Commit 2c705830 authored by jkummerow's avatar jkummerow Committed by Commit bot

[elements.cc] Clean up CopyDoubleToObjectElements

Review URL: https://codereview.chromium.org/1372533002

Cr-Commit-Position: refs/heads/master@{#30935}
parent 175edfb4
...@@ -210,9 +210,7 @@ static void CopyDictionaryToObjectElements( ...@@ -210,9 +210,7 @@ static void CopyDictionaryToObjectElements(
static void CopyDoubleToObjectElements(FixedArrayBase* from_base, static void CopyDoubleToObjectElements(FixedArrayBase* from_base,
uint32_t from_start, uint32_t from_start,
FixedArrayBase* to_base, FixedArrayBase* to_base,
ElementsKind to_kind, uint32_t to_start, uint32_t to_start, int raw_copy_size) {
int raw_copy_size) {
DCHECK(IsFastSmiOrObjectElementsKind(to_kind));
int copy_size = raw_copy_size; int copy_size = raw_copy_size;
if (raw_copy_size < 0) { if (raw_copy_size < 0) {
DisallowHeapAllocation no_allocation; DisallowHeapAllocation no_allocation;
...@@ -252,13 +250,8 @@ static void CopyDoubleToObjectElements(FixedArrayBase* from_base, ...@@ -252,13 +250,8 @@ static void CopyDoubleToObjectElements(FixedArrayBase* from_base,
HandleScope scope(isolate); HandleScope scope(isolate);
offset += 100; offset += 100;
for (int i = offset - 100; i < offset && i < copy_size; ++i) { for (int i = offset - 100; i < offset && i < copy_size; ++i) {
if (IsFastSmiElementsKind(to_kind)) { Handle<Object> value = FixedDoubleArray::get(from, i + from_start);
UNIMPLEMENTED(); to->set(i + to_start, *value, UPDATE_WRITE_BARRIER);
} else {
DCHECK(IsFastObjectElementsKind(to_kind));
Handle<Object> value = FixedDoubleArray::get(from, i + from_start);
to->set(i + to_start, *value, UPDATE_WRITE_BARRIER);
}
} }
} }
} }
...@@ -1550,8 +1543,8 @@ class FastSmiOrObjectElementsAccessor ...@@ -1550,8 +1543,8 @@ class FastSmiOrObjectElementsAccessor
case FAST_DOUBLE_ELEMENTS: case FAST_DOUBLE_ELEMENTS:
case FAST_HOLEY_DOUBLE_ELEMENTS: { case FAST_HOLEY_DOUBLE_ELEMENTS: {
AllowHeapAllocation allow_allocation; AllowHeapAllocation allow_allocation;
CopyDoubleToObjectElements( DCHECK(IsFastObjectElementsKind(to_kind));
from, from_start, to, to_kind, to_start, copy_size); CopyDoubleToObjectElements(from, from_start, to, to_start, copy_size);
break; break;
} }
case DICTIONARY_ELEMENTS: case DICTIONARY_ELEMENTS:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment