OLD | NEW |
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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 // the DOM objects are not collected forever. (Note that | 450 // the DOM objects are not collected forever. (Note that |
451 // Oilpan's GC is not triggered unless Oilpan's heap gets full.) | 451 // Oilpan's GC is not triggered unless Oilpan's heap gets full.) |
452 // (6) V8 hits OOM. | 452 // (6) V8 hits OOM. |
453 ThreadState::current()->setGCRequested(); | 453 ThreadState::current()->setGCRequested(); |
454 } | 454 } |
455 } | 455 } |
456 | 456 |
457 void V8GCController::collectGarbage(v8::Isolate* isolate) | 457 void V8GCController::collectGarbage(v8::Isolate* isolate) |
458 { | 458 { |
459 v8::HandleScope handleScope(isolate); | 459 v8::HandleScope handleScope(isolate); |
460 RefPtr<ScriptState> scriptState = ScriptState::create(v8::Context::New(isola
te), DOMWrapperWorld::create()); | 460 RefPtr<ScriptState> scriptState = ScriptState::create(v8::Context::New(isola
te), DOMWrapperWorld::create(isolate)); |
461 ScriptState::Scope scope(scriptState.get()); | 461 ScriptState::Scope scope(scriptState.get()); |
462 V8ScriptRunner::compileAndRunInternalScript(v8String(isolate, "if (gc) gc();
"), isolate); | 462 V8ScriptRunner::compileAndRunInternalScript(v8String(isolate, "if (gc) gc();
"), isolate); |
463 scriptState->disposePerContextData(); | 463 scriptState->disposePerContextData(); |
464 } | 464 } |
465 | 465 |
466 void V8GCController::reportDOMMemoryUsageToV8(v8::Isolate* isolate) | 466 void V8GCController::reportDOMMemoryUsageToV8(v8::Isolate* isolate) |
467 { | 467 { |
468 if (!isMainThread()) | 468 if (!isMainThread()) |
469 return; | 469 return; |
470 | 470 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 Visitor* m_visitor; | 502 Visitor* m_visitor; |
503 }; | 503 }; |
504 | 504 |
505 void V8GCController::traceDOMWrappers(v8::Isolate* isolate, Visitor* visitor) | 505 void V8GCController::traceDOMWrappers(v8::Isolate* isolate, Visitor* visitor) |
506 { | 506 { |
507 DOMWrapperTracer tracer(visitor); | 507 DOMWrapperTracer tracer(visitor); |
508 v8::V8::VisitHandlesWithClassIds(isolate, &tracer); | 508 v8::V8::VisitHandlesWithClassIds(isolate, &tracer); |
509 } | 509 } |
510 | 510 |
511 } // namespace blink | 511 } // namespace blink |
OLD | NEW |