Chromium Code Reviews| 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 181 | 181 |
| 182 void BranchIfSimd128Equal(compiler::Node* lhs, compiler::Node* lhs_map, | 182 void BranchIfSimd128Equal(compiler::Node* lhs, compiler::Node* lhs_map, |
| 183 compiler::Node* rhs, compiler::Node* rhs_map, | 183 compiler::Node* rhs, compiler::Node* rhs_map, |
| 184 Label* if_equal, Label* if_notequal); | 184 Label* if_equal, Label* if_notequal); |
| 185 void BranchIfSimd128Equal(compiler::Node* lhs, compiler::Node* rhs, | 185 void BranchIfSimd128Equal(compiler::Node* lhs, compiler::Node* rhs, |
| 186 Label* if_equal, Label* if_notequal) { | 186 Label* if_equal, Label* if_notequal) { |
| 187 BranchIfSimd128Equal(lhs, LoadMap(lhs), rhs, LoadMap(rhs), if_equal, | 187 BranchIfSimd128Equal(lhs, LoadMap(lhs), rhs, LoadMap(rhs), if_equal, |
| 188 if_notequal); | 188 if_notequal); |
| 189 } | 189 } |
| 190 | 190 |
| 191 void BranchIfJSReceiver(compiler::Node* object, Label* if_true, | |
|
Igor Sheludko
2016/10/18 12:33:21
I think if_receiver/if_not_receiver are better nam
| |
| 192 Label* if_false); | |
| 193 void BranchIfJSObject(compiler::Node* object, Label* if_true, | |
|
Igor Sheludko
2016/10/18 12:33:21
Same here.
| |
| 194 Label* if_false); | |
| 195 | |
| 191 void BranchIfFastJSArray(compiler::Node* object, compiler::Node* context, | 196 void BranchIfFastJSArray(compiler::Node* object, compiler::Node* context, |
| 192 Label* if_true, Label* if_false); | 197 Label* if_true, Label* if_false); |
| 193 | 198 |
| 194 // Load value from current frame by given offset in bytes. | 199 // Load value from current frame by given offset in bytes. |
| 195 compiler::Node* LoadFromFrame(int offset, | 200 compiler::Node* LoadFromFrame(int offset, |
| 196 MachineType rep = MachineType::AnyTagged()); | 201 MachineType rep = MachineType::AnyTagged()); |
| 197 // Load value from current parent frame by given offset in bytes. | 202 // Load value from current parent frame by given offset in bytes. |
| 198 compiler::Node* LoadFromParentFrame( | 203 compiler::Node* LoadFromParentFrame( |
| 199 int offset, MachineType rep = MachineType::AnyTagged()); | 204 int offset, MachineType rep = MachineType::AnyTagged()); |
| 200 | 205 |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 216 compiler::Node* LoadAndUntagSmi(compiler::Node* base, int index); | 221 compiler::Node* LoadAndUntagSmi(compiler::Node* base, int index); |
| 217 // Load a SMI root, untag it, and convert to Word32. | 222 // Load a SMI root, untag it, and convert to Word32. |
| 218 compiler::Node* LoadAndUntagToWord32Root(Heap::RootListIndex root_index); | 223 compiler::Node* LoadAndUntagToWord32Root(Heap::RootListIndex root_index); |
| 219 | 224 |
| 220 // Load the floating point value of a HeapNumber. | 225 // Load the floating point value of a HeapNumber. |
| 221 compiler::Node* LoadHeapNumberValue(compiler::Node* object); | 226 compiler::Node* LoadHeapNumberValue(compiler::Node* object); |
| 222 // Load the Map of an HeapObject. | 227 // Load the Map of an HeapObject. |
| 223 compiler::Node* LoadMap(compiler::Node* object); | 228 compiler::Node* LoadMap(compiler::Node* object); |
| 224 // Load the instance type of an HeapObject. | 229 // Load the instance type of an HeapObject. |
| 225 compiler::Node* LoadInstanceType(compiler::Node* object); | 230 compiler::Node* LoadInstanceType(compiler::Node* object); |
| 231 // Compare the instance the type of the object against the provided one. | |
| 232 compiler::Node* HasInstanceType(compiler::Node* object, InstanceType type); | |
| 226 // Checks that given heap object has given instance type. | 233 // Checks that given heap object has given instance type. |
| 227 void AssertInstanceType(compiler::Node* object, InstanceType instance_type); | 234 void AssertInstanceType(compiler::Node* object, InstanceType instance_type); |
| 228 // Load the properties backing store of a JSObject. | 235 // Load the properties backing store of a JSObject. |
| 229 compiler::Node* LoadProperties(compiler::Node* object); | 236 compiler::Node* LoadProperties(compiler::Node* object); |
| 230 // Load the elements backing store of a JSObject. | 237 // Load the elements backing store of a JSObject. |
| 231 compiler::Node* LoadElements(compiler::Node* object); | 238 compiler::Node* LoadElements(compiler::Node* object); |
| 232 // Load the length of a JSArray instance. | 239 // Load the length of a JSArray instance. |
| 233 compiler::Node* LoadJSArrayLength(compiler::Node* array); | 240 compiler::Node* LoadJSArrayLength(compiler::Node* array); |
| 234 // Load the length of a fixed array base instance. | 241 // Load the length of a fixed array base instance. |
| 235 compiler::Node* LoadFixedArrayBaseLength(compiler::Node* array); | 242 compiler::Node* LoadFixedArrayBaseLength(compiler::Node* array); |
| 236 // Load the length of a fixed array base instance. | 243 // Load the length of a fixed array base instance. |
| 237 compiler::Node* LoadAndUntagFixedArrayBaseLength(compiler::Node* array); | 244 compiler::Node* LoadAndUntagFixedArrayBaseLength(compiler::Node* array); |
| 238 // Load the bit field of a Map. | 245 // Load the bit field of a Map. |
| 239 compiler::Node* LoadMapBitField(compiler::Node* map); | 246 compiler::Node* LoadMapBitField(compiler::Node* map); |
| 240 // Load bit field 2 of a map. | 247 // Load bit field 2 of a map. |
| 241 compiler::Node* LoadMapBitField2(compiler::Node* map); | 248 compiler::Node* LoadMapBitField2(compiler::Node* map); |
| 242 // Load bit field 3 of a map. | 249 // Load bit field 3 of a map. |
| 243 compiler::Node* LoadMapBitField3(compiler::Node* map); | 250 compiler::Node* LoadMapBitField3(compiler::Node* map); |
| 244 // Load the instance type of a map. | 251 // Load the instance type of a map. |
| 245 compiler::Node* LoadMapInstanceType(compiler::Node* map); | 252 compiler::Node* LoadMapInstanceType(compiler::Node* map); |
| 246 // Load the ElementsKind of a map. | 253 // Load the ElementsKind of a map. |
| 247 compiler::Node* LoadMapElementsKind(compiler::Node* map); | 254 compiler::Node* LoadMapElementsKind(compiler::Node* map); |
| 248 // Load the instance descriptors of a map. | 255 // Load the instance descriptors of a map. |
| 249 compiler::Node* LoadMapDescriptors(compiler::Node* map); | 256 compiler::Node* LoadMapDescriptors(compiler::Node* map); |
| 257 // Load the number of own descriptors from a map. | |
| 258 compiler::Node* LoadMapNumberOfOwnDescriptors(compiler::Node* map); | |
| 250 // Load the prototype of a map. | 259 // Load the prototype of a map. |
| 251 compiler::Node* LoadMapPrototype(compiler::Node* map); | 260 compiler::Node* LoadMapPrototype(compiler::Node* map); |
| 261 // Load the prototype info of a map. The result has to be checked if it is a | |
| 262 // prototype info object or not. | |
| 263 compiler::Node* LoadMapPrototypeInfo(compiler::Node* map, | |
| 264 Label* if_has_no_proto_info); | |
| 252 // Load the instance size of a Map. | 265 // Load the instance size of a Map. |
| 253 compiler::Node* LoadMapInstanceSize(compiler::Node* map); | 266 compiler::Node* LoadMapInstanceSize(compiler::Node* map); |
| 254 // Load the inobject properties count of a Map (valid only for JSObjects). | 267 // Load the inobject properties count of a Map (valid only for JSObjects). |
| 255 compiler::Node* LoadMapInobjectProperties(compiler::Node* map); | 268 compiler::Node* LoadMapInobjectProperties(compiler::Node* map); |
| 256 // Load the constructor function index of a Map (only for primitive maps). | 269 // Load the constructor function index of a Map (only for primitive maps). |
| 257 compiler::Node* LoadMapConstructorFunctionIndex(compiler::Node* map); | 270 compiler::Node* LoadMapConstructorFunctionIndex(compiler::Node* map); |
| 258 // Load the constructor of a Map (equivalent to Map::GetConstructor()). | 271 // Load the constructor of a Map (equivalent to Map::GetConstructor()). |
| 259 compiler::Node* LoadMapConstructor(compiler::Node* map); | 272 compiler::Node* LoadMapConstructor(compiler::Node* map); |
| 273 // Check whether the map is for fast properties. | |
| 274 compiler::Node* IsFastMap(compiler::Node* map); | |
| 275 // Check whether the map is for an object with special properties, such as a | |
| 276 // JSProxy or an object with interceptors. | |
| 277 compiler::Node* IsSpecialReceiverMap(compiler::Node* map); | |
| 278 compiler::Node* IsSpecialReceiverInstanceType(compiler::Node* instance_type); | |
| 260 | 279 |
| 261 // Load the hash field of a name as an uint32 value. | 280 // Load the hash field of a name as an uint32 value. |
| 262 compiler::Node* LoadNameHashField(compiler::Node* name); | 281 compiler::Node* LoadNameHashField(compiler::Node* name); |
| 263 // Load the hash value of a name as an uint32 value. | 282 // Load the hash value of a name as an uint32 value. |
| 264 // If {if_hash_not_computed} label is specified then it also checks if | 283 // If {if_hash_not_computed} label is specified then it also checks if |
| 265 // hash is actually computed. | 284 // hash is actually computed. |
| 266 compiler::Node* LoadNameHash(compiler::Node* name, | 285 compiler::Node* LoadNameHash(compiler::Node* name, |
| 267 Label* if_hash_not_computed = nullptr); | 286 Label* if_hash_not_computed = nullptr); |
| 268 | 287 |
| 269 // Load length field of a String object. | 288 // Load length field of a String object. |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 328 // Store an array element to a FixedArray. | 347 // Store an array element to a FixedArray. |
| 329 compiler::Node* StoreFixedArrayElement( | 348 compiler::Node* StoreFixedArrayElement( |
| 330 compiler::Node* object, compiler::Node* index, compiler::Node* value, | 349 compiler::Node* object, compiler::Node* index, compiler::Node* value, |
| 331 WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER, | 350 WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER, |
| 332 ParameterMode parameter_mode = INTEGER_PARAMETERS); | 351 ParameterMode parameter_mode = INTEGER_PARAMETERS); |
| 333 | 352 |
| 334 compiler::Node* StoreFixedDoubleArrayElement( | 353 compiler::Node* StoreFixedDoubleArrayElement( |
| 335 compiler::Node* object, compiler::Node* index, compiler::Node* value, | 354 compiler::Node* object, compiler::Node* index, compiler::Node* value, |
| 336 ParameterMode parameter_mode = INTEGER_PARAMETERS); | 355 ParameterMode parameter_mode = INTEGER_PARAMETERS); |
| 337 | 356 |
| 357 void StoreFieldsNoWriteBarrier(compiler::Node* start_address, | |
| 358 compiler::Node* end_address, | |
| 359 compiler::Node* value); | |
| 360 | |
| 338 // Allocate a HeapNumber without initializing its value. | 361 // Allocate a HeapNumber without initializing its value. |
| 339 compiler::Node* AllocateHeapNumber(MutableMode mode = IMMUTABLE); | 362 compiler::Node* AllocateHeapNumber(MutableMode mode = IMMUTABLE); |
| 340 // Allocate a HeapNumber with a specific value. | 363 // Allocate a HeapNumber with a specific value. |
| 341 compiler::Node* AllocateHeapNumberWithValue(compiler::Node* value, | 364 compiler::Node* AllocateHeapNumberWithValue(compiler::Node* value, |
| 342 MutableMode mode = IMMUTABLE); | 365 MutableMode mode = IMMUTABLE); |
| 343 // Allocate a SeqOneByteString with the given length. | 366 // Allocate a SeqOneByteString with the given length. |
| 344 compiler::Node* AllocateSeqOneByteString(int length); | 367 compiler::Node* AllocateSeqOneByteString(int length); |
| 345 compiler::Node* AllocateSeqOneByteString(compiler::Node* context, | 368 compiler::Node* AllocateSeqOneByteString(compiler::Node* context, |
| 346 compiler::Node* length); | 369 compiler::Node* length); |
| 347 // Allocate a SeqTwoByteString with the given length. | 370 // Allocate a SeqTwoByteString with the given length. |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 375 | 398 |
| 376 // Allocate a RegExpResult with the given length (the number of captures, | 399 // Allocate a RegExpResult with the given length (the number of captures, |
| 377 // including the match itself), index (the index where the match starts), | 400 // including the match itself), index (the index where the match starts), |
| 378 // and input string. |length| and |index| are expected to be tagged, and | 401 // and input string. |length| and |index| are expected to be tagged, and |
| 379 // |input| must be a string. | 402 // |input| must be a string. |
| 380 compiler::Node* AllocateRegExpResult(compiler::Node* context, | 403 compiler::Node* AllocateRegExpResult(compiler::Node* context, |
| 381 compiler::Node* length, | 404 compiler::Node* length, |
| 382 compiler::Node* index, | 405 compiler::Node* index, |
| 383 compiler::Node* input); | 406 compiler::Node* input); |
| 384 | 407 |
| 408 compiler::Node* AllocateJSObjectFromMap(compiler::Node* map, | |
| 409 compiler::Node* properties = nullptr, | |
| 410 compiler::Node* elements = nullptr); | |
| 411 | |
| 412 void InitializeJSObjectFromMap(compiler::Node* object, compiler::Node* map, | |
| 413 compiler::Node* size, | |
| 414 compiler::Node* properties = nullptr, | |
| 415 compiler::Node* elements = nullptr); | |
| 416 | |
| 417 void InitializeJSObjectBody(compiler::Node* object, compiler::Node* map, | |
| 418 compiler::Node* size, | |
| 419 int start_offset = JSObject::kHeaderSize); | |
| 420 | |
| 385 // Allocate a JSArray without elements and initialize the header fields. | 421 // Allocate a JSArray without elements and initialize the header fields. |
| 386 compiler::Node* AllocateUninitializedJSArrayWithoutElements( | 422 compiler::Node* AllocateUninitializedJSArrayWithoutElements( |
| 387 ElementsKind kind, compiler::Node* array_map, compiler::Node* length, | 423 ElementsKind kind, compiler::Node* array_map, compiler::Node* length, |
| 388 compiler::Node* allocation_site); | 424 compiler::Node* allocation_site); |
| 389 // Allocate and return a JSArray with initialized header fields and its | 425 // Allocate and return a JSArray with initialized header fields and its |
| 390 // uninitialized elements. | 426 // uninitialized elements. |
| 391 // The ParameterMode argument is only used for the capacity parameter. | 427 // The ParameterMode argument is only used for the capacity parameter. |
| 392 std::pair<compiler::Node*, compiler::Node*> | 428 std::pair<compiler::Node*, compiler::Node*> |
| 393 AllocateUninitializedJSArrayWithElements( | 429 AllocateUninitializedJSArrayWithElements( |
| 394 ElementsKind kind, compiler::Node* array_map, compiler::Node* length, | 430 ElementsKind kind, compiler::Node* array_map, compiler::Node* length, |
| (...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 990 static const int kElementLoopUnrollThreshold = 8; | 1026 static const int kElementLoopUnrollThreshold = 8; |
| 991 }; | 1027 }; |
| 992 | 1028 |
| 993 #define CSA_ASSERT(x) Assert((x), #x, __FILE__, __LINE__) | 1029 #define CSA_ASSERT(x) Assert((x), #x, __FILE__, __LINE__) |
| 994 | 1030 |
| 995 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 1031 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
| 996 | 1032 |
| 997 } // namespace internal | 1033 } // namespace internal |
| 998 } // namespace v8 | 1034 } // namespace v8 |
| 999 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 1035 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
| OLD | NEW |