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/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/base/division-by-constant.h" | 8 #include "src/base/division-by-constant.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 4296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4307 Jump(adaptor, RelocInfo::CODE_TARGET); | 4307 Jump(adaptor, RelocInfo::CODE_TARGET); |
4308 } | 4308 } |
4309 bind(&invoke); | 4309 bind(&invoke); |
4310 } | 4310 } |
4311 } | 4311 } |
4312 | 4312 |
4313 | 4313 |
4314 void MacroAssembler::FloodFunctionIfStepping(Register fun, Register new_target, | 4314 void MacroAssembler::FloodFunctionIfStepping(Register fun, Register new_target, |
4315 const ParameterCount& expected, | 4315 const ParameterCount& expected, |
4316 const ParameterCount& actual) { | 4316 const ParameterCount& actual) { |
4317 Label skip_flooding; | 4317 Label skip_hook; |
4318 ExternalReference last_step_action = | 4318 ExternalReference debug_hook_active = |
4319 ExternalReference::debug_last_step_action_address(isolate()); | 4319 ExternalReference::debug_hook_on_function_call_address(isolate()); |
4320 Operand last_step_action_operand = ExternalOperand(last_step_action); | 4320 Operand debug_hook_active_operand = ExternalOperand(debug_hook_active); |
4321 STATIC_ASSERT(StepFrame > StepIn); | 4321 cmpb(debug_hook_active_operand, Immediate(0)); |
4322 cmpb(last_step_action_operand, Immediate(StepIn)); | 4322 j(equal, &skip_hook); |
4323 j(less, &skip_flooding); | |
4324 { | 4323 { |
4325 FrameScope frame(this, | 4324 FrameScope frame(this, |
4326 has_frame() ? StackFrame::NONE : StackFrame::INTERNAL); | 4325 has_frame() ? StackFrame::NONE : StackFrame::INTERNAL); |
4327 if (expected.is_reg()) { | 4326 if (expected.is_reg()) { |
4328 Integer32ToSmi(expected.reg(), expected.reg()); | 4327 Integer32ToSmi(expected.reg(), expected.reg()); |
4329 Push(expected.reg()); | 4328 Push(expected.reg()); |
4330 } | 4329 } |
4331 if (actual.is_reg()) { | 4330 if (actual.is_reg()) { |
4332 Integer32ToSmi(actual.reg(), actual.reg()); | 4331 Integer32ToSmi(actual.reg(), actual.reg()); |
4333 Push(actual.reg()); | 4332 Push(actual.reg()); |
4334 } | 4333 } |
4335 if (new_target.is_valid()) { | 4334 if (new_target.is_valid()) { |
4336 Push(new_target); | 4335 Push(new_target); |
4337 } | 4336 } |
4338 Push(fun); | 4337 Push(fun); |
4339 Push(fun); | 4338 Push(fun); |
4340 CallRuntime(Runtime::kDebugPrepareStepInIfStepping); | 4339 CallRuntime(Runtime::kDebugOnFunctionCall); |
jgruber
2017/01/10 12:46:38
Can we use this in builtins-x64.cc (Generate_Resum
Yang
2017/01/10 14:14:07
We probably can. Let me think this through.
Yang
2017/01/11 10:32:10
Done.
| |
4341 Pop(fun); | 4340 Pop(fun); |
4342 if (new_target.is_valid()) { | 4341 if (new_target.is_valid()) { |
4343 Pop(new_target); | 4342 Pop(new_target); |
4344 } | 4343 } |
4345 if (actual.is_reg()) { | 4344 if (actual.is_reg()) { |
4346 Pop(actual.reg()); | 4345 Pop(actual.reg()); |
4347 SmiToInteger64(actual.reg(), actual.reg()); | 4346 SmiToInteger64(actual.reg(), actual.reg()); |
4348 } | 4347 } |
4349 if (expected.is_reg()) { | 4348 if (expected.is_reg()) { |
4350 Pop(expected.reg()); | 4349 Pop(expected.reg()); |
4351 SmiToInteger64(expected.reg(), expected.reg()); | 4350 SmiToInteger64(expected.reg(), expected.reg()); |
4352 } | 4351 } |
4353 } | 4352 } |
4354 bind(&skip_flooding); | 4353 bind(&skip_hook); |
4355 } | 4354 } |
4356 | 4355 |
4357 void MacroAssembler::StubPrologue(StackFrame::Type type) { | 4356 void MacroAssembler::StubPrologue(StackFrame::Type type) { |
4358 pushq(rbp); // Caller's frame pointer. | 4357 pushq(rbp); // Caller's frame pointer. |
4359 movp(rbp, rsp); | 4358 movp(rbp, rsp); |
4360 Push(Smi::FromInt(type)); | 4359 Push(Smi::FromInt(type)); |
4361 } | 4360 } |
4362 | 4361 |
4363 void MacroAssembler::Prologue(bool code_pre_aging) { | 4362 void MacroAssembler::Prologue(bool code_pre_aging) { |
4364 PredictableCodeSizeScope predictible_code_size_scope(this, | 4363 PredictableCodeSizeScope predictible_code_size_scope(this, |
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5297 movl(rax, dividend); | 5296 movl(rax, dividend); |
5298 shrl(rax, Immediate(31)); | 5297 shrl(rax, Immediate(31)); |
5299 addl(rdx, rax); | 5298 addl(rdx, rax); |
5300 } | 5299 } |
5301 | 5300 |
5302 | 5301 |
5303 } // namespace internal | 5302 } // namespace internal |
5304 } // namespace v8 | 5303 } // namespace v8 |
5305 | 5304 |
5306 #endif // V8_TARGET_ARCH_X64 | 5305 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |