RFR: 8265135: Reduce work initializing VarForms
Claes Redestad
redestad at openjdk.java.net
Wed Apr 14 00:37:56 UTC 2021
On Tue, 13 Apr 2021 23:09:12 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:
>> This patch reduces work done initializing VarForms - mostly observed when loading each VarHandle implementation class.
>>
>> - Lazily resolve MemberNames.
>> - Streamline MethodType creation. This reduces the number of MethodTypes created.
>>
>> Net effect is a reduction in bytecode executed per VH class by 50-60%.
>
> src/java.base/share/classes/java/lang/invoke/VarForm.java line 130:
>
>> 128: } catch (NoSuchMethodException | IllegalAccessException e) {
>> 129: throw new UnsupportedOperationException();
>> 130: }
>
> Suggestion:
>
> } catch (ReflectiveOperationException e) {
> throw newInternalError("Failed resolving VarHandle member name", ex);
> }
Thanks for reviewing!
Is there's a way to provoke this exception through the public API? If not then the suggested behavior change seems reasonable.
-------------
PR: https://git.openjdk.java.net/jdk/pull/3472
More information about the core-libs-dev
mailing list