RFR: 8145680: Remove unnecessary explicit initialization of volatile variables in java.base

Claes Redestad claes.redestad at oracle.com
Mon Dec 21 17:13:34 UTC 2015


Sure, rerunning with -XX:TieredStopAtLevel=1 there's evidently a very 
small overhead of return !falseValue over return trueValue:

DefaultInitBench.trueWithFalseValue avgt 15 5.482 ± 0.077 ns/op
DefaultInitBench.trueWithTrueValue avgt 15 5.147 ± 0.037 ns/op

I prefer to keep the patch as-is.

/Claes

On 2015-12-21 16:48, Jason Mehrens wrote:
> So for C2 it doesn't matter.  From what I can tell using javap, the xor generates the fewest number of bytecode operations.  Not that this breaks the bank but, one would think that fewer bytecodes would help C1.
>
> Jason




More information about the core-libs-dev mailing list