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

Unified Diff: src/heap/incremental-marking.cc

Issue 894703002: Add a flag to over approximate the weak closure during GC (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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
Index: src/heap/incremental-marking.cc
diff --git a/src/heap/incremental-marking.cc b/src/heap/incremental-marking.cc
index a85d4a8489326ec84afcd2ca4191d45ebdda18fe..abca37ee408aa8d105c22c32e2f464ecc13b15ec 100644
--- a/src/heap/incremental-marking.cc
+++ b/src/heap/incremental-marking.cc
@@ -28,7 +28,8 @@ IncrementalMarking::IncrementalMarking(Heap* heap)
idle_marking_delay_counter_(0),
no_marking_scope_depth_(0),
unscanned_bytes_of_large_object_(0),
- was_activated_(false) {}
+ was_activated_(false),
+ weak_closure_was_overapproximated_(false) {}
void IncrementalMarking::RecordWriteSlow(HeapObject* obj, Object** slot,
@@ -495,6 +496,7 @@ void IncrementalMarking::Start(CompactionFlag flag) {
ResetStepCounters();
was_activated_ = true;
+ weak_closure_was_overapproximated_ = false;
Hannes Payer (out of office) 2015/02/03 17:40:11 Can we do that in the gc epilogue?
jochen (gone - plz use gerrit) 2015/02/09 16:03:43 Done
if (!heap_->mark_compact_collector()->sweeping_in_progress()) {
StartMarking(flag);
@@ -772,13 +774,22 @@ void IncrementalMarking::Finalize() {
void IncrementalMarking::MarkingComplete(CompletionAction action) {
- state_ = COMPLETE;
// We will set the stack guard to request a GC now. This will mean the rest
// of the GC gets performed as soon as possible (we can't do a GC here in a
// record-write context). If a few things get allocated between now and then
// that shouldn't make us do a scavenge and keep being incremental, so we set
// the should-hurry flag to indicate that there can't be much work left to do.
set_should_hurry(true);
+ if (FLAG_overapproximate_weak_closure &&
+ !weak_closure_was_overapproximated_ && action == GC_VIA_STACK_GUARD) {
+ if (FLAG_trace_incremental_marking) {
Hannes Payer (out of office) 2015/02/03 17:40:11 Can we add a separate method for that and dispatch
jochen (gone - plz use gerrit) 2015/02/09 16:03:43 done
jochen (gone - plz use gerrit) 2015/02/09 16:03:43 done
+ PrintF(
+ "[IncrementalMarking] requesting weak closure overapproximation.\n");
+ }
+ heap_->isolate()->stack_guard()->RequestGC();
+ return;
+ }
+ state_ = COMPLETE;
if (FLAG_trace_incremental_marking) {
PrintF("[IncrementalMarking] Complete (normal).\n");
}
« src/heap/heap.h ('K') | « src/heap/incremental-marking.h ('k') | src/heap/mark-compact.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698