-
ggaren@apple.com authored
Reviewed by Beth Dakin. Reversed the ownership relationship between Interpreter and JSGlobalObject. Now, the JSGlobalObject owns the Interpreter, and top-level objects that need the two to persist just protect the JSGlobalObject from GC. Global object bootstrapping looks a little odd right now, but it will make much more sense soon, after further rounds of refactoring. * bindings/runtime_root.h: Made this class inherit from RefCounted, to avoid code duplication. * kjs/collector.cpp: (KJS::Collector::collect): No need to give special GC treatment to Interpreters, since we mark their global objects, which mark them. * kjs/interpreter.cpp: (KJS::Interpreter::mark): No need to mark our global object, since it marks us. * kjs/interpreter.h: Don't inherit from RefCounted -- JSGlobalObject owns us directly. * kjs/testkjs.cpp: Modified to follow the new rules. (createGlobalObject): (runWithScripts): JavaScriptGlue: Reviewed by Beth Dakin. Modified to follow new JSGlobalObject/Interpreter ownership rules in JavaScriptCore. * JSRun.cpp: (JSRun::JSRun): (JSRun::GetInterpreter): (JSRun::Evaluate): (JSRun::CheckSyntax): * JSRun.h: * JSValueWrapper.cpp: (unprotectGlobalObject): (initializeGlobalObjectKey): (getThreadGlobalExecState): WebCore: Reviewed by Beth Dakin. Modified WebCore to follow the new JSGlobalObject/Interpreter ownership rules in JavaScriptCore. * bindings/js/kjs_binding.cpp: * bindings/js/kjs_binding.h: Removed stale, unused interpreterForGlobalObject(). * bindings/js/kjs_proxy.cpp: Changed to store a global object, rather than an interpreter. (WebCore::KJSProxy::finishedWithEvent): Need to NULL check m_globalObject here because we no longer unnecessarily instantiate it. * bindings/js/kjs_window.cpp: (KJS::ScheduledAction::execute): * bindings/js/kjs_window.h: Removed redundant and less efficient interpreter() function -- global objects have direct access to their interpreters now. Changed these functions to pass around JSGlobalObjects instead of Interpreters: * page/Frame.cpp: (WebCore::Frame::bindingRootObject): (WebCore::Frame::createRootObject): * page/Frame.h: * page/mac/WebCoreFrameBridge.mm: (createRootObject): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@28309 268f45cc-cd09-0410-ab3c-d52691b4dbfc
41893215