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

Paul Sandoz paul.sandoz at oracle.com
Tue Apr 1 15:29:31 UTC 2014


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 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