Index: src/hydrogen.cc |
=================================================================== |
--- src/hydrogen.cc (revision 6029) |
+++ src/hydrogen.cc (working copy) |
@@ -3023,8 +3023,9 @@ |
// The array is expected in the bailout environment during computation |
// of the property values and is the value of the entire expression. |
PushAndAdd(literal); |
- HValue* elements = AddInstruction(new HLoadElements(literal)); |
+ HLoadElements* elements = NULL; |
+ |
for (int i = 0; i < length; i++) { |
Expression* subexpr = subexprs->at(i); |
// If the subexpression is a literal or a simple materialized literal it |
@@ -3034,6 +3035,13 @@ |
VISIT_FOR_VALUE(subexpr); |
HValue* value = Pop(); |
if (!Smi::IsValid(i)) BAILOUT("Non-smi key in array literal"); |
+ |
+ // Load the elements array before the first store. |
+ if (elements == NULL) { |
+ elements = new HLoadElements(literal); |
+ AddInstruction(elements); |
+ } |
+ |
HValue* key = AddInstruction(new HConstant(Handle<Object>(Smi::FromInt(i)), |
Representation::Integer32())); |
AddInstruction(new HStoreKeyedFastElement(elements, key, value)); |