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 | |
132 void DebugCodegen::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { | 127 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 | |
142 // We do not know our frame height, but set sp based on fp. | 128 // We do not know our frame height, but set sp based on fp. |
143 __ Sub(masm->StackPointer(), fp, kPointerSize); | 129 __ Sub(masm->StackPointer(), fp, kPointerSize); |
144 __ AssertStackConsistency(); | 130 __ AssertStackConsistency(); |
145 | 131 |
146 __ Pop(x1, fp, lr); // Function, Frame, Return address. | 132 __ Pop(x1, fp, lr); // Function, Frame, Return address. |
147 | 133 |
| 134 ParameterCount dummy(0); |
| 135 __ FloodFunctionIfStepping(x1, no_reg, dummy, dummy); |
| 136 |
| 137 UseScratchRegisterScope temps(masm); |
| 138 Register scratch = temps.AcquireX(); |
| 139 |
148 // Load context from the function. | 140 // Load context from the function. |
149 __ Ldr(cp, FieldMemOperand(x1, JSFunction::kContextOffset)); | 141 __ Ldr(cp, FieldMemOperand(x1, JSFunction::kContextOffset)); |
150 | 142 |
151 // Clear new.target as a safety measure. | 143 // Clear new.target as a safety measure. |
152 __ LoadRoot(x3, Heap::kUndefinedValueRootIndex); | 144 __ LoadRoot(x3, Heap::kUndefinedValueRootIndex); |
153 | 145 |
154 // Get function code. | 146 // Get function code. |
155 __ Ldr(scratch, FieldMemOperand(x1, JSFunction::kSharedFunctionInfoOffset)); | 147 __ Ldr(scratch, FieldMemOperand(x1, JSFunction::kSharedFunctionInfoOffset)); |
156 __ Ldr(scratch, FieldMemOperand(scratch, SharedFunctionInfo::kCodeOffset)); | 148 __ Ldr(scratch, FieldMemOperand(scratch, SharedFunctionInfo::kCodeOffset)); |
157 __ Add(scratch, scratch, Code::kHeaderSize - kHeapObjectTag); | 149 __ Add(scratch, scratch, Code::kHeaderSize - kHeapObjectTag); |
158 | 150 |
159 // Re-run JSFunction, x1 is function, cp is context. | 151 // Re-run JSFunction, x1 is function, cp is context. |
160 __ Br(scratch); | 152 __ Br(scratch); |
161 } | 153 } |
162 | 154 |
163 | 155 |
164 const bool LiveEdit::kFrameDropperSupported = true; | 156 const bool LiveEdit::kFrameDropperSupported = true; |
165 | 157 |
166 } // namespace internal | 158 } // namespace internal |
167 } // namespace v8 | 159 } // namespace v8 |
168 | 160 |
169 #endif // V8_TARGET_ARCH_ARM64 | 161 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |