OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
6 | 6 |
7 #include "src/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
9 #include "src/debug/debug.h" | 9 #include "src/debug/debug.h" |
10 #include "src/deoptimizer.h" | 10 #include "src/deoptimizer.h" |
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 void Builtins::Generate_JSConstructStubApi(MacroAssembler* masm) { | 654 void Builtins::Generate_JSConstructStubApi(MacroAssembler* masm) { |
655 Generate_JSConstructStubHelper(masm, true, true); | 655 Generate_JSConstructStubHelper(masm, true, true); |
656 } | 656 } |
657 | 657 |
658 | 658 |
659 void Builtins::Generate_JSBuiltinsConstructStub(MacroAssembler* masm) { | 659 void Builtins::Generate_JSBuiltinsConstructStub(MacroAssembler* masm) { |
660 Generate_JSConstructStubHelper(masm, false, false); | 660 Generate_JSConstructStubHelper(masm, false, false); |
661 } | 661 } |
662 | 662 |
663 | 663 |
| 664 void Builtins::Generate_ConstructedNonConstructable(MacroAssembler* masm) { |
| 665 FrameScope scope(masm, StackFrame::INTERNAL); |
| 666 __ Push(x1); |
| 667 __ CallRuntime(Runtime::kThrowConstructedNonConstructable, 1); |
| 668 } |
| 669 |
| 670 |
664 enum IsTagged { kArgcIsSmiTagged, kArgcIsUntaggedInt }; | 671 enum IsTagged { kArgcIsSmiTagged, kArgcIsUntaggedInt }; |
665 | 672 |
666 | 673 |
667 // Clobbers x10, x15; preserves all other registers. | 674 // Clobbers x10, x15; preserves all other registers. |
668 static void Generate_CheckStackOverflow(MacroAssembler* masm, Register argc, | 675 static void Generate_CheckStackOverflow(MacroAssembler* masm, Register argc, |
669 IsTagged argc_is_tagged) { | 676 IsTagged argc_is_tagged) { |
670 // Check the stack for overflow. | 677 // Check the stack for overflow. |
671 // We are not trying to catch interruptions (e.g. debug break and | 678 // We are not trying to catch interruptions (e.g. debug break and |
672 // preemption) here, so the "real stack limit" is checked. | 679 // preemption) here, so the "real stack limit" is checked. |
673 Label enough_stack_space; | 680 Label enough_stack_space; |
(...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1673 x2, FieldMemOperand(x2, SharedFunctionInfo::kFormalParameterCountOffset)); | 1680 x2, FieldMemOperand(x2, SharedFunctionInfo::kFormalParameterCountOffset)); |
1674 __ Ldr(x4, FieldMemOperand(x1, JSFunction::kCodeEntryOffset)); | 1681 __ Ldr(x4, FieldMemOperand(x1, JSFunction::kCodeEntryOffset)); |
1675 ParameterCount actual(x0); | 1682 ParameterCount actual(x0); |
1676 ParameterCount expected(x2); | 1683 ParameterCount expected(x2); |
1677 __ InvokeCode(x4, no_reg, expected, actual, JUMP_FUNCTION, NullCallWrapper()); | 1684 __ InvokeCode(x4, no_reg, expected, actual, JUMP_FUNCTION, NullCallWrapper()); |
1678 | 1685 |
1679 // The function is a "classConstructor", need to raise an exception. | 1686 // The function is a "classConstructor", need to raise an exception. |
1680 __ bind(&class_constructor); | 1687 __ bind(&class_constructor); |
1681 { | 1688 { |
1682 FrameScope frame(masm, StackFrame::INTERNAL); | 1689 FrameScope frame(masm, StackFrame::INTERNAL); |
1683 __ CallRuntime(Runtime::kThrowConstructorNonCallableError, 0); | 1690 __ Push(x1); |
| 1691 __ CallRuntime(Runtime::kThrowConstructorNonCallableError, 1); |
1684 } | 1692 } |
1685 } | 1693 } |
1686 | 1694 |
1687 | 1695 |
1688 // static | 1696 // static |
1689 void Builtins::Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode) { | 1697 void Builtins::Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode) { |
1690 // ----------- S t a t e ------------- | 1698 // ----------- S t a t e ------------- |
1691 // -- x0 : the number of arguments (not including the receiver) | 1699 // -- x0 : the number of arguments (not including the receiver) |
1692 // -- x1 : the target to call (can be any Object). | 1700 // -- x1 : the target to call (can be any Object). |
1693 // ----------------------------------- | 1701 // ----------------------------------- |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1800 __ Poke(x1, Operand(x0, LSL, kXRegSizeLog2)); | 1808 __ Poke(x1, Operand(x0, LSL, kXRegSizeLog2)); |
1801 // Let the "call_as_constructor_delegate" take care of the rest. | 1809 // Let the "call_as_constructor_delegate" take care of the rest. |
1802 __ LoadGlobalFunction(Context::CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, x1); | 1810 __ LoadGlobalFunction(Context::CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, x1); |
1803 __ Jump(masm->isolate()->builtins()->CallFunction(), | 1811 __ Jump(masm->isolate()->builtins()->CallFunction(), |
1804 RelocInfo::CODE_TARGET); | 1812 RelocInfo::CODE_TARGET); |
1805 } | 1813 } |
1806 | 1814 |
1807 // Called Construct on an Object that doesn't have a [[Construct]] internal | 1815 // Called Construct on an Object that doesn't have a [[Construct]] internal |
1808 // method. | 1816 // method. |
1809 __ bind(&non_constructor); | 1817 __ bind(&non_constructor); |
1810 { | 1818 __ Jump(masm->isolate()->builtins()->ConstructedNonConstructable(), |
1811 FrameScope scope(masm, StackFrame::INTERNAL); | 1819 RelocInfo::CODE_TARGET); |
1812 __ Push(x1); | |
1813 __ CallRuntime(Runtime::kThrowCalledNonCallable, 1); | |
1814 } | |
1815 } | 1820 } |
1816 | 1821 |
1817 | 1822 |
1818 // static | 1823 // static |
1819 void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) { | 1824 void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) { |
1820 // ----------- S t a t e ------------- | 1825 // ----------- S t a t e ------------- |
1821 // -- x0 : the number of arguments (not including the receiver) | 1826 // -- x0 : the number of arguments (not including the receiver) |
1822 // -- x2 : the address of the first argument to be pushed. Subsequent | 1827 // -- x2 : the address of the first argument to be pushed. Subsequent |
1823 // arguments should be consecutive above this, in the same order as | 1828 // arguments should be consecutive above this, in the same order as |
1824 // they are to be pushed onto the stack. | 1829 // they are to be pushed onto the stack. |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2054 } | 2059 } |
2055 } | 2060 } |
2056 | 2061 |
2057 | 2062 |
2058 #undef __ | 2063 #undef __ |
2059 | 2064 |
2060 } // namespace internal | 2065 } // namespace internal |
2061 } // namespace v8 | 2066 } // namespace v8 |
2062 | 2067 |
2063 #endif // V8_TARGET_ARCH_ARM | 2068 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |