summaryrefslogtreecommitdiff
path: root/libjava/interpret.cc
diff options
context:
space:
mode:
authorkseitz <kseitz@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-10 20:15:51 +0000
committerkseitz <kseitz@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-10 20:15:51 +0000
commitb15e90aa9a994748b6ea0a3bf030ca7fc661d2a7 (patch)
tree128c26f6b83c22bf5dbed4b27189a9b690415438 /libjava/interpret.cc
parent7aa7b3527e0518c7a2d1de5a0bd3c6a6ebd2b481 (diff)
downloadgcc-b15e90aa9a994748b6ea0a3bf030ca7fc661d2a7.tar.gz
* include/java-interp.h (_Jv_InterpMethod::get_insn): Declare.
(_Jv_InterpMethod::set_insn): Declare. * interpret.cc (_Jv_InterpMethod::get_insn): New method. (_Jv_InterpMethod::get_insn): New method. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117614 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/interpret.cc')
-rw-r--r--libjava/interpret.cc40
1 files changed, 40 insertions, 0 deletions
diff --git a/libjava/interpret.cc b/libjava/interpret.cc
index 1c4e21e6b76..b5c83871b5f 100644
--- a/libjava/interpret.cc
+++ b/libjava/interpret.cc
@@ -1384,6 +1384,46 @@ _Jv_InterpMethod::get_line_table (jlong& start, jlong& end,
#endif // !DIRECT_THREADED
}
+pc_t
+_Jv_InterpMethod::get_insn (jlong index)
+{
+ pc_t code;
+
+#ifdef DIRECT_THREADED
+ if (index >= number_insn_slots || index < 0)
+ return NULL;
+
+ code = prepared;
+#else // !DIRECT_THREADED
+ if (index >= code_length || index < 0)
+ return NULL;
+
+ code = reinterpret_cast<pc_t> (bytecode ());
+#endif // !DIRECT_THREADED
+
+ return &code[index];
+}
+
+pc_t
+_Jv_InterpMethod::set_insn (jlong index, pc_t insn)
+{
+#ifdef DIRECT_THREADED
+ if (index >= number_insn_slots || index < 0)
+ return NULL;
+
+ pc_t code = prepared;
+ code[index].insn = insn->insn;
+#else // !DIRECT_THREADED
+ if (index >= code_length || index < 0)
+ return NULL;
+
+ pc_t code = reinterpret_cast<pc_t> (bytecode ());
+ code[index] = *insn;
+#endif // !DIRECT_THREADED
+
+ return &code[index];
+}
+
void *
_Jv_JNIMethod::ncode ()
{