Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: src/mips/builtins-mips.cc

Issue 1467473002: Install ConstructNonConstructable as construct stub for non-constructables. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/messages.h ('k') | src/mips64/builtins-mips64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_MIPS 5 #if V8_TARGET_ARCH_MIPS
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 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 void Builtins::Generate_JSConstructStubApi(MacroAssembler* masm) { 648 void Builtins::Generate_JSConstructStubApi(MacroAssembler* masm) {
649 Generate_JSConstructStubHelper(masm, true, true); 649 Generate_JSConstructStubHelper(masm, true, true);
650 } 650 }
651 651
652 652
653 void Builtins::Generate_JSBuiltinsConstructStub(MacroAssembler* masm) { 653 void Builtins::Generate_JSBuiltinsConstructStub(MacroAssembler* masm) {
654 Generate_JSConstructStubHelper(masm, false, false); 654 Generate_JSConstructStubHelper(masm, false, false);
655 } 655 }
656 656
657 657
658 void Builtins::Generate_ConstructedNonConstructable(MacroAssembler* masm) {
659 FrameScope scope(masm, StackFrame::INTERNAL);
660 __ Push(a1);
661 __ CallRuntime(Runtime::kThrowConstructedNonConstructable, 1);
662 }
663
664
658 enum IsTagged { kArgcIsSmiTagged, kArgcIsUntaggedInt }; 665 enum IsTagged { kArgcIsSmiTagged, kArgcIsUntaggedInt };
659 666
660 667
661 // Clobbers a2; preserves all other registers. 668 // Clobbers a2; preserves all other registers.
662 static void Generate_CheckStackOverflow(MacroAssembler* masm, Register argc, 669 static void Generate_CheckStackOverflow(MacroAssembler* masm, Register argc,
663 IsTagged argc_is_tagged) { 670 IsTagged argc_is_tagged) {
664 // Check the stack for overflow. We are not trying to catch 671 // Check the stack for overflow. We are not trying to catch
665 // interruptions (e.g. debug break and preemption) here, so the "real stack 672 // interruptions (e.g. debug break and preemption) here, so the "real stack
666 // limit" is checked. 673 // limit" is checked.
667 Label okay; 674 Label okay;
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
1698 __ sra(a2, a2, kSmiTagSize); // Un-tag. 1705 __ sra(a2, a2, kSmiTagSize); // Un-tag.
1699 __ lw(t0, FieldMemOperand(a1, JSFunction::kCodeEntryOffset)); 1706 __ lw(t0, FieldMemOperand(a1, JSFunction::kCodeEntryOffset));
1700 ParameterCount actual(a0); 1707 ParameterCount actual(a0);
1701 ParameterCount expected(a2); 1708 ParameterCount expected(a2);
1702 __ InvokeCode(t0, no_reg, expected, actual, JUMP_FUNCTION, NullCallWrapper()); 1709 __ InvokeCode(t0, no_reg, expected, actual, JUMP_FUNCTION, NullCallWrapper());
1703 1710
1704 // The function is a "classConstructor", need to raise an exception. 1711 // The function is a "classConstructor", need to raise an exception.
1705 __ bind(&class_constructor); 1712 __ bind(&class_constructor);
1706 { 1713 {
1707 FrameScope frame(masm, StackFrame::INTERNAL); 1714 FrameScope frame(masm, StackFrame::INTERNAL);
1708 __ CallRuntime(Runtime::kThrowConstructorNonCallableError, 0); 1715 __ Push(a1);
1716 __ CallRuntime(Runtime::kThrowConstructorNonCallableError, 1);
1709 } 1717 }
1710 } 1718 }
1711 1719
1712 1720
1713 // static 1721 // static
1714 void Builtins::Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode) { 1722 void Builtins::Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode) {
1715 // ----------- S t a t e ------------- 1723 // ----------- S t a t e -------------
1716 // -- a0 : the number of arguments (not including the receiver) 1724 // -- a0 : the number of arguments (not including the receiver)
1717 // -- a1 : the target to call (can be any Object). 1725 // -- a1 : the target to call (can be any Object).
1718 // ----------------------------------- 1726 // -----------------------------------
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
1830 __ sw(a1, MemOperand(at)); 1838 __ sw(a1, MemOperand(at));
1831 // Let the "call_as_constructor_delegate" take care of the rest. 1839 // Let the "call_as_constructor_delegate" take care of the rest.
1832 __ LoadGlobalFunction(Context::CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, a1); 1840 __ LoadGlobalFunction(Context::CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, a1);
1833 __ Jump(masm->isolate()->builtins()->CallFunction(), 1841 __ Jump(masm->isolate()->builtins()->CallFunction(),
1834 RelocInfo::CODE_TARGET); 1842 RelocInfo::CODE_TARGET);
1835 } 1843 }
1836 1844
1837 // Called Construct on an Object that doesn't have a [[Construct]] internal 1845 // Called Construct on an Object that doesn't have a [[Construct]] internal
1838 // method. 1846 // method.
1839 __ bind(&non_constructor); 1847 __ bind(&non_constructor);
1840 { 1848 __ Jump(masm->isolate()->builtins()->ConstructedNonConstructable(),
1841 FrameScope scope(masm, StackFrame::INTERNAL); 1849 RelocInfo::CODE_TARGET);
1842 __ Push(a1);
1843 __ CallRuntime(Runtime::kThrowCalledNonCallable, 1);
1844 }
1845 } 1850 }
1846 1851
1847 1852
1848 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { 1853 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
1849 // State setup as expected by MacroAssembler::InvokePrologue. 1854 // State setup as expected by MacroAssembler::InvokePrologue.
1850 // ----------- S t a t e ------------- 1855 // ----------- S t a t e -------------
1851 // -- a0: actual arguments count 1856 // -- a0: actual arguments count
1852 // -- a1: function (passed through to callee) 1857 // -- a1: function (passed through to callee)
1853 // -- a2: expected arguments count 1858 // -- a2: expected arguments count
1854 // -- a3: new target (passed through to callee) 1859 // -- a3: new target (passed through to callee)
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1999 } 2004 }
2000 } 2005 }
2001 2006
2002 2007
2003 #undef __ 2008 #undef __
2004 2009
2005 } // namespace internal 2010 } // namespace internal
2006 } // namespace v8 2011 } // namespace v8
2007 2012
2008 #endif // V8_TARGET_ARCH_MIPS 2013 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/messages.h ('k') | src/mips64/builtins-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698