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 *
23 */
24
25 #include "precompiled.hpp"
26 #include "classfile/stringTable.hpp"
27 #include "classfile/symbolTable.hpp"
28 #include "code/icBuffer.hpp"
29 #include "gc/shared/collectedHeap.hpp"
30 #include "interpreter/bytecodes.hpp"
31 #include "memory/universe.hpp"
32 #include "prims/methodHandles.hpp"
33 #include "runtime/globals.hpp"
34 #include "runtime/handles.inline.hpp"
35 #include "runtime/icache.hpp"
36 #include "runtime/init.hpp"
37 #include "runtime/safepoint.hpp"
38 #include "runtime/sharedRuntime.hpp"
39 #include "services/memTracker.hpp"
40 #include "utilities/macros.hpp"
41
42
43 // Initialization done by VM thread in vm_init_globals()
44 void check_ThreadShadow();
45 void eventlog_init();
46 void mutex_init();
47 void chunkpool_init();
48 void perfMemory_init();
49 void SuspendibleThreadSet_init() NOT_ALL_GCS_RETURN;
50
51 // Initialization done by Java thread in init_globals()
52 void management_init();
53 void bytecodes_init();
146 if (!compileBroker_init()) {
147 return JNI_EINVAL;
148 }
149 VMRegImpl::set_regName();
150
151 if (!universe_post_init()) {
152 return JNI_ERR;
153 }
154 stubRoutines_init2(); // note: StubRoutines need 2-phase init
155 MethodHandles::generate_adapters();
156
157 #if INCLUDE_NMT
158 // Solaris stack is walkable only after stubRoutines are set up.
159 // On Other platforms, the stack is always walkable.
160 NMT_stack_walkable = true;
161 #endif // INCLUDE_NMT
162
163 // All the flags that get adjusted by VM_Version_init and os::init_2
164 // have been set so dump the flags now.
165 if (PrintFlagsFinal || PrintFlagsRanges) {
166 CommandLineFlags::printFlags(tty, false, PrintFlagsRanges);
167 }
168
169 return JNI_OK;
170 }
171
172
173 void exit_globals() {
174 static bool destructorsCalled = false;
175 if (!destructorsCalled) {
176 destructorsCalled = true;
177 perfMemory_exit();
178 if (PrintSafepointStatistics) {
179 // Print the collected safepoint statistics.
180 SafepointSynchronize::print_stat_on_exit();
181 }
182 if (PrintStringTableStatistics) {
183 SymbolTable::dump(tty);
184 StringTable::dump(tty);
185 }
186 ostream_exit();
|
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 *
23 */
24
25 #include "precompiled.hpp"
26 #include "classfile/stringTable.hpp"
27 #include "classfile/symbolTable.hpp"
28 #include "code/icBuffer.hpp"
29 #include "gc/shared/collectedHeap.hpp"
30 #include "interpreter/bytecodes.hpp"
31 #include "memory/universe.hpp"
32 #include "prims/methodHandles.hpp"
33 #include "runtime/handles.inline.hpp"
34 #include "runtime/icache.hpp"
35 #include "runtime/init.hpp"
36 #include "runtime/safepoint.hpp"
37 #include "runtime/sharedRuntime.hpp"
38 #include "services/memTracker.hpp"
39 #include "utilities/macros.hpp"
40
41
42 // Initialization done by VM thread in vm_init_globals()
43 void check_ThreadShadow();
44 void eventlog_init();
45 void mutex_init();
46 void chunkpool_init();
47 void perfMemory_init();
48 void SuspendibleThreadSet_init() NOT_ALL_GCS_RETURN;
49
50 // Initialization done by Java thread in init_globals()
51 void management_init();
52 void bytecodes_init();
145 if (!compileBroker_init()) {
146 return JNI_EINVAL;
147 }
148 VMRegImpl::set_regName();
149
150 if (!universe_post_init()) {
151 return JNI_ERR;
152 }
153 stubRoutines_init2(); // note: StubRoutines need 2-phase init
154 MethodHandles::generate_adapters();
155
156 #if INCLUDE_NMT
157 // Solaris stack is walkable only after stubRoutines are set up.
158 // On Other platforms, the stack is always walkable.
159 NMT_stack_walkable = true;
160 #endif // INCLUDE_NMT
161
162 // All the flags that get adjusted by VM_Version_init and os::init_2
163 // have been set so dump the flags now.
164 if (PrintFlagsFinal || PrintFlagsRanges) {
165 JVMFlag::printFlags(tty, false, PrintFlagsRanges);
166 }
167
168 return JNI_OK;
169 }
170
171
172 void exit_globals() {
173 static bool destructorsCalled = false;
174 if (!destructorsCalled) {
175 destructorsCalled = true;
176 perfMemory_exit();
177 if (PrintSafepointStatistics) {
178 // Print the collected safepoint statistics.
179 SafepointSynchronize::print_stat_on_exit();
180 }
181 if (PrintStringTableStatistics) {
182 SymbolTable::dump(tty);
183 StringTable::dump(tty);
184 }
185 ostream_exit();
|