< prev index next >

src/hotspot/share/classfile/classLoader.cpp

Print this page


1626     return false;
1627   }
1628   return true;
1629 }
1630 
1631 void ClassLoader::create_javabase() {
1632   Thread* THREAD = Thread::current();
1633 
1634   // Create java.base's module entry for the boot
1635   // class loader prior to loading j.l.Ojbect.
1636   ClassLoaderData* null_cld = ClassLoaderData::the_null_class_loader_data();
1637 
1638   // Get module entry table
1639   ModuleEntryTable* null_cld_modules = null_cld->modules();
1640   if (null_cld_modules == NULL) {
1641     vm_exit_during_initialization("No ModuleEntryTable for the boot class loader");
1642   }
1643 
1644   {
1645     MutexLocker ml(THREAD, Module_lock);

1646     ModuleEntry* jb_module = null_cld_modules->locked_create_entry(Handle(),
1647                                false, vmSymbols::java_base(), NULL, NULL, null_cld);
1648     if (jb_module == NULL) {
1649       vm_exit_during_initialization("Unable to create ModuleEntry for " JAVA_BASE_NAME);
1650     }
1651     ModuleEntryTable::set_javabase_moduleEntry(jb_module);

1652   }
1653 }
1654 
1655 // Please keep following two functions at end of this file. With them placed at top or in middle of the file,
1656 // they could get inlined by agressive compiler, an unknown trick, see bug 6966589.
1657 void PerfClassTraceTime::initialize() {
1658   if (!UsePerfData) return;
1659 
1660   if (_eventp != NULL) {
1661     // increment the event counter
1662     _eventp->inc();
1663   }
1664 
1665   // stop the current active thread-local timer to measure inclusive time
1666   _prev_active_event = -1;
1667   for (int i=0; i < EVENT_TYPE_COUNT; i++) {
1668      if (_timers[i].is_active()) {
1669        assert(_prev_active_event == -1, "should have only one active timer");
1670        _prev_active_event = i;
1671        _timers[i].stop();




1626     return false;
1627   }
1628   return true;
1629 }
1630 
1631 void ClassLoader::create_javabase() {
1632   Thread* THREAD = Thread::current();
1633 
1634   // Create java.base's module entry for the boot
1635   // class loader prior to loading j.l.Ojbect.
1636   ClassLoaderData* null_cld = ClassLoaderData::the_null_class_loader_data();
1637 
1638   // Get module entry table
1639   ModuleEntryTable* null_cld_modules = null_cld->modules();
1640   if (null_cld_modules == NULL) {
1641     vm_exit_during_initialization("No ModuleEntryTable for the boot class loader");
1642   }
1643 
1644   {
1645     MutexLocker ml(THREAD, Module_lock);
1646     if (ModuleEntryTable::javabase_moduleEntry() == NULL) {  // may have been inited by CDS.
1647       ModuleEntry* jb_module = null_cld_modules->locked_create_entry(Handle(),
1648                                false, vmSymbols::java_base(), NULL, NULL, null_cld);
1649       if (jb_module == NULL) {
1650         vm_exit_during_initialization("Unable to create ModuleEntry for " JAVA_BASE_NAME);
1651       }
1652       ModuleEntryTable::set_javabase_moduleEntry(jb_module);
1653     }
1654   }
1655 }
1656 
1657 // Please keep following two functions at end of this file. With them placed at top or in middle of the file,
1658 // they could get inlined by agressive compiler, an unknown trick, see bug 6966589.
1659 void PerfClassTraceTime::initialize() {
1660   if (!UsePerfData) return;
1661 
1662   if (_eventp != NULL) {
1663     // increment the event counter
1664     _eventp->inc();
1665   }
1666 
1667   // stop the current active thread-local timer to measure inclusive time
1668   _prev_active_event = -1;
1669   for (int i=0; i < EVENT_TYPE_COUNT; i++) {
1670      if (_timers[i].is_active()) {
1671        assert(_prev_active_event == -1, "should have only one active timer");
1672        _prev_active_event = i;
1673        _timers[i].stop();


< prev index next >