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 2223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2234 // are marked. Objects pointed to only by weak global handles cannot be | 2234 // are marked. Objects pointed to only by weak global handles cannot be |
2235 // immediately reclaimed. Instead, we have to mark them as pending and mark | 2235 // immediately reclaimed. Instead, we have to mark them as pending and mark |
2236 // objects reachable from them. | 2236 // objects reachable from them. |
2237 // | 2237 // |
2238 // First we identify nonlive weak handles and mark them as pending | 2238 // First we identify nonlive weak handles and mark them as pending |
2239 // destruction. | 2239 // destruction. |
2240 heap()->isolate()->global_handles()->IdentifyWeakHandles( | 2240 heap()->isolate()->global_handles()->IdentifyWeakHandles( |
2241 &IsUnmarkedHeapObject); | 2241 &IsUnmarkedHeapObject); |
2242 // Then we mark the objects. | 2242 // Then we mark the objects. |
2243 heap()->isolate()->global_handles()->IterateWeakRoots(&root_visitor); | 2243 heap()->isolate()->global_handles()->IterateWeakRoots(&root_visitor); |
| 2244 ProcessMarkingDeque(); |
2244 | 2245 |
2245 // Repeat Harmony weak maps marking to mark unmarked objects reachable from | 2246 // Repeat Harmony weak maps marking to mark unmarked objects reachable from |
2246 // the weak roots we just marked as pending destruction. | 2247 // the weak roots we just marked as pending destruction. |
2247 // | 2248 // |
2248 // We only process harmony collections, as all object groups have been fully | 2249 // We only process harmony collections, as all object groups have been fully |
2249 // processed and no weakly reachable node can discover new objects groups. | 2250 // processed and no weakly reachable node can discover new objects groups. |
2250 ProcessEphemeralMarking(&root_visitor, true); | 2251 ProcessEphemeralMarking(&root_visitor, true); |
2251 } | 2252 } |
2252 | 2253 |
2253 AfterMarking(); | 2254 AfterMarking(); |
(...skipping 2185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4439 SlotsBuffer* buffer = *buffer_address; | 4440 SlotsBuffer* buffer = *buffer_address; |
4440 while (buffer != NULL) { | 4441 while (buffer != NULL) { |
4441 SlotsBuffer* next_buffer = buffer->next(); | 4442 SlotsBuffer* next_buffer = buffer->next(); |
4442 DeallocateBuffer(buffer); | 4443 DeallocateBuffer(buffer); |
4443 buffer = next_buffer; | 4444 buffer = next_buffer; |
4444 } | 4445 } |
4445 *buffer_address = NULL; | 4446 *buffer_address = NULL; |
4446 } | 4447 } |
4447 } | 4448 } |
4448 } // namespace v8::internal | 4449 } // namespace v8::internal |
OLD | NEW |