| 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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 compiler::Node* LoadMapDescriptors(compiler::Node* map); | 226 compiler::Node* LoadMapDescriptors(compiler::Node* map); |
| 227 // Load the prototype of a map. | 227 // Load the prototype of a map. |
| 228 compiler::Node* LoadMapPrototype(compiler::Node* map); | 228 compiler::Node* LoadMapPrototype(compiler::Node* map); |
| 229 // Load the instance size of a Map. | 229 // Load the instance size of a Map. |
| 230 compiler::Node* LoadMapInstanceSize(compiler::Node* map); | 230 compiler::Node* LoadMapInstanceSize(compiler::Node* map); |
| 231 // Load the inobject properties count of a Map (valid only for JSObjects). | 231 // Load the inobject properties count of a Map (valid only for JSObjects). |
| 232 compiler::Node* LoadMapInobjectProperties(compiler::Node* map); | 232 compiler::Node* LoadMapInobjectProperties(compiler::Node* map); |
| 233 // Load the constructor of a Map (equivalent to Map::GetConstructor()). | 233 // Load the constructor of a Map (equivalent to Map::GetConstructor()). |
| 234 compiler::Node* LoadMapConstructor(compiler::Node* map); | 234 compiler::Node* LoadMapConstructor(compiler::Node* map); |
| 235 | 235 |
| 236 // Load the hash field of a name. | 236 // Load the hash field of a name as an uint32 value. |
| 237 compiler::Node* LoadNameHashField(compiler::Node* name); | 237 compiler::Node* LoadNameHashField(compiler::Node* name); |
| 238 // Load the hash value of a name. If {if_hash_not_computed} label | 238 // Load the hash value of a name as an uint32 value. |
| 239 // is specified then it also checks if hash is actually computed. | 239 // If {if_hash_not_computed} label is specified then it also checks if |
| 240 // hash is actually computed. |
| 240 compiler::Node* LoadNameHash(compiler::Node* name, | 241 compiler::Node* LoadNameHash(compiler::Node* name, |
| 241 Label* if_hash_not_computed = nullptr); | 242 Label* if_hash_not_computed = nullptr); |
| 242 | 243 |
| 243 // Load length field of a String object. | 244 // Load length field of a String object. |
| 244 compiler::Node* LoadStringLength(compiler::Node* object); | 245 compiler::Node* LoadStringLength(compiler::Node* object); |
| 245 // Load value field of a JSValue object. | 246 // Load value field of a JSValue object. |
| 246 compiler::Node* LoadJSValueValue(compiler::Node* object); | 247 compiler::Node* LoadJSValueValue(compiler::Node* object); |
| 247 // Load value field of a WeakCell object. | 248 // Load value field of a WeakCell object. |
| 248 compiler::Node* LoadWeakCellValue(compiler::Node* weak_cell, | 249 compiler::Node* LoadWeakCellValue(compiler::Node* weak_cell, |
| 249 Label* if_cleared = nullptr); | 250 Label* if_cleared = nullptr); |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 compiler::Node* StringCharCodeAt(compiler::Node* string, | 374 compiler::Node* StringCharCodeAt(compiler::Node* string, |
| 374 compiler::Node* smi_index); | 375 compiler::Node* smi_index); |
| 375 // Return the single character string with only {code}. | 376 // Return the single character string with only {code}. |
| 376 compiler::Node* StringFromCharCode(compiler::Node* code); | 377 compiler::Node* StringFromCharCode(compiler::Node* code); |
| 377 | 378 |
| 378 // Type conversion helpers. | 379 // Type conversion helpers. |
| 379 // Convert a String to a Number. | 380 // Convert a String to a Number. |
| 380 compiler::Node* StringToNumber(compiler::Node* context, | 381 compiler::Node* StringToNumber(compiler::Node* context, |
| 381 compiler::Node* input); | 382 compiler::Node* input); |
| 382 | 383 |
| 383 // Returns a node that is true if the given bit is set in |word32|. | 384 // Returns a node that contains a decoded (unsigned!) value of a bit |
| 385 // field |T| in |word32|. Returns result as an uint32 node. |
| 384 template <typename T> | 386 template <typename T> |
| 385 compiler::Node* BitFieldDecode(compiler::Node* word32) { | 387 compiler::Node* BitFieldDecode(compiler::Node* word32) { |
| 386 return BitFieldDecode(word32, T::kShift, T::kMask); | 388 return BitFieldDecode(word32, T::kShift, T::kMask); |
| 387 } | 389 } |
| 388 | 390 |
| 391 // Returns a node that contains a decoded (unsigned!) value of a bit |
| 392 // field |T| in |word32|. Returns result as a word-size node. |
| 393 template <typename T> |
| 394 compiler::Node* BitFieldDecodeWord(compiler::Node* word32) { |
| 395 return ChangeUint32ToWord(BitFieldDecode<T>(word32)); |
| 396 } |
| 397 |
| 398 // Decodes an unsigned (!) value from |word32| to an uint32 node. |
| 389 compiler::Node* BitFieldDecode(compiler::Node* word32, uint32_t shift, | 399 compiler::Node* BitFieldDecode(compiler::Node* word32, uint32_t shift, |
| 390 uint32_t mask); | 400 uint32_t mask); |
| 391 | 401 |
| 392 void SetCounter(StatsCounter* counter, int value); | 402 void SetCounter(StatsCounter* counter, int value); |
| 393 void IncrementCounter(StatsCounter* counter, int delta); | 403 void IncrementCounter(StatsCounter* counter, int delta); |
| 394 void DecrementCounter(StatsCounter* counter, int delta); | 404 void DecrementCounter(StatsCounter* counter, int delta); |
| 395 | 405 |
| 396 // Generates "if (false) goto label" code. Useful for marking a label as | 406 // Generates "if (false) goto label" code. Useful for marking a label as |
| 397 // "live" to avoid assertion failures during graph building. In the resulting | 407 // "live" to avoid assertion failures during graph building. In the resulting |
| 398 // code this check will be eliminated. | 408 // code this check will be eliminated. |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 compiler::Node* SmiShiftBitsConstant(); | 644 compiler::Node* SmiShiftBitsConstant(); |
| 635 | 645 |
| 636 static const int kElementLoopUnrollThreshold = 8; | 646 static const int kElementLoopUnrollThreshold = 8; |
| 637 }; | 647 }; |
| 638 | 648 |
| 639 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 649 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
| 640 | 650 |
| 641 } // namespace internal | 651 } // namespace internal |
| 642 } // namespace v8 | 652 } // namespace v8 |
| 643 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 653 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
| OLD | NEW |