OLD | NEW |
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" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 return value; | 65 return value; |
66 } | 66 } |
67 | 67 |
68 compiler::Node* TagParameter(compiler::Node* value, ParameterMode mode) { | 68 compiler::Node* TagParameter(compiler::Node* value, ParameterMode mode) { |
69 if (mode != SMI_PARAMETERS) value = SmiTag(value); | 69 if (mode != SMI_PARAMETERS) value = SmiTag(value); |
70 return value; | 70 return value; |
71 } | 71 } |
72 | 72 |
73 compiler::Node* BooleanMapConstant(); | 73 compiler::Node* BooleanMapConstant(); |
74 compiler::Node* EmptyStringConstant(); | 74 compiler::Node* EmptyStringConstant(); |
| 75 compiler::Node* FixedArrayMapConstant(); |
| 76 compiler::Node* FixedCowArrayMapConstant(); |
75 compiler::Node* HeapNumberMapConstant(); | 77 compiler::Node* HeapNumberMapConstant(); |
76 compiler::Node* NoContextConstant(); | 78 compiler::Node* NoContextConstant(); |
77 compiler::Node* NanConstant(); | 79 compiler::Node* NanConstant(); |
78 compiler::Node* NullConstant(); | 80 compiler::Node* NullConstant(); |
79 compiler::Node* MinusZeroConstant(); | 81 compiler::Node* MinusZeroConstant(); |
80 compiler::Node* UndefinedConstant(); | 82 compiler::Node* UndefinedConstant(); |
81 compiler::Node* TheHoleConstant(); | 83 compiler::Node* TheHoleConstant(); |
82 compiler::Node* HashSeed(); | 84 compiler::Node* HashSeed(); |
83 compiler::Node* StaleRegisterConstant(); | 85 compiler::Node* StaleRegisterConstant(); |
84 | 86 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 // Load the Map of an HeapObject. | 205 // Load the Map of an HeapObject. |
204 compiler::Node* LoadMap(compiler::Node* object); | 206 compiler::Node* LoadMap(compiler::Node* object); |
205 // Load the instance type of an HeapObject. | 207 // Load the instance type of an HeapObject. |
206 compiler::Node* LoadInstanceType(compiler::Node* object); | 208 compiler::Node* LoadInstanceType(compiler::Node* object); |
207 // Checks that given heap object has given instance type. | 209 // Checks that given heap object has given instance type. |
208 void AssertInstanceType(compiler::Node* object, InstanceType instance_type); | 210 void AssertInstanceType(compiler::Node* object, InstanceType instance_type); |
209 // Load the properties backing store of a JSObject. | 211 // Load the properties backing store of a JSObject. |
210 compiler::Node* LoadProperties(compiler::Node* object); | 212 compiler::Node* LoadProperties(compiler::Node* object); |
211 // Load the elements backing store of a JSObject. | 213 // Load the elements backing store of a JSObject. |
212 compiler::Node* LoadElements(compiler::Node* object); | 214 compiler::Node* LoadElements(compiler::Node* object); |
| 215 // Load the length of a JSArray instance. |
| 216 compiler::Node* LoadJSArrayLength(compiler::Node* array); |
213 // Load the length of a fixed array base instance. | 217 // Load the length of a fixed array base instance. |
214 compiler::Node* LoadFixedArrayBaseLength(compiler::Node* array); | 218 compiler::Node* LoadFixedArrayBaseLength(compiler::Node* array); |
215 // Load the length of a fixed array base instance. | 219 // Load the length of a fixed array base instance. |
216 compiler::Node* LoadAndUntagFixedArrayBaseLength(compiler::Node* array); | 220 compiler::Node* LoadAndUntagFixedArrayBaseLength(compiler::Node* array); |
217 // Load the bit field of a Map. | 221 // Load the bit field of a Map. |
218 compiler::Node* LoadMapBitField(compiler::Node* map); | 222 compiler::Node* LoadMapBitField(compiler::Node* map); |
219 // Load bit field 2 of a map. | 223 // Load bit field 2 of a map. |
220 compiler::Node* LoadMapBitField2(compiler::Node* map); | 224 compiler::Node* LoadMapBitField2(compiler::Node* map); |
221 // Load bit field 3 of a map. | 225 // Load bit field 3 of a map. |
222 compiler::Node* LoadMapBitField3(compiler::Node* map); | 226 compiler::Node* LoadMapBitField3(compiler::Node* map); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 compiler::Node* AllocateHeapNumberWithValue(compiler::Node* value, | 314 compiler::Node* AllocateHeapNumberWithValue(compiler::Node* value, |
311 MutableMode mode = IMMUTABLE); | 315 MutableMode mode = IMMUTABLE); |
312 // Allocate a SeqOneByteString with the given length. | 316 // Allocate a SeqOneByteString with the given length. |
313 compiler::Node* AllocateSeqOneByteString(int length); | 317 compiler::Node* AllocateSeqOneByteString(int length); |
314 compiler::Node* AllocateSeqOneByteString(compiler::Node* context, | 318 compiler::Node* AllocateSeqOneByteString(compiler::Node* context, |
315 compiler::Node* length); | 319 compiler::Node* length); |
316 // Allocate a SeqTwoByteString with the given length. | 320 // Allocate a SeqTwoByteString with the given length. |
317 compiler::Node* AllocateSeqTwoByteString(int length); | 321 compiler::Node* AllocateSeqTwoByteString(int length); |
318 compiler::Node* AllocateSeqTwoByteString(compiler::Node* context, | 322 compiler::Node* AllocateSeqTwoByteString(compiler::Node* context, |
319 compiler::Node* length); | 323 compiler::Node* length); |
320 // Allocated an JSArray | 324 // Allocate a JSArray and its elements if capacity is not null. |
321 compiler::Node* AllocateJSArray(ElementsKind kind, compiler::Node* array_map, | 325 // Also initializes JSArray header fields. |
322 compiler::Node* capacity, | 326 compiler::Node* AllocateEmptyJSArray( |
323 compiler::Node* length, | 327 ElementsKind kind, compiler::Node* array_map, compiler::Node* length, |
324 compiler::Node* allocation_site = nullptr, | 328 compiler::Node* allocation_site = nullptr, |
325 ParameterMode mode = INTEGER_PARAMETERS); | 329 ParameterMode mode = INTEGER_PARAMETERS, |
| 330 compiler::Node* capacity = nullptr); |
| 331 // Allocate a JSArray and fill elements with zero. |
| 332 compiler::Node* AllocateFilledJSArray( |
| 333 ElementsKind kind, compiler::Node* array_map, compiler::Node* capacity, |
| 334 compiler::Node* length, compiler::Node* allocation_site = nullptr, |
| 335 ParameterMode mode = INTEGER_PARAMETERS); |
326 | 336 |
327 compiler::Node* AllocateFixedArray(ElementsKind kind, | 337 compiler::Node* AllocateFixedArray(ElementsKind kind, |
328 compiler::Node* capacity, | 338 compiler::Node* capacity, |
329 ParameterMode mode = INTEGER_PARAMETERS, | 339 ParameterMode mode = INTEGER_PARAMETERS, |
330 AllocationFlags flags = kNone); | 340 AllocationFlags flags = kNone); |
331 | 341 |
332 void FillFixedArrayWithValue(ElementsKind kind, compiler::Node* array, | 342 void FillFixedArrayWithValue(ElementsKind kind, compiler::Node* array, |
333 compiler::Node* from_index, | 343 compiler::Node* from_index, |
334 compiler::Node* to_index, | 344 compiler::Node* to_index, |
335 Heap::RootListIndex value_root_index, | 345 Heap::RootListIndex value_root_index, |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 Label* bailout); | 744 Label* bailout); |
735 | 745 |
736 static const int kElementLoopUnrollThreshold = 8; | 746 static const int kElementLoopUnrollThreshold = 8; |
737 }; | 747 }; |
738 | 748 |
739 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 749 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
740 | 750 |
741 } // namespace internal | 751 } // namespace internal |
742 } // namespace v8 | 752 } // namespace v8 |
743 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 753 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
OLD | NEW |