OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
6 | 6 |
7 #include "src/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
9 #include "src/debug/debug.h" | 9 #include "src/debug/debug.h" |
10 | 10 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 // jumping to the target address intended by the caller and that was | 117 // jumping to the target address intended by the caller and that was |
118 // overwritten by the address of DebugBreakXXX. | 118 // overwritten by the address of DebugBreakXXX. |
119 ExternalReference after_break_target = | 119 ExternalReference after_break_target = |
120 ExternalReference::debug_after_break_target_address(masm->isolate()); | 120 ExternalReference::debug_after_break_target_address(masm->isolate()); |
121 __ Mov(scratch, after_break_target); | 121 __ Mov(scratch, after_break_target); |
122 __ Ldr(scratch, MemOperand(scratch)); | 122 __ Ldr(scratch, MemOperand(scratch)); |
123 __ Br(scratch); | 123 __ Br(scratch); |
124 } | 124 } |
125 | 125 |
126 | 126 |
| 127 void DebugCodegen::GeneratePlainReturnLiveEdit(MacroAssembler* masm) { |
| 128 __ Ret(); |
| 129 } |
| 130 |
| 131 |
127 void DebugCodegen::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { | 132 void DebugCodegen::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { |
| 133 ExternalReference restarter_frame_function_slot = |
| 134 ExternalReference::debug_restarter_frame_function_pointer_address( |
| 135 masm->isolate()); |
| 136 UseScratchRegisterScope temps(masm); |
| 137 Register scratch = temps.AcquireX(); |
| 138 |
| 139 __ Mov(scratch, restarter_frame_function_slot); |
| 140 __ Str(xzr, MemOperand(scratch)); |
| 141 |
128 // We do not know our frame height, but set sp based on fp. | 142 // We do not know our frame height, but set sp based on fp. |
129 __ Sub(masm->StackPointer(), fp, kPointerSize); | 143 __ Sub(masm->StackPointer(), fp, kPointerSize); |
130 __ AssertStackConsistency(); | 144 __ AssertStackConsistency(); |
131 | 145 |
132 __ Pop(x1, fp, lr); // Function, Frame, Return address. | 146 __ Pop(x1, fp, lr); // Function, Frame, Return address. |
133 | 147 |
134 ParameterCount dummy(0); | |
135 __ FloodFunctionIfStepping(x1, no_reg, dummy, dummy); | |
136 | |
137 UseScratchRegisterScope temps(masm); | |
138 Register scratch = temps.AcquireX(); | |
139 | |
140 // Load context from the function. | 148 // Load context from the function. |
141 __ Ldr(cp, FieldMemOperand(x1, JSFunction::kContextOffset)); | 149 __ Ldr(cp, FieldMemOperand(x1, JSFunction::kContextOffset)); |
142 | 150 |
143 // Clear new.target as a safety measure. | 151 // Clear new.target as a safety measure. |
144 __ LoadRoot(x3, Heap::kUndefinedValueRootIndex); | 152 __ LoadRoot(x3, Heap::kUndefinedValueRootIndex); |
145 | 153 |
146 // Get function code. | 154 // Get function code. |
147 __ Ldr(scratch, FieldMemOperand(x1, JSFunction::kSharedFunctionInfoOffset)); | 155 __ Ldr(scratch, FieldMemOperand(x1, JSFunction::kSharedFunctionInfoOffset)); |
148 __ Ldr(scratch, FieldMemOperand(scratch, SharedFunctionInfo::kCodeOffset)); | 156 __ Ldr(scratch, FieldMemOperand(scratch, SharedFunctionInfo::kCodeOffset)); |
149 __ Add(scratch, scratch, Code::kHeaderSize - kHeapObjectTag); | 157 __ Add(scratch, scratch, Code::kHeaderSize - kHeapObjectTag); |
150 | 158 |
151 // Re-run JSFunction, x1 is function, cp is context. | 159 // Re-run JSFunction, x1 is function, cp is context. |
152 __ Br(scratch); | 160 __ Br(scratch); |
153 } | 161 } |
154 | 162 |
155 | 163 |
156 const bool LiveEdit::kFrameDropperSupported = true; | 164 const bool LiveEdit::kFrameDropperSupported = true; |
157 | 165 |
158 } // namespace internal | 166 } // namespace internal |
159 } // namespace v8 | 167 } // namespace v8 |
160 | 168 |
161 #endif // V8_TARGET_ARCH_ARM64 | 169 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |