Index: src/arm/lithium-arm.cc |
diff --git a/src/arm/lithium-arm.cc b/src/arm/lithium-arm.cc |
index 30301f9f324ad3c03b3d8970896bd8da7a10a384..6268df3dfcf6ab3d006492456c9986d492fcfc90 100644 |
--- a/src/arm/lithium-arm.cc |
+++ b/src/arm/lithium-arm.cc |
@@ -2234,14 +2234,21 @@ LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { |
result = DefineAsRegister(new(zone()) LLoadKeyed(backing_store, key)); |
} |
- if ((instr->is_external() || instr->is_fixed_typed_array()) ? |
- // see LCodeGen::DoLoadKeyedExternalArray |
- ((elements_kind == EXTERNAL_UINT32_ELEMENTS || |
- elements_kind == UINT32_ELEMENTS) && |
- !instr->CheckFlag(HInstruction::kUint32)) : |
- // see LCodeGen::DoLoadKeyedFixedDoubleArray and |
- // LCodeGen::DoLoadKeyedFixedArray |
- instr->RequiresHoleCheck()) { |
+ bool needs_environment; |
+ if (instr->is_external() || instr->is_fixed_typed_array()) { |
+ // see LCodeGen::DoLoadKeyedExternalArray |
+ needs_environment = (elements_kind == EXTERNAL_UINT32_ELEMENTS || |
+ elements_kind == UINT32_ELEMENTS) && |
+ !instr->CheckFlag(HInstruction::kUint32); |
+ } else { |
+ // see LCodeGen::DoLoadKeyedFixedDoubleArray and |
+ // LCodeGen::DoLoadKeyedFixedArray |
+ needs_environment = |
+ instr->RequiresHoleCheck() || |
+ (instr->hole_mode() == CONVERT_HOLE_TO_UNDEFINED && info()->IsStub()); |
+ } |
+ |
+ if (needs_environment) { |
result = AssignEnvironment(result); |
} |
return result; |