RFR: 8344014: Simplify TracePhase constructor
Thomas Stuefe
stuefe at openjdk.org
Wed Nov 13 12:32:39 UTC 2024
On Tue, 12 Nov 2024 20:55:51 GMT, Dean Long <dlong at openjdk.org> wrote:
>> As a prerequisite for [JDK-8344009](https://bugs.openjdk.org/browse/JDK-8344009), `TracePhase` constructor needs to know the PhaseTraceId. And while we are at it, it can be simplified: trace strings can be kept in via x-macro with the IDs, and it is sufficient to pass in the IDs, no need to pass the pointer to the counters since we use the same counters anyway.
>>
>> Since this is a somewhat invasive but purely mechanical change, I separate this work from [JDK-8344009](https://bugs.openjdk.org/browse/JDK-8344009).
>>
>> There are no functional changes. Trace texts have been faithfully taken over, even in the case where the original TracePhase constructor invocation got fed an empty string (`_t_vector` and `_t_renumberLive`) - whether this was intentional or not, this patch does not change it.
>>
>> The patch preserves the possibility to override the phase name with an explicit argument to the constructor. This is used in one existing case ("computeLive (sbplr)"), again, to faithfully preserve the log format.
>>
>> Test: I checked manually with +CITimeVerbose with and without patch and compared the output; output format is preserved.
>
> This looks OK, but doesn't seem strictly necessary for JDK-8344009. We could get the PhaseTraceId from `accumulator - &Phase::timers[0]`.
Thank you @dean-long and @rwestrel !
-------------
PR Comment: https://git.openjdk.org/jdk/pull/22029#issuecomment-2473476182
More information about the hotspot-compiler-dev
mailing list