943
944 // Caller needs ResourceMark
945 // Format of the _name_and_id is as follows:
946 // If the defining loader has a name explicitly set then '<loader-name>' @<id>
947 // If the defining loader has no name then <qualified-class-name> @<id>
948 // If built-in loader, then omit '@<id>' as there is only one instance.
949 const char* ClassLoaderData::loader_name_and_id() const {
950 if (_class_loader_klass == NULL) {
951 return "'" BOOTSTRAP_LOADER_NAME "'";
952 } else if (_name_and_id != NULL) {
953 return _name_and_id->as_C_string();
954 } else {
955 // May be called in a race before _name_and_id is initialized.
956 return _class_loader_klass->external_name();
957 }
958 }
959
960 void ClassLoaderData::print_value_on(outputStream* out) const {
961 if (!is_unloading() && class_loader() != NULL) {
962 out->print("loader data: " INTPTR_FORMAT " for instance ", p2i(this));
963 class_loader()->print_value_on(out); // includes loader_name_and_id() and address of class loader instance
964 } else {
965 // loader data: 0xsomeaddr of 'bootstrap'
966 out->print("loader data: " INTPTR_FORMAT " of %s", p2i(this), loader_name_and_id());
967 }
968 if (is_anonymous()) {
969 out->print(" anonymous");
970 }
971 }
972
973 #ifndef PRODUCT
974 void ClassLoaderData::print_on(outputStream* out) const {
975 out->print("ClassLoaderData CLD: " PTR_FORMAT ", loader: " PTR_FORMAT ", loader_klass: %s {",
976 p2i(this), p2i(_class_loader.ptr_raw()), loader_name_and_id());
977 if (is_anonymous()) out->print(" anonymous");
978 if (claimed()) out->print(" claimed");
979 if (is_unloading()) out->print(" unloading");
980 out->print(" metaspace: " INTPTR_FORMAT, p2i(metaspace_or_null()));
981
982 if (_jmethod_ids != NULL) {
983 Method::print_jmethod_ids(this, out);
|
943
944 // Caller needs ResourceMark
945 // Format of the _name_and_id is as follows:
946 // If the defining loader has a name explicitly set then '<loader-name>' @<id>
947 // If the defining loader has no name then <qualified-class-name> @<id>
948 // If built-in loader, then omit '@<id>' as there is only one instance.
949 const char* ClassLoaderData::loader_name_and_id() const {
950 if (_class_loader_klass == NULL) {
951 return "'" BOOTSTRAP_LOADER_NAME "'";
952 } else if (_name_and_id != NULL) {
953 return _name_and_id->as_C_string();
954 } else {
955 // May be called in a race before _name_and_id is initialized.
956 return _class_loader_klass->external_name();
957 }
958 }
959
960 void ClassLoaderData::print_value_on(outputStream* out) const {
961 if (!is_unloading() && class_loader() != NULL) {
962 out->print("loader data: " INTPTR_FORMAT " for instance ", p2i(this));
963 oopDesc::print_value_on(out, class_loader()); // includes loader_name_and_id() and address of class loader instance
964 } else {
965 // loader data: 0xsomeaddr of 'bootstrap'
966 out->print("loader data: " INTPTR_FORMAT " of %s", p2i(this), loader_name_and_id());
967 }
968 if (is_anonymous()) {
969 out->print(" anonymous");
970 }
971 }
972
973 #ifndef PRODUCT
974 void ClassLoaderData::print_on(outputStream* out) const {
975 out->print("ClassLoaderData CLD: " PTR_FORMAT ", loader: " PTR_FORMAT ", loader_klass: %s {",
976 p2i(this), p2i(_class_loader.ptr_raw()), loader_name_and_id());
977 if (is_anonymous()) out->print(" anonymous");
978 if (claimed()) out->print(" claimed");
979 if (is_unloading()) out->print(" unloading");
980 out->print(" metaspace: " INTPTR_FORMAT, p2i(metaspace_or_null()));
981
982 if (_jmethod_ids != NULL) {
983 Method::print_jmethod_ids(this, out);
|