Index: src/compiler/x64/code-generator-x64.cc |
diff --git a/src/compiler/x64/code-generator-x64.cc b/src/compiler/x64/code-generator-x64.cc |
index 324cc094597d26c47261abffd3c9cb1ef198f5aa..93e87068410f5f7a3717392f3289e701cedc78ae 100644 |
--- a/src/compiler/x64/code-generator-x64.cc |
+++ b/src/compiler/x64/code-generator-x64.cc |
@@ -2327,9 +2327,6 @@ void CodeGenerator::AssembleArchTrap(Instruction* instr, |
if (frame_elided_) { |
__ set_has_frame(old_has_frame); |
} |
- if (FLAG_debug_code) { |
- __ ud2(); |
- } |
} |
private: |
@@ -2341,15 +2338,20 @@ void CodeGenerator::AssembleArchTrap(Instruction* instr, |
__ CallCFunction( |
ExternalReference::wasm_call_trap_callback_for_testing(isolate()), |
0); |
+ __ LeaveFrame(StackFrame::WASM_COMPILED); |
+ __ Ret(); |
} else { |
__ Move(rsi, Smi::kZero); |
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) { |
+ __ ud2(); |
+ } |
} |
- ReferenceMap* reference_map = |
- new (gen_->zone()) ReferenceMap(gen_->zone()); |
- gen_->RecordSafepoint(reference_map, Safepoint::kSimple, 0, |
- Safepoint::kNoLazyDeopt); |
} |
bool frame_elided_; |