RFR: 8260467: Move well-known classes from systemDictionary.hpp to vmClasses.hpp
Ioi Lam
iklam at openjdk.java.net
Tue Jan 26 23:51:49 UTC 2021
The "well-known classes" API in [systemDictionary.hpp](https://github.com/openjdk/jdk/blob/19b6f61bd2f49f06ef6b8e9b6ecd2fd910070035/src/hotspot/share/classfile/systemDictionary.hpp#L103) 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](https://github.com/openjdk/jdk/blob/19b6f61bd2f49f06ef6b8e9b6ecd2fd910070035/src/hotspot/share/classfile/vmSymbols.hpp#L53) and [vmIntrinsics.hpp](https://github.com/openjdk/jdk/blob/19b6f61bd2f49f06ef6b8e9b6ecd2fd910070035/src/hotspot/share/classfile/vmIntrinsics.hpp#L108):
#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](https://bugs.openjdk.java.net/browse/JDK-8260471) -- [preliminary webrev](http://cr.openjdk.java.net/~iklam/jdk17/8260471-decouple-vmClasses-and-SystemDictionary/)).
Within this RFE, we temporarily subclass `SystemDictionary` from `vmClasses`, so `SystemDictionary::Object_klass()` will continue to work.
Tested with mach5: tier1, builds-tier2, builds-tier3, builds-tier4 and builds-tier5. Also locally: aarch64, arm, ppc64, s390, x86, and zero.
-------------
Commit messages:
- Merge branch 'master' into 8260467-move-well-known-klasses-out-of-system-dictionary
- added missing vmClasses.hpp
- Renamed VMClasses to vmClasses to be consistent with vmSymbols
- Move well_known_classes out of SystemDictionary
Changes: https://git.openjdk.java.net/jdk/pull/2246/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2246&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8260467
Stats: 1208 lines in 35 files changed: 634 ins; 455 del; 119 mod
Patch: https://git.openjdk.java.net/jdk/pull/2246.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/2246/head:pull/2246
PR: https://git.openjdk.java.net/jdk/pull/2246
More information about the hotspot-dev
mailing list