RFR: 8284579: Improve VarHandle checks for interpreter [v2]

Claes Redestad redestad at openjdk.java.net
Mon Apr 11 09:56:32 UTC 2022


On Mon, 11 Apr 2022 09:26:12 GMT, ExE Boss <duke at openjdk.java.net> wrote:

>> Claes Redestad has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Simplified as suggested by @ExE-Boss
>
> src/java.base/share/classes/java/lang/invoke/VarHandle.java line 2075:
> 
>> 2073: 
>> 2074:     @DontInline
>> 2075:     final void throwWrongMethodTypeException(VarHandle.AccessDescriptor ad) {
> 
> This can actually be `private` and `static`:
> Suggestion:
> 
>     private static final void throwWrongMethodTypeException(VarHandle.AccessDescriptor ad) {

`private` yes. `static` would require to pass the `MethodType` and since this is an exceptional slow-path it doesn't make sense to keep the complexity contained inside the `throw...` method.

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

PR: https://git.openjdk.java.net/jdk/pull/8160


More information about the core-libs-dev mailing list