RFR: 8303489: Add a test to verify classes in vmStruct have unuque vtables

Chris Plummer cjplummer at openjdk.org
Thu Mar 2 03:42:14 UTC 2023


On Thu, 2 Mar 2023 02:41:12 GMT, Alex Menkov <amenkov at openjdk.org> wrote:

> Unique vtables for classes in vmStruct data is a requirement for SA to correctly detect hotspot classes.
> The fix adds test to verify this requirement.
> 
> The test fails as expected on Windows if VM is built without RTTI (see JDK-8302817)

test/hotspot/jtreg/serviceability/sa/UniqueVtableTest.java line 84:

> 82:         MethodHandles.Lookup classLookup = MethodHandles.privateLookupIn(BasicTypeDataBase.class, lookup);
> 83:         vtblForType = classLookup.findVirtual(BasicTypeDataBase.class, "vtblForType",
> 84:                  MethodType.methodType(Address.class, Type.class));

I think it would be ok to just make vtblForType() public so you won't need to use reflection. The public SA APIs are not a spec. We are free to do things in the future that are not backwards compatible.

-------------

PR: https://git.openjdk.org/jdk/pull/12820


More information about the serviceability-dev mailing list