Mercurial > hg > truffle
diff c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotRuntime.java @ 2283:f21664b3dd1c
Keeping up-to-date with Maxine/CRI changes.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Mon, 11 Apr 2011 10:22:05 +0200 |
parents | 360497545e85 |
children | 6190d20bd6d6 |
line wrap: on
line diff
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotRuntime.java Mon Apr 04 21:02:45 2011 +0200 +++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotRuntime.java Mon Apr 11 10:22:05 2011 +0200 @@ -145,6 +145,23 @@ } @Override + public RiType getRiType(CiKind kind) { + return getRiType(kind.toJavaClass()); + } + + @Override + public RiType getRiType(CiConstant constant) { + Object o = constant.asObject(); + if (o == null) return null; + return getRiType(o.getClass()); + } + + @Override + public boolean isExceptionType(RiType type) { + return type.isSubtypeOf(getRiType(Throwable.class)); + } + + @Override public RiSnippets getSnippets() { throw new UnsupportedOperationException("getSnippets"); } @@ -206,8 +223,8 @@ } @Override - public boolean compareConstantObjects(Object x, Object y) { - return x == y; + public boolean compareConstantObjects(CiConstant x, CiConstant y) { + return x.asObject() == y.asObject(); } @Override @@ -227,4 +244,9 @@ public boolean supportsArrayIntrinsics() { return true; } + + @Override + public int getArrayLength(CiConstant array) { + return Array.getLength(array.asObject()); + } }