提交 32a92223 编写于 作者: A asaha

Merge

......@@ -733,6 +733,7 @@ aa915217a00c4b8ce0e82d1b23fa1df8a9e4cc70 jdk8u65-b05
d8519b30e607f87cad6c949c6b52c1dba0cde7a8 jdk8u65-b08
c6d1a21e213d62f423ac9013bcc7dc0bc05e38b6 jdk8u65-b09
0274b03fdf4a3e4d125547d68ed74b4f55d515ec jdk8u65-b10
a106723ba50719c479614d1f599e951edb51506c jdk8u65-b11
878cb0df27c22c6b1e9f4add1eb3da3edc8ab51d jdk8u66-b00
777a354cada52b831a32bfc5362ad7cedfde4450 jdk8u66-b01
0366ad2644f58ec88af9cb2ea8c23a02559fb2d1 hs25.66-b02
......@@ -742,4 +743,5 @@ ae5624088d86abe8e7981dbb893c1b6da5140a1c jdk8u66-b02
aedefb75358f3cda5181bf594c2cda833056b25a jdk8u66-b08
83621deea0fcb4a517b94c5546b4f8738588cb6c jdk8u66-b09
5280a8174aea13bd242480419e6228857dac7b59 jdk8u66-b10
8a23b6392c590b7bf5f6ad2c4746dc03981a7f60 jdk8u66-b11
9a158a0c243beb610dbaabd63d6218d3ce5825f1 jdk8u71-b00
......@@ -782,6 +782,22 @@ Symbol* java_lang_Class::as_signature(oop java_class, bool intern_if_not_found,
return name;
}
// Returns the Java name for this Java mirror (Resource allocated)
// See Klass::external_name().
// For primitive type Java mirrors, its type name is returned.
const char* java_lang_Class::as_external_name(oop java_class) {
assert(java_lang_Class::is_instance(java_class), "must be a Class object");
const char* name = NULL;
if (is_primitive(java_class)) {
name = type2name(primitive_type(java_class));
} else {
name = as_Klass(java_class)->external_name();
}
if (name == NULL) {
name = "<null>";
}
return name;
}
Klass* java_lang_Class::array_klass(oop java_class) {
Klass* k = ((Klass*)java_class->metadata_field(_array_klass_offset));
......
......@@ -270,6 +270,7 @@ class java_lang_Class : AllStatic {
}
static Symbol* as_signature(oop java_class, bool intern_if_not_found, TRAPS);
static void print_signature(oop java_class, outputStream *st);
static const char* as_external_name(oop java_class);
// Testing
static bool is_instance(oop obj) {
return obj != NULL && obj->klass() == SystemDictionary::Class_klass();
......
......@@ -148,8 +148,7 @@ static void print_locked_object_class_name(outputStream* st, Handle obj, const c
if (obj.not_null()) {
st->print("\t- %s <" INTPTR_FORMAT "> ", lock_state, (address)obj());
if (obj->klass() == SystemDictionary::Class_klass()) {
Klass* target_klass = java_lang_Class::as_Klass(obj());
st->print_cr("(a java.lang.Class for %s)", InstanceKlass::cast(target_klass)->external_name());
st->print_cr("(a java.lang.Class for %s)", java_lang_Class::as_external_name(obj()));
} else {
Klass* k = obj->klass();
st->print_cr("(a %s)", k->external_name());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册