< prev index next >
src/hotspot/share/compiler/oopMap.cpp
Print this page
rev 54883 : 8213084: Rework and enhance Print[Opto]Assembly output
Reviewed-by:
*** 512,522 ****
void OopMapValue::print() const { print_on(tty); }
void ImmutableOopMap::print_on(outputStream* st) const {
OopMapValue omv;
! st->print("ImmutableOopMap{");
for(OopMapStream oms(this); !oms.is_done(); oms.next()) {
omv = oms.current();
omv.print_on(st);
}
st->print("}");
--- 512,522 ----
void OopMapValue::print() const { print_on(tty); }
void ImmutableOopMap::print_on(outputStream* st) const {
OopMapValue omv;
! st->print("ImmutableOopMap {");
for(OopMapStream oms(this); !oms.is_done(); oms.next()) {
omv = oms.current();
omv.print_on(st);
}
st->print("}");
*** 524,571 ****
void ImmutableOopMap::print() const { print_on(tty); }
void OopMap::print_on(outputStream* st) const {
OopMapValue omv;
! st->print("OopMap{");
for(OopMapStream oms((OopMap*)this); !oms.is_done(); oms.next()) {
omv = oms.current();
omv.print_on(st);
}
! st->print("off=%d}", (int) offset());
}
void OopMap::print() const { print_on(tty); }
void ImmutableOopMapSet::print_on(outputStream* st) const {
const ImmutableOopMap* last = NULL;
! for (int i = 0; i < _count; ++i) {
const ImmutableOopMapPair* pair = pair_at(i);
const ImmutableOopMap* map = pair->get_from(this);
if (map != last) {
st->cr();
map->print_on(st);
! st->print("pc offsets: ");
}
last = map;
st->print("%d ", pair->pc_offset());
}
}
void ImmutableOopMapSet::print() const { print_on(tty); }
void OopMapSet::print_on(outputStream* st) const {
! int i, len = om_count();
! st->print_cr("OopMapSet contains %d OopMaps\n",len);
! for( i = 0; i < len; i++) {
OopMap* m = at(i);
st->print_cr("#%d ",i);
m->print_on(st);
st->cr();
}
}
void OopMapSet::print() const { print_on(tty); }
bool OopMap::equals(const OopMap* other) const {
--- 524,578 ----
void ImmutableOopMap::print() const { print_on(tty); }
void OopMap::print_on(outputStream* st) const {
OopMapValue omv;
! st->print("OopMap {");
for(OopMapStream oms((OopMap*)this); !oms.is_done(); oms.next()) {
omv = oms.current();
omv.print_on(st);
}
! // Print hex offset in addition.
! st->print("off=%d/0x%x}", (int) offset(), (int) offset());
}
void OopMap::print() const { print_on(tty); }
void ImmutableOopMapSet::print_on(outputStream* st) const {
const ImmutableOopMap* last = NULL;
! const int len = count();
!
! st->print_cr("ImmutableOopMapSet contains %d OopMaps", len);
!
! for (int i = 0; i < len; i++) {
const ImmutableOopMapPair* pair = pair_at(i);
const ImmutableOopMap* map = pair->get_from(this);
if (map != last) {
st->cr();
map->print_on(st);
! st->print(" pc offsets: ");
}
last = map;
st->print("%d ", pair->pc_offset());
}
+ st->cr();
}
void ImmutableOopMapSet::print() const { print_on(tty); }
void OopMapSet::print_on(outputStream* st) const {
! const int len = om_count();
! st->print_cr("OopMapSet contains %d OopMaps", len);
! for( int i = 0; i < len; i++) {
OopMap* m = at(i);
st->print_cr("#%d ",i);
m->print_on(st);
st->cr();
}
+ st->cr();
}
void OopMapSet::print() const { print_on(tty); }
bool OopMap::equals(const OopMap* other) const {
*** 581,599 ****
return true;
}
const ImmutableOopMap* ImmutableOopMapSet::find_map_at_offset(int pc_offset) const {
ImmutableOopMapPair* pairs = get_pairs();
! int i;
! for (i = 0; i < _count; ++i) {
if (pairs[i].pc_offset() >= pc_offset) {
break;
}
}
- ImmutableOopMapPair* last = &pairs[i];
assert(last->pc_offset() == pc_offset, "oopmap not found");
return last->get_from(this);
}
const ImmutableOopMap* ImmutableOopMapPair::get_from(const ImmutableOopMapSet* set) const {
--- 588,608 ----
return true;
}
const ImmutableOopMap* ImmutableOopMapSet::find_map_at_offset(int pc_offset) const {
ImmutableOopMapPair* pairs = get_pairs();
+ ImmutableOopMapPair* last = NULL;
! for (int i = 0; i < _count; ++i) {
if (pairs[i].pc_offset() >= pc_offset) {
+ last = &pairs[i];
break;
}
}
+ // Heal Coverity issue: potential index out of bounds access.
+ guarantee(last != NULL, "last may not be null");
assert(last->pc_offset() == pc_offset, "oopmap not found");
return last->get_from(this);
}
const ImmutableOopMap* ImmutableOopMapPair::get_from(const ImmutableOopMapSet* set) const {
< prev index next >