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 3027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3038 // evacuation. | 3038 // evacuation. |
3039 static int PageEvacuationThreshold() { | 3039 static int PageEvacuationThreshold() { |
3040 if (FLAG_page_promotion) | 3040 if (FLAG_page_promotion) |
3041 return FLAG_page_promotion_threshold * Page::kAllocatableMemory / 100; | 3041 return FLAG_page_promotion_threshold * Page::kAllocatableMemory / 100; |
3042 return Page::kAllocatableMemory + kPointerSize; | 3042 return Page::kAllocatableMemory + kPointerSize; |
3043 } | 3043 } |
3044 | 3044 |
3045 explicit Evacuator(MarkCompactCollector* collector) | 3045 explicit Evacuator(MarkCompactCollector* collector) |
3046 : collector_(collector), | 3046 : collector_(collector), |
3047 compaction_spaces_(collector->heap()), | 3047 compaction_spaces_(collector->heap()), |
3048 local_pretenuring_feedback_(base::HashMap::PointersMatch, | 3048 local_pretenuring_feedback_(kInitialLocalPretenuringFeedbackCapacity), |
3049 kInitialLocalPretenuringFeedbackCapacity), | |
3050 new_space_visitor_(collector->heap(), &compaction_spaces_, | 3049 new_space_visitor_(collector->heap(), &compaction_spaces_, |
3051 &local_pretenuring_feedback_), | 3050 &local_pretenuring_feedback_), |
3052 new_space_page_visitor(collector->heap()), | 3051 new_space_page_visitor(collector->heap()), |
3053 old_space_visitor_(collector->heap(), &compaction_spaces_), | 3052 old_space_visitor_(collector->heap(), &compaction_spaces_), |
3054 duration_(0.0), | 3053 duration_(0.0), |
3055 bytes_compacted_(0) {} | 3054 bytes_compacted_(0) {} |
3056 | 3055 |
3057 inline bool EvacuatePage(Page* chunk); | 3056 inline bool EvacuatePage(Page* chunk); |
3058 | 3057 |
3059 // Merge back locally cached info sequentially. Note that this method needs | 3058 // Merge back locally cached info sequentially. Note that this method needs |
(...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3998 // The target is always in old space, we don't have to record the slot in | 3997 // The target is always in old space, we don't have to record the slot in |
3999 // the old-to-new remembered set. | 3998 // the old-to-new remembered set. |
4000 DCHECK(!heap()->InNewSpace(target)); | 3999 DCHECK(!heap()->InNewSpace(target)); |
4001 RecordRelocSlot(host, &rinfo, target); | 4000 RecordRelocSlot(host, &rinfo, target); |
4002 } | 4001 } |
4003 } | 4002 } |
4004 } | 4003 } |
4005 | 4004 |
4006 } // namespace internal | 4005 } // namespace internal |
4007 } // namespace v8 | 4006 } // namespace v8 |
OLD | NEW |