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

Make Check.checkOverride call diagnosticPositionFor lazily

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 13
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b01

      Description

      When Check.checkOverride calls checkDeprecated it unconditionally calls TreeInfo.diagnosticPositionFor, even though checkDeprecated may not end up emitting a diagnostic: http://hg.openjdk.java.net/jdk/jdk/file/6879069d9d94/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java#l1800

      I noticed this while profiling a very large generated compilation unit, which was spending a significant fraction of its time in calls to TreeInfo.diagnosticPositionFor. That method is relatively expensive if it isn't able to find a diagnostic position, because it has to scan the entire tree that's passed in.

        Attachments

          Activity

            People

            Assignee:
            cushon Liam Miller-Cushon
            Reporter:
            cushon Liam Miller-Cushon
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: