From 4493f92dfc70e01d95ad57bc4c0c38f59a616f70 Mon Sep 17 00:00:00 2001 From: Alex Light Date: Fri, 10 Feb 2017 16:33:26 +0000 Subject: Revert "Revert "Make class redefinition work with native methods on stack."" When we were scanning the stack for tracing we were getting the wrong stack-frame size for obsolete native methods. This fixes it by creating real obsolete native methods so we can recognize them and then doing the (rather long) calculation to find their real stack-frame size. This reverts commit 7558d27ccd0837fef7c4bfbff7fc82f07a787316. Reason for revert: Fixed tracing failures. Test: mma -j40 test-art-host Test: ART_TEST_TRACE=true ART_TEST_INTERPRETER=true mma -j40 test-art-host Change-Id: Ic65da1b51a43733ff60131832753afa0c4ce66b1 --- runtime/stack.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'runtime/stack.cc') diff --git a/runtime/stack.cc b/runtime/stack.cc index d7ba1d75d8..96fc664584 100644 --- a/runtime/stack.cc +++ b/runtime/stack.cc @@ -874,9 +874,11 @@ void StackVisitor::WalkStack(bool include_transitions) { CHECK_EQ(GetMethod(), callee) << "Expected: " << ArtMethod::PrettyMethod(callee) << " Found: " << ArtMethod::PrettyMethod(GetMethod()); } else { - CHECK_EQ(instrumentation_frame.method_, GetMethod()) + // Instrumentation generally doesn't distinguish between a method's obsolete and + // non-obsolete version. + CHECK_EQ(instrumentation_frame.method_, GetMethod()->GetNonObsoleteMethod()) << "Expected: " << ArtMethod::PrettyMethod(instrumentation_frame.method_) - << " Found: " << ArtMethod::PrettyMethod(GetMethod()); + << " Found: " << ArtMethod::PrettyMethod(GetMethod()->GetNonObsoleteMethod()); } if (num_frames_ != 0) { // Check agreement of frame Ids only if num_frames_ is computed to avoid infinite @@ -903,7 +905,7 @@ void StackVisitor::WalkStack(bool include_transitions) { << " native=" << method->IsNative() << std::noboolalpha << " entrypoints=" << method->GetEntryPointFromQuickCompiledCode() - << "," << method->GetEntryPointFromJni() + << "," << (method->IsNative() ? method->GetEntryPointFromJni() : nullptr) << " next=" << *cur_quick_frame_; } -- cgit v1.2.3-59-g8ed1b