RFR: 8355481: Clean up MHN_copyOutBootstrapArguments [v2]
Johan Sjölen
jsjolen at openjdk.org
Fri May 9 07:46:52 UTC 2025
On Thu, 8 May 2025 19:08:26 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:
> > It looks like @PaulSandoz wrote this code and could help review your change. I wish -4 etc had some const names instead and both versions look the same to me.
>
> I was the one who committed this code, but i don't recall writing it, and was likely written by another contributor.
>
> This is arguably now dead code, likely written at the time for generality in the expectation it might be used but eventually was not. I don't see any calls to this method from Java that passes in a negative start argument. This method supports accessing the prefix of known bootstrap arguments (bsm, name, type) + size information for the additional arguments, but these arguments are already available in Java and passed in via up call linkage (see [MethodHandleNatives.linkDynamicConstant](https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java#L308)).
Do you think that the idea is that the ordinary arguments started at 0, and the static arguments referenced in the CP was accessed by going into negative indices?
Let's see if this is dead code, I'll get rid of it and see what happens in the CI. When I read the Java code, it wasn't entirely obvious that we never pass in negative args.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24825#issuecomment-2865504838
More information about the hotspot-dev
mailing list