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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // jumping to the target address intended by the caller and that was | 101 // jumping to the target address intended by the caller and that was |
102 // overwritten by the address of DebugBreakXXX. | 102 // overwritten by the address of DebugBreakXXX. |
103 ExternalReference after_break_target = | 103 ExternalReference after_break_target = |
104 ExternalReference::debug_after_break_target_address(masm->isolate()); | 104 ExternalReference::debug_after_break_target_address(masm->isolate()); |
105 __ li(t9, Operand(after_break_target)); | 105 __ li(t9, Operand(after_break_target)); |
106 __ lw(t9, MemOperand(t9)); | 106 __ lw(t9, MemOperand(t9)); |
107 __ Jump(t9); | 107 __ Jump(t9); |
108 } | 108 } |
109 | 109 |
110 | 110 |
111 void DebugCodegen::GeneratePlainReturnLiveEdit(MacroAssembler* masm) { | |
112 __ Ret(); | |
113 } | |
114 | |
115 | |
116 void DebugCodegen::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { | 111 void DebugCodegen::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { |
117 ExternalReference restarter_frame_function_slot = | |
118 ExternalReference::debug_restarter_frame_function_pointer_address( | |
119 masm->isolate()); | |
120 __ li(at, Operand(restarter_frame_function_slot)); | |
121 __ sw(zero_reg, MemOperand(at, 0)); | |
122 | |
123 // We do not know our frame height, but set sp based on fp. | 112 // We do not know our frame height, but set sp based on fp. |
124 __ Subu(sp, fp, Operand(kPointerSize)); | 113 __ Subu(sp, fp, Operand(kPointerSize)); |
125 | 114 |
126 __ Pop(ra, fp, a1); // Return address, Frame, Function. | 115 __ Pop(ra, fp, a1); // Return address, Frame, Function. |
127 | 116 |
| 117 ParameterCount dummy(0); |
| 118 __ FloodFunctionIfStepping(a1, no_reg, dummy, dummy); |
| 119 |
128 // Load context from the function. | 120 // Load context from the function. |
129 __ lw(cp, FieldMemOperand(a1, JSFunction::kContextOffset)); | 121 __ lw(cp, FieldMemOperand(a1, JSFunction::kContextOffset)); |
130 | 122 |
131 // Clear new.target as a safety measure. | 123 // Clear new.target as a safety measure. |
132 __ LoadRoot(a3, Heap::kUndefinedValueRootIndex); | 124 __ LoadRoot(a3, Heap::kUndefinedValueRootIndex); |
133 | 125 |
134 // Get function code. | 126 // Get function code. |
135 __ lw(at, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); | 127 __ lw(at, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); |
136 __ lw(at, FieldMemOperand(at, SharedFunctionInfo::kCodeOffset)); | 128 __ lw(at, FieldMemOperand(at, SharedFunctionInfo::kCodeOffset)); |
137 __ Addu(t9, at, Operand(Code::kHeaderSize - kHeapObjectTag)); | 129 __ Addu(t9, at, Operand(Code::kHeaderSize - kHeapObjectTag)); |
138 | 130 |
139 // Re-run JSFunction, a1 is function, cp is context. | 131 // Re-run JSFunction, a1 is function, cp is context. |
140 __ Jump(t9); | 132 __ Jump(t9); |
141 } | 133 } |
142 | 134 |
143 | 135 |
144 const bool LiveEdit::kFrameDropperSupported = true; | 136 const bool LiveEdit::kFrameDropperSupported = true; |
145 | 137 |
146 #undef __ | 138 #undef __ |
147 | 139 |
148 } // namespace internal | 140 } // namespace internal |
149 } // namespace v8 | 141 } // namespace v8 |
150 | 142 |
151 #endif // V8_TARGET_ARCH_MIPS | 143 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |