RFR(M): 6700100: optimize inline_native_clone() for small objects with exact klass

Roland Westrelin roland.westrelin at oracle.com
Thu Oct 23 11:58:15 UTC 2014

> Any reason why you chosen 8 as the threshold value? Any benchmarking
> involved? Do you need one?

I think Vladimir suggested 8, 2 years ago when I worked on this first. The value stayed.

Are you talking about micro benchmarks? There are 2 benefits to this change:

- it avoids a call so we could look for a copy size where the benefit of not doing the call becomes small enough
- it allows other optimizations. An important one is that escape analysis can find more candidate allocations that we can eliminate. That’s much harder to benchmark I think.

There’s a second change coming that will do the same for array copies and that will use the same threshold value. So if we want to tune the threshold value we should wait for that change.

Do we need a threshold value? I think we do. We don’t want to grow the IR graph if it doesn’t pay off.


>> Converts ArrayCopy nodes for small instance clones to series of
>> loads/stores + a little bit of cleanup.
>> Small array clones & copies as loads/stores are coming next in
>> another change.
> -Aleksey.

More information about the hotspot-compiler-dev mailing list