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 #if V8_TARGET_ARCH_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
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 2348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2359 // MAsm::InvokeFunctionCode and we can just fall through. | 2359 // MAsm::InvokeFunctionCode and we can just fall through. |
2360 B(done); | 2360 B(done); |
2361 } | 2361 } |
2362 } else { | 2362 } else { |
2363 Jump(adaptor, RelocInfo::CODE_TARGET); | 2363 Jump(adaptor, RelocInfo::CODE_TARGET); |
2364 } | 2364 } |
2365 } | 2365 } |
2366 Bind(®ular_invoke); | 2366 Bind(®ular_invoke); |
2367 } | 2367 } |
2368 | 2368 |
2369 | 2369 void MacroAssembler::CheckDebugHook(Register fun, Register new_target, |
2370 void MacroAssembler::FloodFunctionIfStepping(Register fun, Register new_target, | 2370 const ParameterCount& expected, |
2371 const ParameterCount& expected, | 2371 const ParameterCount& actual) { |
2372 const ParameterCount& actual) { | 2372 Label skip_hook; |
2373 Label skip_flooding; | 2373 ExternalReference debug_hook_active = |
2374 ExternalReference last_step_action = | 2374 ExternalReference::debug_hook_on_function_call_address(isolate()); |
2375 ExternalReference::debug_last_step_action_address(isolate()); | 2375 Mov(x4, Operand(debug_hook_active)); |
2376 STATIC_ASSERT(StepFrame > StepIn); | |
2377 Mov(x4, Operand(last_step_action)); | |
2378 Ldrsb(x4, MemOperand(x4)); | 2376 Ldrsb(x4, MemOperand(x4)); |
2379 CompareAndBranch(x4, Operand(StepIn), lt, &skip_flooding); | 2377 CompareAndBranch(x4, Operand(0), eq, &skip_hook); |
2380 { | 2378 { |
2381 FrameScope frame(this, | 2379 FrameScope frame(this, |
2382 has_frame() ? StackFrame::NONE : StackFrame::INTERNAL); | 2380 has_frame() ? StackFrame::NONE : StackFrame::INTERNAL); |
2383 if (expected.is_reg()) { | 2381 if (expected.is_reg()) { |
2384 SmiTag(expected.reg()); | 2382 SmiTag(expected.reg()); |
2385 Push(expected.reg()); | 2383 Push(expected.reg()); |
2386 } | 2384 } |
2387 if (actual.is_reg()) { | 2385 if (actual.is_reg()) { |
2388 SmiTag(actual.reg()); | 2386 SmiTag(actual.reg()); |
2389 Push(actual.reg()); | 2387 Push(actual.reg()); |
2390 } | 2388 } |
2391 if (new_target.is_valid()) { | 2389 if (new_target.is_valid()) { |
2392 Push(new_target); | 2390 Push(new_target); |
2393 } | 2391 } |
2394 Push(fun); | 2392 Push(fun); |
2395 Push(fun); | 2393 Push(fun); |
2396 CallRuntime(Runtime::kDebugPrepareStepInIfStepping); | 2394 CallRuntime(Runtime::kDebugOnFunctionCall); |
2397 Pop(fun); | 2395 Pop(fun); |
2398 if (new_target.is_valid()) { | 2396 if (new_target.is_valid()) { |
2399 Pop(new_target); | 2397 Pop(new_target); |
2400 } | 2398 } |
2401 if (actual.is_reg()) { | 2399 if (actual.is_reg()) { |
2402 Pop(actual.reg()); | 2400 Pop(actual.reg()); |
2403 SmiUntag(actual.reg()); | 2401 SmiUntag(actual.reg()); |
2404 } | 2402 } |
2405 if (expected.is_reg()) { | 2403 if (expected.is_reg()) { |
2406 Pop(expected.reg()); | 2404 Pop(expected.reg()); |
2407 SmiUntag(expected.reg()); | 2405 SmiUntag(expected.reg()); |
2408 } | 2406 } |
2409 } | 2407 } |
2410 bind(&skip_flooding); | 2408 bind(&skip_hook); |
2411 } | 2409 } |
2412 | 2410 |
2413 | 2411 |
2414 void MacroAssembler::InvokeFunctionCode(Register function, Register new_target, | 2412 void MacroAssembler::InvokeFunctionCode(Register function, Register new_target, |
2415 const ParameterCount& expected, | 2413 const ParameterCount& expected, |
2416 const ParameterCount& actual, | 2414 const ParameterCount& actual, |
2417 InvokeFlag flag, | 2415 InvokeFlag flag, |
2418 const CallWrapper& call_wrapper) { | 2416 const CallWrapper& call_wrapper) { |
2419 // You can't call a function without a valid frame. | 2417 // You can't call a function without a valid frame. |
2420 DCHECK(flag == JUMP_FUNCTION || has_frame()); | 2418 DCHECK(flag == JUMP_FUNCTION || has_frame()); |
2421 DCHECK(function.is(x1)); | 2419 DCHECK(function.is(x1)); |
2422 DCHECK_IMPLIES(new_target.is_valid(), new_target.is(x3)); | 2420 DCHECK_IMPLIES(new_target.is_valid(), new_target.is(x3)); |
2423 | 2421 |
2424 FloodFunctionIfStepping(function, new_target, expected, actual); | 2422 if (call_wrapper.NeedsDebugHookCheck()) { |
| 2423 CheckDebugHook(function, new_target, expected, actual); |
| 2424 } |
2425 | 2425 |
2426 // Clear the new.target register if not given. | 2426 // Clear the new.target register if not given. |
2427 if (!new_target.is_valid()) { | 2427 if (!new_target.is_valid()) { |
2428 LoadRoot(x3, Heap::kUndefinedValueRootIndex); | 2428 LoadRoot(x3, Heap::kUndefinedValueRootIndex); |
2429 } | 2429 } |
2430 | 2430 |
2431 Label done; | 2431 Label done; |
2432 bool definitely_mismatches = false; | 2432 bool definitely_mismatches = false; |
2433 InvokePrologue(expected, actual, &done, flag, &definitely_mismatches, | 2433 InvokePrologue(expected, actual, &done, flag, &definitely_mismatches, |
2434 call_wrapper); | 2434 call_wrapper); |
(...skipping 2233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4668 } | 4668 } |
4669 | 4669 |
4670 | 4670 |
4671 #undef __ | 4671 #undef __ |
4672 | 4672 |
4673 | 4673 |
4674 } // namespace internal | 4674 } // namespace internal |
4675 } // namespace v8 | 4675 } // namespace v8 |
4676 | 4676 |
4677 #endif // V8_TARGET_ARCH_ARM64 | 4677 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |