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

Unified Diff: src/interpreter/interpreter.cc

Issue 2609013002: [turbofan] Use InternalizedString feedback abstract/strict equality comparisons. (Closed)
Patch Set: Created 3 years, 12 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
« 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 0b5fc92e80dd7fc5adb25ed8c5dbc2efc67b08b0..724c159c5eeedd1bae69eef33e932490aa58d540 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -1038,9 +1038,27 @@ void Interpreter::DoCompareOpWithFeedback(Token::Value compare_op,
__ Bind(&lhs_is_not_oddball);
}
- var_type_feedback.Bind(__ SelectInt32Constant(
- __ IsStringInstanceType(lhs_instance_type),
- CompareOperationFeedback::kString, CompareOperationFeedback::kAny));
+ Label lhs_is_not_string(assembler);
+ __ GotoUnless(__ IsStringInstanceType(lhs_instance_type),
+ &lhs_is_not_string);
+
+ if (Token::IsOrderedRelationalCompareOp(compare_op)) {
+ var_type_feedback.Bind(
+ __ Int32Constant(CompareOperationFeedback::kString));
+ } else {
+ var_type_feedback.Bind(__ SelectInt32Constant(
+ __ Word32Equal(
+ __ Word32And(lhs_instance_type,
+ __ Int32Constant(kIsNotInternalizedMask)),
+ __ Int32Constant(kInternalizedTag)),
+ CompareOperationFeedback::kInternalizedString,
+ CompareOperationFeedback::kString));
+ }
+ __ Goto(&gather_rhs_type);
+
+ __ Bind(&lhs_is_not_string);
+ var_type_feedback.Bind(
+ __ Int32Constant(CompareOperationFeedback::kAny));
__ Goto(&gather_rhs_type);
}
}
@@ -1083,11 +1101,30 @@ void Interpreter::DoCompareOpWithFeedback(Token::Value compare_op,
__ Bind(&rhs_is_not_oddball);
}
- var_type_feedback.Bind(__ Word32Or(
- var_type_feedback.value(),
- __ SelectInt32Constant(__ IsStringInstanceType(rhs_instance_type),
- CompareOperationFeedback::kString,
- CompareOperationFeedback::kAny)));
+ Label rhs_is_not_string(assembler);
+ __ GotoUnless(__ IsStringInstanceType(rhs_instance_type),
+ &rhs_is_not_string);
+
+ if (Token::IsOrderedRelationalCompareOp(compare_op)) {
+ var_type_feedback.Bind(__ Word32Or(
+ var_type_feedback.value(),
+ __ Int32Constant(CompareOperationFeedback::kString)));
+ } else {
+ var_type_feedback.Bind(__ Word32Or(
+ var_type_feedback.value(),
+ __ SelectInt32Constant(
+ __ Word32Equal(
+ __ Word32And(rhs_instance_type,
+ __ Int32Constant(kIsNotInternalizedMask)),
+ __ Int32Constant(kInternalizedTag)),
+ CompareOperationFeedback::kInternalizedString,
+ CompareOperationFeedback::kString)));
+ }
+ __ Goto(&update_feedback);
+
+ __ Bind(&rhs_is_not_string);
+ var_type_feedback.Bind(
+ __ 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