RFR: 8303489: Add a test to verify classes in vmStruct have unique vtables [v2]

Chris Plummer cjplummer at openjdk.org
Thu Mar 2 22:29:19 UTC 2023


On Thu, 2 Mar 2023 20:42: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)
>
> Alex Menkov has updated the pull request incrementally with one additional commit since the last revision:
> 
>   addressed feedback

Changes requested by cjplummer (Reviewer).

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

> 83:         int dupsFound = 0;
> 84:         // agent.getTypeDataBase() returns HotSpotTypeDataBase (extends BasicTypeDataBase)
> 85:         BasicTypeDataBase typeDB = (BasicTypeDataBase)(agent.getTypeDataBase());

I don't think the cast is needed.

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

> 92:             Address vtable = typeDB.vtblForType(t);
> 93:             if (vtable != null) {
> 94:                 no_vtable++;

`no_vtable` is actually tracking the number of Types with a vtable.

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

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


More information about the serviceability-dev mailing list