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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
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 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 void Builtins::Generate_JSConstructStubApi(MacroAssembler* masm) { | 647 void Builtins::Generate_JSConstructStubApi(MacroAssembler* masm) { |
648 Generate_JSConstructStubHelper(masm, true, true); | 648 Generate_JSConstructStubHelper(masm, true, true); |
649 } | 649 } |
650 | 650 |
651 | 651 |
652 void Builtins::Generate_JSBuiltinsConstructStub(MacroAssembler* masm) { | 652 void Builtins::Generate_JSBuiltinsConstructStub(MacroAssembler* masm) { |
653 Generate_JSConstructStubHelper(masm, false, false); | 653 Generate_JSConstructStubHelper(masm, false, false); |
654 } | 654 } |
655 | 655 |
656 | 656 |
| 657 void Builtins::Generate_ConstructedNonConstructable(MacroAssembler* masm) { |
| 658 FrameScope scope(masm, StackFrame::INTERNAL); |
| 659 __ Push(a1); |
| 660 __ CallRuntime(Runtime::kThrowConstructedNonConstructable, 1); |
| 661 } |
| 662 |
| 663 |
657 enum IsTagged { kArgcIsSmiTagged, kArgcIsUntaggedInt }; | 664 enum IsTagged { kArgcIsSmiTagged, kArgcIsUntaggedInt }; |
658 | 665 |
659 | 666 |
660 // Clobbers a2; preserves all other registers. | 667 // Clobbers a2; preserves all other registers. |
661 static void Generate_CheckStackOverflow(MacroAssembler* masm, Register argc, | 668 static void Generate_CheckStackOverflow(MacroAssembler* masm, Register argc, |
662 IsTagged argc_is_tagged) { | 669 IsTagged argc_is_tagged) { |
663 // Check the stack for overflow. We are not trying to catch | 670 // Check the stack for overflow. We are not trying to catch |
664 // interruptions (e.g. debug break and preemption) here, so the "real stack | 671 // interruptions (e.g. debug break and preemption) here, so the "real stack |
665 // limit" is checked. | 672 // limit" is checked. |
666 Label okay; | 673 Label okay; |
(...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1695 FieldMemOperand(a2, SharedFunctionInfo::kFormalParameterCountOffset)); | 1702 FieldMemOperand(a2, SharedFunctionInfo::kFormalParameterCountOffset)); |
1696 __ ld(t0, FieldMemOperand(a1, JSFunction::kCodeEntryOffset)); | 1703 __ ld(t0, FieldMemOperand(a1, JSFunction::kCodeEntryOffset)); |
1697 ParameterCount actual(a0); | 1704 ParameterCount actual(a0); |
1698 ParameterCount expected(a2); | 1705 ParameterCount expected(a2); |
1699 __ InvokeCode(t0, no_reg, expected, actual, JUMP_FUNCTION, NullCallWrapper()); | 1706 __ InvokeCode(t0, no_reg, expected, actual, JUMP_FUNCTION, NullCallWrapper()); |
1700 | 1707 |
1701 // The function is a "classConstructor", need to raise an exception. | 1708 // The function is a "classConstructor", need to raise an exception. |
1702 __ bind(&class_constructor); | 1709 __ bind(&class_constructor); |
1703 { | 1710 { |
1704 FrameScope frame(masm, StackFrame::INTERNAL); | 1711 FrameScope frame(masm, StackFrame::INTERNAL); |
1705 __ CallRuntime(Runtime::kThrowConstructorNonCallableError, 0); | 1712 __ Push(a1); |
| 1713 __ CallRuntime(Runtime::kThrowConstructorNonCallableError, 1); |
1706 } | 1714 } |
1707 } | 1715 } |
1708 | 1716 |
1709 | 1717 |
1710 // static | 1718 // static |
1711 void Builtins::Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode) { | 1719 void Builtins::Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode) { |
1712 // ----------- S t a t e ------------- | 1720 // ----------- S t a t e ------------- |
1713 // -- a0 : the number of arguments (not including the receiver) | 1721 // -- a0 : the number of arguments (not including the receiver) |
1714 // -- a1 : the target to call (can be any Object). | 1722 // -- a1 : the target to call (can be any Object). |
1715 // ----------------------------------- | 1723 // ----------------------------------- |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1826 __ sd(a1, MemOperand(at)); | 1834 __ sd(a1, MemOperand(at)); |
1827 // Let the "call_as_constructor_delegate" take care of the rest. | 1835 // Let the "call_as_constructor_delegate" take care of the rest. |
1828 __ LoadGlobalFunction(Context::CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, a1); | 1836 __ LoadGlobalFunction(Context::CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, a1); |
1829 __ Jump(masm->isolate()->builtins()->CallFunction(), | 1837 __ Jump(masm->isolate()->builtins()->CallFunction(), |
1830 RelocInfo::CODE_TARGET); | 1838 RelocInfo::CODE_TARGET); |
1831 } | 1839 } |
1832 | 1840 |
1833 // Called Construct on an Object that doesn't have a [[Construct]] internal | 1841 // Called Construct on an Object that doesn't have a [[Construct]] internal |
1834 // method. | 1842 // method. |
1835 __ bind(&non_constructor); | 1843 __ bind(&non_constructor); |
1836 { | 1844 __ Jump(masm->isolate()->builtins()->ConstructedNonConstructable(), |
1837 FrameScope scope(masm, StackFrame::INTERNAL); | 1845 RelocInfo::CODE_TARGET); |
1838 __ Push(a1); | |
1839 __ CallRuntime(Runtime::kThrowCalledNonCallable, 1); | |
1840 } | |
1841 } | 1846 } |
1842 | 1847 |
1843 | 1848 |
1844 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { | 1849 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
1845 // State setup as expected by MacroAssembler::InvokePrologue. | 1850 // State setup as expected by MacroAssembler::InvokePrologue. |
1846 // ----------- S t a t e ------------- | 1851 // ----------- S t a t e ------------- |
1847 // -- a0: actual arguments count | 1852 // -- a0: actual arguments count |
1848 // -- a1: function (passed through to callee) | 1853 // -- a1: function (passed through to callee) |
1849 // -- a2: expected arguments count | 1854 // -- a2: expected arguments count |
1850 // -- a3: new target (passed through to callee) | 1855 // -- a3: new target (passed through to callee) |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1995 } | 2000 } |
1996 } | 2001 } |
1997 | 2002 |
1998 | 2003 |
1999 #undef __ | 2004 #undef __ |
2000 | 2005 |
2001 } // namespace internal | 2006 } // namespace internal |
2002 } // namespace v8 | 2007 } // namespace v8 |
2003 | 2008 |
2004 #endif // V8_TARGET_ARCH_MIPS64 | 2009 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |