Index: src/x64/lithium-codegen-x64.cc |
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc |
index 49814a37c24a4aef51caee7cadfeb8435534aa20..02c89b1c3dce5f8eda0ba4d20bf66eebbca7761f 100644 |
--- a/src/x64/lithium-codegen-x64.cc |
+++ b/src/x64/lithium-codegen-x64.cc |
@@ -3262,6 +3262,20 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) { |
__ CompareRoot(result, Heap::kTheHoleValueRootIndex); |
DeoptimizeIf(equal, instr, Deoptimizer::kHole); |
} |
+ } else if (hinstr->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) { |
+ DCHECK(hinstr->elements_kind() == FAST_HOLEY_ELEMENTS); |
+ Label done; |
+ __ CompareRoot(result, Heap::kTheHoleValueRootIndex); |
+ __ j(not_equal, &done); |
+ if (info()->IsStub()) { |
+ // A stub can safely convert the hole to undefined only if the array |
+ // protector cell contains (Smi) 1. Otherwise it needs to bail out. |
+ __ LoadRoot(result, Heap::kArrayProtectorRootIndex); |
+ __ Cmp(FieldOperand(result, Cell::kValueOffset), Smi::FromInt(1)); |
+ DeoptimizeIf(not_equal, instr, Deoptimizer::kHole); |
+ } |
+ __ Move(result, isolate()->factory()->undefined_value()); |
+ __ bind(&done); |
} |
} |