Move vmEntryGlobalObject() to VM from CallFrame.
authormark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Aug 2018 22:57:09 +0000 (22:57 +0000)
committermark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Aug 2018 22:57:09 +0000 (22:57 +0000)
commitb991bf74232c5957f4d27422eedc18cb54ebe0dd
tree6b6cd855a06edbdeac55a4651c373e18c633a8d4
parentae2d2218642167cfad1b116e5c17dbcf464709b0
Move vmEntryGlobalObject() to VM from CallFrame.
https://bugs.webkit.org/show_bug.cgi?id=188900
<rdar://problem/43655753>

Reviewed by Michael Saboff.

Source/JavaScriptCore:

Also introduced CallFrame::isGlobalExec() which makes use of one property of
GlobalExecs to identify them i.e. GlobalExecs have null callerFrame and returnPCs.
CallFrame::initGlobalExec() ensures this.

In contrast, normal CallFrames always have a callerFrame (because they must at
least be preceded by a VM EntryFrame) and a returnPC (at least return to the
VM entry glue).

* API/APIUtils.h:
(handleExceptionIfNeeded):
(setException):
* API/JSBase.cpp:
(JSEvaluateScript):
(JSCheckScriptSyntax):
* API/JSContextRef.cpp:
(JSGlobalContextRetain):
(JSGlobalContextRelease):
(JSGlobalContextCopyName):
(JSGlobalContextSetName):
(JSGlobalContextGetRemoteInspectionEnabled):
(JSGlobalContextSetRemoteInspectionEnabled):
(JSGlobalContextGetIncludesNativeCallStackWhenReportingExceptions):
(JSGlobalContextSetIncludesNativeCallStackWhenReportingExceptions):
(JSGlobalContextGetDebuggerRunLoop):
(JSGlobalContextSetDebuggerRunLoop):
(JSGlobalContextGetAugmentableInspectorController):
* API/JSValue.mm:
(reportExceptionToInspector):
* API/glib/JSCClass.cpp:
(jscContextForObject):
* API/glib/JSCContext.cpp:
(jsc_context_evaluate_in_object):
* debugger/Debugger.cpp:
(JSC::Debugger::pauseIfNeeded):
* debugger/DebuggerCallFrame.cpp:
(JSC::DebuggerCallFrame::vmEntryGlobalObject const):
(JSC::DebuggerCallFrame::evaluateWithScopeExtension):
* interpreter/CallFrame.cpp:
(JSC::CallFrame::vmEntryGlobalObject): Deleted.
* interpreter/CallFrame.h:
(JSC::ExecState::scope const):
(JSC::ExecState::noCaller):
(JSC::ExecState::isGlobalExec const):
* interpreter/Interpreter.cpp:
(JSC::notifyDebuggerOfUnwinding):
(JSC::Interpreter::notifyDebuggerOfExceptionToBeThrown):
(JSC::Interpreter::debug):
* runtime/CallData.cpp:
(JSC::profiledCall):
* runtime/Completion.cpp:
(JSC::evaluate):
(JSC::profiledEvaluate):
(JSC::evaluateWithScopeExtension):
(JSC::loadAndEvaluateModule):
(JSC::loadModule):
(JSC::linkAndEvaluateModule):
(JSC::importModule):
* runtime/ConstructData.cpp:
(JSC::profiledConstruct):
* runtime/Error.cpp:
(JSC::getStackTrace):
* runtime/VM.cpp:
(JSC::VM::throwException):
(JSC::VM::vmEntryGlobalObject const):
* runtime/VM.h:

Source/WebCore:

No new tests needed because this patch does not introduce new functionality.

* bindings/js/JSCustomXPathNSResolver.cpp:
(WebCore::JSCustomXPathNSResolver::create):
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::callerGlobalObject):
(WebCore::toJSDOMGlobalObject): Deleted.
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::firstDOMWindow):
* bridge/c/c_utility.cpp:
(JSC::Bindings::convertValueToNPVariant):
* bridge/objc/WebScriptObject.mm:
(WebCore::addExceptionToConsole):
* bridge/objc/objc_instance.mm:
(ObjcInstance::moveGlobalExceptionToExecState):
* bridge/objc/objc_runtime.mm:
(JSC::Bindings::convertValueToObjcObject):
* bridge/objc/objc_utility.mm:
(JSC::Bindings::convertValueToObjcValue):
* testing/Internals.cpp:
(WebCore::Internals::cloneArrayBuffer):

Source/WebKitLegacy/mac:

* WebView/WebScriptDebugger.mm:
(WebScriptDebugger::sourceParsed):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235254 268f45cc-cd09-0410-ab3c-d52691b4dbfc
30 files changed:
Source/JavaScriptCore/API/APIUtils.h
Source/JavaScriptCore/API/JSBase.cpp
Source/JavaScriptCore/API/JSContextRef.cpp
Source/JavaScriptCore/API/JSValue.mm
Source/JavaScriptCore/API/glib/JSCClass.cpp
Source/JavaScriptCore/API/glib/JSCContext.cpp
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/debugger/Debugger.cpp
Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp
Source/JavaScriptCore/interpreter/CallFrame.cpp
Source/JavaScriptCore/interpreter/CallFrame.h
Source/JavaScriptCore/interpreter/Interpreter.cpp
Source/JavaScriptCore/runtime/CallData.cpp
Source/JavaScriptCore/runtime/Completion.cpp
Source/JavaScriptCore/runtime/ConstructData.cpp
Source/JavaScriptCore/runtime/Error.cpp
Source/JavaScriptCore/runtime/VM.cpp
Source/JavaScriptCore/runtime/VM.h
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSCustomXPathNSResolver.cpp
Source/WebCore/bindings/js/JSDOMGlobalObject.cpp
Source/WebCore/bindings/js/JSDOMWindowBase.cpp
Source/WebCore/bridge/c/c_utility.cpp
Source/WebCore/bridge/objc/WebScriptObject.mm
Source/WebCore/bridge/objc/objc_instance.mm
Source/WebCore/bridge/objc/objc_runtime.mm
Source/WebCore/bridge/objc/objc_utility.mm
Source/WebCore/testing/Internals.cpp
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebView/WebScriptDebugger.mm