| 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/heap/mark-compact.h" | 5 #include "src/heap/mark-compact.h" |
| 6 | 6 |
| 7 #include "src/base/atomicops.h" | 7 #include "src/base/atomicops.h" |
| 8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
| 9 #include "src/base/sys-info.h" | 9 #include "src/base/sys-info.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 size_t free_bytes = area_size - live_bytes; | 709 size_t free_bytes = area_size - live_bytes; |
| 710 if (FLAG_always_compact || | 710 if (FLAG_always_compact || |
| 711 ((free_bytes >= free_bytes_threshold) && | 711 ((free_bytes >= free_bytes_threshold) && |
| 712 ((total_live_bytes + live_bytes) <= max_evacuated_bytes))) { | 712 ((total_live_bytes + live_bytes) <= max_evacuated_bytes))) { |
| 713 candidate_count++; | 713 candidate_count++; |
| 714 total_live_bytes += live_bytes; | 714 total_live_bytes += live_bytes; |
| 715 } | 715 } |
| 716 if (FLAG_trace_fragmentation_verbose) { | 716 if (FLAG_trace_fragmentation_verbose) { |
| 717 PrintIsolate(isolate(), | 717 PrintIsolate(isolate(), |
| 718 "compaction-selection-page: space=%s free_bytes_page=%zu " | 718 "compaction-selection-page: space=%s free_bytes_page=%zu " |
| 719 "fragmentation_limit_kb=%" V8PRIdPTR | 719 "fragmentation_limit_kb=%" PRIuS |
| 720 " fragmentation_limit_percent=%d sum_compaction_kb=%zu " | 720 " fragmentation_limit_percent=%d sum_compaction_kb=%zu " |
| 721 "compaction_limit_kb=%zu\n", | 721 "compaction_limit_kb=%zu\n", |
| 722 AllocationSpaceName(space->identity()), free_bytes / KB, | 722 AllocationSpaceName(space->identity()), free_bytes / KB, |
| 723 free_bytes_threshold / KB, target_fragmentation_percent, | 723 free_bytes_threshold / KB, target_fragmentation_percent, |
| 724 total_live_bytes / KB, max_evacuated_bytes / KB); | 724 total_live_bytes / KB, max_evacuated_bytes / KB); |
| 725 } | 725 } |
| 726 } | 726 } |
| 727 // How many pages we will allocated for the evacuated objects | 727 // How many pages we will allocated for the evacuated objects |
| 728 // in the worst case: ceil(total_live_bytes / area_size) | 728 // in the worst case: ceil(total_live_bytes / area_size) |
| 729 int estimated_new_pages = | 729 int estimated_new_pages = |
| (...skipping 3270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4000 // The target is always in old space, we don't have to record the slot in | 4000 // The target is always in old space, we don't have to record the slot in |
| 4001 // the old-to-new remembered set. | 4001 // the old-to-new remembered set. |
| 4002 DCHECK(!heap()->InNewSpace(target)); | 4002 DCHECK(!heap()->InNewSpace(target)); |
| 4003 RecordRelocSlot(host, &rinfo, target); | 4003 RecordRelocSlot(host, &rinfo, target); |
| 4004 } | 4004 } |
| 4005 } | 4005 } |
| 4006 } | 4006 } |
| 4007 | 4007 |
| 4008 } // namespace internal | 4008 } // namespace internal |
| 4009 } // namespace v8 | 4009 } // namespace v8 |
| OLD | NEW |