Commit bd93fa6e authored by rmcilroy's avatar rmcilroy Committed by Commit bot

Revert of [Interpreter] Collect NumberOrOddball feedback in CompareOps....

Revert of [Interpreter] Collect NumberOrOddball feedback in CompareOps. (patchset #2 id:20001 of https://codereview.chromium.org/2506283003/ )

Reason for revert:
Turbofan doesn't do proper ToNumber conversions on NumberOrOddball equality conversions.

BUG=v8:5660

Original issue's description:
> [Interpreter] Collect NumberOrOddball feedback in CompareOps.
>
> Collect feedback for oddballs in the interpreter compare operations handlers.
> This is important to ensure that we don't consider oddball comparisons as
> generic, which prevents optimization.
>
> BUG=chromium:660947
>
> Committed: https://crrev.com/721e74d9d942fd4f2e3392ea9626d9d404dbbbd0
> Cr-Commit-Position: refs/heads/master@{#41081}

TBR=bmeurer@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=chromium:660947

Review-Url: https://codereview.chromium.org/2517133002
Cr-Commit-Position: refs/heads/master@{#41134}
parent 4513532f
......@@ -1244,8 +1244,8 @@ class BinaryOperationFeedback {
// Type feedback is encoded in such a way that, we can combine the feedback
// at different points by performing an 'OR' operation. Type feedback moves
// to a more generic type when we combine feedback.
// kSignedSmall -> kNumber -> kNumberOrOddball -> kAny
// kString -> kAny
// kSignedSmall -> kNumber -> kAny
// kString -> kAny
// TODO(epertoso): consider unifying this with BinaryOperationFeedback.
class CompareOperationFeedback {
public:
......@@ -1253,9 +1253,8 @@ class CompareOperationFeedback {
kNone = 0x00,
kSignedSmall = 0x01,
kNumber = 0x3,
kNumberOrOddball = 0x7,
kString = 0x8,
kAny = 0x1F
kString = 0x4,
kAny = 0xf
};
};
......
......@@ -1035,8 +1035,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_oddball(assembler), lhs_is_not_string(assembler),
gather_rhs_type(assembler), update_feedback(assembler);
lhs_is_not_string(assembler), gather_rhs_type(assembler),
update_feedback(assembler);
__ GotoUnless(__ TaggedIsSmi(lhs), &lhs_is_not_smi);
......@@ -1057,31 +1057,19 @@ void Interpreter::DoCompareOpWithFeedback(Token::Value compare_op,
__ Bind(&lhs_is_not_number);
{
Node* lhs_instance_type = __ LoadInstanceType(lhs);
Node* lhs_is_oddball =
__ Word32Equal(lhs_instance_type, __ Int32Constant(ODDBALL_TYPE));
__ GotoUnless(lhs_is_oddball, &lhs_is_not_oddball);
Node* lhs_type =
__ Select(__ IsStringInstanceType(lhs_instance_type),
__ Int32Constant(CompareOperationFeedback::kString),
__ Int32Constant(CompareOperationFeedback::kAny));
var_type_feedback.Bind(
__ Int32Constant(CompareOperationFeedback::kNumberOrOddball));
var_type_feedback.Bind(lhs_type);
__ 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),
rhs_is_not_oddball(assembler);
Label rhs_is_not_smi(assembler), rhs_is_not_number(assembler);
__ GotoUnless(__ TaggedIsSmi(rhs), &rhs_is_not_smi);
......@@ -1104,24 +1092,13 @@ void Interpreter::DoCompareOpWithFeedback(Token::Value compare_op,
__ Bind(&rhs_is_not_number);
{
Node* rhs_instance_type = __ LoadInstanceType(rhs);
Node* rhs_is_oddball =
__ Word32Equal(rhs_instance_type, __ Int32Constant(ODDBALL_TYPE));
__ GotoUnless(rhs_is_oddball, &rhs_is_not_oddball);
Node* rhs_type =
__ Select(__ IsStringInstanceType(rhs_instance_type),
__ Int32Constant(CompareOperationFeedback::kString),
__ Int32Constant(CompareOperationFeedback::kAny));
var_type_feedback.Bind(
__ 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);
}
__ Word32Or(var_type_feedback.value(), rhs_type));
__ Goto(&update_feedback);
}
}
}
......
......@@ -126,8 +126,6 @@ CompareOperationHint CompareOperationHintFromFeedback(int type_feedback) {
return CompareOperationHint::kSignedSmall;
case CompareOperationFeedback::kNumber:
return CompareOperationHint::kNumber;
case CompareOperationFeedback::kNumberOrOddball:
return CompareOperationHint::kNumberOrOddball;
case CompareOperationFeedback::kString:
return CompareOperationHint::kString;
default:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment