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

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

Issue 2465253011: Fastpath some spread-call desugaring. (Closed)
Patch Set: Handles double arrays too Created 4 years, 1 month 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/bootstrapper.cc ('k') | src/code-stub-assembler.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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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 #include "src/builtins/builtins.h" 5 #include "src/builtins/builtins.h"
6 #include "src/builtins/builtins-utils.h" 6 #include "src/builtins/builtins-utils.h"
7 7
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/contexts.h" 9 #include "src/contexts.h"
10 #include "src/elements.h" 10 #include "src/elements.h"
(...skipping 2229 matching lines...) Expand 10 before | Expand all | Expand 10 after
2240 elements, index, MachineType::Float64(), 0, 2240 elements, index, MachineType::Float64(), 0,
2241 CodeStubAssembler::SMI_PARAMETERS); 2241 CodeStubAssembler::SMI_PARAMETERS);
2242 var_value.Bind(assembler->AllocateHeapNumberWithValue(value)); 2242 var_value.Bind(assembler->AllocateHeapNumberWithValue(value));
2243 assembler->Goto(&allocate_entry_if_needed); 2243 assembler->Goto(&allocate_entry_if_needed);
2244 } 2244 }
2245 2245
2246 assembler->Bind(&holey_object_values); 2246 assembler->Bind(&holey_object_values);
2247 { 2247 {
2248 // Check the array_protector cell, and take the slow path if it's invalid. 2248 // Check the array_protector cell, and take the slow path if it's invalid.
2249 Node* invalid = 2249 Node* invalid =
2250 assembler->SmiConstant(Smi::FromInt(Isolate::kArrayProtectorInvalid)); 2250 assembler->SmiConstant(Smi::FromInt(Isolate::kProtectorInvalid));
2251 Node* cell = assembler->LoadRoot(Heap::kArrayProtectorRootIndex); 2251 Node* cell = assembler->LoadRoot(Heap::kArrayProtectorRootIndex);
2252 Node* cell_value = 2252 Node* cell_value =
2253 assembler->LoadObjectField(cell, PropertyCell::kValueOffset); 2253 assembler->LoadObjectField(cell, PropertyCell::kValueOffset);
2254 assembler->GotoIf(assembler->WordEqual(cell_value, invalid), 2254 assembler->GotoIf(assembler->WordEqual(cell_value, invalid),
2255 &generic_values); 2255 &generic_values);
2256 2256
2257 var_value.Bind(assembler->UndefinedConstant()); 2257 var_value.Bind(assembler->UndefinedConstant());
2258 Node* value = assembler->LoadFixedArrayElement( 2258 Node* value = assembler->LoadFixedArrayElement(
2259 elements, index, 0, CodeStubAssembler::SMI_PARAMETERS); 2259 elements, index, 0, CodeStubAssembler::SMI_PARAMETERS);
2260 assembler->GotoIf( 2260 assembler->GotoIf(
2261 assembler->WordEqual(value, assembler->TheHoleConstant()), 2261 assembler->WordEqual(value, assembler->TheHoleConstant()),
2262 &allocate_entry_if_needed); 2262 &allocate_entry_if_needed);
2263 var_value.Bind(value); 2263 var_value.Bind(value);
2264 assembler->Goto(&allocate_entry_if_needed); 2264 assembler->Goto(&allocate_entry_if_needed);
2265 } 2265 }
2266 2266
2267 assembler->Bind(&holey_double_values); 2267 assembler->Bind(&holey_double_values);
2268 { 2268 {
2269 // Check the array_protector cell, and take the slow path if it's invalid. 2269 // Check the array_protector cell, and take the slow path if it's invalid.
2270 Node* invalid = 2270 Node* invalid =
2271 assembler->SmiConstant(Smi::FromInt(Isolate::kArrayProtectorInvalid)); 2271 assembler->SmiConstant(Smi::FromInt(Isolate::kProtectorInvalid));
2272 Node* cell = assembler->LoadRoot(Heap::kArrayProtectorRootIndex); 2272 Node* cell = assembler->LoadRoot(Heap::kArrayProtectorRootIndex);
2273 Node* cell_value = 2273 Node* cell_value =
2274 assembler->LoadObjectField(cell, PropertyCell::kValueOffset); 2274 assembler->LoadObjectField(cell, PropertyCell::kValueOffset);
2275 assembler->GotoIf(assembler->WordEqual(cell_value, invalid), 2275 assembler->GotoIf(assembler->WordEqual(cell_value, invalid),
2276 &generic_values); 2276 &generic_values);
2277 2277
2278 var_value.Bind(assembler->UndefinedConstant()); 2278 var_value.Bind(assembler->UndefinedConstant());
2279 Node* value = assembler->LoadFixedDoubleArrayElement( 2279 Node* value = assembler->LoadFixedDoubleArrayElement(
2280 elements, index, MachineType::Float64(), 0, 2280 elements, index, MachineType::Float64(), 0,
2281 CodeStubAssembler::SMI_PARAMETERS, &allocate_entry_if_needed); 2281 CodeStubAssembler::SMI_PARAMETERS, &allocate_entry_if_needed);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
2331 assembler->StoreObjectFieldNoWriteBarrier( 2331 assembler->StoreObjectFieldNoWriteBarrier(
2332 iterator, JSArrayIterator::kIteratedObjectMapOffset, 2332 iterator, JSArrayIterator::kIteratedObjectMapOffset,
2333 assembler->UndefinedConstant()); 2333 assembler->UndefinedConstant());
2334 assembler->GotoIf( 2334 assembler->GotoIf(
2335 assembler->Uint32LessThanOrEqual( 2335 assembler->Uint32LessThanOrEqual(
2336 instance_type, assembler->Int32Constant( 2336 instance_type, assembler->Int32Constant(
2337 JS_GENERIC_ARRAY_KEY_ITERATOR_TYPE)), 2337 JS_GENERIC_ARRAY_KEY_ITERATOR_TYPE)),
2338 &done); 2338 &done);
2339 2339
2340 Node* invalid = assembler->SmiConstant( 2340 Node* invalid = assembler->SmiConstant(
2341 Smi::FromInt(Isolate::kArrayProtectorInvalid)); 2341 Smi::FromInt(Isolate::kProtectorInvalid));
2342 Node* cell = assembler->LoadRoot( 2342 Node* cell = assembler->LoadRoot(
2343 Heap::kFastArrayIterationProtectorRootIndex); 2343 Heap::kFastArrayIterationProtectorRootIndex);
2344 assembler->StoreObjectFieldNoWriteBarrier(cell, Cell::kValueOffset, 2344 assembler->StoreObjectFieldNoWriteBarrier(cell, Cell::kValueOffset,
2345 invalid); 2345 invalid);
2346 assembler->Goto(&done); 2346 assembler->Goto(&done);
2347 } 2347 }
2348 } 2348 }
2349 2349
2350 assembler->Bind(&if_isnotarray); 2350 assembler->Bind(&if_isnotarray);
2351 { 2351 {
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
2615 Runtime::kThrowIncompatibleMethodReceiver, context, 2615 Runtime::kThrowIncompatibleMethodReceiver, context,
2616 assembler->HeapConstant(assembler->factory()->NewStringFromAsciiChecked( 2616 assembler->HeapConstant(assembler->factory()->NewStringFromAsciiChecked(
2617 "Array Iterator.prototype.next", TENURED)), 2617 "Array Iterator.prototype.next", TENURED)),
2618 iterator); 2618 iterator);
2619 assembler->Return(result); 2619 assembler->Return(result);
2620 } 2620 }
2621 } 2621 }
2622 2622
2623 } // namespace internal 2623 } // namespace internal
2624 } // namespace v8 2624 } // namespace v8
OLDNEW
« no previous file with comments | « src/bootstrapper.cc ('k') | src/code-stub-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698