| 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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
| 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 2538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2549 __ lw(t0, MemOperand(a0)); | 2549 __ lw(t0, MemOperand(a0)); |
| 2550 __ push(t0); | 2550 __ push(t0); |
| 2551 __ Branch(USE_DELAY_SLOT, ©, ne, a0, Operand(t1)); | 2551 __ Branch(USE_DELAY_SLOT, ©, ne, a0, Operand(t1)); |
| 2552 __ addiu(a0, a0, -kPointerSize); // In delay slot. | 2552 __ addiu(a0, a0, -kPointerSize); // In delay slot. |
| 2553 | 2553 |
| 2554 __ jmp(&invoke); | 2554 __ jmp(&invoke); |
| 2555 } | 2555 } |
| 2556 | 2556 |
| 2557 { // Too few parameters: Actual < expected. | 2557 { // Too few parameters: Actual < expected. |
| 2558 __ bind(&too_few); | 2558 __ bind(&too_few); |
| 2559 | |
| 2560 // If the function is strong we need to throw an error. | |
| 2561 Label no_strong_error; | |
| 2562 __ lw(t1, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); | |
| 2563 __ lw(t2, FieldMemOperand(t1, SharedFunctionInfo::kCompilerHintsOffset)); | |
| 2564 __ And(t3, t2, Operand(1 << (SharedFunctionInfo::kStrongModeFunction + | |
| 2565 kSmiTagSize))); | |
| 2566 __ Branch(&no_strong_error, eq, t3, Operand(zero_reg)); | |
| 2567 | |
| 2568 // What we really care about is the required number of arguments. | |
| 2569 __ lw(t2, FieldMemOperand(t1, SharedFunctionInfo::kLengthOffset)); | |
| 2570 __ SmiUntag(t2); | |
| 2571 __ Branch(&no_strong_error, ge, a0, Operand(t2)); | |
| 2572 | |
| 2573 { | |
| 2574 FrameScope frame(masm, StackFrame::MANUAL); | |
| 2575 EnterArgumentsAdaptorFrame(masm); | |
| 2576 __ CallRuntime(Runtime::kThrowStrongModeTooFewArguments); | |
| 2577 } | |
| 2578 | |
| 2579 __ bind(&no_strong_error); | |
| 2580 EnterArgumentsAdaptorFrame(masm); | 2559 EnterArgumentsAdaptorFrame(masm); |
| 2581 ArgumentAdaptorStackCheck(masm, &stack_overflow); | 2560 ArgumentAdaptorStackCheck(masm, &stack_overflow); |
| 2582 | 2561 |
| 2583 // Calculate copy start address into a0 and copy end address into t3. | 2562 // Calculate copy start address into a0 and copy end address into t3. |
| 2584 // a0: actual number of arguments as a smi | 2563 // a0: actual number of arguments as a smi |
| 2585 // a1: function | 2564 // a1: function |
| 2586 // a2: expected number of arguments | 2565 // a2: expected number of arguments |
| 2587 // a3: new target (passed through to callee) | 2566 // a3: new target (passed through to callee) |
| 2588 __ Lsa(a0, fp, a0, kPointerSizeLog2 - kSmiTagSize); | 2567 __ Lsa(a0, fp, a0, kPointerSizeLog2 - kSmiTagSize); |
| 2589 // Adjust for return address and receiver. | 2568 // Adjust for return address and receiver. |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2655 } | 2634 } |
| 2656 } | 2635 } |
| 2657 | 2636 |
| 2658 | 2637 |
| 2659 #undef __ | 2638 #undef __ |
| 2660 | 2639 |
| 2661 } // namespace internal | 2640 } // namespace internal |
| 2662 } // namespace v8 | 2641 } // namespace v8 |
| 2663 | 2642 |
| 2664 #endif // V8_TARGET_ARCH_MIPS | 2643 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |