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

Make Check.checkOverride call diagnosticPositionFor lazily

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P3
    • 13
    • None
    • tools
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: