Index: src/crankshaft/hydrogen.cc |
diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc |
index dd99183faa3a18ab16168c734d5b93c14cc3bce8..1b8fb4d6d6093fb05204b632c479bcee2ccd3ccc 100644 |
--- a/src/crankshaft/hydrogen.cc |
+++ b/src/crankshaft/hydrogen.cc |
@@ -11689,6 +11689,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); |