There seems to invalid inline source code for arraycopy of
c1_LIRAssembler_sparc.cpp in JDK 1.4.2/1.5 for Solaris(SPARC).
======
c1_LIRAssembler_sparc.cpp(1.4.2_03):
.....
2816 void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
2817 Register src = op->src()->as_register();
2818 Register dst = op->dst()->as_register();
2819 LIR_Opr src_pos = op->src_pos();
2820 LIR_Opr dst_pos = op->dst_pos();
....
3026 // the move is within the same array, so figure out whether the copy
3027 // needs to happen top to bottom or bottom to top.
3028 __ cmp(src_ptr, dst_ptr);
3029 __ br(Assembler::greater, false, Assembler::pn, bottom_to_top); <=== (*)
3030 __ delayed()->nop();
...
======
The above (*) is the branch instruction of whether copy operation
runs "bottom to top" or top to bottonm" when there is overlapped area
between src and dst in arraycopy.
The compare operation between ptr of src and that of dst seems done
in signed integer.
Ex.
src : 0x7ffffff0
dst : 0x80000010
In the above case, dst is considered as negative integer value
and then copy operation fails.
The code which is similar to the above is in Tiger also.
========================================================================
c1_LIRAssembler_sparc.cpp in JDK 1.4.2/1.5 for Solaris(SPARC).
======
c1_LIRAssembler_sparc.cpp(1.4.2_03):
.....
2816 void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
2817 Register src = op->src()->as_register();
2818 Register dst = op->dst()->as_register();
2819 LIR_Opr src_pos = op->src_pos();
2820 LIR_Opr dst_pos = op->dst_pos();
....
3026 // the move is within the same array, so figure out whether the copy
3027 // needs to happen top to bottom or bottom to top.
3028 __ cmp(src_ptr, dst_ptr);
3029 __ br(Assembler::greater, false, Assembler::pn, bottom_to_top); <=== (*)
3030 __ delayed()->nop();
...
======
The above (*) is the branch instruction of whether copy operation
runs "bottom to top" or top to bottonm" when there is overlapped area
between src and dst in arraycopy.
The compare operation between ptr of src and that of dst seems done
in signed integer.
Ex.
src : 0x7ffffff0
dst : 0x80000010
In the above case, dst is considered as negative integer value
and then copy operation fails.
The code which is similar to the above is in Tiger also.
========================================================================