RFR(S): 8185694: Replace SystemDictionaryShared::_java_platform_loader with SystemDictionary::is_platform_class_loader()
Calvin Cheung
calvin.cheung at oracle.com
Fri Oct 6 17:33:35 UTC 2017
On 10/6/17, 10:18 AM, mandy chung wrote:
>
>
> On 10/5/17 5:59 PM, Calvin Cheung wrote:
>> I've modified the code to using SystemDictionary::ClassLoader_klass()
>> but I don't need the local variable because I'm creating the
>> _java_system_loader and _java_platform_loader separately in 2
>> different functions.
>>
>> It is because the _java_platform_loader is required for module system
>> initialization in call_initPhase2.
>> It would be too early to create the _java_system_loader before
>> call_initPhase2 because in call_initPhase3, it will check if there is
>> a custom system loader defined via the -Djava.system.loader property.
> Where in the VM that accesses _java_platform_loader before initPhase?
>
> The module system initialization implementation is in the library. I
> don't see how the VM will need to access it before call_initPhase2.
During initPhase2, the java library calls the JVM_DefineModule() API
which in turn calls the Modules::define_module() where it requires the
_java_platform_loader:
if (!h_loader.is_null() &&
!*SystemDictionary::is_platform_class_loader(h_loader())* &&
(strncmp(package_name, JAVAPKG, JAVAPKG_LEN) == 0 &&
(package_name[JAVAPKG_LEN] == '/' ||
package_name[JAVAPKG_LEN] == '\0'))) {
thanks,
Calvin
More information about the hotspot-runtime-dev
mailing list