Index: src/ia32/lithium-codegen-ia32.cc |
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc |
index 564ef0046ab5fed77d89fbfd7b7597d284721cf7..37f8bccd1d7d0ccaa996d425e68521a7fd5675d0 100644 |
--- a/src/ia32/lithium-codegen-ia32.cc |
+++ b/src/ia32/lithium-codegen-ia32.cc |
@@ -3184,6 +3184,21 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) { |
__ cmp(result, factory()->the_hole_value()); |
DeoptimizeIf(equal, instr, Deoptimizer::kHole); |
} |
+ } else if (instr->hydrogen()->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) { |
+ DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS); |
+ Label done; |
+ __ cmp(result, factory()->the_hole_value()); |
+ __ 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. |
+ __ mov(result, isolate()->factory()->array_protector()); |
Jakob Kummerow
2015/04/23 13:40:00
You can collapse this into one instruction:
__ cm
mvstanton
2015/04/27 07:57:12
Actually I can't do that for a PropertyCell, just
|
+ __ cmp(FieldOperand(result, Cell::kValueOffset), |
+ Immediate(Smi::FromInt(1))); |
Jakob Kummerow
2015/04/23 13:40:00
Please factor out the magic 0/1 constants as "stat
mvstanton
2015/04/27 07:57:12
Done.
|
+ DeoptimizeIf(not_equal, instr, Deoptimizer::kHole); |
+ } |
+ __ mov(result, isolate()->factory()->undefined_value()); |
+ __ bind(&done); |
} |
} |