Request for reviews (S): JDK-8011979: SA: Special-case Instance.printValueOn() for Java mirrors
云达(Yunda)
yunda.mly at taobao.com
Tue Apr 23 03:52:44 PDT 2013
Kris,
I applied your change and it’s useful when using CLHSDB. And I also think the code is good.
Regards,
Yunda
From: serviceability-dev-bounces at openjdk.java.net [mailto:serviceability-dev-bounces at openjdk.java.net] On Behalf Of Krystal Mo
Sent: Thursday, April 11, 2013 5:40 PM
To: serviceability-dev at openjdk.java.net
Subject: Request for reviews (S): JDK-8011979: SA: Special-case Instance.printValueOn() for Java mirrors
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
________________________________
This email (including any attachments) is confidential and may be legally privileged. If you received this email in error, please delete it immediately and do not copy it or use it for any purpose or disclose its contents to any other person. Thank you.
本电邮(包括任何附件)可能含有机密资料并受法律保护。如您不是正确的收件人,请您立即删除本邮件。请不要将本电邮进行复制并用作任何其他用途、或透露本邮件之内容。谢谢。
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20130423/b0a14002/attachment.html
More information about the serviceability-dev
mailing list