# HG changeset patch # User Lukas Stadler # Date 1399308013 -7200 # Node ID 130e0183b7e2569950e9288770eec99c22eeb3ab # Parent d968c2db220b91aab6f09d1246ec493cfd2ec6ad# Parent 97b49458b616bf1f702f97e8435db20d0ad05d38 Merge (made FloatRemNode implement Lowerable) diff -r d968c2db220b -r 130e0183b7e2 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/DefaultHotSpotLoweringProvider.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/DefaultHotSpotLoweringProvider.java Mon May 05 18:39:29 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/DefaultHotSpotLoweringProvider.java Mon May 05 18:40:13 2014 +0200 @@ -203,7 +203,7 @@ boxingSnippets.lower((BoxNode) n, tool); } else if (n instanceof UnboxNode) { boxingSnippets.lower((UnboxNode) n, tool); - } else if (n instanceof DeoptimizeNode || n instanceof UnwindNode) { + } else if (n instanceof DeoptimizeNode || n instanceof UnwindNode || n instanceof FloatRemNode) { /* No lowering, we generate LIR directly for these nodes. */ } else { throw GraalInternalError.shouldNotReachHere("Node implementing Lowerable not handled: " + n); diff -r d968c2db220b -r 130e0183b7e2 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatRemNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatRemNode.java Mon May 05 18:39:29 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatRemNode.java Mon May 05 18:40:13 2014 +0200 @@ -31,7 +31,7 @@ import com.oracle.graal.nodes.spi.*; @NodeInfo(shortName = "%") -public final class FloatRemNode extends FloatArithmeticNode implements Canonicalizable { +public class FloatRemNode extends FloatArithmeticNode implements Canonicalizable, Lowerable { public FloatRemNode(Stamp stamp, ValueNode x, ValueNode y, boolean isStrictFP) { super(stamp, x, y, isStrictFP); @@ -57,6 +57,11 @@ } @Override + public void lower(LoweringTool tool) { + tool.getLowerer().lower(this, tool); + } + + @Override public void generate(NodeMappableLIRBuilder builder, ArithmeticLIRGenerator gen) { builder.setResult(this, gen.emitRem(builder.operand(x()), builder.operand(y()), null)); } diff -r d968c2db220b -r 130e0183b7e2 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/cfs/BaseReduction.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/cfs/BaseReduction.java Mon May 05 18:39:29 2014 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/cfs/BaseReduction.java Mon May 05 18:40:13 2014 +0200 @@ -57,10 +57,11 @@ */ public abstract class BaseReduction extends PostOrderNodeIterator { - protected static final DebugMetric metricCheckCastRemoved = Debug.metric("CheckCastRemoved"); - protected static final DebugMetric metricGuardingPiNodeRemoved = Debug.metric("GuardingPiNodeRemoved"); - protected static final DebugMetric metricFixedGuardNodeRemoved = Debug.metric("FixedGuardNodeRemoved"); - protected static final DebugMetric metricMethodResolved = Debug.metric("MethodResolved"); + protected static final DebugMetric metricCheckCastRemoved = Debug.metric("FSR-CheckCastRemoved"); + protected static final DebugMetric metricGuardingPiNodeRemoved = Debug.metric("FSR-GuardingPiNodeRemoved"); + protected static final DebugMetric metricFixedGuardNodeRemoved = Debug.metric("FSR-FixedGuardNodeRemoved"); + protected static final DebugMetric metricMethodResolved = Debug.metric("FSR-MethodResolved"); + protected static final DebugMetric metricUnconditionalDeoptInserted = Debug.metric("FSR-UnconditionalDeoptInserted"); /** *

@@ -95,6 +96,7 @@ * a bug in FlowSensitiveReduction (the code was reachable, after all). */ public void doRewrite(LogicNode falseConstant) { + metricUnconditionalDeoptInserted.increment(); StructuredGraph graph = fixed.graph(); // have to insert a FixedNode other than a ControlSinkNode FixedGuardNode buckStopsHere = graph.add(new FixedGuardNode(falseConstant, deoptReason, DeoptimizationAction.None)); diff -r d968c2db220b -r 130e0183b7e2 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/cfs/EquationalReasoner.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/cfs/EquationalReasoner.java Mon May 05 18:39:29 2014 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/cfs/EquationalReasoner.java Mon May 05 18:40:13 2014 +0200 @@ -65,11 +65,12 @@ */ public final class EquationalReasoner { - private static final DebugMetric metricInstanceOfRemoved = Debug.metric("InstanceOfRemoved"); - private static final DebugMetric metricNullCheckRemoved = Debug.metric("NullCheckRemoved"); - private static final DebugMetric metricObjectEqualsRemoved = Debug.metric("ObjectEqualsRemoved"); - private static final DebugMetric metricEquationalReasoning = Debug.metric("EquationalReasoning"); - private static final DebugMetric metricDowncasting = Debug.metric("Downcasting"); + private static final DebugMetric metricInstanceOfRemoved = Debug.metric("FSR-InstanceOfRemoved"); + private static final DebugMetric metricNullCheckRemoved = Debug.metric("FSR-NullCheckRemoved"); + private static final DebugMetric metricObjectEqualsRemoved = Debug.metric("FSR-ObjectEqualsRemoved"); + private static final DebugMetric metricEquationalReasoning = Debug.metric("FSR-EquationalReasoning"); + private static final DebugMetric metricDowncasting = Debug.metric("FSR-Downcasting"); + private static final DebugMetric metricNullInserted = Debug.metric("FSR-NullInserted"); private final StructuredGraph graph; private final CanonicalizerTool tool; @@ -114,6 +115,7 @@ */ public void forceState(State s) { state = s; + assert state.repOK(); substs.clear(); added.clear(); visited = null; @@ -269,6 +271,7 @@ if (FlowUtil.hasLegalObjectStamp(v)) { if (state.isNull(v)) { // it's ok to return nullConstant in deverbosify unlike in downcast + metricNullInserted.increment(); return nullConstant; } return downcast(v); @@ -596,6 +599,7 @@ PiNode untrivialNull = nonTrivialNull(scrutinee); if (untrivialNull != null) { + metricNullInserted.increment(); return untrivialNull; } diff -r d968c2db220b -r 130e0183b7e2 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/cfs/FlowSensitiveReduction.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/cfs/FlowSensitiveReduction.java Mon May 05 18:39:29 2014 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/cfs/FlowSensitiveReduction.java Mon May 05 18:40:13 2014 +0200 @@ -54,6 +54,14 @@ *