| Index: pkg/compiler/lib/src/ssa/value_range_analyzer.dart
|
| diff --git a/pkg/compiler/lib/src/ssa/value_range_analyzer.dart b/pkg/compiler/lib/src/ssa/value_range_analyzer.dart
|
| index 1882fc6bb1f65d2ee84d7735a1589c1c95b19af2..589086fac5a39d5aff7fe19aaff80c70793e2631 100644
|
| --- a/pkg/compiler/lib/src/ssa/value_range_analyzer.dart
|
| +++ b/pkg/compiler/lib/src/ssa/value_range_analyzer.dart
|
| @@ -687,7 +687,7 @@ class SsaValueRangeAnalyzer extends HBaseVisitor implements OptimizationPhase {
|
| }
|
| if (constantNum.isPositiveInfinity || constantNum.isNegativeInfinity) {
|
| return info.newUnboundRange();
|
| - }
|
| + }
|
| if (constantNum.isMinusZero) constantNum = new IntConstantValue(0);
|
| Value value = info.newIntValue(constantNum.primitiveValue);
|
| return info.newNormalizedRange(value, value);
|
| @@ -832,6 +832,21 @@ class SsaValueRangeAnalyzer extends HBaseVisitor implements OptimizationPhase {
|
| return info.newUnboundRange();
|
| }
|
|
|
| + Range visitRemainder(HRemainder instruction) {
|
| + HInstruction left = instruction.inputs[0];
|
| + HInstruction right = instruction.inputs[1];
|
| + if (left.isPositiveInteger(compiler) && right.isPositiveInteger(compiler)) {
|
| + Range divisor = ranges[right];
|
| + if (divisor != null) {
|
| + if (divisor.isPositive) {
|
| + return info.newNormalizedRange(
|
| + info.intZero, divisor.upper - info.intOne);
|
| + }
|
| + }
|
| + }
|
| + return info.newUnboundRange();
|
| + }
|
| +
|
| Range visitInvokeDynamicMethod(HInvokeDynamicMethod invoke) {
|
| if ((invoke.inputs.length == 3) && (invoke.selector.name == "%"))
|
| return handleInvokeModulo(invoke);
|
|
|