OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/base/once.h" | 9 #include "src/base/once.h" |
10 #include "src/base/utils/random-number-generator.h" | 10 #include "src/base/utils/random-number-generator.h" |
(...skipping 4280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4291 isolate_->counters()->gc_idle_notification()); | 4291 isolate_->counters()->gc_idle_notification()); |
4292 | 4292 |
4293 GCIdleTimeHandler::HeapState heap_state; | 4293 GCIdleTimeHandler::HeapState heap_state; |
4294 heap_state.contexts_disposed = contexts_disposed_; | 4294 heap_state.contexts_disposed = contexts_disposed_; |
4295 heap_state.size_of_objects = static_cast<size_t>(SizeOfObjects()); | 4295 heap_state.size_of_objects = static_cast<size_t>(SizeOfObjects()); |
4296 heap_state.incremental_marking_stopped = incremental_marking()->IsStopped(); | 4296 heap_state.incremental_marking_stopped = incremental_marking()->IsStopped(); |
4297 // TODO(ulan): Start incremental marking only for large heaps. | 4297 // TODO(ulan): Start incremental marking only for large heaps. |
4298 heap_state.can_start_incremental_marking = true; | 4298 heap_state.can_start_incremental_marking = true; |
4299 heap_state.sweeping_in_progress = | 4299 heap_state.sweeping_in_progress = |
4300 mark_compact_collector()->sweeping_in_progress(); | 4300 mark_compact_collector()->sweeping_in_progress(); |
| 4301 heap_state.mark_compact_speed_in_bytes_per_ms = |
| 4302 static_cast<size_t>(tracer()->MarkCompactSpeedInBytesPerMillisecond()); |
| 4303 heap_state.incremental_marking_speed_in_bytes_per_ms = static_cast<size_t>( |
| 4304 tracer()->IncrementalMarkingSpeedInBytesPerMillisecond()); |
4301 | 4305 |
4302 GCIdleTimeAction action = | 4306 GCIdleTimeAction action = |
4303 gc_idle_time_handler_.Compute(idle_time_in_ms, heap_state, tracer()); | 4307 gc_idle_time_handler_.Compute(idle_time_in_ms, heap_state); |
4304 | 4308 |
4305 contexts_disposed_ = 0; | 4309 contexts_disposed_ = 0; |
4306 bool result = false; | 4310 bool result = false; |
4307 switch (action.type) { | 4311 switch (action.type) { |
4308 case DO_INCREMENTAL_MARKING: | 4312 case DO_INCREMENTAL_MARKING: |
4309 if (incremental_marking()->IsStopped()) { | 4313 if (incremental_marking()->IsStopped()) { |
4310 incremental_marking()->Start(); | 4314 incremental_marking()->Start(); |
4311 } | 4315 } |
4312 AdvanceIdleIncrementalMarking(action.parameter); | 4316 AdvanceIdleIncrementalMarking(action.parameter); |
4313 break; | 4317 break; |
(...skipping 1789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6103 static_cast<int>(object_sizes_last_time_[index])); | 6107 static_cast<int>(object_sizes_last_time_[index])); |
6104 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6108 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
6105 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6109 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
6106 | 6110 |
6107 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6111 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
6108 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6112 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
6109 ClearObjectStats(); | 6113 ClearObjectStats(); |
6110 } | 6114 } |
6111 } | 6115 } |
6112 } // namespace v8::internal | 6116 } // namespace v8::internal |
OLD | NEW |