< prev index next >

src/hotspot/share/classfile/packageEntry.cpp

Print this page

230   assert(_archived_packages_entries->get(this) == nullptr, "Each PackageEntry must not be shared across PackageEntryTables");
231   _archived_packages_entries->put(this, archived_entry);
232 
233   return archived_entry;
234 }
235 
236 PackageEntry* PackageEntry::get_archived_entry(PackageEntry* orig_entry) {
237   PackageEntry** ptr = _archived_packages_entries->get(orig_entry);
238   if (ptr != nullptr) {
239     return *ptr;
240   } else {
241     return nullptr;
242   }
243 }
244 
245 void PackageEntry::iterate_symbols(MetaspaceClosure* closure) {
246   closure->push(&_name);
247 }
248 
249 void PackageEntry::init_as_archived_entry() {
250   Array<ModuleEntry*>* archived_qualified_exports = ModuleEntry::write_growable_array(_qualified_exports);
251 
252   _name = ArchiveBuilder::get_buffered_symbol(_name);
253   _module = ModuleEntry::get_archived_entry(_module);
254   _qualified_exports = (GrowableArray<ModuleEntry*>*)archived_qualified_exports;
255   _defined_by_cds_in_class_path = 0;
256   JFR_ONLY(set_trace_id(0);) // re-init at runtime
257 
258   ArchivePtrMarker::mark_pointer((address*)&_name);
259   ArchivePtrMarker::mark_pointer((address*)&_module);
260   ArchivePtrMarker::mark_pointer((address*)&_qualified_exports);
261 }
262 
263 void PackageEntry::load_from_archive() {
264   _qualified_exports = ModuleEntry::restore_growable_array((Array<ModuleEntry*>*)_qualified_exports);
265   JFR_ONLY(INIT_ID(this);)
266 }
267 
268 static int compare_package_by_name(PackageEntry* a, PackageEntry* b) {
269   assert(a == b || a->name() != b->name(), "no duplicated names");
270   return a->name()->fast_compare(b->name());

230   assert(_archived_packages_entries->get(this) == nullptr, "Each PackageEntry must not be shared across PackageEntryTables");
231   _archived_packages_entries->put(this, archived_entry);
232 
233   return archived_entry;
234 }
235 
236 PackageEntry* PackageEntry::get_archived_entry(PackageEntry* orig_entry) {
237   PackageEntry** ptr = _archived_packages_entries->get(orig_entry);
238   if (ptr != nullptr) {
239     return *ptr;
240   } else {
241     return nullptr;
242   }
243 }
244 
245 void PackageEntry::iterate_symbols(MetaspaceClosure* closure) {
246   closure->push(&_name);
247 }
248 
249 void PackageEntry::init_as_archived_entry() {
250   Array<ModuleEntry*>* archived_qualified_exports = ModuleEntry::write_growable_array(module(), _qualified_exports);
251 
252   _name = ArchiveBuilder::get_buffered_symbol(_name);
253   _module = ModuleEntry::get_archived_entry(_module);
254   _qualified_exports = (GrowableArray<ModuleEntry*>*)archived_qualified_exports;
255   _defined_by_cds_in_class_path = 0;
256   JFR_ONLY(set_trace_id(0);) // re-init at runtime
257 
258   ArchivePtrMarker::mark_pointer((address*)&_name);
259   ArchivePtrMarker::mark_pointer((address*)&_module);
260   ArchivePtrMarker::mark_pointer((address*)&_qualified_exports);
261 }
262 
263 void PackageEntry::load_from_archive() {
264   _qualified_exports = ModuleEntry::restore_growable_array((Array<ModuleEntry*>*)_qualified_exports);
265   JFR_ONLY(INIT_ID(this);)
266 }
267 
268 static int compare_package_by_name(PackageEntry* a, PackageEntry* b) {
269   assert(a == b || a->name() != b->name(), "no duplicated names");
270   return a->name()->fast_compare(b->name());
< prev index next >