JDK-8206115 : Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 11,12
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-06-29
  • Updated: 2019-09-10
  • Resolved: 2018-08-15
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.
JDK 11 JDK 12
11.0.6Fixed 12 b07Fixed
Related Reports
Relates :  
Description
MetaspaceShared::serialize_well_known_classes() archived the field offsets computed by JavaClasses::compute_offsets(). At runtime, the archived field offsets are used without recomputing.

When a new class is added in javaClasses.*, if MetaspaceShared::serialize_well_known_classes() is not updated to include the new class' field offsets, there will be a runtime failure when the new field offset is used.

To avoid JavaClasses::compute_offsets() and MetaspaceShared::serialize_well_known_classes() being out of sync, we could use shared macros for these functions.
Comments
Fix Request Backporting this patch as a dependency for additional planned backporting of CDS bug fixes and improvements. Patch applies cleanly to 11u on top of JDK-8209120 patch.
14-08-2019

We have a bug introduced by JDK-8209120 http://hg.openjdk.java.net/jdk/jdk/rev/0dcd27526967 -> http://hg.openjdk.java.net/jdk/jdk/annotate/0dcd27526967/src/hotspot/share/memory/metaspaceShared.cpp#l432 java_lang_Integer_IntegerCache::serialize() is missing from MetaspaceShared::serialize_well_known_classes We need to implement this RFE to avoid future problems.
15-08-2018