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

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

Issue 494683002: Fix EstimateMarkingStepSizeTest. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Clamp to INT_MAX 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 | « no previous file | no next file » | 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 #include <climits> 4 #include <climits>
5 5
6 #include "src/v8.h" 6 #include "src/v8.h"
7 7
8 #include "src/heap/gc-idle-time-handler.h" 8 #include "src/heap/gc-idle-time-handler.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 12 matching lines...) Expand all
23 GCIdleTimeHandler::kInitialConservativeMarkingSpeed; 23 GCIdleTimeHandler::kInitialConservativeMarkingSpeed;
24 } 24 }
25 25
26 intptr_t marking_step_size = marking_speed_in_bytes_per_ms * idle_time_in_ms; 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) != 27 if (static_cast<intptr_t>(marking_step_size / idle_time_in_ms) !=
28 marking_speed_in_bytes_per_ms) { 28 marking_speed_in_bytes_per_ms) {
29 // In the case of an overflow we return maximum marking step size. 29 // In the case of an overflow we return maximum marking step size.
30 return INT_MAX; 30 return INT_MAX;
31 } 31 }
32 32
33 return static_cast<intptr_t>(marking_step_size * 33 return Min(static_cast<intptr_t>(marking_step_size *
34 GCIdleTimeHandler::kConservativeTimeRatio); 34 GCIdleTimeHandler::kConservativeTimeRatio),
35 static_cast<intptr_t>(INT_MAX));
35 } 36 }
36 } 37 }
37 } 38 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698