Skip to content

Commit

Permalink
Use la()
Browse files Browse the repository at this point in the history
  • Loading branch information
robehn committed Apr 29, 2024
1 parent 7272939 commit 2891b21
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/hotspot/cpu/riscv/macroAssembler_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2098,7 +2098,7 @@ void MacroAssembler::movoop(Register dst, jobject obj) {
RelocationHolder rspec = oop_Relocation::spec(oop_index);

if (BarrierSet::barrier_set()->barrier_set_assembler()->supports_instruction_patching()) {
mv(dst, Address((address)obj, rspec));
la(dst, Address((address)obj, rspec));
} else {
address dummy = address(uintptr_t(pc()) & -wordSize); // A nearby aligned address
ld_constant(dst, Address(dummy, rspec));
Expand All @@ -2114,7 +2114,7 @@ void MacroAssembler::mov_metadata(Register dst, Metadata* obj) {
oop_index = oop_recorder()->find_index(obj);
}
RelocationHolder rspec = metadata_Relocation::spec(oop_index);
mv(dst, Address((address)obj, rspec));
la(dst, Address((address)obj, rspec));
}

// Writes to stack successive pages until offset reached to check for
Expand Down
7 changes: 0 additions & 7 deletions src/hotspot/cpu/riscv/macroAssembler_riscv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -763,13 +763,6 @@ class MacroAssembler: public Assembler {
template<typename T, ENABLE_IF(std::is_integral<T>::value)>
inline void mv(Register Rd, T o) { li(Rd, (int64_t)o); }

void mv(Register Rd, Address dest) {
assert(dest.getMode() == Address::literal, "Address mode should be Address::literal");
relocate(dest.rspec(), [&] {
movptr(Rd, dest.target());
});
}

void mv(Register Rd, RegisterOrConstant src) {
if (src.is_register()) {
mv(Rd, src.as_register());
Expand Down

0 comments on commit 2891b21

Please sign in to comment.