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

Improve implementation of RShift Value

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 22
    • 22
    • hotspot
    • b26

    Description

      Right shift nodes currently return the bottom type when they encounter a right-hand input that isn't a constant. However, sometimes it's possible to use the type of the left-hand input to calculate a sharper type, even if we don't know anything about the right-hand side.

      As an example, "ary.length >> y" knows that the bounds of the array length are [0, max_jint] and can propagate that to the right shift node, as the result of shift is always non-negative if the input is non-negative. This pattern is found in String#length, which shifts the array length by the coder to find the length.

      Attachments

        Issue Links

          Activity

            People

              jkarthikeyan Jasmine Karthikeyan
              jkarthikeyan Jasmine Karthikeyan
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: