Mercurial > hg > truffle
diff graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/SwitchNode.java @ 16672:f2cd7b3d5aef
unswitching: check full SwitchNode structure
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Fri, 01 Aug 2014 15:19:26 +0200 |
parents | c164a505fc23 |
children | 5d468add216f |
line wrap: on
line diff
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/SwitchNode.java Fri Jul 25 13:12:32 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/SwitchNode.java Fri Aug 01 15:19:26 2014 +0200 @@ -22,6 +22,8 @@ */ package com.oracle.graal.nodes.extended; +import java.util.*; + import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.type.*; @@ -103,6 +105,10 @@ */ public abstract Constant keyAt(int i); + public boolean structureEquals(SwitchNode switchNode) { + return Arrays.equals(keySuccessors, switchNode.keySuccessors) && equalKeys(switchNode); + } + /** * Returns true if the switch has the same keys in the same order as this switch. */