Chromium Code Reviews| Index: lib/compiler/implementation/ssa/codegen.dart |
| diff --git a/lib/compiler/implementation/ssa/codegen.dart b/lib/compiler/implementation/ssa/codegen.dart |
| index 0e9fe182853f588e9b96fc6f46b764fa921629fb..721ad498529857a3a0363d52b8e70662601b199c 100644 |
| --- a/lib/compiler/implementation/ssa/codegen.dart |
| +++ b/lib/compiler/implementation/ssa/codegen.dart |
| @@ -1172,7 +1172,35 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor { |
| buffer.add(')'); |
| endExpression(JSPrecedence.CALL_PRECEDENCE); |
| } else { |
| - visitInvokeStatic(node); |
| + if (node.left is HFieldGet && node.right is HConstant) { |
|
ngeoffray
2012/06/14 13:01:21
This is too late in the game. The node.builtin sho
Søren Gjesse
2012/06/15 13:19:59
Removed all this as the SSA optimization phase now
|
| + 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: |
| + visitInvokeStatic(node); |
| + break; |
| + case 2: |
| + if (right.isConstantInteger()) { |
| + buffer.add('('); |
| + use(node.left, JSPrecedence.EQUALITY_PRECEDENCE); |
| + buffer.add(' === '); |
| + use(node.right, JSPrecedence.RELATIONAL_PRECEDENCE); |
| + buffer.add(')'); |
| + } else { |
| + visitInvokeStatic(node); |
| + } |
| + break; |
| + } |
| + } else { |
| + visitInvokeStatic(node); |
| + } |
| + } else { |
| + visitInvokeStatic(node); |
| + } |
| } |
| } |
| @@ -1728,7 +1756,12 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor { |
| buffer.add(name); |
| Type type = node.receiver.propagatedType.computeType(compiler); |
| if (type != null) { |
| - world.registerFieldSetter(node.element.name, type); |
| + Type valueType = node.value.propagatedType.computeType(compiler); |
| + if (valueType.toString() == "int") { |
|
ngeoffray
2012/06/14 13:01:21
You should change that to node.value.isInteger()
Søren Gjesse
2012/06/15 13:19:59
Done.
|
| + world.registerFieldSetter(node.element.name, type, true); |
| + } else { |
| + world.registerFieldSetter(node.element.name, type, false); |
| + } |
| } |
| } else { |
| declareInstruction(node.receiver); |