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 1638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1649 __ mov(r1, r0); | 1649 __ mov(r1, r0); |
1650 __ Pop(r0); | 1650 __ Pop(r0); |
1651 __ SmiUntag(r0); | 1651 __ SmiUntag(r0); |
1652 } | 1652 } |
1653 // The delegate is always a regular function. | 1653 // The delegate is always a regular function. |
1654 __ AssertFunction(r1); | 1654 __ AssertFunction(r1); |
1655 __ Jump(masm->isolate()->builtins()->CallFunction(), RelocInfo::CODE_TARGET); | 1655 __ Jump(masm->isolate()->builtins()->CallFunction(), RelocInfo::CODE_TARGET); |
1656 } | 1656 } |
1657 | 1657 |
1658 | 1658 |
| 1659 // static |
| 1660 void Builtins::Generate_PushArgsAndCall(MacroAssembler* masm) { |
| 1661 // ----------- S t a t e ------------- |
| 1662 // -- r0 : the number of arguments (not including the receiver) |
| 1663 // -- r2 : the address of the first argument to be pushed. Subsequent |
| 1664 // arguments should be consecutive above this, in the same order as |
| 1665 // they are to be pushed onto the stack. |
| 1666 // -- r1 : the target to call (can be any Object). |
| 1667 |
| 1668 // Find the address of the last argument. |
| 1669 __ add(r3, r0, Operand(1)); // Add one for receiver. |
| 1670 __ mov(r3, Operand(r3, LSL, kPointerSizeLog2)); |
| 1671 __ sub(r3, r2, r3); |
| 1672 |
| 1673 // Push the arguments. |
| 1674 Label loop_header, loop_check; |
| 1675 __ b(al, &loop_check); |
| 1676 __ bind(&loop_header); |
| 1677 __ ldr(r4, MemOperand(r2, -kPointerSize, PostIndex)); |
| 1678 __ push(r4); |
| 1679 __ bind(&loop_check); |
| 1680 __ cmp(r2, r3); |
| 1681 __ b(gt, &loop_header); |
| 1682 |
| 1683 // Call the target. |
| 1684 __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
| 1685 } |
| 1686 |
| 1687 |
1659 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { | 1688 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
1660 // ----------- S t a t e ------------- | 1689 // ----------- S t a t e ------------- |
1661 // -- r0 : actual number of arguments | 1690 // -- r0 : actual number of arguments |
1662 // -- r1 : function (passed through to callee) | 1691 // -- r1 : function (passed through to callee) |
1663 // -- r2 : expected number of arguments | 1692 // -- r2 : expected number of arguments |
1664 // ----------------------------------- | 1693 // ----------------------------------- |
1665 | 1694 |
1666 Label stack_overflow; | 1695 Label stack_overflow; |
1667 ArgumentAdaptorStackCheck(masm, &stack_overflow); | 1696 ArgumentAdaptorStackCheck(masm, &stack_overflow); |
1668 Label invoke, dont_adapt_arguments; | 1697 Label invoke, dont_adapt_arguments; |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1799 } | 1828 } |
1800 } | 1829 } |
1801 | 1830 |
1802 | 1831 |
1803 #undef __ | 1832 #undef __ |
1804 | 1833 |
1805 } // namespace internal | 1834 } // namespace internal |
1806 } // namespace v8 | 1835 } // namespace v8 |
1807 | 1836 |
1808 #endif // V8_TARGET_ARCH_ARM | 1837 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |