On Fri, 4 Mar 2022 17:12:51 GMT, Alex Menkov <amen...@openjdk.org> wrote:

>> JDK-8238048 (fixed in jdk15) moved major_version, minor_version, 
>> generic_signature_index and source_file_name_index from InstanceKlass to 
>> ConstantPool.
>> We still have some incorrect code in CP merge during class redefinition.
>> 
>> rewrite_cp_refs(scratch_class) updates generic_signature_index and 
>> source_file_name_index in the scratch_cp, so we need to copy the attributes 
>> (merge_cp->copy_fields(scratch_cp())) after rewrite_cp_refs.
>> 
>> In redefine_single_class we don't need to copy source_file_name_index 
>> because it's a CP property and we swap CPs. So this copying actually sets 
>> the value from old class.
>> 
>> tested:
>> - test/jdk/java/lang/instrument
>> - test/hotspot/jtreg/serviceability/jvmti/RedefineClasses
>> - test/hotspot/jtreg/vmTestbase/nsk/jvmti/RedefineClasses
>> - test/hotspot/jtreg/vmTestbase/nsk/jvmti/RetransformClasses
>
> Alex Menkov has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Reworked the test

Ping. Need 2nd reviewer.

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

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

Reply via email to