Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8057931

Instead of not skipping small functions in parser, make lexer avoid them instead

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 9
    • core-libs
    • b31
    • generic
    • generic

        In JDK-8057148 we introduced a feature where the Nashorn's parser will skip nested functions when it's reparsing an outer function as the first step of recompiling it (as nested functions aren't necessary for recompilation of outer function). We also introduced a feature where functions under a certain size (those that don't exhaust the lexer's read-ahead buffer) will not be skipped (as we already lexed their source).

        This enhancement instead informs the lexer to pause read-ahead lexing when it encounters a function body's left brace when it's used in recompilation context. Care is also taken in parser's functionBody() to not accidentally nudge the lexer past the pause point when it'd otherwise skip the function body.

              attila Attila Szegedi
              attila Attila Szegedi
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: