+// Return the class of the method that contains PC.
+// This is a macro not a function, since defining it as one would
+// introduce an extra frame on the stack. */
+#define GET_CALLING_CLASS(PC) \
+({ \
+ void *f = _Unwind_FindEnclosingFunction (PC); \
+ \
+ /* FIXME: it might well be a good idea to cache pc values here in \
+ order to avoid repeated invocations of \
+ _Unwind_FindEnclosingFunction, which is quite expensive. On the \
+ other hand, which not simply write a caching version of \
+ _Unwind_FindEnclosingFunction itself? That would probably be \
+ worthwhile. */ \
+ \
+ _Jv_StackTrace::UpdateNCodeMap (); \
+ jclass klass = (jclass) _Jv_StackTrace::ncodeMap->get ((jobject) f); \
+ \
+ /* If the caller is a compiled frame and the caller of the caller is \
+ an interpreted frame then klass will be null and we need to \
+ unwind the stack. */ \
+ if (!klass) \
+ klass = _Jv_StackTrace::GetStackWalkerCallingClass (); \
+ \
+ klass; \
+ })
+