From: jarin@chromium.org Date: Fri, 9 May 2014 09:23:10 +0000 (+0000) Subject: Make new space iterable for --log-gc and --heap-stats options X-Git-Tag: upstream/4.7.83~9215 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3976ebef93df0f28c91e1429a15e8d8160427c73;p=platform%2Fupstream%2Fv8.git Make new space iterable for --log-gc and --heap-stats options R=hpayer@chromium.org BUG=370827 TEST=test/mjsunit/regress/regress-370827.js LOG=N Review URL: https://codereview.chromium.org/272503005 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21209 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc index feb8b6b..16efa21 100644 --- a/src/hydrogen-instructions.cc +++ b/src/hydrogen-instructions.cc @@ -3825,19 +3825,18 @@ bool HAllocate::HandleSideEffectDominator(GVNFlag side_effect, dominator_allocate); dominator_allocate->UpdateSize(new_dominator_size_constant); + bool keep_new_space_iterable = FLAG_log_gc || FLAG_heap_stats; #ifdef VERIFY_HEAP - if (FLAG_verify_heap && dominator_allocate->IsNewSpaceAllocation()) { + keep_new_space_iterable = keep_new_space_iterable || FLAG_verify_heap; +#endif + + if (keep_new_space_iterable && dominator_allocate->IsNewSpaceAllocation()) { dominator_allocate->MakePrefillWithFiller(); } else { // TODO(hpayer): This is a short-term hack to make allocation mementos // work again in new space. dominator_allocate->ClearNextMapWord(original_object_size); } -#else - // TODO(hpayer): This is a short-term hack to make allocation mementos - // work again in new space. - dominator_allocate->ClearNextMapWord(original_object_size); -#endif dominator_allocate->UpdateClearNextMapWord(MustClearNextMapWord()); diff --git a/test/mjsunit/regress/regress-370827.js b/test/mjsunit/regress/regress-370827.js new file mode 100644 index 0000000..5536d51 --- /dev/null +++ b/test/mjsunit/regress/regress-370827.js @@ -0,0 +1,21 @@ +// 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 --expose-gc --heap-stats + +function g(dummy, x) { + var start = ""; + if (x) { start = x + " - "; } + start = start + "array length"; +}; + +function f() { + gc(); + g([0.1]); +} + +f(); +%OptimizeFunctionOnNextCall(f); +f(); +f();