summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2016-06-09 12:38:42 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2016-06-09 12:38:42 +0000
commit08f746d4a54dd4766f4be2d405f5f26784c6bd7c (patch)
tree5c84a6ad50db3d232e246abb727a79acc9d6e263
parent172abeb725a8acbd0c2c0130bbbd75749650218c (diff)
parentadc61dfdedec5440ae4e51361a70718af4714123 (diff)
Merge "Ensure we have a profiling info object before trying to compile."
-rw-r--r--test/604-hot-static-interface/hot_static_interface.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/604-hot-static-interface/hot_static_interface.cc b/test/604-hot-static-interface/hot_static_interface.cc
index 9074a0a18c..475a11d351 100644
--- a/test/604-hot-static-interface/hot_static_interface.cc
+++ b/test/604-hot-static-interface/hot_static_interface.cc
@@ -17,6 +17,7 @@
#include "art_method.h"
#include "jit/jit.h"
#include "jit/jit_code_cache.h"
+#include "jit/profiling_info.h"
#include "oat_quick_method_header.h"
#include "scoped_thread_state_change.h"
#include "ScopedUtfChars.h"
@@ -43,6 +44,8 @@ extern "C" JNIEXPORT void JNICALL Java_Main_waitUntilJitted(JNIEnv* env,
jit::JitCodeCache* code_cache = jit->GetCodeCache();
OatQuickMethodHeader* header = nullptr;
+ // Make sure there is a profiling info, required by the compiler.
+ ProfilingInfo::Create(soa.Self(), method, /* retry_allocation */ true);
while (true) {
header = OatQuickMethodHeader::FromEntryPoint(method->GetEntryPointFromQuickCompiledCode());
if (code_cache->ContainsPc(header->GetCode())) {
@@ -51,7 +54,7 @@ extern "C" JNIEXPORT void JNICALL Java_Main_waitUntilJitted(JNIEnv* env,
// Sleep to yield to the compiler thread.
usleep(1000);
// Will either ensure it's compiled or do the compilation itself.
- jit->CompileMethod(method, Thread::Current(), /* osr */ false);
+ jit->CompileMethod(method, soa.Self(), /* osr */ false);
}
}
}