Commit 4da3e8de authored by weinig@apple.com's avatar weinig@apple.com

Replace ScriptState with JSC::ExecState

https://bugs.webkit.org/show_bug.cgi?id=121336

Reviewed by Darin Adler.

* Modules/indexeddb/IDBCursor.h:
* Modules/indexeddb/IDBObjectStore.h:
* bindings/js/JSInjectedScriptHostCustom.cpp:
* bindings/js/JSInjectedScriptManager.cpp:
* bindings/js/JSNodeCustom.cpp:
* bindings/js/JSNodeFilterCondition.h:
* bindings/js/ScriptController.cpp:
* bindings/js/ScriptDebugServer.cpp:
* bindings/js/ScriptDebugServer.h:
* bindings/js/ScriptEventListener.cpp:
* bindings/js/ScriptEventListener.h:
* bindings/js/ScriptFunctionCall.cpp:
* bindings/js/ScriptFunctionCall.h:
* bindings/js/ScriptObject.cpp:
* bindings/js/ScriptObject.h:
* bindings/js/ScriptProfiler.cpp:
* bindings/js/ScriptProfiler.h:
* bindings/js/ScriptState.cpp:
* bindings/js/ScriptState.h:
* bindings/js/ScriptValue.cpp:
* bindings/js/ScriptValue.h:
* bindings/js/SerializedScriptValue.cpp:
* bindings/js/SerializedScriptValue.h:
* dom/Document.cpp:
* dom/Document.h:
* dom/NodeFilter.cpp:
* dom/NodeFilter.h:
* dom/NodeFilterCondition.cpp:
* dom/NodeFilterCondition.h:
* dom/NodeIterator.cpp:
* dom/NodeIterator.h:
* dom/ScriptExecutionContext.cpp:
* dom/ScriptExecutionContext.h:
* dom/Traversal.cpp:
* dom/Traversal.h:
* dom/TreeWalker.cpp:
* dom/TreeWalker.h:
* inspector/ConsoleMessage.cpp:
* inspector/ConsoleMessage.h:
* inspector/InjectedScript.h:
* inspector/InjectedScriptBase.cpp:
* inspector/InjectedScriptBase.h:
* inspector/InjectedScriptCanvasModule.cpp:
* inspector/InjectedScriptCanvasModule.h:
* inspector/InjectedScriptHost.cpp:
* inspector/InjectedScriptHost.h:
* inspector/InjectedScriptManager.cpp:
* inspector/InjectedScriptManager.h:
* inspector/InjectedScriptModule.cpp:
* inspector/InjectedScriptModule.h:
* inspector/InspectorAgent.cpp:
* inspector/InspectorCanvasAgent.cpp:
* inspector/InspectorCanvasAgent.h:
* inspector/InspectorConsoleAgent.cpp:
* inspector/InspectorConsoleAgent.h:
* inspector/InspectorConsoleInstrumentation.h:
* inspector/InspectorDOMAgent.cpp:
* inspector/InspectorDebuggerAgent.cpp:
* inspector/InspectorDebuggerAgent.h:
* inspector/InspectorFrontendClientLocal.cpp:
* inspector/InspectorFrontendHost.cpp:
* inspector/InspectorIndexedDBAgent.cpp:
* inspector/InspectorInstrumentation.cpp:
* inspector/InspectorInstrumentation.h:
* inspector/PageConsoleAgent.cpp:
* inspector/PageDebuggerAgent.cpp:
* inspector/PageRuntimeAgent.cpp:
* inspector/PageRuntimeAgent.h:
* inspector/ScriptArguments.cpp:
* inspector/ScriptArguments.h:
* inspector/ScriptDebugListener.h:
* inspector/WorkerDebuggerAgent.cpp:
* inspector/WorkerRuntimeAgent.cpp:
* page/Console.cpp:
* page/Console.h:
* page/ContentSecurityPolicy.cpp:
* page/ContentSecurityPolicy.h:
* page/PageConsole.cpp:
* page/PageConsole.h:
* workers/WorkerGlobalScope.cpp:
* workers/WorkerGlobalScope.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155736 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 3c5a96eb
2013-09-13 Sam Weinig <sam@webkit.org>
Replace ScriptState with JSC::ExecState
https://bugs.webkit.org/show_bug.cgi?id=121336
Reviewed by Darin Adler.
* Modules/indexeddb/IDBCursor.h:
* Modules/indexeddb/IDBObjectStore.h:
* bindings/js/JSInjectedScriptHostCustom.cpp:
* bindings/js/JSInjectedScriptManager.cpp:
* bindings/js/JSNodeCustom.cpp:
* bindings/js/JSNodeFilterCondition.h:
* bindings/js/ScriptController.cpp:
* bindings/js/ScriptDebugServer.cpp:
* bindings/js/ScriptDebugServer.h:
* bindings/js/ScriptEventListener.cpp:
* bindings/js/ScriptEventListener.h:
* bindings/js/ScriptFunctionCall.cpp:
* bindings/js/ScriptFunctionCall.h:
* bindings/js/ScriptObject.cpp:
* bindings/js/ScriptObject.h:
* bindings/js/ScriptProfiler.cpp:
* bindings/js/ScriptProfiler.h:
* bindings/js/ScriptState.cpp:
* bindings/js/ScriptState.h:
* bindings/js/ScriptValue.cpp:
* bindings/js/ScriptValue.h:
* bindings/js/SerializedScriptValue.cpp:
* bindings/js/SerializedScriptValue.h:
* dom/Document.cpp:
* dom/Document.h:
* dom/NodeFilter.cpp:
* dom/NodeFilter.h:
* dom/NodeFilterCondition.cpp:
* dom/NodeFilterCondition.h:
* dom/NodeIterator.cpp:
* dom/NodeIterator.h:
* dom/ScriptExecutionContext.cpp:
* dom/ScriptExecutionContext.h:
* dom/Traversal.cpp:
* dom/Traversal.h:
* dom/TreeWalker.cpp:
* dom/TreeWalker.h:
* inspector/ConsoleMessage.cpp:
* inspector/ConsoleMessage.h:
* inspector/InjectedScript.h:
* inspector/InjectedScriptBase.cpp:
* inspector/InjectedScriptBase.h:
* inspector/InjectedScriptCanvasModule.cpp:
* inspector/InjectedScriptCanvasModule.h:
* inspector/InjectedScriptHost.cpp:
* inspector/InjectedScriptHost.h:
* inspector/InjectedScriptManager.cpp:
* inspector/InjectedScriptManager.h:
* inspector/InjectedScriptModule.cpp:
* inspector/InjectedScriptModule.h:
* inspector/InspectorAgent.cpp:
* inspector/InspectorCanvasAgent.cpp:
* inspector/InspectorCanvasAgent.h:
* inspector/InspectorConsoleAgent.cpp:
* inspector/InspectorConsoleAgent.h:
* inspector/InspectorConsoleInstrumentation.h:
* inspector/InspectorDOMAgent.cpp:
* inspector/InspectorDebuggerAgent.cpp:
* inspector/InspectorDebuggerAgent.h:
* inspector/InspectorFrontendClientLocal.cpp:
* inspector/InspectorFrontendHost.cpp:
* inspector/InspectorIndexedDBAgent.cpp:
* inspector/InspectorInstrumentation.cpp:
* inspector/InspectorInstrumentation.h:
* inspector/PageConsoleAgent.cpp:
* inspector/PageDebuggerAgent.cpp:
* inspector/PageRuntimeAgent.cpp:
* inspector/PageRuntimeAgent.h:
* inspector/ScriptArguments.cpp:
* inspector/ScriptArguments.h:
* inspector/ScriptDebugListener.h:
* inspector/WorkerDebuggerAgent.cpp:
* inspector/WorkerRuntimeAgent.cpp:
* page/Console.cpp:
* page/Console.h:
* page/ContentSecurityPolicy.cpp:
* page/ContentSecurityPolicy.h:
* page/PageConsole.cpp:
* page/PageConsole.h:
* workers/WorkerGlobalScope.cpp:
* workers/WorkerGlobalScope.h:
2013-09-13 Sam Weinig <sam@webkit.org>
Chrome, DragController and FocusController should hold onto a Page&
......@@ -68,7 +68,7 @@ public:
const ScriptValue& value() const;
IDBAny* source() const;
PassRefPtr<IDBRequest> update(ScriptState*, ScriptValue&, ExceptionCode&);
PassRefPtr<IDBRequest> update(JSC::ExecState*, ScriptValue&, ExceptionCode&);
void advance(unsigned long, ExceptionCode&);
// FIXME: Try to modify the code generator so this overload is unneeded.
void continueFunction(ScriptExecutionContext*, ExceptionCode& ec) { continueFunction(static_cast<IDBKey*>(0), ec); }
......
......@@ -65,8 +65,8 @@ public:
PassRefPtr<IDBTransaction> transaction() const { return m_transaction; }
bool autoIncrement() const { return m_metadata.autoIncrement; }
PassRefPtr<IDBRequest> add(ScriptState*, ScriptValue&, ExceptionCode&);
PassRefPtr<IDBRequest> put(ScriptState*, ScriptValue&, ExceptionCode&);
PassRefPtr<IDBRequest> add(JSC::ExecState*, ScriptValue&, ExceptionCode&);
PassRefPtr<IDBRequest> put(JSC::ExecState*, ScriptValue&, ExceptionCode&);
PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext* context, ExceptionCode& ec) { return openCursor(context, static_cast<IDBKeyRange*>(0), ec); }
PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionCode& ec) { return openCursor(context, keyRange, IDBCursor::directionNext(), ec); }
PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext* context, const ScriptValue& key, ExceptionCode& ec) { return openCursor(context, key, IDBCursor::directionNext(), ec); }
......@@ -76,8 +76,8 @@ public:
PassRefPtr<IDBRequest> get(ScriptExecutionContext*, const ScriptValue& key, ExceptionCode&);
PassRefPtr<IDBRequest> get(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, ExceptionCode&);
PassRefPtr<IDBRequest> add(ScriptState*, ScriptValue&, const ScriptValue& key, ExceptionCode&);
PassRefPtr<IDBRequest> put(ScriptState*, ScriptValue&, const ScriptValue& key, ExceptionCode&);
PassRefPtr<IDBRequest> add(JSC::ExecState*, ScriptValue&, const ScriptValue& key, ExceptionCode&);
PassRefPtr<IDBRequest> put(JSC::ExecState*, ScriptValue&, const ScriptValue& key, ExceptionCode&);
PassRefPtr<IDBRequest> deleteFunction(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, ExceptionCode&);
PassRefPtr<IDBRequest> deleteFunction(ScriptExecutionContext*, const ScriptValue& key, ExceptionCode&);
PassRefPtr<IDBRequest> clear(ScriptExecutionContext*, ExceptionCode&);
......@@ -94,8 +94,8 @@ public:
PassRefPtr<IDBRequest> count(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, ExceptionCode&);
PassRefPtr<IDBRequest> count(ScriptExecutionContext*, const ScriptValue& key, ExceptionCode&);
PassRefPtr<IDBRequest> put(IDBDatabaseBackendInterface::PutMode, PassRefPtr<IDBAny> source, ScriptState*, ScriptValue&, const ScriptValue& key, ExceptionCode&);
PassRefPtr<IDBRequest> put(IDBDatabaseBackendInterface::PutMode, PassRefPtr<IDBAny> source, ScriptState*, ScriptValue&, PassRefPtr<IDBKey>, ExceptionCode&);
PassRefPtr<IDBRequest> put(IDBDatabaseBackendInterface::PutMode, PassRefPtr<IDBAny> source, JSC::ExecState*, ScriptValue&, const ScriptValue& key, ExceptionCode&);
PassRefPtr<IDBRequest> put(IDBDatabaseBackendInterface::PutMode, PassRefPtr<IDBAny> source, JSC::ExecState*, ScriptValue&, PassRefPtr<IDBKey>, ExceptionCode&);
void markDeleted() { m_deleted = true; }
void transactionFinished();
......
......@@ -49,11 +49,11 @@ public:
{
if (m_scriptExecutionContext->isDocument()) {
Document* document = toDocument(m_scriptExecutionContext);
m_exec = scriptStateFromPage(mainThreadNormalWorld(), document->page());
m_exec = execStateFromPage(mainThreadNormalWorld(), document->page());
} else {
#if ENABLE(WORKERS)
WorkerGlobalScope* workerGlobalScope = static_cast<WorkerGlobalScope*>(m_scriptExecutionContext);
m_exec = scriptStateFromWorkerGlobalScope(workerGlobalScope);
m_exec = execStateFromWorkerGlobalScope(workerGlobalScope);
#endif
}
}
......
......@@ -76,7 +76,7 @@ Node* InjectedScriptHost::scriptValueAsNode(ScriptValue value)
return toNode(value.jsValue());
}
ScriptValue InjectedScriptHost::nodeAsScriptValue(ScriptState* state, Node* node)
ScriptValue InjectedScriptHost::nodeAsScriptValue(JSC::ExecState* state, Node* node)
{
if (!shouldAllowAccessToNode(state, node))
return ScriptValue(state->vm(), jsNull());
......
......@@ -50,7 +50,7 @@ using namespace JSC;
namespace WebCore {
ScriptObject InjectedScriptManager::createInjectedScript(const String& source, ScriptState* scriptState, int id)
ScriptObject InjectedScriptManager::createInjectedScript(const String& source, JSC::ExecState* scriptState, int id)
{
JSLockHolder lock(scriptState);
......@@ -86,7 +86,7 @@ ScriptObject InjectedScriptManager::createInjectedScript(const String& source, S
return ScriptObject();
}
bool InjectedScriptManager::canAccessInspectedWindow(ScriptState* scriptState)
bool InjectedScriptManager::canAccessInspectedWindow(JSC::ExecState* scriptState)
{
JSLockHolder lock(scriptState);
JSDOMWindow* inspectedWindow = toJSDOMWindow(scriptState->lexicalGlobalObject());
......
......@@ -276,7 +276,7 @@ JSValue toJSNewlyCreated(ExecState* exec, JSDOMGlobalObject* globalObject, Node*
void willCreatePossiblyOrphanedTreeByRemovalSlowCase(Node* root)
{
ScriptState* scriptState = mainWorldScriptState(root->document().frame());
JSC::ExecState* scriptState = mainWorldExecState(root->document().frame());
if (!scriptState)
return;
......
......@@ -42,7 +42,7 @@ namespace WebCore {
private:
JSNodeFilterCondition(JSC::VM&, NodeFilter* owner, JSC::JSValue filter);
virtual short acceptNode(ScriptState*, Node*) const;
virtual short acceptNode(JSC::ExecState*, Node*) const;
class WeakOwner : public JSC::WeakHandleOwner {
virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
......
......@@ -338,7 +338,7 @@ void ScriptController::collectIsolatedContexts(Vector<std::pair<JSC::ExecState*,
for (ShellMap::iterator iter = m_windowShells.begin(); iter != m_windowShells.end(); ++iter) {
JSC::ExecState* exec = iter->value->window()->globalExec();
SecurityOrigin* origin = iter->value->window()->impl()->document()->securityOrigin();
result.append(std::pair<ScriptState*, SecurityOrigin*>(exec, origin));
result.append(std::pair<JSC::ExecState*, SecurityOrigin*>(exec, origin));
}
}
......
......@@ -304,7 +304,7 @@ void ScriptDebugServer::dispatchDidPause(ScriptDebugListener* listener)
{
ASSERT(m_paused);
JSGlobalObject* globalObject = m_currentCallFrame->scopeChain()->globalObject();
ScriptState* state = globalObject->globalExec();
JSC::ExecState* state = globalObject->globalExec();
JSValue jsCallFrame;
{
if (m_currentCallFrame->isValid() && globalObject->inherits(JSDOMGlobalObject::info())) {
......@@ -574,7 +574,7 @@ void ScriptDebugServer::recompileAllJSFunctionsSoon()
m_recompileTimer.startOneShot(0);
}
void ScriptDebugServer::compileScript(ScriptState*, const String&, const String&, String*, String*)
void ScriptDebugServer::compileScript(JSC::ExecState*, const String&, const String&, String*, String*)
{
// FIXME(89652): implement this.
}
......@@ -584,7 +584,7 @@ void ScriptDebugServer::clearCompiledScripts()
// FIXME(89652): implement this.
}
void ScriptDebugServer::runScript(ScriptState*, const String&, ScriptValue*, bool*, String*)
void ScriptDebugServer::runScript(JSC::ExecState*, const String&, ScriptValue*, bool*, String*)
{
// FIXME(89652): implement this.
}
......
......@@ -98,9 +98,9 @@ public:
bool isPaused() { return m_paused; }
bool runningNestedMessageLoop() { return m_runningNestedMessageLoop; }
void compileScript(ScriptState*, const String& expression, const String& sourceURL, String* scriptId, String* exceptionMessage);
void compileScript(JSC::ExecState*, const String& expression, const String& sourceURL, String* scriptId, String* exceptionMessage);
void clearCompiledScripts();
void runScript(ScriptState*, const String& scriptId, ScriptValue* result, bool* wasThrown, String* exceptionMessage);
void runScript(JSC::ExecState*, const String& scriptId, ScriptValue* result, bool* wasThrown, String* exceptionMessage);
class Task {
WTF_MAKE_FAST_ALLOCATED;
......
......@@ -103,7 +103,7 @@ String eventListenerHandlerBody(Document* document, EventListener* eventListener
JSC::JSObject* jsFunction = jsListener->jsFunction(document);
if (!jsFunction)
return "";
ScriptState* scriptState = scriptStateFromNode(jsListener->isolatedWorld(), document);
JSC::ExecState* scriptState = execStateFromNode(jsListener->isolatedWorld(), document);
return jsFunction->toString(scriptState)->value(scriptState);
}
......@@ -120,7 +120,7 @@ ScriptValue eventListenerHandler(Document* document, EventListener* eventListene
return ScriptValue(*jsListener->isolatedWorld()->vm(), jsFunction);
}
ScriptState* eventListenerHandlerScriptState(Frame* frame, EventListener* eventListener)
JSC::ExecState* eventListenerHandlerScriptState(Frame* frame, EventListener* eventListener)
{
const JSEventListener* jsListener = JSEventListener::cast(eventListener);
ASSERT(jsListener);
......
......@@ -49,7 +49,7 @@ namespace WebCore {
PassRefPtr<JSLazyEventListener> createAttributeEventListener(Frame*, const QualifiedName&, const AtomicString& value);
String eventListenerHandlerBody(Document*, EventListener*);
ScriptValue eventListenerHandler(Document*, EventListener*);
ScriptState* eventListenerHandlerScriptState(Frame*, EventListener*);
JSC::ExecState* eventListenerHandlerScriptState(Frame*, EventListener*);
bool eventListenerHandlerLocation(Document*, EventListener*, String& sourceName, String& scriptId, int& lineNumber);
} // namespace WebCore
......
......@@ -190,7 +190,7 @@ ScriptObject ScriptFunctionCall::construct(bool& hadException, bool reportExcept
return ScriptObject(m_exec, asObject(result));
}
ScriptCallback::ScriptCallback(ScriptState* state, const ScriptValue& function)
ScriptCallback::ScriptCallback(JSC::ExecState* state, const ScriptValue& function)
: ScriptCallArgumentHandler(state)
, m_function(function)
{
......
......@@ -46,7 +46,7 @@ namespace WebCore {
class ScriptCallArgumentHandler {
public:
ScriptCallArgumentHandler(ScriptState* state) : m_exec(state) { }
ScriptCallArgumentHandler(JSC::ExecState* state) : m_exec(state) { }
void appendArgument(const ScriptObject&);
void appendArgument(const ScriptValue&);
......@@ -62,7 +62,7 @@ namespace WebCore {
protected:
JSC::MarkedArgumentBuffer m_arguments;
ScriptState* m_exec;
JSC::ExecState* m_exec;
private:
// MarkedArgumentBuffer must be stack allocated, so prevent heap
......@@ -85,7 +85,7 @@ namespace WebCore {
class ScriptCallback : public ScriptCallArgumentHandler {
public:
ScriptCallback(ScriptState*, const ScriptValue&);
ScriptCallback(JSC::ExecState*, const ScriptValue&);
ScriptValue call();
......
......@@ -44,19 +44,19 @@ using namespace JSC;
namespace WebCore {
ScriptObject::ScriptObject(ScriptState* scriptState, JSObject* object)
ScriptObject::ScriptObject(JSC::ExecState* scriptState, JSObject* object)
: ScriptValue(scriptState->vm(), object)
, m_scriptState(scriptState)
{
}
ScriptObject::ScriptObject(ScriptState* scriptState, const ScriptValue& scriptValue)
ScriptObject::ScriptObject(JSC::ExecState* scriptState, const ScriptValue& scriptValue)
: ScriptValue(scriptState->vm(), scriptValue.jsValue())
, m_scriptState(scriptState)
{
}
static bool handleException(ScriptState* scriptState)
static bool handleException(JSC::ExecState* scriptState)
{
if (!scriptState->hadException())
return true;
......@@ -65,7 +65,7 @@ static bool handleException(ScriptState* scriptState)
return false;
}
bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, const ScriptObject& value)
bool ScriptGlobalObject::set(JSC::ExecState* scriptState, const char* name, const ScriptObject& value)
{
JSLockHolder lock(scriptState);
scriptState->lexicalGlobalObject()->putDirect(scriptState->vm(), Identifier(scriptState, name), value.jsObject());
......@@ -73,7 +73,7 @@ bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, const S
}
#if ENABLE(INSPECTOR)
bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, InspectorFrontendHost* value)
bool ScriptGlobalObject::set(JSC::ExecState* scriptState, const char* name, InspectorFrontendHost* value)
{
JSLockHolder lock(scriptState);
JSDOMGlobalObject* globalObject = jsCast<JSDOMGlobalObject*>(scriptState->lexicalGlobalObject());
......@@ -81,7 +81,7 @@ bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, Inspect
return handleException(scriptState);
}
bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, InjectedScriptHost* value)
bool ScriptGlobalObject::set(JSC::ExecState* scriptState, const char* name, InjectedScriptHost* value)
{
JSLockHolder lock(scriptState);
JSDOMGlobalObject* globalObject = jsCast<JSDOMGlobalObject*>(scriptState->lexicalGlobalObject());
......@@ -90,7 +90,7 @@ bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, Injecte
}
#endif // ENABLE(INSPECTOR)
bool ScriptGlobalObject::get(ScriptState* scriptState, const char* name, ScriptObject& value)
bool ScriptGlobalObject::get(JSC::ExecState* scriptState, const char* name, ScriptObject& value)
{
JSLockHolder lock(scriptState);
JSValue jsValue = scriptState->lexicalGlobalObject()->get(scriptState, Identifier(scriptState, name));
......@@ -104,7 +104,7 @@ bool ScriptGlobalObject::get(ScriptState* scriptState, const char* name, ScriptO
return true;
}
bool ScriptGlobalObject::remove(ScriptState* scriptState, const char* name)
bool ScriptGlobalObject::remove(JSC::ExecState* scriptState, const char* name)
{
JSLockHolder lock(scriptState);
scriptState->lexicalGlobalObject()->methodTable()->deleteProperty(scriptState->lexicalGlobalObject(), scriptState, Identifier(scriptState, name));
......
......@@ -43,25 +43,25 @@ namespace WebCore {
class ScriptObject : public ScriptValue {
public:
ScriptObject(ScriptState*, JSC::JSObject*);
ScriptObject(ScriptState*, const ScriptValue&);
ScriptObject(JSC::ExecState*, JSC::JSObject*);
ScriptObject(JSC::ExecState*, const ScriptValue&);
ScriptObject() : m_scriptState(0) { }
JSC::JSObject* jsObject() const { return asObject(jsValue()); }
ScriptState* scriptState() const { return m_scriptState; }
JSC::ExecState* scriptState() const { return m_scriptState; }
protected:
ScriptState* m_scriptState;
JSC::ExecState* m_scriptState;
};
class ScriptGlobalObject {
public:
static bool set(ScriptState*, const char* name, const ScriptObject&);
static bool set(JSC::ExecState*, const char* name, const ScriptObject&);
#if ENABLE(INSPECTOR)
static bool set(ScriptState*, const char* name, InspectorFrontendHost*);
static bool set(ScriptState*, const char* name, InjectedScriptHost*);
static bool set(JSC::ExecState*, const char* name, InspectorFrontendHost*);
static bool set(JSC::ExecState*, const char* name, InjectedScriptHost*);
#endif
static bool get(ScriptState*, const char* name, ScriptObject&);
static bool remove(ScriptState*, const char* name);
static bool get(JSC::ExecState*, const char* name, ScriptObject&);
static bool remove(JSC::ExecState*, const char* name);
private:
ScriptGlobalObject() { }
};
......
......@@ -57,7 +57,7 @@ unsigned ScriptProfiler::getHeapObjectId(const ScriptValue&)
return 0;
}
void ScriptProfiler::start(ScriptState* state, const String& title)
void ScriptProfiler::start(JSC::ExecState* state, const String& title)
{
JSC::LegacyProfiler::profiler()->startProfiling(state, title);
}
......@@ -71,11 +71,11 @@ void ScriptProfiler::startForPage(Page* inspectedPage, const String& title)
#if ENABLE(WORKERS)
void ScriptProfiler::startForWorkerGlobalScope(WorkerGlobalScope* context, const String& title)
{
start(scriptStateFromWorkerGlobalScope(context), title);
start(execStateFromWorkerGlobalScope(context), title);
}
#endif
PassRefPtr<ScriptProfile> ScriptProfiler::stop(ScriptState* state, const String& title)
PassRefPtr<ScriptProfile> ScriptProfiler::stop(JSC::ExecState* state, const String& title)
{
RefPtr<JSC::Profile> profile = JSC::LegacyProfiler::profiler()->stopProfiling(state, title);
return ScriptProfile::create(profile);
......@@ -90,7 +90,7 @@ PassRefPtr<ScriptProfile> ScriptProfiler::stopForPage(Page* inspectedPage, const
#if ENABLE(WORKERS)
PassRefPtr<ScriptProfile> ScriptProfiler::stopForWorkerGlobalScope(WorkerGlobalScope* context, const String& title)
{
return stop(scriptStateFromWorkerGlobalScope(context), title);
return stop(execStateFromWorkerGlobalScope(context), title);
}
#endif
......
......@@ -59,12 +59,12 @@ public:
static void collectGarbage();
static ScriptObject objectByHeapObjectId(unsigned id);
static unsigned getHeapObjectId(const ScriptValue&);
static void start(ScriptState* state, const String& title);
static void start(JSC::ExecState*, const String& title);
static void startForPage(Page*, const String& title);
#if ENABLE(WORKERS)
static void startForWorkerGlobalScope(WorkerGlobalScope*, const String& title);
#endif
static PassRefPtr<ScriptProfile> stop(ScriptState* state, const String& title);
static PassRefPtr<ScriptProfile> stop(JSC::ExecState*, const String& title);
static PassRefPtr<ScriptProfile> stopForPage(Page*, const String& title);
#if ENABLE(WORKERS)
static PassRefPtr<ScriptProfile> stopForWorkerGlobalScope(WorkerGlobalScope*, const String& title);
......
......@@ -49,7 +49,7 @@
namespace WebCore {
DOMWindow* domWindowFromScriptState(ScriptState* scriptState)
DOMWindow* domWindowFromExecState(JSC::ExecState* scriptState)
{
JSC::JSGlobalObject* globalObject = scriptState->lexicalGlobalObject();
if (!globalObject->inherits(JSDOMWindowBase::info()))
......@@ -57,7 +57,7 @@ DOMWindow* domWindowFromScriptState(ScriptState* scriptState)
return JSC::jsCast<JSDOMWindowBase*>(globalObject)->impl();
}
ScriptExecutionContext* scriptExecutionContextFromScriptState(ScriptState* scriptState)
ScriptExecutionContext* scriptExecutionContextFromExecState(JSC::ExecState* scriptState)
{
JSC::JSGlobalObject* globalObject = scriptState->lexicalGlobalObject();
if (!globalObject->inherits(JSDOMGlobalObject::info()))
......@@ -65,7 +65,7 @@ ScriptExecutionContext* scriptExecutionContextFromScriptState(ScriptState* scrip
return JSC::jsCast<JSDOMGlobalObject*>(globalObject)->scriptExecutionContext();
}
ScriptState* mainWorldScriptState(Frame* frame)
JSC::ExecState* mainWorldExecState(Frame* frame)
{
if (!frame)
return 0;
......@@ -73,7 +73,7 @@ ScriptState* mainWorldScriptState(Frame* frame)
return shell->window()->globalExec();
}
ScriptState* scriptStateFromNode(DOMWrapperWorld* world, Node* node)
JSC::ExecState* execStateFromNode(DOMWrapperWorld* world, Node* node)
{
if (!node)
return 0;
......@@ -85,13 +85,13 @@ ScriptState* scriptStateFromNode(DOMWrapperWorld* world, Node* node)
return frame->script().globalObject(world)->globalExec();
}
ScriptState* scriptStateFromPage(DOMWrapperWorld* world, Page* page)
JSC::ExecState* execStateFromPage(DOMWrapperWorld* world, Page* page)
{
return page->mainFrame().script().globalObject(world)->globalExec();
}
#if ENABLE(WORKERS)
ScriptState* scriptStateFromWorkerGlobalScope(WorkerGlobalScope* workerGlobalScope)
JSC::ExecState* execStateFromWorkerGlobalScope(WorkerGlobalScope* workerGlobalScope)
{
return workerGlobalScope->script()->workerGlobalScopeWrapper()->globalExec();
}
......
......@@ -52,16 +52,16 @@ class WorkerGlobalScope;
// For now, the separation is purely by convention.
typedef JSC::ExecState ScriptState;
DOMWindow* domWindowFromScriptState(ScriptState*);
ScriptExecutionContext* scriptExecutionContextFromScriptState(ScriptState*);
DOMWindow* domWindowFromExecState(ScriptState*);
ScriptExecutionContext* scriptExecutionContextFromExecState(JSC::ExecState*);
ScriptState* mainWorldScriptState(Frame*);
JSC::ExecState* mainWorldExecState(Frame*);
ScriptState* scriptStateFromNode(DOMWrapperWorld*, Node*);
ScriptState* scriptStateFromPage(DOMWrapperWorld*, Page*);
JSC::ExecState* execStateFromNode(DOMWrapperWorld*, Node*);
JSC::ExecState* execStateFromPage(DOMWrapperWorld*, Page*);
#if ENABLE(WORKERS)
ScriptState* scriptStateFromWorkerGlobalScope(WorkerGlobalScope*);
JSC::ExecState* execStateFromWorkerGlobalScope(WorkerGlobalScope*);
#endif
} // namespace WebCore
......
......@@ -44,7 +44,7 @@ using namespace JSC;
namespace WebCore {
bool ScriptValue::getString(ScriptState* scriptState, String& result) const
bool ScriptValue::getString(JSC::ExecState* scriptState, String& result) const
{
if (!m_value)
return false;
......@@ -54,7 +54,7 @@ bool ScriptValue::getString(ScriptState* scriptState, String& result) const
return true;
}
String ScriptValue::toString(ScriptState* scriptState) const
String ScriptValue::toString(JSC::ExecState* scriptState) const
{
String result = m_value.get().toString(scriptState)->value(scriptState);
// Handle the case where an exception is thrown as part of invoking toString on the object.
......@@ -63,7 +63,7 @@ String ScriptValue::toString(ScriptState* scriptState) const
return result;
}
bool ScriptValue::isEqual(ScriptState* scriptState, const ScriptValue& anotherValue) const
bool ScriptValue::isEqual(JSC::ExecState* scriptState, const ScriptValue& anotherValue) const
{
if (hasNoValue())
return anotherValue.hasNoValue();
......@@ -98,25 +98,25 @@ bool ScriptValue::isFunction() const
return getCallData(m_value.get(), callData) != CallTypeNone;
}
PassRefPtr<SerializedScriptValue> ScriptValue::serialize(ScriptState* scriptState, SerializationErrorMode throwExceptions)
PassRefPtr<SerializedScriptValue> ScriptValue::serialize(JSC::ExecState* scriptState, SerializationErrorMode throwExceptions)
{
return SerializedScriptValue::create(scriptState, jsValue(), 0, 0, throwExceptions);
}
PassRefPtr<SerializedScriptValue> ScriptValue::serialize(ScriptState* scriptState, MessagePortArray* messagePorts, ArrayBufferArray* arrayBuffers, bool& didThrow)
PassRefPtr<SerializedScriptValue> ScriptValue::serialize(JSC::ExecState* scriptState, MessagePortArray* messagePorts, ArrayBufferArray* arrayBuffers, bool& didThrow)
{
RefPtr<SerializedScriptValue> serializedValue = SerializedScriptValue::create(scriptState, jsValue(), messagePorts, arrayBuffers);
didThrow = scriptState->hadException();
return serializedValue.release();
}
ScriptValue ScriptValue::deserialize(ScriptState* scriptState, SerializedScriptValue* value, SerializationErrorMode throwExceptions)
ScriptValue ScriptValue::deserialize(JSC::ExecState* scriptState, SerializedScriptValue* value, SerializationErrorMode throwExceptions)
{
return ScriptValue(scriptState->vm(), value->deserialize(scriptState, scriptState->lexicalGlobalObject(), 0, throwExceptions));
}
#if ENABLE(INSPECTOR)
static PassRefPtr<InspectorValue> jsToInspectorValue(ScriptState* scriptState, JSValue value, int maxDepth)
static PassRefPtr<InspectorValue> jsToInspectorValue(JSC::ExecState* scriptState, JSValue value, int maxDepth)
{
if (!value) {
ASSERT_NOT_REACHED();
......@@ -169,7 +169,7 @@ static PassRefPtr<InspectorValue> jsToInspectorValue(ScriptState* scriptState, J
return 0;
}
PassRefPtr<InspectorValue> ScriptValue::toInspectorValue(ScriptState* scriptState) const
PassRefPtr<InspectorValue> ScriptValue::toInspectorValue(JSC::ExecState* scriptState) const
{
JSC::JSLockHolder holder(scriptState);
return jsToInspectorValue(scriptState, m_value.get(), InspectorValue::maxDepth);
......
......@@ -52,9 +52,9 @@ public:
virtual ~ScriptValue() {}
JSC::JSValue jsValue() const { return m_value.get(); }
bool getString(ScriptState*, String& result) const;
String toString(ScriptState*) const;
bool isEqual(ScriptState*, const ScriptValue&) const;
bool getString(JSC::ExecState*, String& result) const;
String toString(JSC::ExecState*) const;
bool isEqual(JSC::ExecState*, const ScriptValue&) const;
bool isNull() const;
bool isUndefined() const;