Commit f5ab0692 authored by ggaren@apple.com's avatar ggaren@apple.com

JavaScriptCore:

        Reviewed by Sam Weinig.

        Next step in refactoring JSGlobalObject: Added JSVariableObject class,
        and factored symbol-table-related code into it. (JSGlobalObject doesn't
        use the symbol table code yet, though.)
        
        Layout and JS tests, and testapi, pass. SunSpider reports no regression.

WebCore:

        Reviewed by Sam Weinig.

        Added some namespace qualifications and a forwarding header, now that
        KJS::Node is sometimes #included in WebCore by JavaScriptCore headers.

        * ForwardingHeaders/wtf/ListRefPtr.h: Added.
        * bindings/js/JSXSLTProcessor.cpp:
        (KJS::JSXSLTProcessorPrototypeFunctionTransformToFragment::callAsFunction):
        * bindings/js/kjs_binding.cpp:
        (KJS::ScriptInterpreter::getDOMNodeForDocument):
        (KJS::ScriptInterpreter::forgetDOMNodeForDocument):
        (KJS::ScriptInterpreter::putDOMNodeForDocument):
        (KJS::ScriptInterpreter::markDOMNodesForDocument):
        (KJS::ScriptInterpreter::updateDOMNodeDocument):

WebKit/mac:

        Reviewed by Sam Weinig.
        
        Added a forwarding header, since we now #include nodes.h through some
        JavaScriptCore headers.

        * ForwardingHeaders/wtf/ListRefPtr.h: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@28527 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent ee5a5d14
