In SA, when we try to retrieve the list of InstanceKlasses either through SystemDictionaryHelper.getAllInstanceKlasses() or through SystemDictionary.ClassVisitor(), the LambdaMetaFactory generated classes are not included at all.
Once the changes to retrieve these generated anonymous classes are done, and extra word (representing the embedded host klass) needs to be added to the InstanceKlass size, so that the size would be in line with the following code in instanceKlass.hpp
47 // An InstanceKlass is the VM level representation of a Java class.
48 // It contains all information needed for at class at execution runtime.
49
50 // InstanceKlass embedded field layout (after declared fields):
51 // [EMBEDDED Java vtable ] size in words = vtable_len
52 // [EMBEDDED nonstatic oop-map blocks] size in words = nonstatic_oop_map_size
53 // The embedded nonstatic oop-map blocks are short pairs (offset, length)
54 // indicating where oops are located in instances of this klass.
55 // [EMBEDDED implementor of the interface] only exist for interface
56 // [EMBEDDED host klass ] only exist for an anonymous class (JSR 292 enabled)
…
1006 static int size(int vtable_length, int itable_length,
1007 int nonstatic_oop_map_size,
1008 bool is_interface, bool is_anonymous) {
1009 return align_metadata_size(header_size() +
1010 vtable_length +
1011 itable_length +
1012 nonstatic_oop_map_size +
1013 (is_interface ? (int)sizeof(Klass*)/wordSize : 0) +
1014 (is_anonymous ? (int)sizeof(Klass*)/wordSize : 0));
Once the changes to retrieve these generated anonymous classes are done, and extra word (representing the embedded host klass) needs to be added to the InstanceKlass size, so that the size would be in line with the following code in instanceKlass.hpp
47 // An InstanceKlass is the VM level representation of a Java class.
48 // It contains all information needed for at class at execution runtime.
49
50 // InstanceKlass embedded field layout (after declared fields):
51 // [EMBEDDED Java vtable ] size in words = vtable_len
52 // [EMBEDDED nonstatic oop-map blocks] size in words = nonstatic_oop_map_size
53 // The embedded nonstatic oop-map blocks are short pairs (offset, length)
54 // indicating where oops are located in instances of this klass.
55 // [EMBEDDED implementor of the interface] only exist for interface
56 // [EMBEDDED host klass ] only exist for an anonymous class (JSR 292 enabled)
…
1006 static int size(int vtable_length, int itable_length,
1007 int nonstatic_oop_map_size,
1008 bool is_interface, bool is_anonymous) {
1009 return align_metadata_size(header_size() +
1010 vtable_length +
1011 itable_length +
1012 nonstatic_oop_map_size +
1013 (is_interface ? (int)sizeof(Klass*)/wordSize : 0) +
1014 (is_anonymous ? (int)sizeof(Klass*)/wordSize : 0));
- duplicates
-
JDK-8171008 Integrate AOT compiler into JDK
-
- Resolved
-
- relates to
-
JDK-8145627 sun.jvm.hotspot.oops.InstanceKlass::getSize() returns the incorrect size and has no test
-
- Resolved
-