Comments about JDK-8213473: Replace testB_mem_imm matcher with testUB_mem_imm

B. Blaser bsrbnd at
Fri Nov 16 14:23:25 UTC 2018


The current fix [1] for JDK-8213473 [2] replaces 'testB_mem_imm' with
'testUB_mem_imm' in '' which is fine for unsigned bytes, for
  if ((flags & 0x80) != 0) ...

But per JLS §5.6.2 & §5.1.2, if we have something like [3]:
  if ((flags & (byte)0x80) != 0) ...

the mask is 32-bit sign-extended and 'LoadB' isn't converted to
'LoadUB' in 'AndINode::Ideal' [4] which is fine.

Unfortunately 'testUB_mem_imm' won't be matched in this case, so I
guess we'd need both 'testB_mem_imm' & 'testUB_mem_imm' patterns.

If we all agree, I can create a JBS issue and send out a RFR for this?



More information about the hotspot-dev mailing list