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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/heap/gc-idle-time-handler.h ('k') | src/heap/heap.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 #include <climits>
5
6 #include "src/v8.h"
7
8 #include "src/heap/gc-idle-time-handler.h"
9
10 namespace v8 {
11 namespace internal {
12
13
14 const double GCIdleTimeHandler::kConservativeTimeRatio = 0.9;
15
16
17 intptr_t GCIdleTimeHandler::EstimateMarkingStepSize(
18 int idle_time_in_ms, intptr_t marking_speed_in_bytes_per_ms) {
19 DCHECK(idle_time_in_ms > 0);
20
21 if (marking_speed_in_bytes_per_ms == 0) {
22 marking_speed_in_bytes_per_ms =
23 GCIdleTimeHandler::kInitialConservativeMarkingSpeed;
24 }
25
26 intptr_t marking_step_size = marking_speed_in_bytes_per_ms * idle_time_in_ms;
27 if (static_cast<intptr_t>(marking_step_size / idle_time_in_ms) !=
28 marking_speed_in_bytes_per_ms) {
29 // In the case of an overflow we return maximum marking step size.
30 return INT_MAX;
31 }
32
33 return static_cast<intptr_t>(marking_step_size *
34 GCIdleTimeHandler::kConservativeTimeRatio);
35 }
36 }
37 }
OLDNEW
« 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