> 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 ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/7676/files - new: https://git.openjdk.java.net/jdk/pull/7676/files/8c6d55c5..c51b82d7 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=7676&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=7676&range=00-01 Stats: 429 lines in 2 files changed: 196 ins; 233 del; 0 mod Patch: https://git.openjdk.java.net/jdk/pull/7676.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/7676/head:pull/7676 PR: https://git.openjdk.java.net/jdk/pull/7676