Create empty VerifiedMethod after vdex verification.
The compiler and quicken require the existence of a
VerifiedMethod for compiling a method.
This fixes the regression of not doing any compilation when
passed --input-vdex.
Test: 629-vdex-speed
Change-Id: Ie65578eadd09099df1c1a403d96c15e5da78a901
diff --git a/test/common/runtime_state.cc b/test/common/runtime_state.cc
index 9cfa324..285f3aa 100644
--- a/test/common/runtime_state.cc
+++ b/test/common/runtime_state.cc
@@ -119,6 +119,24 @@
return JNI_TRUE;
}
+extern "C" JNIEXPORT jboolean JNICALL Java_Main_isAotCompiled(JNIEnv* env,
+ jclass,
+ jclass cls,
+ jstring method_name) {
+ Thread* self = Thread::Current();
+ ScopedObjectAccess soa(self);
+ ScopedUtfChars chars(env, method_name);
+ CHECK(chars.c_str() != nullptr);
+ ArtMethod* method = soa.Decode<mirror::Class>(cls)->FindDeclaredDirectMethodByName(
+ chars.c_str(), kRuntimePointerSize);
+ const void* code = method->GetOatMethodQuickCode(kRuntimePointerSize);
+ jit::Jit* jit = Runtime::Current()->GetJit();
+ if (jit != nullptr && jit->GetCodeCache()->ContainsPc(code)) {
+ return true;
+ }
+ return code != nullptr;
+}
+
extern "C" JNIEXPORT void JNICALL Java_Main_ensureJitCompiled(JNIEnv* env,
jclass,
jclass cls,