summaryrefslogtreecommitdiff
path: root/libjava/interpret.cc
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2002-08-29 17:53:28 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2002-08-29 17:53:28 +0000
commit3196bed74979360646cbc8418db5c86c0527ced4 (patch)
tree538202560a3a2f376b6fb55ee3b836b195f01e73 /libjava/interpret.cc
parent1153c2dcea1d760a4e4503c103995e48d5399800 (diff)
downloadgcc-3196bed74979360646cbc8418db5c86c0527ced4.tar.gz
* include/jvm.h (struct _Jv_frame_info): New structure.
* gnu/gcj/runtime/natNameFinder.cc: Include StringBuffer.h, java-interp.h. (lookupInterp): New method. (getAddrAsString): Use _Jv_frame_info. (dladdrLookup): Likewise. * gnu/gcj/runtime/NameFinder.java (lookup): Try to look up interpreted frame. (lookupInterp): Declare. * java/lang/natVMThrowable.cc: Include Thread.h, java-interp.h. (fillInStackTrace): Collect information on interpreted frames. Use _Jv_frame_info. * interpret.cc: Include Thread.h. (run): Create and push _Jv_MethodChain object. (_Jv_EndOfInterpreter): New global. * java/lang/Thread.java (interp_frame): New field. * include/java-interp.h (struct _Jv_MethodChain): New structure. Include NameFinder.h. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@56657 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/interpret.cc')
-rw-r--r--libjava/interpret.cc26
1 files changed, 25 insertions, 1 deletions
diff --git a/libjava/interpret.cc b/libjava/interpret.cc
index e5c40cff150..d231387dc9a 100644
--- a/libjava/interpret.cc
+++ b/libjava/interpret.cc
@@ -22,7 +22,6 @@ details. */
#include <jvm.h>
#include <java-cpool.h>
#include <java-interp.h>
-// #include <java/lang/fdlibm.h>
#include <java/lang/System.h>
#include <java/lang/String.h>
#include <java/lang/Integer.h>
@@ -36,6 +35,7 @@ details. */
#include <java/lang/NullPointerException.h>
#include <java/lang/ArithmeticException.h>
#include <java/lang/IncompatibleClassChangeError.h>
+#include <java/lang/Thread.h>
#include <java-insns.h>
#include <java-signal.h>
@@ -744,11 +744,28 @@ _Jv_InterpMethod::compile (const void * const *insn_targets)
}
#endif /* DIRECT_THREADED */
+// This function exists so that the stack-tracing code can find the
+// boundaries of the interpreter.
+void
+_Jv_StartOfInterpreter (void)
+{
+}
+
void
_Jv_InterpMethod::run (void *retp, ffi_raw *args)
{
using namespace java::lang::reflect;
+ // FRAME_DESC registers this particular invocation as the top-most
+ // interpreter frame. This lets the stack tracing code (for
+ // Throwable) print information about the method being interpreted
+ // rather than about the interpreter itself. FRAME_DESC has a
+ // destructor so it cleans up automatically when the interpreter
+ // returns.
+ java::lang::Thread *thread = java::lang::Thread::currentThread();
+ _Jv_MethodChain frame_desc (this,
+ (_Jv_MethodChain **) &thread->interp_frame);
+
_Jv_word stack[max_stack];
_Jv_word *sp = stack;
@@ -3169,6 +3186,13 @@ _Jv_InterpMethod::run (void *retp, ffi_raw *args)
}
}
+// This function exists so that the stack-tracing code can find the
+// boundaries of the interpreter.
+void
+_Jv_EndOfInterpreter (void)
+{
+}
+
static void
throw_internal_error (char *msg)
{