Changeset 127010 in webkit
- Timestamp:
- Aug 29, 2012 10:13:50 AM (12 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/CMakeLists.txt
r126893 r127010 209 209 runtime/JSSegmentedVariableObject.cpp 210 210 runtime/JSNameScope.cpp 211 runtime/JSWithScope.cpp 211 212 runtime/JSScope.cpp 212 213 runtime/JSString.cpp -
trunk/Source/JavaScriptCore/ChangeLog
r126990 r127010 1 2012-08-28 Geoffrey Garen <ggaren@apple.com> 2 3 Introduced JSWithScope, making all scope objects subclasses of JSScope 4 https://bugs.webkit.org/show_bug.cgi?id=95295 5 6 Reviewed by Filip Pizlo. 7 8 This is a step toward removing ScopeChainNode. With a uniform representation 9 for objects in the scope chain, we can move data from ScopeChainNode 10 into JSScope. 11 12 * CMakeLists.txt: 13 * GNUmakefile.list.am: 14 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 15 * JavaScriptCore.xcodeproj/project.pbxproj: 16 * Target.pri: Build! 17 18 * interpreter/Interpreter.cpp: 19 (JSC::Interpreter::privateExecute): 20 * jit/JITStubs.cpp: 21 (JSC::DEFINE_STUB_FUNCTION): 22 * llint/LLIntSlowPaths.cpp: 23 (JSC::LLInt::LLINT_SLOW_PATH_DECL): Use an explicit JSWithScope object 24 for 'with' statements. Since 'with' can put any object in the scope 25 chain, we'll need an adapter object to hold the data ScopeChainNode 26 currently holds. 27 28 * runtime/JSGlobalData.cpp: 29 (JSC::JSGlobalData::JSGlobalData): 30 * runtime/JSGlobalData.h: 31 (JSGlobalData): Support for JSWithScope. 32 33 * runtime/JSScope.cpp: 34 (JSC::JSScope::objectAtScope): 35 * runtime/JSScope.h: Check for and unwrap JSWithScope. 36 37 * runtime/JSType.h: Support for JSWithScope. 38 39 * runtime/StrictEvalActivation.cpp: 40 (JSC::StrictEvalActivation::StrictEvalActivation): 41 * runtime/StrictEvalActivation.h: 42 (StrictEvalActivation): Inherit from JSScope, to make the scope chain uniform. 43 44 * runtime/JSWithScope.cpp: Added. 45 (JSC::JSWithScope::visitChildren): 46 * runtime/JSWithScope.h: Added. 47 (JSWithScope): 48 (JSC::JSWithScope::create): 49 (JSC::JSWithScope::object): 50 (JSC::JSWithScope::createStructure): 51 (JSC::JSWithScope::JSWithScope): New adapter object. Since this object 52 is never exposed to scripts, it doesn't need any meaningful implementation 53 of property access or other callbacks. 54 1 55 2012-08-29 Patrick Gansterer <paroga@webkit.org> 2 56 -
trunk/Source/JavaScriptCore/GNUmakefile.list.am
r126893 r127010 548 548 Source/JavaScriptCore/runtime/JSSegmentedVariableObject.cpp \ 549 549 Source/JavaScriptCore/runtime/JSSegmentedVariableObject.h \ 550 Source/JavaScriptCore/runtime/JSWithScope.cpp \ 550 551 Source/JavaScriptCore/runtime/JSNameScope.cpp \ 551 552 Source/JavaScriptCore/runtime/JSNameScope.h \ -
trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
r126893 r127010 883 883 </File> 884 884 <File 885 RelativePath="..\..\runtime\JSWithScope.cpp" 886 > 887 </File> 888 <File 889 RelativePath="..\..\runtime\JSWithScope.h" 890 > 891 </File> 892 <File 885 893 RelativePath="..\..\runtime\JSNameScope.cpp" 886 894 > -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r126955 r127010 141 141 0F63945415D07055006A597C /* ArrayProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F63945115D07051006A597C /* ArrayProfile.cpp */; }; 142 142 0F63945515D07057006A597C /* ArrayProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F63945215D07051006A597C /* ArrayProfile.h */; settings = {ATTRIBUTES = (Private, ); }; }; 143 0F63947815DCE34B006A597C /* DFGStructureAbstractValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F63947615DCE347006A597C /* DFGStructureAbstractValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; 143 144 0F63948415E48118006A597C /* DFGArrayMode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F63948115E48114006A597C /* DFGArrayMode.cpp */; }; 144 145 0F63948515E4811B006A597C /* DFGArrayMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F63948215E48114006A597C /* DFGArrayMode.h */; settings = {ATTRIBUTES = (Private, ); }; }; 145 0F63947815DCE34B006A597C /* DFGStructureAbstractValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F63947615DCE347006A597C /* DFGStructureAbstractValue.h */; settings = {ATTRIBUTES = (Private, ); }; };146 146 0F66E16B14DF3F1600B7B2E4 /* DFGAdjacencyList.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F66E16814DF3F1300B7B2E4 /* DFGAdjacencyList.h */; settings = {ATTRIBUTES = (Private, ); }; }; 147 147 0F66E16C14DF3F1600B7B2E4 /* DFGEdge.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F66E16914DF3F1300B7B2E4 /* DFGEdge.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 315 315 1440F8AF0A508D200005F061 /* JSCallbackConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1440F8AD0A508D200005F061 /* JSCallbackConstructor.cpp */; }; 316 316 1440FCE40A51E46B0005F061 /* JSClassRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1440FCE20A51E46B0005F061 /* JSClassRef.cpp */; }; 317 1442566115EDE98D0066A49B /* JSWithScope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1442565F15EDE98D0066A49B /* JSWithScope.cpp */; }; 318 1442566215EDE98D0066A49B /* JSWithScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 1442566015EDE98D0066A49B /* JSWithScope.h */; settings = {ATTRIBUTES = (Private, ); }; }; 317 319 14469DDE107EC7E700650446 /* Lookup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8680255597D01FF60F7 /* Lookup.cpp */; }; 318 320 14469DDF107EC7E700650446 /* MathObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A86A0255597D01FF60F7 /* MathObject.cpp */; }; … … 721 723 FE4A331F15BD2E07006F54F3 /* VMInspector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE4A331D15BD2E07006F54F3 /* VMInspector.cpp */; }; 722 724 FE4A332015BD2E07006F54F3 /* VMInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = FE4A331E15BD2E07006F54F3 /* VMInspector.h */; }; 723 FED287B215EC9A5700DA8161 /* LLIntOpcode.h in Headers */ = {isa = PBXBuildFile; fileRef = FED287B115EC9A5700DA8161 /* LLIntOpcode.h */; 725 FED287B215EC9A5700DA8161 /* LLIntOpcode.h in Headers */ = {isa = PBXBuildFile; fileRef = FED287B115EC9A5700DA8161 /* LLIntOpcode.h */; settings = {ATTRIBUTES = (Private, ); }; }; 724 726 /* End PBXBuildFile section */ 725 727 … … 902 904 0F63945115D07051006A597C /* ArrayProfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ArrayProfile.cpp; sourceTree = "<group>"; }; 903 905 0F63945215D07051006A597C /* ArrayProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrayProfile.h; sourceTree = "<group>"; }; 906 0F63947615DCE347006A597C /* DFGStructureAbstractValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGStructureAbstractValue.h; path = dfg/DFGStructureAbstractValue.h; sourceTree = "<group>"; }; 904 907 0F63948115E48114006A597C /* DFGArrayMode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGArrayMode.cpp; path = dfg/DFGArrayMode.cpp; sourceTree = "<group>"; }; 905 908 0F63948215E48114006A597C /* DFGArrayMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGArrayMode.h; path = dfg/DFGArrayMode.h; sourceTree = "<group>"; }; 906 0F63947615DCE347006A597C /* DFGStructureAbstractValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGStructureAbstractValue.h; path = dfg/DFGStructureAbstractValue.h; sourceTree = "<group>"; };907 909 0F66E16814DF3F1300B7B2E4 /* DFGAdjacencyList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGAdjacencyList.h; path = dfg/DFGAdjacencyList.h; sourceTree = "<group>"; }; 908 910 0F66E16914DF3F1300B7B2E4 /* DFGEdge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGEdge.h; path = dfg/DFGEdge.h; sourceTree = "<group>"; }; … … 1063 1065 1440FCE10A51E46B0005F061 /* JSClassRef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSClassRef.h; sourceTree = "<group>"; }; 1064 1066 1440FCE20A51E46B0005F061 /* JSClassRef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSClassRef.cpp; sourceTree = "<group>"; }; 1067 1442565F15EDE98D0066A49B /* JSWithScope.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWithScope.cpp; sourceTree = "<group>"; }; 1068 1442566015EDE98D0066A49B /* JSWithScope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWithScope.h; sourceTree = "<group>"; }; 1065 1069 145722851437E140005FDE26 /* StrongInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StrongInlines.h; sourceTree = "<group>"; }; 1066 1070 145C507F0D9DF63B0088F6B9 /* CallData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallData.h; sourceTree = "<group>"; }; … … 2136 2140 BC22A39A0E16E14800AF21C8 /* JSVariableObject.cpp */, 2137 2141 14F252560D08DD8D004ECFFF /* JSVariableObject.h */, 2142 1442565F15EDE98D0066A49B /* JSWithScope.cpp */, 2143 1442566015EDE98D0066A49B /* JSWithScope.h */, 2138 2144 65C7A1710A8EAACB00FA37EA /* JSWrapperObject.cpp */, 2139 2145 65C7A1720A8EAACB00FA37EA /* JSWrapperObject.h */, … … 2910 2916 14874AE615EBDE4A002E3587 /* JSScope.h in Headers */, 2911 2917 FED287B215EC9A5700DA8161 /* LLIntOpcode.h in Headers */, 2918 1442566215EDE98D0066A49B /* JSWithScope.h in Headers */, 2912 2919 ); 2913 2920 runOnlyForDeploymentPostprocessing = 0; … … 3512 3519 14874AE315EBDE4A002E3587 /* JSNameScope.cpp in Sources */, 3513 3520 14874AE515EBDE4A002E3587 /* JSScope.cpp in Sources */, 3521 1442566115EDE98D0066A49B /* JSWithScope.cpp in Sources */, 3514 3522 ); 3515 3523 runOnlyForDeploymentPostprocessing = 0; -
trunk/Source/JavaScriptCore/Target.pri
r126893 r127010 210 210 runtime/JSPropertyNameIterator.cpp \ 211 211 runtime/JSSegmentedVariableObject.cpp \ 212 runtime/JSWithScope.cpp \ 212 213 runtime/JSNameScope.cpp \ 213 214 runtime/JSScope.cpp \ -
trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp
r126990 r127010 4797 4797 4798 4798 callFrame->uncheckedR(scope) = JSValue(o); 4799 callFrame->setScopeChain(callFrame->scopeChain()->push( o));4799 callFrame->setScopeChain(callFrame->scopeChain()->push(JSWithScope(callFrame, o))); 4800 4800 4801 4801 vPC += OPCODE_LENGTH(op_push_scope); -
trunk/Source/JavaScriptCore/jit/JITStubs.cpp
r126926 r127010 55 55 #include "JSPropertyNameIterator.h" 56 56 #include "JSString.h" 57 #include "JSWithScope.h" 57 58 #include "NameInstance.h" 58 59 #include "ObjectPrototype.h" … … 3147 3148 JSObject* o = stackFrame.args[0].jsValue().toObject(stackFrame.callFrame); 3148 3149 CHECK_FOR_EXCEPTION(); 3149 stackFrame.callFrame->setScopeChain(stackFrame.callFrame->scopeChain()->push( o));3150 stackFrame.callFrame->setScopeChain(stackFrame.callFrame->scopeChain()->push(JSWithScope::create(stackFrame.callFrame, o))); 3150 3151 return o; 3151 3152 } -
trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
r126893 r127010 43 43 #include "JSString.h" 44 44 #include "JSValue.h" 45 #include "JSWithScope.h" 45 46 #include "LLIntCommon.h" 46 47 #include "LLIntExceptions.h" … … 1536 1537 1537 1538 LLINT_OP(1) = o; 1538 exec->setScopeChain(exec->scopeChain()->push( o));1539 exec->setScopeChain(exec->scopeChain()->push(JSWithScope::create(exec, o))); 1539 1540 1540 1541 LLINT_END(); -
trunk/Source/JavaScriptCore/runtime/JSGlobalData.cpp
r126893 r127010 49 49 #include "JSNotAnObject.h" 50 50 #include "JSPropertyNameIterator.h" 51 #include "JSWithScope.h" 51 52 #include "Lexer.h" 52 53 #include "Lookup.h" … … 206 207 sharedSymbolTableStructure.set(*this, SharedSymbolTable::createStructure(*this, 0, jsNull())); 207 208 structureChainStructure.set(*this, StructureChain::createStructure(*this, 0, jsNull())); 209 withScopeStructure.set(*this, JSWithScope::createStructure(*this, 0, jsNull())); 208 210 209 211 wtfThreadData().setCurrentIdentifierTable(existingEntryIdentifierTable); -
trunk/Source/JavaScriptCore/runtime/JSGlobalData.h
r126893 r127010 241 241 Strong<Structure> sharedSymbolTableStructure; 242 242 Strong<Structure> structureChainStructure; 243 Strong<Structure> withScopeStructure; 243 244 244 245 IdentifierTable* identifierTable; -
trunk/Source/JavaScriptCore/runtime/JSScope.cpp
r126962 r127010 30 30 #include "JSGlobalObject.h" 31 31 #include "JSNameScope.h" 32 #include "JSWithScope.h" 32 33 33 34 namespace JSC { … … 52 53 } 53 54 55 JSObject* JSScope::objectAtScope(ScopeChainNode* scopeChain) 56 { 57 JSObject* object = scopeChain->object.get(); 58 if (object->structure()->typeInfo().type() == WithScopeType) 59 return jsCast<JSWithScope*>(object)->object(); 60 61 return object; 62 } 63 54 64 JSValue JSScope::resolve(CallFrame* callFrame, const Identifier& identifier) 55 65 { -
trunk/Source/JavaScriptCore/runtime/JSScope.h
r126962 r127010 35 35 typedef JSNonFinalObject Base; 36 36 37 static JSObject* objectAtScope(ScopeChainNode*);37 JS_EXPORT_PRIVATE static JSObject* objectAtScope(ScopeChainNode*); 38 38 39 39 static JSValue resolve(CallFrame*, const Identifier&); … … 66 66 : Base(globalData, structure) 67 67 { 68 }69 70 inline JSObject* JSScope::objectAtScope(ScopeChainNode* scopeChain)71 {72 return scopeChain->object.get();73 68 } 74 69 -
trunk/Source/JavaScriptCore/runtime/JSType.h
r126893 r127010 50 50 ErrorInstanceType, 51 51 GlobalThisType, 52 WithScopeType, 52 53 53 54 NameScopeObjectType, -
trunk/Source/JavaScriptCore/runtime/StrictEvalActivation.cpp
r116828 r127010 34 34 35 35 StrictEvalActivation::StrictEvalActivation(ExecState* exec) 36 : JSNonFinalObject(exec->globalData(), exec->globalData().strictEvalActivationStructure.get())36 : Base(exec->globalData(), exec->globalData().strictEvalActivationStructure.get()) 37 37 { 38 38 } -
trunk/Source/JavaScriptCore/runtime/StrictEvalActivation.h
r116828 r127010 27 27 #define StrictEvalActivation_h 28 28 29 #include "JS Object.h"29 #include "JSScope.h" 30 30 31 31 namespace JSC { 32 32 33 class StrictEvalActivation : public JS NonFinalObject{33 class StrictEvalActivation : public JSScope { 34 34 public: 35 typedef JS NonFinalObjectBase;35 typedef JSScope Base; 36 36 37 37 static StrictEvalActivation* create(ExecState* exec) … … 53 53 54 54 protected: 55 static const unsigned StructureFlags = IsEnvironmentRecord | JSNonFinalObject::StructureFlags;55 static const unsigned StructureFlags = IsEnvironmentRecord | Base::StructureFlags; 56 56 57 57 private:
Note: See TracChangeset
for help on using the changeset viewer.