< prev index next >

src/hotspot/share/classfile/sharedClassUtil.cpp

Print this page




 169   if (UseSharedSpaces) {
 170     int size = FileMapInfo::get_number_of_share_classpaths();
 171     if (size > 0) {
 172       SystemDictionaryShared::allocate_shared_data_arrays(size, THREAD);
 173       if (!DumpSharedSpaces) {
 174         FileMapHeaderExt* header = (FileMapHeaderExt*)FileMapInfo::current_info()->header();
 175         ClassLoaderExt::init_paths_start_index(header->_app_paths_start_index);
 176       }
 177     }
 178   }
 179 
 180   if (DumpSharedSpaces) {
 181     if (SharedArchiveConfigFile) {
 182       read_extra_data(SharedArchiveConfigFile, THREAD);
 183     }
 184   }
 185 }
 186 
 187 void SharedClassUtil::read_extra_data(const char* filename, TRAPS) {
 188   HashtableTextDump reader(filename);
 189   reader.check_version("VERSION: 1.0");
 190 
 191   while (reader.remain() > 0) {
 192     int utf8_length;
 193     int prefix_type = reader.scan_prefix(&utf8_length);
 194     ResourceMark rm(THREAD);
 195     char* utf8_buffer = NEW_RESOURCE_ARRAY(char, utf8_length);
 196     reader.get_utf8(utf8_buffer, utf8_length);
 197 
 198     if (prefix_type == HashtableTextDump::SymbolPrefix) {
 199       SymbolTable::new_symbol(utf8_buffer, utf8_length, THREAD);
 200     } else{
 201       assert(prefix_type == HashtableTextDump::StringPrefix, "Sanity");
 202       utf8_buffer[utf8_length] = '\0';
 203       oop s = StringTable::intern(utf8_buffer, THREAD);
 204     }
 205   }
 206 }
 207 
 208 bool SharedClassUtil::is_classpath_entry_signed(int classpath_index) {
 209   assert(classpath_index >= 0, "Sanity");




 169   if (UseSharedSpaces) {
 170     int size = FileMapInfo::get_number_of_share_classpaths();
 171     if (size > 0) {
 172       SystemDictionaryShared::allocate_shared_data_arrays(size, THREAD);
 173       if (!DumpSharedSpaces) {
 174         FileMapHeaderExt* header = (FileMapHeaderExt*)FileMapInfo::current_info()->header();
 175         ClassLoaderExt::init_paths_start_index(header->_app_paths_start_index);
 176       }
 177     }
 178   }
 179 
 180   if (DumpSharedSpaces) {
 181     if (SharedArchiveConfigFile) {
 182       read_extra_data(SharedArchiveConfigFile, THREAD);
 183     }
 184   }
 185 }
 186 
 187 void SharedClassUtil::read_extra_data(const char* filename, TRAPS) {
 188   HashtableTextDump reader(filename);
 189   reader.check_version(HASHTABLE_VERSION);
 190 
 191   while (reader.remain() > 0) {
 192     int utf8_length;
 193     int prefix_type = reader.scan_prefix(&utf8_length);
 194     ResourceMark rm(THREAD);
 195     char* utf8_buffer = NEW_RESOURCE_ARRAY(char, utf8_length);
 196     reader.get_utf8(utf8_buffer, utf8_length);
 197 
 198     if (prefix_type == HashtableTextDump::SymbolPrefix) {
 199       SymbolTable::new_symbol(utf8_buffer, utf8_length, THREAD);
 200     } else{
 201       assert(prefix_type == HashtableTextDump::StringPrefix, "Sanity");
 202       utf8_buffer[utf8_length] = '\0';
 203       oop s = StringTable::intern(utf8_buffer, THREAD);
 204     }
 205   }
 206 }
 207 
 208 bool SharedClassUtil::is_classpath_entry_signed(int classpath_index) {
 209   assert(classpath_index >= 0, "Sanity");


< prev index next >