RFR: 8302124: HotSpot Style Guide should permit noreturn attribute [v2]

Kim Barrett kbarrett at openjdk.org
Tue Feb 28 02:03:38 UTC 2023


> Please review this change to permit the use of noreturn attributes in HotSpot
> code.
> 
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf
> https://en.cppreference.com/w/cpp/language/attributes/noreturn
> 
> This will permit such changes as marking failed assertions and the like as
> noreturn, permitting the compiler to generate better code in some cases.  This
> has benefits even in product builds, since some of the relevant checks occur
> in product code (such as `guarantee`, `fatal`, &etc).  It also provides a
> solution to the problem described in JDK-8294031, where the potential
> continued execution from a failed assertion leads to compiler warnings.
> 
> The change is written in such a way that it should be easy to add the
> appropriate text for new attributes in the future.  There have been
> discussions of adopting C++17, which adds several attributes.
> 
> The change to the Style Guide is forward looking, toward a time when more
> attributes are available due to the adoption of a newer language standard than
> the current C++14.  It is written in such a way that it should be easy to add
> the appropriate text for new attributes.
> 
> Testing:
> I have a prototype of making HotSpot assertions noreturn, which has been run
> through mach5 tier1-8 for all Oracle-supported platforms.
> 
> This is a modification of the Style Guide, so rough consensus among the
> HotSpot Group members is required to make this change. Only Group members
> should vote for approval (via the github PR), though reasoned objections or
> comments from anyone will be considered. A decision on this proposal will not
> be made before Friday 24-Feb-2023 at 12h00 UTC.
> 
> Since we're piggybacking on github PRs here, please use the PR review process
> to approve (click on Review Changes > Approve), rather than sending a "vote:
> yes" email reply that would be normal for a CFV.

Kim Barrett has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:

 - Merge branch 'master' into style-guide-noreturn
 - style guide permits noreturn attributes

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/12507/files
  - new: https://git.openjdk.org/jdk/pull/12507/files/421a1681..37b2bccb

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=12507&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=12507&range=00-01

  Stats: 59158 lines in 1499 files changed: 24690 ins; 17229 del; 17239 mod
  Patch: https://git.openjdk.org/jdk/pull/12507.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/12507/head:pull/12507

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


More information about the hotspot-dev mailing list