| 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 #include "v8.h" | 5 #include "v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
| 8 | 8 |
| 9 #include "assembler.h" | 9 #include "assembler.h" |
| 10 #include "codegen.h" | 10 #include "codegen.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 // Now that the break point has been handled, resume normal execution by | 145 // Now that the break point has been handled, resume normal execution by |
| 146 // jumping to the target address intended by the caller and that was | 146 // jumping to the target address intended by the caller and that was |
| 147 // overwritten by the address of DebugBreakXXX. | 147 // overwritten by the address of DebugBreakXXX. |
| 148 ExternalReference after_break_target = | 148 ExternalReference after_break_target = |
| 149 ExternalReference(Debug_Address::AfterBreakTarget(), masm->isolate()); | 149 ExternalReference(Debug_Address::AfterBreakTarget(), masm->isolate()); |
| 150 __ Move(kScratchRegister, after_break_target); | 150 __ Move(kScratchRegister, after_break_target); |
| 151 __ Jump(Operand(kScratchRegister, 0)); | 151 __ Jump(Operand(kScratchRegister, 0)); |
| 152 } | 152 } |
| 153 | 153 |
| 154 | 154 |
| 155 void Debug::GenerateCallICStubDebugBreak(MacroAssembler* masm) { |
| 156 // Register state for CallICStub |
| 157 // ----------- S t a t e ------------- |
| 158 // -- rdx : type feedback slot (smi) |
| 159 // -- rdi : function |
| 160 // ----------------------------------- |
| 161 Generate_DebugBreakCallHelper(masm, rdx.bit() | rdi.bit(), 0, false); |
| 162 } |
| 163 |
| 164 |
| 155 void Debug::GenerateLoadICDebugBreak(MacroAssembler* masm) { | 165 void Debug::GenerateLoadICDebugBreak(MacroAssembler* masm) { |
| 156 // Register state for IC load call (from ic-x64.cc). | 166 // Register state for IC load call (from ic-x64.cc). |
| 157 // ----------- S t a t e ------------- | 167 // ----------- S t a t e ------------- |
| 158 // -- rax : receiver | 168 // -- rax : receiver |
| 159 // -- rcx : name | 169 // -- rcx : name |
| 160 // ----------------------------------- | 170 // ----------------------------------- |
| 161 Generate_DebugBreakCallHelper(masm, rax.bit() | rcx.bit(), 0, false); | 171 Generate_DebugBreakCallHelper(masm, rax.bit() | rcx.bit(), 0, false); |
| 162 } | 172 } |
| 163 | 173 |
| 164 | 174 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 | 208 |
| 199 void Debug::GenerateCompareNilICDebugBreak(MacroAssembler* masm) { | 209 void Debug::GenerateCompareNilICDebugBreak(MacroAssembler* masm) { |
| 200 // Register state for CompareNil IC | 210 // Register state for CompareNil IC |
| 201 // ----------- S t a t e ------------- | 211 // ----------- S t a t e ------------- |
| 202 // -- rax : value | 212 // -- rax : value |
| 203 // ----------------------------------- | 213 // ----------------------------------- |
| 204 Generate_DebugBreakCallHelper(masm, rax.bit(), 0, false); | 214 Generate_DebugBreakCallHelper(masm, rax.bit(), 0, false); |
| 205 } | 215 } |
| 206 | 216 |
| 207 | 217 |
| 208 void Debug::GenerateCallICDebugBreak(MacroAssembler* masm) { | |
| 209 // Register state for IC call call (from ic-x64.cc) | |
| 210 // ----------- S t a t e ------------- | |
| 211 // -- rcx: function name | |
| 212 // ----------------------------------- | |
| 213 Generate_DebugBreakCallHelper(masm, rcx.bit(), 0, false); | |
| 214 } | |
| 215 | |
| 216 | |
| 217 void Debug::GenerateReturnDebugBreak(MacroAssembler* masm) { | 218 void Debug::GenerateReturnDebugBreak(MacroAssembler* masm) { |
| 218 // Register state just before return from JS function (from codegen-x64.cc). | 219 // Register state just before return from JS function (from codegen-x64.cc). |
| 219 // ----------- S t a t e ------------- | 220 // ----------- S t a t e ------------- |
| 220 // -- rax: return value | 221 // -- rax: return value |
| 221 // ----------------------------------- | 222 // ----------------------------------- |
| 222 Generate_DebugBreakCallHelper(masm, rax.bit(), 0, true); | 223 Generate_DebugBreakCallHelper(masm, rax.bit(), 0, true); |
| 223 } | 224 } |
| 224 | 225 |
| 225 | 226 |
| 226 void Debug::GenerateCallFunctionStubDebugBreak(MacroAssembler* masm) { | 227 void Debug::GenerateCallFunctionStubDebugBreak(MacroAssembler* masm) { |
| 227 // Register state for CallFunctionStub (from code-stubs-x64.cc). | 228 // Register state for CallFunctionStub (from code-stubs-x64.cc). |
| 228 // ----------- S t a t e ------------- | 229 // ----------- S t a t e ------------- |
| 229 // -- rdi : function | 230 // -- rdi : function |
| 230 // ----------------------------------- | 231 // ----------------------------------- |
| 231 Generate_DebugBreakCallHelper(masm, rdi.bit(), 0, false); | 232 Generate_DebugBreakCallHelper(masm, rdi.bit(), 0, false); |
| 232 } | 233 } |
| 233 | 234 |
| 234 | 235 |
| 235 void Debug::GenerateCallFunctionStubRecordDebugBreak(MacroAssembler* masm) { | |
| 236 // Register state for CallFunctionStub (from code-stubs-x64.cc). | |
| 237 // ----------- S t a t e ------------- | |
| 238 // -- rdi : function | |
| 239 // -- rbx: feedback array | |
| 240 // -- rdx: slot in feedback array | |
| 241 // ----------------------------------- | |
| 242 Generate_DebugBreakCallHelper(masm, rbx.bit() | rdx.bit() | rdi.bit(), | |
| 243 0, false); | |
| 244 } | |
| 245 | |
| 246 | |
| 247 void Debug::GenerateCallConstructStubDebugBreak(MacroAssembler* masm) { | 236 void Debug::GenerateCallConstructStubDebugBreak(MacroAssembler* masm) { |
| 248 // Register state for CallConstructStub (from code-stubs-x64.cc). | 237 // Register state for CallConstructStub (from code-stubs-x64.cc). |
| 249 // rax is the actual number of arguments not encoded as a smi, see comment | 238 // rax is the actual number of arguments not encoded as a smi, see comment |
| 250 // above IC call. | 239 // above IC call. |
| 251 // ----------- S t a t e ------------- | 240 // ----------- S t a t e ------------- |
| 252 // -- rax: number of arguments | 241 // -- rax: number of arguments |
| 253 // ----------------------------------- | 242 // ----------------------------------- |
| 254 // The number of arguments in rax is not smi encoded. | 243 // The number of arguments in rax is not smi encoded. |
| 255 Generate_DebugBreakCallHelper(masm, rdi.bit(), rax.bit(), false); | 244 Generate_DebugBreakCallHelper(masm, rdi.bit(), rax.bit(), false); |
| 256 } | 245 } |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 __ jmp(rdx); | 308 __ jmp(rdx); |
| 320 } | 309 } |
| 321 | 310 |
| 322 const bool Debug::kFrameDropperSupported = true; | 311 const bool Debug::kFrameDropperSupported = true; |
| 323 | 312 |
| 324 #undef __ | 313 #undef __ |
| 325 | 314 |
| 326 } } // namespace v8::internal | 315 } } // namespace v8::internal |
| 327 | 316 |
| 328 #endif // V8_TARGET_ARCH_X64 | 317 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |