java-interp.h (prepared): Change type to pc_t.

* 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.

From-SVN: r117333
This commit is contained in:
Keith Seitz
2006-09-30 19:20:16 +00:00
committed by Keith Seitz
parent 05c1e3a7a9
commit 19add4f7e4
4 changed files with 32 additions and 20 deletions
+9 -6
View File
@@ -200,7 +200,7 @@ do { DEBUG_LOCALS_INSN(I, 'd'); \
#define PEEKA(I) (locals+(I))->o
#define POKEI(I,V) \
DEBUG_LOCALS_INSN(I,i) \
DEBUG_LOCALS_INSN(I,'i'); \
((locals+(I))->i = (V))
@@ -1307,23 +1307,27 @@ _Jv_InterpMethod::ncode ()
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;
@@ -1331,7 +1335,6 @@ _Jv_InterpMethod::insn_index (pc_t pc)
return -1;
}
#endif // DIRECT_THREADED
void
_Jv_InterpMethod::get_line_table (jlong& start, jlong& end,