summaryrefslogtreecommitdiff
path: root/libjava/interpret.cc
diff options
context:
space:
mode:
authorkseitz <kseitz@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-14 20:11:12 +0000
committerkseitz <kseitz@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-14 20:11:12 +0000
commit957ad449a65ba4b5bd771e22629fa94e6ffbe7a1 (patch)
treee1e9bbc74493dff5ebbd6ee844018c6a7cb62049 /libjava/interpret.cc
parentf63d9bf40b68693a6303fd01ede782011ed2b69c (diff)
downloadgcc-957ad449a65ba4b5bd771e22629fa94e6ffbe7a1.tar.gz
* include/java-insns.h (enum java_code): Add op_breakpoint.
* include/java-interp.h (_Jv_InterpMethod): Declare breakpoint_insn. [INTERPRETER]: Declare _Jv_InterpMethod::bp_insn_slot. [!INTERPRETER]: Declare _Jv_InterpMethod::bp_insn_opcode. (install_break): Declare. * interpret.cc (breakpoint_insn): Define breakpoint insn. (compile): Add op_breakpoint to "can't happen" cases. [INTERPRETER] Initialize breakpoint insn if necessary. (install_break): New method. * interpret-run.cc: Add op_breakpoint to insn_targets. Add insn_breakpoint label. * verify.cc (branch_prepass): Add op_breakpoint to unrecognized opcodes section of switch statement. (verify_instructions_0): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117734 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/interpret.cc')
-rw-r--r--libjava/interpret.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/libjava/interpret.cc b/libjava/interpret.cc
index b5c83871b5f..4b3725855f6 100644
--- a/libjava/interpret.cc
+++ b/libjava/interpret.cc
@@ -75,6 +75,18 @@ _Jv_InitInterpreter()
void _Jv_InitInterpreter() {}
#endif
+// The breakpoint instruction. For the direct threaded case,
+// _Jv_InterpMethod::compile will initialize breakpoint_insn
+// the first time it is called.
+#ifdef DIRECT_THREADED
+insn_slot _Jv_InterpMethod::bp_insn_slot;
+pc_t _Jv_InterpMethod::breakpoint_insn = NULL;
+#else
+unsigned char _Jv_InterpMethod::bp_insn_opcode
+ = static_cast<unsigned char> (op_breakpoint);
+pc_t _Jv_InterpMethod::breakpoint_insn = &_Jv_InterpMethod::bp_insn_opcode;
+#endif
+
extern "C" double __ieee754_fmod (double,double);
static inline void dupx (_Jv_word *sp, int n, int x)
@@ -844,6 +856,7 @@ _Jv_InterpMethod::compile (const void * const *insn_targets)
case op_getstatic_4:
case op_getstatic_8:
case op_getstatic_a:
+ case op_breakpoint:
default:
// Fail somehow.
break;
@@ -879,6 +892,12 @@ _Jv_InterpMethod::compile (const void * const *insn_targets)
}
prepared = insns;
+
+ if (breakpoint_insn == NULL)
+ {
+ bp_insn_slot.insn = const_cast<void *> (insn_targets[op_breakpoint]);
+ breakpoint_insn = &bp_insn_slot;
+ }
}
#endif /* DIRECT_THREADED */
@@ -1385,6 +1404,12 @@ _Jv_InterpMethod::get_line_table (jlong& start, jlong& end,
}
pc_t
+_Jv_InterpMethod::install_break (jlong index)
+{
+ return set_insn (index, breakpoint_insn);
+}
+
+pc_t
_Jv_InterpMethod::get_insn (jlong index)
{
pc_t code;