RFR: 8254354: Add an asExact() VarHandle combinator [v2]
Jorn Vernee
jvernee at openjdk.java.net
Tue Oct 27 15:04:20 UTC 2020
On Mon, 26 Oct 2020 18:54:45 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
>> Paul,
>> an invoker has the MethodHandle (resp. VarHandle) as first argument so it's not the same semantics.
>
> I've updated the implementation of accessModeType to work with the ordinal directly. Note that it was using the AccessType ordinal though, so I also had to change the parameter type of accessModeTypeUncached, and the respective implementations, to use AccessType directly (luckily this was possible, since the current implementations all just used the AccessType).
I think `asInvoker` and `asExactInvoker` make sense if you think of a VarHandle as an invoker of MethodHandles (though this is more of an implementation detail). But, I feel like the name `asInvoker` isn't obvious enough for what it does. i.e. it's not that obvious from the name that this removes the exactness.
If `asGeneric` is problematic, maybe just `asNonExact` works?
-------------
PR: https://git.openjdk.java.net/jdk/pull/843
More information about the core-libs-dev
mailing list