Changeset 37275 in webkit for trunk/JavaScriptCore/kjs/NodeInfo.h


Ignore:
Timestamp:
Oct 3, 2008, 6:39:43 PM (17 years ago)
Author:
[email protected]
Message:

2008-10-03 Maciej Stachowiak <[email protected]>

Reviewed by Cameron Zwarich.


  • Some code cleanup to how we handle code features.


1) Rename FeatureInfo typedef to CodeFeatures.
2) Rename NodeFeatureInfo template to NodeInfo.
3) Keep CodeFeature bitmask in ScopeNode instead of trying to break it out into individual bools.
4) Rename misleadingly named "needsClosure" method to "containsClosures", which better describes the meaning
of ClosureFeature.
5) Make setUsersArguments() not take an argument since it only goes one way.

  • JavaScriptCore.exp:
  • VM/CodeBlock.h: (JSC::CodeBlock::CodeBlock):
  • kjs/NodeInfo.h:
  • kjs/Parser.cpp: (JSC::Parser::didFinishParsing):
  • kjs/Parser.h: (JSC::Parser::parse):
  • kjs/grammar.y:
  • kjs/nodes.cpp: (JSC::ScopeNode::ScopeNode): (JSC::ProgramNode::ProgramNode): (JSC::ProgramNode::create): (JSC::EvalNode::EvalNode): (JSC::EvalNode::create): (JSC::FunctionBodyNode::FunctionBodyNode): (JSC::FunctionBodyNode::create):
  • kjs/nodes.h: (JSC::ScopeNode::usesEval): (JSC::ScopeNode::containsClosures): (JSC::ScopeNode::usesArguments): (JSC::ScopeNode::setUsesArguments):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/NodeInfo.h

    r37132 r37275  
    2626namespace JSC {
    2727
    28     typedef unsigned int FeatureInfo;
    29 
    30     const FeatureInfo NoFeatures = 0;
    31     const FeatureInfo EvalFeature = 1 << 0;
    32     const FeatureInfo ClosureFeature = 1 << 1;
    33     const FeatureInfo AssignFeature = 1 << 2;
    34     const FeatureInfo ArgumentsFeature = 1 << 3;
    35     const FeatureInfo WithFeature = 1 << 4;
    36     const FeatureInfo CatchFeature = 1 << 5;
    37     const FeatureInfo ThisFeature = 1 << 6;
    38     const FeatureInfo AllFeatures = EvalFeature | ClosureFeature | AssignFeature | ArgumentsFeature | WithFeature | CatchFeature | ThisFeature;
    39 
    40     template <typename T> struct NodeFeatureInfo {
     28    template <typename T> struct NodeInfo {
    4129        T m_node;
    42         FeatureInfo m_featureInfo;
     30        CodeFeatures m_features;
    4331        int m_numConstants;
    4432    };
    4533
    46     typedef NodeFeatureInfo<FuncDeclNode*> FuncDeclNodeInfo;   
    47     typedef NodeFeatureInfo<FuncExprNode*> FuncExprNodeInfo;
    48     typedef NodeFeatureInfo<ExpressionNode*> ExpressionNodeInfo;
    49     typedef NodeFeatureInfo<ArgumentsNode*> ArgumentsNodeInfo;
    50     typedef NodeFeatureInfo<ConstDeclNode*> ConstDeclNodeInfo;
    51     typedef NodeFeatureInfo<PropertyNode*> PropertyNodeInfo;
    52     typedef NodeFeatureInfo<PropertyList> PropertyListInfo;
    53     typedef NodeFeatureInfo<ElementList> ElementListInfo;
    54     typedef NodeFeatureInfo<ArgumentList> ArgumentListInfo;
     34    typedef NodeInfo<FuncDeclNode*> FuncDeclNodeInfo;   
     35    typedef NodeInfo<FuncExprNode*> FuncExprNodeInfo;
     36    typedef NodeInfo<ExpressionNode*> ExpressionNodeInfo;
     37    typedef NodeInfo<ArgumentsNode*> ArgumentsNodeInfo;
     38    typedef NodeInfo<ConstDeclNode*> ConstDeclNodeInfo;
     39    typedef NodeInfo<PropertyNode*> PropertyNodeInfo;
     40    typedef NodeInfo<PropertyList> PropertyListInfo;
     41    typedef NodeInfo<ElementList> ElementListInfo;
     42    typedef NodeInfo<ArgumentList> ArgumentListInfo;
    5543   
    5644    template <typename T> struct NodeDeclarationInfo {
     
    5846        ParserRefCountedData<DeclarationStacks::VarStack>* m_varDeclarations;
    5947        ParserRefCountedData<DeclarationStacks::FunctionStack>* m_funcDeclarations;
    60         FeatureInfo m_featureInfo;
     48        CodeFeatures m_features;
    6149        int m_numConstants;
    6250    };
Note: See TracChangeset for help on using the changeset viewer.