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

Unified Diff: src/heap/heap.cc

Issue 2687113002: [heap] no longer perform GC to make heap iterable. (Closed)
Patch Set: Created 3 years, 10 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/heap.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 4451b5a6a5bc824c4fd2b5378ab99a3fce62c46c..fb1aca0b1fdfd22ce86e522c363f3a23cd1a35cf 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -4067,21 +4067,8 @@ AllocationResult Heap::AllocateStruct(InstanceType type) {
}
-bool Heap::IsHeapIterable() {
- // TODO(hpayer): This function is not correct. Allocation folding in old
- // space breaks the iterability.
- return new_space_top_after_last_gc_ == new_space()->top();
-}
-
-
void Heap::MakeHeapIterable() {
Hannes Payer (out of office) 2017/02/10 07:37:18 FYI: We do not need to wait for sweepers to make t
- DCHECK(AllowHeapAllocation::IsAllowed());
- if (!IsHeapIterable()) {
- CollectAllGarbage(kMakeHeapIterableMask,
- GarbageCollectionReason::kMakeHeapIterable);
- }
mark_compact_collector()->EnsureSweepingCompleted();
- DCHECK(IsHeapIterable());
}
@@ -6117,16 +6104,15 @@ class UnreachableObjectsFilter : public HeapObjectsFilter {
DisallowHeapAllocation no_allocation_;
};
-
HeapIterator::HeapIterator(Heap* heap,
HeapIterator::HeapObjectsFiltering filtering)
- : make_heap_iterable_helper_(heap),
- no_heap_allocation_(),
+ : no_heap_allocation_(),
heap_(heap),
filtering_(filtering),
filter_(nullptr),
space_iterator_(nullptr),
object_iterator_(nullptr) {
+ heap_->MakeHeapIterable();
heap_->heap_iterator_start();
// Start the iteration.
space_iterator_ = new SpaceIterator(heap_);
« no previous file with comments | « src/heap/heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698