JDK-7066841 : remove MacroAssembler::br_on_reg_cond() on sparc
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: hs22
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2011-07-13
  • Updated: 2011-10-07
  • Resolved: 2011-09-30
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8 Other
7u2Fixed 8Fixed hs22Fixed
Description
I want to remove these instructions added with initial push for G1 (3 years ago) and use existing instructions. I think they are dangerous because for all v9 sparc (32 and 64 bit VM) they use branch on register (bpr, compare with zero) instruction which checks all 64 bits but for v8 they use old branch instruction which checks only 32 bits. 


Also they are used to check int values (but checks all 64 bits):

  AddressLiteral addrlit(byte_map_base);
  masm.set(addrlit, O1); // O1 := <card table base>
  masm.ldub(O0, O1, O2); // O2 := [O0 + O1]
  masm.br_on_reg_cond(Assembler::rc_nz, /*annul*/false, Assembler::pt,
                      O2, not_already_dirty);

and at the same time checks pointers values:

  masm.ld_ptr(G2_thread, dirty_card_q_index_byte_offset, L0);
  masm.br_on_reg_cond(Assembler::rc_z, /*annul*/false, Assembler::pn,
                      L0, refill);

We had situations when upper 32 bits in registers with integer values are dirty so we may get situation when check's result is incorrect. Note, in the case above the result will be correct since loads extends signs.

We use br_null() and br_notnull() for pointers tests and br_zero() for 32 bits tests. So I want to use them instead of br_on_reg_cond().

Also the version of br_on_reg_cond() with address parameter is not used.

Vladimir

Comments
EVALUATION See main CR
14-09-2011

SUGGESTED FIX Remove br_on_reg_cond and use equivalents. For example br_null, cmp_zero_and_br, cmp_and_br_short, cmp_and_brx_short.
31-08-2011

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-gc/hotspot/rev/4fe626cbf0bf
31-08-2011