Chromium Code Reviews| Index: src/debug/x64/debug-x64.cc |
| diff --git a/src/debug/x64/debug-x64.cc b/src/debug/x64/debug-x64.cc |
| index 094e7b608ece3dc54ac5f1f708a057b62854a9cf..c554d7a53a86eb0c107aeae6e4424c4c5685b457 100644 |
| --- a/src/debug/x64/debug-x64.cc |
| +++ b/src/debug/x64/debug-x64.cc |
| @@ -69,9 +69,15 @@ void DebugCodegen::GenerateDebugBreakStub(MacroAssembler* masm, |
| } |
| __ Push(Smi::FromInt(LiveEdit::kFramePaddingInitialSize)); |
| - if (mode == SAVE_RESULT_REGISTER) __ Push(rax); |
| - |
| - __ Set(rax, 0); // No arguments (argc == 0). |
| + // Push arguments for DebugBreak call. |
| + if (mode == SAVE_RESULT_REGISTER) { |
| + // Break on return. |
| + __ Push(rax); |
| + } else { |
| + // Non-return breaks. |
| + __ Push(masm->isolate()->factory()->the_hole_value()); |
| + } |
| + __ Set(rax, 1); |
| __ Move(rbx, 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 rax 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) { |
|
mythria
2016/03/21 16:24:29
If this is too hacky, I will just push and pop rax
rmcilroy
2016/03/22 11:32:34
Ditto. I'm not sure it's necessary to push / pop,
mythria
2016/03/22 12:08:09
Done.
|
| Register reg = {JSCallerSavedCode(i)}; |
| __ Set(reg, kDebugZapValue); |
| } |
| } |
| - if (mode == SAVE_RESULT_REGISTER) __ Pop(rax); |
| - |
| // Read current padding counter and skip corresponding number of words. |
| __ Pop(kScratchRegister); |
| __ SmiToInteger32(kScratchRegister, kScratchRegister); |