From dd4c82bbb3c3e51a610892c4285cbad3e7ee978c Mon Sep 17 00:00:00 2001 From: "jarin@chromium.org" Date: Tue, 20 May 2014 13:19:21 +0000 Subject: [PATCH] Fix Heap::IsHeapIterable. We only consider heap iterable if the new space is empty (in addition to the exisiting old space check). The change also moves the iterability forcing + allocation prevention gadgets to HeapIterator so that it is impossible to miss them when iterating the heap. R=hpayer@chromium.org BUG=373283 LOG=N Review URL: https://codereview.chromium.org/285693006 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21387 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/debug.cc | 9 +--- src/heap-profiler.cc | 3 -- src/heap-snapshot-generator.cc | 4 -- src/heap.cc | 15 ++++--- src/heap.h | 11 ++++- src/liveedit.cc | 12 ++---- src/runtime.cc | 76 ++++++++++++++++------------------ test/cctest/test-api.cc | 1 - test/cctest/test-heap.cc | 4 +- test/cctest/test-object-observe.cc | 1 - test/mjsunit/regress/regress-373283.js | 18 ++++++++ 11 files changed, 80 insertions(+), 74 deletions(-) create mode 100644 test/mjsunit/regress/regress-373283.js diff --git a/src/debug.cc b/src/debug.cc index a994eb0..9a9d737 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -2048,6 +2048,7 @@ void Debug::PrepareForBreakPoints() { Heap* heap = isolate_->heap(); heap->CollectAllGarbage(Heap::kMakeHeapIterableMask, "preparing for breakpoints"); + HeapIterator iterator(heap); // Ensure no GC in this scope as we are going to use gc_metadata // field in the Code object to mark active functions. @@ -2067,7 +2068,6 @@ void Debug::PrepareForBreakPoints() { // Scan the heap for all non-optimized functions which have no // debug break slots and are not active or inlined into an active // function and mark them for lazy compilation. - HeapIterator iterator(heap); HeapObject* obj = NULL; while (((obj = iterator.next()) != NULL)) { if (obj->IsJSFunction()) { @@ -2192,9 +2192,7 @@ Object* Debug::FindSharedFunctionInfoInScript(Handle