OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_COMPILER_TYPE_HINTS_H_ | 5 #ifndef V8_COMPILER_TYPE_HINTS_H_ |
6 #define V8_COMPILER_TYPE_HINTS_H_ | 6 #define V8_COMPILER_TYPE_HINTS_H_ |
7 | 7 |
8 #include "src/base/flags.h" | 8 #include "src/base/flags.h" |
9 #include "src/utils.h" | 9 #include "src/utils.h" |
10 | 10 |
11 namespace v8 { | 11 namespace v8 { |
12 namespace internal { | 12 namespace internal { |
13 namespace compiler { | 13 namespace compiler { |
14 | 14 |
15 // Type hints for an binary operation. | 15 // Type hints for an binary operation. |
16 class BinaryOperationHints final { | 16 class BinaryOperationHints final { |
17 public: | 17 public: |
18 enum Hint { | 18 enum Hint { kNone, kSignedSmall, kSigned32, kNumberOrOddball, kString, kAny }; |
19 kNone, | |
20 kSignedSmall, | |
21 kSigned32, | |
22 kNumberOrUndefined, | |
23 kString, | |
24 kAny | |
25 }; | |
26 | 19 |
27 BinaryOperationHints() : BinaryOperationHints(kNone, kNone, kNone) {} | 20 BinaryOperationHints() : BinaryOperationHints(kNone, kNone, kNone) {} |
28 BinaryOperationHints(Hint left, Hint right, Hint result) | 21 BinaryOperationHints(Hint left, Hint right, Hint result) |
29 : bit_field_(LeftField::encode(left) | RightField::encode(right) | | 22 : bit_field_(LeftField::encode(left) | RightField::encode(right) | |
30 ResultField::encode(result)) {} | 23 ResultField::encode(result)) {} |
31 | 24 |
32 static BinaryOperationHints Any() { | 25 static BinaryOperationHints Any() { |
33 return BinaryOperationHints(kAny, kAny, kAny); | 26 return BinaryOperationHints(kAny, kAny, kAny); |
34 } | 27 } |
35 | 28 |
(...skipping 28 matching lines...) Expand all Loading... |
64 std::ostream& operator<<(std::ostream&, BinaryOperationHints::Hint); | 57 std::ostream& operator<<(std::ostream&, BinaryOperationHints::Hint); |
65 std::ostream& operator<<(std::ostream&, BinaryOperationHints); | 58 std::ostream& operator<<(std::ostream&, BinaryOperationHints); |
66 | 59 |
67 // Type hints for an binary operation. | 60 // Type hints for an binary operation. |
68 class CompareOperationHints final { | 61 class CompareOperationHints final { |
69 public: | 62 public: |
70 enum Hint { | 63 enum Hint { |
71 kNone, | 64 kNone, |
72 kBoolean, | 65 kBoolean, |
73 kSignedSmall, | 66 kSignedSmall, |
74 kNumber, | 67 kNumberOrOddball, |
75 kString, | 68 kString, |
76 kInternalizedString, | 69 kInternalizedString, |
77 kUniqueName, | 70 kUniqueName, |
78 kReceiver, | 71 kReceiver, |
79 kAny | 72 kAny |
80 }; | 73 }; |
81 | 74 |
82 CompareOperationHints() : CompareOperationHints(kNone, kNone, kNone) {} | 75 CompareOperationHints() : CompareOperationHints(kNone, kNone, kNone) {} |
83 CompareOperationHints(Hint left, Hint right, Hint combined) | 76 CompareOperationHints(Hint left, Hint right, Hint combined) |
84 : bit_field_(LeftField::encode(left) | RightField::encode(right) | | 77 : bit_field_(LeftField::encode(left) | RightField::encode(right) | |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 | 129 |
137 std::ostream& operator<<(std::ostream&, ToBooleanHints); | 130 std::ostream& operator<<(std::ostream&, ToBooleanHints); |
138 | 131 |
139 DEFINE_OPERATORS_FOR_FLAGS(ToBooleanHints) | 132 DEFINE_OPERATORS_FOR_FLAGS(ToBooleanHints) |
140 | 133 |
141 } // namespace compiler | 134 } // namespace compiler |
142 } // namespace internal | 135 } // namespace internal |
143 } // namespace v8 | 136 } // namespace v8 |
144 | 137 |
145 #endif // V8_COMPILER_TYPE_HINTS_H_ | 138 #endif // V8_COMPILER_TYPE_HINTS_H_ |
OLD | NEW |