for pre-review (M): 6912064: type profiles need to be more thorough for dynamic language support
Vladimir Kozlov
Vladimir.Kozlov at Sun.COM
Tue Jan 26 18:59:49 PST 2010
John Rose wrote:
> On Jan 26, 2010, at 3:44 PM, Vladimir Kozlov wrote:
>
>> Since I am looking on type profiling code (for bimorphic call fix)
>> I noticed that new code in gen_instanceof() does not check
>> for type check failures when the code in gen_checkcast() does:
>>
>> data->as_CounterData()->count() >= 0
>>
>> Was it intentional?
>
> Yes, otherwise I would have factored that check into maybe_cast_profiled_receiver.
>
> The type profile collected at an instanceof, checkcast, or aastore contains all operand klasses seen, not just those klasses which matched the query type.
Yes, all of them use InterpreterMacroAssembler::gen_subtype_check().
>
> Usually checkcast and aastore match the query type but instanceof often does not match it.
Then why you generate the klass check with uncommon trap for instanceof
for cases when profiling shows that it will fail?
>
> The check (data->as_CounterData()->count() >= 0) is questionable; I think it could be deleted, but I don't seen any reason to change it.
This check has good comment explaining that in normal case count() == 0
since it is not updated for type profiling. And it is < 0 when type check failed.
>
> Shall I put in a comment?
I think when you do type profiling for invokedynamic you should keep in mind this situation.
Vladimir
>
> -- John
More information about the hotspot-compiler-dev
mailing list