| 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 4566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4577 if (uncommit) { | 4577 if (uncommit) { |
| 4578 new_space_.Shrink(); | 4578 new_space_.Shrink(); |
| 4579 UncommitFromSpace(); | 4579 UncommitFromSpace(); |
| 4580 } | 4580 } |
| 4581 } | 4581 } |
| 4582 | 4582 |
| 4583 | 4583 |
| 4584 bool Heap::TryFinalizeIdleIncrementalMarking( | 4584 bool Heap::TryFinalizeIdleIncrementalMarking( |
| 4585 double idle_time_in_ms, size_t size_of_objects, | 4585 double idle_time_in_ms, size_t size_of_objects, |
| 4586 size_t final_incremental_mark_compact_speed_in_bytes_per_ms) { | 4586 size_t final_incremental_mark_compact_speed_in_bytes_per_ms) { |
| 4587 if (incremental_marking()->IsReadyToOverApproximateWeakClosure() || | 4587 if (FLAG_overapproximate_weak_closure && |
| 4588 (FLAG_overapproximate_weak_closure && | 4588 (incremental_marking()->IsReadyToOverApproximateWeakClosure() || |
| 4589 mark_compact_collector_.marking_deque()->IsEmpty() && | 4589 (!incremental_marking()->weak_closure_was_overapproximated() && |
| 4590 gc_idle_time_handler_.ShouldDoOverApproximateWeakClosure( | 4590 mark_compact_collector_.marking_deque()->IsEmpty() && |
| 4591 static_cast<size_t>(idle_time_in_ms)))) { | 4591 gc_idle_time_handler_.ShouldDoOverApproximateWeakClosure( |
| 4592 static_cast<size_t>(idle_time_in_ms))))) { |
| 4592 OverApproximateWeakClosure( | 4593 OverApproximateWeakClosure( |
| 4593 "Idle notification: overapproximate weak closure"); | 4594 "Idle notification: overapproximate weak closure"); |
| 4594 return true; | 4595 return true; |
| 4595 } else if (incremental_marking()->IsComplete() || | 4596 } else if (incremental_marking()->IsComplete() || |
| 4596 (mark_compact_collector_.marking_deque()->IsEmpty() && | 4597 (mark_compact_collector_.marking_deque()->IsEmpty() && |
| 4597 gc_idle_time_handler_.ShouldDoFinalIncrementalMarkCompact( | 4598 gc_idle_time_handler_.ShouldDoFinalIncrementalMarkCompact( |
| 4598 static_cast<size_t>(idle_time_in_ms), size_of_objects, | 4599 static_cast<size_t>(idle_time_in_ms), size_of_objects, |
| 4599 final_incremental_mark_compact_speed_in_bytes_per_ms))) { | 4600 final_incremental_mark_compact_speed_in_bytes_per_ms))) { |
| 4600 CollectAllGarbage(kNoGCFlags, "idle notification: finalize incremental"); | 4601 CollectAllGarbage(kNoGCFlags, "idle notification: finalize incremental"); |
| 4601 return true; | 4602 return true; |
| (...skipping 1847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6449 static_cast<int>(object_sizes_last_time_[index])); | 6450 static_cast<int>(object_sizes_last_time_[index])); |
| 6450 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6451 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
| 6451 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6452 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
| 6452 | 6453 |
| 6453 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6454 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
| 6454 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6455 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
| 6455 ClearObjectStats(); | 6456 ClearObjectStats(); |
| 6456 } | 6457 } |
| 6457 } | 6458 } |
| 6458 } // namespace v8::internal | 6459 } // namespace v8::internal |
| OLD | NEW |