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

Unified Diff: src/heap.cc

Issue 291193005: Attempt no. 3 to fix Heap::IsHeapIterable and HeapIterator (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Remove EnsureHeapIterable and DisallocAllocation calls from LiveEdit::FindActiveGenerators Created 6 years, 7 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 | « src/heap.h ('k') | src/heap-profiler.cc » ('j') | src/heap-profiler.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index 2e2aa8e08fe732e71d5f0bff868e23ac32b208a1..66d17fbe6501fe46acfeffb81b1c70afdb155688 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -699,6 +699,10 @@ void Heap::GarbageCollectionEpilogue() {
ReportStatisticsAfterGC();
#endif // DEBUG
isolate_->debug()->AfterGarbageCollection();
+
+ // Remember the last top pointer so that we can later find out
+ // whether we allocated in new space since the last GC.
+ new_space_top_after_last_gc_ = new_space()->top();
}
@@ -4321,14 +4325,15 @@ STRUCT_LIST(MAKE_CASE)
bool Heap::IsHeapIterable() {
return (!old_pointer_space()->was_swept_conservatively() &&
- !old_data_space()->was_swept_conservatively());
+ !old_data_space()->was_swept_conservatively() &&
+ new_space_top_after_last_gc_ == new_space()->top());
}
-void Heap::EnsureHeapIsIterable() {
+void Heap::MakeHeapIterable() {
ASSERT(AllowHeapAllocation::IsAllowed());
if (!IsHeapIterable()) {
- CollectAllGarbage(kMakeHeapIterableMask, "Heap::EnsureHeapIsIterable");
+ CollectAllGarbage(kMakeHeapIterableMask, "Heap::MakeHeapIterable");
}
ASSERT(IsHeapIterable());
}
@@ -5208,6 +5213,7 @@ bool Heap::SetUp() {
if (!new_space_.SetUp(reserved_semispace_size_, max_semi_space_size_)) {
return false;
}
+ new_space_top_after_last_gc_ = new_space()->top();
// Initialize old pointer space.
old_pointer_space_ =
@@ -5731,7 +5737,9 @@ class UnreachableObjectsFilter : public HeapObjectsFilter {
HeapIterator::HeapIterator(Heap* heap)
- : heap_(heap),
+ : make_heap_iterable_helper_(heap),
+ no_heap_allocation_(),
+ heap_(heap),
filtering_(HeapIterator::kNoFiltering),
filter_(NULL) {
Init();
@@ -5740,7 +5748,9 @@ HeapIterator::HeapIterator(Heap* heap)
HeapIterator::HeapIterator(Heap* heap,
HeapIterator::HeapObjectsFiltering filtering)
- : heap_(heap),
+ : make_heap_iterable_helper_(heap),
+ no_heap_allocation_(),
+ heap_(heap),
filtering_(filtering),
filter_(NULL) {
Init();
« no previous file with comments | « src/heap.h ('k') | src/heap-profiler.cc » ('j') | src/heap-profiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698