Ignore:
Timestamp:
Apr 29, 2014, 3:23:17 PM (11 years ago)
Author:
[email protected]
Message:

Source/JavaScriptCore: Don't hold on to parameterBindingNodes forever
https://bugs.webkit.org/show_bug.cgi?id=132360

Reviewed by Geoffrey Garen.

Don't keep the parameter nodes anymore. Instead we store the
original parameter string and reparse whenever we actually
need them. Because we only actually need them for compilation
this only results in a single extra parse.

  • bytecode/UnlinkedCodeBlock.cpp:

(JSC::generateFunctionCodeBlock):
(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
(JSC::UnlinkedFunctionExecutable::visitChildren):
(JSC::UnlinkedFunctionExecutable::finishCreation):
(JSC::UnlinkedFunctionExecutable::paramString):
(JSC::UnlinkedFunctionExecutable::parameters):
(JSC::UnlinkedFunctionExecutable::parameterCount): Deleted.

  • bytecode/UnlinkedCodeBlock.h:

(JSC::UnlinkedFunctionExecutable::create):
(JSC::UnlinkedFunctionExecutable::parameterCount):
(JSC::UnlinkedFunctionExecutable::parameters): Deleted.
(JSC::UnlinkedFunctionExecutable::finishCreation): Deleted.

  • parser/ASTBuilder.h:

(JSC::ASTBuilder::ASTBuilder):
(JSC::ASTBuilder::setFunctionBodyParameters):

  • parser/Nodes.h:

(JSC::FunctionBodyNode::parametersStartOffset):
(JSC::FunctionBodyNode::parametersEndOffset):
(JSC::FunctionBodyNode::setParameterLocation):

  • parser/Parser.cpp:

(JSC::Parser<LexerType>::parseFunctionInfo):
(JSC::parseParameters):

  • parser/Parser.h:

(JSC::parse):

  • parser/SourceCode.h:

(JSC::SourceCode::subExpression):

  • parser/SyntaxChecker.h:

(JSC::SyntaxChecker::setFunctionBodyParameters):

LayoutTests: Don't hold on to parameter BindingNodes forever
https://bugs.webkit.org/show_bug.cgi?id=132360

Reviewed by Geoffrey Garen.

We don't regenerate the parameter string anymore, so these tests now
match the original input.

  • js/destructuring-assignment-expected.txt:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/parser/SourceCode.h

    r165676 r167964  
    104104        int length() const { return m_endChar - m_startChar; }
    105105       
    106         SourceCode subExpression(unsigned openBrace, unsigned closeBrace, int firstLine, int startColumn);
     106        SourceCode subExpression(unsigned openBrace, unsigned closeBrace, int firstLine, int startColumn) const;
    107107
    108108    private:
     
    119119    }
    120120
    121     inline SourceCode SourceCode::subExpression(unsigned openBrace, unsigned closeBrace, int firstLine, int startColumn)
     121    inline SourceCode SourceCode::subExpression(unsigned openBrace, unsigned closeBrace, int firstLine, int startColumn) const
    122122    {
    123123        ASSERT(provider()->source()[openBrace] == '{');
Note: See TracChangeset for help on using the changeset viewer.