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