+2006-09-30 Keith Seitz <keiths@redhat.com>
+
+ * include/java-interp.h (prepared): Change type to pc_t.
+ (insn_index): Define for both DIRECT_THREADED and bytecode interpreters.
+ * interpret.cc [!DIRECT_THREADED] (POKEI): Fix typo.
+ (insn_index): Implement for bytecode interpreter.
+ * interpret-run.cc [!DIRECT_THREADED] (AVAL1U): Add _Jv_Linker class
+ qualifier to resolve_pool_entry.
+ [!DIRECT_THREADED] (AVAL2U): Likewise.
+ [!DIRECT_THREADED] bytecode() cannot be called without an object.
+ Changed all typos.
+ [!DIRECT_THREADED] Likewise for defining_class.
+
2006-09-26 Jack Howarth <howarth@bromo.med.uc.edu>
PR target/26792:
// class'.
#define AVAL1U() \
({ int index = get1u (pc++); \
- resolve_pool_entry (meth->defining_class, index).o; })
+ _Jv_Linker::resolve_pool_entry (meth->defining_class, index).o; })
#define AVAL2U() \
({ int index = get2u (pc); pc += 2; \
- resolve_pool_entry (meth->defining_class, index).o; })
+ _Jv_Linker::resolve_pool_entry (meth->defining_class, index).o; })
// Note that we don't need to resolve the pool entry here as class
// constants are never wide.
#define AVAL2UP() ({ int index = get2u (pc); pc += 2; &pool_data[index]; })
#define PCVAL(unionval) unionval.i
#define AMPAMP(label) NULL
- pc = bytecode ();
+ pc = meth->bytecode ();
#endif /* DIRECT_THREADED */
pc_t base_pc = pc - 1;
int index = POPI ();
- pc_t base = (pc_t) bytecode ();
+ pc_t base = (pc_t) meth->bytecode ();
while ((pc - base) % 4 != 0)
++pc;
unsigned char *base_pc = pc-1;
int index = POPI();
- unsigned char* base = bytecode ();
+ unsigned char* base = meth->bytecode ();
while ((pc-base) % 4 != 0)
++pc;
#ifdef DIRECT_THREADED
void *logical_pc = (void *) ((insn_slot *) pc - 1);
#else
- int logical_pc = pc - 1 - bytecode ();
+ int logical_pc = pc - 1 - meth->bytecode ();
#endif
_Jv_InterpException *exc = meth->exceptions ();
jclass exc_class = ex->getClass ();
#else
jclass handler = NULL;
if (exc[i].handler_type.i != 0)
- handler = (_Jv_Linker::resolve_pool_entry (defining_class,
- exc[i].handler_type.i)).clazz;
+ handler = (_Jv_Linker::resolve_pool_entry (meth->defining_class,
+ exc[i].handler_type.i)).clazz;
#endif /* DIRECT_THREADED */
if (handler == NULL || handler->isAssignableFrom (exc_class))
#ifdef DIRECT_THREADED
pc = (insn_slot *) exc[i].handler_pc.p;
#else
- pc = bytecode () + exc[i].handler_pc.i;
+ pc = meth->bytecode () + exc[i].handler_pc.i;
#endif /* DIRECT_THREADED */
sp = stack;
sp++->o = ex; // Push exception.
#define PEEKA(I) (locals+(I))->o
#define POKEI(I,V) \
-DEBUG_LOCALS_INSN(I,i) \
+DEBUG_LOCALS_INSN(I,'i'); \
((locals+(I))->i = (V))
return self->ncode;
}
-#ifdef DIRECT_THREADED
/* Find the index of the given insn in the array of insn slots
for this method. Returns -1 if not found. */
jlong
_Jv_InterpMethod::insn_index (pc_t pc)
{
jlong left = 0;
+#ifdef DIRECT_THREADED
jlong right = number_insn_slots;
- insn_slot* slots = reinterpret_cast<insn_slot*> (prepared);
+ pc_t insns = prepared;
+#else
+ jlong right = code_length;
+ pc_t insns = bytecode ();
+#endif
while (right >= 0)
{
jlong mid = (left + right) / 2;
- if (&slots[mid] == pc)
+ if (&insns[mid] == pc)
return mid;
- if (pc < &slots[mid])
+ if (pc < &insns[mid])
right = mid - 1;
else
left = mid + 1;
return -1;
}
-#endif // DIRECT_THREADED
void
_Jv_InterpMethod::get_line_table (jlong& start, jlong& end,