| 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. |
| 321 compiler::Node* AllocateJSArray(ElementsKind kind, compiler::Node* array_map, | 326 compiler::Node* AllocateUninitializedJSArrayWithoutElements( |
| 322 compiler::Node* capacity, | 327 ElementsKind kind, compiler::Node* array_map, compiler::Node* length, |
| 323 compiler::Node* length, | 328 compiler::Node* allocation_site); |
| 324 compiler::Node* allocation_site = nullptr, | 329 // Allocate and return a JSArray with initialized header fields and its |
| 325 ParameterMode mode = INTEGER_PARAMETERS); | 330 // uninitialized elements. |
| 331 // The ParameterMode argument is only used for the capacity parameter. |
| 332 std::pair<compiler::Node*, compiler::Node*> |
| 333 AllocateUninitializedJSArrayWithElements( |
| 334 ElementsKind kind, compiler::Node* array_map, compiler::Node* length, |
| 335 compiler::Node* allocation_site, compiler::Node* capacity, |
| 336 ParameterMode capacity_mode = INTEGER_PARAMETERS); |
| 337 // Allocate a JSArray and fill elements with the hole. |
| 338 // The ParameterMode argument is only used for the capacity parameter. |
| 339 compiler::Node* AllocateJSArray( |
| 340 ElementsKind kind, compiler::Node* array_map, compiler::Node* capacity, |
| 341 compiler::Node* length, compiler::Node* allocation_site = nullptr, |
| 342 ParameterMode capacity_mode = INTEGER_PARAMETERS); |
| 326 | 343 |
| 327 compiler::Node* AllocateFixedArray(ElementsKind kind, | 344 compiler::Node* AllocateFixedArray(ElementsKind kind, |
| 328 compiler::Node* capacity, | 345 compiler::Node* capacity, |
| 329 ParameterMode mode = INTEGER_PARAMETERS, | 346 ParameterMode mode = INTEGER_PARAMETERS, |
| 330 AllocationFlags flags = kNone); | 347 AllocationFlags flags = kNone); |
| 331 | 348 |
| 332 void FillFixedArrayWithValue(ElementsKind kind, compiler::Node* array, | 349 void FillFixedArrayWithValue(ElementsKind kind, compiler::Node* array, |
| 333 compiler::Node* from_index, | 350 compiler::Node* from_index, |
| 334 compiler::Node* to_index, | 351 compiler::Node* to_index, |
| 335 Heap::RootListIndex value_root_index, | 352 Heap::RootListIndex value_root_index, |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 int base_size = 0); | 772 int base_size = 0); |
| 756 | 773 |
| 757 compiler::Node* AllocateRawAligned(compiler::Node* size_in_bytes, | 774 compiler::Node* AllocateRawAligned(compiler::Node* size_in_bytes, |
| 758 AllocationFlags flags, | 775 AllocationFlags flags, |
| 759 compiler::Node* top_address, | 776 compiler::Node* top_address, |
| 760 compiler::Node* limit_address); | 777 compiler::Node* limit_address); |
| 761 compiler::Node* AllocateRawUnaligned(compiler::Node* size_in_bytes, | 778 compiler::Node* AllocateRawUnaligned(compiler::Node* size_in_bytes, |
| 762 AllocationFlags flags, | 779 AllocationFlags flags, |
| 763 compiler::Node* top_adddress, | 780 compiler::Node* top_adddress, |
| 764 compiler::Node* limit_address); | 781 compiler::Node* limit_address); |
| 782 // Allocate and return a JSArray of given total size in bytes with header |
| 783 // fields initialized. |
| 784 compiler::Node* AllocateUninitializedJSArray(ElementsKind kind, |
| 785 compiler::Node* array_map, |
| 786 compiler::Node* length, |
| 787 compiler::Node* allocation_site, |
| 788 compiler::Node* size_in_bytes); |
| 765 | 789 |
| 766 compiler::Node* SmiShiftBitsConstant(); | 790 compiler::Node* SmiShiftBitsConstant(); |
| 767 | 791 |
| 768 // Emits keyed sloppy arguments load if the |value| is nullptr or store | 792 // Emits keyed sloppy arguments load if the |value| is nullptr or store |
| 769 // otherwise. Returns either the loaded value or |value|. | 793 // otherwise. Returns either the loaded value or |value|. |
| 770 compiler::Node* EmitKeyedSloppyArguments(compiler::Node* receiver, | 794 compiler::Node* EmitKeyedSloppyArguments(compiler::Node* receiver, |
| 771 compiler::Node* key, | 795 compiler::Node* key, |
| 772 compiler::Node* value, | 796 compiler::Node* value, |
| 773 Label* bailout); | 797 Label* bailout); |
| 774 | 798 |
| 775 static const int kElementLoopUnrollThreshold = 8; | 799 static const int kElementLoopUnrollThreshold = 8; |
| 776 }; | 800 }; |
| 777 | 801 |
| 778 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 802 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
| 779 | 803 |
| 780 } // namespace internal | 804 } // namespace internal |
| 781 } // namespace v8 | 805 } // namespace v8 |
| 782 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 806 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
| OLD | NEW |