RFR: 8285364: Remove REF_ enum for java.lang.ref.Reference [v4]

Albert Mingkun Yang ayang at openjdk.java.net
Fri Apr 29 11:42:44 UTC 2022


On Fri, 29 Apr 2022 10:56:49 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> The current approach limits the knowledge of non-strong ref types to `instanceRefKlass` file.
>
> The `_reference_type` used to be initialized correctly in most cases, but
> needed fixing up for a few cases during bootstrapping. With this change it is
> *never* initialized correctly for Reference subtypes and always needs an
> initialization kludge for them. That's not an improvement.

`_reference_type` always gets the correct value after the constructor is run. The member initializer list just follows the convention of having all fields set. One could move this field inside the constructor body to ensure this field is set only once.

-------------

PR: https://git.openjdk.java.net/jdk/pull/8332


More information about the hotspot-dev mailing list