Chromium Code Reviews| Index: src/hydrogen.cc |
| diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
| index 54ae31f0f20196c8e4b61e4e4a28e2d72d1695fe..d001534bf579edf413d71ac8e74275c8594961db 100644 |
| --- a/src/hydrogen.cc |
| +++ b/src/hydrogen.cc |
| @@ -603,19 +603,6 @@ HConstant* HGraph::GetConstantInt32(SetOncePointer<HConstant>* pointer, |
| } |
| -HConstant* HGraph::GetConstantSmi(SetOncePointer<HConstant>* pointer, |
| - int32_t value) { |
| - if (!pointer->is_set()) { |
| - HConstant* constant = |
| - new(zone()) HConstant(Handle<Object>(Smi::FromInt(value), isolate()), |
| - Representation::Tagged()); |
| - constant->InsertAfter(GetConstantUndefined()); |
| - pointer->set(constant); |
| - } |
| - return pointer->get(); |
| -} |
| - |
| - |
| HConstant* HGraph::GetConstant0() { |
| return GetConstantInt32(&constant_0_, 0); |
| } |
| @@ -655,16 +642,6 @@ DEFINE_GET_CONSTANT(Hole, the_hole, HType::Tagged(), false) |
| DEFINE_GET_CONSTANT(Null, null, HType::Tagged(), false) |
| -HConstant* HGraph::GetConstantSmi0() { |
| - return GetConstantSmi(&constant_smi_0_, 0); |
| -} |
| - |
| - |
| -HConstant* HGraph::GetConstantSmi1() { |
| - return GetConstantSmi(&constant_smi_1_, 1); |
| -} |
| - |
| - |
| #undef DEFINE_GET_CONSTANT |
| @@ -1562,6 +1539,9 @@ void HGraphBuilder::BuildFillElementsWithHole(HValue* context, |
| } |
| } |
| + if (IsFastSmiOrObjectElementsKind(elements_kind)) { |
| + elements_kind = FAST_HOLEY_ELEMENTS; |
|
Jakob Kummerow
2013/05/27 07:15:44
nit: this looks a bit surprising, please add a com
|
| + } |
| if (unfold_loop) { |
| for (int i = 0; i < initial_capacity; i++) { |
| HInstruction* key = AddInstruction(new(zone) |
| @@ -1608,8 +1588,11 @@ void HGraphBuilder::BuildCopyElements(HValue* context, |
| from_elements_kind, |
| ALLOW_RETURN_HOLE)); |
| - AddInstruction(new(zone()) HStoreKeyed(to_elements, key, element, |
| - to_elements_kind)); |
| + ElementsKind holey_kind = IsFastSmiElementsKind(to_elements_kind) |
| + ? FAST_HOLEY_ELEMENTS : to_elements_kind; |
| + HInstruction* holey_store = AddInstruction( |
| + new(zone()) HStoreKeyed(to_elements, key, element, holey_kind)); |
| + holey_store->ClearFlag(HValue::kDeoptimizeOnUndefined); |
| builder.EndBody(); |