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

(str) JavaLangAccess accessors for new String shapes

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • None
    • core-libs
    • None

      Some related work, notably Indify String Concat (JDK-8085796) needs the access to raw String shape. JavaLangAccess is normally used in these cases, but it only has the char[] version now, which invokes the private constructor that shares "chars" array:

            public String newStringUnsafe(char[] chars) {
                 return new String(chars, true);
            }

      That String(char[],boolean) constructor is copying now, defeating the purpose of JavaLangAccess::newStringUnsafe. Therefore, we need to drill a few new holes in JavaLangAccess to aid these cases, admitting the new String shape.

            shade Aleksey Shipilev
            shade Aleksey Shipilev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: