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