Chromium Code Reviews| Index: src/debug/ia32/debug-ia32.cc |
| diff --git a/src/debug/ia32/debug-ia32.cc b/src/debug/ia32/debug-ia32.cc |
| index 7df18c7eb8f7bddd8768769058021cc153ca099c..b860e09f9bf742e1deaa4e1bc2880f19261fb800 100644 |
| --- a/src/debug/ia32/debug-ia32.cc |
| +++ b/src/debug/ia32/debug-ia32.cc |
| @@ -68,9 +68,15 @@ void DebugCodegen::GenerateDebugBreakStub(MacroAssembler* masm, |
| } |
| __ push(Immediate(Smi::FromInt(LiveEdit::kFramePaddingInitialSize))); |
| - if (mode == SAVE_RESULT_REGISTER) __ push(eax); |
| - |
| - __ Move(eax, Immediate(0)); // No arguments. |
| + // Push arguments for DebugBreak call. |
| + if (mode == SAVE_RESULT_REGISTER) { |
| + // Break on return. |
| + __ push(eax); |
| + } else { |
| + // Non-return breaks. |
| + __ Push(masm->isolate()->factory()->the_hole_value()); |
| + } |
| + __ Move(eax, Immediate(1)); |
| __ mov(ebx, |
| Immediate(ExternalReference( |
| Runtime::FunctionForId(Runtime::kDebugBreak), masm->isolate()))); |
| @@ -79,14 +85,14 @@ void DebugCodegen::GenerateDebugBreakStub(MacroAssembler* masm, |
| __ CallStub(&ceb); |
| if (FLAG_debug_code) { |
| - for (int i = 0; i < kNumJSCallerSaved; ++i) { |
| + // Do not clobber eax if SAVE_RESULT_REGISTER is set. It will |
| + // contain return value of the function. |
| + for (int i = SAVE_RESULT_REGISTER ? 1 : 0; i < kNumJSCallerSaved; ++i) { |
|
rmcilroy
2016/03/22 11:32:34
This is relying on JSCallerSavedCode(0) being eax,
mythria
2016/03/22 12:08:09
Thanks, I did not realize we could check if a regi
|
| Register reg = {JSCallerSavedCode(i)}; |
| __ Move(reg, Immediate(kDebugZapValue)); |
| } |
| } |
| - if (mode == SAVE_RESULT_REGISTER) __ pop(eax); |
| - |
| __ pop(ebx); |
| // We divide stored value by 2 (untagging) and multiply it by word's size. |
| STATIC_ASSERT(kSmiTagSize == 1 && kSmiShiftSize == 0); |