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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp

Issue 1475493002: Enable MinorGCUnmodifiedWrapperVisitor in workers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2564
Patch Set: Created 5 years 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 | « no previous file | 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 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 { 238 {
239 v8::HeapStatistics heapStatistics; 239 v8::HeapStatistics heapStatistics;
240 isolate->GetHeapStatistics(&heapStatistics); 240 isolate->GetHeapStatistics(&heapStatistics);
241 return heapStatistics.used_heap_size(); 241 return heapStatistics.used_heap_size();
242 } 242 }
243 243
244 namespace { 244 namespace {
245 245
246 void visitWeakHandlesForMinorGC(v8::Isolate* isolate) 246 void visitWeakHandlesForMinorGC(v8::Isolate* isolate)
247 { 247 {
248 ASSERT(isMainThread());
249 MinorGCUnmodifiedWrapperVisitor visitor(isolate); 248 MinorGCUnmodifiedWrapperVisitor visitor(isolate);
250 isolate->VisitWeakHandles(&visitor); 249 isolate->VisitWeakHandles(&visitor);
251 } 250 }
252 251
253 void objectGroupingForMajorGC(v8::Isolate* isolate, bool constructRetainedObject Infos) 252 void objectGroupingForMajorGC(v8::Isolate* isolate, bool constructRetainedObject Infos)
254 { 253 {
255 MajorGCWrapperVisitor visitor(isolate, constructRetainedObjectInfos); 254 MajorGCWrapperVisitor visitor(isolate, constructRetainedObjectInfos);
256 v8::V8::VisitHandlesWithClassIds(isolate, &visitor); 255 v8::V8::VisitHandlesWithClassIds(isolate, &visitor);
257 visitor.notifyFinished(); 256 visitor.notifyFinished();
258 } 257 }
(...skipping 24 matching lines...) Expand all
283 } 282 }
284 283
285 // TODO(haraken): It would be nice if the GC callbacks passed the Isolate 284 // TODO(haraken): It would be nice if the GC callbacks passed the Isolate
286 // directly. 285 // directly.
287 v8::Isolate* isolate = v8::Isolate::GetCurrent(); 286 v8::Isolate* isolate = v8::Isolate::GetCurrent();
288 v8::HandleScope scope(isolate); 287 v8::HandleScope scope(isolate);
289 switch (type) { 288 switch (type) {
290 case v8::kGCTypeScavenge: 289 case v8::kGCTypeScavenge:
291 TRACE_EVENT_BEGIN1("devtools.timeline,v8", "MinorGC", "usedHeapSizeBefor e", usedHeapSize(isolate)); 290 TRACE_EVENT_BEGIN1("devtools.timeline,v8", "MinorGC", "usedHeapSizeBefor e", usedHeapSize(isolate));
292 if (isMainThread()) { 291 if (isMainThread()) {
293 { 292 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "DOMMinorGC");
294 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "DOMMinorGC"); 293 }
295 visitWeakHandlesForMinorGC(isolate); 294 visitWeakHandlesForMinorGC(isolate);
296 } 295 if (isMainThread()) {
297 V8PerIsolateData::from(isolate)->setPreviousSamplingState(TRACE_EVEN T_GET_SAMPLING_STATE()); 296 V8PerIsolateData::from(isolate)->setPreviousSamplingState(TRACE_EVEN T_GET_SAMPLING_STATE());
298 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8MinorGC"); 297 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8MinorGC");
299 } 298 }
300 break; 299 break;
301 case v8::kGCTypeMarkSweepCompact: 300 case v8::kGCTypeMarkSweepCompact:
302 TRACE_EVENT_BEGIN2("devtools.timeline,v8", "MajorGC", "usedHeapSizeBefor e", usedHeapSize(isolate), "type", "atomic pause"); 301 TRACE_EVENT_BEGIN2("devtools.timeline,v8", "MajorGC", "usedHeapSizeBefor e", usedHeapSize(isolate), "type", "atomic pause");
303 gcPrologueForMajorGC(isolate, flags & v8::kGCCallbackFlagConstructRetain edObjectInfos); 302 gcPrologueForMajorGC(isolate, flags & v8::kGCCallbackFlagConstructRetain edObjectInfos);
304 break; 303 break;
305 case v8::kGCTypeIncrementalMarking: 304 case v8::kGCTypeIncrementalMarking:
306 TRACE_EVENT_BEGIN2("devtools.timeline,v8", "MajorGC", "usedHeapSizeBefor e", usedHeapSize(isolate), "type", "incremental marking"); 305 TRACE_EVENT_BEGIN2("devtools.timeline,v8", "MajorGC", "usedHeapSizeBefor e", usedHeapSize(isolate), "type", "incremental marking");
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 Visitor* m_visitor; 439 Visitor* m_visitor;
441 }; 440 };
442 441
443 void V8GCController::traceDOMWrappers(v8::Isolate* isolate, Visitor* visitor) 442 void V8GCController::traceDOMWrappers(v8::Isolate* isolate, Visitor* visitor)
444 { 443 {
445 DOMWrapperTracer tracer(visitor); 444 DOMWrapperTracer tracer(visitor);
446 v8::V8::VisitHandlesWithClassIds(isolate, &tracer); 445 v8::V8::VisitHandlesWithClassIds(isolate, &tracer);
447 } 446 }
448 447
449 } // namespace blink 448 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698