| 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 2462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2473 __ CmpP(r2, r6); // Compare before moving to next argument. | 2473 __ CmpP(r2, r6); // Compare before moving to next argument. |
| 2474 __ lay(r2, MemOperand(r2, -kPointerSize)); | 2474 __ lay(r2, MemOperand(r2, -kPointerSize)); |
| 2475 __ bne(©); | 2475 __ bne(©); |
| 2476 | 2476 |
| 2477 __ b(&invoke); | 2477 __ b(&invoke); |
| 2478 } | 2478 } |
| 2479 | 2479 |
| 2480 { // Too few parameters: Actual < expected | 2480 { // Too few parameters: Actual < expected |
| 2481 __ bind(&too_few); | 2481 __ bind(&too_few); |
| 2482 | 2482 |
| 2483 // If the function is strong we need to throw an error. | |
| 2484 Label no_strong_error; | |
| 2485 __ LoadP(r6, FieldMemOperand(r3, JSFunction::kSharedFunctionInfoOffset)); | |
| 2486 __ LoadlW(r7, | |
| 2487 FieldMemOperand(r6, SharedFunctionInfo::kCompilerHintsOffset)); | |
| 2488 __ TestBit(r7, SharedFunctionInfo::kStrongModeBit, r0); | |
| 2489 __ beq(&no_strong_error); | |
| 2490 | |
| 2491 // What we really care about is the required number of arguments. | |
| 2492 __ LoadlW(r6, FieldMemOperand(r6, SharedFunctionInfo::kLengthOffset)); | |
| 2493 #if V8_TARGET_ARCH_S390X | |
| 2494 // See commment near kLenghtOffset in src/objects.h | |
| 2495 __ ShiftRightArith(r6, r6, Operand(kSmiTagSize)); | |
| 2496 #else | |
| 2497 __ SmiUntag(r6); | |
| 2498 #endif | |
| 2499 __ CmpP(r2, r6); | |
| 2500 __ bge(&no_strong_error); | |
| 2501 | |
| 2502 { | |
| 2503 FrameScope frame(masm, StackFrame::MANUAL); | |
| 2504 EnterArgumentsAdaptorFrame(masm); | |
| 2505 __ CallRuntime(Runtime::kThrowStrongModeTooFewArguments); | |
| 2506 } | |
| 2507 | |
| 2508 __ bind(&no_strong_error); | |
| 2509 EnterArgumentsAdaptorFrame(masm); | 2483 EnterArgumentsAdaptorFrame(masm); |
| 2510 ArgumentAdaptorStackCheck(masm, &stack_overflow); | 2484 ArgumentAdaptorStackCheck(masm, &stack_overflow); |
| 2511 | 2485 |
| 2512 // Calculate copy start address into r0 and copy end address is fp. | 2486 // Calculate copy start address into r0 and copy end address is fp. |
| 2513 // r2: actual number of arguments as a smi | 2487 // r2: actual number of arguments as a smi |
| 2514 // r3: function | 2488 // r3: function |
| 2515 // r4: expected number of arguments | 2489 // r4: expected number of arguments |
| 2516 // r5: new target (passed through to callee) | 2490 // r5: new target (passed through to callee) |
| 2517 // ip: code entry to call | 2491 // ip: code entry to call |
| 2518 __ SmiToPtrArrayOffset(r2, r2); | 2492 __ SmiToPtrArrayOffset(r2, r2); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2579 __ bkpt(0); | 2553 __ bkpt(0); |
| 2580 } | 2554 } |
| 2581 } | 2555 } |
| 2582 | 2556 |
| 2583 #undef __ | 2557 #undef __ |
| 2584 | 2558 |
| 2585 } // namespace internal | 2559 } // namespace internal |
| 2586 } // namespace v8 | 2560 } // namespace v8 |
| 2587 | 2561 |
| 2588 #endif // V8_TARGET_ARCH_S390 | 2562 #endif // V8_TARGET_ARCH_S390 |
| OLD | NEW |