Changeset 28309 in webkit
- Timestamp:
- Dec 1, 2007 3:56:56 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/JSContextRef.cpp
r27885 r28309 63 63 JSLock lock; 64 64 ExecState* exec = toJS(ctx); 65 exec->dynamicInterpreter()->ref();65 gcProtect(exec->dynamicInterpreter()->globalObject()); 66 66 return ctx; 67 67 } … … 71 71 JSLock lock; 72 72 ExecState* exec = toJS(ctx); 73 exec->dynamicInterpreter()->deref();73 gcUnprotect(exec->dynamicInterpreter()->globalObject()); 74 74 } 75 75 -
trunk/JavaScriptCore/ChangeLog
r28272 r28309 1 2007-11-30 Geoffrey Garen <ggaren@apple.com> 2 3 Reviewed by Beth Dakin. 4 5 Reversed the ownership relationship between Interpreter and JSGlobalObject. 6 Now, the JSGlobalObject owns the Interpreter, and top-level objects 7 that need the two to persist just protect the JSGlobalObject from GC. 8 9 Global object bootstrapping looks a little odd right now, but it will 10 make much more sense soon, after further rounds of refactoring. 11 12 * bindings/runtime_root.h: Made this class inherit from RefCounted, 13 to avoid code duplication. 14 15 * kjs/collector.cpp: 16 (KJS::Collector::collect): No need to give special GC treatment to 17 Interpreters, since we mark their global objects, which mark them. 18 19 * kjs/interpreter.cpp: 20 (KJS::Interpreter::mark): No need to mark our global object, since it 21 marks us. 22 * kjs/interpreter.h: Don't inherit from RefCounted -- JSGlobalObject 23 owns us directly. 24 25 * kjs/testkjs.cpp: Modified to follow the new rules. 26 (createGlobalObject): 27 (runWithScripts): 28 1 29 2007-11-30 Brent Fulgham <bfulgham@gmail.com> 2 30 -
trunk/JavaScriptCore/JavaScriptCore.exp
r28110 r28309 187 187 __ZN3KJS8Bindings10RootObject17_createRootObjectE 188 188 __ZN3KJS8Bindings10RootObject19setCreateRootObjectEPFN3WTF10PassRefPtrIS1_EEPvE 189 __ZN3KJS8Bindings10RootObject6createEPKv N3WTF10PassRefPtrINS_11InterpreterEEE189 __ZN3KJS8Bindings10RootObject6createEPKvPNS_14JSGlobalObjectE 190 190 __ZN3KJS8Bindings10RootObject9gcProtectEPNS_8JSObjectE 191 191 __ZN3KJS8Bindings10RootObjectD1Ev -
trunk/JavaScriptCore/bindings/jni/jni_jsobject.h
r27373 r28309 30 30 31 31 #include <JavaVM/jni.h> 32 #include <wtf/RefPtr.h> 32 33 33 34 #define jlong_to_ptr(a) ((void*)(uintptr_t)(a)) -
trunk/JavaScriptCore/bindings/runtime_root.cpp
r23538 r28309 26 26 #include "runtime_root.h" 27 27 28 #include "JSGlobalObject.h" 28 29 #include "object.h" 29 30 #include "runtime.h" 30 31 #include "runtime_object.h" 31 32 32 #include <wtf/HashCountedSet.h> 33 33 #include <wtf/HashSet.h> … … 196 196 #endif 197 197 198 PassRefPtr<RootObject> RootObject::create(const void* nativeHandle, PassRefPtr<Interpreter> interpreter) 199 { 200 return new RootObject(nativeHandle, interpreter); 201 } 202 203 RootObject::RootObject(const void* nativeHandle, PassRefPtr<Interpreter> interpreter) 204 : m_refCount(0) 205 , m_isValid(true) 198 PassRefPtr<RootObject> RootObject::create(const void* nativeHandle, JSGlobalObject* globalObject) 199 { 200 return new RootObject(nativeHandle, globalObject); 201 } 202 203 RootObject::RootObject(const void* nativeHandle, JSGlobalObject* globalObject) 204 : m_isValid(true) 206 205 , m_nativeHandle(nativeHandle) 207 , m_ interpreter(interpreter)208 { 209 ASSERT( m_interpreter);206 , m_globalObject(globalObject) 207 { 208 ASSERT(globalObject); 210 209 rootObjectSet()->add(this); 211 210 } … … 233 232 234 233 m_nativeHandle = 0; 235 m_ interpreter= 0;234 m_globalObject = 0; 236 235 237 236 ProtectCountSet::iterator end = m_protectCountSet.end(); … … 285 284 { 286 285 ASSERT(m_isValid); 287 return m_ interpreter.get();286 return m_globalObject->interpreter(); 288 287 } 289 288 -
trunk/JavaScriptCore/bindings/runtime_root.h
r23538 r28309 27 27 #define RUNTIME_ROOT_H_ 28 28 29 #include "interpreter.h"30 29 #if PLATFORM(MAC) 31 30 #include "jni_jsobject.h" … … 35 34 #include <wtf/HashSet.h> 36 35 #include <wtf/Noncopyable.h> 36 #include <wtf/RefCounted.h> 37 37 38 38 namespace KJS { 39 39 40 class Interpreter; 41 class JSGlobalObject; 40 42 class RuntimeObjectImp; 41 43 42 44 namespace Bindings { 43 45 … … 50 52 extern RootObject* findRootObject(Interpreter*); 51 53 52 class RootObject : Noncopyable53 { 54 friend class JavaJSObject; 54 class RootObject : public RefCounted<RootObject> { 55 friend class JavaJSObject; 56 55 57 public: 56 static PassRefPtr<RootObject> create(const void* nativeHandle, PassRefPtr<Interpreter> interpreter); 57 58 void ref() { m_refCount++; } 59 void deref() 60 { 61 if (--m_refCount == 0) 62 delete this; 63 } 58 ~RootObject(); 59 60 static PassRefPtr<RootObject> create(const void* nativeHandle, JSGlobalObject*); 64 61 65 62 bool isValid() { return m_isValid; } … … 89 86 void removeRuntimeObject(RuntimeObjectImp*); 90 87 private: 91 RootObject(const void* nativeHandle, PassRefPtr<Interpreter> interpreter); 92 ~RootObject(); 88 RootObject(const void* nativeHandle, JSGlobalObject*); 93 89 94 unsigned m_refCount;95 90 bool m_isValid; 96 91 97 92 const void* m_nativeHandle; 98 RefPtr<Interpreter> m_interpreter;93 ProtectedPtr<JSGlobalObject> m_globalObject; 99 94 ProtectCountSet m_protectCountSet; 100 95 -
trunk/JavaScriptCore/kjs/JSGlobalObject.h
r27022 r28309 2 2 /* 3 3 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2007 Apple Ince. All rights reserved. 4 5 * 5 6 * This library is free software; you can redistribute it and/or … … 26 27 27 28 namespace KJS { 29 28 30 class Interpreter; 31 29 32 class JSGlobalObject : public JSObject { 30 33 public: 31 34 JSGlobalObject() { } 32 35 JSGlobalObject(JSValue* proto) : JSObject(proto) { } 33 36 34 37 virtual bool isGlobalObject() const { return true; } 35 36 Interpreter* interpreter() const { return m_interpreter; } 37 void setInterpreter(Interpreter* i) { m_interpreter = i; } 38 39 virtual void mark() 40 { 41 JSObject::mark(); 42 m_interpreter->mark(); 43 } 44 45 Interpreter* interpreter() const { return m_interpreter.get(); } 46 void setInterpreter(std::auto_ptr<Interpreter> i) { m_interpreter = i; } 47 38 48 private: 39 Interpreter*m_interpreter;49 std::auto_ptr<Interpreter> m_interpreter; 40 50 }; 51 41 52 } // namespace KJS 42 53 -
trunk/JavaScriptCore/kjs/collector.cpp
r28223 r28309 941 941 #endif 942 942 943 if (Interpreter::s_hook) {944 Interpreter* scr = Interpreter::s_hook;945 do {946 scr->mark();947 scr = scr->next;948 } while (scr != Interpreter::s_hook);949 }950 951 943 markStackObjectsConservatively(); 952 944 markProtectedObjects(); -
trunk/JavaScriptCore/kjs/interpreter.cpp
r28110 r28309 257 257 { 258 258 ASSERT(m_globalObject); 259 m_globalObject->setInterpreter( this);259 m_globalObject->setInterpreter(std::auto_ptr<Interpreter>(this)); 260 260 261 261 // Set global object prototype … … 553 553 m_globalExec.exception()->mark(); 554 554 555 if (m_globalObject && !m_globalObject->marked())556 m_globalObject->mark();557 558 555 if (m_Object && !m_Object->marked()) 559 556 m_Object->mark(); -
trunk/JavaScriptCore/kjs/interpreter.h
r28110 r28309 77 77 * " Object" and "Number". 78 78 */ 79 class Interpreter : public RefCounted<Interpreter>{79 class Interpreter { 80 80 friend class Collector; 81 81 public: -
trunk/JavaScriptCore/kjs/testkjs.cpp
r27885 r28309 222 222 } 223 223 224 static PassRefPtr<Interpreter> setupInterpreter() 225 { 226 GlobalImp* global = new GlobalImp(); 227 RefPtr<Interpreter> interp = new Interpreter(); 228 interp->setGlobalObject(global); 224 static GlobalImp* createGlobalObject() 225 { 226 GlobalImp* global = new GlobalImp; 227 Interpreter* interp = new Interpreter; 228 interp->setGlobalObject(global); // global now owns interp. 229 229 230 // add debug() function 230 231 global->put(interp->globalExec(), "debug", new TestFunctionImp(TestFunctionImp::Debug, 1)); … … 241 242 242 243 Interpreter::setShouldPrintExceptions(true); 243 return interp.release();244 return global; 244 245 } 245 246 … … 261 262 static bool runWithScripts(const Vector<UString>& fileNames, bool prettyPrint) 262 263 { 263 RefPtr<Interpreter> interp = setupInterpreter();264 GlobalImp* globalObject = createGlobalObject(); 264 265 Vector<char> script; 265 266 … … 275 276 prettyPrintScript(fileName, script); 276 277 else { 277 Completion completion = interp->evaluate(fileName, 0, script.data());278 Completion completion = globalObject->interpreter()->evaluate(fileName, 0, script.data()); 278 279 success = success && completion.complType() != Throw; 279 280 } -
trunk/JavaScriptGlue/ChangeLog
r28137 r28309 1 2007-11-30 Geoffrey Garen <ggaren@apple.com> 2 3 Reviewed by Beth Dakin. 4 5 Modified to follow new JSGlobalObject/Interpreter ownership rules 6 in JavaScriptCore. 7 8 * JSRun.cpp: 9 (JSRun::JSRun): 10 (JSRun::GetInterpreter): 11 (JSRun::Evaluate): 12 (JSRun::CheckSyntax): 13 * JSRun.h: 14 * JSValueWrapper.cpp: 15 (unprotectGlobalObject): 16 (initializeGlobalObjectKey): 17 (getThreadGlobalExecState): 18 1 19 2007-11-29 Mark Rowe <mrowe@apple.com> 2 20 -
trunk/JavaScriptGlue/JSRun.cpp
r27023 r28309 34 34 fSource(CFStringToUString(source)), 35 35 fGlobalObject(new JSGlobalObject()), 36 fInterpreter(new JSInterpreter(fGlobalObject, inFlags)),37 36 fFlags(inFlags) 38 37 { 38 Interpreter* interpreter = new JSInterpreter(fGlobalObject, inFlags); 39 interpreter->setGlobalObject(fGlobalObject); // fGlobalObject now owns interpreter 39 40 } 40 41 … … 60 61 JSInterpreter* JSRun::GetInterpreter() 61 62 { 62 return fInterpreter.get();63 return static_cast<JSInterpreter*>(fGlobalObject->interpreter()); 63 64 } 64 65 65 66 Completion JSRun::Evaluate() 66 67 { 67 return f Interpreter->evaluate(UString(), 0, fSource.data(), fSource.size());68 return fGlobalObject->interpreter()->evaluate(UString(), 0, fSource.data(), fSource.size()); 68 69 } 69 70 70 71 bool JSRun::CheckSyntax() 71 72 { 72 return f Interpreter->checkSyntax(UString(), 0, fSource.data(), fSource.size()).complType() != Throw;73 return fGlobalObject->interpreter()->checkSyntax(UString(), 0, fSource.data(), fSource.size()).complType() != Throw; 73 74 } -
trunk/JavaScriptGlue/JSRun.h
r27951 r28309 61 61 UString fSource; 62 62 ProtectedPtr<JSGlobalObject> fGlobalObject; 63 RefPtr<JSInterpreter> fInterpreter;64 63 JSFlags fFlags; 65 64 }; -
trunk/JavaScriptGlue/JSValueWrapper.cpp
r28137 r28309 29 29 #include "config.h" 30 30 #include "JSValueWrapper.h" 31 #include "JSRun.h" 31 32 #include <JavaScriptCore/PropertyNameArray.h> 32 33 #include <pthread.h> … … 61 62 */ 62 63 63 pthread_key_t interpreterKey;64 pthread_once_t interpreterKeyOnce = PTHREAD_ONCE_INIT;65 66 static void derefInterpreter(void* data)67 { 68 static_cast<Interpreter*>(data)->deref();69 } 70 71 static void initialize InterpreterKey()72 { 73 pthread_key_create(& interpreterKey, derefInterpreter);64 pthread_key_t globalObjectKey; 65 pthread_once_t globalObjectKeyOnce = PTHREAD_ONCE_INIT; 66 67 static void unprotectGlobalObject(void* data) 68 { 69 gcUnprotect(static_cast<JSGlobalObject*>(data)); 70 } 71 72 static void initializeGlobalObjectKey() 73 { 74 pthread_key_create(&globalObjectKey, unprotectGlobalObject); 74 75 } 75 76 76 77 static ExecState* getThreadGlobalExecState() 77 78 { 78 pthread_once(&interpreterKeyOnce, initializeInterpreterKey); 79 Interpreter* interpreter = static_cast<Interpreter*>(pthread_getspecific(interpreterKey)); 80 if (!interpreter) { 81 interpreter = new Interpreter(); 82 interpreter->setGlobalObject(new JSGlobalObject()); 83 interpreter->ref(); 84 pthread_setspecific(interpreterKey, interpreter); 85 } 79 pthread_once(&globalObjectKeyOnce, initializeGlobalObjectKey); 80 JSGlobalObject* globalObject = static_cast<JSGlobalObject*>(pthread_getspecific(globalObjectKey)); 81 if (!globalObject) { 82 globalObject = new JSGlobalObject; 83 Interpreter* interpreter = new JSInterpreter; 84 interpreter->setGlobalObject(globalObject); // globalObject now owns interpreter 85 86 gcProtect(globalObject); 87 pthread_setspecific(globalObjectKey, globalObject); 88 } 89 90 ExecState* exec = globalObject->interpreter()->globalExec(); 86 91 87 92 // Discard exceptions -- otherwise an exception would forestall JS 88 93 // evaluation throughout the thread 89 interpreter->globalExec()->clearException(); 90 91 return interpreter->globalExec(); 94 exec->clearException(); 95 return exec; 92 96 } 93 97 -
trunk/WebCore/ChangeLog
r28304 r28309 1 2007-11-30 Geoffrey Garen <ggaren@apple.com> 2 3 Reviewed by Beth Dakin. 4 5 Modified WebCore to follow the new JSGlobalObject/Interpreter ownership 6 rules in JavaScriptCore. 7 8 * bindings/js/kjs_binding.cpp: 9 * bindings/js/kjs_binding.h: Removed stale, unused 10 interpreterForGlobalObject(). 11 12 * bindings/js/kjs_proxy.cpp: Changed to store a global object, rather 13 than an interpreter. 14 (WebCore::KJSProxy::finishedWithEvent): Need to NULL check 15 m_globalObject here because we no longer unnecessarily instantiate it. 16 17 * bindings/js/kjs_window.cpp: 18 (KJS::ScheduledAction::execute): 19 * bindings/js/kjs_window.h: Removed redundant and less efficient 20 interpreter() function -- global objects have direct access to their 21 interpreters now. 22 23 Changed these functions to pass around JSGlobalObjects instead of 24 Interpreters: 25 26 * page/Frame.cpp: 27 (WebCore::Frame::bindingRootObject): 28 (WebCore::Frame::createRootObject): 29 * page/Frame.h: 30 * page/mac/WebCoreFrameBridge.mm: 31 (createRootObject): 32 1 33 2007-12-01 Darin Adler <darin@apple.com> 2 34 -
trunk/WebCore/bindings/js/kjs_binding.cpp
r28110 r28309 288 288 } 289 289 290 Interpreter* ScriptInterpreter::interpreterForGlobalObject(const JSValue* imp)291 {292 const Window* win = static_cast<const Window*>(imp);293 return win->interpreter();294 }295 296 290 bool ScriptInterpreter::shouldInterruptScript() const 297 291 { -
trunk/WebCore/bindings/js/kjs_binding.h
r28110 r28309 105 105 106 106 virtual bool isGlobalObject(JSValue*); 107 virtual Interpreter* interpreterForGlobalObject(const JSValue*);108 107 virtual bool isSafeScript(const Interpreter* target); 109 108 -
trunk/WebCore/bindings/js/kjs_proxy.cpp
r27108 r28309 43 43 44 44 KJSProxy::KJSProxy(Frame* frame) 45 : m_frame(frame) 46 , m_handlerLineno(0) 45 47 { 46 m_frame = frame;47 m_handlerLineno = 0;48 48 } 49 49 … … 52 52 // Check for <rdar://problem/4876466>. In theory, no JS should be executing 53 53 // in our interpreter. 54 ASSERT(!m_ script || !m_script->currentExec());54 ASSERT(!m_globalObject || !m_globalObject->interpreter()->currentExec()); 55 55 56 if (m_ script) {57 m_ script = 0;56 if (m_globalObject) { 57 m_globalObject = 0; 58 58 59 59 // It's likely that destroying the interpreter has created a lot of garbage. … … 74 74 bool inlineCode = filename.isNull(); 75 75 76 m_script->setInlineCode(inlineCode); 76 ScriptInterpreter* interpreter = static_cast<ScriptInterpreter*>(m_globalObject->interpreter()); 77 ExecState* exec = interpreter->globalExec(); 78 79 interpreter->setInlineCode(inlineCode); 77 80 78 81 JSLock lock; … … 84 87 JSValue* thisNode = KJS::Window::retrieve(m_frame); 85 88 86 m_script->startTimeoutCheck();87 Completion comp = m_script->evaluate(filename, baseLine, reinterpret_cast<const KJS::UChar*>(str.characters()), str.length(), thisNode);88 m_script->stopTimeoutCheck();89 interpreter->startTimeoutCheck(); 90 Completion comp = interpreter->evaluate(filename, baseLine, reinterpret_cast<const KJS::UChar*>(str.characters()), str.length(), thisNode); 91 interpreter->stopTimeoutCheck(); 89 92 90 93 if (comp.complType() == Normal || comp.complType() == ReturnValue) … … 92 95 93 96 if (comp.complType() == Throw) { 94 UString errorMessage = comp.value()->toString( m_script->globalExec());95 int lineNumber = comp.value()->toObject( m_script->globalExec())->get(m_script->globalExec(), "line")->toInt32(m_script->globalExec());96 UString sourceURL = comp.value()->toObject( m_script->globalExec())->get(m_script->globalExec(), "sourceURL")->toString(m_script->globalExec());97 UString errorMessage = comp.value()->toString(exec); 98 int lineNumber = comp.value()->toObject(exec)->get(exec, "line")->toInt32(exec); 99 UString sourceURL = comp.value()->toObject(exec)->get(exec, "sourceURL")->toString(exec); 97 100 if (Page* page = m_frame->page()) 98 101 page->chrome()->addMessageToConsole(JSMessageSource, ErrorMessageLevel, errorMessage, lineNumber, sourceURL); … … 106 109 // We have to keep it, so that the KJS::Window object for the frame remains the same. 107 110 // (we used to delete and re-create it, previously) 108 if (m_script) { 109 KJS::Window *win = KJS::Window::retrieveWindow(m_frame); 110 if (win) 111 win->clear(); 112 } 111 if (m_globalObject) 112 m_globalObject->clear(); 113 113 } 114 114 … … 135 135 // e.g. an image load or mouse move. Once the event has been dispatched, it is forgotten 136 136 // by the DOM implementation and so does not need to be cached still by the interpreter 137 m_script->forgetDOMObject(event); 137 if (!m_globalObject) 138 return; 139 static_cast<ScriptInterpreter*>(m_globalObject->interpreter())->forgetDOMObject(event); 138 140 } 139 141 … … 141 143 { 142 144 initScriptIfNeeded(); 143 ASSERT(m_ script);144 return m_script.get();145 ASSERT(m_globalObject); 146 return static_cast<ScriptInterpreter*>(m_globalObject->interpreter()); 145 147 } 146 148 147 149 void KJSProxy::initScriptIfNeeded() 148 150 { 149 if (m_ script)151 if (m_globalObject) 150 152 return; 151 153 152 154 // Build the global object - which is a Window instance 153 155 JSLock lock; 154 JSDOMWindow* globalObject = new JSDOMWindow(m_frame->domWindow()); 155 156 // Create a KJS interpreter for this frame 157 m_script = new ScriptInterpreter(globalObject, m_frame); 156 157 m_globalObject = new JSDOMWindow(m_frame->domWindow()); 158 ScriptInterpreter* interpreter = new ScriptInterpreter(m_globalObject, m_frame); // m_globalObject now owns interpreter 158 159 159 160 String userAgent = m_frame->loader()->userAgent(m_frame->document() ? m_frame->document()->URL() : KURL()); 160 161 if (userAgent.find("Microsoft") >= 0 || userAgent.find("MSIE") >= 0) 161 m_script->setCompatMode(Interpreter::IECompat);162 interpreter->setCompatMode(Interpreter::IECompat); 162 163 else 163 164 // If we find "Mozilla" but not "(compatible, ...)" we are a real Netscape 164 165 if (userAgent.find("Mozilla") >= 0 && userAgent.find("compatible") == -1) 165 m_script->setCompatMode(Interpreter::NetscapeCompat);166 interpreter->setCompatMode(Interpreter::NetscapeCompat); 166 167 167 168 m_frame->loader()->dispatchWindowObjectAvailable(); … … 170 171 void KJSProxy::clearDocumentWrapper() 171 172 { 172 if (!m_ script)173 if (!m_globalObject) 173 174 return; 174 175 175 176 JSLock lock; 176 m_ script->globalObject()->removeDirect("document");177 m_globalObject->removeDirect("document"); 177 178 } 178 179 179 } 180 } // namespace WebCore -
trunk/WebCore/bindings/js/kjs_proxy.h
r26074 r28309 22 22 #define kjs_proxy_h 23 23 24 #include <kjs/protect.h> 24 25 #include <wtf/RefPtr.h> 25 26 … … 34 35 class EventListener; 35 36 class Frame; 37 class JSDOMWindow; 36 38 class Node; 37 39 class String; 40 41 // FIXME: Rename this class to JSController and merge functions from 42 // ScriptInterpreter into it. 38 43 39 44 class KJSProxy { … … 54 59 void initScriptIfNeeded(); 55 60 56 bool haveInterpreter() const { return m_ script; }61 bool haveInterpreter() const { return m_globalObject; } 57 62 58 63 void clearDocumentWrapper(); 59 64 60 65 private: 61 RefPtr<KJS::ScriptInterpreter> m_script;66 KJS::ProtectedPtr<JSDOMWindow> m_globalObject; 62 67 Frame* m_frame; 63 68 int m_handlerLineno; -
trunk/WebCore/bindings/js/kjs_window.cpp
r28300 r28309 248 248 for (; i1 != e1; ++i1) 249 249 i1->second->clearWindowObj(); 250 }251 252 ScriptInterpreter* Window::interpreter() const253 {254 Frame* frame = impl()->frame();255 if (!frame)256 return 0;257 258 return frame->scriptProxy()->interpreter();259 250 } 260 251 … … 1664 1655 return; 1665 1656 1666 RefPtr<ScriptInterpreter>interpreter = scriptProxy->interpreter();1657 ScriptInterpreter* interpreter = scriptProxy->interpreter(); 1667 1658 1668 1659 interpreter->setProcessingTimerCallback(true); -
trunk/WebCore/bindings/js/kjs_window.h
r28110 r28309 104 104 void timerFired(DOMWindowTimer*); 105 105 106 KJS::ScriptInterpreter *interpreter() const;107 108 106 bool isSafeScript(ExecState*) const; 109 107 static bool isSafeScript(const ScriptInterpreter *origin, const ScriptInterpreter *target); -
trunk/WebCore/page/Frame.cpp
r28066 r28309 1111 1111 if (!d->m_bindingRootObject) { 1112 1112 JSLock lock; 1113 d->m_bindingRootObject = KJS::Bindings::RootObject::create(0, scriptProxy()->interpreter() );1113 d->m_bindingRootObject = KJS::Bindings::RootObject::create(0, scriptProxy()->interpreter()->globalObject()); 1114 1114 } 1115 1115 return d->m_bindingRootObject.get(); 1116 1116 } 1117 1117 1118 PassRefPtr<KJS::Bindings::RootObject> Frame::createRootObject(void* nativeHandle, PassRefPtr<KJS::Interpreter> interpreter)1118 PassRefPtr<KJS::Bindings::RootObject> Frame::createRootObject(void* nativeHandle, KJS::JSGlobalObject* globalObject) 1119 1119 { 1120 1120 RootObjectMap::iterator it = d->m_rootObjects.find(nativeHandle); … … 1122 1122 return it->second; 1123 1123 1124 RefPtr<KJS::Bindings::RootObject> rootObject = KJS::Bindings::RootObject::create(nativeHandle, interpreter);1124 RefPtr<KJS::Bindings::RootObject> rootObject = KJS::Bindings::RootObject::create(nativeHandle, globalObject); 1125 1125 1126 1126 d->m_rootObjects.set(nativeHandle, rootObject); -
trunk/WebCore/page/Frame.h
r27776 r28309 42 42 43 43 namespace KJS { 44 44 45 class Interpreter; 46 class JSGlobalObject; 47 45 48 namespace Bindings { 46 49 class Instance; 47 50 class RootObject; 48 51 } 52 49 53 } 50 54 … … 170 174 KJS::Bindings::RootObject* bindingRootObject(); 171 175 172 PassRefPtr<KJS::Bindings::RootObject> createRootObject(void* nativeHandle, PassRefPtr<KJS::Interpreter>);176 PassRefPtr<KJS::Bindings::RootObject> createRootObject(void* nativeHandle, KJS::JSGlobalObject*); 173 177 174 178 #if PLATFORM(MAC) -
trunk/WebCore/page/mac/WebCoreFrameBridge.mm
r27873 r28309 131 131 132 132 Frame* frame = [bridge _frame]; 133 return frame->createRootObject(nativeHandle, frame->scriptProxy()->interpreter() );133 return frame->createRootObject(nativeHandle, frame->scriptProxy()->interpreter()->globalObject()); 134 134 } 135 135
Note: See TracChangeset
for help on using the changeset viewer.