diff options
author | 2022-03-23 12:49:30 +0000 | |
---|---|---|
committer | 2022-07-12 13:03:15 +0000 | |
commit | fc067a360d14db5f84fd4b58e0dee6cb04ee759b (patch) | |
tree | a9217edb3a03e3937411407f704ad26e5887fb9a /compiler/jni/quick/jni_compiler.cc | |
parent | 0ae89052f7213701b8b3a782266e84b3d3600dbf (diff) |
Introduce a flag to check if JITed code has instrumentation support
Introduce a new flag to identify if JITed code was compiled with
instrumentation support. We used to check if the runtime is java
debuggable to check for instrumentation support of JITed code. We only
set the java debuggable at runtime init and never changed it after. So
this check was sufficient since we always JIT code with instrumentation
support in debuggable runtimes.
We want to be able to change the runtime to debuggable after the runtime
has started. As a first step, introduce a new flag to explicitly check
if JITed code was compiled with instrumentation support. Use this flag
to check if code needs entry / exit stubs and to check if code is async
deoptimizeable.
Bug: 222479430
Test: art/test.py
Change-Id: Ibcaeab869aa8ce153920a801dcc60988411c775b
Diffstat (limited to 'compiler/jni/quick/jni_compiler.cc')
-rw-r--r-- | compiler/jni/quick/jni_compiler.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/compiler/jni/quick/jni_compiler.cc b/compiler/jni/quick/jni_compiler.cc index d672500126..42072eb6e0 100644 --- a/compiler/jni/quick/jni_compiler.cc +++ b/compiler/jni/quick/jni_compiler.cc @@ -103,19 +103,19 @@ static JniCompiledMethod ArtJniCompileMethodInternal(const CompilerOptions& comp // i.e. if the method was annotated with @CriticalNative const bool is_critical_native = (access_flags & kAccCriticalNative) != 0u; + bool needs_entry_exit_hooks = + compiler_options.GetDebuggable() && compiler_options.IsJitCompiler(); + // We don't support JITing stubs for critical native methods in debuggable runtimes yet. + // TODO(mythria): Add support required for calling method entry / exit hooks from critical native + // methods. + DCHECK_IMPLIES(needs_entry_exit_hooks, !is_critical_native); + // When walking the stack the top frame doesn't have a pc associated with it. We then depend on // the invariant that we don't have JITed code when AOT code is available. In debuggable runtimes // this invariant doesn't hold. So we tag the SP for JITed code to indentify if we are executing // JITed code or AOT code. Since tagging involves additional instructions we tag only in // debuggable runtimes. - bool should_tag_sp = compiler_options.GetDebuggable() && compiler_options.IsJitCompiler(); - - // We don't JIT stubs for critical native methods in debuggable runtimes. - // TODO(mythria): Add support required for calling method entry / exit hooks from critical native - // methods. - bool needs_entry_exit_hooks = compiler_options.GetDebuggable() && - compiler_options.IsJitCompiler() && - !is_critical_native; + bool should_tag_sp = needs_entry_exit_hooks; VLOG(jni) << "JniCompile: Method :: " << dex_file.PrettyMethod(method_idx, /* with signature */ true) |