| 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_ARM | 5 #if V8_TARGET_ARCH_ARM |
| 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 2399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2410 __ push(ip); | 2410 __ push(ip); |
| 2411 __ cmp(r0, r4); // Compare before moving to next argument. | 2411 __ cmp(r0, r4); // Compare before moving to next argument. |
| 2412 __ sub(r0, r0, Operand(kPointerSize)); | 2412 __ sub(r0, r0, Operand(kPointerSize)); |
| 2413 __ b(ne, ©); | 2413 __ b(ne, ©); |
| 2414 | 2414 |
| 2415 __ b(&invoke); | 2415 __ b(&invoke); |
| 2416 } | 2416 } |
| 2417 | 2417 |
| 2418 { // Too few parameters: Actual < expected | 2418 { // Too few parameters: Actual < expected |
| 2419 __ bind(&too_few); | 2419 __ bind(&too_few); |
| 2420 | |
| 2421 // If the function is strong we need to throw an error. | |
| 2422 Label no_strong_error; | |
| 2423 __ ldr(r4, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); | |
| 2424 __ ldr(r5, FieldMemOperand(r4, SharedFunctionInfo::kCompilerHintsOffset)); | |
| 2425 __ tst(r5, Operand(1 << (SharedFunctionInfo::kStrongModeFunction + | |
| 2426 kSmiTagSize))); | |
| 2427 __ b(eq, &no_strong_error); | |
| 2428 | |
| 2429 // What we really care about is the required number of arguments. | |
| 2430 __ ldr(r4, FieldMemOperand(r4, SharedFunctionInfo::kLengthOffset)); | |
| 2431 __ cmp(r0, Operand::SmiUntag(r4)); | |
| 2432 __ b(ge, &no_strong_error); | |
| 2433 | |
| 2434 { | |
| 2435 FrameScope frame(masm, StackFrame::MANUAL); | |
| 2436 EnterArgumentsAdaptorFrame(masm); | |
| 2437 __ CallRuntime(Runtime::kThrowStrongModeTooFewArguments); | |
| 2438 } | |
| 2439 | |
| 2440 __ bind(&no_strong_error); | |
| 2441 EnterArgumentsAdaptorFrame(masm); | 2420 EnterArgumentsAdaptorFrame(masm); |
| 2442 ArgumentAdaptorStackCheck(masm, &stack_overflow); | 2421 ArgumentAdaptorStackCheck(masm, &stack_overflow); |
| 2443 | 2422 |
| 2444 // Calculate copy start address into r0 and copy end address is fp. | 2423 // Calculate copy start address into r0 and copy end address is fp. |
| 2445 // r0: actual number of arguments as a smi | 2424 // r0: actual number of arguments as a smi |
| 2446 // r1: function | 2425 // r1: function |
| 2447 // r2: expected number of arguments | 2426 // r2: expected number of arguments |
| 2448 // r3: new target (passed through to callee) | 2427 // r3: new target (passed through to callee) |
| 2449 __ add(r0, fp, Operand::PointerOffsetFromSmiKey(r0)); | 2428 __ add(r0, fp, Operand::PointerOffsetFromSmiKey(r0)); |
| 2450 | 2429 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2511 } | 2490 } |
| 2512 } | 2491 } |
| 2513 | 2492 |
| 2514 | 2493 |
| 2515 #undef __ | 2494 #undef __ |
| 2516 | 2495 |
| 2517 } // namespace internal | 2496 } // namespace internal |
| 2518 } // namespace v8 | 2497 } // namespace v8 |
| 2519 | 2498 |
| 2520 #endif // V8_TARGET_ARCH_ARM | 2499 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |