Commit d75bf843 by Tom Tromey Committed by Tom Tromey

interpret.cc (run_debug): Remove comment.

	* 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) <breakpoint>: Tidy.

From-SVN: r121313
parent a1c06277
2007-01-29 Tom Tromey <tromey@redhat.com> 2007-01-29 Tom Tromey <tromey@redhat.com>
* 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) <breakpoint>: Tidy.
2007-01-29 Tom Tromey <tromey@redhat.com>
* configure, Makefile.in: Rebuilt. * configure, Makefile.in: Rebuilt.
* Makefile.am (bin_SCRIPTS): Never install scripts/jar. * Makefile.am (bin_SCRIPTS): Never install scripts/jar.
* configure.ac (BASH_JAR): Removed conditional. * configure.ac (BASH_JAR): Removed conditional.
......
...@@ -217,7 +217,7 @@ details. */ ...@@ -217,7 +217,7 @@ details. */
INSN_LABEL(invokespecial), INSN_LABEL(invokespecial),
INSN_LABEL(invokestatic), INSN_LABEL(invokestatic),
INSN_LABEL(invokeinterface), INSN_LABEL(invokeinterface),
INSN_LABEL (breakpoint), INSN_LABEL(breakpoint),
INSN_LABEL(new), INSN_LABEL(new),
INSN_LABEL(newarray), INSN_LABEL(newarray),
INSN_LABEL(anewarray), INSN_LABEL(anewarray),
......
...@@ -172,41 +172,43 @@ convert (FROM val, TO min, TO max) ...@@ -172,41 +172,43 @@ convert (FROM val, TO min, TO max)
#endif #endif
#define STOREA(I) \ #define STOREA(I) \
do { \ do { \
DEBUG_LOCALS_INSN(I, 'o'); \ DEBUG_LOCALS_INSN (I, 'o'); \
locals[I].o = (--sp)->o; \ locals[I].o = (--sp)->o; \
} while(0) } while (0)
#define STOREI(I) \ #define STOREI(I) \
do { \ do { \
DEBUG_LOCALS_INSN (I, 'i'); \ DEBUG_LOCALS_INSN (I, 'i'); \
locals[I].i = (--sp)->i; \ locals[I].i = (--sp)->i; \
} while(0) } while (0)
#define STOREF(I) \ #define STOREF(I) \
do { \ do { \
DEBUG_LOCALS_INSN (I, 'f'); \ DEBUG_LOCALS_INSN (I, 'f'); \
locals[I].f = (--sp)->f; \ locals[I].f = (--sp)->f; \
} while(0) } while (0)
#if SIZEOF_VOID_P == 8 #if SIZEOF_VOID_P == 8
# define STOREL(I) \ # define STOREL(I) \
do { \ do { \
DEBUG_LOCALS_INSN (I, 'l'); \ DEBUG_LOCALS_INSN (I, 'l'); \
(sp -= 2, locals[I].l = sp->l); \ (sp -= 2, locals[I].l = sp->l); \
} while(0) } while (0)
# define STORED(I) \ # define STORED(I) \
do { \ do { \
DEBUG_LOCALS_INSN (I, 'd'); \ DEBUG_LOCALS_INSN (I, 'd'); \
(sp -= 2, locals[I].d = sp->d); \ (sp -= 2, locals[I].d = sp->d); \
} while(0) } while (0)
#else #else
# define STOREL(I) \ # define STOREL(I) \
do { DEBUG_LOCALS_INSN(I, 'l'); \ do { \
DEBUG_LOCALS_INSN (I, 'l'); \
jint __idx = (I); \ jint __idx = (I); \
locals[__idx+1].ia[0] = (--sp)->ia[0]; \ locals[__idx+1].ia[0] = (--sp)->ia[0]; \
locals[__idx].ia[0] = (--sp)->ia[0]; \ locals[__idx].ia[0] = (--sp)->ia[0]; \
} while (0) } while (0)
# define STORED(I) \ # define STORED(I) \
do { DEBUG_LOCALS_INSN(I, 'd'); \ do { \
DEBUG_LOCALS_INSN(I, 'd'); \
jint __idx = (I); \ jint __idx = (I); \
locals[__idx+1].ia[0] = (--sp)->ia[0]; \ locals[__idx+1].ia[0] = (--sp)->ia[0]; \
locals[__idx].ia[0] = (--sp)->ia[0]; \ locals[__idx].ia[0] = (--sp)->ia[0]; \
...@@ -217,8 +219,8 @@ do { DEBUG_LOCALS_INSN(I, 'd'); \ ...@@ -217,8 +219,8 @@ do { DEBUG_LOCALS_INSN(I, 'd'); \
#define PEEKA(I) (locals+(I))->o #define PEEKA(I) (locals+(I))->o
#define POKEI(I,V) \ #define POKEI(I,V) \
DEBUG_LOCALS_INSN(I,'i'); \ DEBUG_LOCALS_INSN(I,'i'); \
((locals+(I))->i = (V)) ((locals+(I))->i = (V))
#define BINOPI(OP) { \ #define BINOPI(OP) { \
...@@ -245,23 +247,33 @@ DEBUG_LOCALS_INSN(I,'i'); \ ...@@ -245,23 +247,33 @@ DEBUG_LOCALS_INSN(I,'i'); \
PUSHD(value1 OP value2); \ PUSHD(value1 OP value2); \
} }
static inline jint get1s(unsigned char* loc) { static inline jint
get1s (unsigned char* loc)
{
return *(signed char*)loc; return *(signed char*)loc;
} }
static inline jint get1u(unsigned char* loc) { static inline jint
get1u (unsigned char* loc)
{
return *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)); 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)); return (((jint)(*loc)) << 8) | ((jint)*(loc+1));
} }
static jint get4(unsigned char* loc) { static jint
get4 (unsigned char* loc)
{
return (((jint)(loc[0])) << 24) return (((jint)(loc[0])) << 24)
| (((jint)(loc[1])) << 16) | (((jint)(loc[1])) << 16)
| (((jint)(loc[2])) << 8) | (((jint)(loc[2])) << 8)
...@@ -285,7 +297,11 @@ static jint get4(unsigned char* loc) { ...@@ -285,7 +297,11 @@ static jint get4(unsigned char* loc) {
#define NULLARRAYCHECK(X) SAVE_PC() #define NULLARRAYCHECK(X) SAVE_PC()
#else #else
#define NULLARRAYCHECK(X) \ #define NULLARRAYCHECK(X) \
do { SAVE_PC(); if ((X)==NULL) { throw_null_pointer_exception (); } } while (0) do \
{ \
SAVE_PC(); \
if ((X) == NULL) { throw_null_pointer_exception (); } \
} while (0)
#endif #endif
#define ARRAYBOUNDSCHECK(array, index) \ #define ARRAYBOUNDSCHECK(array, index) \
...@@ -293,14 +309,13 @@ static jint get4(unsigned char* loc) { ...@@ -293,14 +309,13 @@ static jint get4(unsigned char* loc) {
{ \ { \
if (((unsigned) index) >= (unsigned) (array->length)) \ if (((unsigned) index) >= (unsigned) (array->length)) \
_Jv_ThrowBadArrayIndex (index); \ _Jv_ThrowBadArrayIndex (index); \
} \ } while (0)
while (0)
void void
_Jv_InterpMethod::run_normal (ffi_cif *, _Jv_InterpMethod::run_normal (ffi_cif *,
void* ret, void *ret,
ffi_raw * args, ffi_raw *args,
void* __this) void *__this)
{ {
_Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this; _Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this;
run (ret, args, _this); run (ret, args, _this);
...@@ -308,9 +323,9 @@ _Jv_InterpMethod::run_normal (ffi_cif *, ...@@ -308,9 +323,9 @@ _Jv_InterpMethod::run_normal (ffi_cif *,
void void
_Jv_InterpMethod::run_normal_debug (ffi_cif *, _Jv_InterpMethod::run_normal_debug (ffi_cif *,
void* ret, void *ret,
ffi_raw * args, ffi_raw *args,
void* __this) void *__this)
{ {
_Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this; _Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this;
run_debug (ret, args, _this); run_debug (ret, args, _this);
...@@ -318,9 +333,9 @@ _Jv_InterpMethod::run_normal_debug (ffi_cif *, ...@@ -318,9 +333,9 @@ _Jv_InterpMethod::run_normal_debug (ffi_cif *,
void void
_Jv_InterpMethod::run_synch_object (ffi_cif *, _Jv_InterpMethod::run_synch_object (ffi_cif *,
void* ret, void *ret,
ffi_raw * args, ffi_raw *args,
void* __this) void *__this)
{ {
_Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this; _Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this;
...@@ -332,9 +347,9 @@ _Jv_InterpMethod::run_synch_object (ffi_cif *, ...@@ -332,9 +347,9 @@ _Jv_InterpMethod::run_synch_object (ffi_cif *,
void void
_Jv_InterpMethod::run_synch_object_debug (ffi_cif *, _Jv_InterpMethod::run_synch_object_debug (ffi_cif *,
void* ret, void *ret,
ffi_raw * args, ffi_raw *args,
void* __this) void *__this)
{ {
_Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this; _Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this;
...@@ -346,9 +361,9 @@ _Jv_InterpMethod::run_synch_object_debug (ffi_cif *, ...@@ -346,9 +361,9 @@ _Jv_InterpMethod::run_synch_object_debug (ffi_cif *,
void void
_Jv_InterpMethod::run_class (ffi_cif *, _Jv_InterpMethod::run_class (ffi_cif *,
void* ret, void *ret,
ffi_raw * args, ffi_raw *args,
void* __this) void *__this)
{ {
_Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this; _Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this;
_Jv_InitClass (_this->defining_class); _Jv_InitClass (_this->defining_class);
...@@ -357,9 +372,9 @@ _Jv_InterpMethod::run_class (ffi_cif *, ...@@ -357,9 +372,9 @@ _Jv_InterpMethod::run_class (ffi_cif *,
void void
_Jv_InterpMethod::run_class_debug (ffi_cif *, _Jv_InterpMethod::run_class_debug (ffi_cif *,
void* ret, void *ret,
ffi_raw * args, ffi_raw *args,
void* __this) void *__this)
{ {
_Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this; _Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this;
_Jv_InitClass (_this->defining_class); _Jv_InitClass (_this->defining_class);
...@@ -368,9 +383,9 @@ _Jv_InterpMethod::run_class_debug (ffi_cif *, ...@@ -368,9 +383,9 @@ _Jv_InterpMethod::run_class_debug (ffi_cif *,
void void
_Jv_InterpMethod::run_synch_class (ffi_cif *, _Jv_InterpMethod::run_synch_class (ffi_cif *,
void* ret, void *ret,
ffi_raw * args, ffi_raw *args,
void* __this) void *__this)
{ {
_Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this; _Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this;
...@@ -383,9 +398,9 @@ _Jv_InterpMethod::run_synch_class (ffi_cif *, ...@@ -383,9 +398,9 @@ _Jv_InterpMethod::run_synch_class (ffi_cif *,
void void
_Jv_InterpMethod::run_synch_class_debug (ffi_cif *, _Jv_InterpMethod::run_synch_class_debug (ffi_cif *,
void* ret, void *ret,
ffi_raw * args, ffi_raw *args,
void* __this) void *__this)
{ {
_Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this; _Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this;
...@@ -921,15 +936,6 @@ _Jv_InterpMethod::run (void *retp, ffi_raw *args, _Jv_InterpMethod *meth) ...@@ -921,15 +936,6 @@ _Jv_InterpMethod::run (void *retp, ffi_raw *args, _Jv_InterpMethod *meth)
void void
_Jv_InterpMethod::run_debug (void *retp, ffi_raw *args, _Jv_InterpMethod *meth) _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 #define DEBUG
#undef DEBUG_LOCALS_INSN #undef DEBUG_LOCALS_INSN
#define DEBUG_LOCALS_INSN(s, t) do {} while(0) #define DEBUG_LOCALS_INSN(s, t) do {} while(0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment