Skip to content

Commit 5372ed2

Browse files
author
duke
committed
Backport e6ac956a7ac613b916c0dbfda7e57856c1b8a83c
1 parent 2c7becc commit 5372ed2

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

src/hotspot/cpu/riscv/c1_LIRGenerator_riscv.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ void LIRGenerator::do_ArrayCopy(Intrinsic* x) {
772772
ciArrayKlass* expected_type = nullptr;
773773
arraycopy_helper(x, &flags, &expected_type);
774774
if (x->check_flag(Instruction::OmitChecksFlag)) {
775-
flags = 0;
775+
flags = (flags & LIR_OpArrayCopy::get_initial_copy_flags());
776776
}
777777

778778
__ arraycopy(src.result(), src_pos.result(), dst.result(), dst_pos.result(), length.result(), tmp,

src/hotspot/share/c1/c1_LIR.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,8 @@ LIR_OpArrayCopy::LIR_OpArrayCopy(LIR_Opr src, LIR_Opr src_pos, LIR_Opr dst, LIR_
351351
, _expected_type(expected_type)
352352
, _flags(flags) {
353353
#if defined(X86) || defined(AARCH64) || defined(S390) || defined(RISCV64) || defined(PPC64)
354-
if (expected_type != nullptr && flags == 0) {
354+
if (expected_type != nullptr &&
355+
((flags & ~LIR_OpArrayCopy::get_initial_copy_flags()) == 0)) {
355356
_stub = nullptr;
356357
} else {
357358
_stub = new ArrayCopyStub(this);

src/hotspot/share/c1/c1_LIR.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,6 +1282,8 @@ class LIR_OpArrayCopy: public LIR_Op {
12821282
int flags() const { return _flags; }
12831283
ciArrayKlass* expected_type() const { return _expected_type; }
12841284
ArrayCopyStub* stub() const { return _stub; }
1285+
static int get_initial_copy_flags() { return LIR_OpArrayCopy::unaligned |
1286+
LIR_OpArrayCopy::overlapping; }
12851287

12861288
virtual void emit_code(LIR_Assembler* masm);
12871289
virtual LIR_OpArrayCopy* as_OpArrayCopy() { return this; }

0 commit comments

Comments
 (0)