diff options
| author | 2016-01-29 12:09:43 +0000 | |
|---|---|---|
| committer | 2016-01-29 12:09:43 +0000 | |
| commit | e38a328dfd26424d91a8316bfdfa555250b8a17b (patch) | |
| tree | c6452967cdc8e883a0c66daf4b26063ad1068a66 | |
| parent | 5bd53a97ea29c3addb2753aebc8433f1cb0713aa (diff) | |
| parent | c26f1288aaf9141ac4b2150869f0c594d52dbf36 (diff) | |
Merge "Re-enable test 566-polymorphic-inlining."
| -rw-r--r-- | runtime/jit/jit_code_cache.cc | 9 | ||||
| -rw-r--r-- | test/566-polymorphic-inlining/polymorphic_inline.cc | 20 | ||||
| -rw-r--r-- | test/Android.run-test.mk | 1 |
3 files changed, 17 insertions, 13 deletions
diff --git a/runtime/jit/jit_code_cache.cc b/runtime/jit/jit_code_cache.cc index c6e7fef75a..b0e5fdeeb1 100644 --- a/runtime/jit/jit_code_cache.cc +++ b/runtime/jit/jit_code_cache.cc @@ -738,15 +738,8 @@ bool JitCodeCache::NotifyCompilationOf(ArtMethod* method, Thread* self) { return false; } - // Compiling requires a profiling info object to notify compilation. Create - // one if it hasn't been done before. - ProfilingInfo* info = method->GetProfilingInfo(sizeof(void*)); - if (info == nullptr) { - ProfilingInfo::Create(self, method, /* retry_allocation */ true); - } - MutexLock mu(self, lock_); - info = method->GetProfilingInfo(sizeof(void*)); + ProfilingInfo* info = method->GetProfilingInfo(sizeof(void*)); if (info == nullptr || info->IsMethodBeingCompiled()) { return false; } diff --git a/test/566-polymorphic-inlining/polymorphic_inline.cc b/test/566-polymorphic-inlining/polymorphic_inline.cc index 55eac5c30a..b2934ed163 100644 --- a/test/566-polymorphic-inlining/polymorphic_inline.cc +++ b/test/566-polymorphic-inlining/polymorphic_inline.cc @@ -29,11 +29,18 @@ static void do_checks(jclass cls, const char* method_name) { jit::Jit* jit = Runtime::Current()->GetJit(); jit::JitCodeCache* code_cache = jit->GetCodeCache(); ArtMethod* method = klass->FindDeclaredDirectMethodByName(method_name, sizeof(void*)); - jit->CompileMethod(method, soa.Self()); - OatQuickMethodHeader* header = OatQuickMethodHeader::FromEntryPoint( - method->GetEntryPointFromQuickCompiledCode()); - CHECK(code_cache->ContainsPc(header->GetCode())); + OatQuickMethodHeader* header = nullptr; + // Infinite loop... Test harness will have its own timeout. + while (true) { + header = OatQuickMethodHeader::FromEntryPoint(method->GetEntryPointFromQuickCompiledCode()); + if (code_cache->ContainsPc(header->GetCode())) { + break; + } else { + // sleep one second to give time to the JIT compiler. + sleep(1); + } + } CodeInfo info = header->GetOptimizedCodeInfo(); CHECK(info.HasInlineInfo()); @@ -45,6 +52,11 @@ extern "C" JNIEXPORT void JNICALL Java_Main_ensureJittedAndPolymorphicInline(JNI return; } + if (kIsDebugBuild) { + // A debug build might often compile the methods without profiling informations filled. + return; + } + do_checks(cls, "testInvokeVirtual"); do_checks(cls, "testInvokeInterface"); } diff --git a/test/Android.run-test.mk b/test/Android.run-test.mk index ab35ea1fe7..7400248952 100644 --- a/test/Android.run-test.mk +++ b/test/Android.run-test.mk @@ -445,7 +445,6 @@ TEST_ART_BROKEN_INTERPRETER_RUN_TESTS := # CFI unwinding expects managed frames, and the test does not iterate enough to even compile. JIT # also uses Generic JNI instead of the JNI compiler. TEST_ART_BROKEN_JIT_RUN_TESTS := \ - 566-polymorphic-inlining \ 137-cfi ifneq (,$(filter jit,$(COMPILER_TYPES))) |