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_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/assembler.h" | 7 #include "src/assembler.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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // Now that the break point has been handled, resume normal execution by | 100 // Now that the break point has been handled, resume normal execution by |
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 __ Move(kScratchRegister, after_break_target); | 105 __ Move(kScratchRegister, after_break_target); |
106 __ Jump(Operand(kScratchRegister, 0)); | 106 __ Jump(Operand(kScratchRegister, 0)); |
107 } | 107 } |
108 | 108 |
109 | 109 |
| 110 void DebugCodegen::GeneratePlainReturnLiveEdit(MacroAssembler* masm) { |
| 111 masm->ret(0); |
| 112 } |
| 113 |
| 114 |
110 void DebugCodegen::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { | 115 void DebugCodegen::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { |
| 116 ExternalReference restarter_frame_function_slot = |
| 117 ExternalReference::debug_restarter_frame_function_pointer_address( |
| 118 masm->isolate()); |
| 119 __ Move(rax, restarter_frame_function_slot); |
| 120 __ movp(Operand(rax, 0), Immediate(0)); |
| 121 |
111 // We do not know our frame height, but set rsp based on rbp. | 122 // We do not know our frame height, but set rsp based on rbp. |
112 __ leap(rsp, Operand(rbp, -1 * kPointerSize)); | 123 __ leap(rsp, Operand(rbp, -1 * kPointerSize)); |
113 | 124 |
114 __ Pop(rdi); // Function. | 125 __ Pop(rdi); // Function. |
115 | |
116 ParameterCount dummy(0); | |
117 __ FloodFunctionIfStepping(rdi, no_reg, dummy, dummy); | |
118 | |
119 __ popq(rbp); | 126 __ popq(rbp); |
120 | 127 |
121 // Load context from the function. | 128 // Load context from the function. |
122 __ movp(rsi, FieldOperand(rdi, JSFunction::kContextOffset)); | 129 __ movp(rsi, FieldOperand(rdi, JSFunction::kContextOffset)); |
123 | 130 |
124 // Get function code. | 131 // Get function code. |
125 __ movp(rdx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset)); | 132 __ movp(rdx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset)); |
126 __ movp(rdx, FieldOperand(rdx, SharedFunctionInfo::kCodeOffset)); | 133 __ movp(rdx, FieldOperand(rdx, SharedFunctionInfo::kCodeOffset)); |
127 __ leap(rdx, FieldOperand(rdx, Code::kHeaderSize)); | 134 __ leap(rdx, FieldOperand(rdx, Code::kHeaderSize)); |
128 | 135 |
129 // Re-run JSFunction, rdi is function, rsi is context. | 136 // Re-run JSFunction, rdi is function, rsi is context. |
130 __ jmp(rdx); | 137 __ jmp(rdx); |
131 } | 138 } |
132 | 139 |
133 const bool LiveEdit::kFrameDropperSupported = true; | 140 const bool LiveEdit::kFrameDropperSupported = true; |
134 | 141 |
135 #undef __ | 142 #undef __ |
136 | 143 |
137 } // namespace internal | 144 } // namespace internal |
138 } // namespace v8 | 145 } // namespace v8 |
139 | 146 |
140 #endif // V8_TARGET_ARCH_X64 | 147 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |