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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
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 2476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2487 __ ld(a5, MemOperand(a0)); | 2487 __ ld(a5, MemOperand(a0)); |
2488 __ push(a5); | 2488 __ push(a5); |
2489 __ Branch(USE_DELAY_SLOT, ©, ne, a0, Operand(a4)); | 2489 __ Branch(USE_DELAY_SLOT, ©, ne, a0, Operand(a4)); |
2490 __ daddiu(a0, a0, -kPointerSize); // In delay slot. | 2490 __ daddiu(a0, a0, -kPointerSize); // In delay slot. |
2491 | 2491 |
2492 __ jmp(&invoke); | 2492 __ jmp(&invoke); |
2493 } | 2493 } |
2494 | 2494 |
2495 { // Too few parameters: Actual < expected. | 2495 { // Too few parameters: Actual < expected. |
2496 __ bind(&too_few); | 2496 __ bind(&too_few); |
2497 | |
2498 // If the function is strong we need to throw an error. | |
2499 Label no_strong_error; | |
2500 __ ld(a4, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); | |
2501 __ lbu(a5, FieldMemOperand(a4, SharedFunctionInfo::kStrongModeByteOffset)); | |
2502 __ And(a5, a5, Operand(1 << SharedFunctionInfo::kStrongModeBitWithinByte)); | |
2503 __ Branch(&no_strong_error, eq, a5, Operand(zero_reg)); | |
2504 | |
2505 // What we really care about is the required number of arguments. | |
2506 DCHECK_EQ(kPointerSize, kInt64Size); | |
2507 __ lw(a5, FieldMemOperand(a4, SharedFunctionInfo::kLengthOffset)); | |
2508 __ srl(a5, a5, 1); | |
2509 __ Branch(&no_strong_error, ge, a0, Operand(a5)); | |
2510 | |
2511 { | |
2512 FrameScope frame(masm, StackFrame::MANUAL); | |
2513 EnterArgumentsAdaptorFrame(masm); | |
2514 __ CallRuntime(Runtime::kThrowStrongModeTooFewArguments); | |
2515 } | |
2516 | |
2517 __ bind(&no_strong_error); | |
2518 EnterArgumentsAdaptorFrame(masm); | 2497 EnterArgumentsAdaptorFrame(masm); |
2519 ArgumentAdaptorStackCheck(masm, &stack_overflow); | 2498 ArgumentAdaptorStackCheck(masm, &stack_overflow); |
2520 | 2499 |
2521 // Calculate copy start address into a0 and copy end address into a7. | 2500 // Calculate copy start address into a0 and copy end address into a7. |
2522 // a0: actual number of arguments as a smi | 2501 // a0: actual number of arguments as a smi |
2523 // a1: function | 2502 // a1: function |
2524 // a2: expected number of arguments | 2503 // a2: expected number of arguments |
2525 // a3: new target (passed through to callee) | 2504 // a3: new target (passed through to callee) |
2526 __ SmiScale(a0, a0, kPointerSizeLog2); | 2505 __ SmiScale(a0, a0, kPointerSizeLog2); |
2527 __ Daddu(a0, fp, a0); | 2506 __ Daddu(a0, fp, a0); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2594 } | 2573 } |
2595 } | 2574 } |
2596 | 2575 |
2597 | 2576 |
2598 #undef __ | 2577 #undef __ |
2599 | 2578 |
2600 } // namespace internal | 2579 } // namespace internal |
2601 } // namespace v8 | 2580 } // namespace v8 |
2602 | 2581 |
2603 #endif // V8_TARGET_ARCH_MIPS64 | 2582 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |