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

Unified Diff: src/elements.cc

Issue 219103002: Make sure when we shrink an object that we store a filler first into the free memory before updatin… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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/builtins.cc ('k') | src/objects.h » ('j') | src/objects.h » ('J')
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 3949747c62ebed39506e88b5699400534e35d7e7..51a42c0ee4451b26b8b9e74abebd06b7baf423b7 100644
--- a/src/elements.cc
+++ b/src/elements.cc
@@ -1003,11 +1003,11 @@ class FastElementsAccessor
if (length == 0) {
array->initialize_elements();
} else {
- backing_store->set_length(length);
+ int filler_size = (old_capacity - length) * ElementSize;
Address filler_start = backing_store->address() +
BackingStore::OffsetOfElementAt(length);
- int filler_size = (old_capacity - length) * ElementSize;
array->GetHeap()->CreateFillerObjectAt(filler_start, filler_size);
+ backing_store->synchronized_set_length(length);
}
} else {
// Otherwise, fill the unused tail with holes.
« no previous file with comments | « src/builtins.cc ('k') | src/objects.h » ('j') | src/objects.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698