1 /*
2 * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
3424 static void call_initPhase3(TRAPS) {
3425 Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_System(), true, CHECK);
3426 instanceKlassHandle klass (THREAD, k);
3427
3428 JavaValue result(T_VOID);
3429 JavaCalls::call_static(&result, klass, vmSymbols::initPhase3_name(),
3430 vmSymbols::void_method_signature(), CHECK);
3431 }
3432
3433 void Threads::initialize_java_lang_classes(JavaThread* main_thread, TRAPS) {
3434 TraceTime timer("Initialize java.lang classes", TRACETIME_LOG(Info, startuptime));
3435
3436 if (EagerXrunInit && Arguments::init_libraries_at_startup()) {
3437 create_vm_init_libraries();
3438 }
3439
3440 initialize_class(vmSymbols::java_lang_String(), CHECK);
3441
3442 // Inject CompactStrings value after the static initializers for String ran.
3443 java_lang_String::set_compact_strings(CompactStrings);
3444
3445 // Initialize java_lang.System (needed before creating the thread)
3446 initialize_class(vmSymbols::java_lang_System(), CHECK);
3447 // The VM creates & returns objects of this class. Make sure it's initialized.
3448 initialize_class(vmSymbols::java_lang_Class(), CHECK);
3449 initialize_class(vmSymbols::java_lang_ThreadGroup(), CHECK);
3450 Handle thread_group = create_initial_thread_group(CHECK);
3451 Universe::set_main_thread_group(thread_group());
3452 initialize_class(vmSymbols::java_lang_Thread(), CHECK);
3453 oop thread_object = create_initial_thread(thread_group, main_thread, CHECK);
3454 main_thread->set_threadObj(thread_object);
3455 // Set thread status to running since main thread has
3456 // been started and running.
3457 java_lang_Thread::set_thread_status(thread_object,
3458 java_lang_Thread::RUNNABLE);
3459
3460 // The VM creates objects of this class.
3461 initialize_class(vmSymbols::java_lang_reflect_Module(), CHECK);
3462
3463 // The VM preresolves methods to these classes. Make sure that they get initialized
|
1 /*
2 * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
3424 static void call_initPhase3(TRAPS) {
3425 Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_System(), true, CHECK);
3426 instanceKlassHandle klass (THREAD, k);
3427
3428 JavaValue result(T_VOID);
3429 JavaCalls::call_static(&result, klass, vmSymbols::initPhase3_name(),
3430 vmSymbols::void_method_signature(), CHECK);
3431 }
3432
3433 void Threads::initialize_java_lang_classes(JavaThread* main_thread, TRAPS) {
3434 TraceTime timer("Initialize java.lang classes", TRACETIME_LOG(Info, startuptime));
3435
3436 if (EagerXrunInit && Arguments::init_libraries_at_startup()) {
3437 create_vm_init_libraries();
3438 }
3439
3440 initialize_class(vmSymbols::java_lang_String(), CHECK);
3441
3442 // Inject CompactStrings value after the static initializers for String ran.
3443 java_lang_String::set_compact_strings(CompactStrings);
3444
3445 #ifdef ASSERT
3446 // And set debug flag for String intrinsics
3447 java_lang_String::set_debug_intrinsics(true);
3448 #endif
3449
3450 // Initialize java_lang.System (needed before creating the thread)
3451 initialize_class(vmSymbols::java_lang_System(), CHECK);
3452 // The VM creates & returns objects of this class. Make sure it's initialized.
3453 initialize_class(vmSymbols::java_lang_Class(), CHECK);
3454 initialize_class(vmSymbols::java_lang_ThreadGroup(), CHECK);
3455 Handle thread_group = create_initial_thread_group(CHECK);
3456 Universe::set_main_thread_group(thread_group());
3457 initialize_class(vmSymbols::java_lang_Thread(), CHECK);
3458 oop thread_object = create_initial_thread(thread_group, main_thread, CHECK);
3459 main_thread->set_threadObj(thread_object);
3460 // Set thread status to running since main thread has
3461 // been started and running.
3462 java_lang_Thread::set_thread_status(thread_object,
3463 java_lang_Thread::RUNNABLE);
3464
3465 // The VM creates objects of this class.
3466 initialize_class(vmSymbols::java_lang_reflect_Module(), CHECK);
3467
3468 // The VM preresolves methods to these classes. Make sure that they get initialized
|