Chromium Code Reviews| 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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 297 DCHECK(heap_->incremental_marking()->IsStopped()); | 297 DCHECK(heap_->incremental_marking()->IsStopped()); |
| 298 | 298 |
| 299 if (FLAG_collect_maps) ClearNonLiveReferences(); | 299 if (FLAG_collect_maps) ClearNonLiveReferences(); |
| 300 | 300 |
| 301 ProcessAndClearWeakCells(); | 301 ProcessAndClearWeakCells(); |
| 302 | 302 |
| 303 ClearWeakCollections(); | 303 ClearWeakCollections(); |
| 304 | 304 |
| 305 heap_->set_encountered_weak_cells(Smi::FromInt(0)); | 305 heap_->set_encountered_weak_cells(Smi::FromInt(0)); |
| 306 | 306 |
| 307 isolate()->global_handles()->CollectPhantomCallbackData(); | |
| 308 | |
| 307 #ifdef VERIFY_HEAP | 309 #ifdef VERIFY_HEAP |
| 308 if (FLAG_verify_heap) { | 310 if (FLAG_verify_heap) { |
| 309 VerifyMarking(heap_); | 311 VerifyMarking(heap_); |
| 310 } | 312 } |
| 311 #endif | 313 #endif |
| 312 | 314 |
| 313 SweepSpaces(); | 315 SweepSpaces(); |
| 314 | 316 |
| 315 #ifdef VERIFY_HEAP | 317 #ifdef VERIFY_HEAP |
| 316 if (heap()->weak_embedded_objects_verification_enabled()) { | 318 if (heap()->weak_embedded_objects_verification_enabled()) { |
| (...skipping 1889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2206 // The objects reachable from the roots, weak maps or object groups | 2208 // The objects reachable from the roots, weak maps or object groups |
| 2207 // are marked, yet unreachable objects are unmarked. Mark objects | 2209 // are marked, yet unreachable objects are unmarked. Mark objects |
| 2208 // reachable only from weak global handles. | 2210 // reachable only from weak global handles. |
| 2209 // | 2211 // |
| 2210 // First we identify nonlive weak handles and mark them as pending | 2212 // First we identify nonlive weak handles and mark them as pending |
| 2211 // destruction. | 2213 // destruction. |
| 2212 heap()->isolate()->global_handles()->IdentifyWeakHandles( | 2214 heap()->isolate()->global_handles()->IdentifyWeakHandles( |
| 2213 &IsUnmarkedHeapObject); | 2215 &IsUnmarkedHeapObject); |
| 2214 // Then we mark the objects and process the transitive closure. | 2216 // Then we mark the objects and process the transitive closure. |
| 2215 heap()->isolate()->global_handles()->IterateWeakRoots(&root_visitor); | 2217 heap()->isolate()->global_handles()->IterateWeakRoots(&root_visitor); |
| 2216 while (marking_deque_.overflowed()) { | 2218 |
| 2217 RefillMarkingDeque(); | 2219 ProcessMarkingDeque(); |
|
jochen (gone - plz use gerrit)
2014/12/02 10:25:59
this is not needed, because the following call to
Erik Corry
2014/12/02 10:40:49
I think this is wrong, and it is needed.
Nothing
| |
| 2218 EmptyMarkingDeque(); | |
| 2219 } | |
| 2220 | 2220 |
| 2221 // Repeat host application specific and Harmony weak maps marking to | 2221 // Repeat host application specific and Harmony weak maps marking to |
| 2222 // mark unmarked objects reachable from the weak roots. | 2222 // mark unmarked objects reachable from the weak roots. |
| 2223 ProcessEphemeralMarking(&root_visitor); | 2223 ProcessEphemeralMarking(&root_visitor); |
| 2224 | 2224 |
| 2225 AfterMarking(); | 2225 AfterMarking(); |
| 2226 | 2226 |
| 2227 if (FLAG_print_cumulative_gc_stat) { | 2227 if (FLAG_print_cumulative_gc_stat) { |
| 2228 heap_->tracer()->AddMarkingTime(base::OS::TimeCurrentMillis() - start_time); | 2228 heap_->tracer()->AddMarkingTime(base::OS::TimeCurrentMillis() - start_time); |
| 2229 } | 2229 } |
| (...skipping 2180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4410 SlotsBuffer* buffer = *buffer_address; | 4410 SlotsBuffer* buffer = *buffer_address; |
| 4411 while (buffer != NULL) { | 4411 while (buffer != NULL) { |
| 4412 SlotsBuffer* next_buffer = buffer->next(); | 4412 SlotsBuffer* next_buffer = buffer->next(); |
| 4413 DeallocateBuffer(buffer); | 4413 DeallocateBuffer(buffer); |
| 4414 buffer = next_buffer; | 4414 buffer = next_buffer; |
| 4415 } | 4415 } |
| 4416 *buffer_address = NULL; | 4416 *buffer_address = NULL; |
| 4417 } | 4417 } |
| 4418 } | 4418 } |
| 4419 } // namespace v8::internal | 4419 } // namespace v8::internal |
| OLD | NEW |