// Translate a bci to its corresponding data index (di). address methodDataOopDesc::bci_to_dp(int bci) { ResourceMark rm; ProfileData* data = data_before(bci); ProfileData* prev = NULL; for ( ; is_valid(data); data = next_data(data)) { if (data->bci() >= bci) { if (data->bci() == bci) set_hint_di(dp_to_di(data->dp())); else if (prev != NULL) set_hint_di(dp_to_di(prev->dp())); return data->dp(); } prev = data; } return (address)limit_data_position(); }
// Translate a bci to its corresponding data, or NULL. ciProfileData* ciMethodData::bci_to_data(int bci, ciMethod* m) { // If m is not NULL we look for a SpeculativeTrapData entry if (m == NULL) { ciProfileData* data = data_before(bci); for ( ; is_valid(data); data = next_data(data)) { if (data->bci() == bci) { set_hint_di(dp_to_di(data->dp())); return data; } else if (data->bci() > bci) { break; } } } bool two_free_slots = false; ciProfileData* result = bci_to_extra_data(bci, m, two_free_slots); if (result != NULL) { return result; } if (m != NULL && !two_free_slots) { // We were looking for a SpeculativeTrapData entry we didn't // find. Room is not available for more SpeculativeTrapData // entries, look in the non SpeculativeTrapData entries. return bci_to_data(bci, NULL); } return NULL; }
// Translate a bci to its corresponding data, or NULL. ciProfileData* ciMethodData::bci_to_data(int bci) { ciProfileData* data = data_before(bci); for ( ; is_valid(data); data = next_data(data)) { if (data->bci() == bci) { set_hint_di(dp_to_di(data->dp())); return data; } else if (data->bci() > bci) { break; } } // bci_to_extra_data(bci) ... DataLayout* dp = data_layout_at(data_size()); DataLayout* end = data_layout_at(data_size() + extra_data_size()); for (; dp < end; dp = methodDataOopDesc::next_extra(dp)) { if (dp->tag() == DataLayout::no_tag) { _saw_free_extra_data = true; // observed an empty slot (common case) return NULL; } if (dp->tag() == DataLayout::arg_info_data_tag) { break; // ArgInfoData is at the end of extra data section. } if (dp->bci() == bci) { assert(dp->tag() == DataLayout::bit_data_tag, "sane"); return new ciBitData(dp); } } return NULL; }
// Translate a bci to its corresponding data, or NULL. ProfileData* methodDataOopDesc::bci_to_data(int bci) { ProfileData* data = data_before(bci); for ( ; is_valid(data); data = next_data(data)) { if (data->bci() == bci) { set_hint_di(dp_to_di(data->dp())); return data; } else if (data->bci() > bci) { break; } } return bci_to_extra_data(bci, false); }