equal
deleted
inserted
replaced
1409 tty->print_cr("done. "); |
1409 tty->print_cr("done. "); |
1410 |
1410 |
1411 // Move classes from platform/system dictionaries into the boot dictionary |
1411 // Move classes from platform/system dictionaries into the boot dictionary |
1412 SystemDictionary::combine_shared_dictionaries(); |
1412 SystemDictionary::combine_shared_dictionaries(); |
1413 |
1413 |
|
1414 // Make sure all classes have a correct loader type. |
|
1415 ClassLoaderData::the_null_class_loader_data()->dictionary()->classes_do(MetaspaceShared::check_shared_class_loader_type); |
|
1416 |
1414 // Remove all references outside the metadata |
1417 // Remove all references outside the metadata |
1415 tty->print("Removing unshareable information ... "); |
1418 tty->print("Removing unshareable information ... "); |
1416 remove_unshareable_in_classes(); |
1419 remove_unshareable_in_classes(); |
1417 tty->print_cr("done. "); |
1420 tty->print_cr("done. "); |
1418 |
1421 |
1608 _made_progress = true; |
1611 _made_progress = true; |
1609 } |
1612 } |
1610 } |
1613 } |
1611 }; |
1614 }; |
1612 |
1615 |
1613 void MetaspaceShared::check_shared_class_loader_type(Klass* k) { |
1616 void MetaspaceShared::check_shared_class_loader_type(InstanceKlass* ik) { |
1614 if (k->is_instance_klass()) { |
1617 ResourceMark rm; |
1615 InstanceKlass* ik = InstanceKlass::cast(k); |
1618 if (ik->shared_classpath_index() == UNREGISTERED_INDEX) { |
1616 u2 loader_type = ik->loader_type(); |
1619 guarantee(ik->loader_type() == 0, |
1617 ResourceMark rm; |
1620 "Class loader type must not be set for this class %s", ik->name()->as_C_string()); |
1618 guarantee(loader_type != 0, |
1621 } else { |
1619 "Class loader type is not set for this class %s", ik->name()->as_C_string()); |
1622 guarantee(ik->loader_type() != 0, |
|
1623 "Class loader type must be set for this class %s", ik->name()->as_C_string()); |
1620 } |
1624 } |
1621 } |
1625 } |
1622 |
1626 |
1623 void MetaspaceShared::link_and_cleanup_shared_classes(TRAPS) { |
1627 void MetaspaceShared::link_and_cleanup_shared_classes(TRAPS) { |
1624 // We need to iterate because verification may cause additional classes |
1628 // We need to iterate because verification may cause additional classes |