< prev index next >

src/hotspot/share/classfile/javaClasses.cpp

Print this page


1195 
1196   // The field at _array_klass_offset is pointing to the original one dimension
1197   // higher array klass if exists. Relocate the pointer.
1198   Klass *arr = array_klass_acquire(mirror);
1199   if (arr != NULL) {
1200     Klass *reloc_arr = MetaspaceShared::get_relocated_klass(arr);
1201     log_debug(cds, heap, mirror)(
1202       "Relocate mirror metadata field at _array_klass_offset from " PTR_FORMAT " ==> " PTR_FORMAT,
1203       p2i(arr), p2i(reloc_arr));
1204     archived_mirror->metadata_field_put(_array_klass_offset, reloc_arr);
1205   }
1206   return archived_mirror;
1207 }
1208 
1209 // Returns true if the mirror is updated, false if no archived mirror
1210 // data is present. After the archived mirror object is restored, the
1211 // shared klass' _has_raw_archived_mirror flag is cleared.
1212 bool java_lang_Class::restore_archived_mirror(Klass *k,
1213                                               Handle class_loader, Handle module,
1214                                               Handle protection_domain, TRAPS) {
1215   oop m = MetaspaceShared::materialize_archived_object(k->archived_java_mirror_raw());
1216 
1217   if (m == NULL) {
1218     return false;
1219   }
1220 
1221   log_debug(cds, mirror)("Archived mirror is: " PTR_FORMAT, p2i(m));
1222 
1223   // mirror is archived, restore
1224   assert(MetaspaceShared::is_archive_object(m), "must be archived mirror object");
1225   Handle mirror(THREAD, m);
1226 
1227   // The java.lang.Class field offsets were archived and reloaded from archive.
1228   // No need to put classes on the fixup_mirror_list before java.lang.Class
1229   // is loaded.
1230 
1231   if (!k->is_array_klass()) {
1232     // - local static final fields with initial values were initialized at dump time
1233 
1234     // create the init_lock
1235     typeArrayOop r = oopFactory::new_typeArray(T_INT, 0, CHECK_(false));




1195 
1196   // The field at _array_klass_offset is pointing to the original one dimension
1197   // higher array klass if exists. Relocate the pointer.
1198   Klass *arr = array_klass_acquire(mirror);
1199   if (arr != NULL) {
1200     Klass *reloc_arr = MetaspaceShared::get_relocated_klass(arr);
1201     log_debug(cds, heap, mirror)(
1202       "Relocate mirror metadata field at _array_klass_offset from " PTR_FORMAT " ==> " PTR_FORMAT,
1203       p2i(arr), p2i(reloc_arr));
1204     archived_mirror->metadata_field_put(_array_klass_offset, reloc_arr);
1205   }
1206   return archived_mirror;
1207 }
1208 
1209 // Returns true if the mirror is updated, false if no archived mirror
1210 // data is present. After the archived mirror object is restored, the
1211 // shared klass' _has_raw_archived_mirror flag is cleared.
1212 bool java_lang_Class::restore_archived_mirror(Klass *k,
1213                                               Handle class_loader, Handle module,
1214                                               Handle protection_domain, TRAPS) {
1215   oop m = MetaspaceShared::materialize_archived_object(k->archived_java_mirror_raw_narrow());
1216 
1217   if (m == NULL) {
1218     return false;
1219   }
1220 
1221   log_debug(cds, mirror)("Archived mirror is: " PTR_FORMAT, p2i(m));
1222 
1223   // mirror is archived, restore
1224   assert(MetaspaceShared::is_archive_object(m), "must be archived mirror object");
1225   Handle mirror(THREAD, m);
1226 
1227   // The java.lang.Class field offsets were archived and reloaded from archive.
1228   // No need to put classes on the fixup_mirror_list before java.lang.Class
1229   // is loaded.
1230 
1231   if (!k->is_array_klass()) {
1232     // - local static final fields with initial values were initialized at dump time
1233 
1234     // create the init_lock
1235     typeArrayOop r = oopFactory::new_typeArray(T_INT, 0, CHECK_(false));


< prev index next >