| 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 3068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3079 // evacuation. | 3079 // evacuation. |
| 3080 static int PageEvacuationThreshold() { | 3080 static int PageEvacuationThreshold() { |
| 3081 if (FLAG_page_promotion) | 3081 if (FLAG_page_promotion) |
| 3082 return FLAG_page_promotion_threshold * Page::kAllocatableMemory / 100; | 3082 return FLAG_page_promotion_threshold * Page::kAllocatableMemory / 100; |
| 3083 return Page::kAllocatableMemory + kPointerSize; | 3083 return Page::kAllocatableMemory + kPointerSize; |
| 3084 } | 3084 } |
| 3085 | 3085 |
| 3086 explicit Evacuator(MarkCompactCollector* collector) | 3086 explicit Evacuator(MarkCompactCollector* collector) |
| 3087 : collector_(collector), | 3087 : collector_(collector), |
| 3088 compaction_spaces_(collector->heap()), | 3088 compaction_spaces_(collector->heap()), |
| 3089 local_pretenuring_feedback_(base::HashMap::PointersMatch, | 3089 local_pretenuring_feedback_(kInitialLocalPretenuringFeedbackCapacity), |
| 3090 kInitialLocalPretenuringFeedbackCapacity), | |
| 3091 new_space_visitor_(collector->heap(), &compaction_spaces_, | 3090 new_space_visitor_(collector->heap(), &compaction_spaces_, |
| 3092 &local_pretenuring_feedback_), | 3091 &local_pretenuring_feedback_), |
| 3093 new_space_page_visitor(collector->heap()), | 3092 new_space_page_visitor(collector->heap()), |
| 3094 old_space_visitor_(collector->heap(), &compaction_spaces_), | 3093 old_space_visitor_(collector->heap(), &compaction_spaces_), |
| 3095 duration_(0.0), | 3094 duration_(0.0), |
| 3096 bytes_compacted_(0) {} | 3095 bytes_compacted_(0) {} |
| 3097 | 3096 |
| 3098 inline bool EvacuatePage(Page* chunk); | 3097 inline bool EvacuatePage(Page* chunk); |
| 3099 | 3098 |
| 3100 // Merge back locally cached info sequentially. Note that this method needs | 3099 // Merge back locally cached info sequentially. Note that this method needs |
| (...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4042 // The target is always in old space, we don't have to record the slot in | 4041 // The target is always in old space, we don't have to record the slot in |
| 4043 // the old-to-new remembered set. | 4042 // the old-to-new remembered set. |
| 4044 DCHECK(!heap()->InNewSpace(target)); | 4043 DCHECK(!heap()->InNewSpace(target)); |
| 4045 RecordRelocSlot(host, &rinfo, target); | 4044 RecordRelocSlot(host, &rinfo, target); |
| 4046 } | 4045 } |
| 4047 } | 4046 } |
| 4048 } | 4047 } |
| 4049 | 4048 |
| 4050 } // namespace internal | 4049 } // namespace internal |
| 4051 } // namespace v8 | 4050 } // namespace v8 |
| OLD | NEW |