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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
8 | 8 |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/debug.h" | 10 #include "src/debug.h" |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 | 125 |
126 | 126 |
127 static void Generate_DebugBreakCallHelper(MacroAssembler* masm, | 127 static void Generate_DebugBreakCallHelper(MacroAssembler* masm, |
128 RegList object_regs, | 128 RegList object_regs, |
129 RegList non_object_regs, | 129 RegList non_object_regs, |
130 Register scratch) { | 130 Register scratch) { |
131 { | 131 { |
132 FrameScope scope(masm, StackFrame::INTERNAL); | 132 FrameScope scope(masm, StackFrame::INTERNAL); |
133 | 133 |
134 // Load padding words on stack. | 134 // Load padding words on stack. |
135 __ ldr(scratch, Smi::FromInt(LiveEdit::kFramePaddingValue)); | 135 __ Mov(scratch, Smi::FromInt(LiveEdit::kFramePaddingValue)); |
136 for (int i = 0; i < LiveEdit::kFramePaddingInitialSize; i++) { | 136 __ PushMultipleTimes(scratch, LiveEdit::kFramePaddingInitialSize); |
137 __ push(scratch); | 137 __ Mov(scratch, Smi::FromInt(LiveEdit::kFramePaddingInitialSize)); |
138 } | 138 __ Push(scratch); |
139 __ ldr(scratch, Smi::FromInt(LiveEdit::kFramePaddingInitialSize)); | |
140 __ push(scratch); | |
141 | 139 |
142 // Any live values (object_regs and non_object_regs) in caller-saved | 140 // Any live values (object_regs and non_object_regs) in caller-saved |
143 // registers (or lr) need to be stored on the stack so that their values are | 141 // registers (or lr) need to be stored on the stack so that their values are |
144 // safely preserved for a call into C code. | 142 // safely preserved for a call into C code. |
145 // | 143 // |
146 // Also: | 144 // Also: |
147 // * object_regs may be modified during the C code by the garbage | 145 // * object_regs may be modified during the C code by the garbage |
148 // collector. Every object register must be a valid tagged pointer or | 146 // collector. Every object register must be a valid tagged pointer or |
149 // SMI. | 147 // SMI. |
150 // | 148 // |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 | 351 |
354 void DebugCodegen::GeneratePlainReturnLiveEdit(MacroAssembler* masm) { | 352 void DebugCodegen::GeneratePlainReturnLiveEdit(MacroAssembler* masm) { |
355 __ Ret(); | 353 __ Ret(); |
356 } | 354 } |
357 | 355 |
358 | 356 |
359 void DebugCodegen::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { | 357 void DebugCodegen::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { |
360 ExternalReference restarter_frame_function_slot = | 358 ExternalReference restarter_frame_function_slot = |
361 ExternalReference::debug_restarter_frame_function_pointer_address( | 359 ExternalReference::debug_restarter_frame_function_pointer_address( |
362 masm->isolate()); | 360 masm->isolate()); |
363 __ mov(x1, xzr); | 361 UseScratchRegisterScope temps(masm); |
364 __ Mov(ip0, restarter_frame_function_slot); | 362 Register scratch = temps.AcquireX(); |
365 __ str(x1, MemOperand(ip0, 0)); | 363 |
| 364 __ Mov(scratch, restarter_frame_function_slot); |
| 365 __ Str(xzr, MemOperand(scratch)); |
366 | 366 |
367 // We do not know our frame height, but set sp based on fp. | 367 // We do not know our frame height, but set sp based on fp. |
368 __ sub(jssp, fp, Operand(kPointerSize)); | 368 __ Sub(masm->StackPointer(), fp, kPointerSize); |
| 369 __ AssertStackConsistency(); |
369 | 370 |
370 __ Pop(x1, fp, lr); // Function, Frame, Return address. | 371 __ Pop(x1, fp, lr); // Function, Frame, Return address. |
371 | 372 |
372 // Load context from the function. | 373 // Load context from the function. |
373 __ ldr(cp, FieldMemOperand(x1, JSFunction::kContextOffset)); | 374 __ Ldr(cp, FieldMemOperand(x1, JSFunction::kContextOffset)); |
374 | 375 |
375 // Get function code. | 376 // Get function code. |
376 __ ldr(ip0, FieldMemOperand(x1, JSFunction::kSharedFunctionInfoOffset)); | 377 __ Ldr(scratch, FieldMemOperand(x1, JSFunction::kSharedFunctionInfoOffset)); |
377 __ ldr(ip0, FieldMemOperand(ip0, SharedFunctionInfo::kCodeOffset)); | 378 __ Ldr(scratch, FieldMemOperand(scratch, SharedFunctionInfo::kCodeOffset)); |
378 __ add(ip0, ip0, Operand(Code::kHeaderSize - kHeapObjectTag)); | 379 __ Add(scratch, scratch, Code::kHeaderSize - kHeapObjectTag); |
379 | 380 |
380 // Re-run JSFunction, x1 is function, cp is context. | 381 // Re-run JSFunction, x1 is function, cp is context. |
381 __ Jump(ip0); | 382 __ Br(scratch); |
382 } | 383 } |
383 | 384 |
384 | 385 |
385 const bool LiveEdit::kFrameDropperSupported = true; | 386 const bool LiveEdit::kFrameDropperSupported = true; |
386 | 387 |
387 } } // namespace v8::internal | 388 } } // namespace v8::internal |
388 | 389 |
389 #endif // V8_TARGET_ARCH_ARM64 | 390 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |