Chromium Code Reviews| Index: lib/compiler/implementation/ssa/optimize.dart |
| diff --git a/lib/compiler/implementation/ssa/optimize.dart b/lib/compiler/implementation/ssa/optimize.dart |
| index ab0b54f1d689146ea7508cf6ebb1c50005375343..a04db0410277d725b1658e4018df36cae586cfa7 100644 |
| --- a/lib/compiler/implementation/ssa/optimize.dart |
| +++ b/lib/compiler/implementation/ssa/optimize.dart |
| @@ -474,6 +474,26 @@ class SsaConstantFolder extends HBaseVisitor implements OptimizationPhase { |
| } |
| } |
|
ngeoffray
2012/06/14 13:01:21
Add a comment on why we're interested in recompili
Søren Gjesse
2012/06/15 13:19:59
Done.
|
| + if (node.left is HFieldGet && node.right is HConstant) { |
|
ngeoffray
2012/06/14 13:01:21
check node.right.isInteger()
Søren Gjesse
2012/06/15 13:19:59
Done.
|
| + HFieldGet left = node.left; |
| + HConstant right = node.right; |
| + Type type = left.receiver.propagatedType.computeType(compiler); |
| + if (left.element != null && |
| + compiler.codegenWorld.hasFieldOnlyIntegerSetters( |
| + type, left.element.name)) { |
| + switch (compiler.pass) { |
| + case 1: |
| + compiler.enqueuer.codegen.registerRecompilationCandidate( |
| + work.element); |
| + break; |
| + case 2: |
| + // Codegen will generate the faster code now. |
| + break; |
| + } |
| + return node; |
|
ngeoffray
2012/06/14 13:01:21
This code does not really belong here. I would cre
Søren Gjesse
2012/06/15 13:19:59
Moved all this to a new SSA pass.
|
| + } |
| + } |
| + |
| // All other cases are dealt with by the [visitRelational] and |
| // [visitInvokeBinary], which are visited by invoking the [super]'s |
| // visit method. |