RFR: 8256365: Clean up vtable initialization code

Coleen Phillimore coleenp at openjdk.java.net
Tue Nov 17 16:50:07 UTC 2020


On Tue, 17 Nov 2020 16:18:46 GMT, Erik Ă–sterlund <eosterlund at openjdk.org> wrote:

>> I was looking through this code because of JDK-8061949 and want to do some minor cleanups.
>> 1. There's a function in the wrong place (is_override)
>> 2. methodHandles that use mh()->is_native(), with extra (),
>> 3. some methods declared with TRAPS, that don't trap
>> 4. some multi-clause conditionals with confusing formatting
>> 5. extra InstanceKlass::cast() casts
>> 6. some useless asserts
>> 7. and potentially a bug with RedefineClasses where the method being added to the vtable may have been redefined in the constraint verification call. (noreg-hard)
>> 
>> Tested with tier1-3.
>
> src/hotspot/share/oops/klassVtable.cpp line 474:
> 
>> 472:     // (TBD: put in a method to throw NoSuchMethodError if this slot is ever used.)
>> 473:     if (super_method->name() == name && super_method->signature() == signature &&
>> 474:         (!klass->is_interface() ||
> 
> Is _klass and klass really the same? I thought they could be different. If so, this looks like a subtle behavioural change hidden in a large cleanup patch.

Yes, they are the same which is why I made this change.  I thought of taking out the klass parameter and using _klass everywhere so there isn't this extra _klass v. klass distinction to worry about.

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

PR: https://git.openjdk.java.net/jdk/pull/1236


More information about the hotspot-dev mailing list