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

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

Issue 765743002: Re-land: Distinguish beween final incremental mark-compact and full mark-compact event in IdleNotif… (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 4103b78a348c81e3be0b60b030a04d107eaa4ea1..730d2bb2568888ca8208e875c0ab6587cab101b1 100644
--- a/src/heap/gc-idle-time-handler.cc
+++ b/src/heap/gc-idle-time-handler.cc
@@ -11,6 +11,7 @@ namespace internal {
const double GCIdleTimeHandler::kConservativeTimeRatio = 0.9;
const size_t GCIdleTimeHandler::kMaxMarkCompactTimeInMs = 1000;
+const size_t GCIdleTimeHandler::kMaxFinalIncrementalMarkCompactTimeInMs = 1000;
const size_t GCIdleTimeHandler::kMinTimeForFinalizeSweeping = 100;
const int GCIdleTimeHandler::kMaxMarkCompactsInIdleRound = 7;
const int GCIdleTimeHandler::kIdleScavengeThreshold = 5;
@@ -84,8 +85,7 @@ size_t GCIdleTimeHandler::EstimateMarkingStepSize(
size_t GCIdleTimeHandler::EstimateMarkCompactTime(
size_t size_of_objects, size_t mark_compact_speed_in_bytes_per_ms) {
// TODO(hpayer): Be more precise about the type of mark-compact event. It
- // makes a huge difference if it is incremental or non-incremental and if
- // compaction is happening.
+ // makes a huge difference if compaction is happening.
if (mark_compact_speed_in_bytes_per_ms == 0) {
mark_compact_speed_in_bytes_per_ms = kInitialConservativeMarkCompactSpeed;
}
@@ -94,6 +94,19 @@ size_t GCIdleTimeHandler::EstimateMarkCompactTime(
}
+size_t GCIdleTimeHandler::EstimateFinalIncrementalMarkCompactTime(
+ size_t size_of_objects,
+ size_t final_incremental_mark_compact_speed_in_bytes_per_ms) {
+ if (final_incremental_mark_compact_speed_in_bytes_per_ms == 0) {
+ final_incremental_mark_compact_speed_in_bytes_per_ms =
+ kInitialConservativeFinalIncrementalMarkCompactSpeed;
+ }
+ size_t result =
+ size_of_objects / final_incremental_mark_compact_speed_in_bytes_per_ms;
+ return Min(result, kMaxFinalIncrementalMarkCompactTimeInMs);
+}
+
+
bool GCIdleTimeHandler::ShouldDoScavenge(
size_t idle_time_in_ms, size_t new_space_size, size_t used_new_space_size,
size_t scavenge_speed_in_bytes_per_ms,
@@ -149,6 +162,16 @@ bool GCIdleTimeHandler::ShouldDoContextDisposalMarkCompact(
}
+bool GCIdleTimeHandler::ShouldDoFinalIncrementalMarkCompact(
+ size_t idle_time_in_ms, size_t size_of_objects,
+ size_t final_incremental_mark_compact_speed_in_bytes_per_ms) {
+ return idle_time_in_ms >=
+ EstimateFinalIncrementalMarkCompactTime(
+ size_of_objects,
+ final_incremental_mark_compact_speed_in_bytes_per_ms);
+}
+
+
// 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
« 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