OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
6 | 6 |
7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
(...skipping 2533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2544 __ cmp(r3, r7); // Compare before moving to next argument. | 2544 __ cmp(r3, r7); // Compare before moving to next argument. |
2545 __ subi(r3, r3, Operand(kPointerSize)); | 2545 __ subi(r3, r3, Operand(kPointerSize)); |
2546 __ bne(©); | 2546 __ bne(©); |
2547 | 2547 |
2548 __ b(&invoke); | 2548 __ b(&invoke); |
2549 } | 2549 } |
2550 | 2550 |
2551 { // Too few parameters: Actual < expected | 2551 { // Too few parameters: Actual < expected |
2552 __ bind(&too_few); | 2552 __ bind(&too_few); |
2553 | 2553 |
2554 // If the function is strong we need to throw an error. | |
2555 Label no_strong_error; | |
2556 __ LoadP(r7, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); | |
2557 __ lwz(r8, FieldMemOperand(r7, SharedFunctionInfo::kCompilerHintsOffset)); | |
2558 __ TestBit(r8, SharedFunctionInfo::kStrongModeBit, r0); | |
2559 __ beq(&no_strong_error, cr0); | |
2560 | |
2561 // What we really care about is the required number of arguments. | |
2562 __ lwz(r7, FieldMemOperand(r7, SharedFunctionInfo::kLengthOffset)); | |
2563 #if V8_TARGET_ARCH_PPC64 | |
2564 // See commment near kLenghtOffset in src/objects.h | |
2565 __ srawi(r7, r7, kSmiTagSize); | |
2566 #else | |
2567 __ SmiUntag(r7); | |
2568 #endif | |
2569 __ cmp(r3, r7); | |
2570 __ bge(&no_strong_error); | |
2571 | |
2572 { | |
2573 FrameScope frame(masm, StackFrame::MANUAL); | |
2574 EnterArgumentsAdaptorFrame(masm); | |
2575 __ CallRuntime(Runtime::kThrowStrongModeTooFewArguments); | |
2576 } | |
2577 | |
2578 __ bind(&no_strong_error); | |
2579 EnterArgumentsAdaptorFrame(masm); | 2554 EnterArgumentsAdaptorFrame(masm); |
2580 ArgumentAdaptorStackCheck(masm, &stack_overflow); | 2555 ArgumentAdaptorStackCheck(masm, &stack_overflow); |
2581 | 2556 |
2582 // Calculate copy start address into r0 and copy end address is fp. | 2557 // Calculate copy start address into r0 and copy end address is fp. |
2583 // r3: actual number of arguments as a smi | 2558 // r3: actual number of arguments as a smi |
2584 // r4: function | 2559 // r4: function |
2585 // r5: expected number of arguments | 2560 // r5: expected number of arguments |
2586 // r6: new target (passed through to callee) | 2561 // r6: new target (passed through to callee) |
2587 // ip: code entry to call | 2562 // ip: code entry to call |
2588 __ SmiToPtrArrayOffset(r3, r3); | 2563 __ SmiToPtrArrayOffset(r3, r3); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2651 __ bkpt(0); | 2626 __ bkpt(0); |
2652 } | 2627 } |
2653 } | 2628 } |
2654 | 2629 |
2655 | 2630 |
2656 #undef __ | 2631 #undef __ |
2657 } // namespace internal | 2632 } // namespace internal |
2658 } // namespace v8 | 2633 } // namespace v8 |
2659 | 2634 |
2660 #endif // V8_TARGET_ARCH_PPC | 2635 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |