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

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

Issue 496273002: First tests for GCIdleTimeHandler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebase 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') | test/heap-unittests/heap-unittest.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/heap/gc-idle-time-handler.h" 5 #include "src/heap/gc-idle-time-handler.h"
6 #include "src/heap/gc-tracer.h" 6 #include "src/heap/gc-tracer.h"
7 #include "src/utils.h" 7 #include "src/utils.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
11 11
12 const double GCIdleTimeHandler::kConservativeTimeRatio = 0.9; 12 const double GCIdleTimeHandler::kConservativeTimeRatio = 0.9;
13 const size_t GCIdleTimeHandler::kMaxMarkCompactTimeInMs = 1000000; 13 const size_t GCIdleTimeHandler::kMaxMarkCompactTimeInMs = 1000000;
14 const size_t GCIdleTimeHandler::kMinTimeForFinalizeSweeping = 100; 14 const size_t GCIdleTimeHandler::kMinTimeForFinalizeSweeping = 100;
15 const int GCIdleTimeHandler::kMaxMarkCompactsInIdleRound = 7;
16 const int GCIdleTimeHandler::kIdleScavengeThreshold = 5;
15 17
16 18
17 size_t GCIdleTimeHandler::EstimateMarkingStepSize( 19 size_t GCIdleTimeHandler::EstimateMarkingStepSize(
18 size_t idle_time_in_ms, size_t marking_speed_in_bytes_per_ms) { 20 size_t idle_time_in_ms, size_t marking_speed_in_bytes_per_ms) {
19 DCHECK(idle_time_in_ms > 0); 21 DCHECK(idle_time_in_ms > 0);
20 22
21 if (marking_speed_in_bytes_per_ms == 0) { 23 if (marking_speed_in_bytes_per_ms == 0) {
22 marking_speed_in_bytes_per_ms = kInitialConservativeMarkingSpeed; 24 marking_speed_in_bytes_per_ms = kInitialConservativeMarkingSpeed;
23 } 25 }
24 26
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 idle_time_in_ms >= kMinTimeForFinalizeSweeping) { 81 idle_time_in_ms >= kMinTimeForFinalizeSweeping) {
80 return GCIdleTimeAction::FinalizeSweeping(); 82 return GCIdleTimeAction::FinalizeSweeping();
81 } 83 }
82 84
83 size_t step_size = EstimateMarkingStepSize( 85 size_t step_size = EstimateMarkingStepSize(
84 idle_time_in_ms, heap_state.incremental_marking_speed_in_bytes_per_ms); 86 idle_time_in_ms, heap_state.incremental_marking_speed_in_bytes_per_ms);
85 return GCIdleTimeAction::IncrementalMarking(step_size); 87 return GCIdleTimeAction::IncrementalMarking(step_size);
86 } 88 }
87 } 89 }
88 } 90 }
OLDNEW
« no previous file with comments | « src/heap/gc-idle-time-handler.h ('k') | test/heap-unittests/heap-unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698