RFR: Streamline write-barrier-prologue (C2 part)

Roman Kennke rkennke at redhat.com
Fri Sep 14 15:57:55 UTC 2018


Hi Roland,

finally I get back to this. :-)

>> - it usually loads+checks gc-state 2x back-to-back (null-check is
>> usually known statically)
> 
> Isn't loading 2x the gc state necessary if we want it to fold into the
> heap stable test instruction?

The first test is the 'broad' heap-stable-test. Our hope is that this
one can be folded with other (close-by) heap-stable-tests, and thus
generates significant barrier-free-paths. The 2nd test
(evac-in-progress) is there to distinguish the evac-phase from other
phases. With this proposed change, we don't need that 2nd test because
it's implied by the o != rb(o) test, which does not require any
additional load.

>> from cheapest to most expensive:
>> - null-check: cheapest: nothing is loaded. Also, usually elided, and if
>> not, might fold with other nullchecks on same object
> 
> I don't think it will fold that late in the optimization process. By
> putting the null check first, happy path style optimizations are made
> harder. Does it really matter that null check is first?

I guess not.

>> - Only 1 region and related phis used for the whole branching stuff
> 
> As I remember the 2 regions were there to help happy path style
> optimizations.

Ok. This revision:
- switches null-check with heap-stable-test, such that heap-stable test
remains outer-most test.
- reinstates the outer heap-stable-regions/phis

http://cr.openjdk.java.net/~rkennke/streamline-wb-prologue/webrev.01/

Roman




More information about the shenandoah-dev mailing list