Mercurial > hg > graal-jvmci-8
annotate src/share/vm/runtime/init.cpp @ 1778:eeade8e89248
Merge
author | ysr |
---|---|
date | Sat, 11 Sep 2010 11:42:09 -0700 |
parents | f55c4f82ab9d |
children | 9eecf81a02fb |
rev | line source |
---|---|
0 | 1 /* |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1299
diff
changeset
|
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. |
0 | 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 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1299
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1299
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1299
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
25 # include "incls/_precompiled.incl" | |
26 # include "incls/_init.cpp.incl" | |
27 | |
28 // Initialization done by VM thread in vm_init_globals() | |
29 void check_ThreadShadow(); | |
30 void eventlog_init(); | |
31 void mutex_init(); | |
32 void chunkpool_init(); | |
33 void perfMemory_init(); | |
34 | |
35 // Initialization done by Java thread in init_globals() | |
36 void management_init(); | |
37 void bytecodes_init(); | |
38 void classLoader_init(); | |
39 void codeCache_init(); | |
40 void VM_Version_init(); | |
41 void stubRoutines_init1(); | |
42 jint universe_init(); // dependent on codeCache_init and stubRoutines_init | |
43 void interpreter_init(); // before any methods loaded | |
44 void invocationCounter_init(); // before any methods loaded | |
45 void marksweep_init(); | |
46 void accessFlags_init(); | |
47 void templateTable_init(); | |
48 void InterfaceSupport_init(); | |
49 void universe2_init(); // dependent on codeCache_init and stubRoutines_init | |
50 void referenceProcessor_init(); | |
51 void jni_handles_init(); | |
52 void vmStructs_init(); | |
53 | |
54 void vtableStubs_init(); | |
55 void InlineCacheBuffer_init(); | |
56 void compilerOracle_init(); | |
57 void compilationPolicy_init(); | |
58 | |
59 | |
60 // Initialization after compiler initialization | |
61 bool universe_post_init(); // must happen after compiler_init | |
62 void javaClasses_init(); // must happen after vtable initialization | |
63 void stubRoutines_init2(); // note: StubRoutines need 2-phase init | |
64 | |
65 // Do not disable thread-local-storage, as it is important for some | |
66 // JNI/JVM/JVMTI functions and signal handlers to work properly | |
67 // during VM shutdown | |
68 void perfMemory_exit(); | |
69 void ostream_exit(); | |
70 | |
71 void vm_init_globals() { | |
72 check_ThreadShadow(); | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
73 basic_types_init(); |
0 | 74 eventlog_init(); |
75 mutex_init(); | |
76 chunkpool_init(); | |
77 perfMemory_init(); | |
78 } | |
79 | |
80 | |
81 jint init_globals() { | |
82 HandleMark hm; | |
83 management_init(); | |
84 bytecodes_init(); | |
85 classLoader_init(); | |
86 codeCache_init(); | |
87 VM_Version_init(); | |
88 stubRoutines_init1(); | |
89 jint status = universe_init(); // dependent on codeCache_init and stubRoutines_init | |
90 if (status != JNI_OK) | |
91 return status; | |
92 | |
93 interpreter_init(); // before any methods loaded | |
94 invocationCounter_init(); // before any methods loaded | |
95 marksweep_init(); | |
96 accessFlags_init(); | |
97 templateTable_init(); | |
98 InterfaceSupport_init(); | |
99 SharedRuntime::generate_stubs(); | |
100 universe2_init(); // dependent on codeCache_init and stubRoutines_init | |
101 referenceProcessor_init(); | |
102 jni_handles_init(); | |
103 #ifndef VM_STRUCTS_KERNEL | |
104 vmStructs_init(); | |
105 #endif // VM_STRUCTS_KERNEL | |
106 | |
107 vtableStubs_init(); | |
108 InlineCacheBuffer_init(); | |
109 compilerOracle_init(); | |
110 compilationPolicy_init(); | |
111 VMRegImpl::set_regName(); | |
112 | |
113 if (!universe_post_init()) { | |
114 return JNI_ERR; | |
115 } | |
116 javaClasses_init(); // must happen after vtable initialization | |
117 stubRoutines_init2(); // note: StubRoutines need 2-phase init | |
118 | |
1299
9eba43136cb5
6934494: JSR 292 MethodHandles adapters should be generated into their own CodeBlob
twisti
parents:
242
diff
changeset
|
119 // Generate MethodHandles adapters. |
9eba43136cb5
6934494: JSR 292 MethodHandles adapters should be generated into their own CodeBlob
twisti
parents:
242
diff
changeset
|
120 MethodHandles::generate_adapters(); |
9eba43136cb5
6934494: JSR 292 MethodHandles adapters should be generated into their own CodeBlob
twisti
parents:
242
diff
changeset
|
121 |
0 | 122 // Although we'd like to, we can't easily do a heap verify |
123 // here because the main thread isn't yet a JavaThread, so | |
124 // its TLAB may not be made parseable from the usual interfaces. | |
125 if (VerifyBeforeGC && !UseTLAB && | |
126 Universe::heap()->total_collections() >= VerifyGCStartAt) { | |
127 Universe::heap()->prepare_for_verify(); | |
128 Universe::verify(); // make sure we're starting with a clean slate | |
129 } | |
130 | |
1730
f55c4f82ab9d
6978249: spill between cpu and fpu registers when those moves are fast
never
parents:
1644
diff
changeset
|
131 // All the flags that get adjusted by VM_Version_init and os::init_2 |
f55c4f82ab9d
6978249: spill between cpu and fpu registers when those moves are fast
never
parents:
1644
diff
changeset
|
132 // have been set so dump the flags now. |
f55c4f82ab9d
6978249: spill between cpu and fpu registers when those moves are fast
never
parents:
1644
diff
changeset
|
133 if (PrintFlagsFinal) { |
f55c4f82ab9d
6978249: spill between cpu and fpu registers when those moves are fast
never
parents:
1644
diff
changeset
|
134 CommandLineFlags::printFlags(); |
f55c4f82ab9d
6978249: spill between cpu and fpu registers when those moves are fast
never
parents:
1644
diff
changeset
|
135 } |
f55c4f82ab9d
6978249: spill between cpu and fpu registers when those moves are fast
never
parents:
1644
diff
changeset
|
136 |
0 | 137 return JNI_OK; |
138 } | |
139 | |
140 | |
141 void exit_globals() { | |
142 static bool destructorsCalled = false; | |
143 if (!destructorsCalled) { | |
144 destructorsCalled = true; | |
145 perfMemory_exit(); | |
146 if (PrintSafepointStatistics) { | |
147 // Print the collected safepoint statistics. | |
148 SafepointSynchronize::print_stat_on_exit(); | |
149 } | |
150 ostream_exit(); | |
151 } | |
152 } | |
153 | |
154 | |
155 static bool _init_completed = false; | |
156 | |
157 bool is_init_completed() { | |
158 return _init_completed; | |
159 } | |
160 | |
161 | |
162 void set_init_completed() { | |
163 _init_completed = true; | |
164 } |