| 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 "src/compiler/code-assembler.h" | 8 #include "src/compiler/code-assembler.h" |
| 9 #include "src/objects.h" | 9 #include "src/objects.h" |
| 10 | 10 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 MachineType rep = MachineType::AnyTagged()); | 116 MachineType rep = MachineType::AnyTagged()); |
| 117 // Load a field from an object on the heap. | 117 // Load a field from an object on the heap. |
| 118 compiler::Node* LoadObjectField(compiler::Node* object, int offset, | 118 compiler::Node* LoadObjectField(compiler::Node* object, int offset, |
| 119 MachineType rep = MachineType::AnyTagged()); | 119 MachineType rep = MachineType::AnyTagged()); |
| 120 // Load the floating point value of a HeapNumber. | 120 // Load the floating point value of a HeapNumber. |
| 121 compiler::Node* LoadHeapNumberValue(compiler::Node* object); | 121 compiler::Node* LoadHeapNumberValue(compiler::Node* object); |
| 122 // Load the Map of an HeapObject. | 122 // Load the Map of an HeapObject. |
| 123 compiler::Node* LoadMap(compiler::Node* object); | 123 compiler::Node* LoadMap(compiler::Node* object); |
| 124 // Load the instance type of an HeapObject. | 124 // Load the instance type of an HeapObject. |
| 125 compiler::Node* LoadInstanceType(compiler::Node* object); | 125 compiler::Node* LoadInstanceType(compiler::Node* object); |
| 126 // Checks that given heap object has given instance type. |
| 127 void AssertInstanceType(compiler::Node* object, InstanceType instance_type); |
| 126 // Load the properties backing store of a JSObject. | 128 // Load the properties backing store of a JSObject. |
| 127 compiler::Node* LoadProperties(compiler::Node* object); | 129 compiler::Node* LoadProperties(compiler::Node* object); |
| 128 // Load the elements backing store of a JSObject. | 130 // Load the elements backing store of a JSObject. |
| 129 compiler::Node* LoadElements(compiler::Node* object); | 131 compiler::Node* LoadElements(compiler::Node* object); |
| 130 // Load the length of a fixed array base instance. | 132 // Load the length of a fixed array base instance. |
| 131 compiler::Node* LoadFixedArrayBaseLength(compiler::Node* array); | 133 compiler::Node* LoadFixedArrayBaseLength(compiler::Node* array); |
| 132 // Load the bit field of a Map. | 134 // Load the bit field of a Map. |
| 133 compiler::Node* LoadMapBitField(compiler::Node* map); | 135 compiler::Node* LoadMapBitField(compiler::Node* map); |
| 134 // Load bit field 2 of a map. | 136 // Load bit field 2 of a map. |
| 135 compiler::Node* LoadMapBitField2(compiler::Node* map); | 137 compiler::Node* LoadMapBitField2(compiler::Node* map); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 149 // Load the hash value of a name. If {if_hash_not_computed} label | 151 // Load the hash value of a name. If {if_hash_not_computed} label |
| 150 // is specified then it also checks if hash is actually computed. | 152 // is specified then it also checks if hash is actually computed. |
| 151 compiler::Node* LoadNameHash(compiler::Node* name, | 153 compiler::Node* LoadNameHash(compiler::Node* name, |
| 152 Label* if_hash_not_computed = nullptr); | 154 Label* if_hash_not_computed = nullptr); |
| 153 | 155 |
| 154 // Load length field of a String object. | 156 // Load length field of a String object. |
| 155 compiler::Node* LoadStringLength(compiler::Node* object); | 157 compiler::Node* LoadStringLength(compiler::Node* object); |
| 156 // Load value field of a JSValue object. | 158 // Load value field of a JSValue object. |
| 157 compiler::Node* LoadJSValueValue(compiler::Node* object); | 159 compiler::Node* LoadJSValueValue(compiler::Node* object); |
| 158 // Load value field of a WeakCell object. | 160 // Load value field of a WeakCell object. |
| 159 compiler::Node* LoadWeakCellValue(compiler::Node* weak_cell); | 161 compiler::Node* LoadWeakCellValue(compiler::Node* weak_cell, |
| 162 Label* if_cleared = nullptr); |
| 160 | 163 |
| 161 compiler::Node* AllocateUninitializedFixedArray(compiler::Node* length); | 164 compiler::Node* AllocateUninitializedFixedArray(compiler::Node* length); |
| 162 | 165 |
| 163 // Load an array element from a FixedArray. | 166 // Load an array element from a FixedArray. |
| 164 compiler::Node* LoadFixedArrayElement( | 167 compiler::Node* LoadFixedArrayElement( |
| 165 compiler::Node* object, compiler::Node* int32_index, | 168 compiler::Node* object, compiler::Node* int32_index, |
| 166 int additional_offset = 0, | 169 int additional_offset = 0, |
| 167 ParameterMode parameter_mode = INTEGER_PARAMETERS); | 170 ParameterMode parameter_mode = INTEGER_PARAMETERS); |
| 168 // Load an array element from a FixedDoubleArray. | 171 // Load an array element from a FixedDoubleArray. |
| 169 compiler::Node* LoadFixedDoubleArrayElement( | 172 compiler::Node* LoadFixedDoubleArrayElement( |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 compiler::Node* entry_offset, | 348 compiler::Node* entry_offset, |
| 346 compiler::Node* name, Code::Flags flags, | 349 compiler::Node* name, Code::Flags flags, |
| 347 compiler::Node* map, Label* if_handler, | 350 compiler::Node* map, Label* if_handler, |
| 348 Variable* var_handler, Label* if_miss); | 351 Variable* var_handler, Label* if_miss); |
| 349 | 352 |
| 350 void TryProbeStubCache(StubCache* stub_cache, Code::Flags flags, | 353 void TryProbeStubCache(StubCache* stub_cache, Code::Flags flags, |
| 351 compiler::Node* receiver, compiler::Node* name, | 354 compiler::Node* receiver, compiler::Node* name, |
| 352 Label* if_handler, Variable* var_handler, | 355 Label* if_handler, Variable* var_handler, |
| 353 Label* if_miss); | 356 Label* if_miss); |
| 354 | 357 |
| 355 void LoadIC(const LoadICParameters* p, Label* if_miss); | 358 void LoadIC(const LoadICParameters* p); |
| 359 void LoadGlobalIC(const LoadICParameters* p); |
| 356 | 360 |
| 357 private: | 361 private: |
| 358 compiler::Node* ElementOffsetFromIndex(compiler::Node* index, | 362 compiler::Node* ElementOffsetFromIndex(compiler::Node* index, |
| 359 ElementsKind kind, ParameterMode mode, | 363 ElementsKind kind, ParameterMode mode, |
| 360 int base_size = 0); | 364 int base_size = 0); |
| 361 | 365 |
| 362 compiler::Node* AllocateRawAligned(compiler::Node* size_in_bytes, | 366 compiler::Node* AllocateRawAligned(compiler::Node* size_in_bytes, |
| 363 AllocationFlags flags, | 367 AllocationFlags flags, |
| 364 compiler::Node* top_address, | 368 compiler::Node* top_address, |
| 365 compiler::Node* limit_address); | 369 compiler::Node* limit_address); |
| 366 compiler::Node* AllocateRawUnaligned(compiler::Node* size_in_bytes, | 370 compiler::Node* AllocateRawUnaligned(compiler::Node* size_in_bytes, |
| 367 AllocationFlags flags, | 371 AllocationFlags flags, |
| 368 compiler::Node* top_adddress, | 372 compiler::Node* top_adddress, |
| 369 compiler::Node* limit_address); | 373 compiler::Node* limit_address); |
| 370 | 374 |
| 371 static const int kElementLoopUnrollThreshold = 8; | 375 static const int kElementLoopUnrollThreshold = 8; |
| 372 }; | 376 }; |
| 373 | 377 |
| 374 } // namespace internal | 378 } // namespace internal |
| 375 } // namespace v8 | 379 } // namespace v8 |
| 376 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 380 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
| OLD | NEW |