Commit ff28f851 authored by Narayan Kamath's avatar Narayan Kamath
Browse files

MethodHandles: Implement MethodHandle.asType.

MethodHandles that are derived from asType calls declare a "nominal"
type in addition to their "actual" type, the latter being the type of
the target method being invoked in the case of non-transforming method
handles.

The runtime will need to check the callsite type against the "nominal"
type in order to check for exactness in the sense of throwing a WMTE
when there's no exact match, but will have to use the "actual" type in
order to build stack frames or perform argument conversions.

One minor drawback this change introduces is that it forces all method
handle subclasses to be cloneable in order to be used with asType. This
shouldn't be an issue in practice, given that we control this class
hierarchy.

Test: make test-art-host
Bug : 30550796

Change-Id: I350a48a8cf70e2789c1c1d121f97c301d0640e54
parent 6e53e657
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment