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

Unified Diff: src/heap/heap.cc

Issue 2287343002: [heap] Integrate embedder heap tracer into incremental marking (Closed)
Patch Set: Addressed comments Created 4 years, 4 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/heap/incremental-marking.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 7eb5af3b6a4a408f20d40e5ede782643407acb24..106a1ddc991916f822bf50a697d8f7bcf02fad6e 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -4175,12 +4175,20 @@ void Heap::ReduceNewSpaceSize() {
}
}
+bool Heap::MarkingDequesAreEmpty() {
+ return mark_compact_collector()->marking_deque()->IsEmpty() &&
+ (!UsingEmbedderHeapTracer() ||
+ (mark_compact_collector()->wrappers_to_trace() == 0 &&
+ mark_compact_collector()
+ ->embedder_heap_tracer()
+ ->NumberOfWrappersToTrace() == 0));
+}
void Heap::FinalizeIncrementalMarkingIfComplete(const char* comment) {
if (incremental_marking()->IsMarking() &&
(incremental_marking()->IsReadyToOverApproximateWeakClosure() ||
(!incremental_marking()->finalize_marking_completed() &&
- mark_compact_collector()->marking_deque()->IsEmpty()))) {
+ MarkingDequesAreEmpty()))) {
FinalizeIncrementalMarking(comment);
} else if (incremental_marking()->IsComplete() ||
(mark_compact_collector()->marking_deque()->IsEmpty())) {
@@ -4195,14 +4203,14 @@ bool Heap::TryFinalizeIdleIncrementalMarking(double idle_time_in_ms) {
tracer()->FinalIncrementalMarkCompactSpeedInBytesPerMillisecond();
if (incremental_marking()->IsReadyToOverApproximateWeakClosure() ||
(!incremental_marking()->finalize_marking_completed() &&
- mark_compact_collector()->marking_deque()->IsEmpty() &&
+ MarkingDequesAreEmpty() &&
gc_idle_time_handler_->ShouldDoOverApproximateWeakClosure(
idle_time_in_ms))) {
FinalizeIncrementalMarking(
"Idle notification: finalize incremental marking");
return true;
} else if (incremental_marking()->IsComplete() ||
- (mark_compact_collector()->marking_deque()->IsEmpty() &&
+ (MarkingDequesAreEmpty() &&
gc_idle_time_handler_->ShouldDoFinalIncrementalMarkCompact(
idle_time_in_ms, size_of_objects,
final_incremental_mark_compact_speed_in_bytes_per_ms))) {
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/incremental-marking.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698