Skip to content

Commit

Permalink
Basic x86_64 version
Browse files Browse the repository at this point in the history
  • Loading branch information
shipilev committed Oct 21, 2024
1 parent b6f3494 commit 0a6400e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/hotspot/cpu/x86/x86_64.ad
Original file line number Diff line number Diff line change
Expand Up @@ -12385,18 +12385,19 @@ instruct cmpFastUnlockLightweight(rFlagsReg cr, rRegP object, rax_RegP rax_reg,

// ============================================================================
// Safepoint Instructions
instruct safePoint_poll_tls(rFlagsReg cr, rRegP poll)
instruct safePoint_poll_tls(rax_RegP rax_reg, rFlagsReg cr)
%{
match(SafePoint poll);
effect(KILL cr, USE poll);
match(SafePoint);
effect(KILL cr, KILL rax_reg);

format %{ "testl rax, [$poll]\t"
"# Safepoint: poll for GC" %}
format %{ "mov rax, [thread, #polling_page_offset]\n\t"
"testl rax, [rax]\t# Safepoint: poll for GC" %}
ins_cost(125);
ins_encode %{
__ movptr(rax, Address(r15_thread, JavaThread::polling_page_offset()));
__ relocate(relocInfo::poll_type);
address pre_pc = __ pc();
__ testl(rax, Address($poll$$Register, 0));
__ testl(rax, Address(rax, 0));
assert(nativeInstruction_at(pre_pc)->is_safepoint_poll(), "must emit test %%eax [reg]");
%}
ins_pipe(ialu_reg_mem);
Expand Down

0 comments on commit 0a6400e

Please sign in to comment.