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

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

Issue 750813003: Use deadline in IdleNotification. (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
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..1bdc597d91085d20c1ffb28ba390bcc2553bd437 100644
--- a/src/heap/gc-idle-time-handler.cc
+++ b/src/heap/gc-idle-time-handler.cc
@@ -166,9 +166,9 @@ bool GCIdleTimeHandler::ShouldDoContextDisposalMarkCompact(
// request, we finalize sweeping here.
// (6) If incremental marking is in progress, we perform a marking step. Note,
// that this currently may trigger a full garbage collection.
-GCIdleTimeAction GCIdleTimeHandler::Compute(size_t idle_time_in_ms,
+GCIdleTimeAction GCIdleTimeHandler::Compute(double idle_time,
HeapState heap_state) {
- if (idle_time_in_ms == 0) {
+ if (idle_time <= 0.0) {
if (heap_state.incremental_marking_stopped) {
if (ShouldDoContextDisposalMarkCompact(
heap_state.contexts_disposed,
@@ -179,6 +179,8 @@ GCIdleTimeAction GCIdleTimeHandler::Compute(size_t idle_time_in_ms,
return GCIdleTimeAction::Nothing();
}
+ size_t idle_time_in_ms = static_cast<size_t>(idle_time);
+
if (ShouldDoScavenge(
idle_time_in_ms, heap_state.new_space_capacity,
heap_state.used_new_space_size,
« no previous file with comments | « src/heap/gc-idle-time-handler.h ('k') | src/heap/heap.h » ('j') | src/heap/heap.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698