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
This commit is contained in:
parent
ce4e997039
commit
3308c46e47
8 changed files with 160 additions and 11 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue