| 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 2482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2493 __ lw(t0, MemOperand(a0)); | 2493 __ lw(t0, MemOperand(a0)); |
| 2494 __ push(t0); | 2494 __ push(t0); |
| 2495 __ Branch(USE_DELAY_SLOT, ©, ne, a0, Operand(t1)); | 2495 __ Branch(USE_DELAY_SLOT, ©, ne, a0, Operand(t1)); |
| 2496 __ addiu(a0, a0, -kPointerSize); // In delay slot. | 2496 __ addiu(a0, a0, -kPointerSize); // In delay slot. |
| 2497 | 2497 |
| 2498 __ jmp(&invoke); | 2498 __ jmp(&invoke); |
| 2499 } | 2499 } |
| 2500 | 2500 |
| 2501 { // Too few parameters: Actual < expected. | 2501 { // Too few parameters: Actual < expected. |
| 2502 __ bind(&too_few); | 2502 __ bind(&too_few); |
| 2503 | |
| 2504 // If the function is strong we need to throw an error. | |
| 2505 Label no_strong_error; | |
| 2506 __ lw(t1, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); | |
| 2507 __ lw(t2, FieldMemOperand(t1, SharedFunctionInfo::kCompilerHintsOffset)); | |
| 2508 __ And(t3, t2, Operand(1 << (SharedFunctionInfo::kStrongModeFunction + | |
| 2509 kSmiTagSize))); | |
| 2510 __ Branch(&no_strong_error, eq, t3, Operand(zero_reg)); | |
| 2511 | |
| 2512 // What we really care about is the required number of arguments. | |
| 2513 __ lw(t2, FieldMemOperand(t1, SharedFunctionInfo::kLengthOffset)); | |
| 2514 __ SmiUntag(t2); | |
| 2515 __ Branch(&no_strong_error, ge, a0, Operand(t2)); | |
| 2516 | |
| 2517 { | |
| 2518 FrameScope frame(masm, StackFrame::MANUAL); | |
| 2519 EnterArgumentsAdaptorFrame(masm); | |
| 2520 __ CallRuntime(Runtime::kThrowStrongModeTooFewArguments); | |
| 2521 } | |
| 2522 | |
| 2523 __ bind(&no_strong_error); | |
| 2524 EnterArgumentsAdaptorFrame(masm); | 2503 EnterArgumentsAdaptorFrame(masm); |
| 2525 ArgumentAdaptorStackCheck(masm, &stack_overflow); | 2504 ArgumentAdaptorStackCheck(masm, &stack_overflow); |
| 2526 | 2505 |
| 2527 // Calculate copy start address into a0 and copy end address into t3. | 2506 // Calculate copy start address into a0 and copy end address into t3. |
| 2528 // a0: actual number of arguments as a smi | 2507 // a0: actual number of arguments as a smi |
| 2529 // a1: function | 2508 // a1: function |
| 2530 // a2: expected number of arguments | 2509 // a2: expected number of arguments |
| 2531 // a3: new target (passed through to callee) | 2510 // a3: new target (passed through to callee) |
| 2532 __ Lsa(a0, fp, a0, kPointerSizeLog2 - kSmiTagSize); | 2511 __ Lsa(a0, fp, a0, kPointerSizeLog2 - kSmiTagSize); |
| 2533 // Adjust for return address and receiver. | 2512 // Adjust for return address and receiver. |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2599 } | 2578 } |
| 2600 } | 2579 } |
| 2601 | 2580 |
| 2602 | 2581 |
| 2603 #undef __ | 2582 #undef __ |
| 2604 | 2583 |
| 2605 } // namespace internal | 2584 } // namespace internal |
| 2606 } // namespace v8 | 2585 } // namespace v8 |
| 2607 | 2586 |
| 2608 #endif // V8_TARGET_ARCH_MIPS | 2587 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |