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_PPC | 5 #if V8_TARGET_ARCH_PPC |
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 1655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1666 __ mr(r4, r3); | 1666 __ mr(r4, r3); |
1667 __ Pop(r3); | 1667 __ Pop(r3); |
1668 __ SmiUntag(r3); | 1668 __ SmiUntag(r3); |
1669 } | 1669 } |
1670 // The delegate is always a regular function. | 1670 // The delegate is always a regular function. |
1671 __ AssertFunction(r4); | 1671 __ AssertFunction(r4); |
1672 __ Jump(masm->isolate()->builtins()->CallFunction(), RelocInfo::CODE_TARGET); | 1672 __ Jump(masm->isolate()->builtins()->CallFunction(), RelocInfo::CODE_TARGET); |
1673 } | 1673 } |
1674 | 1674 |
1675 | 1675 |
| 1676 // static |
| 1677 void Builtins::Generate_PushArgsAndCall(MacroAssembler* masm) { |
| 1678 // ----------- S t a t e ------------- |
| 1679 // -- r3 : the number of arguments (not including the receiver) |
| 1680 // -- r5 : the address of the first argument to be pushed. Subsequent |
| 1681 // arguments should be consecutive above this, in the same order as |
| 1682 // they are to be pushed onto the stack. |
| 1683 // -- r4 : the target to call (can be any Object). |
| 1684 |
| 1685 // Calculate number of arguments (add one for receiver). |
| 1686 __ addi(r6, r3, Operand(1)); |
| 1687 |
| 1688 // Push the arguments. |
| 1689 Label loop; |
| 1690 __ addi(r5, r5, Operand(kPointerSize)); // Bias up for LoadPU |
| 1691 __ mtctr(r6); |
| 1692 __ bind(&loop); |
| 1693 __ LoadPU(r6, MemOperand(r5, -kPointerSize)); |
| 1694 __ push(r6); |
| 1695 __ bdnz(&loop); |
| 1696 |
| 1697 // Call the target. |
| 1698 __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
| 1699 } |
| 1700 |
| 1701 |
1676 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { | 1702 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
1677 // ----------- S t a t e ------------- | 1703 // ----------- S t a t e ------------- |
1678 // -- r3 : actual number of arguments | 1704 // -- r3 : actual number of arguments |
1679 // -- r4 : function (passed through to callee) | 1705 // -- r4 : function (passed through to callee) |
1680 // -- r5 : expected number of arguments | 1706 // -- r5 : expected number of arguments |
1681 // ----------------------------------- | 1707 // ----------------------------------- |
1682 | 1708 |
1683 Label stack_overflow; | 1709 Label stack_overflow; |
1684 ArgumentAdaptorStackCheck(masm, &stack_overflow); | 1710 ArgumentAdaptorStackCheck(masm, &stack_overflow); |
1685 Label invoke, dont_adapt_arguments; | 1711 Label invoke, dont_adapt_arguments; |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1830 __ bkpt(0); | 1856 __ bkpt(0); |
1831 } | 1857 } |
1832 } | 1858 } |
1833 | 1859 |
1834 | 1860 |
1835 #undef __ | 1861 #undef __ |
1836 } // namespace internal | 1862 } // namespace internal |
1837 } // namespace v8 | 1863 } // namespace v8 |
1838 | 1864 |
1839 #endif // V8_TARGET_ARCH_PPC | 1865 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |