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); |
+ } |
} |
} |
} |