| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |