Mercurial > hg > graal-compiler
changeset 5135:4bcd22f088b2
Use CiKind.ordinal() as it directly reflects HotSpot's basic type value.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Wed, 21 Mar 2012 12:12:22 +0100 |
parents | 4eb9895d9afe |
children | 8f4f0ebffca2 |
files | graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java |
diffstat | 1 files changed, 1 insertions(+), 25 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java Wed Mar 21 12:07:41 2012 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java Wed Mar 21 12:12:22 2012 +0100 @@ -113,30 +113,6 @@ } public int getArrayOffset(CiKind kind) { - return arrayOffsets[getKindNumber(kind)]; - } - - private static int getKindNumber(CiKind kind) { - if (kind == CiKind.Boolean) { - return 0; - } else if (kind == CiKind.Byte) { - return 1; - } else if (kind == CiKind.Short) { - return 2; - } else if (kind == CiKind.Char) { - return 3; - } else if (kind == CiKind.Int) { - return 4; - } else if (kind == CiKind.Float) { - return 5; - } else if (kind == CiKind.Long) { - return 6; - } else if (kind == CiKind.Double) { - return 7; - } else if (kind == CiKind.Object) { - return 8; - } else { - throw new RuntimeException(kind + " is not a Java kind"); - } + return arrayOffsets[kind.ordinal()]; } }