Skip to content

Commit

Permalink
Draft fix for missing safepoint checks at returns
Browse files Browse the repository at this point in the history
  • Loading branch information
parttimenerd committed Jul 31, 2023
1 parent bf20a71 commit eea42bc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/hotspot/cpu/aarch64/templateTable_aarch64.cpp
Expand Up @@ -2191,6 +2191,16 @@ void TemplateTable::_return(TosState state)
__ bind(skip_register_finalizer);
}

if (_desc->bytecode() != Bytecodes::_return_register_finalizer) {
Label slow_path;
Label fast_path;
__ safepoint_poll(slow_path, true /* at_return */, false /* acquire */, false /* in_nmethod */);
__ br(Assembler::AL, fast_path);
__ bind(slow_path);
__ super_call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint), rthread);
__ bind(fast_path);
}

// Issue a StoreStore barrier after all stores but before return
// from any constructor for any class with a final field. We don't
// know if this is a finalizer, so we always do so.
Expand Down

0 comments on commit eea42bc

Please sign in to comment.