2007-12-07 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Next step in refactoring JSGlobalObject: Added JSVariableObject class,
and factored symbol-table-related code into it. (JSGlobalObject doesn't
use the symbol table code yet, though.)
Layout and JS tests, and testapi, pass. SunSpider reports no regression.
2007-12-07 Darin Adler <darin@apple.com> 2007-12-07 Darin Adler <darin@apple.com>
Reviewed by Geoff. Reviewed by Geoff.
......
...@@ -149,6 +149,8 @@ __ZN3KJS14StringInstanceC2EPNS_8JSObjectERKNS_7UStringE ...@@ -149,6 +149,8 @@ __ZN3KJS14StringInstanceC2EPNS_8JSObjectERKNS_7UStringE
__ZN3KJS15JSWrapperObject4markEv __ZN3KJS15JSWrapperObject4markEv
__ZN3KJS15SavedPropertiesC1Ev __ZN3KJS15SavedPropertiesC1Ev
__ZN3KJS15SavedPropertiesD1Ev __ZN3KJS15SavedPropertiesD1Ev
__ZN3KJS16JSVariableObject14deletePropertyEPNS_9ExecStateERKNS_10IdentifierE
__ZN3KJS16JSVariableObject16getPropertyNamesEPNS_9ExecStateERNS_17PropertyNameArrayE
__ZN3KJS16RuntimeObjectImp4infoE __ZN3KJS16RuntimeObjectImp4infoE
__ZN3KJS16RuntimeObjectImpC1EPNS_8Bindings8InstanceE __ZN3KJS16RuntimeObjectImpC1EPNS_8Bindings8InstanceE
__ZN3KJS17PropertyNameArray3addERKNS_10IdentifierE __ZN3KJS17PropertyNameArray3addERKNS_10IdentifierE
...@@ -223,6 +225,7 @@ __ZN3KJS9Collector4sizeEv ...@@ -223,6 +225,7 @@ __ZN3KJS9Collector4sizeEv
__ZN3KJS9Collector7collectEv __ZN3KJS9Collector7collectEv
__ZN3KJS9Collector7protectEPNS_7JSValueE __ZN3KJS9Collector7protectEPNS_7JSValueE
__ZN3KJS9Collector9unprotectEPNS_7JSValueE __ZN3KJS9Collector9unprotectEPNS_7JSValueE
__ZN3KJS9ExecStateC1EPNS_14JSGlobalObjectEPNS_8JSObjectEPNS_16FunctionBodyNodeENS_8CodeTypeEPS0_S8_PNS_11FunctionImpEPKNS_4ListE
__ZN3KJS9ExecStateD1Ev __ZN3KJS9ExecStateD1Ev
__ZN3KJSeqERKNS_7UStringEPKc __ZN3KJSeqERKNS_7UStringEPKc
__ZN3WTF10fastCallocEmm __ZN3WTF10fastCallocEmm
...@@ -277,6 +280,7 @@ __ZNK3KJS9ExecState19lexicalGlobalObjectEv ...@@ -277,6 +280,7 @@ __ZNK3KJS9ExecState19lexicalGlobalObjectEv
__ZTVN3KJS14JSGlobalObjectE __ZTVN3KJS14JSGlobalObjectE
__ZTVN3KJS14StringInstanceE __ZTVN3KJS14StringInstanceE
__ZTVN3KJS15JSWrapperObjectE __ZTVN3KJS15JSWrapperObjectE
__ZTVN3KJS16JSVariableObjectE
__ZTVN3KJS19InternalFunctionImpE __ZTVN3KJS19InternalFunctionImpE
__ZTVN3KJS8JSObjectE __ZTVN3KJS8JSObjectE
_jscore_collector_introspection _jscore_collector_introspection
......
...@@ -318,6 +318,14 @@ ...@@ -318,6 +318,14 @@
RelativePath="..\..\kjs\JSGlobalObject.cpp" RelativePath="..\..\kjs\JSGlobalObject.cpp"
> >
</File> </File>
<File
RelativePath="..\..\kjs\JSVariableObject.cpp"
>
</File>
<File
RelativePath="..\..\kjs\JSVariableObject.h"
>
</File>
<File <File
RelativePath="..\..\kjs\JSImmediate.cpp" RelativePath="..\..\kjs\JSImmediate.cpp"
> >
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
1482B7E30A43076000517CFC /* JSObjectRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 1482B7E10A43076000517CFC /* JSObjectRef.h */; settings = {ATTRIBUTES = (Public, ); }; }; 1482B7E30A43076000517CFC /* JSObjectRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 1482B7E10A43076000517CFC /* JSObjectRef.h */; settings = {ATTRIBUTES = (Public, ); }; };
1482B7E40A43076000517CFC /* JSObjectRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1482B7E20A43076000517CFC /* JSObjectRef.cpp */; }; 1482B7E40A43076000517CFC /* JSObjectRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1482B7E20A43076000517CFC /* JSObjectRef.cpp */; };
1483B58A099BC1950016E4F0 /* JSImmediate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1483B589099BC1950016E4F0 /* JSImmediate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1483B58A099BC1950016E4F0 /* JSImmediate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1483B589099BC1950016E4F0 /* JSImmediate.h */; settings = {ATTRIBUTES = (Private, ); }; };
148A1627095D16BB00666D0D /* ListRefPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 148A1626095D16BB00666D0D /* ListRefPtr.h */; }; 148A1627095D16BB00666D0D /* ListRefPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 148A1626095D16BB00666D0D /* ListRefPtr.h */; settings = {ATTRIBUTES = (Private, ); }; };
14A396A70CD2933100B5B4FF /* SymbolTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 14A396A60CD2933100B5B4FF /* SymbolTable.h */; settings = {ATTRIBUTES = (Private, ); }; }; 14A396A70CD2933100B5B4FF /* SymbolTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 14A396A60CD2933100B5B4FF /* SymbolTable.h */; settings = {ATTRIBUTES = (Private, ); }; };
14ABB36F099C076400E2A24F /* value.h in Headers */ = {isa = PBXBuildFile; fileRef = 14ABB36E099C076400E2A24F /* value.h */; settings = {ATTRIBUTES = (Private, ); }; }; 14ABB36F099C076400E2A24F /* value.h in Headers */ = {isa = PBXBuildFile; fileRef = 14ABB36E099C076400E2A24F /* value.h */; settings = {ATTRIBUTES = (Private, ); }; };
14ABB455099C2A0F00E2A24F /* JSType.h in Headers */ = {isa = PBXBuildFile; fileRef = 14ABB454099C2A0F00E2A24F /* JSType.h */; settings = {ATTRIBUTES = (Private, ); }; }; 14ABB455099C2A0F00E2A24F /* JSType.h in Headers */ = {isa = PBXBuildFile; fileRef = 14ABB454099C2A0F00E2A24F /* JSType.h */; settings = {ATTRIBUTES = (Private, ); }; };
...@@ -81,6 +81,8 @@ ...@@ -81,6 +81,8 @@
14BD5A320A3E91F600BAF59C /* JSValueRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14BD5A2B0A3E91F600BAF59C /* JSValueRef.cpp */; }; 14BD5A320A3E91F600BAF59C /* JSValueRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14BD5A2B0A3E91F600BAF59C /* JSValueRef.cpp */; };
14BD5A360A3E91F600BAF59C /* JavaScriptCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 14BD5A2F0A3E91F600BAF59C /* JavaScriptCore.h */; settings = {ATTRIBUTES = (Public, ); }; }; 14BD5A360A3E91F600BAF59C /* JavaScriptCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 14BD5A2F0A3E91F600BAF59C /* JavaScriptCore.h */; settings = {ATTRIBUTES = (Public, ); }; };
14DE0D690D02431400AACCA2 /* JSGlobalObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14DE0D680D02431400AACCA2 /* JSGlobalObject.cpp */; }; 14DE0D690D02431400AACCA2 /* JSGlobalObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14DE0D680D02431400AACCA2 /* JSGlobalObject.cpp */; };
14F252570D08DD8D004ECFFF /* JSVariableObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 14F252560D08DD8D004ECFFF /* JSVariableObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
14F252610D08DF2F004ECFFF /* JSVariableObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14F252600D08DF2F004ECFFF /* JSVariableObject.cpp */; };
1CAF34890A6C421700ABE06E /* WebScriptObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CAF34880A6C421700ABE06E /* WebScriptObject.h */; }; 1CAF34890A6C421700ABE06E /* WebScriptObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CAF34880A6C421700ABE06E /* WebScriptObject.h */; };
5186111E0CC824900081412B /* Deque.h in Headers */ = {isa = PBXBuildFile; fileRef = 5186111D0CC824830081412B /* Deque.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5186111E0CC824900081412B /* Deque.h in Headers */ = {isa = PBXBuildFile; fileRef = 5186111D0CC824830081412B /* Deque.h */; settings = {ATTRIBUTES = (Private, ); }; };
51F648D70BB4E2CA0033D760 /* RetainPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F648D60BB4E2CA0033D760 /* RetainPtr.h */; settings = {ATTRIBUTES = (Private, ); }; }; 51F648D70BB4E2CA0033D760 /* RetainPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F648D60BB4E2CA0033D760 /* RetainPtr.h */; settings = {ATTRIBUTES = (Private, ); }; };
...@@ -142,7 +144,7 @@ ...@@ -142,7 +144,7 @@
932F5B4B0822A1C700736975 /* lexer.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8660255597D01FF60F7 /* lexer.h */; }; 932F5B4B0822A1C700736975 /* lexer.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8660255597D01FF60F7 /* lexer.h */; };
932F5B4D0822A1C700736975 /* lookup.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8690255597D01FF60F7 /* lookup.h */; settings = {ATTRIBUTES = (Private, ); }; }; 932F5B4D0822A1C700736975 /* lookup.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8690255597D01FF60F7 /* lookup.h */; settings = {ATTRIBUTES = (Private, ); }; };
932F5B4E0822A1C700736975 /* math_object.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A86B0255597D01FF60F7 /* math_object.h */; settings = {ATTRIBUTES = (Private, ); }; }; 932F5B4E0822A1C700736975 /* math_object.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A86B0255597D01FF60F7 /* math_object.h */; settings = {ATTRIBUTES = (Private, ); }; };
932F5B500822A1C700736975 /* nodes.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A86E0255597D01FF60F7 /* nodes.h */; }; 932F5B500822A1C700736975 /* nodes.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A86E0255597D01FF60F7 /* nodes.h */; settings = {ATTRIBUTES = (Private, ); }; };
932F5B510822A1C700736975 /* number_object.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8710255597D01FF60F7 /* number_object.h */; settings = {ATTRIBUTES = (Private, ); }; }; 932F5B510822A1C700736975 /* number_object.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8710255597D01FF60F7 /* number_object.h */; settings = {ATTRIBUTES = (Private, ); }; };
932F5B530822A1C700736975 /* object_object.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8740255597D01FF60F7 /* object_object.h */; settings = {ATTRIBUTES = (Private, ); }; }; 932F5B530822A1C700736975 /* object_object.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8740255597D01FF60F7 /* object_object.h */; settings = {ATTRIBUTES = (Private, ); }; };
932F5B540822A1C700736975 /* object.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8760255597D01FF60F7 /* object.h */; settings = {ATTRIBUTES = (Private, ); }; }; 932F5B540822A1C700736975 /* object.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8760255597D01FF60F7 /* object.h */; settings = {ATTRIBUTES = (Private, ); }; };
...@@ -228,7 +230,7 @@ ...@@ -228,7 +230,7 @@
93E26BD408B1514100F85226 /* pcre_xclass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E26BD308B1514100F85226 /* pcre_xclass.cpp */; }; 93E26BD408B1514100F85226 /* pcre_xclass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E26BD308B1514100F85226 /* pcre_xclass.cpp */; };
93E26BE608B1517100F85226 /* pcre_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 93E26BE508B1517100F85226 /* pcre_internal.h */; }; 93E26BE608B1517100F85226 /* pcre_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 93E26BE508B1517100F85226 /* pcre_internal.h */; };
93E26BFE08B151D400F85226 /* ucpinternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 93E26BFC08B151D400F85226 /* ucpinternal.h */; }; 93E26BFE08B151D400F85226 /* ucpinternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 93E26BFC08B151D400F85226 /* ucpinternal.h */; };
93F0B3AC09BB4DC00068FCE3 /* Parser.h in Headers */ = {isa = PBXBuildFile; fileRef = 93F0B3AA09BB4DC00068FCE3 /* Parser.h */; }; 93F0B3AC09BB4DC00068FCE3 /* Parser.h in Headers */ = {isa = PBXBuildFile; fileRef = 93F0B3AA09BB4DC00068FCE3 /* Parser.h */; settings = {ATTRIBUTES = (Private, ); }; };
95C18D490C90E82600E72F73 /* JSRetainPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C18D3E0C90E7EF00E72F73 /* JSRetainPtr.h */; settings = {ATTRIBUTES = (Private, ); }; }; 95C18D490C90E82600E72F73 /* JSRetainPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C18D3E0C90E7EF00E72F73 /* JSRetainPtr.h */; settings = {ATTRIBUTES = (Private, ); }; };
A8E894320CD0602400367179 /* JSCallbackObjectFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = A8E894310CD0602400367179 /* JSCallbackObjectFunctions.h */; }; A8E894320CD0602400367179 /* JSCallbackObjectFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = A8E894310CD0602400367179 /* JSCallbackObjectFunctions.h */; };
A8E894340CD0603F00367179 /* JSGlobalObject.h in Headers */ = {isa = PBXBuildFile; fileRef = A8E894330CD0603F00367179 /* JSGlobalObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; A8E894340CD0603F00367179 /* JSGlobalObject.h in Headers */ = {isa = PBXBuildFile; fileRef = A8E894330CD0603F00367179 /* JSGlobalObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
...@@ -439,6 +441,8 @@ ...@@ -439,6 +441,8 @@
14BD5A2F0A3E91F600BAF59C /* JavaScriptCore.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JavaScriptCore.h; sourceTree = "<group>"; }; 14BD5A2F0A3E91F600BAF59C /* JavaScriptCore.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JavaScriptCore.h; sourceTree = "<group>"; };
14D857740A4696C80032146C /* testapi.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = testapi.js; sourceTree = "<group>"; }; 14D857740A4696C80032146C /* testapi.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = testapi.js; sourceTree = "<group>"; };
14DE0D680D02431400AACCA2 /* JSGlobalObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSGlobalObject.cpp; sourceTree = "<group>"; }; 14DE0D680D02431400AACCA2 /* JSGlobalObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSGlobalObject.cpp; sourceTree = "<group>"; };
14F252560D08DD8D004ECFFF /* JSVariableObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVariableObject.h; sourceTree = "<group>"; };
14F252600D08DF2F004ECFFF /* JSVariableObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSVariableObject.cpp; sourceTree = "<group>"; };
1C9051420BA9E8A70081E9D0 /* Version.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Version.xcconfig; sourceTree = "<group>"; }; 1C9051420BA9E8A70081E9D0 /* Version.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Version.xcconfig; sourceTree = "<group>"; };
1C9051430BA9E8A70081E9D0 /* JavaScriptCore.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = JavaScriptCore.xcconfig; sourceTree = "<group>"; }; 1C9051430BA9E8A70081E9D0 /* JavaScriptCore.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = JavaScriptCore.xcconfig; sourceTree = "<group>"; };
1C9051440BA9E8A70081E9D0 /* DebugRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = DebugRelease.xcconfig; sourceTree = "<group>"; }; 1C9051440BA9E8A70081E9D0 /* DebugRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = DebugRelease.xcconfig; sourceTree = "<group>"; };
...@@ -952,6 +956,7 @@ ...@@ -952,6 +956,7 @@
65417200039E01BA0058BFEB /* kjs */ = { 65417200039E01BA0058BFEB /* kjs */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
14F252600D08DF2F004ECFFF /* JSVariableObject.cpp */,
659126BC0BDD1728001921FB /* AllInOneFile.cpp */, 659126BC0BDD1728001921FB /* AllInOneFile.cpp */,
93ADFCE60CCBD7AC00D30B08 /* array_instance.cpp */, 93ADFCE60CCBD7AC00D30B08 /* array_instance.cpp */,
938772E5038BFE19008635CE /* array_instance.h */, 938772E5038BFE19008635CE /* array_instance.h */,
...@@ -1000,6 +1005,7 @@ ...@@ -1000,6 +1005,7 @@
65EA4C9A092AF9E20093D800 /* JSLock.h */, 65EA4C9A092AF9E20093D800 /* JSLock.h */,
14ABB454099C2A0F00E2A24F /* JSType.h */, 14ABB454099C2A0F00E2A24F /* JSType.h */,
1482B6EA0A4300B300517CFC /* JSValueRef.h */, 1482B6EA0A4300B300517CFC /* JSValueRef.h */,
14F252560D08DD8D004ECFFF /* JSVariableObject.h */,
65C7A1710A8EAACB00FA37EA /* JSWrapperObject.cpp */, 65C7A1710A8EAACB00FA37EA /* JSWrapperObject.cpp */,
65C7A1720A8EAACB00FA37EA /* JSWrapperObject.h */, 65C7A1720A8EAACB00FA37EA /* JSWrapperObject.h */,
93F1981A08245AAE001E9ABC /* keywords.table */, 93F1981A08245AAE001E9ABC /* keywords.table */,
...@@ -1268,6 +1274,7 @@ ...@@ -1268,6 +1274,7 @@
E1EF79AB0CE97BA60088D500 /* UTF8.h in Headers */, E1EF79AB0CE97BA60088D500 /* UTF8.h in Headers */,
1419D32D0CEA7CDE00FF507A /* RefCounted.h in Headers */, 1419D32D0CEA7CDE00FF507A /* RefCounted.h in Headers */,
5DA479660CFBCF56009328A0 /* TCPackedCache.h in Headers */, 5DA479660CFBCF56009328A0 /* TCPackedCache.h in Headers */,
14F252570D08DD8D004ECFFF /* JSVariableObject.h in Headers */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -1557,6 +1564,7 @@ ...@@ -1557,6 +1564,7 @@
932F5BC50822A1C700736975 /* runtime_root.cpp in Sources */, 932F5BC50822A1C700736975 /* runtime_root.cpp in Sources */,
E1EF79AA0CE97BA60088D500 /* UTF8.cpp in Sources */, E1EF79AA0CE97BA60088D500 /* UTF8.cpp in Sources */,
14DE0D690D02431400AACCA2 /* JSGlobalObject.cpp in Sources */, 14DE0D690D02431400AACCA2 /* JSGlobalObject.cpp in Sources */,
14F252610D08DF2F004ECFFF /* JSVariableObject.cpp in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
......
...@@ -75,6 +75,7 @@ Source files for JSCore. ...@@ -75,6 +75,7 @@ Source files for JSCore.
kjs/internal.cpp kjs/internal.cpp
kjs/interpreter.cpp kjs/interpreter.cpp
kjs/JSGlobalObject.cpp kjs/JSGlobalObject.cpp
kjs/JSVariableObject.cpp
kjs/JSImmediate.cpp kjs/JSImmediate.cpp
kjs/JSLock.cpp kjs/JSLock.cpp
kjs/JSWrapperObject.cpp kjs/JSWrapperObject.cpp
......
...@@ -50,10 +50,10 @@ ExecState::ExecState(JSGlobalObject* globalObject, JSObject* thisV, ...@@ -50,10 +50,10 @@ ExecState::ExecState(JSGlobalObject* globalObject, JSObject* thisV,
// create and initialize activation object (ECMA 10.1.6) // create and initialize activation object (ECMA 10.1.6)
if (type == FunctionCode) { if (type == FunctionCode) {
m_activation = new ActivationImp(this); m_activation = new ActivationImp(this);
m_variable = m_activation; m_variableObject = m_activation;
} else { } else {
m_activation = 0; m_activation = 0;
m_variable = globalObject; m_variableObject = globalObject;
} }
// ECMA 10.2 // ECMA 10.2
...@@ -61,7 +61,7 @@ ExecState::ExecState(JSGlobalObject* globalObject, JSObject* thisV, ...@@ -61,7 +61,7 @@ ExecState::ExecState(JSGlobalObject* globalObject, JSObject* thisV,
case EvalCode: case EvalCode:
if (m_callingExec) { if (m_callingExec) {
m_scopeChain = m_callingExec->scopeChain(); m_scopeChain = m_callingExec->scopeChain();
m_variable = m_callingExec->variableObject(); m_variableObject = m_callingExec->variableObject();
m_thisVal = m_callingExec->thisValue(); m_thisVal = m_callingExec->thisValue();
break; break;
} // else same as GlobalCode } // else same as GlobalCode
...@@ -72,7 +72,7 @@ ExecState::ExecState(JSGlobalObject* globalObject, JSObject* thisV, ...@@ -72,7 +72,7 @@ ExecState::ExecState(JSGlobalObject* globalObject, JSObject* thisV,
case FunctionCode: case FunctionCode:
m_scopeChain = func->scope(); m_scopeChain = func->scope();
m_scopeChain.push(m_activation); m_scopeChain.push(m_activation);
m_variable = m_activation; // TODO: DontDelete ? (ECMA 10.2.3) m_variableObject = m_activation;
m_thisVal = thisV; m_thisVal = thisV;
break; break;
} }
...@@ -106,7 +106,7 @@ JSGlobalObject* ExecState::lexicalGlobalObject() const ...@@ -106,7 +106,7 @@ JSGlobalObject* ExecState::lexicalGlobalObject() const
void ExecState::updateLocalStorage() void ExecState::updateLocalStorage()
{ {
m_localStorageBuffer = static_cast<ActivationImp*>(m_activation)->localStorage().data(); m_localStorageBuffer = m_activation->localStorage().data();
} }
} // namespace KJS } // namespace KJS
...@@ -38,12 +38,14 @@ namespace KJS { ...@@ -38,12 +38,14 @@ namespace KJS {
FunctionCode, FunctionCode,
}; };
class JSGlobalObject; class ActivationImp;
class ScopeChain; class FunctionBodyNode;
class Interpreter;
class FunctionImp; class FunctionImp;
class GlobalFuncImp; class GlobalFuncImp;
class FunctionBodyNode; class Interpreter;
class JSGlobalObject;
class JSVariableObject;
class ScopeChain;
struct LocalStorageEntry; struct LocalStorageEntry;
/** /**
...@@ -73,14 +75,14 @@ namespace KJS { ...@@ -73,14 +75,14 @@ namespace KJS {
const ScopeChain& scopeChain() const { return m_scopeChain; } const ScopeChain& scopeChain() const { return m_scopeChain; }
JSObject* variableObject() const { return m_variable; } JSVariableObject* variableObject() const { return m_variableObject; }
void setVariableObject(JSObject* v) { m_variable = v; } void setVariableObject(JSVariableObject* v) { m_variableObject = v; }
JSObject* thisValue() const { return m_thisVal; } JSObject* thisValue() const { return m_thisVal; }
ExecState* callingExecState() { return m_callingExec; } ExecState* callingExecState() { return m_callingExec; }
JSObject* activationObject() { return m_activation; } ActivationImp* activationObject() { return m_activation; }
CodeType codeType() { return m_codeType; } CodeType codeType() { return m_codeType; }
FunctionBodyNode* currentBody() { return m_currentBody; } FunctionBodyNode* currentBody() { return m_currentBody; }
FunctionImp* function() const { return m_function; } FunctionImp* function() const { return m_function; }
...@@ -128,11 +130,11 @@ namespace KJS { ...@@ -128,11 +130,11 @@ namespace KJS {
FunctionImp* m_function; FunctionImp* m_function;
const List* m_arguments; const List* m_arguments;
JSObject* m_activation; ActivationImp* m_activation;
LocalStorageEntry* m_localStorageBuffer; LocalStorageEntry* m_localStorageBuffer;
ScopeChain m_scopeChain; ScopeChain m_scopeChain;
JSObject* m_variable; JSVariableObject* m_variableObject;
JSObject* m_thisVal; JSObject* m_thisVal;
LabelStack ls; LabelStack ls;
......
This diff is collapsed.
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#ifndef KJS_GlobalObject_h #ifndef KJS_GlobalObject_h
#define KJS_GlobalObject_h #define KJS_GlobalObject_h
#include "object.h" #include "JSVariableObject.h"
namespace KJS { namespace KJS {
...@@ -67,11 +67,14 @@ namespace KJS { ...@@ -67,11 +67,14 @@ namespace KJS {
enum CompatMode { NativeMode, IECompat, NetscapeCompat }; enum CompatMode { NativeMode, IECompat, NetscapeCompat };
class JSGlobalObject : public JSObject { class JSGlobalObject : public JSVariableObject {
protected: protected:
struct JSGlobalObjectData { using JSVariableObject::JSVariableObjectData;
struct JSGlobalObjectData : public JSVariableObjectData {
JSGlobalObjectData(JSGlobalObject* globalObject) JSGlobalObjectData(JSGlobalObject* globalObject)
: globalExec(globalObject, globalObject, 0) : JSVariableObjectData(&inlineSymbolTable)
, globalExec(globalObject, globalObject, 0)
{ {
} }
...@@ -80,7 +83,7 @@ namespace KJS { ...@@ -80,7 +83,7 @@ namespace KJS {
Debugger* debugger; Debugger* debugger;
CompatMode compatMode; CompatMode compatMode;
ExecState globalExec; ExecState globalExec;
ExecState* currentExec; ExecState* currentExec;
int recursion; int recursion;
...@@ -123,17 +126,20 @@ namespace KJS { ...@@ -123,17 +126,20 @@ namespace KJS {
NativeErrorPrototype* syntaxErrorPrototype; NativeErrorPrototype* syntaxErrorPrototype;
NativeErrorPrototype* typeErrorPrototype; NativeErrorPrototype* typeErrorPrototype;
NativeErrorPrototype* URIErrorPrototype; NativeErrorPrototype* URIErrorPrototype;
SymbolTable inlineSymbolTable;
}; };
public: public:
JSGlobalObject() JSGlobalObject()
: JSVariableObject(new JSGlobalObjectData(this))
{ {
init(); init();
} }
protected: protected:
JSGlobalObject(JSValue* proto) JSGlobalObject(JSValue* proto)
: JSObject(proto) : JSVariableObject(proto, new JSGlobalObjectData(this))
{ {
init(); init();
} }
...@@ -143,7 +149,7 @@ namespace KJS { ...@@ -143,7 +149,7 @@ namespace KJS {
// Linked list of all global objects. // Linked list of all global objects.
static JSGlobalObject* head() { return s_head; } static JSGlobalObject* head() { return s_head; }
JSGlobalObject* next() { return d->next; } JSGlobalObject* next() { return d()->next; }
// Resets the global object to contain only built-in properties, sets // Resets the global object to contain only built-in properties, sets
// the global object's prototype to "prototype," then adds the // the global object's prototype to "prototype," then adds the
...@@ -154,59 +160,59 @@ namespace KJS { ...@@ -154,59 +160,59 @@ namespace KJS {
// The following accessors return pristine values, even if a script // The following accessors return pristine values, even if a script
// replaces the global object's associated property. // replaces the global object's associated property.
ObjectObjectImp* objectConstructor() const { return d->objectConstructor; } ObjectObjectImp* objectConstructor() const { return d()->objectConstructor; }
FunctionObjectImp* functionConstructor() const { return d->functionConstructor; } FunctionObjectImp* functionConstructor() const { return d()->functionConstructor; }
ArrayObjectImp* arrayConstructor() const { return d->arrayConstructor; } ArrayObjectImp* arrayConstructor() const { return d()->arrayConstructor; }
BooleanObjectImp* booleanConstructor() const { return d->booleanConstructor; } BooleanObjectImp* booleanConstructor() const { return d()->booleanConstructor; }
StringObjectImp* stringConstructor() const{ return d->stringConstructor; } StringObjectImp* stringConstructor() const{ return d()->stringConstructor; }
NumberObjectImp* numberConstructor() const{ return d->numberConstructor; } NumberObjectImp* numberConstructor() const{ return d()->numberConstructor; }
DateObjectImp* dateConstructor() const{ return d->dateConstructor; } DateObjectImp* dateConstructor() const{ return d()->dateConstructor; }
RegExpObjectImp* regExpConstructor() const { return d->regExpConstructor; } RegExpObjectImp* regExpConstructor() const { return d()->regExpConstructor; }
ErrorObjectImp* errorConstructor() const { return d->errorConstructor; } ErrorObjectImp* errorConstructor() const { return d()->errorConstructor; }
NativeErrorImp* evalErrorConstructor() const { return d->evalErrorConstructor; } NativeErrorImp* evalErrorConstructor() const { return d()->evalErrorConstructor; }
NativeErrorImp* rangeErrorConstructor() const { return d->rangeErrorConstructor; } NativeErrorImp* rangeErrorConstructor() const { return d()->rangeErrorConstructor; }
NativeErrorImp* referenceErrorConstructor() const { return d->referenceErrorConstructor; } NativeErrorImp* referenceErrorConstructor() const { return d()->referenceErrorConstructor; }
NativeErrorImp* syntaxErrorConstructor() const { return d->syntaxErrorConstructor; } NativeErrorImp* syntaxErrorConstructor() const { return d()->syntaxErrorConstructor; }
NativeErrorImp* typeErrorConstructor() const { return d->typeErrorConstructor; } NativeErrorImp* typeErrorConstructor() const { return d()->typeErrorConstructor; }
NativeErrorImp* URIErrorConstructor() const { return d->URIErrorConstructor; } NativeErrorImp* URIErrorConstructor() const { return d()->URIErrorConstructor; }
ObjectPrototype* objectPrototype() const { return d->objectPrototype; } ObjectPrototype* objectPrototype() const { return d()->objectPrototype; }
FunctionPrototype* functionPrototype() const { return d->functionPrototype; } FunctionPrototype* functionPrototype() const { return d()->functionPrototype; }
ArrayPrototype* arrayPrototype() const { return d->arrayPrototype; } ArrayPrototype* arrayPrototype() const { return d()->arrayPrototype; }
BooleanPrototype* booleanPrototype() const { return d->booleanPrototype; } BooleanPrototype* booleanPrototype() const { return d()->booleanPrototype; }
StringPrototype* stringPrototype() const { return d->stringPrototype; } StringPrototype* stringPrototype() const { return d()->stringPrototype; }
NumberPrototype* numberPrototype() const { return d->numberPrototype; } NumberPrototype* numberPrototype() const { return d()->numberPrototype; }
DatePrototype* datePrototype() const { return d->datePrototype; } DatePrototype* datePrototype() const { return d()->datePrototype; }
RegExpPrototype* regExpPrototype() const { return d->regExpPrototype; } RegExpPrototype* regExpPrototype() const { return d()->regExpPrototype; }
ErrorPrototype* errorPrototype() const { return d->errorPrototype; } ErrorPrototype* errorPrototype() const { return d()->errorPrototype; }
NativeErrorPrototype* evalErrorPrototype() const { return d->evalErrorPrototype; } NativeErrorPrototype* evalErrorPrototype() const { return d()->evalErrorPrototype; }
NativeErrorPrototype* rangeErrorPrototype() const { return d->rangeErrorPrototype; } NativeErrorPrototype* rangeErrorPrototype() const { return d()->rangeErrorPrototype; }
NativeErrorPrototype* referenceErrorPrototype() const { return d->referenceErrorPrototype; } NativeErrorPrototype* referenceErrorPrototype() const { return d()->referenceErrorPrototype; }
NativeErrorPrototype* syntaxErrorPrototype() const { return d->syntaxErrorPrototype; } NativeErrorPrototype* syntaxErrorPrototype() const { return d()->syntaxErrorPrototype; }
NativeErrorPrototype* typeErrorPrototype() const { return d->typeErrorPrototype; } NativeErrorPrototype* typeErrorPrototype() const { return d()->typeErrorPrototype; }
NativeErrorPrototype* URIErrorPrototype() const { return d->URIErrorPrototype; } NativeErrorPrototype* URIErrorPrototype() const { return d()->URIErrorPrototype; }
void saveBuiltins(SavedBuiltins&) const; void saveBuiltins(SavedBuiltins&) const;
void restoreBuiltins(const SavedBuiltins&); void restoreBuiltins(const SavedBuiltins&);
void setTimeoutTime(unsigned timeoutTime) { d->timeoutTime = timeoutTime; } void setTimeoutTime(unsigned timeoutTime) { d()->timeoutTime = timeoutTime; }
void startTimeoutCheck(); void startTimeoutCheck();
void stopTimeoutCheck(); void stopTimeoutCheck();
bool timedOut(); bool timedOut();
Debugger* debugger() const { return d->debugger; } Debugger* debugger() const { return d()->debugger; }
void setDebugger(Debugger* debugger) { d->debugger = debugger; } void setDebugger(Debugger* debugger) { d()->debugger = debugger; }
void setCurrentExec(ExecState* exec) { d->currentExec = exec; } void setCurrentExec(ExecState* exec) { d()->currentExec = exec; }
ExecState* currentExec() const { return d->currentExec; } ExecState* currentExec() const { return d()->currentExec; }
// FIXME: Let's just pick one compatible behavior and go with it. // FIXME: Let's just pick one compatible behavior and go with it.
void setCompatMode(CompatMode mode) { d->compatMode = mode; } void setCompatMode(CompatMode mode) { d()->compatMode = mode; }
CompatMode compatMode() const { return d->compatMode; } CompatMode compatMode() const { return d()->compatMode; }
int recursion() { return d->recursion; } int recursion() { return d()->recursion; }
void incRecursion() { ++d->recursion; } void incRecursion() { ++d()->recursion; }
void decRecursion() { --d->recursion; } void decRecursion() { --d()->recursion; }
virtual void mark(); virtual void mark();
...@@ -218,11 +224,10 @@ namespace KJS { ...@@ -218,11 +224,10 @@ namespace KJS {
virtual bool isSafeScript(const JSGlobalObject*) const { return true; } virtual bool isSafeScript(const JSGlobalObject*) const { return true; }
protected:
std::auto_ptr<JSGlobalObjectData> d;
private: private:
void init(); void init();
JSGlobalObjectData* d() const { return static_cast<JSGlobalObjectData*>(JSVariableObject::d); }
bool checkTimeout(); bool checkTimeout();
void resetTimeoutCheck(); void resetTimeoutCheck();
...@@ -232,9 +237,9 @@ namespace KJS { ...@@ -232,9 +237,9 @@ namespace KJS {
inline bool JSGlobalObject::timedOut() inline bool JSGlobalObject::timedOut()
{ {
d->tickCount++; d()->tickCount++;
if (d->tickCount != d->ticksUntilNextTimeoutCheck) if (d()->tickCount != d()->ticksUntilNextTimeoutCheck)
return false; return false;