From 5097f83c4719a76fdfab1044ab745273841aca45 Mon Sep 17 00:00:00 2001 From: Mythri Alle Date: Tue, 2 Nov 2021 14:52:30 +0000 Subject: Revert^2 "Add support for calling entry / exit hooks directly from JIT code"" This reverts commit 72be14ed06b76cd0e83392145cec9025ff43d174. Reason for revert: A reland of commit 2d4feeb67912d64b9e980e6687794826a5c22f9d with a fix for no-image tests Change-Id: I79f719f0d4d9b903db301a1636fde5689da35a29 --- runtime/stack.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'runtime/stack.cc') diff --git a/runtime/stack.cc b/runtime/stack.cc index 233106eb0a..eb0fe5692d 100644 --- a/runtime/stack.cc +++ b/runtime/stack.cc @@ -800,6 +800,21 @@ QuickMethodFrameInfo StackVisitor::GetCurrentQuickFrameInfo() const { return RuntimeCalleeSaveFrame::GetMethodFrameInfo(CalleeSaveType::kSaveRefsAndArgs); } +uint8_t* StackVisitor::GetShouldDeoptimizeFlagAddr() const REQUIRES_SHARED(Locks::mutator_lock_) { + DCHECK(GetCurrentOatQuickMethodHeader()->HasShouldDeoptimizeFlag()); + QuickMethodFrameInfo frame_info = GetCurrentQuickFrameInfo(); + size_t frame_size = frame_info.FrameSizeInBytes(); + uint8_t* sp = reinterpret_cast(GetCurrentQuickFrame()); + size_t core_spill_size = + POPCOUNT(frame_info.CoreSpillMask()) * GetBytesPerGprSpillLocation(kRuntimeISA); + size_t fpu_spill_size = + POPCOUNT(frame_info.FpSpillMask()) * GetBytesPerFprSpillLocation(kRuntimeISA); + size_t offset = frame_size - core_spill_size - fpu_spill_size - kShouldDeoptimizeFlagSize; + uint8_t* should_deoptimize_addr = sp + offset; + DCHECK_EQ(*should_deoptimize_addr & ~static_cast(DeoptimizeFlagValue::kAll), 0); + return should_deoptimize_addr; +} + template void StackVisitor::WalkStack(bool include_transitions) { if (check_suspended_) { -- cgit v1.2.3-59-g8ed1b