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

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: 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
« src/heap/incremental-marking.cc ('K') | « 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 2142 matching lines...) Expand 10 before | Expand all | Expand 10 after
2153 if (marking_deque_memory_committed_) { 2153 if (marking_deque_memory_committed_) {
2154 bool success = marking_deque_memory_->Uncommit( 2154 bool success = marking_deque_memory_->Uncommit(
2155 reinterpret_cast<Address>(marking_deque_memory_->address()), 2155 reinterpret_cast<Address>(marking_deque_memory_->address()),
2156 marking_deque_memory_->size()); 2156 marking_deque_memory_->size());
2157 CHECK(success); 2157 CHECK(success);
2158 marking_deque_memory_committed_ = false; 2158 marking_deque_memory_committed_ = false;
2159 } 2159 }
2160 } 2160 }
2161 2161
2162 2162
2163 void MarkCompactCollector::OverApproximateWeakClosure() {
2164 GCTracer::Scope gc_scope(heap()->tracer(),
2165 GCTracer::Scope::MC_INCREMENTAL_WEAKCLOSURE);
2166
2167 RootMarkingVisitor root_visitor(heap());
2168 isolate()->global_handles()->IterateObjectGroups(
2169 &root_visitor, &IsUnmarkedHeapObjectWithHeap);
2170 MarkImplicitRefGroups();
2171
2172 // Remove object groups after marking phase.
2173 heap()->isolate()->global_handles()->RemoveObjectGroups();
2174 heap()->isolate()->global_handles()->RemoveImplicitRefGroups();
2175 }
2176
2177
2163 void MarkCompactCollector::MarkLiveObjects() { 2178 void MarkCompactCollector::MarkLiveObjects() {
2164 GCTracer::Scope gc_scope(heap()->tracer(), GCTracer::Scope::MC_MARK); 2179 GCTracer::Scope gc_scope(heap()->tracer(), GCTracer::Scope::MC_MARK);
2165 double start_time = 0.0; 2180 double start_time = 0.0;
2166 if (FLAG_print_cumulative_gc_stat) { 2181 if (FLAG_print_cumulative_gc_stat) {
2167 start_time = base::OS::TimeCurrentMillis(); 2182 start_time = base::OS::TimeCurrentMillis();
2168 } 2183 }
2169 // The recursive GC marker detects when it is nearing stack overflow, 2184 // The recursive GC marker detects when it is nearing stack overflow,
2170 // and switches to a different marking system. JS interrupts interfere 2185 // and switches to a different marking system. JS interrupts interfere
2171 // with the C stack limit check. 2186 // with the C stack limit check.
2172 PostponeInterruptsScope postpone(isolate()); 2187 PostponeInterruptsScope postpone(isolate());
(...skipping 2233 matching lines...) Expand 10 before | Expand all | Expand 10 after
4406 SlotsBuffer* buffer = *buffer_address; 4421 SlotsBuffer* buffer = *buffer_address;
4407 while (buffer != NULL) { 4422 while (buffer != NULL) {
4408 SlotsBuffer* next_buffer = buffer->next(); 4423 SlotsBuffer* next_buffer = buffer->next();
4409 DeallocateBuffer(buffer); 4424 DeallocateBuffer(buffer);
4410 buffer = next_buffer; 4425 buffer = next_buffer;
4411 } 4426 }
4412 *buffer_address = NULL; 4427 *buffer_address = NULL;
4413 } 4428 }
4414 } 4429 }
4415 } // namespace v8::internal 4430 } // namespace v8::internal
OLDNEW
« src/heap/incremental-marking.cc ('K') | « src/heap/mark-compact.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698