Don't disable JIT GC when instrumentation is enabled
Earlier we used to disable GC when there are instrumentation stubs or
the stack is instrumented due to some races in updating the entry
points. This is fixed now and we no longer need to disable JIT GC. The
disabling of the JIT GC wasn't accurate too, we were missing some places
where we don't disable GC (for ex: when instrumenting after the process
has started) which was also causing some DCHECK failures. This CL
updates it to not disable JIT GC even when we have instrumented code
and removes obsolete DCHECKs.
(partial cherry pick from
commit 162d74a1608a46007832470b8245265c576185d5 to remove obsolete DCHECKs)
Bug: 231686121
Test: art/test.py
Change-Id: Ia4e18dcaad1d1ef9de30250ae4e5e52fa259316d
(cherry picked from commit 162d74a1608a46007832470b8245265c576185d5 )
Merged-In: I16bae31c34587f55889769f575c59ec9ed833e0b
diff --git a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
index 898b34d..b6ece4a 100644
--- a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
+++ b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
@@ -1041,18 +1041,7 @@
// This will get the entry point either from the oat file, the JIT or the appropriate bridge
// method if none of those can be found.
result = instrumentation->GetCodeForInvoke(method);
- jit::Jit* jit = Runtime::Current()->GetJit();
DCHECK_NE(result, GetQuickInstrumentationEntryPoint()) << method->PrettyMethod();
- DCHECK(jit == nullptr ||
- // Native methods come through here in Interpreter entrypoints. We might not have
- // disabled jit-gc but that is fine since we won't return jit-code for native methods.
- method->IsNative() ||
- !jit->GetCodeCache()->GetGarbageCollectCode());
- DCHECK(!method->IsNative() ||
- jit == nullptr ||
- !jit->GetCodeCache()->ContainsPc(result))
- << method->PrettyMethod() << " code will jump to possibly cleaned up jit code!";
-
bool interpreter_entry = Runtime::Current()->GetClassLinker()->IsQuickToInterpreterBridge(result);
bool is_static = method->IsStatic();
uint32_t shorty_len;