using namespace java::util;
using namespace gnu::gcj::runtime;
-struct _Jv_FindCallingClassState: _Jv_UnwindState
-{
- jclass result;
-};
-
// Maps ncode values to their containing native class.
// NOTE: Currently this Map contradicts class GC for native classes. This map
// (and the "new class stack") will need to use WeakReferences in order to
// the java code and not the interpreter itself. This assumes a 1:1
// correspondance between call frames in the interpreted stack and occurances
// of _Jv_InterpMethod::run() on the native stack.
+#ifdef INTERPRETER
if (func_addr == (_Unwind_Ptr) &_Jv_InterpMethod::run)
{
state->frames[pos].type = frame_interpreter;
state->interp_frame = state->interp_frame->next;
}
else
+#endif
{
state->frames[pos].type = frame_native;
state->frames[pos].ip = (void *) _Unwind_GetIP (context);
_Jv_StackTrace::getLineNumberForFrame(_Jv_StackFrame *frame, NameFinder *finder,
jstring *sourceFileName, jint *lineNum)
{
+#ifdef INTERPRETER
if (frame->type == frame_interpreter)
{
_Jv_InterpMethod *interp_meth = frame->interp.meth;
*lineNum = interp_meth->get_source_line(frame->interp.pc);
return;
}
+#endif
// Use dladdr() to determine in which binary the address IP resides.
#if defined (HAVE_DLFCN_H) && defined (HAVE_DLADDR)
extern char **_Jv_argv;
}
}
}
+#ifdef INTERPRETER
else if (frame->type == frame_interpreter)
{
_Jv_InterpMethod *interp_meth = frame->interp.meth;
klass = interp_meth->defining_class;
meth = interp_meth->self;
}
+#endif
else
JvFail ("Unknown frame type");
_Jv_StackFrame *frame = &state.frames[i];
FillInFrameInfo (frame);
- if (seen_checkClass
- && frame->klass
- && frame->klass != checkClass)
+ if (seen_checkClass)
{
- jframe_count++;
- if (start_pos == -1)
- start_pos = i;
+ if (frame->klass)
+ {
+ jframe_count++;
+ if (start_pos == -1)
+ start_pos = i;
+ }
}
-
- if (!seen_checkClass
- && frame->klass
- && frame->klass == checkClass)
- seen_checkClass = true;
+ else
+ seen_checkClass = frame->klass == checkClass;
}
result = (JArray<jclass> *) _Jv_NewObjectArray (jframe_count, &Class::class$, NULL);
int pos = 0;
if (frame->klass)
{
classLoader = frame->klass->getClassLoaderInternal();
+#ifdef INTERPRETER
if (classLoader != NULL && classLoader != ClassLoader::systemClassLoader)
{
state->trace_data = (void *) classLoader;
return _URC_NORMAL_STOP;
}
+#endif
}
return _URC_NO_REASON;