@Override public String toString() { StringBuilder sb = new StringBuilder(); String nl = String.format("%n"); String nlIndent = String.format("%n%38s", ""); if (hasNormalData()) { int pos = 0; HotSpotMethodDataAccessor data; while ((data = getNormalData(pos)) != null) { if (pos != 0) { sb.append(nl); } int bci = data.getBCI(this, pos); sb.append(String.format("%-6d bci: %-6d%-20s", pos, bci, data.getClass().getSimpleName())); sb.append(data.appendTo(new StringBuilder(), this, pos).toString().replace(nl, nlIndent)); pos = pos + data.getSize(this, pos); } } if (hasExtraData()) { int pos = getExtraDataBeginOffset(); HotSpotMethodDataAccessor data; while ((data = getExtraData(pos)) != null) { if (pos == getExtraDataBeginOffset()) { sb.append(nl).append("--- Extra data:"); } int bci = data.getBCI(this, pos); sb.append( String.format("%n%-6d bci: %-6d%-20s", pos, bci, data.getClass().getSimpleName())); sb.append(data.appendTo(new StringBuilder(), this, pos).toString().replace(nl, nlIndent)); pos = pos + data.getSize(this, pos); } } return sb.toString(); }
private HotSpotMethodDataAccessor getData(int position) { assert position >= 0 : "out of bounds"; final Tag tag = AbstractMethodData.readTag(this, position); HotSpotMethodDataAccessor accessor = PROFILE_DATA_ACCESSORS[tag.getValue()]; assert accessor == null || accessor.getTag() == tag : "wrong data accessor " + accessor + " for tag " + tag; return accessor; }