RFR: 8349479: C2: when a Type node becomes dead, make CFG path that uses it unreachable [v7]

Christian Hagedorn chagedorn at openjdk.org
Tue Apr 1 08:53:32 UTC 2025


On Tue, 1 Apr 2025 08:03:51 GMT, Roland Westrelin <roland at openjdk.org> wrote:

>> src/hotspot/share/opto/node.cpp line 3096:
>> 
>>> 3094: // paths. The dead paths are then replaced by a Halt node.
>>> 3095: void TypeNode::make_paths_from_here_dead(PhaseIterGVN* igvn, PhaseIdealLoop* loop, const char* phase_str) {
>>> 3096:   Unique_Node_List wq;
>> 
>> Should there be a `ResourceMark` here?
>
> The callers have the `ResourceMark`. This is because it's code I extracted from 8275202: I think it used to not be safe to call `PhaseIdealLoop::register_new_node` from within the `ResourceMark` but I see there were changes in that area (data structures used by `PhaseIdealLoop` no longer allocated in the resource area). So it looks like it could be changed now.

I assume that JDK-8275202 also calls this method with a non-null `PhaseIdealLoop` pointer? Now we only pass in null, so the `loop` parameter could be removed.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/23468#discussion_r2022418989


More information about the hotspot-compiler-dev mailing list