Mercurial > hg > graal-compiler
diff graal/GraalCompiler/src/com/sun/c1x/ir/ArithmeticOp.java @ 2541:0f9eeb15e636
More Value.Flag clean up.
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Wed, 27 Apr 2011 20:58:01 +0200 |
parents | e1ba5a93e997 |
children | 421da5f53b5e |
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/ArithmeticOp.java Wed Apr 27 20:27:43 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/ir/ArithmeticOp.java Wed Apr 27 20:58:01 2011 +0200 @@ -22,7 +22,6 @@ */ package com.sun.c1x.ir; -import com.sun.c1x.*; import com.sun.c1x.debug.*; import com.sun.c1x.value.*; import com.sun.cri.bytecode.*; @@ -30,13 +29,11 @@ /** * The {@code ArithmeticOp} class represents arithmetic operations such as addition, subtraction, etc. - * - * @author Ben L. Titzer */ public final class ArithmeticOp extends Op2 { - private FrameState stateBefore; - private boolean isStrictFP; + private final FrameState stateBefore; + private final boolean isStrictFP; /** * Creates a new arithmetic operation. @@ -50,21 +47,7 @@ public ArithmeticOp(int opcode, CiKind kind, Value x, Value y, boolean isStrictFP, FrameState stateBefore) { super(kind, opcode, x, y); this.isStrictFP = isStrictFP; - if (stateBefore != null) { - // state before is only used in the case of a division or remainder, - // and isn't needed if the zero check is redundant - if (y.isConstant()) { - long divisor = y.asConstant().asLong(); - if (divisor != 0) { - C1XMetrics.ZeroChecksRedundant++; - setFlag(Flag.NoZeroCheck); - } else { - this.stateBefore = stateBefore; - } - } else { - this.stateBefore = stateBefore; - } - } + this.stateBefore = stateBefore; } @Override @@ -99,14 +82,6 @@ return Bytecodes.isCommutative(opcode); } - public boolean needsZeroCheck() { - return !checkFlag(Flag.NoZeroCheck); - } - - public void eliminateZeroCheck() { - clearRuntimeCheck(Flag.NoZeroCheck); - } - @Override public void print(LogStream out) { out.print(x()).print(' ').print(Bytecodes.operator(opcode)).print(' ').print(y());