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

Side by Side Diff: src/builtins/arm/builtins-arm.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 | « no previous file | src/builtins/arm64/builtins-arm64.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_ARM 5 #if V8_TARGET_ARCH_ARM
6 6
7 #include "src/assembler-inl.h" 7 #include "src/assembler-inl.h"
8 #include "src/codegen.h" 8 #include "src/codegen.h"
9 #include "src/counters.h" 9 #include "src/counters.h"
10 #include "src/debug/debug.h" 10 #include "src/debug/debug.h"
(...skipping 2052 matching lines...) Expand 10 before | Expand all | Expand 10 after
2063 __ add(sp, sp, Operand(r0, LSL, kPointerSizeLog2)); 2063 __ add(sp, sp, Operand(r0, LSL, kPointerSizeLog2));
2064 } 2064 }
2065 2065
2066 // ----------- S t a t e ------------- 2066 // ----------- S t a t e -------------
2067 // -- r2 : argumentsList 2067 // -- r2 : argumentsList
2068 // -- r3 : new.target 2068 // -- r3 : new.target
2069 // -- r1 : target 2069 // -- r1 : target
2070 // -- sp[0] : receiver (undefined) 2070 // -- sp[0] : receiver (undefined)
2071 // ----------------------------------- 2071 // -----------------------------------
2072 2072
2073 // 2. Make sure the target is actually a constructor. 2073 // 2. We don't need to check explicitly for constructor target here,
2074 Label target_not_constructor; 2074 // since that's the first thing the Construct/ConstructWithArrayLike
2075 __ JumpIfSmi(r1, &target_not_constructor); 2075 // builtins will do.
2076 __ ldr(r4, FieldMemOperand(r1, HeapObject::kMapOffset));
2077 __ ldrb(r4, FieldMemOperand(r4, Map::kBitFieldOffset));
2078 __ tst(r4, Operand(1 << Map::kIsConstructor));
2079 __ b(eq, &target_not_constructor);
2080 2076
2081 // 3. Make sure the target is actually a constructor. 2077 // 3. We don't need to check explicitly for constructor new.target here,
2082 Label new_target_not_constructor; 2078 // since that's the second thing the Construct/ConstructWithArrayLike
2083 __ JumpIfSmi(r3, &new_target_not_constructor); 2079 // builtins will do.
2084 __ ldr(r4, FieldMemOperand(r3, HeapObject::kMapOffset));
2085 __ ldrb(r4, FieldMemOperand(r4, Map::kBitFieldOffset));
2086 __ tst(r4, Operand(1 << Map::kIsConstructor));
2087 __ b(eq, &new_target_not_constructor);
2088 2080
2089 // 4a. Construct the target with the given new.target and argumentsList. 2081 // 4. Construct the target with the given new.target and argumentsList.
2090 __ Jump(masm->isolate()->builtins()->ConstructWithArrayLike(), 2082 __ Jump(masm->isolate()->builtins()->ConstructWithArrayLike(),
2091 RelocInfo::CODE_TARGET); 2083 RelocInfo::CODE_TARGET);
2092
2093 // 4b. The target is not a constructor, throw an appropriate TypeError.
2094 __ bind(&target_not_constructor);
2095 {
2096 __ str(r1, MemOperand(sp, 0));
2097 __ TailCallRuntime(Runtime::kThrowNotConstructor);
2098 }
2099
2100 // 4c. The new.target is not a constructor, throw an appropriate TypeError.
2101 __ bind(&new_target_not_constructor);
2102 {
2103 __ str(r3, MemOperand(sp, 0));
2104 __ TailCallRuntime(Runtime::kThrowNotConstructor);
2105 }
2106 } 2084 }
2107 2085
2108 static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) { 2086 static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) {
2109 __ SmiTag(r0); 2087 __ SmiTag(r0);
2110 __ mov(r4, Operand(StackFrame::TypeToMarker(StackFrame::ARGUMENTS_ADAPTOR))); 2088 __ mov(r4, Operand(StackFrame::TypeToMarker(StackFrame::ARGUMENTS_ADAPTOR)));
2111 __ stm(db_w, sp, r0.bit() | r1.bit() | r4.bit() | 2089 __ stm(db_w, sp, r0.bit() | r1.bit() | r4.bit() |
2112 fp.bit() | lr.bit()); 2090 fp.bit() | lr.bit());
2113 __ add(fp, sp, 2091 __ add(fp, sp,
2114 Operand(StandardFrameConstants::kFixedFrameSizeFromFp + kPointerSize)); 2092 Operand(StandardFrameConstants::kFixedFrameSizeFromFp + kPointerSize));
2115 } 2093 }
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after
2908 } 2886 }
2909 // Now jump to the instructions of the returned code object. 2887 // Now jump to the instructions of the returned code object.
2910 __ Jump(r8); 2888 __ Jump(r8);
2911 } 2889 }
2912 #undef __ 2890 #undef __
2913 2891
2914 } // namespace internal 2892 } // namespace internal
2915 } // namespace v8 2893 } // namespace v8
2916 2894
2917 #endif // V8_TARGET_ARCH_ARM 2895 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/builtins/arm64/builtins-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698