Index: src/arm/lithium-codegen-arm.cc |
diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc |
index 2cc55fee39a67867f367849caf132e99a21a8ac2..667646474a9f9e4fff164d2703aa56e9dee3e9c9 100644 |
--- a/src/arm/lithium-codegen-arm.cc |
+++ b/src/arm/lithium-codegen-arm.cc |
@@ -3348,6 +3348,23 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) { |
__ cmp(result, scratch); |
DeoptimizeIf(eq, instr, Deoptimizer::kHole); |
} |
+ } else if (instr->hydrogen()->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) { |
+ DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS); |
+ Label done; |
+ __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); |
+ __ cmp(result, scratch); |
+ __ b(ne, &done); |
+ if (info()->IsStub()) { |
+ // A stub can safely convert the hole to undefined only if the array |
+ // protector cell contains (Smi) Isolate::kArrayProtectorValid. Otherwise |
+ // it needs to bail out. |
+ __ LoadRoot(result, Heap::kArrayProtectorRootIndex); |
+ __ ldr(result, FieldMemOperand(result, Cell::kValueOffset)); |
+ __ cmp(result, Operand(Smi::FromInt(Isolate::kArrayProtectorValid))); |
+ DeoptimizeIf(ne, instr, Deoptimizer::kHole); |
+ } |
+ __ LoadRoot(result, Heap::kUndefinedValueRootIndex); |
+ __ bind(&done); |
} |
} |