| Index: src/x64/full-codegen-x64.cc
|
| diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc
|
| index 8ca173b30fa18dcd9f735928a16091ac282573d2..7795510196393d5dbfe92343dfde7f30e5b3922f 100644
|
| --- a/src/x64/full-codegen-x64.cc
|
| +++ b/src/x64/full-codegen-x64.cc
|
| @@ -4381,24 +4381,20 @@ void FullCodeGenerator::EmitLiteralCompareNil(CompareOperation* expr,
|
|
|
| VisitForAccumulatorValue(sub_expr);
|
| PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
|
| - Heap::RootListIndex nil_value = nil == kNullValue ?
|
| - Heap::kNullValueRootIndex :
|
| - Heap::kUndefinedValueRootIndex;
|
| - __ CompareRoot(rax, nil_value);
|
| - if (expr->op() == Token::EQ_STRICT) {
|
| + EqualityKind kind = expr->op() == Token::EQ_STRICT
|
| + ? kStrictEquality : kNonStrictEquality;
|
| + if (kind == kStrictEquality) {
|
| + Heap::RootListIndex nil_value = nil == kNullValue ?
|
| + Heap::kNullValueRootIndex :
|
| + Heap::kUndefinedValueRootIndex;
|
| + __ CompareRoot(rax, nil_value);
|
| Split(equal, if_true, if_false, fall_through);
|
| } else {
|
| - Heap::RootListIndex other_nil_value = nil == kNullValue ?
|
| - Heap::kUndefinedValueRootIndex :
|
| - Heap::kNullValueRootIndex;
|
| - __ j(equal, if_true);
|
| - __ CompareRoot(rax, other_nil_value);
|
| - __ j(equal, if_true);
|
| - __ JumpIfSmi(rax, if_false);
|
| - // It can be an undetectable object.
|
| - __ movq(rdx, FieldOperand(rax, HeapObject::kMapOffset));
|
| - __ testb(FieldOperand(rdx, Map::kBitFieldOffset),
|
| - Immediate(1 << Map::kIsUndetectable));
|
| + __ Move(rcx, Smi::FromInt(kind));
|
| + __ Move(rbx, Smi::FromInt(nil));
|
| + Handle<Code> ic = CompareNilIC::GetUninitialized();
|
| + CallIC(ic, RelocInfo::CODE_TARGET, expr->CompareOperationFeedbackId());
|
| + __ testq(rax, rax);
|
| Split(not_zero, if_true, if_false, fall_through);
|
| }
|
| context()->Plug(if_true, if_false);
|
|
|