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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 1559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1570 __ inc(edi); | 1570 __ inc(edi); |
1571 __ push(Operand(eax, 0)); | 1571 __ push(Operand(eax, 0)); |
1572 __ sub(eax, Immediate(kPointerSize)); | 1572 __ sub(eax, Immediate(kPointerSize)); |
1573 __ cmp(edi, ebx); | 1573 __ cmp(edi, ebx); |
1574 __ j(less, ©); | 1574 __ j(less, ©); |
1575 __ jmp(&invoke); | 1575 __ jmp(&invoke); |
1576 } | 1576 } |
1577 | 1577 |
1578 { // Too few parameters: Actual < expected. | 1578 { // Too few parameters: Actual < expected. |
1579 __ bind(&too_few); | 1579 __ bind(&too_few); |
| 1580 |
| 1581 // If the function is strong we need to throw an error. |
| 1582 Label weak_function; |
| 1583 __ mov(ecx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); |
| 1584 __ test_b(FieldOperand(ecx, SharedFunctionInfo::kStrongModeByteOffset), |
| 1585 1 << SharedFunctionInfo::kStrongModeBitWithinByte); |
| 1586 __ j(equal, &weak_function, Label::kNear); |
| 1587 |
| 1588 { |
| 1589 FrameScope frame(masm, StackFrame::MANUAL); |
| 1590 EnterArgumentsAdaptorFrame(masm); |
| 1591 __ CallRuntime(Runtime::kThrowStrongModeTooFewArguments, 0); |
| 1592 } |
| 1593 |
| 1594 __ bind(&weak_function); |
1580 EnterArgumentsAdaptorFrame(masm); | 1595 EnterArgumentsAdaptorFrame(masm); |
1581 | 1596 |
1582 // Copy receiver and all actual arguments. | 1597 // Copy receiver and all actual arguments. |
1583 const int offset = StandardFrameConstants::kCallerSPOffset; | 1598 const int offset = StandardFrameConstants::kCallerSPOffset; |
1584 __ lea(edi, Operand(ebp, eax, times_4, offset)); | 1599 __ lea(edi, Operand(ebp, eax, times_4, offset)); |
1585 // ebx = expected - actual. | 1600 // ebx = expected - actual. |
1586 __ sub(ebx, eax); | 1601 __ sub(ebx, eax); |
1587 // eax = -actual - 1 | 1602 // eax = -actual - 1 |
1588 __ neg(eax); | 1603 __ neg(eax); |
1589 __ sub(eax, Immediate(1)); | 1604 __ sub(eax, Immediate(1)); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1687 | 1702 |
1688 __ bind(&ok); | 1703 __ bind(&ok); |
1689 __ ret(0); | 1704 __ ret(0); |
1690 } | 1705 } |
1691 | 1706 |
1692 #undef __ | 1707 #undef __ |
1693 } | 1708 } |
1694 } // namespace v8::internal | 1709 } // namespace v8::internal |
1695 | 1710 |
1696 #endif // V8_TARGET_ARCH_IA32 | 1711 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |