| 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 2536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2547 } | 2547 } |
| 2548 | 2548 |
| 2549 { // Too few parameters: Actual < expected | 2549 { // Too few parameters: Actual < expected |
| 2550 __ Bind(&too_few); | 2550 __ Bind(&too_few); |
| 2551 | 2551 |
| 2552 Register copy_from = x10; | 2552 Register copy_from = x10; |
| 2553 Register copy_end = x11; | 2553 Register copy_end = x11; |
| 2554 Register copy_to = x12; | 2554 Register copy_to = x12; |
| 2555 Register scratch1 = x13, scratch2 = x14; | 2555 Register scratch1 = x13, scratch2 = x14; |
| 2556 | 2556 |
| 2557 // If the function is strong we need to throw an error. | |
| 2558 Label no_strong_error; | |
| 2559 __ Ldr(scratch1, | |
| 2560 FieldMemOperand(function, JSFunction::kSharedFunctionInfoOffset)); | |
| 2561 __ Ldr(scratch2.W(), | |
| 2562 FieldMemOperand(scratch1, SharedFunctionInfo::kCompilerHintsOffset)); | |
| 2563 __ TestAndBranchIfAllClear(scratch2.W(), | |
| 2564 (1 << SharedFunctionInfo::kStrongModeFunction), | |
| 2565 &no_strong_error); | |
| 2566 | |
| 2567 // What we really care about is the required number of arguments. | |
| 2568 DCHECK_EQ(kPointerSize, kInt64Size); | |
| 2569 __ Ldr(scratch2.W(), | |
| 2570 FieldMemOperand(scratch1, SharedFunctionInfo::kLengthOffset)); | |
| 2571 __ Cmp(argc_actual, Operand(scratch2, LSR, 1)); | |
| 2572 __ B(ge, &no_strong_error); | |
| 2573 | |
| 2574 { | |
| 2575 FrameScope frame(masm, StackFrame::MANUAL); | |
| 2576 EnterArgumentsAdaptorFrame(masm); | |
| 2577 __ CallRuntime(Runtime::kThrowStrongModeTooFewArguments); | |
| 2578 } | |
| 2579 | |
| 2580 __ Bind(&no_strong_error); | |
| 2581 EnterArgumentsAdaptorFrame(masm); | 2557 EnterArgumentsAdaptorFrame(masm); |
| 2582 ArgumentAdaptorStackCheck(masm, &stack_overflow); | 2558 ArgumentAdaptorStackCheck(masm, &stack_overflow); |
| 2583 | 2559 |
| 2584 __ Lsl(scratch2, argc_expected, kPointerSizeLog2); | 2560 __ Lsl(scratch2, argc_expected, kPointerSizeLog2); |
| 2585 __ Lsl(argc_actual, argc_actual, kPointerSizeLog2); | 2561 __ Lsl(argc_actual, argc_actual, kPointerSizeLog2); |
| 2586 | 2562 |
| 2587 // Adjust for fp, lr, and the receiver. | 2563 // Adjust for fp, lr, and the receiver. |
| 2588 __ Add(copy_from, fp, 3 * kPointerSize); | 2564 __ Add(copy_from, fp, 3 * kPointerSize); |
| 2589 __ Add(copy_from, copy_from, argc_actual); | 2565 __ Add(copy_from, copy_from, argc_actual); |
| 2590 __ Mov(copy_to, jssp); | 2566 __ Mov(copy_to, jssp); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2653 } | 2629 } |
| 2654 } | 2630 } |
| 2655 | 2631 |
| 2656 | 2632 |
| 2657 #undef __ | 2633 #undef __ |
| 2658 | 2634 |
| 2659 } // namespace internal | 2635 } // namespace internal |
| 2660 } // namespace v8 | 2636 } // namespace v8 |
| 2661 | 2637 |
| 2662 #endif // V8_TARGET_ARCH_ARM | 2638 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |