RFR: 8336468: Reflection and MethodHandles should use more precise initializer checks [v5]

Aleksey Shipilev shade at openjdk.org
Wed Sep 25 15:53:19 UTC 2024


> This PR should cover the Reflection/MethodHandles part of [JDK-8336103](https://bugs.openjdk.org/browse/JDK-8336103).
>  
> There are places where we change the behavior: `clinit` would now be recorded as "method", instead of "constructor". Tracing back the uses of `get_flags`: it is used for initializing `java.lang.ClassFrameInfo.flags`. There seem to be no readers for this field in VM. Java side for `j.l.CFI` does not seem to check any method/constructor flags. So I would say this change in behavior is not really visible, and there is no need to try and keep the old (odd) behavior.
> 
> I also inlined the `select_method` definition, which allows for a bit more straight-forward local code, and obviates the need for wrapping things with `methodHandle`.
> 
> @mlchung, you probably want to look at this more closely.
> 
> Additional testing:
>  - [x] Linux x86_64 server fastdebug, `tier1`
>  - [x] Linux x86_64 server fastdebug, `all`

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

  Replace assert with a comment

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/20192/files
  - new: https://git.openjdk.org/jdk/pull/20192/files/95b1091b..d58d7eff

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=20192&range=04
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20192&range=03-04

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

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


More information about the hotspot-dev mailing list