From 5da52cd20ea0d24b038ae20c6c96aa22ac3a24a0 Mon Sep 17 00:00:00 2001 From: Mythri Alle Date: Thu, 5 May 2022 13:49:05 +0000 Subject: 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 --- compiler/utils/jni_macro_assembler.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'compiler/utils/jni_macro_assembler.h') 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 { virtual void StoreStackOffsetToThread(ThreadOffset thr_offs, FrameOffset fr_offs) = 0; - virtual void StoreStackPointerToThread(ThreadOffset 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 thr_offs, bool tag_sp) = 0; virtual void StoreSpanning(FrameOffset dest, ManagedRegister src, -- cgit v1.2.3-59-g8ed1b