Index: src/debug/s390/debug-s390.cc |
diff --git a/src/debug/s390/debug-s390.cc b/src/debug/s390/debug-s390.cc |
index 8165bf98741b91775c02e0f82abc4cb542ab7a8a..c6764c2dcaa32a764f8202ecf210a212ee014da0 100644 |
--- a/src/debug/s390/debug-s390.cc |
+++ b/src/debug/s390/debug-s390.cc |
@@ -88,9 +88,15 @@ void DebugCodegen::GenerateDebugBreakStub(MacroAssembler* masm, |
__ LoadSmiLiteral(ip, Smi::FromInt(LiveEdit::kFramePaddingInitialSize)); |
__ push(ip); |
- if (mode == SAVE_RESULT_REGISTER) __ push(r2); |
- |
- __ mov(r2, Operand::Zero()); // no arguments |
+ // Push arguments for DebugBreak call. |
+ if (mode == SAVE_RESULT_REGISTER) { |
+ // Break on return. |
+ __ push(r2); |
+ } else { |
+ // Non-return breaks. |
+ __ Push(masm->isolate()->factory()->the_hole_value()); |
+ } |
+ __ mov(r2, Operand(1)); |
__ mov(r3, |
Operand(ExternalReference( |
Runtime::FunctionForId(Runtime::kDebugBreak), masm->isolate()))); |
@@ -101,12 +107,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 r2 if mode is SAVE_RESULT_REGISTER. It will |
+ // contain return value of the function. |
+ if (!(reg.is(r2) && (mode == SAVE_RESULT_REGISTER))) { |
+ __ mov(reg, Operand(kDebugZapValue)); |
+ } |
} |
} |
- if (mode == SAVE_RESULT_REGISTER) __ pop(r2); |
- |
// Don't bother removing padding bytes pushed on the stack |
// as the frame is going to be restored right away. |