Add marks for instrumentation frames that get interpreted.
During instrumentation, if a method goes to the interpreter, a special callee-
save ref and args method frame is pushed onto the stack, instead of a frame for
the method being called. This change adds a bool to mark methods that end up
interpreted, so things that walk the stack know to look for the callee-save
method instead.
Also included is a change to UnsafeLogFatalForThreadSuspendAllTimeout to prevent
it from grabbing locks before dumping. This was breaking DumpLocked, which
eventually gets a ScopedObjectAccessUnchecked requiring those locks not be held.
Change-Id: I7e68cf195c77f40df6f497551c94b0926d3c5065
diff --git a/src/stack.cc b/src/stack.cc
index 8672975..fcd0f2d 100644
--- a/src/stack.cc
+++ b/src/stack.cc
@@ -310,7 +310,12 @@
instrumentation::InstrumentationStackFrame instrumentation_frame =
GetInstrumentationStackFrame(instrumentation_stack_depth);
instrumentation_stack_depth++;
- if (instrumentation_frame.method_ != GetMethod()) {
+ if (instrumentation_frame.interpreter_entry_) {
+ mirror::AbstractMethod* callee = Runtime::Current()->GetCalleeSaveMethod(Runtime::kRefsAndArgs);
+ if (GetMethod() != callee) {
+ LOG(FATAL) << "Expected: " << callee << " Found: " << PrettyMethod(GetMethod());
+ }
+ } else if (instrumentation_frame.method_ != GetMethod()) {
LOG(FATAL) << "Expected: " << PrettyMethod(instrumentation_frame.method_)
<< " Found: " << PrettyMethod(GetMethod());
}