Mercurial > hg > graal-jvmci-8
diff c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotTypeUnresolved.java @ 1480:2fe369533fed
Additional debug output.
author | Thomas Wuerthinger <wuerthinger@ssw.jku.at> |
---|---|
date | Sat, 27 Nov 2010 16:43:53 +0100 |
parents | 71cd4b9610eb |
children | 79d04223b8a5 |
line wrap: on
line diff
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotTypeUnresolved.java Sat Nov 27 14:30:07 2010 +0100 +++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotTypeUnresolved.java Sat Nov 27 16:43:53 2010 +0100 @@ -38,8 +38,22 @@ * Creates a new unresolved type for a specified type descriptor. */ public HotSpotTypeUnresolved(String name, long accessingClassVmId) { + assert name.length() > 0 : "name cannot be empty"; + + int dimensions = 0; + // Decode name if necessary. + if (name.charAt(name.length() - 1) == ';') { + int startIndex = 0; + while (name.charAt(startIndex) == '[') { + startIndex++; + dimensions++; + } + assert name.charAt(startIndex) == 'L'; + name = name.substring(startIndex + 1, name.length() - 1); + } + this.name = name; - this.dimensions = 0; + this.dimensions = dimensions; this.accessingClassVmId = accessingClassVmId; } @@ -127,7 +141,7 @@ @Override public RiType componentType() { - assert dimensions > 0; + assert isArrayClass() : "no array class" + name(); return new HotSpotTypeUnresolved(name, dimensions - 1, accessingClassVmId); } @@ -177,7 +191,6 @@ @Override public CiKind getRepresentationKind(RiType.Representation r) { - // TODO: Check if this is correct. return CiKind.Object; }