3395 // system settings, and thread group of the main thread.
3396 static void call_initPhase1(TRAPS) {
3397 Klass* klass = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_System(), true, CHECK);
3398 JavaValue result(T_VOID);
3399 JavaCalls::call_static(&result, klass, vmSymbols::initPhase1_name(),
3400 vmSymbols::void_method_signature(), CHECK);
3401 }
3402
3403 // Phase 2. Module system initialization
3404 // This will initialize the module system. Only java.base classes
3405 // can be loaded until phase 2 completes.
3406 //
3407 // Call System.initPhase2 after the compiler initialization and jsr292
3408 // classes get initialized because module initialization runs a lot of java
3409 // code, that for performance reasons, should be compiled. Also, this will
3410 // enable the startup code to use lambda and other language features in this
3411 // phase and onward.
3412 //
3413 // After phase 2, The VM will begin search classes from -Xbootclasspath/a.
3414 static void call_initPhase2(TRAPS) {
3415 TraceTime timer("Phase2 initialization", TRACETIME_LOG(Info, module, startuptime));
3416
3417 Klass* klass = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_System(), true, CHECK);
3418
3419 JavaValue result(T_INT);
3420 JavaCallArguments args;
3421 args.push_int(DisplayVMOutputToStderr);
3422 args.push_int(log_is_enabled(Debug, init)); // print stack trace if exception thrown
3423 JavaCalls::call_static(&result, klass, vmSymbols::initPhase2_name(),
3424 vmSymbols::boolean_boolean_int_signature(), &args, CHECK);
3425 if (result.get_jint() != JNI_OK) {
3426 vm_exit_during_initialization(); // no message or exception
3427 }
3428
3429 universe_post_module_init();
3430 }
3431
3432 // Phase 3. final setup - set security manager, system class loader and TCCL
3433 //
3434 // This will instantiate and set the security manager, set the system class
3435 // loader as well as the thread context class loader. The security manager
|
3395 // system settings, and thread group of the main thread.
3396 static void call_initPhase1(TRAPS) {
3397 Klass* klass = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_System(), true, CHECK);
3398 JavaValue result(T_VOID);
3399 JavaCalls::call_static(&result, klass, vmSymbols::initPhase1_name(),
3400 vmSymbols::void_method_signature(), CHECK);
3401 }
3402
3403 // Phase 2. Module system initialization
3404 // This will initialize the module system. Only java.base classes
3405 // can be loaded until phase 2 completes.
3406 //
3407 // Call System.initPhase2 after the compiler initialization and jsr292
3408 // classes get initialized because module initialization runs a lot of java
3409 // code, that for performance reasons, should be compiled. Also, this will
3410 // enable the startup code to use lambda and other language features in this
3411 // phase and onward.
3412 //
3413 // After phase 2, The VM will begin search classes from -Xbootclasspath/a.
3414 static void call_initPhase2(TRAPS) {
3415 TraceTime timer("Initialize module system", TRACETIME_LOG(Info, startuptime));
3416
3417 Klass* klass = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_System(), true, CHECK);
3418
3419 JavaValue result(T_INT);
3420 JavaCallArguments args;
3421 args.push_int(DisplayVMOutputToStderr);
3422 args.push_int(log_is_enabled(Debug, init)); // print stack trace if exception thrown
3423 JavaCalls::call_static(&result, klass, vmSymbols::initPhase2_name(),
3424 vmSymbols::boolean_boolean_int_signature(), &args, CHECK);
3425 if (result.get_jint() != JNI_OK) {
3426 vm_exit_during_initialization(); // no message or exception
3427 }
3428
3429 universe_post_module_init();
3430 }
3431
3432 // Phase 3. final setup - set security manager, system class loader and TCCL
3433 //
3434 // This will instantiate and set the security manager, set the system class
3435 // loader as well as the thread context class loader. The security manager
|