# HG changeset patch # User Doug Simon # Date 1335890132 -7200 # Node ID 6e346160f104c3a343c79d3ad09a0038b217fa95 # Parent 678f31e9724e02af3b918129c6cef7e5d0d2af8c replaced magic constants with GraalOptions.CheckcastMaxHints and GraalOptions.InstanceOfMaxHints diff -r 678f31e9724e -r 6e346160f104 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalOptions.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalOptions.java Tue May 01 10:53:56 2012 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalOptions.java Tue May 01 18:35:32 2012 +0200 @@ -230,6 +230,9 @@ */ public static boolean CheckcastCounters = false; + public static int CheckcastMaxHints = 2; + public static int InstanceOfMaxHints = 1; + static { // turn detailed assertions on when the general assertions are on (misusing the assert keyword for this) assert (DetailedAsserts = true) == true; diff -r 678f31e9724e -r 6e346160f104 graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Tue May 01 10:53:56 2012 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Tue May 01 18:35:32 2012 +0200 @@ -629,7 +629,7 @@ AnchorNode anchor = currentGraph.add(new AnchorNode()); append(anchor); CheckCastNode checkCast; - RiResolvedType[] hints = getTypeCheckHints((RiResolvedType) type, 2); + RiResolvedType[] hints = getTypeCheckHints((RiResolvedType) type, GraalOptions.CheckcastMaxHints); checkCast = currentGraph.unique(new CheckCastNode(anchor, typeInstruction, (RiResolvedType) type, object, hints, Util.isFinalClass((RiResolvedType) type))); append(currentGraph.add(new ValueAnchorNode(checkCast))); frameState.apush(checkCast); @@ -648,7 +648,7 @@ RiResolvedType resolvedType = (RiResolvedType) type; ConstantNode hub = appendConstant(resolvedType.getEncoding(RiType.Representation.ObjectHub)); - RiResolvedType[] hints = getTypeCheckHints(resolvedType, 1); + RiResolvedType[] hints = getTypeCheckHints(resolvedType, GraalOptions.InstanceOfMaxHints); InstanceOfNode instanceOfNode = new InstanceOfNode(hub, (RiResolvedType) type, object, hints, Util.isFinalClass(resolvedType), false); frameState.ipush(append(MaterializeNode.create(currentGraph.unique(instanceOfNode), currentGraph))); } else {