for pre-review (M): 6912064: type profiles need to be more thorough for dynamic language support
Vladimir.Kozlov at Sun.COM
Tue Jan 26 19:23:03 PST 2010
I see, I missed that for instanceof case you just compare object's klass
with profiled klass and don't check that it is subtype of require_klass
(which is NULL for this case). Fine.
John Rose wrote:
> On Jan 26, 2010, at 6:59 PM, Vladimir Kozlov wrote:
>> Then why you generate the klass check with uncommon trap for instanceof
>> for cases when profiling shows that it will fail?
> For code like this:
> if (x instanceof String)
> doString((String) x);
> else if (x instanceof Number)
> doNumber((Number) x);
> If the 'x' is always an Integer, I want to fold all the tests up from the first instanceof, not the second.
> The profile will show when 'x' is of a monomorphic type. That is more interesting than whether the first check happens to go true or false.
> -- John
More information about the hotspot-compiler-dev