Fix typo in condition for getting the compiled code.
Due to a late refactor we unintentionally flipped a condition and
returned early on code-collection being off instead of it being on.
Test: ./test.py --host --trace --ntrace
Test: ./test/testrunner/testrunner.py --host --runtime-option=-Xjitthreshold:0 --jit
Test: ./test/testrunner/testrunner.py --host --jit --debug --runtime-option=-Xplugin:libtracefast-trampolined.so
Test: ./test/testrunner/testrunner.py --host --jit --debug --runtime-option=-Xjitthreshold:0 --runtime-option=-Xplugin:libtracefast-trampolined.so
Test: ./test/testrunner/testrunner.py --host --debuggable --run-test-option='--with-agent libtifast.so=MethodEntry,MethodExit'
Test: ./test/testrunner/testrunner.py --host --debuggable --jit --runtime-option=-Xjitthreshold:0 --run-test-option='--with-agent libtifast.so=MethodEntry,MethodExit'
Test: adb shell am start-activity -S --attach-agent /data/local/tmp/libtifast.so=MethodEntry,MethodExit <some app>
Test: ./test/testrunner/testrunner.py --host --runtime-option=-Xplugin:libtracefast-trampolined.so
Change-Id: I2f341cf748530f79a574933a3abb4f32a5019d03
diff --git a/runtime/jit/jit_code_cache.cc b/runtime/jit/jit_code_cache.cc
index 86582ef..70a7171 100644
--- a/runtime/jit/jit_code_cache.cc
+++ b/runtime/jit/jit_code_cache.cc
@@ -378,7 +378,9 @@
}
const void* JitCodeCache::FindCompiledCodeForInstrumentation(ArtMethod* method) {
- if (LIKELY(!GetGarbageCollectCode())) {
+ // If jit-gc is still on we use the SavedEntryPoint field for doing that and so cannot use it to
+ // find the instrumentation entrypoint.
+ if (LIKELY(GetGarbageCollectCode())) {
return nullptr;
}
ProfilingInfo* info = method->GetProfilingInfo(kRuntimePointerSize);