for pre-review (M): 6912064: type profiles need to be more thorough for dynamic language support

John Rose John.Rose at Sun.COM
Tue Jan 26 19:14:13 PST 2010


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