Chromium Code Reviews| Index: src/hydrogen.cc |
| diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
| index ba2ef50326c2ffebedc5eb33f19677fd42a3ae77..ae926b99381f0d4f242ba68189ba3804f3dfeaf2 100644 |
| --- a/src/hydrogen.cc |
| +++ b/src/hydrogen.cc |
| @@ -1698,7 +1698,6 @@ HValue* HGraphBuilder::BuildCloneShallowArray(HContext* context, |
| void HGraphBuilder::BuildCompareNil( |
| HValue* value, |
| - EqualityKind kind, |
| CompareNilICStub::Types types, |
| Handle<Map> map, |
| int position, |
| @@ -1733,9 +1732,7 @@ void HGraphBuilder::BuildCompareNil( |
| // emitted below is the actual monomorphic map. |
| BuildCheckMap(value, map); |
| } else { |
| - if (kind == kNonStrictEquality) { |
| - if_nil.Deopt(); |
| - } |
| + if_nil.Deopt(); |
| } |
| } |
| @@ -9921,19 +9918,22 @@ void HOptimizedGraphBuilder::HandleLiteralCompareNil(CompareOperation* expr, |
| ASSERT(!HasStackOverflow()); |
| ASSERT(current_block() != NULL); |
| ASSERT(current_block()->HasPredecessor()); |
| - EqualityKind kind = |
| - expr->op() == Token::EQ_STRICT ? kStrictEquality : kNonStrictEquality; |
| HIfContinuation continuation; |
| CompareNilICStub::Types types; |
| - if (kind == kStrictEquality) { |
| - types.Add((nil == kNullValue) ? CompareNilICStub::NULL_TYPE : |
| - CompareNilICStub::UNDEFINED); |
| - } else { |
| - types = CompareNilICStub::Types(expr->compare_nil_types()); |
| - if (types.IsEmpty()) types = CompareNilICStub::Types::FullCompare(); |
| + if (expr->op() == Token::EQ_STRICT) { |
| + IfBuilder if_nil(this); |
| + if_nil.If<HCompareObjectEqAndBranch>( |
| + value, (nil== kNullValue) ? graph()->GetConstantNull() |
|
rossberg
2013/06/10 11:43:55
Nit: space before ==
|
| + : graph()->GetConstantUndefined()); |
| + if_nil.Then(); |
| + if_nil.Else(); |
| + if_nil.CaptureContinuation(&continuation); |
| + return ast_context()->ReturnContinuation(&continuation, expr->id()); |
| } |
| + types = CompareNilICStub::Types(expr->compare_nil_types()); |
| + if (types.IsEmpty()) types = CompareNilICStub::Types::FullCompare(); |
| Handle<Map> map_handle = expr->map(); |
| - BuildCompareNil(value, kind, types, map_handle, |
| + BuildCompareNil(value, types, map_handle, |
| expr->position(), &continuation); |
| return ast_context()->ReturnContinuation(&continuation, expr->id()); |
| } |