Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(341)

Side by Side Diff: src/debug/x64/debug-x64.cc

Issue 1491743005: [debugger] do not predict step in target for liveedit. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@liveeditstep
Patch Set: do not prepare stepping if we are not in the debugger Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/debug/mips64/debug-mips64.cc ('k') | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 // Now that the break point has been handled, resume normal execution by 99 // Now that the break point has been handled, resume normal execution by
100 // jumping to the target address intended by the caller and that was 100 // jumping to the target address intended by the caller and that was
101 // overwritten by the address of DebugBreakXXX. 101 // overwritten by the address of DebugBreakXXX.
102 ExternalReference after_break_target = 102 ExternalReference after_break_target =
103 ExternalReference::debug_after_break_target_address(masm->isolate()); 103 ExternalReference::debug_after_break_target_address(masm->isolate());
104 __ Move(kScratchRegister, after_break_target); 104 __ Move(kScratchRegister, after_break_target);
105 __ Jump(Operand(kScratchRegister, 0)); 105 __ Jump(Operand(kScratchRegister, 0));
106 } 106 }
107 107
108 108
109 void DebugCodegen::GeneratePlainReturnLiveEdit(MacroAssembler* masm) {
110 masm->ret(0);
111 }
112
113
114 void DebugCodegen::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { 109 void DebugCodegen::GenerateFrameDropperLiveEdit(MacroAssembler* masm) {
115 ExternalReference restarter_frame_function_slot =
116 ExternalReference::debug_restarter_frame_function_pointer_address(
117 masm->isolate());
118 __ Move(rax, restarter_frame_function_slot);
119 __ movp(Operand(rax, 0), Immediate(0));
120
121 // We do not know our frame height, but set rsp based on rbp. 110 // We do not know our frame height, but set rsp based on rbp.
122 __ leap(rsp, Operand(rbp, -1 * kPointerSize)); 111 __ leap(rsp, Operand(rbp, -1 * kPointerSize));
123 112
124 __ Pop(rdi); // Function. 113 __ Pop(rdi); // Function.
125 __ popq(rbp); 114 __ popq(rbp);
126 115
116 ParameterCount dummy(0);
117 __ FloodFunctionIfStepping(rdi, no_reg, dummy, dummy);
118
127 // Load context from the function. 119 // Load context from the function.
128 __ movp(rsi, FieldOperand(rdi, JSFunction::kContextOffset)); 120 __ movp(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
129 121
130 // Clear new.target as a safety measure. 122 // Clear new.target as a safety measure.
131 __ LoadRoot(rdx, Heap::kUndefinedValueRootIndex); 123 __ LoadRoot(rdx, Heap::kUndefinedValueRootIndex);
132 124
133 // Get function code. 125 // Get function code.
134 __ movp(rbx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset)); 126 __ movp(rbx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset));
135 __ movp(rbx, FieldOperand(rbx, SharedFunctionInfo::kCodeOffset)); 127 __ movp(rbx, FieldOperand(rbx, SharedFunctionInfo::kCodeOffset));
136 __ leap(rbx, FieldOperand(rbx, Code::kHeaderSize)); 128 __ leap(rbx, FieldOperand(rbx, Code::kHeaderSize));
137 129
138 // Re-run JSFunction, rdi is function, rsi is context. 130 // Re-run JSFunction, rdi is function, rsi is context.
139 __ jmp(rbx); 131 __ jmp(rbx);
140 } 132 }
141 133
142 const bool LiveEdit::kFrameDropperSupported = true; 134 const bool LiveEdit::kFrameDropperSupported = true;
143 135
144 #undef __ 136 #undef __
145 137
146 } // namespace internal 138 } // namespace internal
147 } // namespace v8 139 } // namespace v8
148 140
149 #endif // V8_TARGET_ARCH_X64 141 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/debug/mips64/debug-mips64.cc ('k') | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698