136 vtableStubs_init();
137 InlineCacheBuffer_init();
138 compilerOracle_init();
139 dependencyContext_init();
140
141 if (!compileBroker_init()) {
142 return JNI_EINVAL;
143 }
144 #if INCLUDE_JVMCI
145 if (EnableJVMCI) {
146 JVMCI::initialize_globals();
147 }
148 #endif
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 if (log_is_enabled(Info, monitorinflation)) {
177 // The ObjectMonitor subsystem uses perf counters so
178 // do this before perfMemory_exit().
179 // ObjectSynchronizer::finish_deflate_idle_monitors()'s call
180 // to audit_and_print_stats() is done at the Debug level.
181 ObjectSynchronizer::audit_and_print_stats(true /* on_exit */);
|
136 vtableStubs_init();
137 InlineCacheBuffer_init();
138 compilerOracle_init();
139 dependencyContext_init();
140
141 if (!compileBroker_init()) {
142 return JNI_EINVAL;
143 }
144 #if INCLUDE_JVMCI
145 if (EnableJVMCI) {
146 JVMCI::initialize_globals();
147 }
148 #endif
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 // All the flags that get adjusted by VM_Version_init and os::init_2
157 // have been set so dump the flags now.
158 if (PrintFlagsFinal || PrintFlagsRanges) {
159 JVMFlag::printFlags(tty, false, PrintFlagsRanges);
160 }
161
162 return JNI_OK;
163 }
164
165
166 void exit_globals() {
167 static bool destructorsCalled = false;
168 if (!destructorsCalled) {
169 destructorsCalled = true;
170 if (log_is_enabled(Info, monitorinflation)) {
171 // The ObjectMonitor subsystem uses perf counters so
172 // do this before perfMemory_exit().
173 // ObjectSynchronizer::finish_deflate_idle_monitors()'s call
174 // to audit_and_print_stats() is done at the Debug level.
175 ObjectSynchronizer::audit_and_print_stats(true /* on_exit */);
|