Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1871)

Unified Diff: src/elements.cc

Issue 11280054: Ensure CopyElementsImpl is always executed so it fills in holes even if from_size is 0. Allow Fixed… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added castOrEmptyFixedArray Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/elements.cc
diff --git a/src/elements.cc b/src/elements.cc
index 0f4d533f2e307ed613e5db4896a789d1286834d6..eb021e502185acb8eb7ce0af2cdc2f41fcf589ca 100644
--- a/src/elements.cc
+++ b/src/elements.cc
@@ -696,9 +696,6 @@ class ElementsAccessorBase : public ElementsAccessor {
}
}
}
- if (from->length() == 0 || copy_size == 0) {
- return from;
- }
return ElementsAccessorSubclass::CopyElementsImpl(
from, from_start, to, to_kind, to_start, packed_size, copy_size);
}
@@ -1022,17 +1019,17 @@ class FastSmiOrObjectElementsAccessor
packed_size != kPackedSizeNotKnown) {
CopyPackedSmiToDoubleElements(
FixedArray::cast(from), from_start,
- FixedDoubleArray::cast(to), to_start,
+ FixedDoubleArray::castOrEmptyFixedArray(to), to_start,
packed_size, copy_size);
} else {
CopySmiToDoubleElements(
FixedArray::cast(from), from_start,
- FixedDoubleArray::cast(to), to_start, copy_size);
+ FixedDoubleArray::castOrEmptyFixedArray(to), to_start, copy_size);
}
} else {
CopyObjectToDoubleElements(
FixedArray::cast(from), from_start,
- FixedDoubleArray::cast(to), to_start, copy_size);
+ FixedDoubleArray::castOrEmptyFixedArray(to), to_start, copy_size);
}
} else {
UNREACHABLE();
@@ -1136,13 +1133,13 @@ class FastDoubleElementsAccessor
case FAST_HOLEY_SMI_ELEMENTS:
case FAST_HOLEY_ELEMENTS:
return CopyDoubleToObjectElements(
- FixedDoubleArray::cast(from), from_start, FixedArray::cast(to),
- to_kind, to_start, copy_size);
+ FixedDoubleArray::castOrEmptyFixedArray(from), from_start,
+ FixedArray::cast(to), to_kind, to_start, copy_size);
case FAST_DOUBLE_ELEMENTS:
case FAST_HOLEY_DOUBLE_ELEMENTS:
- CopyDoubleToDoubleElements(FixedDoubleArray::cast(from), from_start,
- FixedDoubleArray::cast(to),
- to_start, copy_size);
+ CopyDoubleToDoubleElements(
+ FixedDoubleArray::castOrEmptyFixedArray(from), from_start,
+ FixedDoubleArray::castOrEmptyFixedArray(to), to_start, copy_size);
return from;
default:
UNREACHABLE();
@@ -1476,7 +1473,8 @@ class DictionaryElementsAccessor
case FAST_HOLEY_DOUBLE_ELEMENTS:
CopyDictionaryToDoubleElements(
SeededNumberDictionary::cast(from), from_start,
- FixedDoubleArray::cast(to), to_start, copy_size);
+ FixedDoubleArray::castOrEmptyFixedArray(to), to_start,
+ copy_size);
return from;
default:
UNREACHABLE();
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698