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

Unified Diff: src/runtime.cc

Issue 7551004: Properly handle FastDoubleArrays in Runtime_MoveArrayContents (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix nit Created 9 years, 5 months 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 | « src/objects-inl.h ('k') | test/mjsunit/regress/regress-91010.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index ca83a109915f2b2b3e8560e665ed3a2557492132..77f85b2fcc7a154814d8bd410bbc31e246347028 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -9589,6 +9589,9 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_MoveArrayContents) {
if (new_elements->map() == isolate->heap()->fixed_array_map() ||
new_elements->map() == isolate->heap()->fixed_cow_array_map()) {
maybe_new_map = to->map()->GetFastElementsMap();
+ } else if (new_elements->map() ==
+ isolate->heap()->fixed_double_array_map()) {
+ maybe_new_map = to->map()->GetFastDoubleElementsMap();
} else {
maybe_new_map = to->map()->GetSlowElementsMap();
}
@@ -9676,12 +9679,13 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetArrayKeys) {
}
return *isolate->factory()->NewJSArrayWithElements(keys);
} else {
- ASSERT(array->HasFastElements());
+ ASSERT(array->HasFastElements() || array->HasFastDoubleElements());
Handle<FixedArray> single_interval = isolate->factory()->NewFixedArray(2);
// -1 means start of array.
single_interval->set(0, Smi::FromInt(-1));
+ FixedArrayBase* elements = FixedArrayBase::cast(array->elements());
uint32_t actual_length =
- static_cast<uint32_t>(FixedArray::cast(array->elements())->length());
+ static_cast<uint32_t>(elements->length());
uint32_t min_length = actual_length < length ? actual_length : length;
Handle<Object> length_object =
isolate->factory()->NewNumber(static_cast<double>(min_length));
« no previous file with comments | « src/objects-inl.h ('k') | test/mjsunit/regress/regress-91010.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698