Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1188)

Unified Diff: src/compiler/type-hint-analyzer.cc

Issue 2221833002: [Interpreter] Collect type feedback for subtract operation and pass it to turbofan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/compiler/type-hint-analyzer.cc
diff --git a/src/compiler/type-hint-analyzer.cc b/src/compiler/type-hint-analyzer.cc
index e3cafb4112deb29f7d0fd586c4c164ab9e76a41a..2c30e84fd2c1744dc88275cc41ab206e59fcbb8c 100644
--- a/src/compiler/type-hint-analyzer.cc
+++ b/src/compiler/type-hint-analyzer.cc
@@ -136,6 +136,23 @@ TypeHintAnalysis* TypeHintAnalyzer::Analyze(Handle<Code> code) {
return new (zone()) TypeHintAnalysis(infos, zone());
}
+// Helper function to transform the feedback to BinaryOperationHints
+// The encoded type is in the lower three bits as follows:
+// 1XX - Any Type
+// 01X - Number Type
+// 001 - Smi Type
+BinaryOperationHints::Hint BinaryOperationHintFromFeedback(int type_feedback) {
+ BinaryOperationHints::Hint hint = BinaryOperationHints::kAny;
+ if (BinaryOpTypeFeedback::AnyType::decode(type_feedback)) {
+ hint = BinaryOperationHints::kAny;
+ } else if (BinaryOpTypeFeedback::NumberType::decode(type_feedback)) {
+ hint = BinaryOperationHints::kNumberOrOddball;
+ } else if (BinaryOpTypeFeedback::SmiType::decode(type_feedback)) {
+ hint = BinaryOperationHints::kSigned32;
+ }
+ return hint;
+}
+
} // namespace compiler
} // namespace internal
} // namespace v8

Powered by Google App Engine
This is Rietveld 408576698