Index: pkg/compiler/lib/src/ssa/codegen_helpers.dart |
diff --git a/pkg/compiler/lib/src/ssa/codegen_helpers.dart b/pkg/compiler/lib/src/ssa/codegen_helpers.dart |
index beb4f42206732fa5e0dfea69edb86cd0a18e049a..254e577a31f6141119a0e9d6f9c1fd77a60370a7 100644 |
--- a/pkg/compiler/lib/src/ssa/codegen_helpers.dart |
+++ b/pkg/compiler/lib/src/ssa/codegen_helpers.dart |
@@ -67,8 +67,8 @@ class SsaInstructionSelection extends HBaseVisitor { |
if (node.kind == HIs.RAW_CHECK) { |
HInstruction interceptor = node.interceptor; |
if (interceptor != null) { |
- return new HIsViaInterceptor(node.typeExpression, interceptor, |
- backend.boolType); |
+ return new HIsViaInterceptor( |
+ node.typeExpression, interceptor, backend.boolType); |
} |
} |
return node; |
@@ -87,8 +87,7 @@ class SsaInstructionSelection extends HBaseVisitor { |
if (leftType.isNullable && rightType.isNullable) { |
if (left.isConstantNull() || |
right.isConstantNull() || |
- (left.isPrimitive(compiler) && |
- leftType == rightType)) { |
+ (left.isPrimitive(compiler) && leftType == rightType)) { |
return '=='; |
} |
return null; |
@@ -193,14 +192,12 @@ class SsaInstructionSelection extends HBaseVisitor { |
return replaceOp(rmw, left); |
} else { |
HInstruction rmw = new HReadModifyWrite.assignOp( |
- setter.element, |
- assignOp, |
- receiver, right, op.instructionType); |
+ setter.element, assignOp, receiver, right, op.instructionType); |
return replaceOp(rmw, left); |
} |
} else if (op.usedBy.length == 1 && |
- right is HConstant && |
- right.constant.isOne) { |
+ right is HConstant && |
+ right.constant.isOne) { |
HInstruction rmw = new HReadModifyWrite.postOp( |
setter.element, incrementOp, receiver, op.instructionType); |
block.addAfter(left, rmw); |
@@ -214,14 +211,12 @@ class SsaInstructionSelection extends HBaseVisitor { |
return noMatchingRead(); |
} |
- HInstruction simple(String assignOp, |
- HInstruction left, HInstruction right) { |
+ HInstruction simple( |
+ String assignOp, HInstruction left, HInstruction right) { |
if (isMatchingRead(left)) { |
if (left.usedBy.length == 1) { |
HInstruction rmw = new HReadModifyWrite.assignOp( |
- setter.element, |
- assignOp, |
- receiver, right, op.instructionType); |
+ setter.element, assignOp, receiver, right, op.instructionType); |
return replaceOp(rmw, left); |
} |
} |
@@ -261,7 +256,6 @@ class SsaInstructionSelection extends HBaseVisitor { |
* analysis easier. |
*/ |
class SsaTypeKnownRemover extends HBaseVisitor { |
- |
void visitGraph(HGraph graph) { |
visitDominatorTree(graph); |
} |
@@ -286,7 +280,6 @@ class SsaTypeKnownRemover extends HBaseVisitor { |
* mode. |
*/ |
class SsaTrustedCheckRemover extends HBaseVisitor { |
- |
Compiler compiler; |
SsaTrustedCheckRemover(this.compiler); |
@@ -354,12 +347,12 @@ class SsaInstructionMerger extends HBaseVisitor { |
List<HInstruction> inputs = user.inputs; |
for (int i = start; i < inputs.length; i++) { |
HInstruction input = inputs[i]; |
- if (!generateAtUseSite.contains(input) |
- && !input.isCodeMotionInvariant() |
- && input.usedBy.length == 1 |
- && input is !HPhi |
- && input is !HLocalValue |
- && !input.isJsStatement()) { |
+ if (!generateAtUseSite.contains(input) && |
+ !input.isCodeMotionInvariant() && |
+ input.usedBy.length == 1 && |
+ input is! HPhi && |
+ input is! HLocalValue && |
+ !input.isJsStatement()) { |
if (input.isPure()) { |
// Only consider a pure input if it is in the same loop. |
// Otherwise, we might move GVN'ed instruction back into the |
@@ -441,8 +434,7 @@ class SsaInstructionMerger extends HBaseVisitor { |
} |
void visitTypeConversion(HTypeConversion instruction) { |
- if (!instruction.isArgumentTypeCheck |
- && !instruction.isReceiverTypeCheck) { |
+ if (!instruction.isArgumentTypeCheck && !instruction.isReceiverTypeCheck) { |
assert(instruction.isCheckedModeCheck || instruction.isCastTypeCheck); |
// Checked mode checks and cast checks compile to code that |
// only use their input once, so we can safely visit them |
@@ -462,8 +454,8 @@ class SsaInstructionMerger extends HBaseVisitor { |
} |
bool isBlockSinglePredecessor(HBasicBlock block) { |
- return block.successors.length == 1 |
- && block.successors[0].predecessors.length == 1; |
+ return block.successors.length == 1 && |
+ block.successors[0].predecessors.length == 1; |
} |
void visitBasicBlock(HBasicBlock block) { |
@@ -503,8 +495,8 @@ class SsaInstructionMerger extends HBaseVisitor { |
block.last.accept(this); |
for (HInstruction instruction = block.last.previous; |
- instruction != null; |
- instruction = instruction.previous) { |
+ instruction != null; |
+ instruction = instruction.previous) { |
if (generateAtUseSite.contains(instruction)) { |
continue; |
} |
@@ -585,8 +577,8 @@ class SsaInstructionMerger extends HBaseVisitor { |
} |
} |
- if (block.predecessors.length == 1 |
- && isBlockSinglePredecessor(block.predecessors[0])) { |
+ if (block.predecessors.length == 1 && |
+ isBlockSinglePredecessor(block.predecessors[0])) { |
assert(block.phis.isEmpty); |
tryMergingExpressions(block.predecessors[0]); |
} else { |
@@ -630,8 +622,8 @@ class SsaConditionMerger extends HGraphVisitor { |
// If [instruction] is not the last instruction of the block |
// before the control flow instruction, or the last instruction, |
// then we will have to emit a statement for that last instruction. |
- if (instruction != block.last |
- && !identical(instruction, block.last.previous)) return true; |
+ if (instruction != block.last && |
+ !identical(instruction, block.last.previous)) return true; |
// If one of the instructions in the block until [instruction] is |
// not generated at use site, then we will have to emit a |
@@ -639,8 +631,8 @@ class SsaConditionMerger extends HGraphVisitor { |
// TODO(ngeoffray): we could generate a comma separated |
// list of expressions. |
for (HInstruction temp = block.first; |
- !identical(temp, instruction); |
- temp = temp.next) { |
+ !identical(temp, instruction); |
+ temp = temp.next) { |
if (!generateAtUseSite.contains(temp)) return true; |
} |
@@ -664,7 +656,7 @@ class SsaConditionMerger extends HGraphVisitor { |
} |
void visitBasicBlock(HBasicBlock block) { |
- if (block.last is !HIf) return; |
+ if (block.last is! HIf) return; |
HIf startIf = block.last; |
HBasicBlock end = startIf.joinBlock; |
@@ -754,9 +746,9 @@ class SsaConditionMerger extends HGraphVisitor { |
// If the operation is only used by the first instruction |
// of its block and is safe to be generated at use site, mark it |
// so. |
- if (phi.usedBy.length == 1 |
- && phi.usedBy[0] == nextInstruction |
- && isSafeToGenerateAtUseSite(phi.usedBy[0], phi)) { |
+ if (phi.usedBy.length == 1 && |
+ phi.usedBy[0] == nextInstruction && |
+ isSafeToGenerateAtUseSite(phi.usedBy[0], phi)) { |
markAsGenerateAtUseSite(phi); |
} |