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

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

Issue 747363005: Oilpan: Introduce a state transition model for Oilpan GC states (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/platform/heap/Heap.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 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 // (2) X's DOM wrapper is created. 444 // (2) X's DOM wrapper is created.
445 // (3) The DOM wrapper becomes unreachable. 445 // (3) The DOM wrapper becomes unreachable.
446 // (4) V8 triggers a GC. The V8's GC collects the DOM wrapper. 446 // (4) V8 triggers a GC. The V8's GC collects the DOM wrapper.
447 // However, X is not collected until a next Oilpan's GC is 447 // However, X is not collected until a next Oilpan's GC is
448 // triggered. 448 // triggered.
449 // (5) If a lot of such DOM objects are created, we end up with 449 // (5) If a lot of such DOM objects are created, we end up with
450 // a situation where V8's GC collects the DOM wrappers but 450 // a situation where V8's GC collects the DOM wrappers but
451 // the DOM objects are not collected forever. (Note that 451 // the DOM objects are not collected forever. (Note that
452 // Oilpan's GC is not triggered unless Oilpan's heap gets full.) 452 // Oilpan's GC is not triggered unless Oilpan's heap gets full.)
453 // (6) V8 hits OOM. 453 // (6) V8 hits OOM.
454 ThreadState::current()->setGCRequested(); 454 ThreadState::current()->requestGC();
455 } 455 }
456 } 456 }
457 457
458 void V8GCController::collectGarbage(v8::Isolate* isolate) 458 void V8GCController::collectGarbage(v8::Isolate* isolate)
459 { 459 {
460 v8::HandleScope handleScope(isolate); 460 v8::HandleScope handleScope(isolate);
461 RefPtr<ScriptState> scriptState = ScriptState::create(v8::Context::New(isola te), DOMWrapperWorld::create(isolate)); 461 RefPtr<ScriptState> scriptState = ScriptState::create(v8::Context::New(isola te), DOMWrapperWorld::create(isolate));
462 ScriptState::Scope scope(scriptState.get()); 462 ScriptState::Scope scope(scriptState.get());
463 V8ScriptRunner::compileAndRunInternalScript(v8String(isolate, "if (gc) gc(); "), isolate); 463 V8ScriptRunner::compileAndRunInternalScript(v8String(isolate, "if (gc) gc(); "), isolate);
464 scriptState->disposePerContextData(); 464 scriptState->disposePerContextData();
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 Visitor* m_visitor; 503 Visitor* m_visitor;
504 }; 504 };
505 505
506 void V8GCController::traceDOMWrappers(v8::Isolate* isolate, Visitor* visitor) 506 void V8GCController::traceDOMWrappers(v8::Isolate* isolate, Visitor* visitor)
507 { 507 {
508 DOMWrapperTracer tracer(visitor); 508 DOMWrapperTracer tracer(visitor);
509 v8::V8::VisitHandlesWithClassIds(isolate, &tracer); 509 v8::V8::VisitHandlesWithClassIds(isolate, &tracer);
510 } 510 }
511 511
512 } // namespace blink 512 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/platform/heap/Heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698