From babd7207698261b59894f8520dc464526e411b5c Mon Sep 17 00:00:00 2001 From: Santiago Aboy Solanes Date: Fri, 17 Jan 2025 14:57:07 +0000 Subject: Remove explicit dex_pc from RecordPcInfo Special cases considered: * Frame entry (hardcoded to be 0) or block entry. * Native debuggable + slow paths, which is the only case where we use the instruction's dex_pc. Test: m test-art-host-gtest Test: art/test/testrunner/testrunner.py --host --64 -b --optimizing Change-Id: Ic5e0a6b5106395b891a9a45ea48da39dfb44a0a5 --- compiler/optimizing/code_generator.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'compiler/optimizing/code_generator.h') diff --git a/compiler/optimizing/code_generator.h b/compiler/optimizing/code_generator.h index 950bae5c8f..f242866412 100644 --- a/compiler/optimizing/code_generator.h +++ b/compiler/optimizing/code_generator.h @@ -339,20 +339,24 @@ class CodeGenerator : public DeletableArenaObject { return GetFrameSize() - FrameEntrySpillSize() - kShouldDeoptimizeFlagSize; } - // Record native to dex mapping for a suspend point. Required by runtime. - void RecordPcInfo(HInstruction* instruction, - uint32_t dex_pc, - uint32_t native_pc, - SlowPathCode* slow_path = nullptr, - bool native_debug_info = false); + // For stack overflow checks and native-debug-info entries without dex register + // mapping i.e. start of basic block or at frame entry. + void RecordPcInfoForFrameOrBlockEntry(uint32_t dex_pc = 0); // Record native to dex mapping for a suspend point. // The native_pc is used from Assembler::CodePosition. // // Note: As Assembler::CodePosition is target dependent, it does not guarantee the exact native_pc // for the instruction. If the exact native_pc is required it must be provided explicitly. + void RecordPcInfo(HInstruction* instruction, + SlowPathCode* slow_path = nullptr, + bool native_debug_info = false); + + // Record native to dex mapping for a suspend point. Required by runtime. + // Do not use directly. Use the method above. void RecordPcInfo(HInstruction* instruction, uint32_t dex_pc, + uint32_t native_pc, SlowPathCode* slow_path = nullptr, bool native_debug_info = false); @@ -363,6 +367,7 @@ class CodeGenerator : public DeletableArenaObject { // // ARM specific behaviour: The recorded native PC might be a branch over pools to instructions // corresponding the dex PC. + void MaybeRecordNativeDebugInfoForBlockEntry(uint32_t dex_pc); void MaybeRecordNativeDebugInfo(HInstruction* instruction, uint32_t dex_pc, SlowPathCode* slow_path = nullptr); @@ -672,6 +677,7 @@ class CodeGenerator : public DeletableArenaObject { void SetDisassemblyInformation(DisassemblyInformation* info) { disasm_info_ = info; } DisassemblyInformation* GetDisassemblyInformation() const { return disasm_info_; } + // TODO(solanes): Remove `dex_pc` now that it is unused. virtual void InvokeRuntime(QuickEntrypointEnum entrypoint, HInstruction* instruction, uint32_t dex_pc, -- cgit v1.2.3-59-g8ed1b