RFR: 8281548: Add escape analysis tracing flag [v4]
Jorn Vernee
jvernee at openjdk.java.net
Tue Feb 15 21:23:10 UTC 2022
On Tue, 15 Feb 2022 20:48:33 GMT, Xin Liu <xliu at openjdk.org> wrote:
>> Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Review comments
>
> src/hotspot/share/opto/escape.cpp line 882:
>
>> 880: PointsToNode* ptn = ptnode_adr(val->_idx);
>> 881: assert(ptn != NULL, "node should be registered");
>> 882: set_escape_state(ptn, PointsToNode::GlobalEscape NOT_PRODUCT(COMMA "stored at raw address"));
>
> In a nutshell, this PR annotates a node why it escapes or is NSR. I believe the code would be much cleaner if you just add a field of "reason" to `PointsToNode`. One field is enough because scalar replacement candidates is subset of NoEscape Java nodes. There's no overlap between escape reason and NSR reason. extra bonus is that we can access the reason field in debugger later on.
I can get the debugger argument, but I'm not sure how doing this would make the code cleaner...
Instead of printing out the reason message directly in set_(fields_)escape_state/set_not_scalar_replaceable we would set it in `PointsToNode.reason`, and then afterwards walk the graph to print out all messages?
One potential problem with that approach is that if a node is first updated to ArgEscape, and then later to GlobalEscape, the first state transition would not be visible. (i.e. the PR is not just annotating nodes, it's annotating state transitions, and there can be multiple state transitions per node)
-------------
PR: https://git.openjdk.java.net/jdk/pull/7428
More information about the hotspot-compiler-dev
mailing list