Suspicious code in GraphKit::record_profiled_receiver_for_speculation

Radosław Smogura mail at
Wed Jul 6 21:14:42 UTC 2016

Hi all,

I have found following code, in JDK9 dev, which confused me a little bit:

Node* GraphKit::record_profiled_receiver_for_speculation(Node* n) {
  if (!UseTypeSpeculation) {
    return n;
  ciKlass* exact_kls = profile_has_unique_klass();
  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());
    bool maybe_null = data == NULL ? true : data->as_BitData()->null_seen();
  return record_profile_for_speculation(n, exact_kls, maybe_null);
  return n;

There are two subsequent returns and shadowing maybe_null. At a glance it looks like that closing bracket should be put one line down, between 
`return record_profile_for_speculation` and `return n`?

Kind regards,

More information about the hotspot-compiler-dev mailing list