Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: src/heap/mark-compact.cc

Issue 894703002: Add a flag to over approximate the weak closure during GC (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap/mark-compact.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2143 matching lines...) Expand 10 before | Expand all | Expand 10 after
2154 if (marking_deque_memory_committed_) { 2154 if (marking_deque_memory_committed_) {
2155 bool success = marking_deque_memory_->Uncommit( 2155 bool success = marking_deque_memory_->Uncommit(
2156 reinterpret_cast<Address>(marking_deque_memory_->address()), 2156 reinterpret_cast<Address>(marking_deque_memory_->address()),
2157 marking_deque_memory_->size()); 2157 marking_deque_memory_->size());
2158 CHECK(success); 2158 CHECK(success);
2159 marking_deque_memory_committed_ = false; 2159 marking_deque_memory_committed_ = false;
2160 } 2160 }
2161 } 2161 }
2162 2162
2163 2163
2164 void MarkCompactCollector::OverApproximateWeakClosure() {
2165 GCTracer::Scope gc_scope(heap()->tracer(),
2166 GCTracer::Scope::MC_INCREMENTAL_WEAKCLOSURE);
2167
2168 RootMarkingVisitor root_visitor(heap());
2169 isolate()->global_handles()->IterateObjectGroups(
2170 &root_visitor, &IsUnmarkedHeapObjectWithHeap);
2171 MarkImplicitRefGroups();
2172
2173 // Remove object groups after marking phase.
2174 heap()->isolate()->global_handles()->RemoveObjectGroups();
2175 heap()->isolate()->global_handles()->RemoveImplicitRefGroups();
2176 }
2177
2178
2164 void MarkCompactCollector::MarkLiveObjects() { 2179 void MarkCompactCollector::MarkLiveObjects() {
2165 GCTracer::Scope gc_scope(heap()->tracer(), GCTracer::Scope::MC_MARK); 2180 GCTracer::Scope gc_scope(heap()->tracer(), GCTracer::Scope::MC_MARK);
2166 double start_time = 0.0; 2181 double start_time = 0.0;
2167 if (FLAG_print_cumulative_gc_stat) { 2182 if (FLAG_print_cumulative_gc_stat) {
2168 start_time = base::OS::TimeCurrentMillis(); 2183 start_time = base::OS::TimeCurrentMillis();
2169 } 2184 }
2170 // The recursive GC marker detects when it is nearing stack overflow, 2185 // The recursive GC marker detects when it is nearing stack overflow,
2171 // and switches to a different marking system. JS interrupts interfere 2186 // and switches to a different marking system. JS interrupts interfere
2172 // with the C stack limit check. 2187 // with the C stack limit check.
2173 PostponeInterruptsScope postpone(isolate()); 2188 PostponeInterruptsScope postpone(isolate());
(...skipping 2233 matching lines...) Expand 10 before | Expand all | Expand 10 after
4407 SlotsBuffer* buffer = *buffer_address; 4422 SlotsBuffer* buffer = *buffer_address;
4408 while (buffer != NULL) { 4423 while (buffer != NULL) {
4409 SlotsBuffer* next_buffer = buffer->next(); 4424 SlotsBuffer* next_buffer = buffer->next();
4410 DeallocateBuffer(buffer); 4425 DeallocateBuffer(buffer);
4411 buffer = next_buffer; 4426 buffer = next_buffer;
4412 } 4427 }
4413 *buffer_address = NULL; 4428 *buffer_address = NULL;
4414 } 4429 }
4415 } 4430 }
4416 } // namespace v8::internal 4431 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap/mark-compact.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698