RFR: 8068396: Rename assert() to vmassert()

Kim Barrett kim.barrett at oracle.com
Wed Dec 31 00:47:18 UTC 2014

Please review this change to rename the assert macro to vmassert, as a
step toward eliminating the name clash between the VM's assert() macro
and the standard (<assert.h> / <cassert>) assert() macro.

[Coleen has volunteered sponsorship, since she's been prodding me to
make this change for months. Changes are based on jdk9/hs-rt repo.]



jprt. Also manually verified asserts occur as expected in fastdebug
build and not in release build.

Details of the changes are:

* Renamed the assert macro to vmassert. Also renamed the assert_status
macro to vmassert_status, for name consistency.

* Added temporary synonym macros of assert => vmassert and
assert_status => vmassert_status, for backward compatibility. This
change does not modify the (18K+) occurrences of the old macro names
to use the new names. The synonyms allow that renaming to occur
incrementally, with removal of the synonyms once renaming is complete.

* Simplified the definition of vmassert_status to just use vmassert,
rather than duplicating much of the implementation of vmassert. While
I was at it, added back a comma in the message that was (probably
accidentally) removed by 6888954: argument formatting for assert() and
friends (hg:1410 4/22/2010).

* Moved the assert_if_no_error macro to utilities/xmlstream.cpp, which
is the only place it is used. Also simplified the definition to just
use vmassert, rather than duplicating much of the implementation of

* Changed shark/llvmHeaders.hpp to just define assert as a synonym of
vmassert, rather than duplicating the definition of [vm]assert. [This
is an ugly hack, but still an improvement on what was there. This is a
place that could quickly benefit from updating uses.]

* Removed the non-product AssertRepeat option and the associated
support by the [vm]assert macro. Support for this option has been
broken since 6888954: argument formatting for assert() and friends
(hg:1410 4/22/2010), due to a missing line continuation in the
corresponding definition of the assert macro.  Since the feature
doesn't look very interesting, has been broken for nearly 5 years, and
can easily be resurrected if needed, I chose to simplify by removal.

More information about the hotspot-dev mailing list