| 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/base/atomicops.h" | 7 #include "src/base/atomicops.h" |
| 8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/compilation-cache.h" | 10 #include "src/compilation-cache.h" |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 DCHECK(heap_->incremental_marking()->IsStopped()); | 302 DCHECK(heap_->incremental_marking()->IsStopped()); |
| 303 | 303 |
| 304 if (FLAG_collect_maps) ClearNonLiveReferences(); | 304 if (FLAG_collect_maps) ClearNonLiveReferences(); |
| 305 | 305 |
| 306 ProcessAndClearWeakCells(); | 306 ProcessAndClearWeakCells(); |
| 307 | 307 |
| 308 ClearWeakCollections(); | 308 ClearWeakCollections(); |
| 309 | 309 |
| 310 heap_->set_encountered_weak_cells(Smi::FromInt(0)); | 310 heap_->set_encountered_weak_cells(Smi::FromInt(0)); |
| 311 | 311 |
| 312 isolate()->global_handles()->CollectPhantomCallbackData(); |
| 313 |
| 312 #ifdef VERIFY_HEAP | 314 #ifdef VERIFY_HEAP |
| 313 if (FLAG_verify_heap) { | 315 if (FLAG_verify_heap) { |
| 314 VerifyMarking(heap_); | 316 VerifyMarking(heap_); |
| 315 } | 317 } |
| 316 #endif | 318 #endif |
| 317 | 319 |
| 318 SweepSpaces(); | 320 SweepSpaces(); |
| 319 | 321 |
| 320 #ifdef VERIFY_HEAP | 322 #ifdef VERIFY_HEAP |
| 321 if (heap()->weak_embedded_objects_verification_enabled()) { | 323 if (heap()->weak_embedded_objects_verification_enabled()) { |
| (...skipping 1762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2084 EmptyMarkingDeque(); | 2086 EmptyMarkingDeque(); |
| 2085 } | 2087 } |
| 2086 } | 2088 } |
| 2087 | 2089 |
| 2088 | 2090 |
| 2089 // Mark all objects reachable (transitively) from objects on the marking | 2091 // Mark all objects reachable (transitively) from objects on the marking |
| 2090 // stack including references only considered in the atomic marking pause. | 2092 // stack including references only considered in the atomic marking pause. |
| 2091 void MarkCompactCollector::ProcessEphemeralMarking( | 2093 void MarkCompactCollector::ProcessEphemeralMarking( |
| 2092 ObjectVisitor* visitor, bool only_process_harmony_weak_collections) { | 2094 ObjectVisitor* visitor, bool only_process_harmony_weak_collections) { |
| 2093 bool work_to_do = true; | 2095 bool work_to_do = true; |
| 2094 DCHECK(marking_deque_.IsEmpty()); | 2096 DCHECK(marking_deque_.IsEmpty() && !marking_deque_.overflowed()); |
| 2095 while (work_to_do) { | 2097 while (work_to_do) { |
| 2096 if (!only_process_harmony_weak_collections) { | 2098 if (!only_process_harmony_weak_collections) { |
| 2097 isolate()->global_handles()->IterateObjectGroups( | 2099 isolate()->global_handles()->IterateObjectGroups( |
| 2098 visitor, &IsUnmarkedHeapObjectWithHeap); | 2100 visitor, &IsUnmarkedHeapObjectWithHeap); |
| 2099 MarkImplicitRefGroups(); | 2101 MarkImplicitRefGroups(); |
| 2100 } | 2102 } |
| 2101 ProcessWeakCollections(); | 2103 ProcessWeakCollections(); |
| 2102 work_to_do = !marking_deque_.IsEmpty(); | 2104 work_to_do = !marking_deque_.IsEmpty(); |
| 2103 ProcessMarkingDeque(); | 2105 ProcessMarkingDeque(); |
| 2104 } | 2106 } |
| (...skipping 2335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4440 SlotsBuffer* buffer = *buffer_address; | 4442 SlotsBuffer* buffer = *buffer_address; |
| 4441 while (buffer != NULL) { | 4443 while (buffer != NULL) { |
| 4442 SlotsBuffer* next_buffer = buffer->next(); | 4444 SlotsBuffer* next_buffer = buffer->next(); |
| 4443 DeallocateBuffer(buffer); | 4445 DeallocateBuffer(buffer); |
| 4444 buffer = next_buffer; | 4446 buffer = next_buffer; |
| 4445 } | 4447 } |
| 4446 *buffer_address = NULL; | 4448 *buffer_address = NULL; |
| 4447 } | 4449 } |
| 4448 } | 4450 } |
| 4449 } // namespace v8::internal | 4451 } // namespace v8::internal |
| OLD | NEW |