# HG changeset patch # User kevinw # Date 1437581815 -7200 # Node ID 773b0491804c952ee5109514466b21e0593b743f # Parent b01ad9f7a7393339aa94523b625070bbcfe9f804# Parent 4bb8e8a13f6a841c9e39b6f8b9e829fbbdf9633d Merge diff -r b01ad9f7a739 -r 773b0491804c hotspot/src/share/vm/classfile/javaClasses.cpp --- a/hotspot/src/share/vm/classfile/javaClasses.cpp Wed Jul 22 16:46:36 2015 +0200 +++ b/hotspot/src/share/vm/classfile/javaClasses.cpp Wed Jul 22 18:16:55 2015 +0200 @@ -809,6 +809,22 @@ 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 = ""; + } + return name; +} Klass* java_lang_Class::array_klass(oop java_class) { Klass* k = ((Klass*)java_class->metadata_field(_array_klass_offset)); diff -r b01ad9f7a739 -r 773b0491804c hotspot/src/share/vm/classfile/javaClasses.hpp --- a/hotspot/src/share/vm/classfile/javaClasses.hpp Wed Jul 22 16:46:36 2015 +0200 +++ b/hotspot/src/share/vm/classfile/javaClasses.hpp Wed Jul 22 18:16:55 2015 +0200 @@ -276,6 +276,7 @@ } 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); diff -r b01ad9f7a739 -r 773b0491804c hotspot/src/share/vm/runtime/vframe.cpp --- a/hotspot/src/share/vm/runtime/vframe.cpp Wed Jul 22 16:46:36 2015 +0200 +++ b/hotspot/src/share/vm/runtime/vframe.cpp Wed Jul 22 18:16:55 2015 +0200 @@ -148,8 +148,7 @@ 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());