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

More aggressive value discarding

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b55
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        CodeGenerator code for loading a JoinPredecessorExpression (JPE) ignores whether it is the current discard. Combined with the fact that for loop's modify expressions are now JPEs this causes a typical postincrement in them to have unnecessary DUP/POP pairs, e.g. a typical for-loop "++i" will now be

          iload 3
          iconst_1
          invokedynamic iadd(II)I
          dup
          istore 3
          pop

        The issue is bit more widespread than that, though -- there's a lot of other expressions that could also better discard their subexpressions, e.g. COMMARIGHT. Even if the JPE is fixed, a for loop having "++i, ++j" will not do a discard on ++j as COMMARIGHT doesn't do loadAndDiscard on its RHS regardless of wether it itself should be discarded. Basically, a review of discard logic would be in order.

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved: