JDK-8371713 : [lworld] Method Unsafe.getFieldMap() should be an intrinsic
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: repo-valhalla
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2025-11-12
  • Updated: 2025-11-21
  • Resolved: 2025-11-21
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
repo-valhallaResolved
Related Reports
Duplicate :  
Relates :  
Description
Unsafe.getFieldMap() is an essential method of the alternate substitutability test method, but its cost is very high compared to the fields comparison itself, sometimes taking 50% of the time needed to perform the substitutability test.
The main reason of this cost is that it is a call to the JVM runtime. But the method itself is very simple, fetching an offset in the InlineKlass instance, and using it to return the content of a reference field stored at this offset in the class mirror. It could easily be transformed into an intrinsic in both C1 and C2. 
Comments
I'll fix this with JDK-8228361.
21-11-2025