761 } else {
762 for (int i=0; i<length(); i++) {
763 entry_at(i)->reinitialize(f2_used[i]);
764 }
765 }
766 }
767
768 void ConstantPoolCache::deallocate_contents(ClassLoaderData* data) {
769 assert(!is_shared(), "shared caches are not deallocated");
770 data->remove_handle(_resolved_references);
771 set_resolved_references(NULL);
772 MetadataFactory::free_array<u2>(data, _reference_map);
773 set_reference_map(NULL);
774 }
775
776 #if INCLUDE_CDS_JAVA_HEAP
777 oop ConstantPoolCache::archived_references() {
778 if (CompressedOops::is_null(_archived_references)) {
779 return NULL;
780 }
781 return MetaspaceShared::materialize_archived_object(CompressedOops::decode_not_null(_archived_references));
782 }
783
784 void ConstantPoolCache::set_archived_references(oop o) {
785 assert(DumpSharedSpaces, "called only during runtime");
786 _archived_references = CompressedOops::encode(o);
787 }
788 #endif
789
790 #if INCLUDE_JVMTI
791 // RedefineClasses() API support:
792 // If any entry of this ConstantPoolCache points to any of
793 // old_methods, replace it with the corresponding new_method.
794 void ConstantPoolCache::adjust_method_entries(InstanceKlass* holder, bool * trace_name_printed) {
795 for (int i = 0; i < length(); i++) {
796 ConstantPoolCacheEntry* entry = entry_at(i);
797 Method* old_method = entry->get_interesting_method_entry(holder);
798 if (old_method == NULL || !old_method->is_old()) {
799 continue; // skip uninteresting entries
800 }
801 if (old_method->is_deleted()) {
|
761 } else {
762 for (int i=0; i<length(); i++) {
763 entry_at(i)->reinitialize(f2_used[i]);
764 }
765 }
766 }
767
768 void ConstantPoolCache::deallocate_contents(ClassLoaderData* data) {
769 assert(!is_shared(), "shared caches are not deallocated");
770 data->remove_handle(_resolved_references);
771 set_resolved_references(NULL);
772 MetadataFactory::free_array<u2>(data, _reference_map);
773 set_reference_map(NULL);
774 }
775
776 #if INCLUDE_CDS_JAVA_HEAP
777 oop ConstantPoolCache::archived_references() {
778 if (CompressedOops::is_null(_archived_references)) {
779 return NULL;
780 }
781 return MetaspaceShared::materialize_archived_object(_archived_references);
782 }
783
784 void ConstantPoolCache::set_archived_references(oop o) {
785 assert(DumpSharedSpaces, "called only during runtime");
786 _archived_references = CompressedOops::encode(o);
787 }
788 #endif
789
790 #if INCLUDE_JVMTI
791 // RedefineClasses() API support:
792 // If any entry of this ConstantPoolCache points to any of
793 // old_methods, replace it with the corresponding new_method.
794 void ConstantPoolCache::adjust_method_entries(InstanceKlass* holder, bool * trace_name_printed) {
795 for (int i = 0; i < length(); i++) {
796 ConstantPoolCacheEntry* entry = entry_at(i);
797 Method* old_method = entry->get_interesting_method_entry(holder);
798 if (old_method == NULL || !old_method->is_old()) {
799 continue; // skip uninteresting entries
800 }
801 if (old_method->is_deleted()) {
|