RFR: 8350864: C2: verify structural invariants of the Ideal graph [v5]
Marc Chevalier
mchevalier at openjdk.org
Tue Sep 9 09:55:05 UTC 2025
On Mon, 8 Sep 2025 14:58:33 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> Marc Chevalier has updated the pull request incrementally with one additional commit since the last revision:
>>
>> One more ResourceMark
>
> src/hotspot/share/opto/compile.cpp line 702:
>
>> 700: ,
>> 701: _in_dump_cnt(0),
>> 702: _invariant_checker(GraphInvariantChecker::make_default())
>
> How does this interface with `ResouceMarks`?
> Because it is now resource allocated. And so is the `_checks`.
> How does this not trip the nesting asserts of allocation there?
> I'm probably missing something here.
>
> I would have expected that we need to allocate it from the `_comp_arena`.
I guess I can put it in the comp arena if it's better, but I don't see why there would be a problem. These things are under the ResourceMark in the block where the `Compile` object is created (in `C2Compiler::compile_method`), and deleted at the end of that. In between, all the other structures used by the invariant checkers have been created in nested ResourceMarks, and freed before the surrounding one is deleted. Nesting seems indeed respected.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26362#discussion_r2332826049
More information about the hotspot-compiler-dev
mailing list