[lworld] RFR: 8375306: [lworld] Investigate alternatives to flatArrayOopDesc::obj_at implementation

Stefan Karlsson stefank at openjdk.org
Mon Feb 9 22:03:22 UTC 2026


On Mon, 9 Feb 2026 14:15:26 GMT, Frederic Parain <fparain at openjdk.org> wrote:

> It is true that currently most, if not all, of the arrays created by the JVM are using the default set of properties. But it is likely to change when the new arrays will become available. Many of these arrays are good candidate for being null-free arrays or frozen arrays. So, I'd prefer to keep the more generic name `oopFactory::new_refArray()` for the most generic method able to handle all reference array creations with the properties argument, and keep the more precise name for the more limited case of an array with the default set of properties.

I find the `new_default_refArray" name quite jarring. Could we follow the `new_objArray` example and just have an overload?


  // Regular object arrays
  static objArrayOop     new_objArray(Klass* klass, int length, TRAPS);
  static objArrayOop     new_objArray(Klass* klass, int length, ArrayKlass::ArrayProperties properties, TRAPS);
...
objArrayOop oopFactory::new_objArray(Klass* klass, int length, TRAPS) {
  return  new_objArray(klass, length, ArrayKlass::ArrayProperties::DEFAULT, THREAD);
}

-------------

PR Comment: https://git.openjdk.org/valhalla/pull/2033#issuecomment-3873185151


More information about the valhalla-dev mailing list