Use one object instead of two for closures, eliminating ScopeChainNode
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Aug 2012 22:50:00 +0000 (22:50 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Aug 2012 22:50:00 +0000 (22:50 +0000)
commit73c9089033c84c059283a44d6dc6457321dcee50
tree3425604122e035714a8ddee75b49ab048033c8c8
parent069548f1b41d167734342792fb51b1681d37c466
Use one object instead of two for closures, eliminating ScopeChainNode
https://bugs.webkit.org/show_bug.cgi?id=95501

Reviewed by Filip Pizlo.

../JavaScriptCore:

This patch removes ScopeChainNode, and moves all the data and related
functions that used to be in ScopeChainNode into JSScope.

Most of this patch is mechanical changes to use a JSScope* where we used
to use a ScopeChainNode*. I've only specifically commented about items
that were non-mechanical.

* runtime/Completion.cpp:
(JSC::evaluate):
* runtime/Completion.h: Don't require an explicit scope chain argument
when evaluating code. Clients never wanted anything other than the
global scope, and other arbitrary scopes probably wouldn't work
correctly, anyway.

* runtime/JSScope.cpp:
* runtime/JSScope.h:
(JSC::JSScope::JSScope): JSScope now requires the data we used to pass to
ScopeChainNode, so it can link itself into the scope chain correctly.

* runtime/JSWithScope.h:
(JSC::JSWithScope::create):
(JSC::JSWithScope::JSWithScope): JSWithScope gets an extra constructor
for specifically supplying your own scope chain. The DOM needs this
interface for setting up the scope chain for certain event handlers.
Other clients always just push the JSWithScope to the head of the current
scope chain.

../WebCore:

Mechanical changes to update for JSC interface changes.

../WebKit/mac:

Mechanical change to update for JSC interface change.

../WebKit/qt:

Mechanical change to update for JSC interface change.

* Api/qwebelement.cpp:
(QWebElement::evaluateJavaScript):

../WebKit2:

Mechanical changes to update for JSC interface change.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@127202 268f45cc-cd09-0410-ab3c-d52691b4dbfc
125 files changed:
Source/JavaScriptCore/API/JSBase.cpp
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/GNUmakefile.list.am
Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/Target.pri
Source/JavaScriptCore/bytecode/CodeBlock.cpp
Source/JavaScriptCore/bytecode/CodeBlock.h
Source/JavaScriptCore/bytecode/EvalCodeCache.h
Source/JavaScriptCore/bytecode/Operands.h
Source/JavaScriptCore/bytecode/StructureStubInfo.cpp
Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
Source/JavaScriptCore/debugger/Debugger.cpp
Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp
Source/JavaScriptCore/debugger/DebuggerCallFrame.h
Source/JavaScriptCore/dfg/DFGByteCodeCache.h
Source/JavaScriptCore/dfg/DFGDriver.cpp
Source/JavaScriptCore/dfg/DFGOperations.cpp
Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
Source/JavaScriptCore/heap/HeapTimer.cpp
Source/JavaScriptCore/heap/IncrementalSweeper.cpp
Source/JavaScriptCore/heap/JITStubRoutineSet.cpp
Source/JavaScriptCore/heap/MarkStack.cpp
Source/JavaScriptCore/heap/MarkedBlock.cpp
Source/JavaScriptCore/heap/MarkedSpace.cpp
Source/JavaScriptCore/heap/WeakBlock.cpp
Source/JavaScriptCore/interpreter/AbstractPC.cpp
Source/JavaScriptCore/interpreter/CachedCall.h
Source/JavaScriptCore/interpreter/CallFrame.cpp
Source/JavaScriptCore/interpreter/CallFrame.h
Source/JavaScriptCore/interpreter/CallFrameClosure.h
Source/JavaScriptCore/interpreter/Interpreter.cpp
Source/JavaScriptCore/interpreter/Interpreter.h
Source/JavaScriptCore/interpreter/Register.h
Source/JavaScriptCore/jit/GCAwareJITStubRoutine.cpp
Source/JavaScriptCore/jit/HostCallReturnValue.cpp
Source/JavaScriptCore/jit/JIT.h
Source/JavaScriptCore/jit/JITCall.cpp
Source/JavaScriptCore/jit/JITCall32_64.cpp
Source/JavaScriptCore/jit/JITOpcodes.cpp
Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
Source/JavaScriptCore/jit/JITPropertyAccess.cpp
Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
Source/JavaScriptCore/jit/JITStubRoutine.cpp
Source/JavaScriptCore/jit/JITStubs.cpp
Source/JavaScriptCore/jsc.cpp
Source/JavaScriptCore/llint/LLIntEntrypoints.cpp
Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp
Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
Source/JavaScriptCore/llint/LLIntThunks.cpp
Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
Source/JavaScriptCore/parser/Nodes.h
Source/JavaScriptCore/runtime/ArgList.cpp
Source/JavaScriptCore/runtime/ArgList.h
Source/JavaScriptCore/runtime/ArrayPrototype.cpp
Source/JavaScriptCore/runtime/CallData.h
Source/JavaScriptCore/runtime/Completion.cpp
Source/JavaScriptCore/runtime/Completion.h
Source/JavaScriptCore/runtime/ConstructData.h
Source/JavaScriptCore/runtime/Executable.cpp
Source/JavaScriptCore/runtime/Executable.h
Source/JavaScriptCore/runtime/FunctionConstructor.cpp
Source/JavaScriptCore/runtime/GCActivityCallback.cpp
Source/JavaScriptCore/runtime/Identifier.cpp
Source/JavaScriptCore/runtime/JSActivation.cpp
Source/JavaScriptCore/runtime/JSDateMath.cpp
Source/JavaScriptCore/runtime/JSFunction.cpp
Source/JavaScriptCore/runtime/JSFunction.h
Source/JavaScriptCore/runtime/JSGlobalData.cpp
Source/JavaScriptCore/runtime/JSGlobalData.h
Source/JavaScriptCore/runtime/JSGlobalObject.cpp
Source/JavaScriptCore/runtime/JSGlobalObject.h
Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
Source/JavaScriptCore/runtime/JSLock.cpp
Source/JavaScriptCore/runtime/JSNameScope.h
Source/JavaScriptCore/runtime/JSObject.h
Source/JavaScriptCore/runtime/JSScope.cpp
Source/JavaScriptCore/runtime/JSScope.h
Source/JavaScriptCore/runtime/JSSegmentedVariableObject.h
Source/JavaScriptCore/runtime/JSStringJoiner.cpp
Source/JavaScriptCore/runtime/JSSymbolTableObject.h
Source/JavaScriptCore/runtime/JSVariableObject.h
Source/JavaScriptCore/runtime/JSWithScope.h
Source/JavaScriptCore/runtime/PropertyNameArray.cpp
Source/JavaScriptCore/runtime/ScopeChain.cpp [deleted file]
Source/JavaScriptCore/runtime/ScopeChain.h [deleted file]
Source/JavaScriptCore/runtime/ScopeChainMark.h [deleted file]
Source/JavaScriptCore/runtime/StrictEvalActivation.cpp
Source/WebCore/ChangeLog
Source/WebCore/ForwardingHeaders/runtime/JSWithScope.h [new file with mode: 0644]
Source/WebCore/ForwardingHeaders/runtime/ScopeChain.h [deleted file]
Source/WebCore/WebCore.exp.in
Source/WebCore/bindings/js/JSHTMLElementCustom.cpp
Source/WebCore/bindings/js/JSInjectedScriptManager.cpp
Source/WebCore/bindings/js/JSJavaScriptCallFrameCustom.cpp
Source/WebCore/bindings/js/JSMainThreadExecState.h
Source/WebCore/bindings/js/JSNodeCustom.cpp
Source/WebCore/bindings/js/JavaScriptCallFrame.cpp
Source/WebCore/bindings/js/JavaScriptCallFrame.h
Source/WebCore/bindings/js/ScriptController.cpp
Source/WebCore/bindings/js/ScriptDebugServer.cpp
Source/WebCore/bindings/js/WorkerScriptController.cpp
Source/WebCore/bindings/objc/WebScriptObject.mm
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bridge/NP_jsobject.cpp
Source/WebCore/bridge/c/c_class.cpp
Source/WebCore/bridge/c/c_runtime.cpp
Source/WebCore/bridge/jni/jni_jsobject.mm
Source/WebCore/bridge/jni/jsc/JavaMethodJSC.cpp
Source/WebCore/bridge/jni/jsc/JavaStringJSC.h
Source/WebCore/plugins/PluginViewNone.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
Source/WebKit/mac/WebView/WebScriptDebugDelegate.mm
Source/WebKit/qt/Api/qwebelement.cpp
Source/WebKit/qt/ChangeLog
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.cpp