mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 19:44:41 +02:00
8132051: Better byte behavior
Co-authored-by: Roland Westerlin <roland.westerlin@oracle.com> Co-authored-by: Vladimir Kozlov <vladimir.kozlov@oracle.com> Co-authored-by: John Rose <john.r.rose@oracle.com> Reviewed-by: bdelsart, roland, kvn, jrose, ahgross
This commit is contained in:
parent
ed18f94d21
commit
200784d505
40 changed files with 514 additions and 88 deletions
|
@ -3680,3 +3680,26 @@ void LIRGenerator::do_MemBar(MemBar* x) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
LIR_Opr LIRGenerator::maybe_mask_boolean(StoreIndexed* x, LIR_Opr array, LIR_Opr value, CodeEmitInfo*& null_check_info) {
|
||||
if (x->check_boolean()) {
|
||||
LIR_Opr value_fixed = rlock_byte(T_BYTE);
|
||||
if (TwoOperandLIRForm) {
|
||||
__ move(value, value_fixed);
|
||||
__ logical_and(value_fixed, LIR_OprFact::intConst(1), value_fixed);
|
||||
} else {
|
||||
__ logical_and(value, LIR_OprFact::intConst(1), value_fixed);
|
||||
}
|
||||
LIR_Opr klass = new_register(T_METADATA);
|
||||
__ move(new LIR_Address(array, oopDesc::klass_offset_in_bytes(), T_ADDRESS), klass, null_check_info);
|
||||
null_check_info = NULL;
|
||||
LIR_Opr layout = new_register(T_INT);
|
||||
__ move(new LIR_Address(klass, in_bytes(Klass::layout_helper_offset()), T_INT), layout);
|
||||
int diffbit = Klass::layout_helper_boolean_diffbit();
|
||||
__ logical_and(layout, LIR_OprFact::intConst(diffbit), layout);
|
||||
__ cmp(lir_cond_notEqual, layout, LIR_OprFact::intConst(0));
|
||||
__ cmove(lir_cond_notEqual, value_fixed, value, value_fixed, T_BYTE);
|
||||
value = value_fixed;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue