JDK-8214763 : add compiler intrinsic to materialize objects
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 12
  • Priority: P2
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2018-12-04
  • Updated: 2023-11-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
The C2 and Graal compilers can eliminate allocations, producing virtual objects, if escape analysis determines that the objects never escape.  However, in order to ensure that the objects show up in stack walks, we need a way to materialize these objects (as if they always escape).

One way to do this is to pass the object to a native method, but a compiler intrinsic would be better.
Comments
[~cslucas] For example, java.security.AccessController.executePrivileged() uses the native method ensureMaterializedForStackWalk() to prevent the JIT compiler from optimizing out the allocation. However this has overhead because it is a native method call. It would be nice to have something that has zero overhead, perhaps along the lines of java.lang.ref.Reference.reachabilityFence() or blackholes.
20-01-2023

Hi Dean, I'm working on something that seems related to this issue and perhaps I can work on both in "parallel". Can you please elaborate a bit your idea here? Thanks.
18-01-2023