| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #if V8_TARGET_ARCH_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
| 6 | 6 |
| 7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
| 8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 // Load padding words on stack. | 70 // Load padding words on stack. |
| 71 __ li(at, Operand(Smi::FromInt(LiveEdit::kFramePaddingValue))); | 71 __ li(at, Operand(Smi::FromInt(LiveEdit::kFramePaddingValue))); |
| 72 __ Subu(sp, sp, | 72 __ Subu(sp, sp, |
| 73 Operand(kPointerSize * LiveEdit::kFramePaddingInitialSize)); | 73 Operand(kPointerSize * LiveEdit::kFramePaddingInitialSize)); |
| 74 for (int i = LiveEdit::kFramePaddingInitialSize - 1; i >= 0; i--) { | 74 for (int i = LiveEdit::kFramePaddingInitialSize - 1; i >= 0; i--) { |
| 75 __ sw(at, MemOperand(sp, kPointerSize * i)); | 75 __ sw(at, MemOperand(sp, kPointerSize * i)); |
| 76 } | 76 } |
| 77 __ li(at, Operand(Smi::FromInt(LiveEdit::kFramePaddingInitialSize))); | 77 __ li(at, Operand(Smi::FromInt(LiveEdit::kFramePaddingInitialSize))); |
| 78 __ push(at); | 78 __ push(at); |
| 79 | 79 |
| 80 if (mode == SAVE_RESULT_REGISTER) __ push(v0); | 80 // Push arguments for DebugBreak call. |
| 81 | 81 if (mode == SAVE_RESULT_REGISTER) { |
| 82 __ PrepareCEntryArgs(0); // No arguments. | 82 // Break on return. |
| 83 __ push(v0); |
| 84 } else { |
| 85 // Non-return breaks. |
| 86 __ Push(masm->isolate()->factory()->the_hole_value()); |
| 87 } |
| 88 __ PrepareCEntryArgs(1); |
| 83 __ PrepareCEntryFunction(ExternalReference( | 89 __ PrepareCEntryFunction(ExternalReference( |
| 84 Runtime::FunctionForId(Runtime::kDebugBreak), masm->isolate())); | 90 Runtime::FunctionForId(Runtime::kDebugBreak), masm->isolate())); |
| 85 | 91 |
| 86 CEntryStub ceb(masm->isolate(), 1); | 92 CEntryStub ceb(masm->isolate(), 1); |
| 87 __ CallStub(&ceb); | 93 __ CallStub(&ceb); |
| 88 | 94 |
| 89 if (FLAG_debug_code) { | 95 if (FLAG_debug_code) { |
| 90 for (int i = 0; i < kNumJSCallerSaved; i++) { | 96 for (int i = 0; i < kNumJSCallerSaved; i++) { |
| 91 Register reg = {JSCallerSavedCode(i)}; | 97 Register reg = {JSCallerSavedCode(i)}; |
| 92 __ li(reg, kDebugZapValue); | 98 // Do not clobber v0 if mode is SAVE_RESULT_REGISTER. It will |
| 99 // contain return value of the function returned by DebugBreak. |
| 100 if (!(reg.is(v0) && (mode == SAVE_RESULT_REGISTER))) { |
| 101 __ li(reg, kDebugZapValue); |
| 102 } |
| 93 } | 103 } |
| 94 } | 104 } |
| 95 | 105 |
| 96 if (mode == SAVE_RESULT_REGISTER) __ pop(v0); | |
| 97 | |
| 98 // Don't bother removing padding bytes pushed on the stack | 106 // Don't bother removing padding bytes pushed on the stack |
| 99 // as the frame is going to be restored right away. | 107 // as the frame is going to be restored right away. |
| 100 | 108 |
| 101 // Leave the internal frame. | 109 // Leave the internal frame. |
| 102 } | 110 } |
| 103 | 111 |
| 104 // Now that the break point has been handled, resume normal execution by | 112 // Now that the break point has been handled, resume normal execution by |
| 105 // jumping to the target address intended by the caller and that was | 113 // jumping to the target address intended by the caller and that was |
| 106 // overwritten by the address of DebugBreakXXX. | 114 // overwritten by the address of DebugBreakXXX. |
| 107 ExternalReference after_break_target = | 115 ExternalReference after_break_target = |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 | 147 |
| 140 | 148 |
| 141 const bool LiveEdit::kFrameDropperSupported = true; | 149 const bool LiveEdit::kFrameDropperSupported = true; |
| 142 | 150 |
| 143 #undef __ | 151 #undef __ |
| 144 | 152 |
| 145 } // namespace internal | 153 } // namespace internal |
| 146 } // namespace v8 | 154 } // namespace v8 |
| 147 | 155 |
| 148 #endif // V8_TARGET_ARCH_MIPS | 156 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |