[9] RFR (M): 8037209: Improvements and cleanups to bytecode assembly for lambda forms

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Tue Apr 1 16:21:10 UTC 2014



Best regards,
Vladimir Ivanov

On 4/1/14 7:29 PM, Paul Sandoz wrote:
>
> On Apr 1, 2014, at 4:10 PM, Vladimir Ivanov <vladimir.x.ivanov at oracle.com> wrote:
>
>> Paul,
>>
>> Unfortunately, additional profiling doesn't work for Accessor.checkCast case. The problem is Accessor.checkCast is called from multiple places, so type profile is very likely to be polluted. And it kills the benefits.
>>
>
> So is there any point in doing such a cast in this case?
>
> The type performing the cast is the field type declared as a parameter in the MethodType of the MethodHandle and also held by the Accessor.
>
> IIUC the Invokers.checkExactType should ensure no "unsavoury" instances of the wrong type gets through? (the holder instance is only checked for null, via checkBase).
I don't see any point in doing profiling for this particular case. Such 
shape should be well optimized by JIT if it sees that an instance of 
Accessor is a constant. As I understand, it should be the case for most 
of the usage scenarios.

Best regards,
Vladimir Ivanov

>
>
>> I don't think MethodType helps with profiling in any way. It represents type info which is necessary for correctness checks. Profiling collects more fine-grained information (e.g. exact types, values).
>>
>
> OK.
>
>
>> Regarding redundant null check, do you have a test case so I can play with it myself?
>>
>
> I will send something to you later today or tomorrow.
>
> Paul.
>



More information about the core-libs-dev mailing list