RFR: JDK-8207169: X86: Modularize cmpxchg-oop assembler for C1 and C2

Roland Westrelin rwestrel at redhat.com
Mon Sep 3 08:58:00 UTC 2018


> Who would clobber those registers between iterations though in your 
> tight loop?

Ignoring cas, but with a simple example:

input = 0;

loop_entry:
input++;
array[i] = input;
// some other code
goto loop_entry;

input is live across iterations but given the loop is hidden in a basic
block, the register allocator expects it to be live from its
initialization to the store in the array. So it's free to assign a
register to input and reuse it in whatever code is in the rest of the
loop body.

Roland.



More information about the hotspot-gc-dev mailing list