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

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

Issue 1386453003: Oilpan: Force a page navigation GC before starting a V8 GC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 | « no previous file | third_party/WebKit/Source/platform/heap/ThreadState.h » ('j') | 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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8MajorGC"); 369 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8MajorGC");
370 } else { 370 } else {
371 objectGroupingForMajorGC(isolate, constructRetainedObjectInfos); 371 objectGroupingForMajorGC(isolate, constructRetainedObjectInfos);
372 } 372 }
373 } 373 }
374 374
375 } 375 }
376 376
377 void V8GCController::gcPrologue(v8::GCType type, v8::GCCallbackFlags flags) 377 void V8GCController::gcPrologue(v8::GCType type, v8::GCCallbackFlags flags)
378 { 378 {
379 // Finish Oilpan's complete sweeping before running a V8 GC.
380 // This will let the GC collect more V8 objects.
381 //
382 // TODO(haraken): It's a bit too late for a major GC to schedule
383 // completeSweep() here, because gcPrologue for a major GC is called
384 // not at the point where the major GC started but at the point where
385 // the major GC requests object grouping.
386 if (ThreadState::current()) 379 if (ThreadState::current())
387 ThreadState::current()->completeSweep(); 380 ThreadState::current()->willStartV8GC();
388 381
389 if (isMainThread()) { 382 if (isMainThread()) {
390 ScriptForbiddenScope::enter(); 383 ScriptForbiddenScope::enter();
391 } 384 }
392 385
393 // TODO(haraken): It would be nice if the GC callbacks passed the Isolate 386 // TODO(haraken): It would be nice if the GC callbacks passed the Isolate
394 // directly. 387 // directly.
395 v8::Isolate* isolate = v8::Isolate::GetCurrent(); 388 v8::Isolate* isolate = v8::Isolate::GetCurrent();
396 v8::HandleScope scope(isolate); 389 v8::HandleScope scope(isolate);
397 switch (type) { 390 switch (type) {
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 Visitor* m_visitor; 541 Visitor* m_visitor;
549 }; 542 };
550 543
551 void V8GCController::traceDOMWrappers(v8::Isolate* isolate, Visitor* visitor) 544 void V8GCController::traceDOMWrappers(v8::Isolate* isolate, Visitor* visitor)
552 { 545 {
553 DOMWrapperTracer tracer(visitor); 546 DOMWrapperTracer tracer(visitor);
554 v8::V8::VisitHandlesWithClassIds(isolate, &tracer); 547 v8::V8::VisitHandlesWithClassIds(isolate, &tracer);
555 } 548 }
556 549
557 } // namespace blink 550 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/heap/ThreadState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698