138 vtableStubs_init();
139 InlineCacheBuffer_init();
140 compilerOracle_init();
141 dependencyContext_init();
142
143 if (!compileBroker_init()) {
144 return JNI_EINVAL;
145 }
146 #if INCLUDE_JVMCI
147 if (EnableJVMCI) {
148 JVMCI::initialize_globals();
149 }
150 #endif
151
152 if (!universe_post_init()) {
153 return JNI_ERR;
154 }
155 stubRoutines_init2(); // note: StubRoutines need 2-phase init
156 MethodHandles::generate_adapters();
157
158 #if INCLUDE_NMT
159 // Solaris stack is walkable only after stubRoutines are set up.
160 // On Other platforms, the stack is always walkable.
161 NMT_stack_walkable = true;
162 #endif // INCLUDE_NMT
163
164 // All the flags that get adjusted by VM_Version_init and os::init_2
165 // have been set so dump the flags now.
166 if (PrintFlagsFinal || PrintFlagsRanges) {
167 JVMFlag::printFlags(tty, false, PrintFlagsRanges);
168 }
169
170 return JNI_OK;
171 }
172
173
174 void exit_globals() {
175 static bool destructorsCalled = false;
176 if (!destructorsCalled) {
177 destructorsCalled = true;
178 if (log_is_enabled(Info, monitorinflation)) {
179 // The ObjectMonitor subsystem uses perf counters so
180 // do this before perfMemory_exit().
181 // ObjectSynchronizer::finish_deflate_idle_monitors()'s call
182 // to audit_and_print_stats() is done at the Debug level.
183 ObjectSynchronizer::audit_and_print_stats(true /* on_exit */);
|
138 vtableStubs_init();
139 InlineCacheBuffer_init();
140 compilerOracle_init();
141 dependencyContext_init();
142
143 if (!compileBroker_init()) {
144 return JNI_EINVAL;
145 }
146 #if INCLUDE_JVMCI
147 if (EnableJVMCI) {
148 JVMCI::initialize_globals();
149 }
150 #endif
151
152 if (!universe_post_init()) {
153 return JNI_ERR;
154 }
155 stubRoutines_init2(); // note: StubRoutines need 2-phase init
156 MethodHandles::generate_adapters();
157
158 // All the flags that get adjusted by VM_Version_init and os::init_2
159 // have been set so dump the flags now.
160 if (PrintFlagsFinal || PrintFlagsRanges) {
161 JVMFlag::printFlags(tty, false, PrintFlagsRanges);
162 }
163
164 return JNI_OK;
165 }
166
167
168 void exit_globals() {
169 static bool destructorsCalled = false;
170 if (!destructorsCalled) {
171 destructorsCalled = true;
172 if (log_is_enabled(Info, monitorinflation)) {
173 // The ObjectMonitor subsystem uses perf counters so
174 // do this before perfMemory_exit().
175 // ObjectSynchronizer::finish_deflate_idle_monitors()'s call
176 // to audit_and_print_stats() is done at the Debug level.
177 ObjectSynchronizer::audit_and_print_stats(true /* on_exit */);
|