summaryrefslogtreecommitdiff
path: root/compiler/optimizing/optimizing_compiler.cc
diff options
context:
space:
mode:
author Mythri Alle <mythria@google.com> 2021-11-09 10:17:46 +0000
committer Mythri Alle <mythria@google.com> 2021-11-17 11:11:36 +0000
commitbd95682d8a3ddb6f5e2ce1563d25e52ba2d823d7 (patch)
tree70b15fd1138db00fee4174260dc1eb06e4f867ce /compiler/optimizing/optimizing_compiler.cc
parent83c38e2801699266cbed62f407681b4ef50eeba9 (diff)
Support calling entry / exit hooks from JIT code for non-debuggable
This CL extends the support to call entry / exit hooks directly from JITed code for non-debuggable mode. This is done as a best effort and we won't call method exit hooks for the methods that are already on the stack when method tracing is enabled. This means it might be less precise than the existing approach. The idea is to basically invalidate all the JITed code when we need method entry / exit hooks and re-JIT them with the support to call entry / exit hooks as and when necessary. Test: art/testrunner.py Change-Id: I79e4547368691a21b26226508228d890369823e9
Diffstat (limited to 'compiler/optimizing/optimizing_compiler.cc')
-rw-r--r--compiler/optimizing/optimizing_compiler.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc
index 16abf9d37d..c3ccf954d0 100644
--- a/compiler/optimizing/optimizing_compiler.cc
+++ b/compiler/optimizing/optimizing_compiler.cc
@@ -800,6 +800,8 @@ CodeGenerator* OptimizingCompiler::TryCompile(ArenaAllocator* allocator,
dead_reference_safe = false;
}
+ bool is_instrumentation_enabled =
+ Runtime::Current()->GetInstrumentation()->NeedInstrumentationSupportForJIT();
HGraph* graph = new (allocator) HGraph(
allocator,
arena_stack,
@@ -809,7 +811,7 @@ CodeGenerator* OptimizingCompiler::TryCompile(ArenaAllocator* allocator,
compiler_options.GetInstructionSet(),
kInvalidInvokeType,
dead_reference_safe,
- compiler_options.GetDebuggable(),
+ compiler_options.GetDebuggable() || is_instrumentation_enabled,
compilation_kind);
if (method != nullptr) {
@@ -1296,7 +1298,8 @@ bool OptimizingCompiler::JitCompile(Thread* self,
/* is_full_debug_info= */ compiler_options.GetGenerateDebugInfo(),
compilation_kind,
/* has_should_deoptimize_flag= */ false,
- cha_single_implementation_list)) {
+ cha_single_implementation_list,
+ /* has_instrumentation_support= */ false)) {
code_cache->Free(self, region, reserved_code.data(), reserved_data.data());
return false;
}
@@ -1404,7 +1407,8 @@ bool OptimizingCompiler::JitCompile(Thread* self,
/* is_full_debug_info= */ compiler_options.GetGenerateDebugInfo(),
compilation_kind,
codegen->GetGraph()->HasShouldDeoptimizeFlag(),
- codegen->GetGraph()->GetCHASingleImplementationList())) {
+ codegen->GetGraph()->GetCHASingleImplementationList(),
+ codegen->GetGraph()->IsDebuggable())) {
code_cache->Free(self, region, reserved_code.data(), reserved_data.data());
return false;
}