Skip to content

Instantly share code, notes, and snippets.

@rednaxelafx
Created June 21, 2011 16:01
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rednaxelafx/1038181 to your computer and use it in GitHub Desktop.
Save rednaxelafx/1038181 to your computer and use it in GitHub Desktop.
Trying out clhsdb to examine object layout in HotSpot
class A {
Object aObj;
int aInt;
}
class B extends A {
Object bObj;
int bInt;
float fFloat;
}
class C extends B {
Object cObj;
int cInt;
}
rednaxelafx@fx-laptop:~/workspace/hotspot_evil/bin$ javap -verbose -private A
Compiled from "A.java"
class A extends java.lang.Object
SourceFile: "A.java"
minor version: 0
major version: 50
Constant pool:
const #1 = Method #3.#17; // java/lang/Object."<init>":()V
const #2 = class #18; // A
const #3 = class #19; // java/lang/Object
const #4 = Asciz aObj;
const #5 = Asciz Ljava/lang/Object;;
const #6 = Asciz aInt;
const #7 = Asciz I;
const #8 = Asciz <init>;
const #9 = Asciz ()V;
const #10 = Asciz Code;
const #11 = Asciz LineNumberTable;
const #12 = Asciz LocalVariableTable;
const #13 = Asciz this;
const #14 = Asciz LA;;
const #15 = Asciz SourceFile;
const #16 = Asciz A.java;
const #17 = NameAndType #8:#9;// "<init>":()V
const #18 = Asciz A;
const #19 = Asciz java/lang/Object;
{
java.lang.Object aObj;
int aInt;
A();
Code:
Stack=1, Locals=1, Args_size=1
0: aload_0
1: invokespecial #1; //Method java/lang/Object."<init>":()V
4: return
LineNumberTable:
line 1: 0
LocalVariableTable:
Start Length Slot Name Signature
0 5 0 this LA;
}
rednaxelafx@fx-laptop:~/workspace/hotspot_evil/bin$ javap -verbose -private B
Compiled from "A.java"
class B extends A
SourceFile: "A.java"
minor version: 0
major version: 50
Constant pool:
const #1 = Method #3.#19; // A."<init>":()V
const #2 = class #20; // B
const #3 = class #21; // A
const #4 = Asciz bObj;
const #5 = Asciz Ljava/lang/Object;;
const #6 = Asciz bInt;
const #7 = Asciz I;
const #8 = Asciz fFloat;
const #9 = Asciz F;
const #10 = Asciz <init>;
const #11 = Asciz ()V;
const #12 = Asciz Code;
const #13 = Asciz LineNumberTable;
const #14 = Asciz LocalVariableTable;
const #15 = Asciz this;
const #16 = Asciz LB;;
const #17 = Asciz SourceFile;
const #18 = Asciz A.java;
const #19 = NameAndType #10:#11;// "<init>":()V
const #20 = Asciz B;
const #21 = Asciz A;
{
java.lang.Object bObj;
int bInt;
float fFloat;
B();
Code:
Stack=1, Locals=1, Args_size=1
0: aload_0
1: invokespecial #1; //Method A."<init>":()V
4: return
LineNumberTable:
line 6: 0
LocalVariableTable:
Start Length Slot Name Signature
0 5 0 this LB;
}
rednaxelafx@fx-laptop:~/workspace/hotspot_evil/bin$ javap -verbose -private C
Compiled from "A.java"
class C extends B
SourceFile: "A.java"
minor version: 0
major version: 50
Constant pool:
const #1 = Method #3.#17; // B."<init>":()V
const #2 = class #18; // C
const #3 = class #19; // B
const #4 = Asciz cObj;
const #5 = Asciz Ljava/lang/Object;;
const #6 = Asciz cInt;
const #7 = Asciz I;
const #8 = Asciz <init>;
const #9 = Asciz ()V;
const #10 = Asciz Code;
const #11 = Asciz LineNumberTable;
const #12 = Asciz LocalVariableTable;
const #13 = Asciz this;
const #14 = Asciz LC;;
const #15 = Asciz SourceFile;
const #16 = Asciz A.java;
const #17 = NameAndType #8:#9;// "<init>":()V
const #18 = Asciz C;
const #19 = Asciz B;
{
java.lang.Object cObj;
int cInt;
C();
Code:
Stack=1, Locals=1, Args_size=1
0: aload_0
1: invokespecial #1; //Method B."<init>":()V
4: return
LineNumberTable:
line 12: 0
LocalVariableTable:
Start Length Slot Name Signature
0 5 0 this LC;
}
rednaxelafx@fx-laptop:~/workspace/hotspot_evil/bin$
rednaxelafx@fx-laptop:~$ rvm use jruby
Using /home/rednaxelafx/.rvm/gems/jruby-1.6.2
rednaxelafx@fx-laptop:~$ cd /home/rednaxelafx/workspace/hotspot_evil/
rednaxelafx@fx-laptop:~/workspace/hotspot_evil$ ls
CHANGELOG doc lib LICENSE Rakefile README src TODO
rednaxelafx@fx-laptop:~/workspace/hotspot_evil$ rake
jruby 1.6.2 (ruby-1.8.7-p330) (2011-05-23 e2ea975) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_25) [linux-amd64-java]
compiled Address.java
compiled Dereference.java
compiled MarkWord.java
compiled ReinterpretCast.java
rednaxelafx@fx-laptop:~/workspace/hotspot_evil$ cd bin
rednaxelafx@fx-laptop:~/workspace/hotspot_evil/bin$ ls
hotspot
rednaxelafx@fx-laptop:~/workspace/hotspot_evil/bin$ javac -g A.java
rednaxelafx@fx-laptop:~/workspace/hotspot_evil/bin$ ls
A.class A.java B.class C.class hotspot
rednaxelafx@fx-laptop:~/workspace/hotspot_evil/bin$ java -version
java version "1.6.0_25"
Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.0-b11, mixed mode)
rednaxelafx@fx-laptop:~/workspace/hotspot_evil/bin$ groovysh
Groovy Shell (1.7.5, JVM: 1.6.0_25)
Type 'help' or '\h' for help.
-------------------------------------------------------------------------------
groovy:000> c = new C()
===> C@54ec115b
groovy:000> hotspot.evil.Address.of(c)
===> 33690980728
groovy:000> import hotspot.evil.*
===> [import hotspot.evil.*]
groovy:000> Dereference.int32(0x00FFFFFF12345L as long)
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007fd66a135458, pid=7740, tid=140558944892672
#
# JRE version: 6.0_25-b06
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20.0-b11 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# j hotspot.evil.Dereference.int32(J)I+8
#
# An error report file with more information is saved as:
# /home/rednaxelafx/workspace/hotspot_evil/bin/hs_err_pid7740.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
Aborted (core dumped)
rednaxelafx@fx-laptop:~/workspace/hotspot_evil/bin$ irb
jruby-1.6.2 :001 > 33690980728.to_s 16
=> "7d8239178"
jruby-1.6.2 :002 > quit
rednaxelafx@fx-laptop:~/workspace/hotspot_evil/bin$
rednaxelafx@fx-laptop:~/workspace/hotspot_evil/bin$ ls
A.class A.java B.class C.class core hotspot hs_err_pid7740.log
rednaxelafx@fx-laptop:~/workspace/hotspot_evil/bin$ echo $JAVA_HOME
/home/rednaxelafx/sdk/jdk1.6.0_25
rednaxelafx@fx-laptop:~/workspace/hotspot_evil/bin$ clhsdb
hsdb> attach /home/rednaxelafx/sdk/jdk1.6.0_25/bin/java core
Opening core file, please wait...
hsdb> inspect 0x7d8239178
instance of Oop for C @ 0x00000007d8239178 @ 0x00000007d8239178 (size = 40)
_mark: 364737813249
aObj: null null
aInt: 0
bObj: null null
bInt: 0
fFloat: 0.0
cObj: null null
cInt: 0
hsdb> examine 0x00000007d8239178/5
0x00000007d8239178: 0x00000054ec115b01 0x00000000f01b3203 0x0000000000000000
0x00000007d8239190: 0x0000000000000000 0x0000000000000000
// 0x780d99018 == 0 + 0xf01b3203 << 3 (note that we're using ZeroBasedNarrowOop)
hsdb> inspect 0x780d99018
instance of InstanceKlass for C @ 0x0000000780d99018 @ 0x0000000780d99018 (size = 624)
_mark: 1
_java_mirror: Oop for java/lang/Class @ 0x0000000780d99288 Oop for java/lang/Class @ 0x0000000780d99288
_super: InstanceKlass for B @ 0x0000000780d98d48 Oop @ 0x0000000780d98d48
_layout_helper: 40
_name: #C @ 0x000000077fe05fa8 Oop @ 0x000000077fe05fa8
_access_flags: 538968096
_subklass: null null
_next_sibling: null null
_alloc_count: 0
_array_klasses: null null
_methods: ObjArray @ 0x0000000780d98448 Oop for [[I @ 0x0000000780d98448
_method_ordering: [I @ 0x000000077fe01e98 Oop for [I @ 0x000000077fe01e98
_local_interfaces: ObjArray @ 0x000000077fe01ea8 Oop for [[I @ 0x000000077fe01ea8
_transitive_interfaces: ObjArray @ 0x000000077fe01ea8 Oop for [[I @ 0x000000077fe01ea8
_nof_implementors: 0
_implementors[0]: null null
_implementors[0]: null null
_fields: [S @ 0x0000000780d98418 Oop for [S @ 0x0000000780d98418
_constants: ConstantPool for C @ 0x0000000780d982b0 Oop @ 0x0000000780d982b0
_class_loader: Oop for org/codehaus/groovy/tools/RootLoader @ 0x00000007d8ee8240 Oop for org/codehaus/groovy/tools/RootLoader @ 0x00000007d8ee8240
_protection_domain: Oop for java/security/ProtectionDomain @ 0x00000007d7c8be00 Oop for java/security/ProtectionDomain @ 0x00000007d7c8be00
_signers: null null
_source_file_name: #A.java @ 0x0000000780d98400 Oop @ 0x0000000780d98400
_inner_classes: [S @ 0x000000077fe01e88 Oop for [S @ 0x000000077fe01e88
_nonstatic_field_size: 7
_static_field_size: 0
_static_oop_field_size: 0
_nonstatic_oop_map_size: 3
_is_marked_dependent: 0
_init_state: 5
_vtable_len: 5
_itable_len: 2
hsdb> inspect 0x0000000780d98d48
instance of InstanceKlass for B @ 0x0000000780d98d48 @ 0x0000000780d98d48 (size = 616)
_mark: 1
_java_mirror: Oop for java/lang/Class @ 0x0000000780d98fb0 Oop for java/lang/Class @ 0x0000000780d98fb0
_super: InstanceKlass for A @ 0x0000000780d98a80 Oop @ 0x0000000780d98a80
_layout_helper: 32
_name: #B @ 0x000000077fe05f90 Oop @ 0x000000077fe05f90
_access_flags: 538968096
_subklass: InstanceKlass for C @ 0x0000000780d99018 Oop @ 0x0000000780d99018
_next_sibling: null null
_alloc_count: 0
_array_klasses: null null
_methods: ObjArray @ 0x0000000780d98700 Oop for [[I @ 0x0000000780d98700
_method_ordering: [I @ 0x000000077fe01e98 Oop for [I @ 0x000000077fe01e98
_local_interfaces: ObjArray @ 0x000000077fe01ea8 Oop for [[I @ 0x000000077fe01ea8
_transitive_interfaces: ObjArray @ 0x000000077fe01ea8 Oop for [[I @ 0x000000077fe01ea8
_nof_implementors: 0
_implementors[0]: null null
_implementors[0]: null null
_fields: [S @ 0x0000000780d986c0 Oop for [S @ 0x0000000780d986c0
_constants: ConstantPool for B @ 0x0000000780d98548 Oop @ 0x0000000780d98548
_class_loader: Oop for org/codehaus/groovy/tools/RootLoader @ 0x00000007d8ee8240 Oop for org/codehaus/groovy/tools/RootLoader @ 0x00000007d8ee8240
_protection_domain: Oop for java/security/ProtectionDomain @ 0x00000007d7c8be00 Oop for java/security/ProtectionDomain @ 0x00000007d7c8be00
_signers: null null
_source_file_name: #A.java @ 0x0000000780d98400 Oop @ 0x0000000780d98400
_inner_classes: [S @ 0x000000077fe01e88 Oop for [S @ 0x000000077fe01e88
_nonstatic_field_size: 5
_static_field_size: 0
_static_oop_field_size: 0
_nonstatic_oop_map_size: 2
_is_marked_dependent: 0
_init_state: 5
_vtable_len: 5
_itable_len: 2
hsdb> inspect 0x0000000780d98a80
instance of InstanceKlass for A @ 0x0000000780d98a80 @ 0x0000000780d98a80 (size = 608)
_mark: 1
_java_mirror: Oop for java/lang/Class @ 0x0000000780d98ce0 Oop for java/lang/Class @ 0x0000000780d98ce0
_super: InstanceKlass for java/lang/Object @ 0x000000077fe08df8 Oop @ 0x000000077fe08df8
_layout_helper: 24
_name: #A @ 0x0000000780031e98 Oop @ 0x0000000780031e98
_access_flags: 538968096
_subklass: InstanceKlass for B @ 0x0000000780d98d48 Oop @ 0x0000000780d98d48
_next_sibling: InstanceKlass for org/codehaus/groovy/control/SourceExtensionHandler @ 0x0000000780d96960 Oop @ 0x0000000780d96960
_alloc_count: 0
_array_klasses: null null
_methods: ObjArray @ 0x0000000780d98980 Oop for [[I @ 0x0000000780d98980
_method_ordering: [I @ 0x000000077fe01e98 Oop for [I @ 0x000000077fe01e98
_local_interfaces: ObjArray @ 0x000000077fe01ea8 Oop for [[I @ 0x000000077fe01ea8
_transitive_interfaces: ObjArray @ 0x000000077fe01ea8 Oop for [[I @ 0x000000077fe01ea8
_nof_implementors: 0
_implementors[0]: null null
_implementors[0]: null null
_fields: [S @ 0x0000000780d98950 Oop for [S @ 0x0000000780d98950
_constants: ConstantPool for A @ 0x0000000780d98800 Oop @ 0x0000000780d98800
_class_loader: Oop for org/codehaus/groovy/tools/RootLoader @ 0x00000007d8ee8240 Oop for org/codehaus/groovy/tools/RootLoader @ 0x00000007d8ee8240
_protection_domain: Oop for java/security/ProtectionDomain @ 0x00000007d7c8be00 Oop for java/security/ProtectionDomain @ 0x00000007d7c8be00
_signers: null null
_source_file_name: #A.java @ 0x0000000780d98400 Oop @ 0x0000000780d98400
_inner_classes: [S @ 0x000000077fe01e88 Oop for [S @ 0x000000077fe01e88
_nonstatic_field_size: 2
_static_field_size: 0
_static_oop_field_size: 0
_nonstatic_oop_map_size: 1
_is_marked_dependent: 0
_init_state: 5
_vtable_len: 5
_itable_len: 2
// 7 shorts per tuple in the _fields array (the comment below is missing something off the end)
// Tuples of shorts [access, name index, sig index, initial value index, byte offset, generic signature index]
// A's _fields:
hsdb> inspect 0x0000000780d98950
instance of [S @ 0x0000000780d98950 @ 0x0000000780d98950 (size = 48)
_mark: 1
0: 0 // access: 0
1: 4 // name: aObj
2: 5 // signature: Ljava/lang/Object;
3: 0 // initial value: null
4: 16 // byte offset: 16
5: 0
6: 0
7: 0 // access: 0
8: 6 // name: aInt
9: 7 // signature: I
10: 0 // initial value: 0
11: 12 // byte offset: 12
12: 0
13: 0
// B's _fields:
hsdb> inspect 0x0000000780d986c0
instance of [S @ 0x0000000780d986c0 @ 0x0000000780d986c0 (size = 64)
_mark: 1
0: 0
1: 4
2: 5
3: 0
4: 28
5: 0
6: 0
7: 0
8: 6
9: 7
10: 0
11: 20
12: 0
13: 0
14: 0
15: 8
16: 9
17: 0
18: 24
19: 0
20: 0
// C's _fields:
hsdb> inspect 0x0000000780d98418
instance of [S @ 0x0000000780d98418 @ 0x0000000780d98418 (size = 48)
_mark: 1
0: 0
1: 4
2: 5
3: 0
4: 36
5: 0
6: 0
7: 0
8: 6
9: 7
10: 0
11: 32
12: 0
13: 0
hsdb>
rednaxelafx@fx-laptop:~/workspace/hotspot_evil/bin$ export JAVA_OPTS='-XX:FieldsAllocationStyle=2'
rednaxelafx@fx-laptop:~/workspace/hotspot_evil/bin$ groovysh
Groovy Shell (1.7.5, JVM: 1.6.0_25)
Type 'help' or '\h' for help.
-------------------------------------------------------------------------------------------------------------------------------------
groovy:000> c = new C()
===> C@63e708b2
groovy:000> import hotspot.evil.*
===> [import hotspot.evil.*]
groovy:000> Address.of(c)
===> 33690978904
groovy:000> Dereference.int32(0x00FFFFFF12345L as long)
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f96be9e8458, pid=8380, tid=140285485393664
#
# JRE version: 6.0_25-b06
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20.0-b11 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# j hotspot.evil.Dereference.int32(J)I+8
#
# An error report file with more information is saved as:
# /home/rednaxelafx/workspace/hotspot_evil/bin/hs_err_pid8380.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
Aborted (core dumped)
rednaxelafx@fx-laptop:~/workspace/hotspot_evil/bin$ irb
ruby-1.9.2-p180 :001 > 33690978904.to_s 16
=> "7d8238a58"
ruby-1.9.2-p180 :002 > quit
rednaxelafx@fx-laptop:~/workspace/hotspot_evil/bin$ clhsdb
hsdb> attach /home/rednaxelafx/sdk/jdk1.6.0_25/bin/java core
Opening core file, please wait...
hsdb> inspect 0x7d8238a58
instance of Oop for C @ 0x00000007d8238a58 @ 0x00000007d8238a58 (size = 40)
_mark: 429077869057
aObj: null null
aInt: 0
bObj: null null
bInt: 0
fFloat: 0.0
cObj: null null
cInt: 0
hsdb> examine 0x7d8238a58/5
0x00000007d8238a58: 0x00000063e708b201 0x00000000f01b309b 0x0000000000000000
0x00000007d8238a70: 0x0000000000000000 0x0000000000000000
hsdb> inspect 0x780d984d8
instance of InstanceKlass for C @ 0x0000000780d984d8 @ 0x0000000780d984d8 (size = 616)
_mark: 1
_java_mirror: Oop for java/lang/Class @ 0x0000000780d98740 Oop for java/lang/Class @ 0x0000000780d98740
_super: InstanceKlass for B @ 0x0000000780d98210 Oop @ 0x0000000780d98210
_layout_helper: 40
_name: #C @ 0x000000077fe05fa8 Oop @ 0x000000077fe05fa8
_access_flags: 538968096
_subklass: null null
_next_sibling: null null
_alloc_count: 0
_array_klasses: null null
_methods: ObjArray @ 0x0000000780d97910 Oop for [[I @ 0x0000000780d97910
_method_ordering: [I @ 0x000000077fe01e98 Oop for [I @ 0x000000077fe01e98
_local_interfaces: ObjArray @ 0x000000077fe01ea8 Oop for [[I @ 0x000000077fe01ea8
_transitive_interfaces: ObjArray @ 0x000000077fe01ea8 Oop for [[I @ 0x000000077fe01ea8
_nof_implementors: 0
_implementors[0]: null null
_implementors[0]: null null
_fields: [S @ 0x0000000780d978e0 Oop for [S @ 0x0000000780d978e0
_constants: ConstantPool for C @ 0x0000000780d97778 Oop @ 0x0000000780d97778
_class_loader: Oop for org/codehaus/groovy/tools/RootLoader @ 0x00000007d8ed0270 Oop for org/codehaus/groovy/tools/RootLoader @ 0x00000007d8ed0270
_protection_domain: Oop for java/security/ProtectionDomain @ 0x00000007d7c8b2b0 Oop for java/security/ProtectionDomain @ 0x00000007d7c8b2b0
_signers: null null
_source_file_name: #A.java @ 0x0000000780d978c8 Oop @ 0x0000000780d978c8
_inner_classes: [S @ 0x000000077fe01e88 Oop for [S @ 0x000000077fe01e88
_nonstatic_field_size: 7
_static_field_size: 0
_static_oop_field_size: 0
_nonstatic_oop_map_size: 2
_is_marked_dependent: 0
_init_state: 5
_vtable_len: 5
_itable_len: 2
hsdb> inspect 0x0000000780d978e0
instance of [S @ 0x0000000780d978e0 @ 0x0000000780d978e0 (size = 48)
_mark: 1
0: 0
1: 4
2: 5
3: 0
4: 36
5: 0
6: 0
7: 0
8: 6
9: 7
10: 0
11: 32
12: 0
13: 0
hsdb> inspect 0x0000000780d98210
instance of InstanceKlass for B @ 0x0000000780d98210 @ 0x0000000780d98210 (size = 608)
_mark: 1
_java_mirror: Oop for java/lang/Class @ 0x0000000780d98470 Oop for java/lang/Class @ 0x0000000780d98470
_super: InstanceKlass for A @ 0x0000000780d97f48 Oop @ 0x0000000780d97f48
_layout_helper: 32
_name: #B @ 0x000000077fe05f90 Oop @ 0x000000077fe05f90
_access_flags: 538968096
_subklass: InstanceKlass for C @ 0x0000000780d984d8 Oop @ 0x0000000780d984d8
_next_sibling: null null
_alloc_count: 0
_array_klasses: null null
_methods: ObjArray @ 0x0000000780d97bc8 Oop for [[I @ 0x0000000780d97bc8
_method_ordering: [I @ 0x000000077fe01e98 Oop for [I @ 0x000000077fe01e98
_local_interfaces: ObjArray @ 0x000000077fe01ea8 Oop for [[I @ 0x000000077fe01ea8
_transitive_interfaces: ObjArray @ 0x000000077fe01ea8 Oop for [[I @ 0x000000077fe01ea8
_nof_implementors: 0
_implementors[0]: null null
_implementors[0]: null null
_fields: [S @ 0x0000000780d97b88 Oop for [S @ 0x0000000780d97b88
_constants: ConstantPool for B @ 0x0000000780d97a10 Oop @ 0x0000000780d97a10
_class_loader: Oop for org/codehaus/groovy/tools/RootLoader @ 0x00000007d8ed0270 Oop for org/codehaus/groovy/tools/RootLoader @ 0x00000007d8ed0270
_protection_domain: Oop for java/security/ProtectionDomain @ 0x00000007d7c8b2b0 Oop for java/security/ProtectionDomain @ 0x00000007d7c8b2b0
_signers: null null
_source_file_name: #A.java @ 0x0000000780d978c8 Oop @ 0x0000000780d978c8
_inner_classes: [S @ 0x000000077fe01e88 Oop for [S @ 0x000000077fe01e88
_nonstatic_field_size: 5
_static_field_size: 0
_static_oop_field_size: 0
_nonstatic_oop_map_size: 1
_is_marked_dependent: 0
_init_state: 5
_vtable_len: 5
_itable_len: 2
hsdb> inspect 0x0000000780d97b88
instance of [S @ 0x0000000780d97b88 @ 0x0000000780d97b88 (size = 64)
_mark: 1
0: 0
1: 4
2: 5
3: 0
4: 20
5: 0
6: 0
7: 0
8: 6
9: 7
10: 0
11: 24
12: 0
13: 0
14: 0
15: 8
16: 9
17: 0
18: 28
19: 0
20: 0
hsdb> inspect 0x0000000780d97f48
instance of InstanceKlass for A @ 0x0000000780d97f48 @ 0x0000000780d97f48 (size = 608)
_mark: 1
_java_mirror: Oop for java/lang/Class @ 0x0000000780d981a8 Oop for java/lang/Class @ 0x0000000780d981a8
_super: InstanceKlass for java/lang/Object @ 0x000000077fe08df8 Oop @ 0x000000077fe08df8
_layout_helper: 24
_name: #A @ 0x0000000780031de8 Oop @ 0x0000000780031de8
_access_flags: 538968096
_subklass: InstanceKlass for B @ 0x0000000780d98210 Oop @ 0x0000000780d98210
_next_sibling: InstanceKlass for org/codehaus/groovy/control/SourceExtensionHandler @ 0x0000000780d95e28 Oop @ 0x0000000780d95e28
_alloc_count: 0
_array_klasses: null null
_methods: ObjArray @ 0x0000000780d97e48 Oop for [[I @ 0x0000000780d97e48
_method_ordering: [I @ 0x000000077fe01e98 Oop for [I @ 0x000000077fe01e98
_local_interfaces: ObjArray @ 0x000000077fe01ea8 Oop for [[I @ 0x000000077fe01ea8
_transitive_interfaces: ObjArray @ 0x000000077fe01ea8 Oop for [[I @ 0x000000077fe01ea8
_nof_implementors: 0
_implementors[0]: null null
_implementors[0]: null null
_fields: [S @ 0x0000000780d97e18 Oop for [S @ 0x0000000780d97e18
_constants: ConstantPool for A @ 0x0000000780d97cc8 Oop @ 0x0000000780d97cc8
_class_loader: Oop for org/codehaus/groovy/tools/RootLoader @ 0x00000007d8ed0270 Oop for org/codehaus/groovy/tools/RootLoader @ 0x00000007d8ed0270
_protection_domain: Oop for java/security/ProtectionDomain @ 0x00000007d7c8b2b0 Oop for java/security/ProtectionDomain @ 0x00000007d7c8b2b0
_signers: null null
_source_file_name: #A.java @ 0x0000000780d978c8 Oop @ 0x0000000780d978c8
_inner_classes: [S @ 0x000000077fe01e88 Oop for [S @ 0x000000077fe01e88
_nonstatic_field_size: 2
_static_field_size: 0
_static_oop_field_size: 0
_nonstatic_oop_map_size: 1
_is_marked_dependent: 0
_init_state: 5
_vtable_len: 5
_itable_len: 2
hsdb> inspect 0x0000000780d97e18
instance of [S @ 0x0000000780d97e18 @ 0x0000000780d97e18 (size = 48)
_mark: 1
0: 0
1: 4
2: 5
3: 0
4: 16
5: 0
6: 0
7: 0
8: 6
9: 7
10: 0
11: 12
12: 0
13: 0
hsdb> class C
C @0x0000000780d984d8
hsdb> print 0x0000000780d984d8
class C @0x0000000780d984d8
Super Class
class B @0x0000000780d98210
Fields
java.lang.Object cObj; (offset = 36)
int cInt; (offset = 32)
Methods
void <init>() @0x0000000780d97988;
Constant Pool
Constant Pool of [class C @0x0000000780d984d8] @0x0000000780d97778
hsdb> class B
B @0x0000000780d98210
hsdb> print 0x0000000780d98210
class B @0x0000000780d98210
Super Class
class A @0x0000000780d97f48
Fields
java.lang.Object bObj; (offset = 20)
int bInt; (offset = 24)
float fFloat; (offset = 28)
Methods
void <init>() @0x0000000780d97c40;
Constant Pool
Constant Pool of [class B @0x0000000780d98210] @0x0000000780d97a10
hsdb> class A
A @0x0000000780d97f48
hsdb> print 0x0000000780d97f48
class A @0x0000000780d97f48
Super Class
public class java.lang.Object @0x000000077fe08df8
Fields
java.lang.Object aObj; (offset = 16)
int aInt; (offset = 12)
Methods
void <init>() @0x0000000780d97ec0;
Constant Pool
Constant Pool of [class A @0x0000000780d97f48] @0x0000000780d97cc8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment