diff options
author | Tom Tromey <tromey@redhat.com> | 2002-08-29 17:53:28 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2002-08-29 17:53:28 +0000 |
commit | 3308c46e47a0b17d37b4c29a130e6519c424a737 (patch) | |
tree | 538202560a3a2f376b6fb55ee3b836b195f01e73 /libjava/interpret.cc | |
parent | ce4e997039ab374d5d1719b02aae3ded0a2a8ec4 (diff) | |
download | gcc-3308c46e47a0b17d37b4c29a130e6519c424a737.zip gcc-3308c46e47a0b17d37b4c29a130e6519c424a737.tar.gz gcc-3308c46e47a0b17d37b4c29a130e6519c424a737.tar.bz2 |
jvm.h (struct _Jv_frame_info): New structure.
* 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.
From-SVN: r56657
Diffstat (limited to 'libjava/interpret.cc')
-rw-r--r-- | libjava/interpret.cc | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/libjava/interpret.cc b/libjava/interpret.cc index e5c40cf..d231387 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) { |