JDK-8260467 : Move well-known classes from systemDictionary.hpp to vmClasses.hpp
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-01-26
  • Updated: 2024-02-06
  • Resolved: 2021-01-28
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 17
17 b08Fixed
Related Reports
Duplicate :  
Relates :  
Sub Tasks
JDK-8260471 :  
Description
The "well-known classes" API in systemDictionary.hpp [1] is for accessing a fixed set of classes defined by the bootstrap loader. The rest of systemDictionary.hpp is for finding/defining arbitrary classes in arbitrary class loaders. For modularity, we should separate these two sets of APIs, and make them independent of each other.

The proposed API follows the existing pattern of accessing known symbols/intrinsics in vmSymbols.hpp [2] and vmIntrinsics.hpp [3]:

#include "classfile/vmClasses.hpp"
#include "classfile/vmIntrinsics.hpp"
#include "classfile/vmSymbols.hpp"  // NEW

Symbol* s = vmSymbols::java_lang_Object();
vmIntrinsics::ID id = vmIntrinsics::_linkToSpecial;
Klass* k = vmClasses::Object_klass();  // NEW

Note: to help the review process and limit the amount of boiler-place changes, within this RFE, we do not change existing calls like SystemDictionary::Object_klass() to vmClasses::Object_klass(). That will be done in a subtask (JDK-8260471). 

Within this RFE, we subclass SystemDictionary from vmClasses, so SystemDictionary::Object_klass() will continue to work.

[1] https://github.com/openjdk/jdk/blob/19b6f61bd2f49f06ef6b8e9b6ecd2fd910070035/src/hotspot/share/classfile/systemDictionary.hpp#L103
[2] https://github.com/openjdk/jdk/blob/19b6f61bd2f49f06ef6b8e9b6ecd2fd910070035/src/hotspot/share/classfile/vmSymbols.hpp#L53
[3] https://github.com/openjdk/jdk/blob/19b6f61bd2f49f06ef6b8e9b6ecd2fd910070035/src/hotspot/share/classfile/vmIntrinsics.hpp#L108
Comments
Changeset: 396a496f Author: Ioi Lam <iklam@openjdk.org> Date: 2021-01-28 04:24:04 +0000 URL: https://git.openjdk.java.net/jdk/commit/396a496f
28-01-2021