Changeset 126098 in webkit
- Timestamp:
- Aug 20, 2012 5:02:03 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r126096 r126098 1 2012-08-20 Kentaro Hara <haraken@chromium.org> 2 3 [V8] Move collectGarbage() from ScriptController to V8GCController 4 https://bugs.webkit.org/show_bug.cgi?id=94455 5 6 Reviewed by Adam Barth. 7 8 - This patch moves collectGarbage() from ScriptController to V8GCController. 9 - This patch makes collectGarbage() a static method. 10 - This patch removes ScriptController::lowMemoryNotification() 11 since it is not used at all. 12 13 No tests. No change in behavior. 14 15 * bindings/v8/ScriptController.cpp: 16 * bindings/v8/ScriptController.h: 17 * bindings/v8/V8GCController.cpp: 18 (WebCore::V8GCController::collectGarbage): 19 (WebCore): 20 * bindings/v8/V8GCController.h: 21 (V8GCController): 22 1 23 2012-08-20 Kentaro Hara <haraken@chromium.org> 2 24 -
trunk/Source/WebCore/bindings/v8/ScriptController.cpp
r126096 r126098 345 345 } 346 346 347 void ScriptController::collectGarbage()348 {349 v8::HandleScope handleScope;350 351 v8::Persistent<v8::Context> v8Context = v8::Context::New();352 if (v8Context.IsEmpty())353 return;354 {355 v8::Context::Scope scope(v8Context);356 v8::Local<v8::String> source = v8::String::New("if (gc) gc();");357 v8::Local<v8::String> name = v8::String::New("gc");358 v8::Handle<v8::Script> script = v8::Script::Compile(source, name);359 if (!script.IsEmpty()) {360 V8RecursionScope::MicrotaskSuppression scope;361 script->Run();362 }363 }364 v8Context.Dispose();365 }366 367 void ScriptController::lowMemoryNotification()368 {369 v8::V8::LowMemoryNotification();370 }371 372 347 bool ScriptController::haveInterpreter() const 373 348 { -
trunk/Source/WebCore/bindings/v8/ScriptController.h
r126086 r126098 120 120 ScriptController* existingWindowShell(DOMWrapperWorld*) { return this; } 121 121 122 void collectGarbage();123 124 // Notify V8 that the system is running low on memory.125 void lowMemoryNotification();126 127 122 // Creates a property of the global object of a frame. 128 123 void bindToWindowObject(Frame*, const String& key, NPObject*); -
trunk/Source/WebCore/bindings/v8/V8GCController.cpp
r125491 r126098 49 49 #include "V8DOMImplementation.h" 50 50 #include "V8MessagePort.h" 51 #include "V8RecursionScope.h" 51 52 #include "V8StyleSheet.h" 52 53 #include "V8StyleSheetList.h" … … 531 532 } 532 533 534 void V8GCController::collectGarbage() 535 { 536 v8::HandleScope handleScope; 537 538 v8::Persistent<v8::Context> context = v8::Context::New(); 539 if (context.IsEmpty()) 540 return; 541 { 542 v8::Context::Scope scope(context); 543 v8::Local<v8::String> source = v8::String::New("if (gc) gc();"); 544 v8::Local<v8::String> name = v8::String::New("gc"); 545 v8::Handle<v8::Script> script = v8::Script::Compile(source, name); 546 if (!script.IsEmpty()) { 547 V8RecursionScope::MicrotaskSuppression scope; 548 script->Run(); 549 } 550 } 551 context.Dispose(); 552 } 553 533 554 } // namespace WebCore -
trunk/Source/WebCore/bindings/v8/V8GCController.h
r125491 r126098 78 78 static void checkMemoryUsage(); 79 79 static void collectGarbageIfNecessary(); 80 static void collectGarbage(); 80 81 81 82 private: -
trunk/Source/WebKit/chromium/ChangeLog
r126095 r126098 1 2012-08-20 Kentaro Hara <haraken@chromium.org> 2 3 [V8] Move collectGarbage() from ScriptController to V8GCController 4 https://bugs.webkit.org/show_bug.cgi?id=94455 5 6 Reviewed by Adam Barth. 7 8 - This patch moves collectGarbage() from ScriptController to V8GCController. 9 - This patch makes collectGarbage() a static method. 10 - This patch removes ScriptController::lowMemoryNotification() 11 since it is not used at all. 12 13 No tests. No change in behavior. 14 15 * src/WebFrameImpl.cpp: 16 (WebKit::WebFrameImpl::collectGarbage): 17 1 18 2012-08-20 Adam Barth <abarth@webkit.org> 2 19 -
trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp
r126083 r126098 195 195 #include "V8DOMFileSystem.h" 196 196 #include "V8FileEntry.h" 197 #include "V8GCController.h" 197 198 #include <public/WebFileSystem.h> 198 199 #endif … … 899 900 // FIXME: Move this to the ScriptController and make it JS neutral. 900 901 #if USE(V8) 901 m_frame->script()->collectGarbage();902 V8GCController::collectGarbage(); 902 903 #else 903 904 notImplemented();
Note: See TracChangeset
for help on using the changeset viewer.