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

Unified Diff: src/heap/gc-idle-time-handler.cc

Issue 750963002: Reduce context disposal gc overhead. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years, 1 month 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/gc-idle-time-handler.h ('k') | src/heap/gc-tracer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/gc-idle-time-handler.cc
diff --git a/src/heap/gc-idle-time-handler.cc b/src/heap/gc-idle-time-handler.cc
index beede4cdee3723c2d1be759fead90382c5f49304..4103b78a348c81e3be0b60b030a04d107eaa4ea1 100644
--- a/src/heap/gc-idle-time-handler.cc
+++ b/src/heap/gc-idle-time-handler.cc
@@ -142,6 +142,13 @@ bool GCIdleTimeHandler::ShouldDoMarkCompact(
}
+bool GCIdleTimeHandler::ShouldDoContextDisposalMarkCompact(
+ bool context_disposed, double contexts_disposal_rate) {
+ return context_disposed && contexts_disposal_rate > 0 &&
+ contexts_disposal_rate < kHighContextDisposalRate;
+}
+
+
// The following logic is implemented by the controller:
// (1) If we don't have any idle time, do nothing, unless a context was
// disposed, incremental marking is stopped, and the heap is small. Then do
@@ -163,8 +170,9 @@ GCIdleTimeAction GCIdleTimeHandler::Compute(size_t idle_time_in_ms,
HeapState heap_state) {
if (idle_time_in_ms == 0) {
if (heap_state.incremental_marking_stopped) {
- if (heap_state.contexts_disposed > 0 &&
- heap_state.contexts_disposal_rate < kHighContextDisposalRate) {
+ if (ShouldDoContextDisposalMarkCompact(
+ heap_state.contexts_disposed,
+ heap_state.contexts_disposal_rate)) {
return GCIdleTimeAction::FullGC();
}
}
« no previous file with comments | « src/heap/gc-idle-time-handler.h ('k') | src/heap/gc-tracer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698