Commit 91599ffc authored by hpayer@chromium.org's avatar hpayer@chromium.org

Do not install fillers when right trimming large objects.

BUG=
R=jarin@chromium.org

Review URL: https://codereview.chromium.org/487703002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23183 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 3527f40b
...@@ -3321,7 +3321,6 @@ void Heap::RightTrimFixedArray(FixedArrayBase* object, int elements_to_trim) { ...@@ -3321,7 +3321,6 @@ void Heap::RightTrimFixedArray(FixedArrayBase* object, int elements_to_trim) {
const int bytes_to_trim = elements_to_trim * element_size; const int bytes_to_trim = elements_to_trim * element_size;
// For now this trick is only applied to objects in new and paged space. // 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()); DCHECK(object->map() != fixed_cow_array_map());
const int len = object->length(); const int len = object->length();
...@@ -3333,7 +3332,12 @@ void Heap::RightTrimFixedArray(FixedArrayBase* object, int elements_to_trim) { ...@@ -3333,7 +3332,12 @@ void Heap::RightTrimFixedArray(FixedArrayBase* object, int elements_to_trim) {
// Technically in new space this write might be omitted (except for // Technically in new space this write might be omitted (except for
// debug mode which iterates through the heap), but to play safer // debug mode which iterates through the heap), but to play safer
// we still do it. // we still do it.
// 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); CreateFillerObjectAt(new_end, bytes_to_trim);
}
// Initialize header of the trimmed array. We are storing the new length // 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 // using release store after creating a filler for the left-over space to
......
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
var large_object = new Array(5000001);
large_object.length = 23;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment