top level:
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Nov 2002 06:59:09 +0000 (06:59 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Nov 2002 06:59:09 +0000 (06:59 +0000)
        * Site/Internal/Design/CFURL.rtf: Added.

Tools:

        * Scripts/last-update: Added. Script for Trey that tells you when
you last did a cvs update, based on most-recently updated ChangeLog.

JavaScriptCore:

- stop garbage collecting the ActivationImp objects, gets 3% on iBench
- pave the way to separate the argument lists from scope chains

        * kjs/context.h: Added. Moved ContextImp here so it can use things defined
in function.h

        * kjs/scope_chain.h: Added. Starting as a copy of List, to be improved.
        * kjs/scope_chain.cpp: Added. Starting as a copy of List, to be improved.

        * JavaScriptCore.pbproj/project.pbxproj: Rearranged things, added context.h.

        * kjs/function.cpp:
        (FunctionImp::call): Pass InterpreterImp, not ExecState, to ContextImp.
        (DeclaredFunctionImp::DeclaredFunctionImp): List -> ScopeChain.
        (ActivationImp::createArgumentsObject): ArgumentList -> List.
        (GlobalFuncImp::call): Pass InterpreterImp, not an ExecState, to ContextImp.
        * kjs/function.h: List -> ScopeChain.
        * kjs/function_object.cpp: (FunctionObjectImp::construct): List -> ScopeChain.
        * kjs/internal.cpp:
        (ContextImp::ContextImp): Set the context in the interpreter.
        (ContextImp::~ContextImp): Set the context in the interpreter to the caller.
        (ContextImp::mark): Mark all the activation objects.
        (InterpreterImp::InterpreterImp): Initialize context to 0.
        (InterpreterImp::mark): Mark the top context.
        (InterpreterImp::evaluate): Pass InterpreterImp to ContextImp.
        * kjs/internal.h: Move ContextImp to its own header. Add setContext to InterpreterImp.
        * kjs/interpreter.cpp: (Context::scopeChain): List -> ScopeChain.
        * kjs/interpreter.h: List -> ScopeChain.
        * kjs/nodes.cpp:
        (ResolveNode::evaluateReference): List -> ScopeChain.
        (FuncDeclNode::processFuncDecl): List -> ScopeChain.
        (FuncExprNode::evaluate): List -> ScopeChain.
        * kjs/object.cpp: List -> ScopeChain.
        * kjs/object.h: List -> ScopeChain.

        * kjs/types.h: Remove needsMarking features from List.
        * kjs/types.cpp: Ditto.

WebCore:

        * khtml/ecma/kjs_dom.cpp: (DOMNode::eventHandlerScope): List -> ScopeChain.
        * khtml/ecma/kjs_dom.h: List -> ScopeChain.
        * khtml/ecma/kjs_events.cpp: (JSEventListener::handleEvent): List -> ScopeChain.
        * khtml/ecma/kjs_html.cpp: (KJS::HTMLElement::eventHandlerScope): List -> ScopeChain.
        * khtml/ecma/kjs_html.h: List -> ScopeChain.

        * force-js-clean-timestamp: Not sure this is required, but better safe than sorry.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@2821 268f45cc-cd09-0410-ab3c-d52691b4dbfc

30 files changed:
JavaScriptCore/ChangeLog
JavaScriptCore/ChangeLog-2002-12-03
JavaScriptCore/ChangeLog-2003-10-25
JavaScriptCore/JavaScriptCore.pbproj/project.pbxproj
JavaScriptCore/kjs/context.h [new file with mode: 0644]
JavaScriptCore/kjs/function.cpp
JavaScriptCore/kjs/function.h
JavaScriptCore/kjs/function_object.cpp
JavaScriptCore/kjs/internal.cpp
JavaScriptCore/kjs/internal.h
JavaScriptCore/kjs/interpreter.cpp
JavaScriptCore/kjs/interpreter.h
JavaScriptCore/kjs/nodes.cpp
JavaScriptCore/kjs/object.cpp
JavaScriptCore/kjs/object.h
JavaScriptCore/kjs/property_map.cpp
JavaScriptCore/kjs/property_map.h
JavaScriptCore/kjs/scope_chain.cpp [new file with mode: 0644]
JavaScriptCore/kjs/scope_chain.h [new file with mode: 0644]
JavaScriptCore/kjs/types.cpp
JavaScriptCore/kjs/types.h
WebCore/ChangeLog-2002-12-03
WebCore/ChangeLog-2003-10-25
WebCore/ChangeLog-2005-08-23
WebCore/force-js-clean-timestamp
WebCore/khtml/ecma/kjs_dom.cpp
WebCore/khtml/ecma/kjs_dom.h
WebCore/khtml/ecma/kjs_events.cpp
WebCore/khtml/ecma/kjs_html.cpp
WebCore/khtml/ecma/kjs_html.h

index 976a7126f1e06b4e5b023d99d0034b321da3f7eb..dbab7867575756c6b8ff30c8256247ddb9127573 100644 (file)
@@ -1,3 +1,43 @@
+2002-11-21  Darin Adler  <darin@apple.com>
+
+       - stop garbage collecting the ActivationImp objects, gets 3% on iBench
+       - pave the way to separate the argument lists from scope chains
+
+        * kjs/context.h: Added. Moved ContextImp here so it can use things defined
+       in function.h
+
+        * kjs/scope_chain.h: Added. Starting as a copy of List, to be improved.
+        * kjs/scope_chain.cpp: Added. Starting as a copy of List, to be improved.
+
+        * JavaScriptCore.pbproj/project.pbxproj: Rearranged things, added context.h.
+
+        * kjs/function.cpp:
+        (FunctionImp::call): Pass InterpreterImp, not ExecState, to ContextImp.
+        (DeclaredFunctionImp::DeclaredFunctionImp): List -> ScopeChain.
+        (ActivationImp::createArgumentsObject): ArgumentList -> List.
+        (GlobalFuncImp::call): Pass InterpreterImp, not an ExecState, to ContextImp.
+        * kjs/function.h: List -> ScopeChain.
+        * kjs/function_object.cpp: (FunctionObjectImp::construct): List -> ScopeChain.
+        * kjs/internal.cpp:
+        (ContextImp::ContextImp): Set the context in the interpreter.
+        (ContextImp::~ContextImp): Set the context in the interpreter to the caller.
+        (ContextImp::mark): Mark all the activation objects.
+        (InterpreterImp::InterpreterImp): Initialize context to 0.
+        (InterpreterImp::mark): Mark the top context.
+        (InterpreterImp::evaluate): Pass InterpreterImp to ContextImp.
+        * kjs/internal.h: Move ContextImp to its own header. Add setContext to InterpreterImp.
+        * kjs/interpreter.cpp: (Context::scopeChain): List -> ScopeChain.
+        * kjs/interpreter.h: List -> ScopeChain.
+        * kjs/nodes.cpp:
+        (ResolveNode::evaluateReference): List -> ScopeChain.
+        (FuncDeclNode::processFuncDecl): List -> ScopeChain.
+        (FuncExprNode::evaluate): List -> ScopeChain.
+        * kjs/object.cpp: List -> ScopeChain.
+        * kjs/object.h: List -> ScopeChain.
+
+        * kjs/types.h: Remove needsMarking features from List.
+        * kjs/types.cpp: Ditto.
+
 2002-11-21  Maciej Stachowiak  <mjs@apple.com>
 
        - reduced the size of PropertyMap by storing sizes and such in the
index 976a7126f1e06b4e5b023d99d0034b321da3f7eb..dbab7867575756c6b8ff30c8256247ddb9127573 100644 (file)
@@ -1,3 +1,43 @@
+2002-11-21  Darin Adler  <darin@apple.com>
+
+       - stop garbage collecting the ActivationImp objects, gets 3% on iBench
+       - pave the way to separate the argument lists from scope chains
+
+        * kjs/context.h: Added. Moved ContextImp here so it can use things defined
+       in function.h
+
+        * kjs/scope_chain.h: Added. Starting as a copy of List, to be improved.
+        * kjs/scope_chain.cpp: Added. Starting as a copy of List, to be improved.
+
+        * JavaScriptCore.pbproj/project.pbxproj: Rearranged things, added context.h.
+
+        * kjs/function.cpp:
+        (FunctionImp::call): Pass InterpreterImp, not ExecState, to ContextImp.
+        (DeclaredFunctionImp::DeclaredFunctionImp): List -> ScopeChain.
+        (ActivationImp::createArgumentsObject): ArgumentList -> List.
+        (GlobalFuncImp::call): Pass InterpreterImp, not an ExecState, to ContextImp.
+        * kjs/function.h: List -> ScopeChain.
+        * kjs/function_object.cpp: (FunctionObjectImp::construct): List -> ScopeChain.
+        * kjs/internal.cpp:
+        (ContextImp::ContextImp): Set the context in the interpreter.
+        (ContextImp::~ContextImp): Set the context in the interpreter to the caller.
+        (ContextImp::mark): Mark all the activation objects.
+        (InterpreterImp::InterpreterImp): Initialize context to 0.
+        (InterpreterImp::mark): Mark the top context.
+        (InterpreterImp::evaluate): Pass InterpreterImp to ContextImp.
+        * kjs/internal.h: Move ContextImp to its own header. Add setContext to InterpreterImp.
+        * kjs/interpreter.cpp: (Context::scopeChain): List -> ScopeChain.
+        * kjs/interpreter.h: List -> ScopeChain.
+        * kjs/nodes.cpp:
+        (ResolveNode::evaluateReference): List -> ScopeChain.
+        (FuncDeclNode::processFuncDecl): List -> ScopeChain.
+        (FuncExprNode::evaluate): List -> ScopeChain.
+        * kjs/object.cpp: List -> ScopeChain.
+        * kjs/object.h: List -> ScopeChain.
+
+        * kjs/types.h: Remove needsMarking features from List.
+        * kjs/types.cpp: Ditto.
+
 2002-11-21  Maciej Stachowiak  <mjs@apple.com>
 
        - reduced the size of PropertyMap by storing sizes and such in the
index 976a7126f1e06b4e5b023d99d0034b321da3f7eb..dbab7867575756c6b8ff30c8256247ddb9127573 100644 (file)
@@ -1,3 +1,43 @@
+2002-11-21  Darin Adler  <darin@apple.com>
+
+       - stop garbage collecting the ActivationImp objects, gets 3% on iBench
+       - pave the way to separate the argument lists from scope chains
+
+        * kjs/context.h: Added. Moved ContextImp here so it can use things defined
+       in function.h
+
+        * kjs/scope_chain.h: Added. Starting as a copy of List, to be improved.
+        * kjs/scope_chain.cpp: Added. Starting as a copy of List, to be improved.
+
+        * JavaScriptCore.pbproj/project.pbxproj: Rearranged things, added context.h.
+
+        * kjs/function.cpp:
+        (FunctionImp::call): Pass InterpreterImp, not ExecState, to ContextImp.
+        (DeclaredFunctionImp::DeclaredFunctionImp): List -> ScopeChain.
+        (ActivationImp::createArgumentsObject): ArgumentList -> List.
+        (GlobalFuncImp::call): Pass InterpreterImp, not an ExecState, to ContextImp.
+        * kjs/function.h: List -> ScopeChain.
+        * kjs/function_object.cpp: (FunctionObjectImp::construct): List -> ScopeChain.
+        * kjs/internal.cpp:
+        (ContextImp::ContextImp): Set the context in the interpreter.
+        (ContextImp::~ContextImp): Set the context in the interpreter to the caller.
+        (ContextImp::mark): Mark all the activation objects.
+        (InterpreterImp::InterpreterImp): Initialize context to 0.
+        (InterpreterImp::mark): Mark the top context.
+        (InterpreterImp::evaluate): Pass InterpreterImp to ContextImp.
+        * kjs/internal.h: Move ContextImp to its own header. Add setContext to InterpreterImp.
+        * kjs/interpreter.cpp: (Context::scopeChain): List -> ScopeChain.
+        * kjs/interpreter.h: List -> ScopeChain.
+        * kjs/nodes.cpp:
+        (ResolveNode::evaluateReference): List -> ScopeChain.
+        (FuncDeclNode::processFuncDecl): List -> ScopeChain.
+        (FuncExprNode::evaluate): List -> ScopeChain.
+        * kjs/object.cpp: List -> ScopeChain.
+        * kjs/object.h: List -> ScopeChain.
+
+        * kjs/types.h: Remove needsMarking features from List.
+        * kjs/types.cpp: Ditto.
+
 2002-11-21  Maciej Stachowiak  <mjs@apple.com>
 
        - reduced the size of PropertyMap by storing sizes and such in the
index 6762d2e41720e4e673a2c2b84a02ad8606cde6be..086e9260dbb8a4e5605b4e68aa2759f23ef24533 100644 (file)
                                F5BB2BC7030F772101FCFE1D,
                                933A349C038AE7C6008635CE,
                                938772E6038BFE19008635CE,
+                               9374D3A9038D9D74008635CE,
+                               9373524F038DA8C2008635CE,
                        );
                        isa = PBXHeadersBuildPhase;
                        runOnlyForDeploymentPostprocessing = 0;
                                F5341395030CF5F8018BE7F3,
                                F5BB2BC6030F772101FCFE1D,
                                933A349E038AE80F008635CE,
+                               9374D3AA038D9D74008635CE,
                        );
                        isa = PBXSourcesBuildPhase;
                        runOnlyForDeploymentPostprocessing = 0;
                                F692A8530255597D01FF60F7,
                                F5BB2BC4030F772101FCFE1D,
                                F5BB2BC5030F772101FCFE1D,
+                               9373524E038DA8C2008635CE,
                                F692A8550255597D01FF60F7,
                                F692A8560255597D01FF60F7,
                                F692A8570255597D01FF60F7,
                                F692A87C0255597D01FF60F7,
                                F692A87D0255597D01FF60F7,
                                F692A87E0255597D01FF60F7,
+                               9374D3A7038D9D74008635CE,
+                               9374D3A8038D9D74008635CE,
                                F50888B6030BB74C012A967E,
                                F692A87F0255597D01FF60F7,
                                F692A8800255597D01FF60F7,
                                F692A8810255597D01FF60F7,
-                               F692A8830255597D01FF60F7,
                                F692A8840255597D01FF60F7,
-                               F692A8850255597D01FF60F7,
+                               F692A8830255597D01FF60F7,
                                F692A8860255597D01FF60F7,
-                               F692A8870255597D01FF60F7,
+                               F692A8850255597D01FF60F7,
                                F692A8880255597D01FF60F7,
+                               F692A8870255597D01FF60F7,
                        );
                        isa = PBXGroup;
                        name = Classes;
+                       path = kjs;
                        refType = 4;
                };
 //080
                933A3499038AE7C6008635CE = {
                        fileEncoding = 4;
                        isa = PBXFileReference;
-                       name = grammar.y;
-                       path = kjs/grammar.y;
+                       path = grammar.y;
                        refType = 4;
                };
                933A349A038AE7C6008635CE = {
                        fileEncoding = 4;
                        isa = PBXFileReference;
-                       name = identifier.h;
-                       path = kjs/identifier.h;
+                       path = identifier.h;
                        refType = 4;
                };
                933A349C038AE7C6008635CE = {
                933A349D038AE80F008635CE = {
                        fileEncoding = 4;
                        isa = PBXFileReference;
-                       name = identifier.cpp;
-                       path = kjs/identifier.cpp;
+                       path = identifier.cpp;
                        refType = 4;
                };
                933A349E038AE80F008635CE = {
                        settings = {
                        };
                };
+               9373524E038DA8C2008635CE = {
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       path = context.h;
+                       refType = 4;
+               };
+               9373524F038DA8C2008635CE = {
+                       fileRef = 9373524E038DA8C2008635CE;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Private,
+                               );
+                       };
+               };
+               9374D3A7038D9D74008635CE = {
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       path = scope_chain.h;
+                       refType = 4;
+               };
+               9374D3A8038D9D74008635CE = {
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       path = scope_chain.cpp;
+                       refType = 4;
+               };
+               9374D3A9038D9D74008635CE = {
+                       fileRef = 9374D3A7038D9D74008635CE;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Private,
+                               );
+                       };
+               };
+               9374D3AA038D9D74008635CE = {
+                       fileRef = 9374D3A8038D9D74008635CE;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
                938772E5038BFE19008635CE = {
                        fileEncoding = 4;
                        isa = PBXFileReference;
                F50888B6030BB74C012A967E = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = simple_number.h;
-                       path = kjs/simple_number.h;
+                       path = simple_number.h;
                        refType = 4;
                };
                F50888B7030BB74C012A967E = {
                F5341390030CEEB1018BE7F3 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = reference.cpp;
-                       path = kjs/reference.cpp;
+                       path = reference.cpp;
                        refType = 4;
                };
                F5341391030CEEB1018BE7F3 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = reference.h;
-                       path = kjs/reference.h;
+                       path = reference.h;
                        refType = 4;
                };
                F5341392030CEEB1018BE7F3 = {
                F5341394030CF5F8018BE7F3 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = reference_list.cpp;
-                       path = kjs/reference_list.cpp;
+                       path = reference_list.cpp;
                        refType = 4;
                };
                F5341395030CF5F8018BE7F3 = {
                F54F0800030CD22001B5C2EB = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = reference_list.h;
-                       path = kjs/reference_list.h;
+                       path = reference_list.h;
                        refType = 4;
                };
                F54F0801030CD22001B5C2EB = {
                F5BB2BC4030F772101FCFE1D = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = completion.cpp;
-                       path = kjs/completion.cpp;
+                       path = completion.cpp;
                        refType = 4;
                };
                F5BB2BC5030F772101FCFE1D = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = completion.h;
-                       path = kjs/completion.h;
+                       path = completion.h;
                        refType = 4;
                };
                F5BB2BC6030F772101FCFE1D = {
                        );
                        isa = PBXGroup;
                        name = "Other Sources";
-                       path = "";
+                       path = kjs;
                        refType = 4;
                };
                F5C290E60284F98E018635CA = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       path = JavaScriptCorePrefix.h;
+                       name = JavaScriptCorePrefix.h;
+                       path = ../JavaScriptCorePrefix.h;
                        refType = 4;
                };
                F5C290E70284F98E018635CA = {
                F5FFE656026B47A6018635CA = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = nodes2string.cpp;
-                       path = kjs/nodes2string.cpp;
+                       path = nodes2string.cpp;
                        refType = 4;
                };
                F5FFE657026B47A6018635CA = {
                F68EBB8C0255D4C601FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = config.h;
-                       path = kjs/config.h;
+                       path = config.h;
                        refType = 4;
                };
                F68EBB8E0255D4C601FF60F7 = {
                F692A84D0255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = array_object.cpp;
-                       path = kjs/array_object.cpp;
+                       path = array_object.cpp;
                        refType = 4;
                };
                F692A84E0255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = array_object.h;
-                       path = kjs/array_object.h;
+                       path = array_object.h;
                        refType = 4;
                };
                F692A84F0255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = array_object.lut.h;
-                       path = kjs/array_object.lut.h;
+                       path = array_object.lut.h;
                        refType = 4;
                };
                F692A8500255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = bool_object.cpp;
-                       path = kjs/bool_object.cpp;
+                       path = bool_object.cpp;
                        refType = 4;
                };
                F692A8510255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = bool_object.h;
-                       path = kjs/bool_object.h;
+                       path = bool_object.h;
                        refType = 4;
                };
                F692A8520255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = collector.cpp;
-                       path = kjs/collector.cpp;
+                       path = collector.cpp;
                        refType = 4;
                };
                F692A8530255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = collector.h;
-                       path = kjs/collector.h;
+                       path = collector.h;
                        refType = 4;
                };
                F692A8540255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXExecutableFileReference;
-                       name = create_hash_table;
-                       path = kjs/create_hash_table;
+                       path = create_hash_table;
                        refType = 4;
                };
                F692A8550255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = date_object.cpp;
-                       path = kjs/date_object.cpp;
+                       path = date_object.cpp;
                        refType = 4;
                };
                F692A8560255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = date_object.h;
-                       path = kjs/date_object.h;
+                       path = date_object.h;
                        refType = 4;
                };
                F692A8570255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = date_object.lut.h;
-                       path = kjs/date_object.lut.h;
+                       path = date_object.lut.h;
                        refType = 4;
                };
                F692A8580255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = debugger.cpp;
-                       path = kjs/debugger.cpp;
+                       path = debugger.cpp;
                        refType = 4;
                };
                F692A8590255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = debugger.h;
-                       path = kjs/debugger.h;
+                       path = debugger.h;
                        refType = 4;
                };
                F692A85A0255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = error_object.cpp;
-                       path = kjs/error_object.cpp;
+                       path = error_object.cpp;
                        refType = 4;
                };
                F692A85B0255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = error_object.h;
-                       path = kjs/error_object.h;
+                       path = error_object.h;
                        refType = 4;
                };
                F692A85C0255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = function_object.cpp;
-                       path = kjs/function_object.cpp;
+                       path = function_object.cpp;
                        refType = 4;
                };
                F692A85D0255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = function_object.h;
-                       path = kjs/function_object.h;
+                       path = function_object.h;
                        refType = 4;
                };
                F692A85E0255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = function.cpp;
-                       path = kjs/function.cpp;
+                       path = function.cpp;
                        refType = 4;
                };
                F692A85F0255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = function.h;
-                       path = kjs/function.h;
+                       path = function.h;
                        refType = 4;
                };
                F692A8610255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = internal.cpp;
-                       path = kjs/internal.cpp;
+                       path = internal.cpp;
                        refType = 4;
                };
                F692A8620255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = internal.h;
-                       path = kjs/internal.h;
+                       path = internal.h;
                        refType = 4;
                };
                F692A8630255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = interpreter.cpp;
-                       path = kjs/interpreter.cpp;
+                       path = interpreter.cpp;
                        refType = 4;
                };
                F692A8640255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = interpreter.h;
-                       path = kjs/interpreter.h;
+                       path = interpreter.h;
                        refType = 4;
                };
                F692A8650255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = lexer.cpp;
-                       path = kjs/lexer.cpp;
+                       path = lexer.cpp;
                        refType = 4;
                };
                F692A8660255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = lexer.h;
-                       path = kjs/lexer.h;
+                       path = lexer.h;
                        refType = 4;
                };
                F692A8670255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = lexer.lut.h;
-                       path = kjs/lexer.lut.h;
+                       path = lexer.lut.h;
                        refType = 4;
                };
                F692A8680255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = lookup.cpp;
-                       path = kjs/lookup.cpp;
+                       path = lookup.cpp;
                        refType = 4;
                };
                F692A8690255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = lookup.h;
-                       path = kjs/lookup.h;
+                       path = lookup.h;
                        refType = 4;
                };
                F692A86A0255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = math_object.cpp;
-                       path = kjs/math_object.cpp;
+                       path = math_object.cpp;
                        refType = 4;
                };
                F692A86B0255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = math_object.h;
-                       path = kjs/math_object.h;
+                       path = math_object.h;
                        refType = 4;
                };
                F692A86C0255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = math_object.lut.h;
-                       path = kjs/math_object.lut.h;
+                       path = math_object.lut.h;
                        refType = 4;
                };
                F692A86D0255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = nodes.cpp;
-                       path = kjs/nodes.cpp;
+                       path = nodes.cpp;
                        refType = 4;
                };
                F692A86E0255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = nodes.h;
-                       path = kjs/nodes.h;
+                       path = nodes.h;
                        refType = 4;
                };
                F692A8700255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = number_object.cpp;
-                       path = kjs/number_object.cpp;
+                       path = number_object.cpp;
                        refType = 4;
                };
                F692A8710255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = number_object.h;
-                       path = kjs/number_object.h;
+                       path = number_object.h;
                        refType = 4;
                };
                F692A8720255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = number_object.lut.h;
-                       path = kjs/number_object.lut.h;
+                       path = number_object.lut.h;
                        refType = 4;
                };
                F692A8730255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = object_object.cpp;
-                       path = kjs/object_object.cpp;
+                       path = object_object.cpp;
                        refType = 4;
                };
                F692A8740255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = object_object.h;
-                       path = kjs/object_object.h;
+                       path = object_object.h;
                        refType = 4;
                };
                F692A8750255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = object.cpp;
-                       path = kjs/object.cpp;
+                       path = object.cpp;
                        refType = 4;
                };
                F692A8760255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = object.h;
-                       path = kjs/object.h;
+                       path = object.h;
                        refType = 4;
                };
                F692A8770255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = operations.cpp;
-                       path = kjs/operations.cpp;
+                       path = operations.cpp;
                        refType = 4;
                };
                F692A8780255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = operations.h;
-                       path = kjs/operations.h;
+                       path = operations.h;
                        refType = 4;
                };
                F692A8790255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = property_map.cpp;
-                       path = kjs/property_map.cpp;
+                       path = property_map.cpp;
                        refType = 4;
                };
                F692A87A0255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = property_map.h;
-                       path = kjs/property_map.h;
+                       path = property_map.h;
                        refType = 4;
                };
                F692A87B0255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = regexp_object.cpp;
-                       path = kjs/regexp_object.cpp;
+                       path = regexp_object.cpp;
                        refType = 4;
                };
                F692A87C0255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = regexp_object.h;
-                       path = kjs/regexp_object.h;
+                       path = regexp_object.h;
                        refType = 4;
                };
                F692A87D0255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = regexp.cpp;
-                       path = kjs/regexp.cpp;
+                       path = regexp.cpp;
                        refType = 4;
                };
                F692A87E0255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = regexp.h;
-                       path = kjs/regexp.h;
+                       path = regexp.h;
                        refType = 4;
                };
                F692A87F0255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = string_object.cpp;
-                       path = kjs/string_object.cpp;
+                       path = string_object.cpp;
                        refType = 4;
                };
                F692A8800255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = string_object.h;
-                       path = kjs/string_object.h;
+                       path = string_object.h;
                        refType = 4;
                };
                F692A8810255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = string_object.lut.h;
-                       path = kjs/string_object.lut.h;
+                       path = string_object.lut.h;
                        refType = 4;
                };
                F692A8830255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = types.cpp;
-                       path = kjs/types.cpp;
+                       path = types.cpp;
                        refType = 4;
                };
                F692A8840255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = types.h;
-                       path = kjs/types.h;
+                       path = types.h;
                        refType = 4;
                };
                F692A8850255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = ustring.cpp;
-                       path = kjs/ustring.cpp;
+                       path = ustring.cpp;
                        refType = 4;
                };
                F692A8860255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = ustring.h;
-                       path = kjs/ustring.h;
+                       path = ustring.h;
                        refType = 4;
                };
                F692A8870255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = value.cpp;
-                       path = kjs/value.cpp;
+                       path = value.cpp;
                        refType = 4;
                };
                F692A8880255597D01FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = value.h;
-                       path = kjs/value.h;
+                       path = value.h;
                        refType = 4;
                };
                F692A8890255597D01FF60F7 = {
                F692A8C802555BA201FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = grammar.cpp;
-                       path = kjs/grammar.cpp;
+                       path = grammar.cpp;
                        refType = 4;
                };
                F692A8C902555BA201FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = grammar.cpp.h;
-                       path = kjs/grammar.cpp.h;
+                       path = grammar.cpp.h;
                        refType = 4;
                };
                F692A8CA02555BA201FF60F7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
-                       name = grammar.h;
-                       path = kjs/grammar.h;
+                       path = grammar.h;
                        refType = 4;
                };
                F692A8CB02555BA201FF60F7 = {
diff --git a/JavaScriptCore/kjs/context.h b/JavaScriptCore/kjs/context.h
new file mode 100644 (file)
index 0000000..5e0be1f
--- /dev/null
@@ -0,0 +1,73 @@
+// -*- c-basic-offset: 2 -*-
+/*
+ *  This file is part of the KDE libraries
+ *  Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
+ *  Copyright (C) 2001 Peter Kelly (pmk@post.com)
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Library General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public License
+ *  along with this library; see the file COPYING.LIB.  If not, write to
+ *  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ *  Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef KJS_CONTEXT_H
+#define KJS_CONTEXT_H
+
+#include "function.h"
+
+namespace KJS  {
+
+  /**
+   * @short Execution context.
+   */
+  class ContextImp {
+  public:
+    ContextImp(Object &glob, InterpreterImp *, Object &thisV, CodeType type = GlobalCode,
+               ContextImp *callingContext = 0, FunctionImp *functiion = 0, const List *args = 0);
+    ~ContextImp();
+
+    const ScopeChain scopeChain() const { return scope; }
+    Object variableObject() const { return variable; }
+    void setVariableObject(const Object &v) { variable = v; }
+    Object thisValue() const { return thisVal; }
+    ContextImp *callingContext() { return _callingContext; }
+    ObjectImp *activationObject() { return activation.imp(); }
+    FunctionImp *function() const { return _function; }
+    const List *arguments() const { return _arguments; }
+
+    void pushScope(const Object &s);
+    void popScope();
+    LabelStack *seenLabels() { return &ls; }
+    
+    void mark();
+
+  private:
+    InterpreterImp *_interpreter;
+    ContextImp *_callingContext;
+    ActivationImp _activationImp;
+    FunctionImp *_function;
+    const List *_arguments;
+    Object activation;
+    
+    ScopeChain scope;
+    Object variable;
+    Object thisVal;
+
+    LabelStack ls;
+    CodeType codeType;
+  };
+
+} // namespace KJS
+
+#endif
index 0b2d0a9c37fbeb52d9e07d9ba98513c21e0db7a7..7315a5a5aa7e603e756a8123d84baebc9f870cdc 100644 (file)
@@ -29,6 +29,7 @@
 #include "nodes.h"
 #include "operations.h"
 #include "debugger.h"
+#include "context.h"
 
 #include <stdio.h>
 #include <errno.h>
@@ -92,7 +93,7 @@ Value FunctionImp::call(ExecState *exec, Object &thisObj, const List &args)
   }
 
   // enter a new execution context
-  ContextImp ctx(globalObj, exec, thisObj, codeType(),
+  ContextImp ctx(globalObj, exec->interpreter()->imp(), thisObj, codeType(),
                  exec->context().imp(), this, &args);
   ExecState newExec(exec->interpreter(), &ctx);
   newExec.setException(exec->exception()); // could be null
@@ -254,7 +255,7 @@ bool FunctionImp::deleteProperty(ExecState *exec, const Identifier &propertyName
 const ClassInfo DeclaredFunctionImp::info = {"Function", &FunctionImp::info, 0, 0};
 
 DeclaredFunctionImp::DeclaredFunctionImp(ExecState *exec, const Identifier &n,
-                                        FunctionBodyNode *b, const List &sc)
+                                        FunctionBodyNode *b, const ScopeChain &sc)
   : FunctionImp(exec,n), body(b)
 {
   Value protect(this);
@@ -380,7 +381,7 @@ void ActivationImp::mark()
 void ActivationImp::createArgumentsObject(ExecState *exec) const
 {
     FunctionImp *function = _context->function();
-    const ArgumentList *arguments = _context->arguments();
+    const List *arguments = _context->arguments();
     if (arguments)
         _argumentsObject = new ArgumentsImp(exec, function, *arguments);
     else
@@ -441,7 +442,7 @@ Value GlobalFuncImp::call(ExecState *exec, Object &/*thisObj*/, const List &args
       // enter a new execution context
       Object thisVal(Object::dynamicCast(exec->context().thisValue()));
       ContextImp ctx(exec->interpreter()->globalObject(),
-                     exec,
+                     exec->interpreter()->imp(),
                      thisVal,
                      EvalCode,
                      exec->context().imp());
index fc1f5cc44c8ee75baa5c5d955164b98d37a131c0..42f7d1f0a365de1b2020ed1f056e77213bfd30cb 100644 (file)
@@ -70,7 +70,7 @@ namespace KJS {
   class DeclaredFunctionImp : public FunctionImp {
   public:
     DeclaredFunctionImp(ExecState *exec, const Identifier &n,
-                       FunctionBodyNode *b, const List &sc);
+                       FunctionBodyNode *b, const ScopeChain &sc);
     ~DeclaredFunctionImp();
 
     bool implementsConstruct() const;
index 3779c56a59361cb79c7caa3d2d6adfaa7801a1c4..826e5e08b86f0afa6e0fce6dd5fc7377a2baf4c8 100644 (file)
@@ -233,8 +233,8 @@ Object FunctionObjectImp::construct(ExecState *exec, const List &args)
     return err;
   }
 
-  List scopeChain;
-  scopeChain.append(exec->interpreter()->globalObject());
+  ScopeChain scopeChain;
+  scopeChain.prepend(exec->interpreter()->globalObject());
   FunctionBodyNode *bodyNode = progNode;
 
   FunctionImp *fimp = new DeclaredFunctionImp(exec, Identifier::null, bodyNode,
index e7e7c0af62acd4402c664fb63d8411dad7d6fd2c..a84b747d079d84699e8062cf09d3d815f62b3668 100644 (file)
@@ -31,6 +31,7 @@
 #include "array_object.h"
 #include "bool_object.h"
 #include "collector.h"
+#include "context.h"
 #include "date_object.h"
 #include "debugger.h"
 #include "error_object.h"
@@ -356,16 +357,16 @@ void LabelStack::clear()
 // ------------------------------ ContextImp -----------------------------------
 
 // ECMA 10.2
-ContextImp::ContextImp(Object &glob, ExecState *exec, Object &thisV, CodeType type,
-                       ContextImp *_callingContext, FunctionImp *func, const ArgumentList *args)
-    : _function(func), _arguments(args)
+ContextImp::ContextImp(Object &glob, InterpreterImp *interpreter, Object &thisV, CodeType type,
+                       ContextImp *callingCon, FunctionImp *func, const List *args)
+    : _interpreter(interpreter), _activationImp(this), _function(func), _arguments(args)
 {
   codeType = type;
-  callingCon = _callingContext;
+  _callingContext = callingCon;
 
   // create and initialize activation object (ECMA 10.1.6)
   if (type == FunctionCode || type == AnonymousCode ) {
-    activation = Object(new ActivationImp(this));
+    activation = Object(&_activationImp);
     variable = activation;
   } else {
     activation = Object();
@@ -375,15 +376,15 @@ ContextImp::ContextImp(Object &glob, ExecState *exec, Object &thisV, CodeType ty
   // ECMA 10.2
   switch(type) {
     case EvalCode:
-      if (callingCon) {
-       scope = callingCon->scopeChain().copy();
-       variable = callingCon->variableObject();
-       thisVal = callingCon->thisValue();
+      if (_callingContext) {
+       scope = _callingContext->scopeChain().copy();
+       variable = _callingContext->variableObject();
+       thisVal = _callingContext->thisValue();
        break;
       } // else same as GlobalCode
     case GlobalCode:
-      scope = List();
-      scope.append(glob);
+      scope = ScopeChain();
+      scope.prepend(glob);
       thisVal = Object(static_cast<ObjectImp*>(glob.imp()));
       break;
     case FunctionCode:
@@ -392,19 +393,21 @@ ContextImp::ContextImp(Object &glob, ExecState *exec, Object &thisV, CodeType ty
        scope = func->scope().copy();
        scope.prepend(activation);
       } else {
-       scope = List();
-       scope.append(activation);
-       scope.append(glob);
+       scope = ScopeChain();
+       scope.prepend(glob);
+       scope.prepend(activation);
       }
       variable = activation; // TODO: DontDelete ? (ECMA 10.2.3)
       thisVal = thisV;
       break;
     }
 
+  _interpreter->setContext(this);
 }
 
 ContextImp::~ContextImp()
 {
+  _interpreter->setContext(_callingContext);
 }
 
 void ContextImp::pushScope(const Object &s)
@@ -417,6 +420,12 @@ void ContextImp::popScope()
   scope.removeFirst();
 }
 
+void ContextImp::mark()
+{
+  for (ContextImp *context = this; context; context = context->_callingContext)
+    context->_activationImp.mark();
+}
+
 // ------------------------------ Parser ---------------------------------------
 
 ProgramNode *Parser::progNode = 0;
@@ -499,6 +508,7 @@ void InterpreterImp::globalClear()
 }
 
 InterpreterImp::InterpreterImp(Interpreter *interp, const Object &glob)
+    : _context(0)
 {
   // add this interpreter to the global chain
   // as a root set for garbage collection
@@ -699,6 +709,8 @@ void InterpreterImp::mark()
     global.imp()->mark();
   if (m_interpreter)
     m_interpreter->mark();
+  if (_context)
+    _context->mark();
 }
 
 bool InterpreterImp::checkSyntax(const UString &code)
@@ -781,7 +793,7 @@ Completion InterpreterImp::evaluate(const UString &code, const Value &thisV)
   }
   else {
     // execute the code
-    ContextImp ctx(globalObj, 0, thisObj);
+    ContextImp ctx(globalObj, this, thisObj);
     ExecState newExec(m_interpreter,&ctx);
     res = progNode->execute(&newExec);
   }
index 9a58e480a42de2ee3ea112847596c37101bf567f..e8e38a9b6ccee4f62165619a2ca90f72b81d948e 100644 (file)
@@ -29,6 +29,7 @@
 #include "object.h"
 #include "types.h"
 #include "interpreter.h"
+#include "scope_chain.h"
 
 #define I18N_NOOP(s) s
 
@@ -193,42 +194,6 @@ namespace KJS {
                  FunctionCode,
                  AnonymousCode };
 
-  /**
-   * @short Execution context.
-   */
-  class ContextImp {
-  public:
-    ContextImp(Object &glob, ExecState *exec, Object &thisV, CodeType type = GlobalCode,
-               ContextImp *_callingContext = 0L, FunctionImp *func = 0L, const ArgumentList *args = 0);
-    ~ContextImp();
-
-    const List scopeChain() const { return scope; }
-    Object variableObject() const { return variable; }
-    void setVariableObject(const Object &v) { variable = v; }
-    Object thisValue() const { return thisVal; }
-    ContextImp *callingContext() { return callingCon; }
-    ObjectImp *activationObject() { return activation.imp(); }
-    FunctionImp *function() const { return _function; }
-    const ArgumentList *arguments() const { return _arguments; }
-
-    void pushScope(const Object &s);
-    void popScope();
-    LabelStack *seenLabels() { return &ls; }
-
-  private:
-
-    List scope;
-    Object variable;
-    Object thisVal;
-    ContextImp *callingCon;
-    Object activation;
-    FunctionImp *_function;
-    const ArgumentList *_arguments;
-
-    LabelStack ls;
-    CodeType codeType;
-  };
-
   /**
    * @internal
    *
@@ -308,6 +273,8 @@ namespace KJS {
     static InterpreterImp* firstInterpreter() { return s_hook; }
     InterpreterImp *nextInterpreter() const { return next; }
     InterpreterImp *prevInterpreter() const { return prev; }
+    
+    void setContext(ContextImp *c) { _context = c; }
 
   private:
     void clear();
@@ -359,6 +326,8 @@ namespace KJS {
     // Chained list of interpreters (ring) - for collector
     static InterpreterImp* s_hook;
     InterpreterImp *next, *prev;
+    
+    ContextImp *_context;
 
     int recursion;
   };
index 1706f1cbbed4815d15ebf6b57482443618b2254a..eab661f875325c5f05add21712b837a8abd5a5d2 100644 (file)
@@ -35,6 +35,7 @@
 #include "operations.h"
 #include "error_object.h"
 #include "nodes.h"
+#include "context.h"
 
 using namespace KJS;
 
@@ -70,7 +71,7 @@ ContextImp *Context::imp() const
   return rep;
 }
 
-const List Context::scopeChain() const
+const ScopeChain Context::scopeChain() const
 {
   return rep->scopeChain();
 }
index 5243845a0185056f5a670822726e900a5f853aea..fcbfbe50cbbdec0e67529d3293820aa171279ec7 100644 (file)
@@ -68,7 +68,7 @@ namespace KJS {
      *
      * @return The execution context's scope chain
      */
-    const List scopeChain() const;
+    const ScopeChain scopeChain() const;
 
     /**
      * Returns the variable object for the execution context. This contains a
index 7b1b9c3838c8ca45a75019434038fde2279b8044..5e4949e7d8dc11e9dec2ab2e861401cc9e55a76e 100644 (file)
@@ -32,6 +32,7 @@
 #endif
 
 #include "collector.h"
+#include "context.h"
 #include "debugger.h"
 #include "function_object.h"
 #include "internal.h"
@@ -217,8 +218,8 @@ Value ResolveNode::evaluate(ExecState *exec)
 
 Reference ResolveNode::evaluateReference(ExecState *exec)
 {
-  const List chain = exec->context().scopeChain();
-  ListIterator scope = chain.begin();
+  const ScopeChain chain = exec->context().scopeChain();
+  ScopeChainIterator scope = chain.begin();
 
   while (scope != chain.end()) {
     ObjectImp *o = static_cast<ObjectImp*>((*scope).imp());
@@ -2765,7 +2766,7 @@ bool FuncDeclNode::deref()
 // ECMA 13
 void FuncDeclNode::processFuncDecl(ExecState *exec)
 {
-  const List sc = exec->context().imp()->scopeChain();
+  const ScopeChain sc = exec->context().imp()->scopeChain();
 
   // TODO: let this be an object with [[Class]] property "Function"
   FunctionImp *fimp = new DeclaredFunctionImp(exec, ident, body, sc);
@@ -2820,7 +2821,7 @@ bool FuncExprNode::deref()
 // ECMA 13
 Value FuncExprNode::evaluate(ExecState *exec)
 {
-  const List sc = exec->context().scopeChain();
+  const ScopeChain sc = exec->context().scopeChain();
   FunctionImp *fimp = new DeclaredFunctionImp(exec, Identifier::null, body, sc);
   Value ret(fimp);
   List empty;
index 50114e6b0a0001136cdfbdfd90688eaaa5a63f75..b6dd5a2273ecb092b1c4fbd144e22d5613791687 100644 (file)
@@ -365,12 +365,12 @@ Boolean ObjectImp::hasInstance(ExecState */*exec*/, const Value &/*value*/)
   return Boolean(false);
 }
 
-const List ObjectImp::scope() const
+const ScopeChain ObjectImp::scope() const
 {
   return _scope;
 }
 
-void ObjectImp::setScope(const List &s)
+void ObjectImp::setScope(const ScopeChain &s)
 {
   _scope = s;
 }
index 0ed63ea78496c2e39c7cb0d8f3d603d8f5649ef0..05c5155524e25e4cd57a1e900bba1da462c98244 100644 (file)
@@ -41,6 +41,7 @@
 #include "types.h"
 #include "reference_list.h"
 #include "property_map.h"
+#include "scope_chain.h"
 
 namespace KJS {
 
@@ -318,8 +319,8 @@ namespace KJS {
      * @param exec The current execution state
      * @return The function's scope
      */
-    const List scope() const;
-    void setScope(const List &s);
+    const ScopeChain scope() const;
+    void setScope(const ScopeChain &s);
 
     /**
      * Returns a List of References to all the properties of the object. Used
@@ -568,8 +569,8 @@ namespace KJS {
      *
      * @see Object::scope()
      */
-    const List scope() const;
-    void setScope(const List &s);
+    const ScopeChain scope() const;
+    void setScope(const ScopeChain &s);
 
     ReferenceList propList(ExecState *exec, bool recursive = true);
 
@@ -601,7 +602,7 @@ namespace KJS {
     PropertyMap _prop;
     ValueImp *_proto;
     ValueImp *_internalValue;
-    List _scope;
+    ScopeChain _scope;
   };
 
   /**
@@ -704,10 +705,10 @@ namespace KJS {
   inline Boolean Object::hasInstance(ExecState *exec, const Value &value)
     { return imp()->hasInstance(exec,value); }
 
-  inline const List Object::scope() const
+  inline const ScopeChain Object::scope() const
     { return imp()->scope(); }
 
-  inline void Object::setScope(const List &s)
+  inline void Object::setScope(const ScopeChain &s)
     { imp()->setScope(s); }
 
   inline ReferenceList Object::propList(ExecState *exec, bool recursive)
index 1c9d0786e939ecd65cbfbf17b806eb434f763931..97daa440646cea95e4ac2515e492d2d543c164b8 100644 (file)
 
 namespace KJS {
 
+struct PropertyMapHashTable
+{
+    int sizeMask;
+    int size;
+    int keyCount;
+    PropertyMapHashTableEntry entries[1];
+};
+    
 class SavedProperty {
 public:
     Identifier key;
@@ -190,15 +198,15 @@ void PropertyMap::put(const Identifier &name, ValueImp *value, int attributes)
 
 inline void PropertyMap::insert(UString::Rep *key, ValueImp *value, int attributes)
 {
-  assert(_table);
+    assert(_table);
 
-  int i = hash(key);
-  while (_table->entries[i].key)
-    i = (i + 1) & _table->sizeMask;
+    int i = hash(key);
+    while (_table->entries[i].key)
+        i = (i + 1) & _table->sizeMask;
     
-  _table->entries[i].key = key;
-  _table->entries[i].value = value;
-  _table->entries[i].attributes = attributes;
+    _table->entries[i].key = key;
+    _table->entries[i].value = value;
+    _table->entries[i].attributes = attributes;
 }
 
 void PropertyMap::expand()
@@ -206,12 +214,12 @@ void PropertyMap::expand()
     checkConsistency();
     
     Table *oldTable = _table;
-    int oldTableSize = oldTable ? _table->size : 0;
+    int oldTableSize = oldTable ? oldTable->size : 0;
 
     int newTableSize = oldTableSize ? oldTableSize * 2 : 16;
     _table = (Table *)calloc(1, sizeof(Table) + (newTableSize - 1) * sizeof(Entry) );
     _table->size = newTableSize;
-    _table->sizeMask = _table->size - 1;
+    _table->sizeMask = newTableSize - 1;
 
 #if USE_SINGLE_ENTRY
     UString::Rep *key = _singleEntry.key;
index 67ea8b2b6f58860255e99762fcf5a1524e7079c7..697312c09827005c2c7500565a36b0fb5deb19e3 100644 (file)
@@ -33,6 +33,8 @@ namespace KJS {
     
     class SavedProperty;
     
+    struct PropertyMapHashTable;
+    
     class SavedProperties {
     friend class PropertyMap;
     public:
@@ -55,14 +57,6 @@ namespace KJS {
         int attributes;
     };
 
-    struct PropertyMapHashTable
-    {
-        int sizeMask;
-        int size;
-        int keyCount;
-        PropertyMapHashTableEntry entries[1];
-    };
-    
     class PropertyMap {
     public:
         PropertyMap();
diff --git a/JavaScriptCore/kjs/scope_chain.cpp b/JavaScriptCore/kjs/scope_chain.cpp
new file mode 100644 (file)
index 0000000..c3fd770
--- /dev/null
@@ -0,0 +1,231 @@
+// -*- c-basic-offset: 2 -*-
+/*
+ *  This file is part of the KDE libraries
+ *  Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
+ *  Copyright (C) 2001 Peter Kelly (pmk@post.com)
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Library General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public License
+ *  along with this library; see the file COPYING.LIB.  If not, write to
+ *  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ *  Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include "scope_chain.h"
+
+namespace KJS {
+
+  struct ScopeChainNode {
+    ScopeChainNode(const Value &val, ScopeChainNode *p, ScopeChainNode *n)
+      : member(val.imp()), prev(p), next(n) { }
+    ScopeChainNode(ValueImp *val, ScopeChainNode *p, ScopeChainNode *n)
+      : member(val), prev(p), next(n) { }
+    ValueImp *member;
+    ScopeChainNode *prev, *next;
+  };
+
+  struct ScopeChainHookNode : public ScopeChainNode {
+    ScopeChainHookNode(bool needsMarking) : ScopeChainNode(Value(), this, this),
+        listRefCount(1), nodesRefCount(needsMarking ? 0 : 1) { }
+    int listRefCount;
+    int nodesRefCount;
+  };
+
+// ------------------------------ ScopeChainIterator ---------------------------------
+
+ValueImp* ScopeChainIterator::operator->() const
+{
+  return node->member;
+}
+
+Value ScopeChainIterator::operator*() const
+{
+  return Value(node->member);
+}
+
+Value ScopeChainIterator::operator++()
+{
+  node = node->next;
+  return Value(node->member);
+}
+
+Value ScopeChainIterator::operator++(int)
+{
+  const ScopeChainNode *n = node;
+  ++*this;
+  return Value(n->member);
+}
+
+// ------------------------------ ScopeChain -----------------------------------------
+
+ScopeChain::ScopeChain(bool needsMarking) : hook(new ScopeChainHookNode(needsMarking)), m_needsMarking(needsMarking)
+{
+}
+
+ScopeChain::ScopeChain(const ScopeChain& l) : hook(l.hook), m_needsMarking(false)
+{
+  ++hook->listRefCount;
+  if (hook->nodesRefCount++ == 0)
+    refAll();
+}
+
+ScopeChain& ScopeChain::operator=(const ScopeChain& l)
+{
+  ScopeChain(l).swap(*this);
+  return *this;
+}
+
+ScopeChain::~ScopeChain()
+{
+  if (!m_needsMarking)
+    if (--hook->nodesRefCount == 0)
+      derefAll();
+  
+  if (--hook->listRefCount == 0) {
+    assert(hook->nodesRefCount == 0);
+    clearInternal();
+    delete hook;
+  }
+}
+
+void ScopeChain::mark() const
+{
+  ScopeChainNode *n = hook->next;
+  while (n != hook) {
+    if (!n->member->marked())
+      n->member->mark();
+    n = n->next;
+  }
+}
+
+void ScopeChain::append(const Value& val)
+{
+  ScopeChainNode *n = new ScopeChainNode(val, hook->prev, hook);
+  if (hook->nodesRefCount)
+    n->member->ref();
+  hook->prev->next = n;
+  hook->prev = n;
+}
+
+void ScopeChain::prepend(const Value& val)
+{
+  ScopeChainNode *n = new ScopeChainNode(val, hook, hook->next);
+  if (hook->nodesRefCount)
+    n->member->ref();
+  hook->next->prev = n;
+  hook->next = n;
+}
+
+void ScopeChain::prepend(ValueImp *val)
+{
+  ScopeChainNode *n = new ScopeChainNode(val, hook, hook->next);
+  if (hook->nodesRefCount)
+    n->member->ref();
+  hook->next->prev = n;
+  hook->next = n;
+}
+
+void ScopeChain::prependList(const ScopeChain& lst)
+{
+  ScopeChainNode *otherHook = lst.hook;
+  ScopeChainNode *n = otherHook->prev;
+  while (n != otherHook) {
+    prepend(n->member);
+    n = n->prev;
+  }
+}
+
+void ScopeChain::removeFirst()
+{
+  erase(hook->next);
+}
+
+void ScopeChain::clearInternal()
+{
+  ScopeChainNode *n = hook->next;
+  while (n != hook) {
+    n = n->next;
+    delete n->prev;
+  }
+
+  hook->next = hook;
+  hook->prev = hook;
+}
+
+ScopeChain ScopeChain::copy() const
+{
+  ScopeChain newScopeChain;
+  newScopeChain.prependList(*this);
+  return newScopeChain;
+}
+
+ScopeChainIterator ScopeChain::begin() const
+{
+  return ScopeChainIterator(hook->next);
+}
+
+ScopeChainIterator ScopeChain::end() const
+{
+  return ScopeChainIterator(hook);
+}
+
+void ScopeChain::erase(ScopeChainNode *n)
+{
+  if (n != hook) {
+    if (hook->nodesRefCount)
+      n->member->deref();
+    n->next->prev = n->prev;
+    n->prev->next = n->next;
+    delete n;
+  }
+}
+
+void ScopeChain::refAll() const
+{
+  for (ScopeChainNode *n = hook->next; n != hook; n = n->next)
+    n->member->ref();
+}
+
+void ScopeChain::derefAll() const
+{
+  for (ScopeChainNode *n = hook->next; n != hook; n = n->next)
+    n->member->deref();
+}
+
+void ScopeChain::swap(ScopeChain &other)
+{
+  if (!m_needsMarking)
+    if (other.hook->nodesRefCount++ == 0)
+      other.refAll();
+  if (!other.m_needsMarking)
+    if (hook->nodesRefCount++ == 0)
+      refAll();
+
+  if (!m_needsMarking)
+    if (--hook->nodesRefCount == 0)
+      derefAll();
+  if (!other.m_needsMarking)
+    if (--other.hook->nodesRefCount == 0)
+      other.derefAll();
+
+  ScopeChainHookNode *tmp = hook;
+  hook = other.hook;
+  other.hook = tmp;
+}
+
+bool ScopeChain::isEmpty() const
+{
+    return hook->next == hook;
+}
+
+} // namespace KJS
diff --git a/JavaScriptCore/kjs/scope_chain.h b/JavaScriptCore/kjs/scope_chain.h
new file mode 100644 (file)
index 0000000..469eb17
--- /dev/null
@@ -0,0 +1,147 @@
+// -*- c-basic-offset: 2 -*-
+/*
+ *  This file is part of the KDE libraries
+ *  Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
+ *  Copyright (C) 2001 Peter Kelly (pmk@post.com)
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Library General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public License
+ *  along with this library; see the file COPYING.LIB.  If not, write to
+ *  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ *  Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef KJS_SCOPE_CHAIN_H
+#define KJS_SCOPE_CHAIN_H
+
+#include "value.h"
+
+// internal data types
+
+namespace KJS {
+
+  class ScopeChain;
+  class ScopeChainIterator;
+  class ScopeChainNode;
+  class ScopeChainHookNode;
+
+  /**
+   * @short Iterator for @ref KJS::ScopeChain objects.
+   */
+  class ScopeChainIterator {
+    friend class ScopeChain;
+    ScopeChainIterator() : node(0) { }
+    ScopeChainIterator(ScopeChainNode *n) : node(n) { }
+  public:
+    /**
+     * Construct an iterator that points to the first element of the list.
+     * @param l The list the iterator will operate on.
+     */
+    ScopeChainIterator(const ScopeChain &l);
+    /**
+     * Dereference the iterator.
+     * @return A pointer to the element the iterator operates on.
+     */
+    ValueImp* operator->() const;
+    Value operator*() const;
+    /**
+     * Postfix increment operator.
+     * @return The element after the increment.
+     */
+    Value operator++();
+    /**
+     * Prefix increment operator.
+     */
+    Value operator++(int);
+    /**
+     * Compare the iterator with another one.
+     * @return True if the two iterators operate on the same list element.
+     * False otherwise.
+     */
+    bool operator==(const ScopeChainIterator &it) const { return node == it.node; }
+    /**
+     * Check for inequality with another iterator.
+     * @return True if the two iterators operate on different list elements.
+     */
+    bool operator!=(const ScopeChainIterator &it) const { return node != it.node; }
+  private:
+    ScopeChainNode *node;
+  };
+
+  /**
+   * @short Native list type.
+   *
+   * ScopeChain is a native ECMAScript type. ScopeChain values are only used for
+   * intermediate results of expression evaluation and cannot be stored
+   * as properties of objects.
+   *
+   * The list is explicitly shared. Note that while copy() returns a
+   * copy of the list the referenced objects are still shared.
+   */
+  class ScopeChain {
+    friend class ScopeChainIterator;
+  public:
+    ScopeChain(bool needsMarking = false);
+    ScopeChain(const ScopeChain& l);
+    ScopeChain &operator=(const ScopeChain& l);
+
+    ~ScopeChain();
+
+    /**
+     * Insert an object at the beginning of the list.
+     *
+     * @param val Pointer to object.
+     */
+    void prepend(const Value& val);
+    /**
+     * Remove the element at the beginning of the list.
+     */
+    void removeFirst();
+    /**
+     * Returns a shallow copy of the list. Ownership is passed to the user
+     * who is responsible for deleting the list then.
+     */
+    ScopeChain copy() const;
+    /**
+     * @return A @ref KJS::ScopeChainIterator pointing to the first element.
+     */
+    ScopeChainIterator begin() const;
+    /**
+     * @return A @ref KJS::ScopeChainIterator pointing to the last element.
+     */
+    ScopeChainIterator end() const;
+
+    bool isEmpty() const;
+    
+    void mark() const;
+
+    // temporary
+    void prependList(const ScopeChain &);
+    void append(const Value &);
+
+  private:
+
+    void prepend(ValueImp *val);
+    void erase(ScopeChainNode *n);
+    void clearInternal();
+    void refAll() const;
+    void derefAll() const;
+    void swap(ScopeChain &other);
+    
+    ScopeChainHookNode *hook;
+    bool m_needsMarking;
+  };
+  
+}; // namespace
+
+#endif // KJS_SCOPE_CHAIN_H
index fdb963fca5ca167146943e1082a1878bede0e77e..c97b0b4a9b53d192253dad38e6587995c6660d40 100644 (file)
@@ -48,8 +48,8 @@ namespace KJS {
   };
 
   struct ListHookNode : public ListNode {
-    ListHookNode(bool needsMarking) : ListNode(Value(), this, this),
-        listRefCount(1), nodesRefCount(needsMarking ? 0 : 1) { }
+    ListHookNode() : ListNode(0, this, this),
+        listRefCount(1), nodesRefCount(1) { }
     int listRefCount;
     int nodesRefCount;
   };
@@ -94,11 +94,11 @@ Value ListIterator::operator--(int)
 
 // ------------------------------ List -----------------------------------------
 
-List::List(bool needsMarking) : hook(new ListHookNode(needsMarking)), m_needsMarking(needsMarking)
+List::List() : hook(new ListHookNode)
 {
 }
 
-List::List(const List& l) : hook(l.hook), m_needsMarking(false)
+List::List(const List& l) : hook(l.hook)
 {
   ++hook->listRefCount;
   if (hook->nodesRefCount++ == 0)
@@ -113,9 +113,8 @@ List& List::operator=(const List& l)
 
 List::~List()
 {
-  if (!m_needsMarking)
-    if (--hook->nodesRefCount == 0)
-      derefAll();
+  if (--hook->nodesRefCount == 0)
+    derefAll();
   
   if (--hook->listRefCount == 0) {
     assert(hook->nodesRefCount == 0);
@@ -299,20 +298,6 @@ void List::derefAll()
 
 void List::swap(List &other)
 {
-  if (!m_needsMarking)
-    if (other.hook->nodesRefCount++ == 0)
-      other.refAll();
-  if (!other.m_needsMarking)
-    if (hook->nodesRefCount++ == 0)
-      refAll();
-
-  if (!m_needsMarking)
-    if (--hook->nodesRefCount == 0)
-      derefAll();
-  if (!other.m_needsMarking)
-    if (--other.hook->nodesRefCount == 0)
-      other.derefAll();
-
   ListHookNode *tmp = hook;
   hook = other.hook;
   other.hook = tmp;
index 7b368307f442e927da758dd1f225cbd314d79377..e74c8ad494be2aa08806f7b62c5525511ae4d65a 100644 (file)
 #ifndef _KJS_TYPES_H_
 #define _KJS_TYPES_H_
 
-// internal data types
-
 #include "value.h"
-#include "reference.h"
 #include "completion.h"
 
+// internal data types
+
 namespace KJS {
 
   class List;
@@ -101,7 +100,7 @@ namespace KJS {
   class List {
     friend class ListIterator;
   public:
-    List(bool needsMarking = false);
+    List();
     List(const List& l);
     List &operator=(const List& l);
       
@@ -198,10 +197,9 @@ namespace KJS {
     void swap(List &other);
     
     ListHookNode *hook;
-    bool m_needsMarking;
   };
   
-  typedef List ArgumentList;
+  typedef List List;
 
 }; // namespace
 
index aa90a518e0f5d33d19d651207074e28de1f7ce76..34b925c76d72410a0635518464e7a0105acaae65 100644 (file)
@@ -1,3 +1,13 @@
+2002-11-21  Darin Adler  <darin@apple.com>
+
+        * khtml/ecma/kjs_dom.cpp: (DOMNode::eventHandlerScope): List -> ScopeChain.
+        * khtml/ecma/kjs_dom.h: List -> ScopeChain.
+        * khtml/ecma/kjs_events.cpp: (JSEventListener::handleEvent): List -> ScopeChain.
+        * khtml/ecma/kjs_html.cpp: (KJS::HTMLElement::eventHandlerScope): List -> ScopeChain.
+        * khtml/ecma/kjs_html.h: List -> ScopeChain.
+
+        * force-js-clean-timestamp: Not sure this is required, but better safe than sorry.
+
 2002-11-21  Maciej Stachowiak  <mjs@apple.com>
 
         * force-js-clean-timestamp: Touch so other people's builds work.
index aa90a518e0f5d33d19d651207074e28de1f7ce76..34b925c76d72410a0635518464e7a0105acaae65 100644 (file)
@@ -1,3 +1,13 @@
+2002-11-21  Darin Adler  <darin@apple.com>
+
+        * khtml/ecma/kjs_dom.cpp: (DOMNode::eventHandlerScope): List -> ScopeChain.
+        * khtml/ecma/kjs_dom.h: List -> ScopeChain.
+        * khtml/ecma/kjs_events.cpp: (JSEventListener::handleEvent): List -> ScopeChain.
+        * khtml/ecma/kjs_html.cpp: (KJS::HTMLElement::eventHandlerScope): List -> ScopeChain.
+        * khtml/ecma/kjs_html.h: List -> ScopeChain.
+
+        * force-js-clean-timestamp: Not sure this is required, but better safe than sorry.
+
 2002-11-21  Maciej Stachowiak  <mjs@apple.com>
 
         * force-js-clean-timestamp: Touch so other people's builds work.
index aa90a518e0f5d33d19d651207074e28de1f7ce76..34b925c76d72410a0635518464e7a0105acaae65 100644 (file)
@@ -1,3 +1,13 @@
+2002-11-21  Darin Adler  <darin@apple.com>
+
+        * khtml/ecma/kjs_dom.cpp: (DOMNode::eventHandlerScope): List -> ScopeChain.
+        * khtml/ecma/kjs_dom.h: List -> ScopeChain.
+        * khtml/ecma/kjs_events.cpp: (JSEventListener::handleEvent): List -> ScopeChain.
+        * khtml/ecma/kjs_html.cpp: (KJS::HTMLElement::eventHandlerScope): List -> ScopeChain.
+        * khtml/ecma/kjs_html.h: List -> ScopeChain.
+
+        * force-js-clean-timestamp: Not sure this is required, but better safe than sorry.
+
 2002-11-21  Maciej Stachowiak  <mjs@apple.com>
 
         * force-js-clean-timestamp: Touch so other people's builds work.
index ad1f6e974f9d9129a326a233b5b453e4dd567fdc..f18873965e1b7cccd1b520cc1aaf180b60a526a9 100644 (file)
@@ -1 +1 @@
-PRopertyMap size change 11/21 - Maciej
+List -> ScopeChain 11/21 - Darin
index b77b951872832d624df89fdc3ebbe9e60b3e9249..5b41a3138732d5bb2233e0baf675d6711d5e714b 100644 (file)
@@ -415,9 +415,9 @@ Value DOMNode::getListener(int eventId) const
        return Null();
 }
 
-List DOMNode::eventHandlerScope(ExecState *) const
+ScopeChain DOMNode::eventHandlerScope(ExecState *) const
 {
-  return List::empty();
+  return ScopeChain();
 }
 
 Value DOMNodeProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
index 7463db417b47d442da967c24c042b2741dfa7c74..67bd3787facc4e1a0c4011cb597fe4965f0247ae 100644 (file)
@@ -51,7 +51,7 @@ namespace KJS {
     virtual UString toString(ExecState *exec) const;
     void setListener(ExecState *exec, int eventId, Value func) const;
     Value getListener(int eventId) const;
-    virtual List eventHandlerScope(ExecState *exec) const;
+    virtual ScopeChain eventHandlerScope(ExecState *exec) const;
 
     enum { NodeName, NodeValue, NodeType, ParentNode, ParentElement,
            ChildNodes, FirstChild, LastChild, PreviousSibling, NextSibling,
index ad9a9aa2796ad45e0bf89b48c3d2326caa3e5747..f9c5cc8ac1e64d12fd88f8a72bc9926562e50a79 100644 (file)
@@ -72,13 +72,13 @@ void JSEventListener::handleEvent(DOM::Event &evt)
     // Add the event's target element to the scope
     // (and the document, and the form - see KJS::HTMLElement::eventHandlerScope)
     Object thisObj = Object::dynamicCast(getDOMNode(exec,evt.currentTarget()));
-    List scope;
-    List oldScope = listener.scope();
+    ScopeChain scope;
+    ScopeChain oldScope = listener.scope();
     //if (thisVal.type() != NullType)
     if ( !thisObj.isNull() ) {
       scope = static_cast<DOMNode*>(thisObj.imp())->eventHandlerScope(exec);
       if ( !scope.isEmpty() ) {
-        List curScope = oldScope.copy();
+        ScopeChain curScope = oldScope.copy();
         curScope.prependList( scope );
         listener.setScope( curScope );
       }
index 8bfa8a8c0e7c489b53ca0ce07e9c0171f4066bd4..dd95a3d16cb27e622389f8667c86841820629812 100644 (file)
@@ -1739,11 +1739,11 @@ UString KJS::HTMLElement::toString(ExecState *exec) const
     return DOMElement::toString(exec);
 }
 
-List KJS::HTMLElement::eventHandlerScope(ExecState *exec) const
+ScopeChain KJS::HTMLElement::eventHandlerScope(ExecState *exec) const
 {
   DOM::HTMLElement element = static_cast<DOM::HTMLElement>(node);
 
-  List scope;
+  ScopeChain scope;
   // The element is the first one, so that it is the most prioritary
   scope.append(getDOMNode(exec,element));
 
index 660180d70c6d8b715502c259386425a479209fae..8d2affda90885248a6ea90b278b6c0e39dde56bc 100644 (file)
@@ -61,7 +61,7 @@ namespace KJS {
     void putValue(ExecState *exec, int token, const Value& value, int);
     virtual bool hasProperty(ExecState *exec, const Identifier &propertyName) const;
     virtual UString toString(ExecState *exec) const;
-    virtual List eventHandlerScope(ExecState *exec) const;
+    virtual ScopeChain eventHandlerScope(ExecState *exec) const;
     virtual const ClassInfo* classInfo() const;
     static const ClassInfo info;