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

Unified Diff: src/objects.cc

Issue 10911054: If we are trimming the whole array, just return the empty fixed array. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: u Created 8 years, 3 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.h ('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 5261b6a5ff931381d463e3fda522e23e24ad8389..09f6947aeb5d29d620d4c2668b648b073c811572 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -12474,7 +12474,7 @@ void Dictionary<Shape, Key>::CopyKeysTo(
}
-void StringDictionary::CopyEnumKeysTo(FixedArray* storage) {
+FixedArray* StringDictionary::CopyEnumKeysTo(FixedArray* storage) {
int length = storage->length();
ASSERT(length >= NumberOfEnumElements());
Heap* heap = GetHeap();
@@ -12501,6 +12501,7 @@ void StringDictionary::CopyEnumKeysTo(FixedArray* storage) {
// together by shifting them to the left (maintaining the enumeration order),
// and trimming of the right side of the array.
if (properties < length) {
+ if (properties == 0) return heap->empty_fixed_array();
properties = 0;
for (int i = 0; i < length; ++i) {
Object* value = storage->get(i);
@@ -12511,6 +12512,7 @@ void StringDictionary::CopyEnumKeysTo(FixedArray* storage) {
}
RightTrimFixedArray<FROM_MUTATOR>(heap, storage, length - properties);
}
+ return storage;
}
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698