From: jarin@chromium.org Date: Mon, 12 May 2014 10:39:08 +0000 (+0000) Subject: Fix %SetFlags("--stress-compaction") X-Git-Tag: upstream/4.7.83~9168 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c3cd2f0301e91d1850228db78b727d4868048d62;p=platform%2Fupstream%2Fv8.git Fix %SetFlags("--stress-compaction") BUG=369943 LOG=N R=hpayer@chromium.org Review URL: https://codereview.chromium.org/261253006 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21260 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/spaces-inl.h b/src/spaces-inl.h index da9c03d..eba52c6 100644 --- a/src/spaces-inl.h +++ b/src/spaces-inl.h @@ -290,21 +290,6 @@ AllocationResult PagedSpace::AllocateRaw(int size_in_bytes) { AllocationResult NewSpace::AllocateRaw(int size_in_bytes) { Address old_top = allocation_info_.top(); -#ifdef DEBUG - // If we are stressing compaction we waste some memory in new space - // in order to get more frequent GCs. - if (FLAG_stress_compaction && !heap()->linear_allocation()) { - if (allocation_info_.limit() - old_top >= size_in_bytes * 4) { - int filler_size = size_in_bytes * 4; - for (int i = 0; i < filler_size; i += kPointerSize) { - *(reinterpret_cast(old_top + i)) = - heap()->one_pointer_filler_map(); - } - old_top += filler_size; - allocation_info_.set_top(allocation_info_.top() + filler_size); - } - } -#endif if (allocation_info_.limit() - old_top < size_in_bytes) { return SlowAllocateRaw(size_in_bytes); diff --git a/test/mjsunit/regress/regress-set-flags-stress-compact.js b/test/mjsunit/regress/regress-set-flags-stress-compact.js new file mode 100644 index 0000000..5bc59a7 --- /dev/null +++ b/test/mjsunit/regress/regress-set-flags-stress-compact.js @@ -0,0 +1,10 @@ +// 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. + +// Flags: --allow-natives-syntax + +%SetFlags("--gc-interval=164 --stress-compaction"); + +var a = []; +for (var i = 0; i < 10000; i++) { a[i * 100] = 0; }