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 2193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2204 CHECK(success); | 2204 CHECK(success); |
| 2205 marking_deque_memory_committed_ = false; | 2205 marking_deque_memory_committed_ = false; |
| 2206 } | 2206 } |
| 2207 } | 2207 } |
| 2208 | 2208 |
| 2209 | 2209 |
| 2210 void MarkCompactCollector::OverApproximateWeakClosure() { | 2210 void MarkCompactCollector::OverApproximateWeakClosure() { |
| 2211 GCTracer::Scope gc_scope(heap()->tracer(), | 2211 GCTracer::Scope gc_scope(heap()->tracer(), |
| 2212 GCTracer::Scope::MC_INCREMENTAL_WEAKCLOSURE); | 2212 GCTracer::Scope::MC_INCREMENTAL_WEAKCLOSURE); |
| 2213 | 2213 |
| 2214 // Make sure that the marking deque is empty, even if it has overflown. | |
| 2215 // Otherwise, we might miss some objects in an object group that would | |
| 2216 // otherwise made the entire group alive. | |
| 2217 ProcessMarkingDeque(); | |
| 2218 | |
| 2214 RootMarkingVisitor root_visitor(heap()); | 2219 RootMarkingVisitor root_visitor(heap()); |
| 2215 isolate()->global_handles()->IterateObjectGroups( | 2220 isolate()->global_handles()->IterateObjectGroups( |
| 2216 &root_visitor, &IsUnmarkedHeapObjectWithHeap); | 2221 &root_visitor, &IsUnmarkedHeapObjectWithHeap); |
| 2217 MarkImplicitRefGroups(); | 2222 MarkImplicitRefGroups(); |
| 2218 | 2223 |
| 2224 DCHECK(marking_deque_.overflowed()); | |
|
Hannes Payer (out of office)
2015/03/10 13:09:28
Why do we check here for overflowed?
| |
| 2225 | |
| 2219 // Remove object groups after marking phase. | 2226 // Remove object groups after marking phase. |
| 2220 heap()->isolate()->global_handles()->RemoveObjectGroups(); | 2227 heap()->isolate()->global_handles()->RemoveObjectGroups(); |
| 2221 heap()->isolate()->global_handles()->RemoveImplicitRefGroups(); | 2228 heap()->isolate()->global_handles()->RemoveImplicitRefGroups(); |
| 2222 } | 2229 } |
| 2223 | 2230 |
| 2224 | 2231 |
| 2225 void MarkCompactCollector::MarkLiveObjects() { | 2232 void MarkCompactCollector::MarkLiveObjects() { |
| 2226 GCTracer::Scope gc_scope(heap()->tracer(), GCTracer::Scope::MC_MARK); | 2233 GCTracer::Scope gc_scope(heap()->tracer(), GCTracer::Scope::MC_MARK); |
| 2227 double start_time = 0.0; | 2234 double start_time = 0.0; |
| 2228 if (FLAG_print_cumulative_gc_stat) { | 2235 if (FLAG_print_cumulative_gc_stat) { |
| (...skipping 2267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4496 SlotsBuffer* buffer = *buffer_address; | 4503 SlotsBuffer* buffer = *buffer_address; |
| 4497 while (buffer != NULL) { | 4504 while (buffer != NULL) { |
| 4498 SlotsBuffer* next_buffer = buffer->next(); | 4505 SlotsBuffer* next_buffer = buffer->next(); |
| 4499 DeallocateBuffer(buffer); | 4506 DeallocateBuffer(buffer); |
| 4500 buffer = next_buffer; | 4507 buffer = next_buffer; |
| 4501 } | 4508 } |
| 4502 *buffer_address = NULL; | 4509 *buffer_address = NULL; |
| 4503 } | 4510 } |
| 4504 } | 4511 } |
| 4505 } // namespace v8::internal | 4512 } // namespace v8::internal |
| OLD | NEW |