| 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_S390 | 5 #if V8_TARGET_ARCH_S390 |
| 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 2478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2489 __ CmpP(r2, r6); // Compare before moving to next argument. | 2489 __ CmpP(r2, r6); // Compare before moving to next argument. |
| 2490 __ lay(r2, MemOperand(r2, -kPointerSize)); | 2490 __ lay(r2, MemOperand(r2, -kPointerSize)); |
| 2491 __ bne(©); | 2491 __ bne(©); |
| 2492 | 2492 |
| 2493 __ b(&invoke); | 2493 __ b(&invoke); |
| 2494 } | 2494 } |
| 2495 | 2495 |
| 2496 { // Too few parameters: Actual < expected | 2496 { // Too few parameters: Actual < expected |
| 2497 __ bind(&too_few); | 2497 __ bind(&too_few); |
| 2498 | 2498 |
| 2499 // If the function is strong we need to throw an error. | |
| 2500 Label no_strong_error; | |
| 2501 __ LoadP(r6, FieldMemOperand(r3, JSFunction::kSharedFunctionInfoOffset)); | |
| 2502 __ LoadlW(r7, | |
| 2503 FieldMemOperand(r6, SharedFunctionInfo::kCompilerHintsOffset)); | |
| 2504 __ TestBit(r7, SharedFunctionInfo::kStrongModeBit, r0); | |
| 2505 __ beq(&no_strong_error); | |
| 2506 | |
| 2507 // What we really care about is the required number of arguments. | |
| 2508 __ LoadlW(r6, FieldMemOperand(r6, SharedFunctionInfo::kLengthOffset)); | |
| 2509 #if V8_TARGET_ARCH_S390X | |
| 2510 // See commment near kLenghtOffset in src/objects.h | |
| 2511 __ ShiftRightArith(r6, r6, Operand(kSmiTagSize)); | |
| 2512 #else | |
| 2513 __ SmiUntag(r6); | |
| 2514 #endif | |
| 2515 __ CmpP(r2, r6); | |
| 2516 __ bge(&no_strong_error); | |
| 2517 | |
| 2518 { | |
| 2519 FrameScope frame(masm, StackFrame::MANUAL); | |
| 2520 EnterArgumentsAdaptorFrame(masm); | |
| 2521 __ CallRuntime(Runtime::kThrowStrongModeTooFewArguments); | |
| 2522 } | |
| 2523 | |
| 2524 __ bind(&no_strong_error); | |
| 2525 EnterArgumentsAdaptorFrame(masm); | 2499 EnterArgumentsAdaptorFrame(masm); |
| 2526 ArgumentAdaptorStackCheck(masm, &stack_overflow); | 2500 ArgumentAdaptorStackCheck(masm, &stack_overflow); |
| 2527 | 2501 |
| 2528 // Calculate copy start address into r0 and copy end address is fp. | 2502 // Calculate copy start address into r0 and copy end address is fp. |
| 2529 // r2: actual number of arguments as a smi | 2503 // r2: actual number of arguments as a smi |
| 2530 // r3: function | 2504 // r3: function |
| 2531 // r4: expected number of arguments | 2505 // r4: expected number of arguments |
| 2532 // r5: new target (passed through to callee) | 2506 // r5: new target (passed through to callee) |
| 2533 // ip: code entry to call | 2507 // ip: code entry to call |
| 2534 __ SmiToPtrArrayOffset(r2, r2); | 2508 __ SmiToPtrArrayOffset(r2, r2); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2595 __ bkpt(0); | 2569 __ bkpt(0); |
| 2596 } | 2570 } |
| 2597 } | 2571 } |
| 2598 | 2572 |
| 2599 #undef __ | 2573 #undef __ |
| 2600 | 2574 |
| 2601 } // namespace internal | 2575 } // namespace internal |
| 2602 } // namespace v8 | 2576 } // namespace v8 |
| 2603 | 2577 |
| 2604 #endif // V8_TARGET_ARCH_S390 | 2578 #endif // V8_TARGET_ARCH_S390 |
| OLD | NEW |