Suspicious code in GraphKit::record_profiled_receiver_for_speculation

Tobias Hartmann tobias.hartmann at
Thu Jul 7 07:56:19 UTC 2016

On 07.07.2016 09:52, Roland Westrelin wrote:
>> Without being too familiar with that code, it seems to me that we may lose "not null" information now because we always assume that n may be NULL. So I think the assignment in the if should be fixed.
> How should it be fixed?

I thought we should fix it like this:

bool maybe_null = true;
if (java_bc() == Bytecodes::_checkcast ||
    java_bc() == Bytecodes::_instanceof ||
    java_bc() == Bytecodes::_aastore) {
   ciProfileData* data = method()->method_data()->bci_to_data(bci());
   maybe_null = data == NULL ? true : data->as_BitData()->null_seen();
return record_profile_for_speculation(n, exact_kls, maybe_null);

Because before JDK-8031755 we called record_profile_for_speculation() for all bytecodes not only checkcast, instanceof and aastore.

Best regards,

> Roland.

More information about the hotspot-compiler-dev mailing list