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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 Node* LoadAndUntagToWord32Root(Heap::RootListIndex root_index); | 305 Node* LoadAndUntagToWord32Root(Heap::RootListIndex root_index); |
306 | 306 |
307 // Load the floating point value of a HeapNumber. | 307 // Load the floating point value of a HeapNumber. |
308 Node* LoadHeapNumberValue(Node* object); | 308 Node* LoadHeapNumberValue(Node* object); |
309 // Load the Map of an HeapObject. | 309 // Load the Map of an HeapObject. |
310 Node* LoadMap(Node* object); | 310 Node* LoadMap(Node* object); |
311 // Load the instance type of an HeapObject. | 311 // Load the instance type of an HeapObject. |
312 Node* LoadInstanceType(Node* object); | 312 Node* LoadInstanceType(Node* object); |
313 // Compare the instance the type of the object against the provided one. | 313 // Compare the instance the type of the object against the provided one. |
314 Node* HasInstanceType(Node* object, InstanceType type); | 314 Node* HasInstanceType(Node* object, InstanceType type); |
| 315 Node* DoesntHaveInstanceType(Node* object, InstanceType type); |
315 // Load the properties backing store of a JSObject. | 316 // Load the properties backing store of a JSObject. |
316 Node* LoadProperties(Node* object); | 317 Node* LoadProperties(Node* object); |
317 // Load the elements backing store of a JSObject. | 318 // Load the elements backing store of a JSObject. |
318 Node* LoadElements(Node* object); | 319 Node* LoadElements(Node* object); |
319 // Load the length of a JSArray instance. | 320 // Load the length of a JSArray instance. |
320 Node* LoadJSArrayLength(Node* array); | 321 Node* LoadJSArrayLength(Node* array); |
321 // Load the length of a fixed array base instance. | 322 // Load the length of a fixed array base instance. |
322 Node* LoadFixedArrayBaseLength(Node* array); | 323 Node* LoadFixedArrayBaseLength(Node* array); |
323 // Load the length of a fixed array base instance. | 324 // Load the length of a fixed array base instance. |
324 Node* LoadAndUntagFixedArrayBaseLength(Node* array); | 325 Node* LoadAndUntagFixedArrayBaseLength(Node* array); |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
772 template <typename T> | 773 template <typename T> |
773 Node* IsSetWord(Node* word) { | 774 Node* IsSetWord(Node* word) { |
774 return IsSetWord(word, T::kMask); | 775 return IsSetWord(word, T::kMask); |
775 } | 776 } |
776 | 777 |
777 // Returns true if any of the mask's bits in given |word| are set. | 778 // Returns true if any of the mask's bits in given |word| are set. |
778 Node* IsSetWord(Node* word, uint32_t mask) { | 779 Node* IsSetWord(Node* word, uint32_t mask) { |
779 return WordNotEqual(WordAnd(word, IntPtrConstant(mask)), IntPtrConstant(0)); | 780 return WordNotEqual(WordAnd(word, IntPtrConstant(mask)), IntPtrConstant(0)); |
780 } | 781 } |
781 | 782 |
| 783 // Returns true if all of the |T|'s bits in given |word32| are clear. |
| 784 template <typename T> |
| 785 Node* IsClearWord32(Node* word32) { |
| 786 return IsClearWord32(word32, T::kMask); |
| 787 } |
| 788 |
| 789 // Returns true if all of the mask's bits in given |word32| are clear. |
| 790 Node* IsClearWord32(Node* word32, uint32_t mask) { |
| 791 return Word32Equal(Word32And(word32, Int32Constant(mask)), |
| 792 Int32Constant(0)); |
| 793 } |
| 794 |
| 795 // Returns true if all of the |T|'s bits in given |word| are clear. |
| 796 template <typename T> |
| 797 Node* IsClearWord(Node* word) { |
| 798 return IsClearWord(word, T::kMask); |
| 799 } |
| 800 |
| 801 // Returns true if all of the mask's bits in given |word| are clear. |
| 802 Node* IsClearWord(Node* word, uint32_t mask) { |
| 803 return WordEqual(WordAnd(word, IntPtrConstant(mask)), IntPtrConstant(0)); |
| 804 } |
| 805 |
782 void SetCounter(StatsCounter* counter, int value); | 806 void SetCounter(StatsCounter* counter, int value); |
783 void IncrementCounter(StatsCounter* counter, int delta); | 807 void IncrementCounter(StatsCounter* counter, int delta); |
784 void DecrementCounter(StatsCounter* counter, int delta); | 808 void DecrementCounter(StatsCounter* counter, int delta); |
785 | 809 |
786 void Increment(Variable& variable, int value = 1, | 810 void Increment(Variable& variable, int value = 1, |
787 ParameterMode mode = INTPTR_PARAMETERS); | 811 ParameterMode mode = INTPTR_PARAMETERS); |
788 | 812 |
789 // Generates "if (false) goto label" code. Useful for marking a label as | 813 // Generates "if (false) goto label" code. Useful for marking a label as |
790 // "live" to avoid assertion failures during graph building. In the resulting | 814 // "live" to avoid assertion failures during graph building. In the resulting |
791 // code this check will be eliminated. | 815 // code this check will be eliminated. |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1038 ParameterMode mode, int header_size) { | 1062 ParameterMode mode, int header_size) { |
1039 return ElementOffsetFromIndex(element_count, kind, mode, header_size); | 1063 return ElementOffsetFromIndex(element_count, kind, mode, header_size); |
1040 } | 1064 } |
1041 | 1065 |
1042 Node* GetFixedArrayAllocationSize(Node* element_count, ElementsKind kind, | 1066 Node* GetFixedArrayAllocationSize(Node* element_count, ElementsKind kind, |
1043 ParameterMode mode) { | 1067 ParameterMode mode) { |
1044 return GetArrayAllocationSize(element_count, kind, mode, | 1068 return GetArrayAllocationSize(element_count, kind, mode, |
1045 FixedArray::kHeaderSize); | 1069 FixedArray::kHeaderSize); |
1046 } | 1070 } |
1047 | 1071 |
| 1072 void InitializeFieldsWithRoot(Node* object, Node* start_offset, |
| 1073 Node* end_offset, Heap::RootListIndex root); |
| 1074 |
1048 enum RelationalComparisonMode { | 1075 enum RelationalComparisonMode { |
1049 kLessThan, | 1076 kLessThan, |
1050 kLessThanOrEqual, | 1077 kLessThanOrEqual, |
1051 kGreaterThan, | 1078 kGreaterThan, |
1052 kGreaterThanOrEqual | 1079 kGreaterThanOrEqual |
1053 }; | 1080 }; |
1054 | 1081 |
1055 Node* RelationalComparison(RelationalComparisonMode mode, Node* lhs, | 1082 Node* RelationalComparison(RelationalComparisonMode mode, Node* lhs, |
1056 Node* rhs, Node* context); | 1083 Node* rhs, Node* context); |
1057 | 1084 |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1214 } | 1241 } |
1215 #else | 1242 #else |
1216 #define CSA_SLOW_ASSERT(csa, x) ((void)0) | 1243 #define CSA_SLOW_ASSERT(csa, x) ((void)0) |
1217 #endif | 1244 #endif |
1218 | 1245 |
1219 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 1246 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
1220 | 1247 |
1221 } // namespace internal | 1248 } // namespace internal |
1222 } // namespace v8 | 1249 } // namespace v8 |
1223 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 1250 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
OLD | NEW |