comparison graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/JavaTypeProfile.java @ 21557:31fc2fce38f3

Merge.
author Doug Simon <doug.simon@oracle.com>
date Wed, 27 May 2015 13:32:18 +0200
parents graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaTypeProfile.java@ce585b0ac3e2 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaTypeProfile.java@48c1ebd24120
children
comparison
equal deleted inserted replaced
21556:48c1ebd24120 21557:31fc2fce38f3
172 ProfiledType ptype = getTypes()[j]; 172 ProfiledType ptype = getTypes()[j];
173 buf.append(String.format("%.6f:%s", ptype.getProbability(), ptype.getType())); 173 buf.append(String.format("%.6f:%s", ptype.getProbability(), ptype.getType()));
174 } 174 }
175 return buf.append(String.format("], notRecorded:%.6f>", getNotRecordedProbability())).toString(); 175 return buf.append(String.format("], notRecorded:%.6f>", getNotRecordedProbability())).toString();
176 } 176 }
177
178 /**
179 * Returns {@code true} if all types seen at this location have been recorded in the profile.
180 */
181 public boolean allTypesRecorded() {
182 return this.getNotRecordedProbability() == 0.0;
183 }
184
185 /**
186 * Returns the single monormorphic type representing this profile or {@code null} if no such
187 * type exists.
188 */
189 public ResolvedJavaType asSingleType() {
190 if (allTypesRecorded() && this.getTypes().length == 1) {
191 return getTypes()[0].getType();
192 }
193 return null;
194 }
177 } 195 }