< prev index next >

src/hotspot/share/memory/heapShared.cpp

Print this page


 400   // Initialize from archived data. Currently this is done only
 401   // during VM initialization time. No lock is needed.
 402   if (record != NULL) {
 403     Thread* THREAD = Thread::current();
 404     if (log_is_enabled(Info, cds, heap)) {
 405       ResourceMark rm;
 406       log_info(cds, heap)("initialize_from_archived_subgraph " PTR_FORMAT " %s", p2i(k),
 407                           k->external_name());
 408     }
 409 
 410     int i;
 411     // Load/link/initialize the klasses of the objects in the subgraph.
 412     // NULL class loader is used.
 413     Array<Klass*>* klasses = record->subgraph_object_klasses();
 414     if (klasses != NULL) {
 415       for (i = 0; i < klasses->length(); i++) {
 416         Klass* obj_k = klasses->at(i);
 417         Klass* resolved_k = SystemDictionary::resolve_or_null(
 418                                               (obj_k)->name(), THREAD);
 419         if (resolved_k != obj_k) {





 420           return;
 421         }
 422         if ((obj_k)->is_instance_klass()) {
 423           InstanceKlass* ik = InstanceKlass::cast(obj_k);
 424           ik->initialize(THREAD);
 425         } else if ((obj_k)->is_objArray_klass()) {
 426           ObjArrayKlass* oak = ObjArrayKlass::cast(obj_k);
 427           oak->initialize(THREAD);
 428         }
 429       }
 430     }
 431 
 432     if (HAS_PENDING_EXCEPTION) {
 433       CLEAR_PENDING_EXCEPTION;
 434       // None of the field value will be set if there was an exception.
 435       // The java code will not see any of the archived objects in the
 436       // subgraphs referenced from k in this case.
 437       return;
 438     }
 439 




 400   // Initialize from archived data. Currently this is done only
 401   // during VM initialization time. No lock is needed.
 402   if (record != NULL) {
 403     Thread* THREAD = Thread::current();
 404     if (log_is_enabled(Info, cds, heap)) {
 405       ResourceMark rm;
 406       log_info(cds, heap)("initialize_from_archived_subgraph " PTR_FORMAT " %s", p2i(k),
 407                           k->external_name());
 408     }
 409 
 410     int i;
 411     // Load/link/initialize the klasses of the objects in the subgraph.
 412     // NULL class loader is used.
 413     Array<Klass*>* klasses = record->subgraph_object_klasses();
 414     if (klasses != NULL) {
 415       for (i = 0; i < klasses->length(); i++) {
 416         Klass* obj_k = klasses->at(i);
 417         Klass* resolved_k = SystemDictionary::resolve_or_null(
 418                                               (obj_k)->name(), THREAD);
 419         if (resolved_k != obj_k) {
 420           assert(!SystemDictionary::is_well_known_klass(resolved_k),
 421                  "shared well-known classes must not be replaced by JVMTI ClassFileLoadHook");
 422           ResourceMark rm;
 423           log_info(cds, heap)("Failed to load subgraph because %s was not loaded from archive",
 424                               resolved_k->external_name());
 425           return;
 426         }
 427         if ((obj_k)->is_instance_klass()) {
 428           InstanceKlass* ik = InstanceKlass::cast(obj_k);
 429           ik->initialize(THREAD);
 430         } else if ((obj_k)->is_objArray_klass()) {
 431           ObjArrayKlass* oak = ObjArrayKlass::cast(obj_k);
 432           oak->initialize(THREAD);
 433         }
 434       }
 435     }
 436 
 437     if (HAS_PENDING_EXCEPTION) {
 438       CLEAR_PENDING_EXCEPTION;
 439       // None of the field value will be set if there was an exception.
 440       // The java code will not see any of the archived objects in the
 441       // subgraphs referenced from k in this case.
 442       return;
 443     }
 444 


< prev index next >