mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 19:14:38 +02:00
7063628: Use cbcond on T4
Add new short branch instruction to Hotspot sparc assembler. Reviewed-by: never, twisti, jrose
This commit is contained in:
parent
aa16309657
commit
48c1293916
30 changed files with 966 additions and 1097 deletions
|
@ -217,9 +217,7 @@ void LIR_Assembler::osr_entry() {
|
|||
{
|
||||
Label L;
|
||||
__ ld_ptr(OSR_buf, slot_offset + 1*BytesPerWord, O7);
|
||||
__ cmp(G0, O7);
|
||||
__ br(Assembler::notEqual, false, Assembler::pt, L);
|
||||
__ delayed()->nop();
|
||||
__ cmp_and_br_short(O7, G0, Assembler::notEqual, Assembler::pt, L);
|
||||
__ stop("locked object is NULL");
|
||||
__ bind(L);
|
||||
}
|
||||
|
@ -2096,10 +2094,10 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
|
|||
__ xor3(O0, -1, tmp);
|
||||
__ sub(length, tmp, length);
|
||||
__ add(src_pos, tmp, src_pos);
|
||||
__ br_zero(Assembler::less, false, Assembler::pn, O0, *stub->entry());
|
||||
__ cmp_zero_and_br(Assembler::less, O0, *stub->entry());
|
||||
__ delayed()->add(dst_pos, tmp, dst_pos);
|
||||
} else {
|
||||
__ br_zero(Assembler::less, false, Assembler::pn, O0, *stub->entry());
|
||||
__ cmp_zero_and_br(Assembler::less, O0, *stub->entry());
|
||||
__ delayed()->nop();
|
||||
}
|
||||
__ bind(*stub->continuation());
|
||||
|
@ -2123,22 +2121,19 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
|
|||
|
||||
if (flags & LIR_OpArrayCopy::src_pos_positive_check) {
|
||||
// test src_pos register
|
||||
__ tst(src_pos);
|
||||
__ br(Assembler::less, false, Assembler::pn, *stub->entry());
|
||||
__ cmp_zero_and_br(Assembler::less, src_pos, *stub->entry());
|
||||
__ delayed()->nop();
|
||||
}
|
||||
|
||||
if (flags & LIR_OpArrayCopy::dst_pos_positive_check) {
|
||||
// test dst_pos register
|
||||
__ tst(dst_pos);
|
||||
__ br(Assembler::less, false, Assembler::pn, *stub->entry());
|
||||
__ cmp_zero_and_br(Assembler::less, dst_pos, *stub->entry());
|
||||
__ delayed()->nop();
|
||||
}
|
||||
|
||||
if (flags & LIR_OpArrayCopy::length_positive_check) {
|
||||
// make sure length isn't negative
|
||||
__ tst(length);
|
||||
__ br(Assembler::less, false, Assembler::pn, *stub->entry());
|
||||
__ cmp_zero_and_br(Assembler::less, length, *stub->entry());
|
||||
__ delayed()->nop();
|
||||
}
|
||||
|
||||
|
@ -2261,8 +2256,7 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
|
|||
#ifndef PRODUCT
|
||||
if (PrintC1Statistics) {
|
||||
Label failed;
|
||||
__ br_notnull(O0, false, Assembler::pn, failed);
|
||||
__ delayed()->nop();
|
||||
__ br_notnull_short(O0, Assembler::pn, failed);
|
||||
__ inc_counter((address)&Runtime1::_arraycopy_checkcast_cnt, G1, G3);
|
||||
__ bind(failed);
|
||||
}
|
||||
|
@ -2314,9 +2308,7 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
|
|||
__ br(Assembler::notEqual, false, Assembler::pn, halt);
|
||||
// load the raw value of the src klass.
|
||||
__ delayed()->lduw(src, oopDesc::klass_offset_in_bytes(), tmp2);
|
||||
__ cmp(tmp, tmp2);
|
||||
__ br(Assembler::equal, false, Assembler::pn, known_ok);
|
||||
__ delayed()->nop();
|
||||
__ cmp_and_br_short(tmp, tmp2, Assembler::equal, Assembler::pn, known_ok);
|
||||
} else {
|
||||
__ cmp(tmp, tmp2);
|
||||
__ br(Assembler::equal, false, Assembler::pn, known_ok);
|
||||
|
@ -2330,9 +2322,7 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
|
|||
__ cmp(tmp, tmp2);
|
||||
__ brx(Assembler::notEqual, false, Assembler::pn, halt);
|
||||
__ delayed()->ld_ptr(src, oopDesc::klass_offset_in_bytes(), tmp2);
|
||||
__ cmp(tmp, tmp2);
|
||||
__ brx(Assembler::equal, false, Assembler::pn, known_ok);
|
||||
__ delayed()->nop();
|
||||
__ cmp_and_brx_short(tmp, tmp2, Assembler::equal, Assembler::pn, known_ok);
|
||||
} else {
|
||||
__ cmp(tmp, tmp2);
|
||||
__ brx(Assembler::equal, false, Assembler::pn, known_ok);
|
||||
|
@ -2530,15 +2520,13 @@ void LIR_Assembler::type_profile_helper(Register mdo, int mdo_offset_bias,
|
|||
mdo_offset_bias);
|
||||
__ ld_ptr(receiver_addr, tmp1);
|
||||
__ verify_oop(tmp1);
|
||||
__ cmp(recv, tmp1);
|
||||
__ brx(Assembler::notEqual, false, Assembler::pt, next_test);
|
||||
__ delayed()->nop();
|
||||
__ cmp_and_brx_short(recv, tmp1, Assembler::notEqual, Assembler::pt, next_test);
|
||||
Address data_addr(mdo, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_count_offset(i)) -
|
||||
mdo_offset_bias);
|
||||
__ ld_ptr(data_addr, tmp1);
|
||||
__ add(tmp1, DataLayout::counter_increment, tmp1);
|
||||
__ st_ptr(tmp1, data_addr);
|
||||
__ ba(false, *update_done);
|
||||
__ ba(*update_done);
|
||||
__ delayed()->nop();
|
||||
__ bind(next_test);
|
||||
}
|
||||
|
@ -2549,13 +2537,12 @@ void LIR_Assembler::type_profile_helper(Register mdo, int mdo_offset_bias,
|
|||
Address recv_addr(mdo, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_offset(i)) -
|
||||
mdo_offset_bias);
|
||||
__ ld_ptr(recv_addr, tmp1);
|
||||
__ br_notnull(tmp1, false, Assembler::pt, next_test);
|
||||
__ delayed()->nop();
|
||||
__ br_notnull_short(tmp1, Assembler::pt, next_test);
|
||||
__ st_ptr(recv, recv_addr);
|
||||
__ set(DataLayout::counter_increment, tmp1);
|
||||
__ st_ptr(tmp1, mdo, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_count_offset(i)) -
|
||||
mdo_offset_bias);
|
||||
__ ba(false, *update_done);
|
||||
__ ba(*update_done);
|
||||
__ delayed()->nop();
|
||||
__ bind(next_test);
|
||||
}
|
||||
|
@ -2601,8 +2588,7 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L
|
|||
setup_md_access(method, op->profiled_bci(), md, data, mdo_offset_bias);
|
||||
|
||||
Label not_null;
|
||||
__ br_notnull(obj, false, Assembler::pn, not_null);
|
||||
__ delayed()->nop();
|
||||
__ br_notnull_short(obj, Assembler::pn, not_null);
|
||||
Register mdo = k_RInfo;
|
||||
Register data_val = Rtmp1;
|
||||
jobject2reg(md->constant_encoding(), mdo);
|
||||
|
@ -2614,7 +2600,7 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L
|
|||
__ ldub(flags_addr, data_val);
|
||||
__ or3(data_val, BitData::null_seen_byte_constant(), data_val);
|
||||
__ stb(data_val, flags_addr);
|
||||
__ ba(false, *obj_is_null);
|
||||
__ ba(*obj_is_null);
|
||||
__ delayed()->nop();
|
||||
__ bind(not_null);
|
||||
} else {
|
||||
|
@ -2682,7 +2668,7 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L
|
|||
__ load_klass(obj, recv);
|
||||
type_profile_helper(mdo, mdo_offset_bias, md, data, recv, tmp1, success);
|
||||
// Jump over the failure case
|
||||
__ ba(false, *success);
|
||||
__ ba(*success);
|
||||
__ delayed()->nop();
|
||||
// Cast failure case
|
||||
__ bind(profile_cast_failure);
|
||||
|
@ -2695,10 +2681,10 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L
|
|||
__ ld_ptr(data_addr, tmp1);
|
||||
__ sub(tmp1, DataLayout::counter_increment, tmp1);
|
||||
__ st_ptr(tmp1, data_addr);
|
||||
__ ba(false, *failure);
|
||||
__ ba(*failure);
|
||||
__ delayed()->nop();
|
||||
}
|
||||
__ ba(false, *success);
|
||||
__ ba(*success);
|
||||
__ delayed()->nop();
|
||||
}
|
||||
|
||||
|
@ -2728,8 +2714,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) {
|
|||
|
||||
if (op->should_profile()) {
|
||||
Label not_null;
|
||||
__ br_notnull(value, false, Assembler::pn, not_null);
|
||||
__ delayed()->nop();
|
||||
__ br_notnull_short(value, Assembler::pn, not_null);
|
||||
Register mdo = k_RInfo;
|
||||
Register data_val = Rtmp1;
|
||||
jobject2reg(md->constant_encoding(), mdo);
|
||||
|
@ -2741,12 +2726,10 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) {
|
|||
__ ldub(flags_addr, data_val);
|
||||
__ or3(data_val, BitData::null_seen_byte_constant(), data_val);
|
||||
__ stb(data_val, flags_addr);
|
||||
__ ba(false, done);
|
||||
__ delayed()->nop();
|
||||
__ ba_short(done);
|
||||
__ bind(not_null);
|
||||
} else {
|
||||
__ br_null(value, false, Assembler::pn, done);
|
||||
__ delayed()->nop();
|
||||
__ br_null_short(value, Assembler::pn, done);
|
||||
}
|
||||
add_debug_info_for_null_check_here(op->info_for_exception());
|
||||
__ load_klass(array, k_RInfo);
|
||||
|
@ -2777,8 +2760,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) {
|
|||
}
|
||||
__ load_klass(value, recv);
|
||||
type_profile_helper(mdo, mdo_offset_bias, md, data, recv, tmp1, &done);
|
||||
__ ba(false, done);
|
||||
__ delayed()->nop();
|
||||
__ ba_short(done);
|
||||
// Cast failure case
|
||||
__ bind(profile_cast_failure);
|
||||
jobject2reg(md->constant_encoding(), mdo);
|
||||
|
@ -2790,7 +2772,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) {
|
|||
__ ld_ptr(data_addr, tmp1);
|
||||
__ sub(tmp1, DataLayout::counter_increment, tmp1);
|
||||
__ st_ptr(tmp1, data_addr);
|
||||
__ ba(false, *stub->entry());
|
||||
__ ba(*stub->entry());
|
||||
__ delayed()->nop();
|
||||
}
|
||||
__ bind(done);
|
||||
|
@ -2808,8 +2790,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) {
|
|||
emit_typecheck_helper(op, &success, &failure, &failure);
|
||||
__ bind(failure);
|
||||
__ set(0, dst);
|
||||
__ ba(false, done);
|
||||
__ delayed()->nop();
|
||||
__ ba_short(done);
|
||||
__ bind(success);
|
||||
__ set(1, dst);
|
||||
__ bind(done);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue