RFR: 8340141: C1: rework ciMethod::equals following 8338471
Vladimir Ivanov
vlivanov at openjdk.org
Tue Oct 1 21:39:36 UTC 2024
On Tue, 24 Sep 2024 00:35:47 GMT, Dean Long <dlong at openjdk.org> wrote:
> This PR changes ciMethod::equals() to a special-purpose debug helper method for the one place in C1 that uses it in an assert. The reason why making it general purpose is difficult is because JVMTI can add and delete methods. See the bug report and JDK-8338471 for more details. I'm open to suggestions for a better name than equals_ignore_version().
>
> An alternative approach, which I think may actually be better, would be to check for old methods first, and bail out if we see any. Then we can change the assert back to how it was originally, using ==.
src/hotspot/share/ci/ciMethod.cpp line 800:
> 798: Method* m1 = this->get_Method();
> 799: Method* m2 = m->get_Method();
> 800: guarantee(!m1->is_private() && !m1->is_deleted(), "see usage note");
Some changes inside `ciMethod::equals` look irrelevant to checking method equality (e.g., asserting that a method is not private). Alternatively, if you decide to keep the current shape of the fix, the code can be moved closer to the use site as a helper function.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21148#discussion_r1783559452
More information about the hotspot-compiler-dev
mailing list