RFR: 8367689: Revert removal of several compilation-related vmStructs fields [v2]
Coleen Phillimore
coleenp at openjdk.org
Tue Sep 16 22:25:10 UTC 2025
On Tue, 16 Sep 2025 22:22:13 GMT, Francesco Andreuzzi <fandreuzzi at openjdk.org> wrote:
>> #23782 ([JDK-8315488](https://bugs.openjdk.org/browse/JDK-8315488)) removed several vmStructs fields. A small subset was used in Async-Profiler:
>>
>> CiEnv* _env
>> CompileTask* _task
>> ciMethod* _method
>>
>>
>> I propose a small patch to bring them back. It helps third-party tools in building useful features on the JDK. For example, Async-Profiler uses these fields to display the current method being compiled in a compiler thread.
>
> Francesco Andreuzzi has updated the pull request incrementally with six additional commits since the last revision:
>
> - note
> - nn
> - nn
> - cc
> - nn
> - nn
Changes requested by coleenp (Reviewer).
src/hotspot/share/runtime/vmStructs.cpp line 677:
> 675: nonstatic_field(CompilerThread, _env, ciEnv*) \
> 676: nonstatic_field(ciEnv, _task, CompileTask*) \
> 677: c2_nonstatic_field(Compile, _method, ciMethod*) \
It would be really easy for someone to notice that these aren't used and delete them again, and it's unfortunate that this macro has to be propagated throughout all the vmStructs macros. I can see some external tool needing CompilerThread env and ciEnv task (the current compile task) but maybe this can not need Compile::_method?
Instead of adding the c2 macros, can you change the code to have:
COMPILER2_PRESENT(nontstatic_field(Compile, _method, ciMethod*))
COMPILER2_PRESENT(declare_toplevel_type(Compile))
etc.
-------------
PR Review: https://git.openjdk.org/jdk/pull/27318#pullrequestreview-3231331939
PR Review Comment: https://git.openjdk.org/jdk/pull/27318#discussion_r2353411773
More information about the graal-dev
mailing list