Skip to content

Commit 53ad4e9

Browse files
committed
Implement arraycopy_epilogue
1 parent 4a1e59b commit 53ad4e9

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

mmtk/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ lto = true
1717
[package.metadata.openjdk]
1818
# Our CI matches the following line and extract mmtk/openjdk. If this line is updated, please check ci yaml files and make sure it works.
1919
openjdk_repo = "https://github.com/caizixian/jdk-mmtk.git"
20-
openjdk_version = "b369f54e36e79d5cc3e67424209be3bbae60d644"
20+
openjdk_version = "118483bfe38ddc716272cc92461dfbefdffb7047"
2121

2222
[dependencies]
2323
libc = "0.2"

openjdk/cpu/riscv/mmtkObjectBarrierSetAssembler_riscv.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,17 @@ void MMTkObjectBarrierSetAssembler::object_reference_write_post(MacroAssembler*
88
assert(false, "Not implemented");
99
}
1010

11-
void MMTkObjectBarrierSetAssembler::arraycopy_epilogue(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Register src, Register dst, Register count) {
12-
assert(false, "Not implemented");
11+
void MMTkObjectBarrierSetAssembler::arraycopy_epilogue(MacroAssembler* masm, DecoratorSet decorators, bool is_oop,
12+
Register src, Register dst, Register count, Register tmp, RegSet saved_regs) {
13+
// see also void G1BarrierSetAssembler::gen_write_ref_array_post_barrier
14+
assert_different_registers(src, dst, count);
15+
const bool dest_uninitialized = (decorators & IS_DEST_UNINITIALIZED) != 0;
16+
if (is_oop && !dest_uninitialized) {
17+
// in address generate_checkcast_copy, caller tells us to save count
18+
__ push_reg(saved_regs, sp);
19+
__ call_VM_leaf(FN_ADDR(MMTkBarrierSetRuntime::object_reference_array_copy_post_call), src, dst, count);
20+
__ pop_reg(saved_regs, sp);
21+
}
1322
}
1423

1524
#undef __

openjdk/cpu/riscv/mmtkObjectBarrierSetAssembler_riscv.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ class MMTkObjectBarrierSetAssembler: public MMTkBarrierSetAssembler {
55
protected:
66
virtual void object_reference_write_post(MacroAssembler* masm, DecoratorSet decorators, Address dst, Register val, Register tmp1, Register tmp2) const override;
77
public:
8-
virtual void arraycopy_epilogue(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Register src, Register dst, Register count) override;
8+
virtual void arraycopy_epilogue(MacroAssembler* masm, DecoratorSet decorators, bool is_oop,
9+
Register src, Register dst, Register count, Register tmp, RegSet saved_regs) override;
910
};
1011
#endif // MMTK_OPENJDK_MMTK_OBJECT_BARRIER_SET_ASSEMBLER_RISCV_HPP

0 commit comments

Comments
 (0)