Chromium Code Reviews| Index: src/heap/heap.cc |
| diff --git a/src/heap/heap.cc b/src/heap/heap.cc |
| index cec871403a718d8f2a88b8666af713e48ba56f54..ddaa70e94676db31bc84b44b6219be8117878886 100644 |
| --- a/src/heap/heap.cc |
| +++ b/src/heap/heap.cc |
| @@ -106,6 +106,8 @@ Heap::Heap() |
| old_generation_allocation_limit_(initial_old_generation_size_), |
| old_gen_exhausted_(false), |
| inline_allocation_disabled_(false), |
| + last_array_buffers_young_object_(NULL), |
| + last_native_contexts_young_object_(NULL), |
| store_buffer_rebuilder_(store_buffer()), |
| hidden_string_(NULL), |
| gc_safe_size_of_old_object_(NULL), |
| @@ -1690,29 +1692,38 @@ void Heap::UpdateReferencesInExternalStringTable( |
| void Heap::ProcessAllWeakReferences(WeakObjectRetainer* retainer) { |
| - ProcessArrayBuffers(retainer); |
| - ProcessNativeContexts(retainer); |
| + ProcessArrayBuffers(retainer, NULL); |
| + ProcessNativeContexts(retainer, NULL); |
| ProcessAllocationSites(retainer); |
| } |
| void Heap::ProcessYoungWeakReferences(WeakObjectRetainer* retainer) { |
| - ProcessArrayBuffers(retainer); |
| - ProcessNativeContexts(retainer); |
| + ProcessArrayBuffers(retainer, last_array_buffers_young_object_); |
| + ProcessNativeContexts(retainer, last_native_contexts_young_object_); |
| } |
| -void Heap::ProcessNativeContexts(WeakObjectRetainer* retainer) { |
| - Object* head = VisitWeakList<Context>(this, native_contexts_list(), retainer); |
| +void Heap::ProcessNativeContexts(WeakObjectRetainer* retainer, |
| + Object* last_native_contexts_young_object) { |
| + Object* last_young_object_recorded = NULL; |
| + Object* head = VisitWeakList<Context>(this, native_contexts_list(), retainer, |
| + last_native_contexts_young_object, |
| + &last_young_object_recorded); |
|
ulan
2015/02/03 11:15:21
It just occurred to me that this won't work becaus
|
| // Update the head of the list of contexts. |
| set_native_contexts_list(head); |
| + last_native_contexts_young_object_ = last_young_object_recorded; |
| } |
| -void Heap::ProcessArrayBuffers(WeakObjectRetainer* retainer) { |
| - Object* array_buffer_obj = |
| - VisitWeakList<JSArrayBuffer>(this, array_buffers_list(), retainer); |
| +void Heap::ProcessArrayBuffers(WeakObjectRetainer* retainer, |
| + Object* last_array_buffers_young_object) { |
| + Object* last_young_object_recorded = NULL; |
| + Object* array_buffer_obj = VisitWeakList<JSArrayBuffer>( |
| + this, array_buffers_list(), retainer, last_array_buffers_young_object, |
| + &last_young_object_recorded); |
| set_array_buffers_list(array_buffer_obj); |
| + last_array_buffers_young_object_ = last_young_object_recorded; |
| } |
| @@ -1728,8 +1739,8 @@ void Heap::TearDownArrayBuffers() { |
| void Heap::ProcessAllocationSites(WeakObjectRetainer* retainer) { |
| - Object* allocation_site_obj = |
| - VisitWeakList<AllocationSite>(this, allocation_sites_list(), retainer); |
| + Object* allocation_site_obj = VisitWeakList<AllocationSite>( |
| + this, allocation_sites_list(), retainer, NULL, NULL); |
| set_allocation_sites_list(allocation_site_obj); |
| } |