• marja's avatar
    [parser] Skipping inner funcs: add info about variables. · d4507a6c
    marja authored
    - Declaring a variable called "this" for preparsed functions was unnecessary;
      DeclarationScope ctor already adds the variable.
    
    - "arguments" for preparsed scopes need to be declared after parsing the
      function, like it's done in the parser.
    
    - Now arguments_ can be the dummy variable, so adapted code to it.
    
    - A previous refactoring CL ( https://codereview.chromium.org/2638333002 ) was
      incomplete; it had added ParserBase::ParseFunctionBody but
      PreParser::ParseFunction didn't call it. This CL completes that work. This is
      needed for getting "arguments" declared properly for preparsed functions.
    
    - AllocateVariablesRecursively is already called for preparsed scopes (without
      this CL, that is), and it bails out early. However, before the bailout it used
      to dcheck num_stack_slots_ == 0; that is no longer true since we've done scope
      analysis for preparsed scopes.
    
    - Test fix: we cannot have any lazy inner functions in the test, except the
      topmost lazy inner function. Such functions would also be lazy in the parser
      case, and the parser would just throw away their variables. Then the test
      tries to verify the preparsed data against the scopes without variables and fails.
    
    - Disabled a test w/ a sloppy block function, will get that working again in the
      upcoming CLs.
    
    BUG=v8:5516
    
    Review-Url: https://codereview.chromium.org/2655623005
    Cr-Commit-Position: refs/heads/master@{#42685}
    d4507a6c
preparser.cc 12.6 KB