Mercurial > hg > truffle
changeset 21305:951ecb5473c3
LIRKind: add verifyMoveKinds.
author | Josef Eisl <josef.eisl@jku.at> |
---|---|
date | Mon, 11 May 2015 14:36:16 +0200 |
parents | 90a951b20daf |
children | 335374eed0da |
files | graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/LIRKind.java |
diffstat | 1 files changed, 17 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/LIRKind.java Tue May 12 09:31:56 2015 +0200 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/LIRKind.java Mon May 11 14:36:16 2015 +0200 @@ -277,4 +277,21 @@ LIRKind other = (LIRKind) obj; return platformKind == other.platformKind && referenceMask == other.referenceMask; } + + public static boolean verifyMoveKinds(LIRKind dst, LIRKind src) { + if (src.equals(dst)) { + return true; + } + if (toStackKind(src.getPlatformKind()).equals(dst.getPlatformKind())) { + return !src.isDerivedReference() || dst.isDerivedReference(); + } + return false; + } + + private static PlatformKind toStackKind(PlatformKind platformKind) { + if (platformKind instanceof Kind) { + return ((Kind) platformKind).getStackKind(); + } + return platformKind; + } }