Request for reviews (S): JDK-8011979: SA: Special-case Instance.printValueOn() for Java mirrors

Staffan Larsen staffan.larsen at oracle.com
Tue Apr 23 04:31:19 PDT 2013


Looks good.

/Staffan

On 11 apr 2013, at 11:40, Krystal Mo <krystal.mo at oracle.com> wrote:

> Hi everyone,
> 
> Could I have a few reviews for this change, please?
> 
> Webrev: http://cr.openjdk.java.net/~kmo/8011979/webrev.00/
> CR: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8011979
> 
> Description: (copied from the CR)
> 
> Currently it's hard to tell from the output of sun.jvm.hotspot.oops.Instance.printValueOn() what type a java.lang.Class instance (Java mirror) represents.
> 
> e.g. in a CLHSDB session:
> 
> hsdb> class java.lang.Long
> java/lang/Long @0x000000077ec0f9b0 
> hsdb> inspect 0x000000077ec0f9b0
> Type is InstanceKlass (size of 472)
> ...
> oop Klass::_java_mirror: Oop for java/lang/Class @ 0x00000007d7002fd8 Oop for java/lang/Class @ 0x00000007d7002fd8
> ...
> hsdb> inspect 0x00000007d7002fd8
> instance of Oop for java/lang/Class @ 0x00000007d7002fd8 @ 0x00000007d7002fd8 (size = 128)
> ...
> TYPE: Oop for java/lang/Class @ 0x00000007d70002b0 Oop for java/lang/Class @ 0x00000007d70002b0
> ...
> 
> 
> It is preferable to display the name of the type in Instance.printValueOn() for Java mirrors, so that the aforementioned example becomes:
> 
> hsdb> class java.lang.Long
> java/lang/Long @0x000000077ec0f9b0 
> hsdb> inspect 0x000000077ec0f9b0
> Type is InstanceKlass (size of 472)
> ...
> oop Klass::_java_mirror: Class of [java/lang/Long] @ 0x00000007d7002fd8 Oop for java/lang/Class @ 0x00000007d7002fd8
> ...
> hsdb> inspect 0x00000007d7002fd8
> instance of Class of [java/lang/Long] @ 0x00000007d7002fd8 @ 0x00000007d7002fd8 (size = 128)
> ...
> TYPE: Class of primitive type long @ 0x00000007d70002b0 Oop for java/lang/Class @ 0x00000007d70002b0
> ...
> 
> I'm open to suggestions of the format of the special-cased message.
> 
> Testing:
> Testing with JPRT.
> Hand-tested the example case in the description.
> 
> Thanks,
> Kris

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20130423/55cce1db/attachment.html 


More information about the serviceability-dev mailing list