RFR: 8262227: Change SystemDictionary::find() to return an InstanceKlass*.

Coleen Phillimore coleenp at openjdk.java.net
Thu Feb 25 13:13:39 UTC 2021


On Wed, 24 Feb 2021 23:06:18 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> src/hotspot/share/runtime/thread.cpp line 3017:
>> 
>>> 3015:   InstanceKlass* ik = SystemDictionary::find_instance_klass(vmSymbols::java_lang_VersionProps(),
>>> 3016:                                                             Handle(), Handle());
>>> 3017:   JDK_Version::set_java_version(get_java_version(ik));
>> 
>> The various get_java_xxx() functions all seem to do the same thing. I am wondering if they can be combined into a single utility function, so that you can do something like:
>> 
>> JDK_Version::set_runtime_name(get_version_info(ik, vmSymbols::java_version_name(),
>>                               java_version, sizeof(java_version)));
>
> I think the get_java_* set of functions could be streamlined so that you pass in the symbol for the field you need. Also perhaps VersionProps could be a well-known class so we don't have to look it up. But this seems a future RFE. Even the current changes seem a little out-of-scope for this change.

yes, this might be a useful change in a follow up RFE. What you have is good.  You were going to change the lines anyway.

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

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


More information about the hotspot-dev mailing list