On 12/16/18 9:52 PM, Claes Redestad wrote:
Fair enough, I wasn't aware EA was looking beyond the inlined code like this (which means it can't be "dead" or the JIT might see through the trick at some point). I've skimmed the existing usages in the JDK and can't find anything that seems to be dependent on DontInline defeatingEA - maybe there was in the past, or I simply misremembered.
Were you thinking of the pre-jdk11 implementation of Reference.reachabilityFence() perhaps?
dl