Revert^4 "Allow deoptimization when returning from a runtime method."
This reverts commit 07c7028e518b98d3267a77dfe0d149db1adbe858.
Need some special treatment of string init's shorty.
Test: run-test/gtest on both host and target
Test: 597-deopt-busy-loop, 597-deopt-invoke-stub
Bug: 33616143
Change-Id: Id4c64910acfdd088835b6db6fc503e6ade0218e7
diff --git a/runtime/instrumentation_test.cc b/runtime/instrumentation_test.cc
index 7390f4f..1aa4e91 100644
--- a/runtime/instrumentation_test.cc
+++ b/runtime/instrumentation_test.cc
@@ -493,7 +493,23 @@
// Test instrumentation listeners for each event.
TEST_F(InstrumentationTest, MethodEntryEvent) {
- TestEvent(instrumentation::Instrumentation::kMethodEntered);
+ ScopedObjectAccess soa(Thread::Current());
+ jobject class_loader = LoadDex("Instrumentation");
+ Runtime* const runtime = Runtime::Current();
+ ClassLinker* class_linker = runtime->GetClassLinker();
+ StackHandleScope<1> hs(soa.Self());
+ Handle<mirror::ClassLoader> loader(hs.NewHandle(soa.Decode<mirror::ClassLoader>(class_loader)));
+ mirror::Class* klass = class_linker->FindClass(soa.Self(), "LInstrumentation;", loader);
+ ASSERT_TRUE(klass != nullptr);
+ ArtMethod* method =
+ klass->FindClassMethod("returnReference", "()Ljava/lang/Object;", kRuntimePointerSize);
+ ASSERT_TRUE(method != nullptr);
+ ASSERT_TRUE(method->IsDirect());
+ ASSERT_TRUE(method->GetDeclaringClass() == klass);
+ TestEvent(instrumentation::Instrumentation::kMethodEntered,
+ /*event_method*/ method,
+ /*event_field*/ nullptr,
+ /*with_object*/ true);
}
TEST_F(InstrumentationTest, MethodExitObjectEvent) {