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

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 #define __STDC_LIMIT_MACROS
5 #include <stdint.h>
6
7 #include "src/v8.h"
8
9 #include "src/heap/gc-idle-time-handler.h"
10
11 namespace v8 {
12 namespace internal {
13
14
15 const double GCIdleTimeHandler::kConservativeTimeRatio = 0.9;
16
17
18 intptr_t GCIdleTimeHandler::EstimateMarkingStepSize(
19 int idle_time_in_ms, intptr_t marking_speed_in_bytes_per_millisecond) {
ulan 2014/08/20 08:21:16 Nit: marking_speed_in_bytes_per_ms would be consis
Hannes Payer (out of office) 2014/08/20 10:20:15 Done.
20 DCHECK(idle_time_in_ms > 0);
21
22 if (marking_speed_in_bytes_per_millisecond == 0) {
23 marking_speed_in_bytes_per_millisecond =
24 GCIdleTimeHandler::kInitialConservativeMarkingSpeed;
25 }
26
27 intptr_t marking_step_size =
28 marking_speed_in_bytes_per_millisecond * idle_time_in_ms;
29 if (static_cast<intptr_t>(marking_step_size / idle_time_in_ms) !=
30 marking_speed_in_bytes_per_millisecond) {
31 // In the case of an overflow we return maximum marking step size.
32 return INTPTR_MAX;
33 }
34
35 return static_cast<intptr_t>(marking_step_size *
36 GCIdleTimeHandler::kConservativeTimeRatio);
37 }
38 }
39 }
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