RFR: 8071368 Use more concrete types for NamedFunction constants in the code
Vladimir Ivanov
vladimir.x.ivanov at oracle.com
Fri Feb 5 15:48:55 UTC 2016
Proposed fix looks good.
Quoting John: "The use of erased types (any ref => Object) in the MH
runtime is an artifact of bootstrapping difficulties, early in the
project. I hope it is not necessary any more."
Best regards,
Vladimir Ivanov
On 2/5/16 4:29 PM, Paul Sandoz wrote:
> Hi Shilpi,
>
> In principle this change is ok, however these methods are kind of special because they are called by code generated from LambdaForms with erased types.
>
> IIUC the casts can serve as belts-and-braces checks just in case that generated code passes something that is not of the correct type. By removing the casts it’s possible to erroneously pass in something of another type that the runtime treats erroneously as if a MethodHandle or MethodType, and then strange things happen. The casts will ordinary be removed by the runtime compiler. By removing them from the Java code it might slightly improve C2 compilation time.
>
> Approval from Vladimir/John would be good.
>
> Paul.
>
>> On 4 Feb 2016, at 13:16, shilpi rastogi <shilpi.rastogi at oracle.com> wrote:
>>
>> Hi All,
>>
>> Please review the following-
>>
>> https://bugs.openjdk.java.net/browse/JDK-8071368
>> http://cr.openjdk.java.net/~srastogi/8071368/webrev.02/
>>
>> Thanks,
>> Shilpi
>
More information about the core-libs-dev
mailing list