Skip to content

Commit

Permalink
8302289: RISC-V: Use bgez instruction in arraycopy_simple_check when …
Browse files Browse the repository at this point in the history
…possible

Reviewed-by: fyang, dzhang, luhenry
  • Loading branch information
zifeihan authored and luhenry committed Feb 13, 2023
1 parent 57aef85 commit 99b6c0e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/hotspot/cpu/riscv/c1_LIRAssembler_arraycopy_riscv.cpp
Expand Up @@ -92,18 +92,17 @@ void LIR_Assembler::arraycopy_simple_check(Register src, Register src_pos, Regis
// 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) {
assert(Klass::_lh_neutral_value == 0, "or replace bgez instructions");
if (!(flags & LIR_OpArrayCopy::LIR_OpArrayCopy::dst_objarray)) {
__ load_klass(tmp, dst);
__ lw(t0, Address(tmp, in_bytes(Klass::layout_helper_offset())));
__ mv(t1, Klass::_lh_neutral_value);
__ bge(t0, t1, *stub->entry(), /* is_far */ true);
__ bgez(t0, *stub->entry(), /* is_far */ true);
}

if (!(flags & LIR_OpArrayCopy::LIR_OpArrayCopy::src_objarray)) {
__ load_klass(tmp, src);
__ lw(t0, Address(tmp, in_bytes(Klass::layout_helper_offset())));
__ mv(t1, Klass::_lh_neutral_value);
__ bge(t0, t1, *stub->entry(), /* is_far */ true);
__ bgez(t0, *stub->entry(), /* is_far */ true);
}
}

Expand Down

1 comment on commit 99b6c0e

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.