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

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

Issue 2287343002: [heap] Integrate embedder heap tracer into incremental marking (Closed)
Patch Set: Addressed comments Created 4 years, 3 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/heap/mark-compact.h" 5 #include "src/heap/mark-compact.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/base/sys-info.h" 9 #include "src/base/sys-info.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 2188 matching lines...) Expand 10 before | Expand all | Expand 10 after
2199 top_ = bottom_ = 0xdecbad; 2199 top_ = bottom_ = 0xdecbad;
2200 in_use_ = false; 2200 in_use_ = false;
2201 } 2201 }
2202 2202
2203 void MarkCompactCollector::SetEmbedderHeapTracer(EmbedderHeapTracer* tracer) { 2203 void MarkCompactCollector::SetEmbedderHeapTracer(EmbedderHeapTracer* tracer) {
2204 DCHECK_NOT_NULL(tracer); 2204 DCHECK_NOT_NULL(tracer);
2205 CHECK_NULL(embedder_heap_tracer_); 2205 CHECK_NULL(embedder_heap_tracer_);
2206 embedder_heap_tracer_ = tracer; 2206 embedder_heap_tracer_ = tracer;
2207 } 2207 }
2208 2208
2209 bool MarkCompactCollector::RequiresImmediateWrapperProcessing() {
2210 const size_t kTooManyWrappers = 16000;
2211 return wrappers_to_trace_.size() > kTooManyWrappers;
2212 }
2213
2209 void MarkCompactCollector::RegisterWrappersWithEmbedderHeapTracer() { 2214 void MarkCompactCollector::RegisterWrappersWithEmbedderHeapTracer() {
2210 DCHECK(UsingEmbedderHeapTracer()); 2215 DCHECK(UsingEmbedderHeapTracer());
2211 if (wrappers_to_trace_.empty()) { 2216 if (wrappers_to_trace_.empty()) {
2212 return; 2217 return;
2213 } 2218 }
2214 embedder_heap_tracer()->RegisterV8References(wrappers_to_trace_); 2219 embedder_heap_tracer()->RegisterV8References(wrappers_to_trace_);
2215 wrappers_to_trace_.clear(); 2220 wrappers_to_trace_.clear();
2216 } 2221 }
2217 2222
2218 void MarkCompactCollector::TracePossibleWrapper(JSObject* js_object) { 2223 void MarkCompactCollector::TracePossibleWrapper(JSObject* js_object) {
(...skipping 1816 matching lines...) Expand 10 before | Expand all | Expand 10 after
4035 // The target is always in old space, we don't have to record the slot in 4040 // The target is always in old space, we don't have to record the slot in
4036 // the old-to-new remembered set. 4041 // the old-to-new remembered set.
4037 DCHECK(!heap()->InNewSpace(target)); 4042 DCHECK(!heap()->InNewSpace(target));
4038 RecordRelocSlot(host, &rinfo, target); 4043 RecordRelocSlot(host, &rinfo, target);
4039 } 4044 }
4040 } 4045 }
4041 } 4046 }
4042 4047
4043 } // namespace internal 4048 } // namespace internal
4044 } // namespace v8 4049 } // namespace v8
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