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(); | |
77 compiler::Node* FixedDoubleArrayMapConstant(); | |
75 compiler::Node* HeapNumberMapConstant(); | 78 compiler::Node* HeapNumberMapConstant(); |
76 compiler::Node* NoContextConstant(); | 79 compiler::Node* NoContextConstant(); |
77 compiler::Node* NanConstant(); | 80 compiler::Node* NanConstant(); |
78 compiler::Node* NullConstant(); | 81 compiler::Node* NullConstant(); |
79 compiler::Node* MinusZeroConstant(); | 82 compiler::Node* MinusZeroConstant(); |
80 compiler::Node* UndefinedConstant(); | 83 compiler::Node* UndefinedConstant(); |
81 compiler::Node* TheHoleConstant(); | 84 compiler::Node* TheHoleConstant(); |
82 compiler::Node* HashSeed(); | 85 compiler::Node* HashSeed(); |
83 compiler::Node* StaleRegisterConstant(); | 86 compiler::Node* StaleRegisterConstant(); |
84 | 87 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
203 // Load the Map of an HeapObject. | 206 // Load the Map of an HeapObject. |
204 compiler::Node* LoadMap(compiler::Node* object); | 207 compiler::Node* LoadMap(compiler::Node* object); |
205 // Load the instance type of an HeapObject. | 208 // Load the instance type of an HeapObject. |
206 compiler::Node* LoadInstanceType(compiler::Node* object); | 209 compiler::Node* LoadInstanceType(compiler::Node* object); |
207 // Checks that given heap object has given instance type. | 210 // Checks that given heap object has given instance type. |
208 void AssertInstanceType(compiler::Node* object, InstanceType instance_type); | 211 void AssertInstanceType(compiler::Node* object, InstanceType instance_type); |
209 // Load the properties backing store of a JSObject. | 212 // Load the properties backing store of a JSObject. |
210 compiler::Node* LoadProperties(compiler::Node* object); | 213 compiler::Node* LoadProperties(compiler::Node* object); |
211 // Load the elements backing store of a JSObject. | 214 // Load the elements backing store of a JSObject. |
212 compiler::Node* LoadElements(compiler::Node* object); | 215 compiler::Node* LoadElements(compiler::Node* object); |
216 // Load the length of a JSArray instance. | |
217 compiler::Node* LoadJSArrayLength(compiler::Node* array); | |
213 // Load the length of a fixed array base instance. | 218 // Load the length of a fixed array base instance. |
214 compiler::Node* LoadFixedArrayBaseLength(compiler::Node* array); | 219 compiler::Node* LoadFixedArrayBaseLength(compiler::Node* array); |
215 // Load the length of a fixed array base instance. | 220 // Load the length of a fixed array base instance. |
216 compiler::Node* LoadAndUntagFixedArrayBaseLength(compiler::Node* array); | 221 compiler::Node* LoadAndUntagFixedArrayBaseLength(compiler::Node* array); |
217 // Load the bit field of a Map. | 222 // Load the bit field of a Map. |
218 compiler::Node* LoadMapBitField(compiler::Node* map); | 223 compiler::Node* LoadMapBitField(compiler::Node* map); |
219 // Load bit field 2 of a map. | 224 // Load bit field 2 of a map. |
220 compiler::Node* LoadMapBitField2(compiler::Node* map); | 225 compiler::Node* LoadMapBitField2(compiler::Node* map); |
221 // Load bit field 3 of a map. | 226 // Load bit field 3 of a map. |
222 compiler::Node* LoadMapBitField3(compiler::Node* map); | 227 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, | 315 compiler::Node* AllocateHeapNumberWithValue(compiler::Node* value, |
311 MutableMode mode = IMMUTABLE); | 316 MutableMode mode = IMMUTABLE); |
312 // Allocate a SeqOneByteString with the given length. | 317 // Allocate a SeqOneByteString with the given length. |
313 compiler::Node* AllocateSeqOneByteString(int length); | 318 compiler::Node* AllocateSeqOneByteString(int length); |
314 compiler::Node* AllocateSeqOneByteString(compiler::Node* context, | 319 compiler::Node* AllocateSeqOneByteString(compiler::Node* context, |
315 compiler::Node* length); | 320 compiler::Node* length); |
316 // Allocate a SeqTwoByteString with the given length. | 321 // Allocate a SeqTwoByteString with the given length. |
317 compiler::Node* AllocateSeqTwoByteString(int length); | 322 compiler::Node* AllocateSeqTwoByteString(int length); |
318 compiler::Node* AllocateSeqTwoByteString(compiler::Node* context, | 323 compiler::Node* AllocateSeqTwoByteString(compiler::Node* context, |
319 compiler::Node* length); | 324 compiler::Node* length); |
320 // Allocated an JSArray | 325 // Allocate a JSArray without elements and initialize the header fields. |
326 compiler::Node* AllocateUninitializedJSArrayWithoutElements( | |
327 ElementsKind kind, compiler::Node* array_map, compiler::Node* length, | |
328 compiler::Node* allocation_site); | |
329 // Allocate and return a JSArray and its uninitialized elements. | |
330 // Also initializes JSArray header fields. | |
331 std::pair<compiler::Node*, compiler::Node*> | |
332 AllocateUninitializedJSArrayWithElements( | |
333 ElementsKind kind, compiler::Node* array_map, compiler::Node* length, | |
334 compiler::Node* allocation_site, compiler::Node* capacity, | |
335 ParameterMode capacity_mode = INTEGER_PARAMETERS); | |
Michael Starzinger
2016/09/19 14:20:38
It is somewhat un-intuitive that the ParameterMode
klaasb
2016/09/19 14:46:37
Well, it also doesn't apply to any of the other tw
| |
336 // Allocate a JSArray and fill elements with zero. | |
Michael Starzinger
2016/09/19 14:20:38
nit: s/zero/the hole/
klaasb
2016/09/19 14:46:37
Done, oops.
| |
321 compiler::Node* AllocateJSArray(ElementsKind kind, compiler::Node* array_map, | 337 compiler::Node* AllocateJSArray(ElementsKind kind, compiler::Node* array_map, |
322 compiler::Node* capacity, | 338 compiler::Node* capacity, |
323 compiler::Node* length, | 339 compiler::Node* length, |
324 compiler::Node* allocation_site = nullptr, | 340 compiler::Node* allocation_site = nullptr, |
325 ParameterMode mode = INTEGER_PARAMETERS); | 341 ParameterMode mode = INTEGER_PARAMETERS); |
326 | 342 |
327 compiler::Node* AllocateFixedArray(ElementsKind kind, | 343 compiler::Node* AllocateFixedArray(ElementsKind kind, |
328 compiler::Node* capacity, | 344 compiler::Node* capacity, |
329 ParameterMode mode = INTEGER_PARAMETERS, | 345 ParameterMode mode = INTEGER_PARAMETERS, |
330 AllocationFlags flags = kNone); | 346 AllocationFlags flags = kNone); |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
755 int base_size = 0); | 771 int base_size = 0); |
756 | 772 |
757 compiler::Node* AllocateRawAligned(compiler::Node* size_in_bytes, | 773 compiler::Node* AllocateRawAligned(compiler::Node* size_in_bytes, |
758 AllocationFlags flags, | 774 AllocationFlags flags, |
759 compiler::Node* top_address, | 775 compiler::Node* top_address, |
760 compiler::Node* limit_address); | 776 compiler::Node* limit_address); |
761 compiler::Node* AllocateRawUnaligned(compiler::Node* size_in_bytes, | 777 compiler::Node* AllocateRawUnaligned(compiler::Node* size_in_bytes, |
762 AllocationFlags flags, | 778 AllocationFlags flags, |
763 compiler::Node* top_adddress, | 779 compiler::Node* top_adddress, |
764 compiler::Node* limit_address); | 780 compiler::Node* limit_address); |
781 // Allocate and return a JSArray of given total size in bytes with header | |
782 // fields initialized. | |
783 compiler::Node* AllocateUninitializedJSArray(ElementsKind kind, | |
784 compiler::Node* array_map, | |
785 compiler::Node* length, | |
786 compiler::Node* allocation_site, | |
787 compiler::Node* size_in_bytes); | |
765 | 788 |
766 compiler::Node* SmiShiftBitsConstant(); | 789 compiler::Node* SmiShiftBitsConstant(); |
767 | 790 |
768 // Emits keyed sloppy arguments load if the |value| is nullptr or store | 791 // Emits keyed sloppy arguments load if the |value| is nullptr or store |
769 // otherwise. Returns either the loaded value or |value|. | 792 // otherwise. Returns either the loaded value or |value|. |
770 compiler::Node* EmitKeyedSloppyArguments(compiler::Node* receiver, | 793 compiler::Node* EmitKeyedSloppyArguments(compiler::Node* receiver, |
771 compiler::Node* key, | 794 compiler::Node* key, |
772 compiler::Node* value, | 795 compiler::Node* value, |
773 Label* bailout); | 796 Label* bailout); |
774 | 797 |
775 static const int kElementLoopUnrollThreshold = 8; | 798 static const int kElementLoopUnrollThreshold = 8; |
776 }; | 799 }; |
777 | 800 |
778 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 801 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
779 | 802 |
780 } // namespace internal | 803 } // namespace internal |
781 } // namespace v8 | 804 } // namespace v8 |
782 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 805 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
OLD | NEW |