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

Side by Side Diff: src/code-stub-assembler.h

Issue 2405253006: [builtins] implement Array.prototype[@@iterator] in TFJ builtins (Closed)
Patch Set: V1 Created 4 years, 2 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
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 #ifndef V8_CODE_STUB_ASSEMBLER_H_ 5 #ifndef V8_CODE_STUB_ASSEMBLER_H_
6 #define V8_CODE_STUB_ASSEMBLER_H_ 6 #define V8_CODE_STUB_ASSEMBLER_H_
7 7
8 #include <functional> 8 #include <functional>
9 9
10 #include "src/compiler/code-assembler.h" 10 #include "src/compiler/code-assembler.h"
11 #include "src/objects.h" 11 #include "src/objects.h"
12 12
13 namespace v8 { 13 namespace v8 {
14 namespace internal { 14 namespace internal {
15 15
16 class CallInterfaceDescriptor; 16 class CallInterfaceDescriptor;
17 class StatsCounter; 17 class StatsCounter;
18 class StubCache; 18 class StubCache;
19 19
20 enum class PrimitiveType { kBoolean, kNumber, kString, kSymbol }; 20 enum class PrimitiveType { kBoolean, kNumber, kString, kSymbol };
21 21
22 enum class IterationKind { kKeys, kValues, kEntries };
23
22 #define HEAP_CONSTANT_LIST(V) \ 24 #define HEAP_CONSTANT_LIST(V) \
23 V(BooleanMap, BooleanMap) \ 25 V(BooleanMap, BooleanMap) \
24 V(empty_string, EmptyString) \ 26 V(empty_string, EmptyString) \
25 V(EmptyFixedArray, EmptyFixedArray) \ 27 V(EmptyFixedArray, EmptyFixedArray) \
26 V(FalseValue, False) \ 28 V(FalseValue, False) \
27 V(FixedArrayMap, FixedArrayMap) \ 29 V(FixedArrayMap, FixedArrayMap) \
28 V(FixedCOWArrayMap, FixedCOWArrayMap) \ 30 V(FixedCOWArrayMap, FixedCOWArrayMap) \
29 V(FixedDoubleArrayMap, FixedDoubleArrayMap) \ 31 V(FixedDoubleArrayMap, FixedDoubleArrayMap) \
30 V(HeapNumberMap, HeapNumberMap) \ 32 V(HeapNumberMap, HeapNumberMap) \
31 V(MinusZeroValue, MinusZero) \ 33 V(MinusZeroValue, MinusZero) \
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 compiler::Node* SmiMax(compiler::Node* a, compiler::Node* b); 135 compiler::Node* SmiMax(compiler::Node* a, compiler::Node* b);
134 compiler::Node* SmiMin(compiler::Node* a, compiler::Node* b); 136 compiler::Node* SmiMin(compiler::Node* a, compiler::Node* b);
135 // Computes a % b for Smi inputs a and b; result is not necessarily a Smi. 137 // Computes a % b for Smi inputs a and b; result is not necessarily a Smi.
136 compiler::Node* SmiMod(compiler::Node* a, compiler::Node* b); 138 compiler::Node* SmiMod(compiler::Node* a, compiler::Node* b);
137 // Computes a * b for Smi inputs a and b; result is not necessarily a Smi. 139 // Computes a * b for Smi inputs a and b; result is not necessarily a Smi.
138 compiler::Node* SmiMul(compiler::Node* a, compiler::Node* b); 140 compiler::Node* SmiMul(compiler::Node* a, compiler::Node* b);
139 compiler::Node* SmiOr(compiler::Node* a, compiler::Node* b) { 141 compiler::Node* SmiOr(compiler::Node* a, compiler::Node* b) {
140 return WordOr(a, b); 142 return WordOr(a, b);
141 } 143 }
142 144
145 // Smi | HeapNumber operations.
146 compiler::Node* NumberInc(compiler::Node* value);
147
143 // Allocate an object of the given size. 148 // Allocate an object of the given size.
144 compiler::Node* Allocate(compiler::Node* size, AllocationFlags flags = kNone); 149 compiler::Node* Allocate(compiler::Node* size, AllocationFlags flags = kNone);
145 compiler::Node* Allocate(int size, AllocationFlags flags = kNone); 150 compiler::Node* Allocate(int size, AllocationFlags flags = kNone);
146 compiler::Node* InnerAllocate(compiler::Node* previous, int offset); 151 compiler::Node* InnerAllocate(compiler::Node* previous, int offset);
147 compiler::Node* InnerAllocate(compiler::Node* previous, 152 compiler::Node* InnerAllocate(compiler::Node* previous,
148 compiler::Node* offset); 153 compiler::Node* offset);
149 154
150 void Assert(compiler::Node* condition); 155 void Assert(compiler::Node* condition);
151 156
152 // Check a value for smi-ness 157 // Check a value for smi-ness
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 int additional_offset = 0, 293 int additional_offset = 0,
289 ParameterMode parameter_mode = INTEGER_PARAMETERS, 294 ParameterMode parameter_mode = INTEGER_PARAMETERS,
290 Label* if_hole = nullptr); 295 Label* if_hole = nullptr);
291 296
292 // Load Float64 value by |base| + |offset| address. If the value is a double 297 // Load Float64 value by |base| + |offset| address. If the value is a double
293 // hole then jump to |if_hole|. If |machine_type| is None then only the hole 298 // hole then jump to |if_hole|. If |machine_type| is None then only the hole
294 // check is generated. 299 // check is generated.
295 compiler::Node* LoadDoubleWithHoleCheck( 300 compiler::Node* LoadDoubleWithHoleCheck(
296 compiler::Node* base, compiler::Node* offset, Label* if_hole, 301 compiler::Node* base, compiler::Node* offset, Label* if_hole,
297 MachineType machine_type = MachineType::Float64()); 302 MachineType machine_type = MachineType::Float64());
303 compiler::Node* LoadFixedTypedArrayElement(
304 compiler::Node* data_pointer, compiler::Node* index_node,
305 ElementsKind elements_kind,
306 ParameterMode parameter_mode = INTEGER_PARAMETERS);
298 307
299 // Context manipulation 308 // Context manipulation
300 compiler::Node* LoadContextElement(compiler::Node* context, int slot_index); 309 compiler::Node* LoadContextElement(compiler::Node* context, int slot_index);
301 compiler::Node* StoreContextElement(compiler::Node* context, int slot_index, 310 compiler::Node* StoreContextElement(compiler::Node* context, int slot_index,
302 compiler::Node* value); 311 compiler::Node* value);
303 compiler::Node* LoadNativeContext(compiler::Node* context); 312 compiler::Node* LoadNativeContext(compiler::Node* context);
304 313
305 compiler::Node* LoadJSArrayElementsMap(ElementsKind kind, 314 compiler::Node* LoadJSArrayElementsMap(ElementsKind kind,
306 compiler::Node* native_context); 315 compiler::Node* native_context);
307 316
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 compiler::Node* AllocateJSArray( 395 compiler::Node* AllocateJSArray(
387 ElementsKind kind, compiler::Node* array_map, compiler::Node* capacity, 396 ElementsKind kind, compiler::Node* array_map, compiler::Node* capacity,
388 compiler::Node* length, compiler::Node* allocation_site = nullptr, 397 compiler::Node* length, compiler::Node* allocation_site = nullptr,
389 ParameterMode capacity_mode = INTEGER_PARAMETERS); 398 ParameterMode capacity_mode = INTEGER_PARAMETERS);
390 399
391 compiler::Node* AllocateFixedArray(ElementsKind kind, 400 compiler::Node* AllocateFixedArray(ElementsKind kind,
392 compiler::Node* capacity, 401 compiler::Node* capacity,
393 ParameterMode mode = INTEGER_PARAMETERS, 402 ParameterMode mode = INTEGER_PARAMETERS,
394 AllocationFlags flags = kNone); 403 AllocationFlags flags = kNone);
395 404
405 // Perform CreateArrayIterator (ES6 #sec-createarrayiterator).
406 compiler::Node* CreateArrayIterator(compiler::Node* array,
407 compiler::Node* array_map,
408 compiler::Node* array_type,
409 compiler::Node* context,
410 IterationKind mode);
411
412 compiler::Node* AllocateJSArrayIterator(compiler::Node* array,
413 compiler::Node* array_map,
414 compiler::Node* map);
415 compiler::Node* AllocateJSTypedArrayIterator(compiler::Node* array,
416 compiler::Node* map);
417
396 void FillFixedArrayWithValue(ElementsKind kind, compiler::Node* array, 418 void FillFixedArrayWithValue(ElementsKind kind, compiler::Node* array,
397 compiler::Node* from_index, 419 compiler::Node* from_index,
398 compiler::Node* to_index, 420 compiler::Node* to_index,
399 Heap::RootListIndex value_root_index, 421 Heap::RootListIndex value_root_index,
400 ParameterMode mode = INTEGER_PARAMETERS); 422 ParameterMode mode = INTEGER_PARAMETERS);
401 423
402 // Copies all elements from |from_array| of |length| size to 424 // Copies all elements from |from_array| of |length| size to
403 // |to_array| of the same size respecting the elements kind. 425 // |to_array| of the same size respecting the elements kind.
404 void CopyFixedArrayElements( 426 void CopyFixedArrayElements(
405 ElementsKind kind, compiler::Node* from_array, compiler::Node* to_array, 427 ElementsKind kind, compiler::Node* from_array, compiler::Node* to_array,
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 Label* bailout); 980 Label* bailout);
959 981
960 static const int kElementLoopUnrollThreshold = 8; 982 static const int kElementLoopUnrollThreshold = 8;
961 }; 983 };
962 984
963 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); 985 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags);
964 986
965 } // namespace internal 987 } // namespace internal
966 } // namespace v8 988 } // namespace v8
967 #endif // V8_CODE_STUB_ASSEMBLER_H_ 989 #endif // V8_CODE_STUB_ASSEMBLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698