| Index: src/hydrogen.cc
|
| diff --git a/src/hydrogen.cc b/src/hydrogen.cc
|
| index 60edbb7c8be2ce052e797380de8f533a9e3cc066..e7f8dc0d771fe231a8404550b31ce1f8813d0b6e 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()
|
| + : 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());
|
| }
|
|
|