RFR 8208163 [lworld] performance regression on String(char[]) constructor

Tobias Hartmann tobias.hartmann at oracle.com
Tue Aug 14 14:28:02 UTC 2018


Hi Ioi,

On 10.08.2018 23:37, Ioi Lam wrote:
> https://bugs.openjdk.java.net/browse/JDK-8208163
> http://cr.openjdk.java.net/~iklam/valhalla/8208163_string_charary_ctor_slowdown.v01/

It seems that with your change, we now mark all non-array allocations as "unknown value", right?
This will cause PhaseMacroExpand::expand_allocate_common() to add additional runtime checks. It
might be better to check for primitive arrays (TypeArrayKlass) explicitly.

Also, your comment is a bit misleading because it suggests that the set_unknown_value() code is only
used for reflective array creation. However, that code should be invoked whenever we create an array
and don't know if the element type is a value type.

To improve readability, I think it would also be good to wrap the entire code starting from line
3972 into 'if (EnableValhalla)' and not only the else branch.

Thanks,
Tobias



More information about the valhalla-dev mailing list