summaryrefslogtreecommitdiff
path: root/libjava/interpret.cc
diff options
context:
space:
mode:
authoraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-14 15:21:13 +0000
committeraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-14 15:21:13 +0000
commit8caa0aa0a0b4071cf4d9dd58838556e8a594ba0f (patch)
treef9e1b10a90a60b5918f10b2519f9520b57f64915 /libjava/interpret.cc
parent1624d332ede20a2e626441ef12a674154501cb36 (diff)
downloadgcc-8caa0aa0a0b4071cf4d9dd58838556e8a594ba0f.tar.gz
2004-10-13 Andrew Haley <aph@redhat.com>
* interpret.cc (_Jv_InterpMethod::run): Initialize _Jv_StartOfInterpreter. (_Jv_StartOfInterpreter, _Jv_EndOfInterpreter): Functions removed. (_Jv_StartOfInterpreter, _Jv_EndOfInterpreter): New variables. * gnu/gcj/runtime/natStackTrace.cc (fillInStackTrace): Use _Unwind_FindEnclosingFunction to discover whether PC is within the interpreter. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@89037 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/interpret.cc')
-rw-r--r--libjava/interpret.cc26
1 files changed, 13 insertions, 13 deletions
diff --git a/libjava/interpret.cc b/libjava/interpret.cc
index 109ee10ff8b..0446c729623 100644
--- a/libjava/interpret.cc
+++ b/libjava/interpret.cc
@@ -774,18 +774,25 @@ _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)
-{
-}
+// These exist so that the stack-tracing code can find the boundaries
+// of the interpreter.
+void *_Jv_StartOfInterpreter;
+void *_Jv_EndOfInterpreter;
+extern "C" void *_Unwind_FindEnclosingFunction (void *pc);
void
_Jv_InterpMethod::run (void *retp, ffi_raw *args)
{
using namespace java::lang::reflect;
+ // Record the address of the start of this member function in
+ // _Jv_StartOfInterpreter. Such a write to a global variable
+ // without acquiring a lock is correct iff reads and writes of words
+ // in memory are atomic, but Java requires that anyway.
+ foo:
+ if (_Jv_StartOfInterpreter == NULL)
+ _Jv_StartOfInterpreter = _Unwind_FindEnclosingFunction (&&foo);
+
// 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
@@ -3219,13 +3226,6 @@ _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)
{