Commit 457bbdc4 authored by verwaest's avatar verwaest Committed by Commit bot

[crankshaft] Add support for comparing with indirect undetectable values

If left or right is guaranteed at compile-time to be an undetectable object, use HIsUndetectableAndBranch on the other side.

BUG=

Review URL: https://codereview.chromium.org/1775163005

Cr-Commit-Position: refs/heads/master@{#34616}
parent 69c84fe4
......@@ -11682,6 +11682,20 @@ HControlInstruction* HOptimizedGraphBuilder::BuildCompareInstruction(
New<HCompareNumericAndBranch>(left, right, op);
return result;
} else {
if (op == Token::EQ) {
if (left->IsConstant() &&
HConstant::cast(left)->GetInstanceType() == ODDBALL_TYPE &&
HConstant::cast(left)->IsUndetectable()) {
return New<HIsUndetectableAndBranch>(right);
}
if (right->IsConstant() &&
HConstant::cast(right)->GetInstanceType() == ODDBALL_TYPE &&
HConstant::cast(right)->IsUndetectable()) {
return New<HIsUndetectableAndBranch>(left);
}
}
if (combined_rep.IsTagged() || combined_rep.IsNone()) {
HCompareGeneric* result = Add<HCompareGeneric>(left, right, op);
result->set_observed_input_representation(1, left_rep);
......
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