< prev index next >

src/share/vm/runtime/init.cpp

Print this page




  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();
  54 void classLoader_init1();


 138 
 139   if (!universe_post_init()) {
 140     return JNI_ERR;
 141   }
 142   javaClasses_init();   // must happen after vtable initialization
 143   stubRoutines_init2(); // note: StubRoutines need 2-phase init
 144   MethodHandles::generate_adapters();
 145 
 146 #if INCLUDE_NMT
 147   // Solaris stack is walkable only after stubRoutines are set up.
 148   // On Other platforms, the stack is always walkable.
 149   NMT_stack_walkable = true;
 150 #endif // INCLUDE_NMT
 151 
 152   // All the flags that get adjusted by VM_Version_init and os::init_2
 153   // have been set so dump the flags now.
 154   if (PrintFlagsFinal || PrintFlagsRanges) {
 155     CommandLineFlags::printFlags(tty, false, PrintFlagsRanges);
 156   }
 157 





 158   return JNI_OK;
 159 }
 160 
 161 
 162 void exit_globals() {
 163   static bool destructorsCalled = false;
 164   if (!destructorsCalled) {
 165     destructorsCalled = true;
 166     perfMemory_exit();
 167     if (PrintSafepointStatistics) {
 168       // Print the collected safepoint statistics.
 169       SafepointSynchronize::print_stat_on_exit();
 170     }
 171     if (PrintStringTableStatistics) {
 172       SymbolTable::dump(tty);
 173       StringTable::dump(tty);
 174     }
 175     ostream_exit();
 176   }
 177 }


  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/heapMonitoring.hpp"
  36 #include "prims/jvmtiHeapTransition.hpp"
  37 #include "runtime/icache.hpp"
  38 #include "runtime/init.hpp"
  39 #include "runtime/safepoint.hpp"
  40 #include "runtime/sharedRuntime.hpp"
  41 #include "services/memTracker.hpp"
  42 #include "utilities/macros.hpp"
  43 
  44 
  45 // Initialization done by VM thread in vm_init_globals()
  46 void check_ThreadShadow();
  47 void eventlog_init();
  48 void mutex_init();
  49 void chunkpool_init();
  50 void perfMemory_init();
  51 void SuspendibleThreadSet_init() NOT_ALL_GCS_RETURN;
  52 
  53 // Initialization done by Java thread in init_globals()
  54 void management_init();
  55 void bytecodes_init();
  56 void classLoader_init1();


 140 
 141   if (!universe_post_init()) {
 142     return JNI_ERR;
 143   }
 144   javaClasses_init();   // must happen after vtable initialization
 145   stubRoutines_init2(); // note: StubRoutines need 2-phase init
 146   MethodHandles::generate_adapters();
 147 
 148 #if INCLUDE_NMT
 149   // Solaris stack is walkable only after stubRoutines are set up.
 150   // On Other platforms, the stack is always walkable.
 151   NMT_stack_walkable = true;
 152 #endif // INCLUDE_NMT
 153 
 154   // All the flags that get adjusted by VM_Version_init and os::init_2
 155   // have been set so dump the flags now.
 156   if (PrintFlagsFinal || PrintFlagsRanges) {
 157     CommandLineFlags::printFlags(tty, false, PrintFlagsRanges);
 158   }
 159 
 160   if (HeapMonitor) {
 161     fprintf(stderr, "Starting sampling with rate %d\n", HeapMonitorRate);
 162     HeapThreadTransition htt(Thread::current());
 163     HeapMonitoring::initialize_profiling(HeapMonitorRate);
 164   }
 165   return JNI_OK;
 166 }
 167 
 168 
 169 void exit_globals() {
 170   static bool destructorsCalled = false;
 171   if (!destructorsCalled) {
 172     destructorsCalled = true;
 173     perfMemory_exit();
 174     if (PrintSafepointStatistics) {
 175       // Print the collected safepoint statistics.
 176       SafepointSynchronize::print_stat_on_exit();
 177     }
 178     if (PrintStringTableStatistics) {
 179       SymbolTable::dump(tty);
 180       StringTable::dump(tty);
 181     }
 182     ostream_exit();
 183   }
 184 }
< prev index next >