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

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

Issue 465473002: Use actual incremental marking throughput in IdleNotification to estimate marking step size. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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/gc-idle-time-handler.h ('k') | src/heap/heap.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
new file mode 100644
index 0000000000000000000000000000000000000000..83e95acc0526f5c46740b1e8ddc4f32619577a14
--- /dev/null
+++ b/src/heap/gc-idle-time-handler.cc
@@ -0,0 +1,37 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+#include <climits>
+
+#include "src/v8.h"
+
+#include "src/heap/gc-idle-time-handler.h"
+
+namespace v8 {
+namespace internal {
+
+
+const double GCIdleTimeHandler::kConservativeTimeRatio = 0.9;
+
+
+intptr_t GCIdleTimeHandler::EstimateMarkingStepSize(
+ int idle_time_in_ms, intptr_t marking_speed_in_bytes_per_ms) {
+ DCHECK(idle_time_in_ms > 0);
+
+ if (marking_speed_in_bytes_per_ms == 0) {
+ marking_speed_in_bytes_per_ms =
+ GCIdleTimeHandler::kInitialConservativeMarkingSpeed;
+ }
+
+ intptr_t marking_step_size = marking_speed_in_bytes_per_ms * idle_time_in_ms;
+ if (static_cast<intptr_t>(marking_step_size / idle_time_in_ms) !=
+ marking_speed_in_bytes_per_ms) {
+ // In the case of an overflow we return maximum marking step size.
+ return INT_MAX;
+ }
+
+ return static_cast<intptr_t>(marking_step_size *
+ GCIdleTimeHandler::kConservativeTimeRatio);
+}
+}
+}
« no previous file with comments | « src/heap/gc-idle-time-handler.h ('k') | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698