RFR: 8349122: -XX:+AOTClassLinking is not compatible with jdwp
John R Rose
jrose at openjdk.org
Fri Jan 31 02:42:15 UTC 2025
On Fri, 31 Jan 2025 01:33:21 GMT, Ioi Lam <iklam at openjdk.org> wrote:
> If an AOT cache was created with -XX:+AOTClassLinking, do not load it when `-agent:jdwp....` is detected from the command-line
>
> Justification:
> Since AOT cache is an optimization feature, it's OK to disable this optimization when jdwp is required.
>
> Validation:
> This fix is validated by running JCK jdwp tests in AOT mode
Another 3-line fix, recognizing yet another corner case in which the AOT cache is not appropriate. The fix is not novel; it parallels the same logic for other corner cases.
There is a bit of work detecting the presence of a JDWP option in the arguments, but this uses no new logic, other than a boolean which transmits the result to fileMap where we need to look at it. Of course, that recognition logic might be defective in some way (I imagine it is not exercised much) but it is plenty good enough to get our integration tests to pass.
Maybe we can support JDWP more fully along with the AOT cache, but the JEP clearly calls out debugging functionality (JVMTI in JPDA) as an area where we must make exclusions, even if it does not call out JDWP by name.
Reviewed, with some additional suggestions. (Take them or leave them.)
Fix the whitespace, of course.
The Arguments API does not have methods that use the term "is_specified", but rather "has_".
Suggest the method name `has_jdwp_agent` which is consistent with `has_jimage`.
-------------
Marked as reviewed by jrose (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/23378#pullrequestreview-2585550494
More information about the hotspot-runtime-dev
mailing list