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

Unified Diff: src/interpreter/interpreter.cc

Issue 2518283002: [ignition] Report NumberOrOddball feedback for relational comparisons. (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « src/globals.h ('k') | src/type-feedback-vector-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/interpreter.cc
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc
index b65c779a7da84bc219f07c3ab741c5706f049524..bb731b455bf4afa740027200449273555cdb45bf 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -1057,12 +1057,23 @@ void Interpreter::DoCompareOpWithFeedback(Token::Value compare_op,
__ Bind(&lhs_is_not_number);
{
Node* lhs_instance_type = __ LoadInstanceType(lhs);
- Node* lhs_type =
+ if (Token::IsOrderedRelationalCompareOp(compare_op)) {
+ Label lhs_is_not_oddball(assembler);
+ __ GotoUnless(
+ __ Word32Equal(lhs_instance_type, __ Int32Constant(ODDBALL_TYPE)),
+ &lhs_is_not_oddball);
+
+ var_type_feedback.Bind(
+ __ Int32Constant(CompareOperationFeedback::kNumberOrOddball));
+ __ Goto(&gather_rhs_type);
+
+ __ Bind(&lhs_is_not_oddball);
+ }
+
+ var_type_feedback.Bind(
__ Select(__ IsStringInstanceType(lhs_instance_type),
__ Int32Constant(CompareOperationFeedback::kString),
- __ Int32Constant(CompareOperationFeedback::kAny));
-
- var_type_feedback.Bind(lhs_type);
+ __ Int32Constant(CompareOperationFeedback::kAny)));
__ Goto(&gather_rhs_type);
}
}
@@ -1092,12 +1103,25 @@ void Interpreter::DoCompareOpWithFeedback(Token::Value compare_op,
__ Bind(&rhs_is_not_number);
{
Node* rhs_instance_type = __ LoadInstanceType(rhs);
- Node* rhs_type =
+ if (Token::IsOrderedRelationalCompareOp(compare_op)) {
+ Label rhs_is_not_oddball(assembler);
+ __ GotoUnless(__ Word32Equal(rhs_instance_type,
+ __ Int32Constant(ODDBALL_TYPE)),
+ &rhs_is_not_oddball);
+
+ var_type_feedback.Bind(__ Word32Or(
+ var_type_feedback.value(),
+ __ Int32Constant(CompareOperationFeedback::kNumberOrOddball)));
+ __ Goto(&update_feedback);
+
+ __ Bind(&rhs_is_not_oddball);
+ }
+
+ var_type_feedback.Bind(__ Word32Or(
+ var_type_feedback.value(),
__ Select(__ IsStringInstanceType(rhs_instance_type),
__ Int32Constant(CompareOperationFeedback::kString),
- __ Int32Constant(CompareOperationFeedback::kAny));
- var_type_feedback.Bind(
- __ Word32Or(var_type_feedback.value(), rhs_type));
+ __ Int32Constant(CompareOperationFeedback::kAny))));
__ Goto(&update_feedback);
}
}
« no previous file with comments | « src/globals.h ('k') | src/type-feedback-vector-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698