| Index: src/arm/full-codegen-arm.cc
|
| diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc
|
| index 6a332340315926960540a946599a398d1d3ce979..cdb7eb060a1f12038ae3e96673ce3ac28046d334 100644
|
| --- a/src/arm/full-codegen-arm.cc
|
| +++ b/src/arm/full-codegen-arm.cc
|
| @@ -4383,28 +4383,22 @@ 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;
|
| - __ LoadRoot(r1, nil_value);
|
| - __ cmp(r0, r1);
|
| - if (expr->op() == Token::EQ_STRICT) {
|
| - Split(eq, if_true, if_false, fall_through);
|
| - } else {
|
| - Heap::RootListIndex other_nil_value = nil == kNullValue ?
|
| - Heap::kUndefinedValueRootIndex :
|
| - Heap::kNullValueRootIndex;
|
| - __ b(eq, if_true);
|
| - __ LoadRoot(r1, other_nil_value);
|
| + EqualityKind kind = expr->op() == Token::EQ_STRICT
|
| + ? kStrictEquality : kNonStrictEquality;
|
| + if (kind == kStrictEquality) {
|
| + Heap::RootListIndex nil_value = nil == kNullValue ?
|
| + Heap::kNullValueRootIndex :
|
| + Heap::kUndefinedValueRootIndex;
|
| + __ LoadRoot(r1, nil_value);
|
| __ cmp(r0, r1);
|
| - __ b(eq, if_true);
|
| - __ JumpIfSmi(r0, if_false);
|
| - // It can be an undetectable object.
|
| - __ ldr(r1, FieldMemOperand(r0, HeapObject::kMapOffset));
|
| - __ ldrb(r1, FieldMemOperand(r1, Map::kBitFieldOffset));
|
| - __ and_(r1, r1, Operand(1 << Map::kIsUndetectable));
|
| - __ cmp(r1, Operand(1 << Map::kIsUndetectable));
|
| Split(eq, if_true, if_false, fall_through);
|
| + } else {
|
| + __ mov(r2, Operand(Smi::FromInt(kind)));
|
| + __ mov(r1, Operand(Smi::FromInt(nil)));
|
| + Handle<Code> ic = CompareNilIC::GetUninitialized();
|
| + CallIC(ic, RelocInfo::CODE_TARGET, expr->CompareOperationFeedbackId());
|
| + __ cmp(r0, Operand(0));
|
| + Split(ne, if_true, if_false, fall_through);
|
| }
|
| context()->Plug(if_true, if_false);
|
| }
|
|
|