RFR: 8296470: Refactor VMError::report STEP macro to improve readability

Thomas Stuefe stuefe at openjdk.org
Thu Nov 10 14:44:10 UTC 2022


On Mon, 7 Nov 2022 13:25:53 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

One thing that worries me a bit is that our test coverage is not that great. We have jtreg/runtime/Errorhandling, but that is not much. In particular we miss good tests for robustness (e.g. that alert us if more STEPs start failing, that reporting can cope with a partially corrupted JVM context, or an invalid Thread::current, or pre-init, or if we have very little stack or C-Heap left)...

Unfortunately, tests like these tend to be annoyingly hard to get right. At SAP, we have more tests, but never really managed to get them completely clean.

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

PR: https://git.openjdk.org/jdk/pull/11018


More information about the hotspot-dev mailing list