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

Add utility methods to check machine word indexes and ranges

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P3 P3
    • None
    • None
    • core-libs
    • None

      JDK-8135248 added utility methods like Objects.checkIndex
      to supply efficient checking of indexes for arrays and array-like
      aggregates. These methods operate on 32-bit indexes only.
      They should be duplicated to also operate on 64-bit indexes.

      One customer for this API is the bounds checking of Panama
      pointers. As with C, Panama pointer manipulation is important
      to performance; unlike C, Panama pointers range-check their
      pointers, so optimizing their range checks is a goal.

      It would be sufficient for Panama to place these methods only
      in jdk.internal.util.Preconditions, where the binder can get to them.

      Both signed and unsigned versions of these checkers are plausible.
      Panama needs only the signed 64-bit versions, at present.

            Unassigned Unassigned
            jrose John Rose
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: