# HG changeset patch # User Thomas Wuerthinger # Date 1424038391 -3600 # Node ID a306749d3e861767a630be2c0a97aeb207016d18 # Parent e6d78307bdc9cfcd23a8b4b24496ed0223a0dc65 Lookup Tag based on index in enum value array. diff -r e6d78307bdc9 -r a306749d3e86 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMethodDataAccessor.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMethodDataAccessor.java Sun Feb 15 22:38:29 2015 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMethodDataAccessor.java Sun Feb 15 23:13:11 2015 +0100 @@ -26,7 +26,6 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.api.meta.ProfilingInfo.TriState; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.hotspot.*; /** @@ -70,12 +69,9 @@ } public static Tag getEnum(int value) { - for (Tag e : values()) { - if (e.value == value) { - return e; - } - } - throw GraalInternalError.shouldNotReachHere("unknown enum value " + value); + Tag result = values()[value]; + assert value == result.value; + return result; } }