Index: src/compiler/arm64/code-generator-arm64.cc |
diff --git a/src/compiler/arm64/code-generator-arm64.cc b/src/compiler/arm64/code-generator-arm64.cc |
index 1833821169d4f404b257f3de8a42925a02d15f58..18cdca4103ec4eb8ae5e435920d0c76617ef35bc 100644 |
--- a/src/compiler/arm64/code-generator-arm64.cc |
+++ b/src/compiler/arm64/code-generator-arm64.cc |
@@ -1723,10 +1723,6 @@ void CodeGenerator::AssembleArchTrap(Instruction* instr, |
if (frame_elided_) { |
__ set_has_frame(old_has_frame); |
} |
- if (FLAG_debug_code) { |
- // The trap code should never return. |
- __ Brk(0); |
- } |
} |
private: |
@@ -1737,6 +1733,8 @@ void CodeGenerator::AssembleArchTrap(Instruction* instr, |
__ CallCFunction( |
ExternalReference::wasm_call_trap_callback_for_testing(isolate()), |
0); |
+ __ LeaveFrame(StackFrame::WASM_COMPILED); |
+ __ Ret(); |
} else { |
DCHECK(csp.Is(__ StackPointer())); |
__ Move(cp, Smi::kZero); |
@@ -1744,11 +1742,15 @@ void CodeGenerator::AssembleArchTrap(Instruction* instr, |
__ Mov(jssp, csp); |
gen_->AssembleSourcePosition(instr_); |
__ CallRuntime(trap_id); |
+ ReferenceMap* reference_map = |
+ new (gen_->zone()) ReferenceMap(gen_->zone()); |
+ gen_->RecordSafepoint(reference_map, Safepoint::kSimple, 0, |
+ Safepoint::kNoLazyDeopt); |
+ if (FLAG_debug_code) { |
+ // The trap code should never return. |
+ __ Brk(0); |
+ } |
} |
- ReferenceMap* reference_map = |
- new (gen_->zone()) ReferenceMap(gen_->zone()); |
- gen_->RecordSafepoint(reference_map, Safepoint::kSimple, 0, |
- Safepoint::kNoLazyDeopt); |
} |
bool frame_elided_; |
Instruction* instr_; |
@@ -1886,7 +1888,6 @@ void CodeGenerator::AssembleConstructFrame() { |
osr_pc_offset_ = __ pc_offset(); |
shrink_slots -= OsrHelper(info()).UnoptimizedFrameSlots(); |
} |
- |
// Build remainder of frame, including accounting for and filling-in |
// frame-specific header information, e.g. claiming the extra slot that |
// other platforms explicitly push for STUB frames and frames recording |