Index: src/crankshaft/hydrogen.cc |
diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc |
index e5332a2f5d1a961c6a9eb69da3b29d6390bd22d0..b8190efb7f666985a6d6b03cadde632bcf175192 100644 |
--- a/src/crankshaft/hydrogen.cc |
+++ b/src/crankshaft/hydrogen.cc |
@@ -3226,93 +3226,6 @@ void HGraphBuilder::BuildCopyElements(HValue* from_elements, |
AddIncrementCounter(counters->inlined_copied_elements()); |
} |
- |
-HValue* HGraphBuilder::BuildCloneShallowArrayCow(HValue* boilerplate, |
- HValue* allocation_site, |
- AllocationSiteMode mode, |
- ElementsKind kind) { |
- HAllocate* array = AllocateJSArrayObject(mode); |
- |
- HValue* map = AddLoadMap(boilerplate); |
- HValue* elements = AddLoadElements(boilerplate); |
- HValue* length = AddLoadArrayLength(boilerplate, kind); |
- |
- BuildJSArrayHeader(array, |
- map, |
- elements, |
- mode, |
- FAST_ELEMENTS, |
- allocation_site, |
- length); |
- return array; |
-} |
- |
- |
-HValue* HGraphBuilder::BuildCloneShallowArrayEmpty(HValue* boilerplate, |
- HValue* allocation_site, |
- AllocationSiteMode mode) { |
- HAllocate* array = AllocateJSArrayObject(mode); |
- |
- HValue* map = AddLoadMap(boilerplate); |
- |
- BuildJSArrayHeader(array, |
- map, |
- NULL, // set elements to empty fixed array |
- mode, |
- FAST_ELEMENTS, |
- allocation_site, |
- graph()->GetConstant0()); |
- return array; |
-} |
- |
- |
-HValue* HGraphBuilder::BuildCloneShallowArrayNonEmpty(HValue* boilerplate, |
- HValue* allocation_site, |
- AllocationSiteMode mode, |
- ElementsKind kind) { |
- HValue* boilerplate_elements = AddLoadElements(boilerplate); |
- HValue* capacity = AddLoadFixedArrayLength(boilerplate_elements); |
- |
- // Generate size calculation code here in order to make it dominate |
- // the JSArray allocation. |
- HValue* elements_size = BuildCalculateElementsSize(kind, capacity); |
- |
- // Create empty JSArray object for now, store elimination should remove |
- // redundant initialization of elements and length fields and at the same |
- // time the object will be fully prepared for GC if it happens during |
- // elements allocation. |
- HValue* result = BuildCloneShallowArrayEmpty( |
- boilerplate, allocation_site, mode); |
- |
- HAllocate* elements = BuildAllocateElements(kind, elements_size); |
- |
- Add<HStoreNamedField>(result, HObjectAccess::ForElementsPointer(), elements); |
- |
- // The allocation for the cloned array above causes register pressure on |
- // machines with low register counts. Force a reload of the boilerplate |
- // elements here to free up a register for the allocation to avoid unnecessary |
- // spillage. |
- boilerplate_elements = AddLoadElements(boilerplate); |
- boilerplate_elements->SetFlag(HValue::kCantBeReplaced); |
- |
- // Copy the elements array header. |
- for (int i = 0; i < FixedArrayBase::kHeaderSize; i += kPointerSize) { |
- HObjectAccess access = HObjectAccess::ForFixedArrayHeader(i); |
- Add<HStoreNamedField>( |
- elements, access, |
- Add<HLoadNamedField>(boilerplate_elements, nullptr, access)); |
- } |
- |
- // And the result of the length |
- HValue* length = AddLoadArrayLength(boilerplate, kind); |
- Add<HStoreNamedField>(result, HObjectAccess::ForArrayLength(kind), length); |
- |
- BuildCopyElements(boilerplate_elements, kind, elements, |
- kind, length, NULL); |
- return result; |
-} |
- |
- |
void HGraphBuilder::BuildCreateAllocationMemento( |
HValue* previous_object, |
HValue* previous_object_size, |