summaryrefslogtreecommitdiff
path: root/compiler/utils/jni_macro_assembler.h
diff options
context:
space:
mode:
author Mythri Alle <mythria@google.com> 2022-05-05 13:49:05 +0000
committer Mythri Alle <mythria@google.com> 2022-05-12 10:47:05 +0000
commit5da52cd20ea0d24b038ae20c6c96aa22ac3a24a0 (patch)
tree9d250cd4be4ae21ebedf9a2256f2bcec0cd27dc1 /compiler/utils/jni_macro_assembler.h
parent9f466bd54aa6a6c0f12b2a6ccf4d19bc987bcf04 (diff)
Reland^2 "Don't use AOT code for native methods for java debuggable runtime"
This reverts commit 570ade8a6600d368a9e24b64cfa0a1907929166a. Reason for revert: Relanding after a fix for failures. The original cl breaks the invariant that we would always use AOT code for native methods if there is AOT code. This invariant is necessary to get the header when walking the stack. This CL fixes it by not relying on the invariant but instead tagging the sp to differentiate between JIT and AOT code in debuggable runtimes. Non-debuggable runtimes still have the invariant. Change-Id: I5141281f04202d41988021d53bfe30a48bc4db9c
Diffstat (limited to 'compiler/utils/jni_macro_assembler.h')
-rw-r--r--compiler/utils/jni_macro_assembler.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/utils/jni_macro_assembler.h b/compiler/utils/jni_macro_assembler.h
index 7022e3df92..c8c713ae67 100644
--- a/compiler/utils/jni_macro_assembler.h
+++ b/compiler/utils/jni_macro_assembler.h
@@ -126,7 +126,11 @@ class JNIMacroAssembler : public DeletableArenaObject<kArenaAllocAssembler> {
virtual void StoreStackOffsetToThread(ThreadOffset<kPointerSize> thr_offs,
FrameOffset fr_offs) = 0;
- virtual void StoreStackPointerToThread(ThreadOffset<kPointerSize> thr_offs) = 0;
+ // Stores stack pointer by tagging it if required so we can walk the stack. In debuggable runtimes
+ // we use tag to tell if we are using JITed code or AOT code. In non-debuggable runtimes we never
+ // use JITed code when AOT code is present. So checking for AOT code is sufficient to detect which
+ // code is being executed. We avoid tagging in non-debuggable runtimes to reduce instructions.
+ virtual void StoreStackPointerToThread(ThreadOffset<kPointerSize> thr_offs, bool tag_sp) = 0;
virtual void StoreSpanning(FrameOffset dest,
ManagedRegister src,