RFR(M): 8232896: ZGC: Enable C2 clone intrinsic
Per Liden
per.liden at oracle.com
Fri Nov 1 11:50:07 UTC 2019
Hi Nils,
On 10/31/19 5:37 PM, Nils Eliasson wrote:
> Hi,
>
> This patch fixes and enables the clone intrinsic for C2 with ZGC.
>
> The main thing added is an implementation of the
> ZBarrierSetC2::clone_at_expansion method. This method handles clone
> expansion for regular objects and primitive arrays that hasn't already
> been reduced by optimizations. (Oop array clones doesn't go through this
> path.)
>
> The code switches on the type of the source to either make a leaf call
> to a runtime clone for regular objects, or delegate to
> BarrierSetC2::clone_at_expansion for primitive arrays.
>
> Updated micro benchmark shows great gains, especially for small objects
> that now will be reduced to inlined move-store sequences.
Sweet! The speedup of micro:Clone is impressive!
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8232896
>
> Webrev: http://cr.openjdk.java.net/~neliasso/8232896/webrev.02/
My review comments summarized in a patch on top of yours. Let me know if
there's something you don't agree with. The changes are:
* Changed the type of the runtime function's size arguments from
TypeInt::INT to TypeLong::LONG, to make it 64 bits, rather than 32.
* Changed the new runtime function to call HeapAccess::clone() rather
than ZBarrier::clone_oop(), since ZBarrier is the backend for the access
layer, not the frontend.
* Renamed clone_oop() to clone(), as we're cloning an object rather than
an oop.
* Added const where applicable.
* Adjusted an include line.
* Moved the clone_at_expansion() function up in the file.
http://cr.openjdk.java.net/~pliden/8232896/webrev.pliden_review.0
I ran micro:Clone to verify my changes.
cheers,
Per
>
>
> Please review,
>
> Nils Eliasson
>
More information about the hotspot-compiler-dev
mailing list