Skip to content

Commit

Permalink
8261072: AArch64: Fix MacroAssembler::get_thread convention
Browse files Browse the repository at this point in the history
Co-authored-by: Monica Beckwith <[email protected]>
Backport-of: b670efd
  • Loading branch information
2 people authored and NikitkoCent committed Oct 5, 2021
1 parent 262751e commit 0e05626
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5811,10 +5811,14 @@ void MacroAssembler::char_array_compress(Register src, Register dst, Register le
// by the call to JavaThread::aarch64_get_thread_helper() or, indeed,
// the call setup code.
//
// aarch64_get_thread_helper() clobbers only r0, r1, and flags.
// On Linux, aarch64_get_thread_helper() clobbers only r0, r1, and flags.
// On other systems, the helper is a usual C function.
//
void MacroAssembler::get_thread(Register dst) {
RegSet saved_regs = RegSet::range(r0, r1) + BSD_ONLY(RegSet::range(r2, r17)) + lr - dst;
RegSet saved_regs =
LINUX_ONLY(RegSet::range(r0, r1) + lr - dst)
NOT_LINUX (RegSet::range(r0, r17) + lr - dst);

push(saved_regs, sp);

mov(lr, CAST_FROM_FN_PTR(address, JavaThread::aarch64_get_thread_helper));
Expand Down

0 comments on commit 0e05626

Please sign in to comment.