< prev index next >

src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp

Print this page
rev 4139 : 8160591: Improve internal array handling
Reviewed-by: kvn
Contributed-by: Xiang Yuan <xiang.yuan@linaro.org>, Zoltan Majo <zoltan.majo@oracle.com>

*** 2127,2136 **** --- 2127,2157 ---- __ tst(dst); __ brx(Assembler::equal, false, Assembler::pn, *stub->entry()); __ delayed()->nop(); } + // If the compiler was not able to prove that exact type of the source or the destination + // of the arraycopy is an array type, check at runtime if the source or the destination is + // an instance type. + if (flags & LIR_OpArrayCopy::type_check) { + if (!(flags & LIR_OpArrayCopy::LIR_OpArrayCopy::dst_objarray)) { + __ load_klass(dst, tmp); + __ lduw(tmp, in_bytes(Klass::layout_helper_offset()), tmp2); + __ cmp(tmp2, Klass::_lh_neutral_value); + __ br(Assembler::greaterEqual, false, Assembler::pn, *stub->entry()); + __ delayed()->nop(); + } + + if (!(flags & LIR_OpArrayCopy::LIR_OpArrayCopy::src_objarray)) { + __ load_klass(src, tmp); + __ lduw(tmp, in_bytes(Klass::layout_helper_offset()), tmp2); + __ cmp(tmp2, Klass::_lh_neutral_value); + __ br(Assembler::greaterEqual, false, Assembler::pn, *stub->entry()); + __ delayed()->nop(); + } + } + if (flags & LIR_OpArrayCopy::src_pos_positive_check) { // test src_pos register __ cmp_zero_and_br(Assembler::less, src_pos, *stub->entry()); __ delayed()->nop(); }
< prev index next >