< prev index next >

src/hotspot/share/cds/regeneratedClasses.cpp

Print this page

 57     Method* orig_m = methods->at(i);
 58     Method* regen_m = regen_klass->find_method(orig_m->name(), orig_m->signature());
 59     if (regen_m == nullptr) {
 60       ResourceMark rm;
 61       log_warning(cds)("Method in original class is missing from regenerated class: " INTPTR_FORMAT " %s",
 62                        p2i(orig_m), orig_m->external_name());
 63     } else {
 64       _renegerated_objs->put((address)orig_m, (address)regen_m);
 65     }
 66   }
 67 }
 68 
 69 bool RegeneratedClasses::has_been_regenerated(address orig_obj) {
 70   if (_renegerated_objs == nullptr) {
 71     return false;
 72   } else {
 73     return _renegerated_objs->get(orig_obj) != nullptr;
 74   }
 75 }
 76 



















 77 void RegeneratedClasses::record_regenerated_objects() {
 78   assert_locked_or_safepoint(DumpTimeTable_lock);
 79   if (_renegerated_objs != nullptr) {
 80     auto doit = [&] (address orig_obj, address regen_obj) {
 81       ArchiveBuilder::current()->record_regenerated_object(orig_obj, regen_obj);
 82     };
 83     _renegerated_objs->iterate_all(doit);
 84   }
 85 }
 86 
 87 void RegeneratedClasses::cleanup() {
 88   MutexLocker ml(DumpTimeTable_lock, Mutex::_no_safepoint_check_flag);
 89   if (_regenerated_mirrors != nullptr) {
 90     for (int i = 0; i < _regenerated_mirrors->length(); i++) {
 91       _regenerated_mirrors->at(i).release(Universe::vm_global());
 92     }
 93     delete _regenerated_mirrors;
 94     _regenerated_mirrors = nullptr;
 95   }
 96   if (_renegerated_objs != nullptr) {

 57     Method* orig_m = methods->at(i);
 58     Method* regen_m = regen_klass->find_method(orig_m->name(), orig_m->signature());
 59     if (regen_m == nullptr) {
 60       ResourceMark rm;
 61       log_warning(cds)("Method in original class is missing from regenerated class: " INTPTR_FORMAT " %s",
 62                        p2i(orig_m), orig_m->external_name());
 63     } else {
 64       _renegerated_objs->put((address)orig_m, (address)regen_m);
 65     }
 66   }
 67 }
 68 
 69 bool RegeneratedClasses::has_been_regenerated(address orig_obj) {
 70   if (_renegerated_objs == nullptr) {
 71     return false;
 72   } else {
 73     return _renegerated_objs->get(orig_obj) != nullptr;
 74   }
 75 }
 76 
 77 address RegeneratedClasses::get_regenerated_object(address orig_obj) {
 78   assert(_renegerated_objs != nullptr, "must be");
 79   address* p =_renegerated_objs->get(orig_obj);
 80   assert(p != nullptr, "must be");
 81   return *p;
 82 }
 83 
 84 bool RegeneratedClasses::is_a_regenerated_object(address obj) {
 85 #if 0
 86   if (_original_objs == nullptr) {
 87     return false;
 88   } else {
 89     return _original_objs->get(obj) != nullptr;
 90   }
 91 #else
 92   return false; // FIXME-MERGE
 93 #endif
 94 }
 95 
 96 void RegeneratedClasses::record_regenerated_objects() {
 97   assert_locked_or_safepoint(DumpTimeTable_lock);
 98   if (_renegerated_objs != nullptr) {
 99     auto doit = [&] (address orig_obj, address regen_obj) {
100       ArchiveBuilder::current()->record_regenerated_object(orig_obj, regen_obj);
101     };
102     _renegerated_objs->iterate_all(doit);
103   }
104 }
105 
106 void RegeneratedClasses::cleanup() {
107   MutexLocker ml(DumpTimeTable_lock, Mutex::_no_safepoint_check_flag);
108   if (_regenerated_mirrors != nullptr) {
109     for (int i = 0; i < _regenerated_mirrors->length(); i++) {
110       _regenerated_mirrors->at(i).release(Universe::vm_global());
111     }
112     delete _regenerated_mirrors;
113     _regenerated_mirrors = nullptr;
114   }
115   if (_renegerated_objs != nullptr) {
< prev index next >