Introduced JSWithScope, making all scope objects subclasses of JSScope
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Aug 2012 17:13:50 +0000 (17:13 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Aug 2012 17:13:50 +0000 (17:13 +0000)
commit475e0f32ded35cbbc2018574ff9f0f92e00dff96
treea9a2ee23900213f6f46b42914a7884d594c52a47
parentf9686624f6e8a0e8398591a2eda5630b8faa0c46
Introduced JSWithScope, making all scope objects subclasses of JSScope
https://bugs.webkit.org/show_bug.cgi?id=95295

Reviewed by Filip Pizlo.

This is a step toward removing ScopeChainNode. With a uniform representation
for objects in the scope chain, we can move data from ScopeChainNode
into JSScope.

* CMakeLists.txt:
* GNUmakefile.list.am:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Target.pri: Build!

* interpreter/Interpreter.cpp:
(JSC::Interpreter::privateExecute):
* jit/JITStubs.cpp:
(JSC::DEFINE_STUB_FUNCTION):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL): Use an explicit JSWithScope object
for 'with' statements. Since 'with' can put any object in the scope
chain, we'll need an adapter object to hold the data ScopeChainNode
currently holds.

* runtime/JSGlobalData.cpp:
(JSC::JSGlobalData::JSGlobalData):
* runtime/JSGlobalData.h:
(JSGlobalData): Support for JSWithScope.

* runtime/JSScope.cpp:
(JSC::JSScope::objectAtScope):
* runtime/JSScope.h: Check for and unwrap JSWithScope.

* runtime/JSType.h: Support for JSWithScope.

* runtime/StrictEvalActivation.cpp:
(JSC::StrictEvalActivation::StrictEvalActivation):
* runtime/StrictEvalActivation.h:
(StrictEvalActivation): Inherit from JSScope, to make the scope chain uniform.

* runtime/JSWithScope.cpp: Added.
(JSC::JSWithScope::visitChildren):
* runtime/JSWithScope.h: Added.
(JSWithScope):
(JSC::JSWithScope::create):
(JSC::JSWithScope::object):
(JSC::JSWithScope::createStructure):
(JSC::JSWithScope::JSWithScope): New adapter object. Since this object
is never exposed to scripts, it doesn't need any meaningful implementation
of property access or other callbacks.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@127010 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/GNUmakefile.list.am
Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/Target.pri
Source/JavaScriptCore/interpreter/Interpreter.cpp
Source/JavaScriptCore/jit/JITStubs.cpp
Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
Source/JavaScriptCore/runtime/JSGlobalData.cpp
Source/JavaScriptCore/runtime/JSGlobalData.h
Source/JavaScriptCore/runtime/JSScope.cpp
Source/JavaScriptCore/runtime/JSScope.h
Source/JavaScriptCore/runtime/JSType.h
Source/JavaScriptCore/runtime/JSWithScope.cpp [new file with mode: 0644]
Source/JavaScriptCore/runtime/JSWithScope.h [new file with mode: 0644]
Source/JavaScriptCore/runtime/StrictEvalActivation.cpp
Source/JavaScriptCore/runtime/StrictEvalActivation.h