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

Unified Diff: src/heap/heap.cc

Issue 487703002: Do not install fillers when right trimming large objects. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | « no previous file | test/mjsunit/regress/regress-404981.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index fd08c8292f812c8c3084fb699eb9f65dcc98b4a7..5d3bde4592c991844f1f024c7ab7cb391702d2e7 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -3321,7 +3321,6 @@ void Heap::RightTrimFixedArray(FixedArrayBase* object, int elements_to_trim) {
const int bytes_to_trim = elements_to_trim * element_size;
// For now this trick is only applied to objects in new and paged space.
- DCHECK(!lo_space()->Contains(object));
DCHECK(object->map() != fixed_cow_array_map());
const int len = object->length();
@@ -3333,7 +3332,12 @@ void Heap::RightTrimFixedArray(FixedArrayBase* object, int elements_to_trim) {
// Technically in new space this write might be omitted (except for
// debug mode which iterates through the heap), but to play safer
// we still do it.
- CreateFillerObjectAt(new_end, bytes_to_trim);
+ // We do not create a filler for objects in large object space.
+ // TODO(hpayer): We should shrink the large object page if the size
+ // of the object changed significantly.
+ if (!lo_space()->Contains(object)) {
+ CreateFillerObjectAt(new_end, bytes_to_trim);
+ }
// Initialize header of the trimmed array. We are storing the new length
// using release store after creating a filler for the left-over space to
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-404981.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698