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

Unified Diff: src/interpreter/interpreter.cc

Issue 2506283003: [Interpreter] Collect NumberOrOddball feedback in CompareOps. (Closed)
Patch Set: Rebase 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 635844b6b3d6422753fd7f4f7db41416aa38d4d4..ea31df3e493ff13ff8d878cd81b496ee587ed64d 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -1003,8 +1003,8 @@ void Interpreter::DoCompareOpWithFeedback(Token::Value compare_op,
{
Variable var_type_feedback(assembler, MachineRepresentation::kWord32);
Label lhs_is_not_smi(assembler), lhs_is_not_number(assembler),
- lhs_is_not_string(assembler), gather_rhs_type(assembler),
- update_feedback(assembler);
+ lhs_is_not_oddball(assembler), lhs_is_not_string(assembler),
+ gather_rhs_type(assembler), update_feedback(assembler);
__ GotoUnless(__ TaggedIsSmi(lhs), &lhs_is_not_smi);
@@ -1025,19 +1025,31 @@ void Interpreter::DoCompareOpWithFeedback(Token::Value compare_op,
__ Bind(&lhs_is_not_number);
{
Node* lhs_instance_type = __ LoadInstanceType(lhs);
- Node* lhs_type =
- __ Select(__ IsStringInstanceType(lhs_instance_type),
- __ Int32Constant(CompareOperationFeedback::kString),
- __ Int32Constant(CompareOperationFeedback::kAny));
+ Node* lhs_is_oddball =
+ __ Word32Equal(lhs_instance_type, __ Int32Constant(ODDBALL_TYPE));
+ __ GotoUnless(lhs_is_oddball, &lhs_is_not_oddball);
- var_type_feedback.Bind(lhs_type);
+ var_type_feedback.Bind(
+ __ Int32Constant(CompareOperationFeedback::kNumberOrOddball));
__ Goto(&gather_rhs_type);
+
+ __ Bind(&lhs_is_not_oddball);
+ {
+ Node* lhs_type =
+ __ Select(__ IsStringInstanceType(lhs_instance_type),
+ __ Int32Constant(CompareOperationFeedback::kString),
+ __ Int32Constant(CompareOperationFeedback::kAny));
+
+ var_type_feedback.Bind(lhs_type);
+ __ Goto(&gather_rhs_type);
+ }
}
}
__ Bind(&gather_rhs_type);
{
- Label rhs_is_not_smi(assembler), rhs_is_not_number(assembler);
+ Label rhs_is_not_smi(assembler), rhs_is_not_number(assembler),
+ rhs_is_not_oddball(assembler);
__ GotoUnless(__ TaggedIsSmi(rhs), &rhs_is_not_smi);
@@ -1060,13 +1072,24 @@ void Interpreter::DoCompareOpWithFeedback(Token::Value compare_op,
__ Bind(&rhs_is_not_number);
{
Node* rhs_instance_type = __ LoadInstanceType(rhs);
- Node* rhs_type =
- __ Select(__ IsStringInstanceType(rhs_instance_type),
- __ Int32Constant(CompareOperationFeedback::kString),
- __ Int32Constant(CompareOperationFeedback::kAny));
+ Node* rhs_is_oddball =
+ __ Word32Equal(rhs_instance_type, __ Int32Constant(ODDBALL_TYPE));
+ __ GotoUnless(rhs_is_oddball, &rhs_is_not_oddball);
+
var_type_feedback.Bind(
- __ Word32Or(var_type_feedback.value(), rhs_type));
- __ Goto(&update_feedback);
+ __ Int32Constant(CompareOperationFeedback::kNumberOrOddball));
+ __ Goto(&do_compare);
+
+ __ Bind(&rhs_is_not_oddball);
+ {
+ Node* rhs_type =
+ __ Select(__ IsStringInstanceType(rhs_instance_type),
+ __ Int32Constant(CompareOperationFeedback::kString),
+ __ Int32Constant(CompareOperationFeedback::kAny));
+ var_type_feedback.Bind(
+ __ Word32Or(var_type_feedback.value(), rhs_type));
+ __ 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