From 724f77e2fed038d57a3d08fdcf656d703e3473ea Mon Sep 17 00:00:00 2001 From: Alex Light Date: Sat, 11 Feb 2017 00:43:10 +0000 Subject: Revert^4 "Make class redefinition work with native methods on stack." We had a problem where there was a brief period of time where the dex file for an obsolete method could not be obtained. This meant that not all functions of ArtMethod could safely be called, causing some problems. This reverts commit 38c20d4a694eea44a1bd3af32a6a99512c139358. Reason for revert: Fixed issues with interp-ac and relocate-npatchoat Test: ART_TEST_RUN_TEST_RELOCATE_NO_PATCHOAT=true \ ART_TEST_INTERPRETER_ACCESS_CHECKS=true \ mma -j40 test-art-host Change-Id: I04991f3e76813831b6446f97636b6fa404397f36 --- runtime/stack.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'runtime/stack.cc') diff --git a/runtime/stack.cc b/runtime/stack.cc index d7ba1d75d8..51a24e4e01 100644 --- a/runtime/stack.cc +++ b/runtime/stack.cc @@ -874,9 +874,13 @@ 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()) - << "Expected: " << ArtMethod::PrettyMethod(instrumentation_frame.method_) - << " Found: " << ArtMethod::PrettyMethod(GetMethod()); + // Instrumentation generally doesn't distinguish between a method's obsolete and + // non-obsolete version. + CHECK_EQ(instrumentation_frame.method_->GetNonObsoleteMethod(), + GetMethod()->GetNonObsoleteMethod()) + << "Expected: " + << ArtMethod::PrettyMethod(instrumentation_frame.method_->GetNonObsoleteMethod()) + << " 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 +907,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