Chromium Code Reviews| Index: src/hydrogen.cc |
| diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
| index e5a93a7bd5b1f4ec513e0427d54f033b0fdf5dce..2c38d8059ee21a3d410ade1d0d3d99867646efc4 100644 |
| --- a/src/hydrogen.cc |
| +++ b/src/hydrogen.cc |
| @@ -2789,12 +2789,6 @@ void HGraphBuilder::BuildFillElementsWithValue(HValue* elements, |
| } |
| } |
| - // Since we're about to store a hole value, the store instruction below must |
| - // assume an elements kind that supports heap object values. |
| - if (IsFastSmiOrObjectElementsKind(elements_kind)) { |
| - elements_kind = FAST_HOLEY_ELEMENTS; |
| - } |
| - |
| if (initial_capacity >= 0) { |
| for (int i = 0; i < initial_capacity; i++) { |
| HInstruction* key = Add<HConstant>(i); |
| @@ -2832,10 +2826,41 @@ void HGraphBuilder::BuildFillElementsWithHole(HValue* elements, |
| ? Add<HConstant>(factory->the_hole_value()) |
| : Add<HConstant>(nan_double); |
| + // Since we're about to store a hole value, the store instruction below must |
| + // assume an elements kind that supports heap object values. |
| + if (IsFastSmiOrObjectElementsKind(elements_kind)) { |
| + elements_kind = FAST_HOLEY_ELEMENTS; |
| + } |
| + |
| BuildFillElementsWithValue(elements, elements_kind, from, to, hole); |
| } |
| +void HGraphBuilder::BuildCopyProperties(HValue* from_properties, |
| + HValue* to_properties, HValue* length, |
| + HValue* capacity) { |
| + ElementsKind kind = FAST_ELEMENTS; |
| + |
| + BuildFillElementsWithValue(to_properties, kind, length, capacity, |
| + graph()->GetConstantUndefined()); |
| + |
| + LoopBuilder builder(this, context(), LoopBuilder::kPostDecrement); |
| + |
| + HValue* key = builder.BeginBody(length, graph()->GetConstant0(), Token::GT); |
| + |
| + key = AddUncasted<HSub>(key, graph()->GetConstant1()); |
| + key->ClearFlag(HValue::kCanOverflow); |
| + |
| + HValue* element = |
| + Add<HLoadKeyed>(from_properties, key, static_cast<HValue*>(NULL), kind); |
| + |
| + HStoreKeyed* store = Add<HStoreKeyed>(to_properties, key, element, kind); |
| + store->SetFlag(HValue::kAllowUndefinedAsNaN); |
|
Toon Verwaest
2014/09/22 08:55:29
I don't think this flag has any meaning for FAST_E
Igor Sheludko
2014/09/23 07:38:47
Done.
|
| + |
| + builder.EndBody(); |
| +} |
| + |
| + |
| void HGraphBuilder::BuildCopyElements(HValue* from_elements, |
| ElementsKind from_elements_kind, |
| HValue* to_elements, |