RFR: 8296470: Refactor VMError::report STEP macro to improve readability [v2]
Thomas Stuefe
stuefe at openjdk.org
Thu Nov 17 13:30:57 UTC 2022
On Thu, 17 Nov 2022 10:29:34 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:
>> Refactor the STEP macro in VMError::report to improve readability.
>> Right now the macro contains multiple statements on one line and the non-conventional control flow is even harder to understand.
>>
>> This enhancement aims to do two things:
>> 1. It splits the macro into multiple lines with indentations which makes the structure of the C++ code generated by the preprocessor clearer.
>> 2. Separates the internal step logic from the decision logic which decides if a step should be taken with a STEP_IF(step_name_str, condition) macro
>>
>> Testing: tier 1 + GHA
>
> Axel Boldt-Christmas has updated the pull request incrementally with three additional commits since the last revision:
>
> - Follow HotSpot code style: no implicit boolean
> - Respect 100 character line
> - Revert extended test
Ok!
src/hotspot/share/utilities/vmError.cpp line 545:
> 543: _step_did_timeout = false; \
> 544: if ((cond)) {
> 545: // [Step logic]
nit: newline please?
src/hotspot/share/utilities/vmError.cpp line 546:
> 544: if ((cond)) {
> 545: // [Step logic]
> 546: # define STEP(s) STEP_IF(s, true)
nit: newline please?
-------------
Marked as reviewed by stuefe (Reviewer).
PR: https://git.openjdk.org/jdk/pull/11018
More information about the hotspot-dev
mailing list