From fddeb0040366134bddc7a71d942258eda6bfd23e Mon Sep 17 00:00:00 2001 From: tromey Date: Mon, 29 Jan 2007 22:00:30 +0000 Subject: [PATCH 1/1] * interpret.cc (run_debug): Remove comment. (STOREA): Reformat. (STOREI): Likewise. (STOREF): Likewise. (STOREL): Likewise. (STORED): Likewise. (POKEI): Likewise. (run_normal_debug): Likewise. (run_synch_object_debug): Likewise. (run_class_debug): Likewise. (run_synch_class_debug): Likewise. (get1s): Likewise. (get1u): Likewise. (get2u): Likewise. (get4): Likewise. (NULLARRAYCHECK): Likewise. (ARRAYBOUNDSCHECK): Likewise. * interpret-run.cc (insn_target) : Tidy. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121313 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/ChangeLog | 21 ++++++ libjava/interpret-run.cc | 2 +- libjava/interpret.cc | 178 ++++++++++++++++++++++++----------------------- 3 files changed, 114 insertions(+), 87 deletions(-) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 5cf2d870809..20e91fdb1fd 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,5 +1,26 @@ 2007-01-29 Tom Tromey + * interpret.cc (run_debug): Remove comment. + (STOREA): Reformat. + (STOREI): Likewise. + (STOREF): Likewise. + (STOREL): Likewise. + (STORED): Likewise. + (POKEI): Likewise. + (run_normal_debug): Likewise. + (run_synch_object_debug): Likewise. + (run_class_debug): Likewise. + (run_synch_class_debug): Likewise. + (get1s): Likewise. + (get1u): Likewise. + (get2u): Likewise. + (get4): Likewise. + (NULLARRAYCHECK): Likewise. + (ARRAYBOUNDSCHECK): Likewise. + * interpret-run.cc (insn_target) : Tidy. + +2007-01-29 Tom Tromey + * configure, Makefile.in: Rebuilt. * Makefile.am (bin_SCRIPTS): Never install scripts/jar. * configure.ac (BASH_JAR): Removed conditional. diff --git a/libjava/interpret-run.cc b/libjava/interpret-run.cc index 95037903810..f3687459cb4 100644 --- a/libjava/interpret-run.cc +++ b/libjava/interpret-run.cc @@ -217,7 +217,7 @@ details. */ INSN_LABEL(invokespecial), INSN_LABEL(invokestatic), INSN_LABEL(invokeinterface), - INSN_LABEL (breakpoint), + INSN_LABEL(breakpoint), INSN_LABEL(new), INSN_LABEL(newarray), INSN_LABEL(anewarray), diff --git a/libjava/interpret.cc b/libjava/interpret.cc index 075a15a22db..7e694a392a1 100644 --- a/libjava/interpret.cc +++ b/libjava/interpret.cc @@ -171,54 +171,56 @@ convert (FROM val, TO min, TO max) # define LOADD(I) LOADL(I) #endif -#define STOREA(I) \ -do { \ -DEBUG_LOCALS_INSN(I, 'o'); \ -locals[I].o = (--sp)->o; \ -} while(0) -#define STOREI(I) \ -do { \ -DEBUG_LOCALS_INSN (I, 'i'); \ -locals[I].i = (--sp)->i; \ -} while(0) -#define STOREF(I) \ -do { \ -DEBUG_LOCALS_INSN (I, 'f'); \ -locals[I].f = (--sp)->f; \ -} while(0) +#define STOREA(I) \ + do { \ + DEBUG_LOCALS_INSN (I, 'o'); \ + locals[I].o = (--sp)->o; \ + } while (0) +#define STOREI(I) \ + do { \ + DEBUG_LOCALS_INSN (I, 'i'); \ + locals[I].i = (--sp)->i; \ + } while (0) +#define STOREF(I) \ + do { \ + DEBUG_LOCALS_INSN (I, 'f'); \ + locals[I].f = (--sp)->f; \ + } while (0) #if SIZEOF_VOID_P == 8 -# define STOREL(I) \ -do { \ -DEBUG_LOCALS_INSN (I, 'l'); \ -(sp -= 2, locals[I].l = sp->l); \ -} while(0) +# define STOREL(I) \ + do { \ + DEBUG_LOCALS_INSN (I, 'l'); \ + (sp -= 2, locals[I].l = sp->l); \ + } while (0) # define STORED(I) \ -do { \ -DEBUG_LOCALS_INSN (I, 'd'); \ -(sp -= 2, locals[I].d = sp->d); \ -} while(0) + do { \ + DEBUG_LOCALS_INSN (I, 'd'); \ + (sp -= 2, locals[I].d = sp->d); \ + } while (0) #else -# define STOREL(I) \ -do { DEBUG_LOCALS_INSN(I, 'l'); \ - jint __idx = (I); \ - locals[__idx+1].ia[0] = (--sp)->ia[0]; \ - locals[__idx].ia[0] = (--sp)->ia[0]; \ - } while (0) -# define STORED(I) \ -do { DEBUG_LOCALS_INSN(I, 'd'); \ - jint __idx = (I); \ - locals[__idx+1].ia[0] = (--sp)->ia[0]; \ - locals[__idx].ia[0] = (--sp)->ia[0]; \ - } while (0) +# define STOREL(I) \ + do { \ + DEBUG_LOCALS_INSN (I, 'l'); \ + jint __idx = (I); \ + locals[__idx+1].ia[0] = (--sp)->ia[0]; \ + locals[__idx].ia[0] = (--sp)->ia[0]; \ + } while (0) +# define STORED(I) \ + do { \ + DEBUG_LOCALS_INSN(I, 'd'); \ + jint __idx = (I); \ + locals[__idx+1].ia[0] = (--sp)->ia[0]; \ + locals[__idx].ia[0] = (--sp)->ia[0]; \ + } while (0) #endif #define PEEKI(I) (locals+(I))->i #define PEEKA(I) (locals+(I))->o -#define POKEI(I,V) \ -DEBUG_LOCALS_INSN(I,'i'); \ -((locals+(I))->i = (V)) +#define POKEI(I,V) \ + DEBUG_LOCALS_INSN(I,'i'); \ + ((locals+(I))->i = (V)) #define BINOPI(OP) { \ @@ -245,23 +247,33 @@ DEBUG_LOCALS_INSN(I,'i'); \ PUSHD(value1 OP value2); \ } -static inline jint get1s(unsigned char* loc) { +static inline jint +get1s (unsigned char* loc) +{ return *(signed char*)loc; } -static inline jint get1u(unsigned char* loc) { +static inline jint +get1u (unsigned char* loc) +{ return *loc; } -static inline jint get2s(unsigned char* loc) { +static inline jint +get2s(unsigned char* loc) +{ return (((jint)*(signed char*)loc) << 8) | ((jint)*(loc+1)); } -static inline jint get2u(unsigned char* loc) { +static inline jint +get2u (unsigned char* loc) +{ return (((jint)(*loc)) << 8) | ((jint)*(loc+1)); } -static jint get4(unsigned char* loc) { +static jint +get4 (unsigned char* loc) +{ return (((jint)(loc[0])) << 24) | (((jint)(loc[1])) << 16) | (((jint)(loc[2])) << 8) @@ -284,23 +296,26 @@ static jint get4(unsigned char* loc) { #ifdef HANDLE_SEGV #define NULLARRAYCHECK(X) SAVE_PC() #else -#define NULLARRAYCHECK(X) \ - do { SAVE_PC(); if ((X)==NULL) { throw_null_pointer_exception (); } } while (0) +#define NULLARRAYCHECK(X) \ + do \ + { \ + SAVE_PC(); \ + if ((X) == NULL) { throw_null_pointer_exception (); } \ + } while (0) #endif -#define ARRAYBOUNDSCHECK(array, index) \ - do \ - { \ - if (((unsigned) index) >= (unsigned) (array->length)) \ - _Jv_ThrowBadArrayIndex (index); \ - } \ - while (0) +#define ARRAYBOUNDSCHECK(array, index) \ + do \ + { \ + if (((unsigned) index) >= (unsigned) (array->length)) \ + _Jv_ThrowBadArrayIndex (index); \ + } while (0) void _Jv_InterpMethod::run_normal (ffi_cif *, - void* ret, - ffi_raw * args, - void* __this) + void *ret, + ffi_raw *args, + void *__this) { _Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this; run (ret, args, _this); @@ -308,9 +323,9 @@ _Jv_InterpMethod::run_normal (ffi_cif *, void _Jv_InterpMethod::run_normal_debug (ffi_cif *, - void* ret, - ffi_raw * args, - void* __this) + void *ret, + ffi_raw *args, + void *__this) { _Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this; run_debug (ret, args, _this); @@ -318,9 +333,9 @@ _Jv_InterpMethod::run_normal_debug (ffi_cif *, void _Jv_InterpMethod::run_synch_object (ffi_cif *, - void* ret, - ffi_raw * args, - void* __this) + void *ret, + ffi_raw *args, + void *__this) { _Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this; @@ -332,9 +347,9 @@ _Jv_InterpMethod::run_synch_object (ffi_cif *, void _Jv_InterpMethod::run_synch_object_debug (ffi_cif *, - void* ret, - ffi_raw * args, - void* __this) + void *ret, + ffi_raw *args, + void *__this) { _Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this; @@ -346,9 +361,9 @@ _Jv_InterpMethod::run_synch_object_debug (ffi_cif *, void _Jv_InterpMethod::run_class (ffi_cif *, - void* ret, - ffi_raw * args, - void* __this) + void *ret, + ffi_raw *args, + void *__this) { _Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this; _Jv_InitClass (_this->defining_class); @@ -357,9 +372,9 @@ _Jv_InterpMethod::run_class (ffi_cif *, void _Jv_InterpMethod::run_class_debug (ffi_cif *, - void* ret, - ffi_raw * args, - void* __this) + void *ret, + ffi_raw *args, + void *__this) { _Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this; _Jv_InitClass (_this->defining_class); @@ -368,9 +383,9 @@ _Jv_InterpMethod::run_class_debug (ffi_cif *, void _Jv_InterpMethod::run_synch_class (ffi_cif *, - void* ret, - ffi_raw * args, - void* __this) + void *ret, + ffi_raw *args, + void *__this) { _Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this; @@ -383,9 +398,9 @@ _Jv_InterpMethod::run_synch_class (ffi_cif *, void _Jv_InterpMethod::run_synch_class_debug (ffi_cif *, - void* ret, - ffi_raw * args, - void* __this) + void *ret, + ffi_raw *args, + void *__this) { _Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this; @@ -921,15 +936,6 @@ _Jv_InterpMethod::run (void *retp, ffi_raw *args, _Jv_InterpMethod *meth) void _Jv_InterpMethod::run_debug (void *retp, ffi_raw *args, _Jv_InterpMethod *meth) { -/* Used to keep track of local variable type - * - * Possible Types: - * o object - * i integer - * f float - * l long - * d double - */ #define DEBUG #undef DEBUG_LOCALS_INSN #define DEBUG_LOCALS_INSN(s, t) do {} while(0) -- 2.11.0