diff options
author | kseitz <kseitz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-09-30 19:20:16 +0000 |
---|---|---|
committer | kseitz <kseitz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-09-30 19:20:16 +0000 |
commit | 16ed7fb2c8a7fd227f037804800768994453f6b5 (patch) | |
tree | b484dd0bd0295d212071fc7b2fc86b6422a1732f /libjava/interpret.cc | |
parent | fc2432663bfc27101fdde6bca67055445ed97f05 (diff) | |
download | gcc-16ed7fb2c8a7fd227f037804800768994453f6b5.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117333 138bc75d-0d04-0410-961f-82ee72b054a4
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, |