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

Unified Diff: src/heap/heap.cc

Issue 1961373003: [heap] Do not invoke GC to make heap iterable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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/heap.h ('k') | src/log.cc » ('j') | 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 afdc7bb4cd397d69625ecdca09c295a668e0a6ae..5dab9451677bf2c340bb075aadbbd2c6a541dc13 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -893,7 +893,8 @@ void Heap::CollectAllAvailableGarbage(const char* gc_reason) {
isolate()->optimizing_compile_dispatcher()->Flush();
}
isolate()->ClearSerializerData();
- set_current_gc_flags(kMakeHeapIterableMask | kReduceMemoryFootprintMask);
+ set_current_gc_flags(kAbortIncrementalMarkingMask |
+ kReduceMemoryFootprintMask);
isolate_->compilation_cache()->Clear();
const int kMaxNumberOfAttempts = 7;
const int kMinNumberOfAttempts = 2;
@@ -4032,22 +4033,10 @@ 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() {
- DCHECK(AllowHeapAllocation::IsAllowed());
- if (!IsHeapIterable()) {
- CollectAllGarbage(kMakeHeapIterableMask, "Heap::MakeHeapIterable");
- }
if (mark_compact_collector()->sweeping_in_progress()) {
mark_compact_collector()->EnsureSweepingCompleted();
}
- DCHECK(IsHeapIterable());
}
@@ -4592,10 +4581,7 @@ void Heap::Verify() {
CHECK(HasBeenSetUp());
HandleScope scope(isolate());
- if (mark_compact_collector()->sweeping_in_progress()) {
- // We have to wait here for the sweeper threads to have an iterable heap.
- mark_compact_collector()->EnsureSweepingCompleted();
- }
+ MakeHeapIterable();
VerifyPointersVisitor visitor;
IterateRoots(&visitor, VISIT_ONLY_STRONG);
« no previous file with comments | « src/heap/heap.h ('k') | src/log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698