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

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

    XMLWordPrintable

Details

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

    Backports

      Description

        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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                  Created:
                  Updated:
                  Resolved: