Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index b24890af2a37daecf0d925221316f1fdb79030ed..eef51e5d952ceddd572edc2e05cd03a3fde2e52c 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -11650,6 +11650,23 @@ HControlInstruction* HOptimizedGraphBuilder::BuildCompareInstruction( |
HStringCompareAndBranch* result = |
New<HStringCompareAndBranch>(left, right, op); |
return result; |
+ } else if (combined_type->Is(Type::Boolean())) { |
+ AddCheckMap(left, isolate()->factory()->boolean_map()); |
+ AddCheckMap(right, isolate()->factory()->boolean_map()); |
+ if (Token::IsEqualityOp(op)) { |
+ HCompareObjectEqAndBranch* result = |
+ New<HCompareObjectEqAndBranch>(left, right); |
+ return result; |
+ } |
+ left = Add<HLoadNamedField>( |
+ left, nullptr, |
+ HObjectAccess::ForOddballToNumber(Representation::Smi())); |
+ right = Add<HLoadNamedField>( |
+ right, nullptr, |
+ HObjectAccess::ForOddballToNumber(Representation::Smi())); |
+ HCompareNumericAndBranch* result = |
+ New<HCompareNumericAndBranch>(left, right, op); |
+ return result; |
} else { |
if (combined_rep.IsTagged() || combined_rep.IsNone()) { |
HCompareGeneric* result = Add<HCompareGeneric>( |