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 2202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2213 if (IsMarked(cell)) { | 2213 if (IsMarked(cell)) { |
2214 MarkCompactMarkingVisitor::VisitPropertyCell(cell->map(), cell); | 2214 MarkCompactMarkingVisitor::VisitPropertyCell(cell->map(), cell); |
2215 } | 2215 } |
2216 } | 2216 } |
2217 } | 2217 } |
2218 } | 2218 } |
2219 | 2219 |
2220 RootMarkingVisitor root_visitor(heap()); | 2220 RootMarkingVisitor root_visitor(heap()); |
2221 MarkRoots(&root_visitor); | 2221 MarkRoots(&root_visitor); |
2222 | 2222 |
2223 ProcessTopOptimizedFrame(&root_visitor); | 2223 { |
2224 GCTracer::Scope gc_scope(heap()->tracer(), GCTracer::Scope::MC_WEAKCLOSURE); | |
2225 ProcessTopOptimizedFrame(&root_visitor); | |
Hannes Payer (out of office)
2014/12/02 14:22:09
I guess you want to start measuring time after Pro
| |
2224 | 2226 |
2225 // The objects reachable from the roots are marked, yet unreachable | 2227 // The objects reachable from the roots are marked, yet unreachable |
2226 // objects are unmarked. Mark objects reachable due to host | 2228 // objects are unmarked. Mark objects reachable due to host |
2227 // application specific logic or through Harmony weak maps. | 2229 // application specific logic or through Harmony weak maps. |
2228 ProcessEphemeralMarking(&root_visitor, false); | 2230 ProcessEphemeralMarking(&root_visitor, false); |
2229 | 2231 |
2230 // The objects reachable from the roots, weak maps or object groups | 2232 // The objects reachable from the roots, weak maps or object groups |
2231 // are marked. Objects pointed to only by weak global handles cannot be | 2233 // are marked. Objects pointed to only by weak global handles cannot be |
2232 // immediately reclaimed. Instead, we have to mark them as pending and mark | 2234 // immediately reclaimed. Instead, we have to mark them as pending and mark |
2233 // objects reachable from them. | 2235 // objects reachable from them. |
2234 // | 2236 // |
2235 // First we identify nonlive weak handles and mark them as pending | 2237 // First we identify nonlive weak handles and mark them as pending |
2236 // destruction. | 2238 // destruction. |
2237 heap()->isolate()->global_handles()->IdentifyWeakHandles( | 2239 heap()->isolate()->global_handles()->IdentifyWeakHandles( |
2238 &IsUnmarkedHeapObject); | 2240 &IsUnmarkedHeapObject); |
2239 // Then we mark the objects. | 2241 // Then we mark the objects. |
2240 heap()->isolate()->global_handles()->IterateWeakRoots(&root_visitor); | 2242 heap()->isolate()->global_handles()->IterateWeakRoots(&root_visitor); |
2241 | 2243 |
2242 // Repeat Harmony weak maps marking to mark unmarked objects reachable from | 2244 // Repeat Harmony weak maps marking to mark unmarked objects reachable from |
2243 // the weak roots we just marked as pending destruction. | 2245 // the weak roots we just marked as pending destruction. |
2244 // | 2246 // |
2245 // We only process harmony collections, as all object groups have been fully | 2247 // We only process harmony collections, as all object groups have been fully |
2246 // processed and no weakly reachable node can discover new objects groups. | 2248 // processed and no weakly reachable node can discover new objects groups. |
2247 ProcessEphemeralMarking(&root_visitor, true); | 2249 ProcessEphemeralMarking(&root_visitor, true); |
2250 } | |
2248 | 2251 |
2249 AfterMarking(); | 2252 AfterMarking(); |
2250 | 2253 |
2251 if (FLAG_print_cumulative_gc_stat) { | 2254 if (FLAG_print_cumulative_gc_stat) { |
2252 heap_->tracer()->AddMarkingTime(base::OS::TimeCurrentMillis() - start_time); | 2255 heap_->tracer()->AddMarkingTime(base::OS::TimeCurrentMillis() - start_time); |
2253 } | 2256 } |
2254 } | 2257 } |
2255 | 2258 |
2256 | 2259 |
2257 void MarkCompactCollector::AfterMarking() { | 2260 void MarkCompactCollector::AfterMarking() { |
(...skipping 2177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4435 SlotsBuffer* buffer = *buffer_address; | 4438 SlotsBuffer* buffer = *buffer_address; |
4436 while (buffer != NULL) { | 4439 while (buffer != NULL) { |
4437 SlotsBuffer* next_buffer = buffer->next(); | 4440 SlotsBuffer* next_buffer = buffer->next(); |
4438 DeallocateBuffer(buffer); | 4441 DeallocateBuffer(buffer); |
4439 buffer = next_buffer; | 4442 buffer = next_buffer; |
4440 } | 4443 } |
4441 *buffer_address = NULL; | 4444 *buffer_address = NULL; |
4442 } | 4445 } |
4443 } | 4446 } |
4444 } // namespace v8::internal | 4447 } // namespace v8::internal |
OLD | NEW |