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

Unified Diff: src/objects.cc

Issue 7618012: Change AddElementsToFixedArray to work on FixedArrayBase rather than JSObject (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: review feedback Created 9 years, 4 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/elements.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index d68b8722dc67d417c6d65a35fb97df0b88445a42..640865cacfd3b48ca8ef64ba4baa6ebdb1c66c1d 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -4637,7 +4637,20 @@ MaybeObject* PolymorphicCodeCacheHashTable::Put(MapList* maps,
MaybeObject* FixedArray::AddKeysFromJSArray(JSArray* array) {
- return array->GetElementsAccessor()->AddJSArrayKeysToFixedArray(array, this);
+ ElementsAccessor* accessor = array->GetElementsAccessor();
+ MaybeObject* maybe_result =
+ accessor->AddElementsToFixedArray(array->elements(), this);
+ FixedArray* result;
+ if (!maybe_result->To<FixedArray>(&result)) return maybe_result;
+#ifdef DEBUG
+ if (FLAG_enable_slow_asserts) {
+ for (int i = 0; i < result->length(); i++) {
+ Object* current = result->get(i);
+ ASSERT(current->IsNumber() || current->IsString());
+ }
+ }
+#endif
+ return result;
}
« no previous file with comments | « src/elements.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698