Reland "Update instrumentation support for non-java debuggable runtimes"
This reverts commit 7cc22bb96e4e05cf63661eed7fd3dda5304bdacc.
Reason for revert: Relanding after a fix for jit-on-first-use failures.
The fix:
1. When shutting down jvmti agent, pause Jit threads and discard all
JITed code.
2. Update the jit compiler options when transitioning the runtime debug
state.
Change-Id: I076098459cc5639f9e87dae620a9297460e729e2
diff --git a/runtime/jit/jit_code_cache.cc b/runtime/jit/jit_code_cache.cc
index 39f165d..ad8cc9a 100644
--- a/runtime/jit/jit_code_cache.cc
+++ b/runtime/jit/jit_code_cache.cc
@@ -1763,6 +1763,18 @@
Runtime::Current()->GetInstrumentation()->InitializeMethodsCode(meth, /*aot_code=*/ nullptr);
}
}
+
+ for (auto it : zygote_map_) {
+ if (it.method == nullptr) {
+ continue;
+ }
+ if (it.method->IsPreCompiled()) {
+ it.method->ClearPreCompiled();
+ }
+ Runtime::Current()->GetInstrumentation()->InitializeMethodsCode(it.method,
+ /*aot_code=*/nullptr);
+ }
+
saved_compiled_methods_map_.clear();
osr_code_map_.clear();
}