| 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 // Push arguments for DebugBreak call. | 80 if (mode == SAVE_RESULT_REGISTER) __ push(v0); |
| 81 if (mode == SAVE_RESULT_REGISTER) { | 81 |
| 82 // Break on return. | 82 __ PrepareCEntryArgs(0); // No arguments. |
| 83 __ push(v0); | |
| 84 } else { | |
| 85 // Non-return breaks. | |
| 86 __ Push(masm->isolate()->factory()->the_hole_value()); | |
| 87 } | |
| 88 __ PrepareCEntryArgs(1); | |
| 89 __ PrepareCEntryFunction(ExternalReference( | 83 __ PrepareCEntryFunction(ExternalReference( |
| 90 Runtime::FunctionForId(Runtime::kDebugBreak), masm->isolate())); | 84 Runtime::FunctionForId(Runtime::kDebugBreak), masm->isolate())); |
| 91 | 85 |
| 92 CEntryStub ceb(masm->isolate(), 1); | 86 CEntryStub ceb(masm->isolate(), 1); |
| 93 __ CallStub(&ceb); | 87 __ CallStub(&ceb); |
| 94 | 88 |
| 95 if (FLAG_debug_code) { | 89 if (FLAG_debug_code) { |
| 96 for (int i = 0; i < kNumJSCallerSaved; i++) { | 90 for (int i = 0; i < kNumJSCallerSaved; i++) { |
| 97 Register reg = {JSCallerSavedCode(i)}; | 91 Register reg = {JSCallerSavedCode(i)}; |
| 98 // Do not clobber v0 if SAVE_RESULT_REGISTER is set. It will | 92 __ li(reg, kDebugZapValue); |
| 99 // contain return value of the function returned by DebugBreak. | |
| 100 if (!(reg.is(v0) && SAVE_RESULT_REGISTER)) { | |
| 101 __ li(reg, kDebugZapValue); | |
| 102 } | |
| 103 } | 93 } |
| 104 } | 94 } |
| 105 | 95 |
| 96 if (mode == SAVE_RESULT_REGISTER) __ pop(v0); |
| 97 |
| 106 // Don't bother removing padding bytes pushed on the stack | 98 // Don't bother removing padding bytes pushed on the stack |
| 107 // as the frame is going to be restored right away. | 99 // as the frame is going to be restored right away. |
| 108 | 100 |
| 109 // Leave the internal frame. | 101 // Leave the internal frame. |
| 110 } | 102 } |
| 111 | 103 |
| 112 // Now that the break point has been handled, resume normal execution by | 104 // Now that the break point has been handled, resume normal execution by |
| 113 // jumping to the target address intended by the caller and that was | 105 // jumping to the target address intended by the caller and that was |
| 114 // overwritten by the address of DebugBreakXXX. | 106 // overwritten by the address of DebugBreakXXX. |
| 115 ExternalReference after_break_target = | 107 ExternalReference after_break_target = |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 | 139 |
| 148 | 140 |
| 149 const bool LiveEdit::kFrameDropperSupported = true; | 141 const bool LiveEdit::kFrameDropperSupported = true; |
| 150 | 142 |
| 151 #undef __ | 143 #undef __ |
| 152 | 144 |
| 153 } // namespace internal | 145 } // namespace internal |
| 154 } // namespace v8 | 146 } // namespace v8 |
| 155 | 147 |
| 156 #endif // V8_TARGET_ARCH_MIPS | 148 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |