Index: src/x87/lithium-x87.cc |
diff --git a/src/x87/lithium-x87.cc b/src/x87/lithium-x87.cc |
index 0bf162c2533222c0ee0b47d507fe00f423438862..2c4de87d3fb74f1e6f3b77890dc92b7c0c4e8990 100644 |
--- a/src/x87/lithium-x87.cc |
+++ b/src/x87/lithium-x87.cc |
@@ -2227,14 +2227,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 |
- ((instr->elements_kind() == EXTERNAL_UINT32_ELEMENTS || |
- instr->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; |