diff options
| author | Keith Seitz <keiths@redhat.com> | 2006-09-30 19:20:16 +0000 |
|---|---|---|
| committer | Keith Seitz <kseitz@gcc.gnu.org> | 2006-09-30 19:20:16 +0000 |
| commit | 19add4f7e416da5706eb0e0a0cbbd980a74f4b86 (patch) | |
| tree | b484dd0bd0295d212071fc7b2fc86b6422a1732f /libjava/interpret.cc | |
| parent | 05c1e3a7a94397c4ce9ef29cefec2eeebc2cdb53 (diff) | |
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
Diffstat (limited to 'libjava/interpret.cc')
| -rw-r--r-- | libjava/interpret.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/libjava/interpret.cc b/libjava/interpret.cc index 22196aa30a1..1c4e21e6b76 100644 --- a/libjava/interpret.cc +++ b/libjava/interpret.cc @@ -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, |
