Changeset 31072 in webkit for trunk/JavaScriptCore/kjs/Parser.h


Ignore:
Timestamp:
Mar 14, 2008, 6:05:55 PM (17 years ago)
Author:
[email protected]
Message:

Add logic to track whether a function uses a locally scoped eval or requires a closure

Reviewed by Maciej

Now that we limit eval we can track those uses of eval that operate
in the local scope and functions that require a closure. We track
this information during initial parsing to avoid yet another tree
walk.

File:
1 edited

Legend:

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

    r30942 r31072  
    5353
    5454        void didFinishParsing(SourceElements*, ParserRefCountedData<DeclarationStacks::VarStack>*,
    55                               ParserRefCountedData<DeclarationStacks::FunctionStack>*, int lastLine);
     55                              ParserRefCountedData<DeclarationStacks::FunctionStack>*, bool usesEval, bool needsClosure, int lastLine);
    5656
    5757    private:
     
    6767        RefPtr<ParserRefCountedData<DeclarationStacks::VarStack> > m_varDeclarations;
    6868        RefPtr<ParserRefCountedData<DeclarationStacks::FunctionStack> > m_funcDeclarations;
     69        bool m_usesEval;
     70        bool m_needsClosure;
    6971        int m_lastLine;
    7072    };
     
    8587        RefPtr<ParsedNode> node = ParsedNode::create(m_sourceElements.release().get(),
    8688                                                     m_varDeclarations ? &m_varDeclarations->data : 0,
    87                                                      m_funcDeclarations ? &m_funcDeclarations->data : 0);
     89                                                     m_funcDeclarations ? &m_funcDeclarations->data : 0,
     90                                                     m_usesEval,
     91                                                     m_needsClosure);
    8892        m_varDeclarations = 0;
    8993        m_funcDeclarations = 0;
Note: See TracChangeset for help on using the changeset viewer.