8210465: ARM: Object equals abstraction for BarrierSetAssembler
Reviewed-by: rkennke, dsamersoff
This commit is contained in:
parent
fa1ced20b5
commit
5fa8dfe0f8
@ -2359,8 +2359,11 @@ void LIR_Assembler::comp_op(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2,
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
} else if (opr2->is_single_cpu()) {
|
||||
if (opr1->type() == T_OBJECT || opr1->type() == T_ARRAY || opr1->type() == T_METADATA || opr1->type() == T_ADDRESS) {
|
||||
assert(opr2->type() == T_OBJECT || opr2->type() == T_ARRAY || opr2->type() == T_METADATA || opr2->type() == T_ADDRESS, "incompatibe type");
|
||||
if (opr1->type() == T_OBJECT || opr1->type() == T_ARRAY) {
|
||||
assert(opr2->type() == T_OBJECT || opr2->type() == T_ARRAY, "incompatibe type");
|
||||
__ cmpoop(opr1->as_register(), opr2->as_register());
|
||||
} else if (opr1->type() == T_METADATA || opr1->type() == T_ADDRESS) {
|
||||
assert(opr2->type() == T_METADATA || opr2->type() == T_ADDRESS, "incompatibe type");
|
||||
__ cmp(opr1->as_register(), opr2->as_register());
|
||||
} else {
|
||||
assert(opr2->type() != T_OBJECT && opr2->type() != T_ARRAY && opr2->type() != T_METADATA && opr2->type() != T_ADDRESS, "incompatibe type");
|
||||
|
@ -162,3 +162,7 @@ void BarrierSetAssembler::store_at(MacroAssembler* masm, DecoratorSet decorators
|
||||
}
|
||||
}
|
||||
|
||||
void BarrierSetAssembler::obj_equals(MacroAssembler* masm,
|
||||
Register obj1, Register obj2) {
|
||||
__ cmp(obj1, obj2);
|
||||
}
|
||||
|
@ -41,6 +41,9 @@ public:
|
||||
virtual void store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
|
||||
Address obj, Register new_val, Register tmp1, Register tmp2, Register tmp3, bool is_null);
|
||||
|
||||
virtual void obj_equals(MacroAssembler* masm,
|
||||
Register obj1, Register obj2);
|
||||
|
||||
virtual void barrier_stubs_init() {}
|
||||
};
|
||||
|
||||
|
@ -1037,6 +1037,11 @@ void MacroAssembler::sign_extend(Register rd, Register rn, int bits) {
|
||||
|
||||
#ifndef AARCH64
|
||||
|
||||
void MacroAssembler::cmpoop(Register obj1, Register obj2) {
|
||||
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
bs->obj_equals(this, obj1, obj2);
|
||||
}
|
||||
|
||||
void MacroAssembler::long_move(Register rd_lo, Register rd_hi,
|
||||
Register rn_lo, Register rn_hi,
|
||||
AsmCondition cond) {
|
||||
@ -2269,6 +2274,11 @@ void MacroAssembler::char_arrays_equals(Register ary1, Register ary2,
|
||||
Register chr1, Register chr2, Label& Ldone) {
|
||||
Label Lvector, Lloop;
|
||||
|
||||
// if (ary1 == ary2)
|
||||
// return true;
|
||||
cmpoop(ary1, ary2);
|
||||
b(Ldone, eq);
|
||||
|
||||
// Note: limit contains number of bytes (2*char_elements) != 0.
|
||||
tst(limit, 0x2); // trailing character ?
|
||||
b(Lvector, eq);
|
||||
|
@ -1246,6 +1246,8 @@ public:
|
||||
}
|
||||
|
||||
#ifndef AARCH64
|
||||
void cmpoop(Register obj1, Register obj2);
|
||||
|
||||
void long_move(Register rd_lo, Register rd_hi,
|
||||
Register rn_lo, Register rn_hi,
|
||||
AsmCondition cond = al);
|
||||
|
@ -173,7 +173,7 @@ void MethodHandles::jump_to_lambda_form(MacroAssembler* _masm,
|
||||
// assert(sizeof(u2) == sizeof(Method::_size_of_parameters), "");
|
||||
Label L;
|
||||
__ ldr(tmp, __ receiver_argument_address(Rparams, tmp, tmp));
|
||||
__ cmp(tmp, recv);
|
||||
__ cmpoop(tmp, recv);
|
||||
__ b(L, eq);
|
||||
__ stop("receiver not on stack");
|
||||
__ bind(L);
|
||||
|
@ -2559,7 +2559,7 @@ void TemplateTable::if_acmp(Condition cc) {
|
||||
// assume branch is more often taken than not (loops use backward branches)
|
||||
Label not_taken;
|
||||
__ pop_ptr(R1_tmp);
|
||||
__ cmp(R1_tmp, R0_tos);
|
||||
__ cmpoop(R1_tmp, R0_tos);
|
||||
__ b(not_taken, convNegCond(cc));
|
||||
branch(false, false);
|
||||
__ bind(not_taken);
|
||||
|
Loading…
x
Reference in New Issue
Block a user