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 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 void Builtins::Generate_JSConstructStubApi(MacroAssembler* masm) { | 643 void Builtins::Generate_JSConstructStubApi(MacroAssembler* masm) { |
644 Generate_JSConstructStubHelper(masm, true, true); | 644 Generate_JSConstructStubHelper(masm, true, true); |
645 } | 645 } |
646 | 646 |
647 | 647 |
648 void Builtins::Generate_JSBuiltinsConstructStub(MacroAssembler* masm) { | 648 void Builtins::Generate_JSBuiltinsConstructStub(MacroAssembler* masm) { |
649 Generate_JSConstructStubHelper(masm, false, false); | 649 Generate_JSConstructStubHelper(masm, false, false); |
650 } | 650 } |
651 | 651 |
652 | 652 |
| 653 void Builtins::Generate_ConstructedNonConstructable(MacroAssembler* masm) { |
| 654 FrameScope scope(masm, StackFrame::INTERNAL); |
| 655 __ push(r1); |
| 656 __ CallRuntime(Runtime::kThrowConstructedNonConstructable, 1); |
| 657 } |
| 658 |
| 659 |
653 enum IsTagged { kArgcIsSmiTagged, kArgcIsUntaggedInt }; | 660 enum IsTagged { kArgcIsSmiTagged, kArgcIsUntaggedInt }; |
654 | 661 |
655 | 662 |
656 // Clobbers r2; preserves all other registers. | 663 // Clobbers r2; preserves all other registers. |
657 static void Generate_CheckStackOverflow(MacroAssembler* masm, Register argc, | 664 static void Generate_CheckStackOverflow(MacroAssembler* masm, Register argc, |
658 IsTagged argc_is_tagged) { | 665 IsTagged argc_is_tagged) { |
659 // Check the stack for overflow. We are not trying to catch | 666 // Check the stack for overflow. We are not trying to catch |
660 // interruptions (e.g. debug break and preemption) here, so the "real stack | 667 // interruptions (e.g. debug break and preemption) here, so the "real stack |
661 // limit" is checked. | 668 // limit" is checked. |
662 Label okay; | 669 Label okay; |
(...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1681 __ SmiUntag(r2); | 1688 __ SmiUntag(r2); |
1682 __ ldr(r4, FieldMemOperand(r1, JSFunction::kCodeEntryOffset)); | 1689 __ ldr(r4, FieldMemOperand(r1, JSFunction::kCodeEntryOffset)); |
1683 ParameterCount actual(r0); | 1690 ParameterCount actual(r0); |
1684 ParameterCount expected(r2); | 1691 ParameterCount expected(r2); |
1685 __ InvokeCode(r4, no_reg, expected, actual, JUMP_FUNCTION, NullCallWrapper()); | 1692 __ InvokeCode(r4, no_reg, expected, actual, JUMP_FUNCTION, NullCallWrapper()); |
1686 | 1693 |
1687 // The function is a "classConstructor", need to raise an exception. | 1694 // The function is a "classConstructor", need to raise an exception. |
1688 __ bind(&class_constructor); | 1695 __ bind(&class_constructor); |
1689 { | 1696 { |
1690 FrameScope frame(masm, StackFrame::INTERNAL); | 1697 FrameScope frame(masm, StackFrame::INTERNAL); |
1691 __ CallRuntime(Runtime::kThrowConstructorNonCallableError, 0); | 1698 __ push(r1); |
| 1699 __ CallRuntime(Runtime::kThrowConstructorNonCallableError, 1); |
1692 } | 1700 } |
1693 } | 1701 } |
1694 | 1702 |
1695 | 1703 |
1696 // static | 1704 // static |
1697 void Builtins::Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode) { | 1705 void Builtins::Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode) { |
1698 // ----------- S t a t e ------------- | 1706 // ----------- S t a t e ------------- |
1699 // -- r0 : the number of arguments (not including the receiver) | 1707 // -- r0 : the number of arguments (not including the receiver) |
1700 // -- r1 : the target to call (can be any Object). | 1708 // -- r1 : the target to call (can be any Object). |
1701 // ----------------------------------- | 1709 // ----------------------------------- |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1809 __ str(r1, MemOperand(sp, r0, LSL, kPointerSizeLog2)); | 1817 __ str(r1, MemOperand(sp, r0, LSL, kPointerSizeLog2)); |
1810 // Let the "call_as_constructor_delegate" take care of the rest. | 1818 // Let the "call_as_constructor_delegate" take care of the rest. |
1811 __ LoadGlobalFunction(Context::CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, r1); | 1819 __ LoadGlobalFunction(Context::CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, r1); |
1812 __ Jump(masm->isolate()->builtins()->CallFunction(), | 1820 __ Jump(masm->isolate()->builtins()->CallFunction(), |
1813 RelocInfo::CODE_TARGET); | 1821 RelocInfo::CODE_TARGET); |
1814 } | 1822 } |
1815 | 1823 |
1816 // Called Construct on an Object that doesn't have a [[Construct]] internal | 1824 // Called Construct on an Object that doesn't have a [[Construct]] internal |
1817 // method. | 1825 // method. |
1818 __ bind(&non_constructor); | 1826 __ bind(&non_constructor); |
1819 { | 1827 __ Jump(masm->isolate()->builtins()->ConstructedNonConstructable(), |
1820 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 1828 RelocInfo::CODE_TARGET); |
1821 __ Push(r1); | |
1822 __ CallRuntime(Runtime::kThrowCalledNonCallable, 1); | |
1823 } | |
1824 } | 1829 } |
1825 | 1830 |
1826 | 1831 |
1827 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { | 1832 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
1828 // ----------- S t a t e ------------- | 1833 // ----------- S t a t e ------------- |
1829 // -- r0 : actual number of arguments | 1834 // -- r0 : actual number of arguments |
1830 // -- r1 : function (passed through to callee) | 1835 // -- r1 : function (passed through to callee) |
1831 // -- r2 : expected number of arguments | 1836 // -- r2 : expected number of arguments |
1832 // -- r3 : new target (passed through to callee) | 1837 // -- r3 : new target (passed through to callee) |
1833 // ----------------------------------- | 1838 // ----------------------------------- |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1969 } | 1974 } |
1970 } | 1975 } |
1971 | 1976 |
1972 | 1977 |
1973 #undef __ | 1978 #undef __ |
1974 | 1979 |
1975 } // namespace internal | 1980 } // namespace internal |
1976 } // namespace v8 | 1981 } // namespace v8 |
1977 | 1982 |
1978 #endif // V8_TARGET_ARCH_ARM | 1983 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |