Ignore:
Timestamp:
Jan 26, 2008, 10:55:52 AM (17 years ago)
Author:
Darin Adler
Message:

Reviewed by Eric Seidel.

  • JavaScriptCore.exp: Export the GlobalExecState constructor instead of the global flavor of the ExecState constructor. It'd probably be cleaner to not export either one, but JSGlobalObject inlines the code that constructs the ExecState. If we changed that, we could remove this export.
  • JavaScriptCore.xcodeproj/project.pbxproj: Re-sorted a few things and put the new source files into the kjs group rather than at the top level.
  • kjs/ExecState.cpp: (KJS::ExecState::ExecState): Marked inline and updated for data member name changes. This is now only for use for the derived classes. Also removed code that sets the unused m_savedExec data member for the global case. That data member is only used for the other two types. (KJS::ExecState::~ExecState): Marked inline and removed all the code. The derived class destructors now inclde the appropriate code. (KJS::ExecState::lexicalGlobalObject): Removed unneeded special case for an empty scope chain. The bottom function already returns 0 for that case, so the general case code handles it fine. Also changed to use data members directly rather than calling functions. (KJS::GlobalExecState::GlobalExecState): Added. Calls through to the base class constructor. (KJS::GlobalExecState::~GlobalExecState): Added. (KJS::InterpreterExecState::InterpreterExecState): Added. Moved code to manipulate activeExecStates here since we don't want to have to check for the special case of globalExec. (KJS::InterpreterExecState::~InterpreterExecState): Added. (KJS::EvalExecState::EvalExecState): Added. (KJS::EvalExecState::~EvalExecState): Added. (KJS::FunctionExecState::FunctionExecState): Added. (KJS::FunctionExecState::~FunctionExecState): Added.
  • kjs/ExecState.h: Tweaked the header, includes, and declarations a bit. Made ExecState inherit from Noncopyable. Reformatted some comments and made them a bit more brief. Rearranged declarations a little bit and removed unused savedExec function. Changed seenLabels function to return a reference rather than a pointer. Made constructors and destructor protected, and also did the same with all data members. Renamed m_thisVal to m_thisValue and ls to m_labelStack. Added three new derived classes for each of the types of ExecState. The primary goal here was to remove a branch from the code in the destructor, but it's also clearer than overloading the arguments to the ExecState constructor.
  • kjs/JSGlobalObject.cpp: (KJS::getCurrentTime): Fixed formatting. (KJS::JSGlobalObject::pushActivation): Removed parentheses that don't make the expression clearer -- other similar sites didn't have these parentheses, even the one a couple lines earlier that sets stackEntry. (KJS::JSGlobalObject::tearOffActivation): Got rid of unneeded static_cast (I think I mentioned this during patch review) and used an early exit so that the entire contents of the function aren't nested inside an if statement. Also removed the check of codeType, instead checking Activation for 0. For now, I kept the codeType check, but inside an assertion.
  • kjs/JSGlobalObject.h: Changed type of globalExec to GlobalExecState.
  • kjs/function.cpp: (KJS::FunctionImp::callAsFunction): Changed type to FunctionExecState. (KJS::GlobalFuncImp::callAsFunction): Changed type to EvalExecState.
  • kjs/interpreter.cpp: (KJS::Interpreter::evaluate): Changed type to GlobalExecState.
  • kjs/nodes.cpp: (KJS::ContinueNode::execute): Changed code since seenLabels() returns a reference now instead of a pointer. (KJS::BreakNode::execute): Ditto. (KJS::LabelNode::execute): Ditto.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r29508 r29810  
    532532                70B16A260569A10900DB756D /* runtime_object.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; name = runtime_object.cpp; path = bindings/runtime_object.cpp; sourceTree = "<group>"; tabWidth = 8; };
    533533                70B16A270569A10900DB756D /* runtime_object.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; name = runtime_object.h; path = bindings/runtime_object.h; sourceTree = "<group>"; tabWidth = 8; };
    534                 7E2C6C950D31C6AB002D44E2 /* Activation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Activation.h; path = kjs/Activation.h; sourceTree = "<group>"; };
    535                 7E2C6C980D31C6B6002D44E2 /* scope_chain_mark.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = scope_chain_mark.h; path = kjs/scope_chain_mark.h; sourceTree = "<group>"; };
     534                7E2C6C950D31C6AB002D44E2 /* Activation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Activation.h; sourceTree = "<group>"; };
     535                7E2C6C980D31C6B6002D44E2 /* scope_chain_mark.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scope_chain_mark.h; sourceTree = "<group>"; };
    536536                84ABF1DE070B628C00A3AC05 /* npruntime_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; name = npruntime_impl.h; path = bindings/npruntime_impl.h; sourceTree = "<group>"; tabWidth = 8; };
    537537                9303F567099118FA00AD71B8 /* OwnPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OwnPtr.h; sourceTree = "<group>"; };
     
    691691                        isa = PBXGroup;
    692692                        children = (
    693                                 7E2C6C980D31C6B6002D44E2 /* scope_chain_mark.h */,
    694                                 7E2C6C950D31C6AB002D44E2 /* Activation.h */,
    695693                                937B63CC09E766D200A671DD /* DerivedSources.make */,
    696694                                14B8ECA60A5653980062BE54 /* JavaScriptCore.exp */,
    697695                                F5C290E60284F98E018635CA /* JavaScriptCorePrefix.h */,
     696                                65162EF108E6A21C007556CD /* wtf */,
     697                                65417203039E01F90058BFEB /* pcre */,
     698                                65417200039E01BA0058BFEB /* kjs */,
     699                                51856D950562EE9C008B9D83 /* bindings */,
     700                                1432EBD70A34CAD400717B9F /* API */,
    698701                                141211000A48772600480255 /* tests */,
    699                                 1432EBD70A34CAD400717B9F /* API */,
    700                                 65417200039E01BA0058BFEB /* kjs */,
    701                                 65162EF108E6A21C007556CD /* wtf */,
    702                                 51856D950562EE9C008B9D83 /* bindings */,
    703                                 65417203039E01F90058BFEB /* pcre */,
    704702                                650FDF8D09D0FCA700769E54 /* Derived Sources */,
    705703                                932FC3C20824BB70005B3C75 /* Resources */,
     
    933931                        children = (
    934932                                659126BC0BDD1728001921FB /* AllInOneFile.cpp */,
     933                                7E2C6C950D31C6AB002D44E2 /* Activation.h */,
    935934                                93ADFCE60CCBD7AC00D30B08 /* array_instance.cpp */,
    936935                                938772E5038BFE19008635CE /* array_instance.h */,
     
    979978                                14ABB454099C2A0F00E2A24F /* JSType.h */,
    980979                                14F252600D08DF2F004ECFFF /* JSVariableObject.cpp */,
     980                                14F252600D08DF2F004ECFFF /* JSVariableObject.cpp */,
    981981                                14F252560D08DD8D004ECFFF /* JSVariableObject.h */,
    982982                                65C7A1710A8EAACB00FA37EA /* JSWrapperObject.cpp */,
     
    10201020                                9374D3A8038D9D74008635CE /* scope_chain.cpp */,
    10211021                                9374D3A7038D9D74008635CE /* scope_chain.h */,
     1022                                7E2C6C980D31C6B6002D44E2 /* scope_chain_mark.h */,
    10221023                                F692A87F0255597D01FF60F7 /* string_object.cpp */,
    10231024                                F692A8800255597D01FF60F7 /* string_object.h */,
     
    11361137                                14F252570D08DD8D004ECFFF /* JSVariableObject.h in Headers */,
    11371138                                65C7A1740A8EAACB00FA37EA /* JSWrapperObject.h in Headers */,
     1139                                1CAA8B4C0D32C39A0041BCFF /* JavaScript.h in Headers */,
     1140                                1CAA8B4D0D32C39A0041BCFF /* JavaScriptCore.h in Headers */,
    11381141                                932F5B610822A1C700736975 /* JavaScriptCorePrefix.h in Headers */,
    11391142                                65A7A5E00CD1D50E00061F8E /* LabelStack.h in Headers */,
     
    12391242                                932F5B5C0822A1C700736975 /* ustring.h in Headers */,
    12401243                                14ABB36F099C076400E2A24F /* value.h in Headers */,
    1241                                 1CAA8B4C0D32C39A0041BCFF /* JavaScript.h in Headers */,
    1242                                 1CAA8B4D0D32C39A0041BCFF /* JavaScriptCore.h in Headers */,
    12431244                        );
    12441245                        runOnlyForDeploymentPostprocessing = 0;
Note: See TracChangeset for help on using the changeset viewer.