comparison graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiTypeProfile.java @ 4441:4e3aaf14cbc6

fixed graal to hotspot
author Christian Haeubl <christian.haeubl@oracle.com>
date Mon, 23 Jan 2012 13:22:43 -0800
parents aaac4894175c
children c0430421d43d
comparison
equal deleted inserted replaced
4440:271220b49abc 4441:4e3aaf14cbc6
27 /** 27 /**
28 * This profile object represents the type profile of one call site, cast or instanceof instruction. The precision of 28 * This profile object represents the type profile of one call site, cast or instanceof instruction. The precision of
29 * the supplied values may vary, but a runtime that provides this information should be aware that it will be used to 29 * the supplied values may vary, but a runtime that provides this information should be aware that it will be used to
30 * guide performance-critical decisions like speculative inlining, etc. 30 * guide performance-critical decisions like speculative inlining, etc.
31 */ 31 */
32 public class RiTypeProfile implements Serializable { 32 public final class RiTypeProfile implements Serializable {
33
34 /** 33 /**
35 * 34 *
36 */ 35 */
37 private static final long serialVersionUID = -6877016333706838441L; 36 private static final long serialVersionUID = -6877016333706838441L;
38 37
39 /** 38 private RiResolvedType[] types;
40 * How often the instruction was executed, which may be used to judge the maturity of this profile. 39 private double[] probabilities;
41 */ 40
42 public int count; 41 public RiTypeProfile(RiResolvedType[] types, double[] probabilites) {
42 this.types = types;
43 this.probabilities = probabilites;
44 }
43 45
44 /** 46 /**
45 * An estimation of how many different receiver types were encountered. This may or may not be the same as 47 * The estimated probabilities of the different receivers. This array needs to have the same length as
46 * probabilities.length/types.length, as the runtime may store probabilities for a limited number of receivers. 48 * {@link RiTypeProfile#types}.
47 */ 49 */
48 public int morphism; 50 public double[] getProbabilities() {
51 return probabilities;
52 }
49 53
50 /** 54 /**
51 * A list of receivers for which the runtime has recorded probability information. This array needs to have the same 55 * A list of receivers for which the runtime has recorded probability information. This array needs to have the same
52 * length as {@link RiTypeProfile#probabilities}. 56 * length as {@link RiTypeProfile#probabilities}.
53 */ 57 */
54 public RiResolvedType[] types; 58 public RiResolvedType[] getTypes() {
55 59 return types;
56 /** 60 }
57 * The estimated probabilities of the different receivers. This array needs to have the same length as
58 * {@link RiTypeProfile#types}.
59 */
60 public float[] probabilities;
61 } 61 }