8287061: Support for rematerializing scalar replaced objects participating in allocation merges

Reviewed-by: kvn, vlivanov
This commit is contained in:
Cesar Soares Lucas 2023-07-17 23:01:35 +00:00 committed by Vladimir Kozlov
parent 3236ba0be4
commit a53345ad03
26 changed files with 2631 additions and 254 deletions

View file

@ -778,6 +778,13 @@ public final class AccessController {
T result = action.run();
assert isPrivileged(); // sanity check invariant
// The 'getStackAccessControlContext' call inside 'isPrivileged'
// requires that no Local was scalar replaced. However, in some
// situations, after inlining, 'result' (or part of a possibly
// allocation merge Phi leading to it) might become NonEscaping and get
// scalar replaced. The call below enforces 'result' to always escape.
ensureMaterializedForStackWalk(result);
// Keep these alive across the run() call so they can be
// retrieved by getStackAccessControlContext().
Reference.reachabilityFence(context);
@ -809,6 +816,13 @@ public final class AccessController {
T result = action.run();
assert isPrivileged(); // sanity check invariant
// The 'getStackAccessControlContext' call inside 'isPrivileged'
// requires that no Local was scalar replaced. However, in some
// situations, after inlining, 'result' (or part of a possibly
// allocation merge Phi leading to it) might become NonEscaping and get
// scalar replaced. The call below enforces 'result' to always escape.
ensureMaterializedForStackWalk(result);
// Keep these alive across the run() call so they can be
// retrieved by getStackAccessControlContext().
Reference.reachabilityFence(context);