| 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/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
| (...skipping 4471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4482 | 4482 |
| 4483 bool result = false; | 4483 bool result = false; |
| 4484 switch (action.type) { | 4484 switch (action.type) { |
| 4485 case DONE: | 4485 case DONE: |
| 4486 result = true; | 4486 result = true; |
| 4487 break; | 4487 break; |
| 4488 case DO_INCREMENTAL_MARKING: { | 4488 case DO_INCREMENTAL_MARKING: { |
| 4489 if (incremental_marking()->IsStopped()) { | 4489 if (incremental_marking()->IsStopped()) { |
| 4490 incremental_marking()->Start(); | 4490 incremental_marking()->Start(); |
| 4491 } | 4491 } |
| 4492 incremental_marking()->Step(action.parameter, | 4492 double remaining_idle_time_in_ms = 0.0; |
| 4493 IncrementalMarking::NO_GC_VIA_STACK_GUARD, | 4493 do { |
| 4494 IncrementalMarking::FORCE_MARKING, | 4494 incremental_marking()->Step( |
| 4495 IncrementalMarking::DO_NOT_FORCE_COMPLETION); | 4495 action.parameter, IncrementalMarking::NO_GC_VIA_STACK_GUARD, |
| 4496 double remaining_idle_time_in_ms = | 4496 IncrementalMarking::FORCE_MARKING, |
| 4497 deadline_in_ms - MonotonicallyIncreasingTimeInMs(); | 4497 IncrementalMarking::DO_NOT_FORCE_COMPLETION); |
| 4498 remaining_idle_time_in_ms = |
| 4499 deadline_in_ms - MonotonicallyIncreasingTimeInMs(); |
| 4500 } while (remaining_idle_time_in_ms >= |
| 4501 2.0 * GCIdleTimeHandler::kIncrementalMarkingStepTimeInMs && |
| 4502 !incremental_marking()->IsComplete() && |
| 4503 !mark_compact_collector_.marking_deque()->IsEmpty()); |
| 4498 if (remaining_idle_time_in_ms > 0.0) { | 4504 if (remaining_idle_time_in_ms > 0.0) { |
| 4499 TryFinalizeIdleIncrementalMarking( | 4505 TryFinalizeIdleIncrementalMarking( |
| 4500 remaining_idle_time_in_ms, heap_state.size_of_objects, | 4506 remaining_idle_time_in_ms, heap_state.size_of_objects, |
| 4501 heap_state.final_incremental_mark_compact_speed_in_bytes_per_ms); | 4507 heap_state.final_incremental_mark_compact_speed_in_bytes_per_ms); |
| 4502 } | 4508 } |
| 4503 break; | 4509 break; |
| 4504 } | 4510 } |
| 4505 case DO_FULL_GC: { | 4511 case DO_FULL_GC: { |
| 4506 if (contexts_disposed_) { | 4512 if (contexts_disposed_) { |
| 4507 HistogramTimerScope scope(isolate_->counters()->gc_context()); | 4513 HistogramTimerScope scope(isolate_->counters()->gc_context()); |
| (...skipping 1862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6370 static_cast<int>(object_sizes_last_time_[index])); | 6376 static_cast<int>(object_sizes_last_time_[index])); |
| 6371 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6377 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
| 6372 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6378 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
| 6373 | 6379 |
| 6374 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6380 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
| 6375 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6381 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
| 6376 ClearObjectStats(); | 6382 ClearObjectStats(); |
| 6377 } | 6383 } |
| 6378 } | 6384 } |
| 6379 } // namespace v8::internal | 6385 } // namespace v8::internal |
| OLD | NEW |