-
Enhancement
-
Resolution: Fixed
-
P4
-
9, 10, 11, 12, 13
-
b09
With https://bugs.openjdk.java.net/browse/JDK-8149591, the assert macro in debug.hpp was changed to include another condition:
@@ -119,11 +128,13 @@
#define vmassert(p, ...) \
do { \
if (!(p)) { \
+ if (is_executing_unit_tests()) { \
+ report_assert_msg(__VA_ARGS__); \
+ } \
report_vm_error(__FILE__, __LINE__, "assert(" #p ") failed", __VA_ARGS__); \
BREAKPOINT; \
} \
} while (0)
The point of this coding is to write a short one line blurb to stderr in case of an assert to help gtest death tests (tests expecting the VM to assert with a given message) to recognize the assertion. For details, please see TEST_VM_ASSERT_MSG macro in test/hotspot/gtest/unittest.hpp).
This does increase footprint of assert macros unnecessarily and should be done instead inside report_vm_error.
Doing it inside report_vm_error() reduces the assert macro size from 18 to 11 instructions (x64).
It also reduces size of the fastdebug libjvm.so by ~20Mb (394->375Mb) on linux x64.
@@ -119,11 +128,13 @@
#define vmassert(p, ...) \
do { \
if (!(p)) { \
+ if (is_executing_unit_tests()) { \
+ report_assert_msg(__VA_ARGS__); \
+ } \
report_vm_error(__FILE__, __LINE__, "assert(" #p ") failed", __VA_ARGS__); \
BREAKPOINT; \
} \
} while (0)
The point of this coding is to write a short one line blurb to stderr in case of an assert to help gtest death tests (tests expecting the VM to assert with a given message) to recognize the assertion. For details, please see TEST_VM_ASSERT_MSG macro in test/hotspot/gtest/unittest.hpp).
This does increase footprint of assert macros unnecessarily and should be done instead inside report_vm_error.
Doing it inside report_vm_error() reduces the assert macro size from 18 to 11 instructions (x64).
It also reduces size of the fastdebug libjvm.so by ~20Mb (394->375Mb) on linux x64.
- relates to
-
JDK-8149591 Prepare hotspot for GTest
-
- Resolved
-