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 #include "src/compiler/type-hint-analyzer.h" | 5 #include "src/compiler/type-hint-analyzer.h" |
6 | 6 |
7 #include "src/assembler.h" | 7 #include "src/assembler.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/compiler/type-hints.h" | |
10 #include "src/ic/ic-state.h" | 9 #include "src/ic/ic-state.h" |
| 10 #include "src/type-hints.h" |
11 | 11 |
12 namespace v8 { | 12 namespace v8 { |
13 namespace internal { | 13 namespace internal { |
14 namespace compiler { | 14 namespace compiler { |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 BinaryOperationHint ToBinaryOperationHint(Token::Value op, | 18 BinaryOperationHint ToBinaryOperationHint(Token::Value op, |
19 BinaryOpICState::Kind kind) { | 19 BinaryOpICState::Kind kind) { |
20 switch (kind) { | 20 switch (kind) { |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 break; | 129 break; |
130 } | 130 } |
131 default: | 131 default: |
132 // Ignore the remaining code objects. | 132 // Ignore the remaining code objects. |
133 break; | 133 break; |
134 } | 134 } |
135 } | 135 } |
136 return new (zone()) TypeHintAnalysis(infos, zone()); | 136 return new (zone()) TypeHintAnalysis(infos, zone()); |
137 } | 137 } |
138 | 138 |
139 // Helper function to transform the feedback to BinaryOperationHint. | |
140 BinaryOperationHint BinaryOperationHintFromFeedback(int type_feedback) { | |
141 switch (type_feedback) { | |
142 case BinaryOperationFeedback::kSignedSmall: | |
143 return BinaryOperationHint::kSignedSmall; | |
144 case BinaryOperationFeedback::kNumber: | |
145 return BinaryOperationHint::kNumberOrOddball; | |
146 case BinaryOperationFeedback::kAny: | |
147 default: | |
148 return BinaryOperationHint::kAny; | |
149 } | |
150 UNREACHABLE(); | |
151 return BinaryOperationHint::kNone; | |
152 } | |
153 | |
154 // Helper function to transform the feedback to CompareOperationHint. | |
155 CompareOperationHint CompareOperationHintFromFeedback(int type_feedback) { | |
156 switch (type_feedback) { | |
157 case CompareOperationFeedback::kSignedSmall: | |
158 return CompareOperationHint::kSignedSmall; | |
159 case CompareOperationFeedback::kNumber: | |
160 return CompareOperationHint::kNumber; | |
161 default: | |
162 return CompareOperationHint::kAny; | |
163 } | |
164 } | |
165 | 139 |
166 } // namespace compiler | 140 } // namespace compiler |
167 } // namespace internal | 141 } // namespace internal |
168 } // namespace v8 | 142 } // namespace v8 |
OLD | NEW |