mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 02:54:35 +02:00
8027920: SA: Add default methods to InstanceKlass
Add default methods to InstanceKlass to enable SA to inspect default methods Reviewed-by: dsamersoff, iklam
This commit is contained in:
parent
5460376f61
commit
21f3d1ae5f
1 changed files with 16 additions and 0 deletions
|
@ -68,6 +68,7 @@ public class InstanceKlass extends Klass {
|
||||||
Type type = db.lookupType("InstanceKlass");
|
Type type = db.lookupType("InstanceKlass");
|
||||||
arrayKlasses = new MetadataField(type.getAddressField("_array_klasses"), 0);
|
arrayKlasses = new MetadataField(type.getAddressField("_array_klasses"), 0);
|
||||||
methods = type.getAddressField("_methods");
|
methods = type.getAddressField("_methods");
|
||||||
|
defaultMethods = type.getAddressField("_default_methods");
|
||||||
methodOrdering = type.getAddressField("_method_ordering");
|
methodOrdering = type.getAddressField("_method_ordering");
|
||||||
localInterfaces = type.getAddressField("_local_interfaces");
|
localInterfaces = type.getAddressField("_local_interfaces");
|
||||||
transitiveInterfaces = type.getAddressField("_transitive_interfaces");
|
transitiveInterfaces = type.getAddressField("_transitive_interfaces");
|
||||||
|
@ -128,6 +129,7 @@ public class InstanceKlass extends Klass {
|
||||||
|
|
||||||
private static MetadataField arrayKlasses;
|
private static MetadataField arrayKlasses;
|
||||||
private static AddressField methods;
|
private static AddressField methods;
|
||||||
|
private static AddressField defaultMethods;
|
||||||
private static AddressField methodOrdering;
|
private static AddressField methodOrdering;
|
||||||
private static AddressField localInterfaces;
|
private static AddressField localInterfaces;
|
||||||
private static AddressField transitiveInterfaces;
|
private static AddressField transitiveInterfaces;
|
||||||
|
@ -335,6 +337,20 @@ public class InstanceKlass extends Klass {
|
||||||
// Accessors for declared fields
|
// Accessors for declared fields
|
||||||
public Klass getArrayKlasses() { return (Klass) arrayKlasses.getValue(this); }
|
public Klass getArrayKlasses() { return (Klass) arrayKlasses.getValue(this); }
|
||||||
public MethodArray getMethods() { return new MethodArray(methods.getValue(getAddress())); }
|
public MethodArray getMethods() { return new MethodArray(methods.getValue(getAddress())); }
|
||||||
|
|
||||||
|
public MethodArray getDefaultMethods() {
|
||||||
|
if (defaultMethods != null) {
|
||||||
|
Address addr = defaultMethods.getValue(getAddress());
|
||||||
|
if ((addr != null) && (addr.getAddressAt(0) != null)) {
|
||||||
|
return new MethodArray(addr);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public KlassArray getLocalInterfaces() { return new KlassArray(localInterfaces.getValue(getAddress())); }
|
public KlassArray getLocalInterfaces() { return new KlassArray(localInterfaces.getValue(getAddress())); }
|
||||||
public KlassArray getTransitiveInterfaces() { return new KlassArray(transitiveInterfaces.getValue(getAddress())); }
|
public KlassArray getTransitiveInterfaces() { return new KlassArray(transitiveInterfaces.getValue(getAddress())); }
|
||||||
public int getJavaFieldsCount() { return (int) javaFieldsCount.getValue(this); }
|
public int getJavaFieldsCount() { return (int) javaFieldsCount.getValue(this); }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue