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/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
9 #include "src/debug/debug.h" | 9 #include "src/debug/debug.h" |
10 #include "src/deoptimizer.h" | 10 #include "src/deoptimizer.h" |
(...skipping 2592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2603 } | 2603 } |
2604 | 2604 |
2605 { // Too few parameters: Actual < expected | 2605 { // Too few parameters: Actual < expected |
2606 __ Bind(&too_few); | 2606 __ Bind(&too_few); |
2607 | 2607 |
2608 Register copy_from = x10; | 2608 Register copy_from = x10; |
2609 Register copy_end = x11; | 2609 Register copy_end = x11; |
2610 Register copy_to = x12; | 2610 Register copy_to = x12; |
2611 Register scratch1 = x13, scratch2 = x14; | 2611 Register scratch1 = x13, scratch2 = x14; |
2612 | 2612 |
2613 // If the function is strong we need to throw an error. | |
2614 Label no_strong_error; | |
2615 __ Ldr(scratch1, | |
2616 FieldMemOperand(function, JSFunction::kSharedFunctionInfoOffset)); | |
2617 __ Ldr(scratch2.W(), | |
2618 FieldMemOperand(scratch1, SharedFunctionInfo::kCompilerHintsOffset)); | |
2619 __ TestAndBranchIfAllClear(scratch2.W(), | |
2620 (1 << SharedFunctionInfo::kStrongModeFunction), | |
2621 &no_strong_error); | |
2622 | |
2623 // What we really care about is the required number of arguments. | |
2624 DCHECK_EQ(kPointerSize, kInt64Size); | |
2625 __ Ldr(scratch2.W(), | |
2626 FieldMemOperand(scratch1, SharedFunctionInfo::kLengthOffset)); | |
2627 __ Cmp(argc_actual, Operand(scratch2, LSR, 1)); | |
2628 __ B(ge, &no_strong_error); | |
2629 | |
2630 { | |
2631 FrameScope frame(masm, StackFrame::MANUAL); | |
2632 EnterArgumentsAdaptorFrame(masm); | |
2633 __ CallRuntime(Runtime::kThrowStrongModeTooFewArguments); | |
2634 } | |
2635 | |
2636 __ Bind(&no_strong_error); | |
2637 EnterArgumentsAdaptorFrame(masm); | 2613 EnterArgumentsAdaptorFrame(masm); |
2638 ArgumentAdaptorStackCheck(masm, &stack_overflow); | 2614 ArgumentAdaptorStackCheck(masm, &stack_overflow); |
2639 | 2615 |
2640 __ Lsl(scratch2, argc_expected, kPointerSizeLog2); | 2616 __ Lsl(scratch2, argc_expected, kPointerSizeLog2); |
2641 __ Lsl(argc_actual, argc_actual, kPointerSizeLog2); | 2617 __ Lsl(argc_actual, argc_actual, kPointerSizeLog2); |
2642 | 2618 |
2643 // Adjust for fp, lr, and the receiver. | 2619 // Adjust for fp, lr, and the receiver. |
2644 __ Add(copy_from, fp, 3 * kPointerSize); | 2620 __ Add(copy_from, fp, 3 * kPointerSize); |
2645 __ Add(copy_from, copy_from, argc_actual); | 2621 __ Add(copy_from, copy_from, argc_actual); |
2646 __ Mov(copy_to, jssp); | 2622 __ Mov(copy_to, jssp); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2709 } | 2685 } |
2710 } | 2686 } |
2711 | 2687 |
2712 | 2688 |
2713 #undef __ | 2689 #undef __ |
2714 | 2690 |
2715 } // namespace internal | 2691 } // namespace internal |
2716 } // namespace v8 | 2692 } // namespace v8 |
2717 | 2693 |
2718 #endif // V8_TARGET_ARCH_ARM | 2694 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |