Mercurial > hg > graal-compiler
diff c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMExitsNative.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 | b7fb5f1e0747 |
children | 00bc9eaf0e24 |
line wrap: on
line diff
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMExitsNative.java Mon Dec 27 20:35:47 2010 +0100 +++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMExitsNative.java Tue Dec 28 18:33:26 2010 +0100 @@ -182,6 +182,10 @@ @Override public RiField createRiField(RiType holder, String name, RiType type, int offset) { + if (offset != -1) { + HotSpotTypeResolved resolved = (HotSpotTypeResolved) holder; + return resolved.createRiField(name, type, offset); + } return new HotSpotField(holder, name, type, offset); } @@ -192,44 +196,33 @@ @Override public RiType createRiTypePrimitive(int basicType) { - CiKind kind = null; switch (basicType) { case 4: - kind = CiKind.Boolean; - break; + return HotSpotTypePrimitive.Boolean; case 5: - kind = CiKind.Char; - break; + return HotSpotTypePrimitive.Char; case 6: - kind = CiKind.Float; - break; + return HotSpotTypePrimitive.Float; case 7: - kind = CiKind.Double; - break; + return HotSpotTypePrimitive.Double; case 8: - kind = CiKind.Byte; - break; + return HotSpotTypePrimitive.Byte; case 9: - kind = CiKind.Short; - break; + return HotSpotTypePrimitive.Short; case 10: - kind = CiKind.Int; - break; + return HotSpotTypePrimitive.Int; case 11: - kind = CiKind.Long; - break; + return HotSpotTypePrimitive.Long; case 14: - kind = CiKind.Void; - break; + return HotSpotTypePrimitive.Void; default: throw new IllegalArgumentException("Unknown basic type: " + basicType); } - return new HotSpotTypePrimitive(kind); } @Override - public RiType createRiTypeUnresolved(String name, long accessingClassVmId) { - return new HotSpotTypeUnresolved(name, accessingClassVmId); + public RiType createRiTypeUnresolved(String name) { + return new HotSpotTypeUnresolved(name); } @Override