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

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

Issue 2949813002: [turbofan] Introduce new JSConstructWithArrayLike operator. (Closed)
Patch Set: Address feedback. Created 3 years, 6 months 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/builtins/mips/builtins-mips.cc ('k') | src/builtins/x64/builtins-x64.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_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 2083 matching lines...) Expand 10 before | Expand all | Expand 10 after
2094 __ Sd(undefined_value, MemOperand(sp, 0)); // Overwrite receiver 2094 __ Sd(undefined_value, MemOperand(sp, 0)); // Overwrite receiver
2095 } 2095 }
2096 2096
2097 // ----------- S t a t e ------------- 2097 // ----------- S t a t e -------------
2098 // -- a2 : argumentsList 2098 // -- a2 : argumentsList
2099 // -- a1 : target 2099 // -- a1 : target
2100 // -- a3 : new.target 2100 // -- a3 : new.target
2101 // -- sp[0] : receiver (undefined) 2101 // -- sp[0] : receiver (undefined)
2102 // ----------------------------------- 2102 // -----------------------------------
2103 2103
2104 // 2. Make sure the target is actually a constructor. 2104 // 2. We don't need to check explicitly for constructor target here,
2105 Label target_not_constructor; 2105 // since that's the first thing the Construct/ConstructWithArrayLike
2106 __ JumpIfSmi(target, &target_not_constructor); 2106 // builtins will do.
2107 __ Ld(a4, FieldMemOperand(target, HeapObject::kMapOffset));
2108 __ Lbu(a4, FieldMemOperand(a4, Map::kBitFieldOffset));
2109 __ And(a4, a4, Operand(1 << Map::kIsConstructor));
2110 __ Branch(&target_not_constructor, eq, a4, Operand(zero_reg));
2111 2107
2112 // 3. Make sure the target is actually a constructor. 2108 // 3. We don't need to check explicitly for constructor new.target here,
2113 Label new_target_not_constructor; 2109 // since that's the second thing the Construct/ConstructWithArrayLike
2114 __ JumpIfSmi(new_target, &new_target_not_constructor); 2110 // builtins will do.
2115 __ Ld(a4, FieldMemOperand(new_target, HeapObject::kMapOffset));
2116 __ Lbu(a4, FieldMemOperand(a4, Map::kBitFieldOffset));
2117 __ And(a4, a4, Operand(1 << Map::kIsConstructor));
2118 __ Branch(&new_target_not_constructor, eq, a4, Operand(zero_reg));
2119 2111
2120 // 4a. Construct the target with the given new.target and argumentsList. 2112 // 4. Construct the target with the given new.target and argumentsList.
2121 __ Jump(masm->isolate()->builtins()->ConstructWithArrayLike(), 2113 __ Jump(masm->isolate()->builtins()->ConstructWithArrayLike(),
2122 RelocInfo::CODE_TARGET); 2114 RelocInfo::CODE_TARGET);
2123
2124 // 4b. The target is not a constructor, throw an appropriate TypeError.
2125 __ bind(&target_not_constructor);
2126 {
2127 __ Sd(target, MemOperand(sp));
2128 __ TailCallRuntime(Runtime::kThrowNotConstructor);
2129 }
2130
2131 // 4c. The new.target is not a constructor, throw an appropriate TypeError.
2132 __ bind(&new_target_not_constructor);
2133 {
2134 __ Sd(new_target, MemOperand(sp));
2135 __ TailCallRuntime(Runtime::kThrowNotConstructor);
2136 }
2137 } 2115 }
2138 2116
2139 static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) { 2117 static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) {
2140 // __ sll(a0, a0, kSmiTagSize); 2118 // __ sll(a0, a0, kSmiTagSize);
2141 __ dsll32(a0, a0, 0); 2119 __ dsll32(a0, a0, 0);
2142 __ li(a4, Operand(StackFrame::TypeToMarker(StackFrame::ARGUMENTS_ADAPTOR))); 2120 __ li(a4, Operand(StackFrame::TypeToMarker(StackFrame::ARGUMENTS_ADAPTOR)));
2143 __ MultiPush(a0.bit() | a1.bit() | a4.bit() | fp.bit() | ra.bit()); 2121 __ MultiPush(a0.bit() | a1.bit() | a4.bit() | fp.bit() | ra.bit());
2144 __ Daddu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp + 2122 __ Daddu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp +
2145 kPointerSize)); 2123 kPointerSize));
2146 } 2124 }
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after
3004 __ Daddu(at, v0, Operand(Code::kHeaderSize - kHeapObjectTag)); 2982 __ Daddu(at, v0, Operand(Code::kHeaderSize - kHeapObjectTag));
3005 __ Jump(at); 2983 __ Jump(at);
3006 } 2984 }
3007 2985
3008 #undef __ 2986 #undef __
3009 2987
3010 } // namespace internal 2988 } // namespace internal
3011 } // namespace v8 2989 } // namespace v8
3012 2990
3013 #endif // V8_TARGET_ARCH_MIPS64 2991 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/builtins/mips/builtins-mips.cc ('k') | src/builtins/x64/builtins-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698