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