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

Type profiles should be extended to primitive types

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 9, 10
    • Fix Version/s: tbd
    • Component/s: hotspot
    • Labels:

      Description

      Although type profiling only applies to references, in some cases it would be profitable to profile primitive values, especially ints.

      Any primitive can be summarized in two words as accumulated min and max, and/or as two words of bitwise logical and and bitwise logical or. A few statistical moments (at least order 0 and 1, maybe 2 if multiplies can be tolerated) can also be captured.

      Certain bytecodes that interact with loops can be instrumented this way to allow optimistic range reduction at compile time. Candidates would be *aload, if*, *cmp*, get*, *newarray, and arraylength.

      If references that are non-receiver method arguments or return values are profiled, the profiling could be extended to primitives. (See JDK-6919064.)

      If the cost (space or time) of gathering this data is prohibitive, consider doing it only in tier one compiled code. (See JDK-8015416.)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              jrose John Rose
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated: