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 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 Int32Constant(0)); | 699 Int32Constant(0)); |
700 } | 700 } |
701 | 701 |
702 // Returns true if any of the |T|'s bits in given |word| are set. | 702 // Returns true if any of the |T|'s bits in given |word| are set. |
703 template <typename T> | 703 template <typename T> |
704 Node* IsSetWord(Node* word) { | 704 Node* IsSetWord(Node* word) { |
705 return WordNotEqual(WordAnd(word, IntPtrConstant(T::kMask)), | 705 return WordNotEqual(WordAnd(word, IntPtrConstant(T::kMask)), |
706 IntPtrConstant(0)); | 706 IntPtrConstant(0)); |
707 } | 707 } |
708 | 708 |
| 709 // Returns true if any of the mask's bits in given |word| are set. |
| 710 Node* IsSetWord(Node* word, uint32_t mask) { |
| 711 return WordNotEqual(WordAnd(word, Int32Constant(mask)), Int32Constant(0)); |
| 712 } |
| 713 |
709 void SetCounter(StatsCounter* counter, int value); | 714 void SetCounter(StatsCounter* counter, int value); |
710 void IncrementCounter(StatsCounter* counter, int delta); | 715 void IncrementCounter(StatsCounter* counter, int delta); |
711 void DecrementCounter(StatsCounter* counter, int delta); | 716 void DecrementCounter(StatsCounter* counter, int delta); |
712 | 717 |
713 void Increment(Variable& variable, int value = 1, | 718 void Increment(Variable& variable, int value = 1, |
714 ParameterMode mode = INTPTR_PARAMETERS); | 719 ParameterMode mode = INTPTR_PARAMETERS); |
715 | 720 |
716 // Generates "if (false) goto label" code. Useful for marking a label as | 721 // Generates "if (false) goto label" code. Useful for marking a label as |
717 // "live" to avoid assertion failures during graph building. In the resulting | 722 // "live" to avoid assertion failures during graph building. In the resulting |
718 // code this check will be eliminated. | 723 // code this check will be eliminated. |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1123 } | 1128 } |
1124 #else | 1129 #else |
1125 #define CSA_SLOW_ASSERT(csa, x) ((void)0) | 1130 #define CSA_SLOW_ASSERT(csa, x) ((void)0) |
1126 #endif | 1131 #endif |
1127 | 1132 |
1128 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 1133 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
1129 | 1134 |
1130 } // namespace internal | 1135 } // namespace internal |
1131 } // namespace v8 | 1136 } // namespace v8 |
1132 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 1137 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
OLD | NEW |