On Mon, 20 Oct 2025 04:01:16 GMT, Chen Liang <[email protected]> wrote:
>> Hi, >> >> The load to FlatArrayKlass::_layout_kind can be constant-folded if the >> receiver is a constant. This eliminates all checks when the array type is >> known statically or speculated correctly. >> >> Please leave your reviews, thanks a lot. > > I wonder if the work to constant fold Unsafe.arrayLayout is similar to this - > this is currently a bottleneck in core libraries. @liach That one ([JDK-8369835](https://bugs.openjdk.org/browse/JDK-8369835)) requires an intrinsic for the Unsafe method which is currently implemented in C++ code (there's no Java code that could be optimized/folded). ------------- PR Comment: https://git.openjdk.org/valhalla/pull/1687#issuecomment-3420612504
