RFR: 8336103: Sharper checks for <init> and <clinit> initializers [v3]

Aleksey Shipilev shade at openjdk.org
Fri Jul 12 09:17:22 UTC 2024


> All around Hotspot, we have calls to `method->is_initializer()`. That methods test for both instance and static initializers. In many cases, the uses imply we actually want to test for constructor (instance initializer), not static initializer. Sometimes we filter explicitly for `!m->is_static()`, sometimes we don't. Often we get lucky by never being exposed to static initializers on particular paths.
> 
> I would like to sharpen this. I went back and forth, and ultimately decided to remove `is_initializer` completely to avoid future confusion, and rewrite the uses appropriately.
> 
> Additional testing:
>  - [x] Linux AArch64 server fastdebug, `all` (includes Fuzzer and CTW tests)

Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:

  Touch up assert messages

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/20120/files
  - new: https://git.openjdk.org/jdk/pull/20120/files/c5da5ebd..a18f7a46

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

  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/20120.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20120/head:pull/20120

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


More information about the graal-dev mailing list