[jdk11u-dev] RFR: 8078725: method adjustments can be done just once for all classes involved into redefinition
Martin Doerr
mdoerr at openjdk.org
Wed Jun 26 12:57:35 UTC 2024
Backport of [JDK-8078725](https://bugs.openjdk.org/browse/JDK-8078725) which is a prerequisite of [JDK-8222005](https://bugs.openjdk.org/browse/JDK-8222005). Applies almost cleanly. Manual changes:
1. This hunk required manual integration (1st commit):
--- src/hotspot/share/prims/resolvedMethodTable.cpp
+++ src/hotspot/share/prims/resolvedMethodTable.cpp
@@ -232,12 +232,7 @@ void ResolvedMethodTable::adjust_method_entries(bool * trace_name_printed) {
continue;
}
- InstanceKlass* holder = old_method->method_holder();
- Method* new_method = holder->method_with_idnum(old_method->orig_method_idnum());
- assert(holder == new_method->method_holder(), "call after swapping redefined guts");
- assert(new_method != NULL, "method_with_idnum() should not be NULL");
- assert(old_method != new_method, "sanity check");
-
+ Method* new_method = old_method->get_new_method();
java_lang_invoke_ResolvedMethodName::set_vmtarget(mem_name, new_method);
ResourceMark rm;
JDK 11 code has `new_method` already declared and only needs to assign it.
2. `Method* get_new_method() const` already exists in 11u. Removed old one (2nd commit).
-------------
Commit messages:
- Remove duplicate Method* get_new_method() const
- Backport 351280bbb8337eff6b61ce305ead2bf207370889
Changes: https://git.openjdk.org/jdk11u-dev/pull/2816/files
Webrev: https://webrevs.openjdk.org/?repo=jdk11u-dev&pr=2816&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8078725
Stats: 163 lines in 9 files changed: 24 ins; 81 del; 58 mod
Patch: https://git.openjdk.org/jdk11u-dev/pull/2816.diff
Fetch: git fetch https://git.openjdk.org/jdk11u-dev.git pull/2816/head:pull/2816
PR: https://git.openjdk.org/jdk11u-dev/pull/2816
More information about the jdk-updates-dev
mailing list