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/Parser.h

    r167313 r167964  
    410410    WTF_MAKE_NONCOPYABLE(Parser);
    411411    WTF_MAKE_FAST_ALLOCATED;
     412    friend PassRefPtr<FunctionParameters> parseParameters(VM*, const SourceCode&, JSParserStrictness);
    412413
    413414public:
     
    973974        return result.release();
    974975    }
     976    RELEASE_ASSERT(strictness != JSParseBuiltin);
    975977    Parser<Lexer<UChar>> parser(vm, source, parameters, name, strictness, parserMode);
    976978    RefPtr<ParsedNode> result = parser.parse<ParsedNode>(error);
     
    980982}
    981983
     984PassRefPtr<FunctionParameters> parseParameters(VM*, const SourceCode&, JSParserStrictness);
     985
    982986} // namespace
    983987#endif
Note: See TracChangeset for help on using the changeset viewer.