Chromium Code Reviews| Index: src/hydrogen.cc |
| diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
| index d2aba123922e05452c7bd2b65e8048137110b382..9f5a631ec8b73d78e00ca3cd864157b45d7e1bce 100644 |
| --- a/src/hydrogen.cc |
| +++ b/src/hydrogen.cc |
| @@ -5218,7 +5218,9 @@ void HGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) { |
| HValue* value = Pop(); |
| if (!Smi::IsValid(i)) return Bailout("Non-smi key in array literal"); |
| - elements = new(zone()) HLoadElements(literal); |
| + // Pass in literal as dummy depedency, since the receiver always has |
| + // elements. |
| + elements = new(zone()) HLoadElements(literal, literal); |
| AddInstruction(elements); |
| HValue* key = AddInstruction( |
| @@ -6186,7 +6188,8 @@ HInstruction* HGraphBuilder::BuildUncheckedMonomorphicElementAccess( |
| } |
| bool fast_smi_only_elements = map->has_fast_smi_elements(); |
| bool fast_elements = map->has_fast_object_elements(); |
| - HInstruction* elements = AddInstruction(new(zone()) HLoadElements(object)); |
| + HInstruction* elements = AddInstruction(new(zone()) HLoadElements(object, |
|
Jakob Kummerow
2012/08/30 16:42:03
nit: let's be consistent and break the line after
Toon Verwaest
2012/08/30 17:27:08
Done.
|
| + mapcheck)); |
| if (is_store && (fast_elements || fast_smi_only_elements)) { |
| HCheckMaps* check_cow_map = new(zone()) HCheckMaps( |
| elements, isolate()->factory()->fixed_array_map(), zone()); |
| @@ -6366,13 +6369,15 @@ HValue* HGraphBuilder::HandlePolymorphicElementAccess(HValue* object, |
| return is_store ? NULL : instr; |
| } |
| - AddInstruction(HCheckInstanceType::NewIsSpecObject(object, zone())); |
| + HInstruction* checkspec = |
| + AddInstruction(HCheckInstanceType::NewIsSpecObject(object, zone())); |
| HBasicBlock* join = graph()->CreateBasicBlock(); |
| HInstruction* elements_kind_instr = |
| AddInstruction(new(zone()) HElementsKind(object)); |
| HCompareConstantEqAndBranch* elements_kind_branch = NULL; |
| - HInstruction* elements = AddInstruction(new(zone()) HLoadElements(object)); |
| + HInstruction* elements = AddInstruction(new(zone()) HLoadElements(object, |
|
Jakob Kummerow
2012/08/30 16:42:03
nit: let's be consistent and break the line after
Toon Verwaest
2012/08/30 17:27:08
Done.
|
| + checkspec)); |
| HLoadExternalArrayPointer* external_elements = NULL; |
| HInstruction* checked_key = NULL; |