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 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 void Builtins::Generate_JSConstructStubApi(MacroAssembler* masm) { | 631 void Builtins::Generate_JSConstructStubApi(MacroAssembler* masm) { |
632 Generate_JSConstructStubHelper(masm, true, true); | 632 Generate_JSConstructStubHelper(masm, true, true); |
633 } | 633 } |
634 | 634 |
635 | 635 |
636 void Builtins::Generate_JSBuiltinsConstructStub(MacroAssembler* masm) { | 636 void Builtins::Generate_JSBuiltinsConstructStub(MacroAssembler* masm) { |
637 Generate_JSConstructStubHelper(masm, false, false); | 637 Generate_JSConstructStubHelper(masm, false, false); |
638 } | 638 } |
639 | 639 |
640 | 640 |
| 641 void Builtins::Generate_ConstructedNonConstructable(MacroAssembler* masm) { |
| 642 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); |
| 643 __ push(r4); |
| 644 __ CallRuntime(Runtime::kThrowConstructedNonConstructable, 1); |
| 645 } |
| 646 |
| 647 |
641 enum IsTagged { kArgcIsSmiTagged, kArgcIsUntaggedInt }; | 648 enum IsTagged { kArgcIsSmiTagged, kArgcIsUntaggedInt }; |
642 | 649 |
643 | 650 |
644 // Clobbers r5; preserves all other registers. | 651 // Clobbers r5; preserves all other registers. |
645 static void Generate_CheckStackOverflow(MacroAssembler* masm, Register argc, | 652 static void Generate_CheckStackOverflow(MacroAssembler* masm, Register argc, |
646 IsTagged argc_is_tagged) { | 653 IsTagged argc_is_tagged) { |
647 // Check the stack for overflow. We are not trying to catch | 654 // Check the stack for overflow. We are not trying to catch |
648 // interruptions (e.g. debug break and preemption) here, so the "real stack | 655 // interruptions (e.g. debug break and preemption) here, so the "real stack |
649 // limit" is checked. | 656 // limit" is checked. |
650 Label okay; | 657 Label okay; |
(...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1690 #endif | 1697 #endif |
1691 __ LoadP(r6, FieldMemOperand(r4, JSFunction::kCodeEntryOffset)); | 1698 __ LoadP(r6, FieldMemOperand(r4, JSFunction::kCodeEntryOffset)); |
1692 ParameterCount actual(r3); | 1699 ParameterCount actual(r3); |
1693 ParameterCount expected(r5); | 1700 ParameterCount expected(r5); |
1694 __ InvokeCode(r6, expected, actual, JUMP_FUNCTION, NullCallWrapper()); | 1701 __ InvokeCode(r6, expected, actual, JUMP_FUNCTION, NullCallWrapper()); |
1695 | 1702 |
1696 // The function is a "classConstructor", need to raise an exception. | 1703 // The function is a "classConstructor", need to raise an exception. |
1697 __ bind(&class_constructor); | 1704 __ bind(&class_constructor); |
1698 { | 1705 { |
1699 FrameAndConstantPoolScope frame(masm, StackFrame::INTERNAL); | 1706 FrameAndConstantPoolScope frame(masm, StackFrame::INTERNAL); |
1700 __ CallRuntime(Runtime::kThrowConstructorNonCallableError, 0); | 1707 __ push(r4); |
| 1708 __ CallRuntime(Runtime::kThrowConstructorNonCallableError, 1); |
1701 } | 1709 } |
1702 } | 1710 } |
1703 | 1711 |
1704 | 1712 |
1705 // static | 1713 // static |
1706 void Builtins::Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode) { | 1714 void Builtins::Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode) { |
1707 // ----------- S t a t e ------------- | 1715 // ----------- S t a t e ------------- |
1708 // -- r3 : the number of arguments (not including the receiver) | 1716 // -- r3 : the number of arguments (not including the receiver) |
1709 // -- r4 : the target to call (can be any Object). | 1717 // -- r4 : the target to call (can be any Object). |
1710 // ----------------------------------- | 1718 // ----------------------------------- |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1821 __ StorePX(r4, MemOperand(sp, r8)); | 1829 __ StorePX(r4, MemOperand(sp, r8)); |
1822 // Let the "call_as_constructor_delegate" take care of the rest. | 1830 // Let the "call_as_constructor_delegate" take care of the rest. |
1823 __ LoadGlobalFunction(Context::CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, r4); | 1831 __ LoadGlobalFunction(Context::CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, r4); |
1824 __ Jump(masm->isolate()->builtins()->CallFunction(), | 1832 __ Jump(masm->isolate()->builtins()->CallFunction(), |
1825 RelocInfo::CODE_TARGET); | 1833 RelocInfo::CODE_TARGET); |
1826 } | 1834 } |
1827 | 1835 |
1828 // Called Construct on an Object that doesn't have a [[Construct]] internal | 1836 // Called Construct on an Object that doesn't have a [[Construct]] internal |
1829 // method. | 1837 // method. |
1830 __ bind(&non_constructor); | 1838 __ bind(&non_constructor); |
1831 { | 1839 __ Jump(masm->isolate()->builtins()->ConstructedNonConstructable(), |
1832 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 1840 RelocInfo::CODE_TARGET); |
1833 __ Push(r4); | |
1834 __ CallRuntime(Runtime::kThrowCalledNonCallable, 1); | |
1835 } | |
1836 } | 1841 } |
1837 | 1842 |
1838 | 1843 |
1839 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { | 1844 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
1840 // ----------- S t a t e ------------- | 1845 // ----------- S t a t e ------------- |
1841 // -- r3 : actual number of arguments | 1846 // -- r3 : actual number of arguments |
1842 // -- r4 : function (passed through to callee) | 1847 // -- r4 : function (passed through to callee) |
1843 // -- r5 : expected number of arguments | 1848 // -- r5 : expected number of arguments |
1844 // -- r6 : new target (passed through to callee) | 1849 // -- r6 : new target (passed through to callee) |
1845 // ----------------------------------- | 1850 // ----------------------------------- |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1993 __ bkpt(0); | 1998 __ bkpt(0); |
1994 } | 1999 } |
1995 } | 2000 } |
1996 | 2001 |
1997 | 2002 |
1998 #undef __ | 2003 #undef __ |
1999 } // namespace internal | 2004 } // namespace internal |
2000 } // namespace v8 | 2005 } // namespace v8 |
2001 | 2006 |
2002 #endif // V8_TARGET_ARCH_PPC | 2007 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |