Don't disable JIT GC when enabling method tracing
Earlier we used to disable jit GC when enabling method tracing. This was
because instrumentation stubs fetched jit code for the method if it
existed. There could be races where the code was fetched but jit GC
cleared it before the jit code could be invoked (b/110263880). Currently,
JITed code has instrumentation inbuilt and we don't fetch jited code
from instrumentation stub. So we no longer need to disable jit GC.
Bug: 206029744
Bug: 110263880
Test: art/testrunner.py --trace
Change-Id: Ia5b7daa9d05e43add9486abf327dc4390c09ef53
diff --git a/runtime/trace.cc b/runtime/trace.cc
index 08d69f5..93eec3e 100644
--- a/runtime/trace.cc
+++ b/runtime/trace.cc
@@ -393,15 +393,6 @@
// Enable count of allocs if specified in the flags.
bool enable_stats = false;
- if (runtime->GetJit() != nullptr) {
- // TODO b/110263880 It would be better if we didn't need to do this.
- // Since we need to hold the method entrypoint across a suspend to ensure instrumentation
- // hooks are called correctly we have to disable jit-gc to ensure that the entrypoint doesn't
- // go away. Furthermore we need to leave this off permanently since one could get the same
- // effect by causing this to be toggled on and off.
- runtime->GetJit()->GetCodeCache()->SetGarbageCollectCode(false);
- }
-
// Create Trace object.
{
// Suspend JIT here since we are switching runtime to debuggable. Debuggable runtimes cannot use
diff --git a/test/knownfailures.json b/test/knownfailures.json
index 1899ab1..c370aaa 100644
--- a/test/knownfailures.json
+++ b/test/knownfailures.json
@@ -1493,14 +1493,6 @@
"description": ["jit-on-first-use disables jit GC but this test requires jit GC"]
},
{
- "tests": ["667-jit-jni-stub"],
- "variant": "trace",
- "bug": "b/110263880",
- "description": ["tracing disables jit GC. With the new tracing that doesn't use",
- "instrumetnation stubs, we no longer need to do this. Enable this",
- "test after enabling jit GC in tracing configurations."]
- },
- {
"tests": ["445-checker-licm",
"449-checker-bce",
"455-checker-gvn",