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

use aggressive liveness for unstable_if traps

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 19
    • Fix Version/s: tbd
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      c2 parser is conservative about the bci unstable_if trap. It points to the conditional branch. When interpreter resumes execution, it will reevaluate the condition branch and take another path. unstable_trap collects liveness information at the bci and make live locals the input parameters of CallStaticJava uncommon_trap node.

      We can aggressively set next bci for the unstable traps. Most of next BCIs (fall through or destination) are closer to the exit. It's likely to have less live locals. There are 3 benefits.

      1. less inputs of uncommon_trap node can simplify IR. this may unblock other optimizations such as useless function elimination JDK-8276998 or scalar replacement.

      2. deoptimizations become faster because we don't need to reallocate those dead objects.

      3. save codecache space. we store all debuginfo in codecache. for those scalarized objects, we have to save fields of them in debuginfo. we can avoid them if they are not live.

        Attachments

        1. DateTimeTest.java
          0.8 kB
        2. ShortTest.java
          0.7 kB
        3. Test.java
          5 kB

          Issue Links

            Activity

              People

              Assignee:
              xliu Xin Liu
              Reporter:
              xliu Xin Liu
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated: