Mercurial > hg > graal-compiler
comparison c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotTypePrimitive.java @ 1941:79d04223b8a5
Added caching for resolved types and resolved fields.
This is crucial, because the local load elimination will lead to wrong results, if field equality (of two RiField objects with the same object and the same RiType) is not given. The caching makes sure that the default equals implementation is sufficient.
author | Thomas Wuerthinger <wuerthinger@ssw.jku.at> |
---|---|
date | Tue, 28 Dec 2010 18:33:26 +0100 |
parents | 71cd4b9610eb |
children | 177398c6147d |
comparison
equal
deleted
inserted
replaced
1940:e92a9a73324e | 1941:79d04223b8a5 |
---|---|
26 /** | 26 /** |
27 * Implementation of RiType for primitive HotSpot types. | 27 * Implementation of RiType for primitive HotSpot types. |
28 * | 28 * |
29 * @author Thomas Wuerthinger, Lukas Stadler | 29 * @author Thomas Wuerthinger, Lukas Stadler |
30 */ | 30 */ |
31 public class HotSpotTypePrimitive implements HotSpotType { | 31 public final class HotSpotTypePrimitive implements HotSpotType { |
32 | 32 |
33 private CiKind kind; | 33 private CiKind kind; |
34 | 34 |
35 public HotSpotTypePrimitive(CiKind kind) { | 35 public static final HotSpotTypePrimitive Boolean = new HotSpotTypePrimitive(CiKind.Boolean); |
36 public static final HotSpotTypePrimitive Char = new HotSpotTypePrimitive(CiKind.Char); | |
37 public static final HotSpotTypePrimitive Float = new HotSpotTypePrimitive(CiKind.Float); | |
38 public static final HotSpotTypePrimitive Double = new HotSpotTypePrimitive(CiKind.Double); | |
39 public static final HotSpotTypePrimitive Byte = new HotSpotTypePrimitive(CiKind.Byte); | |
40 public static final HotSpotTypePrimitive Short = new HotSpotTypePrimitive(CiKind.Short); | |
41 public static final HotSpotTypePrimitive Int = new HotSpotTypePrimitive(CiKind.Int); | |
42 public static final HotSpotTypePrimitive Long = new HotSpotTypePrimitive(CiKind.Long); | |
43 public static final HotSpotTypePrimitive Void = new HotSpotTypePrimitive(CiKind.Void); | |
44 | |
45 private HotSpotTypePrimitive(CiKind kind) { | |
36 this.kind = kind; | 46 this.kind = kind; |
37 } | 47 } |
38 | 48 |
39 @Override | 49 @Override |
40 public int accessFlags() { | 50 public int accessFlags() { |