Ignore:
Timestamp:
May 1, 2014, 10:26:24 AM (11 years ago)
Author:
[email protected]
Message:

Unreviewed, rolling out r167964.
https://bugs.webkit.org/show_bug.cgi?id=132431

Memory improvements should not regress memory usage (Requested
by olliej on #webkit).

Reverted changeset:

"Don't hold on to parameter BindingNodes forever"
https://bugs.webkit.org/show_bug.cgi?id=132360
http://trac.webkit.org/changeset/167964

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/parser/Parser.cpp

    r167964 r168107  
    12491249        return false;
    12501250    }
    1251     JSTokenLocation openParen = tokenLocation();
    12521251    if (!consume(OPENPAREN)) {
    12531252        semanticFailureDueToKeyword(stringForFunctionMode(mode), " name");
     
    12581257        failIfFalse(parameters, "Cannot parse parameters for this ", stringForFunctionMode(mode));
    12591258    }
    1260     JSTokenLocation endParen = m_token.m_location;
    12611259    consumeOrFail(CLOSEPAREN, "Expected a ')' or a ',' after a parameter declaration");
    12621260    matchOrFail(OPENBRACE, "Expected an opening '{' at the start of a ", stringForFunctionMode(mode), " body");
     
    12841282
    12851283        body = context.createFunctionBody(startLocation, endLocation, bodyStartColumn, bodyEndColumn, cachedInfo->strictMode);
    1286         context.setFunctionBodyParameters(body, openParen, endParen);
     1284       
    12871285        functionScope->restoreFromSourceProviderCache(cachedInfo);
    12881286        failIfFalse(popScope(functionScope, TreeBuilder::NeedsFreeVariableInfo), "Parser error");
     
    13041302    restoreState(oldState);
    13051303    failIfFalse(body, "Cannot parse the body of this ", stringForFunctionMode(mode));
    1306     context.setFunctionBodyParameters(body, openParen, endParen);
    13071304    if (functionScope->strictMode() && name) {
    13081305        RELEASE_ASSERT(mode == FunctionMode);
     
    24082405}
    24092406
    2410 PassRefPtr<FunctionParameters> parseParameters(VM* vm, const SourceCode& source, JSParserStrictness strictness)
    2411 {
    2412     SamplingRegion samplingRegion("Parsing parameters");
    2413     ParameterNode* parameters = 0;
    2414     ASSERT(!source.provider()->source().isNull());
    2415     if (source.provider()->source().is8Bit()) {
    2416         Parser<Lexer<LChar>> parser(vm, source, 0, Identifier(), strictness, JSParseFunctionCode);
    2417         ASTBuilder builder(vm, &source);
    2418         parameters = parser.parseFormalParameters(builder);
    2419     } else {
    2420         Parser<Lexer<UChar>> parser(vm, source, 0, Identifier(), strictness, JSParseFunctionCode);
    2421         ASTBuilder builder(vm, &source);
    2422         parameters = parser.parseFormalParameters(builder);
    2423     }
    2424     if (!parameters)
    2425         return nullptr;
    2426     return FunctionParameters::create(parameters);
    2427 }
    2428 
    24292407// Instantiate the two flavors of Parser we need instead of putting most of this file in Parser.h
    24302408template class Parser<Lexer<LChar>>;
Note: See TracChangeset for help on using the changeset viewer.