Index: src/debug/arm/debug-arm.cc |
diff --git a/src/debug/arm/debug-arm.cc b/src/debug/arm/debug-arm.cc |
index 99a555de9c5800e4deeb7d7d80db2a7025d40d7a..fa3540e53bac2eef70fef969fc858b0f3264d833 100644 |
--- a/src/debug/arm/debug-arm.cc |
+++ b/src/debug/arm/debug-arm.cc |
@@ -81,9 +81,15 @@ void DebugCodegen::GenerateDebugBreakStub(MacroAssembler* masm, |
__ mov(ip, Operand(Smi::FromInt(LiveEdit::kFramePaddingInitialSize))); |
__ push(ip); |
- if (mode == SAVE_RESULT_REGISTER) __ push(r0); |
- |
- __ mov(r0, Operand::Zero()); // no arguments |
+ // Push arguments for DebugBreak call. |
+ if (mode == SAVE_RESULT_REGISTER) { |
+ // Break on return. |
+ __ push(r0); |
+ } else { |
+ // Non-return breaks. |
+ __ Push(masm->isolate()->factory()->the_hole_value()); |
+ } |
+ __ mov(r0, Operand(1)); |
__ mov(r1, |
Operand(ExternalReference( |
Runtime::FunctionForId(Runtime::kDebugBreak), masm->isolate()))); |
@@ -94,12 +100,14 @@ void DebugCodegen::GenerateDebugBreakStub(MacroAssembler* masm, |
if (FLAG_debug_code) { |
for (int i = 0; i < kNumJSCallerSaved; i++) { |
Register reg = {JSCallerSavedCode(i)}; |
- __ mov(reg, Operand(kDebugZapValue)); |
+ // Do not clobber r0 if mode is SAVE_RESULT_REGISTER. It will |
+ // contain return value of the function. |
+ if (!(reg.is(r0) && (mode == SAVE_RESULT_REGISTER))) { |
+ __ mov(reg, Operand(kDebugZapValue)); |
+ } |
} |
} |
- if (mode == SAVE_RESULT_REGISTER) __ pop(r0); |
- |
// Don't bother removing padding bytes pushed on the stack |
// as the frame is going to be restored right away. |