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