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 3b5cabcdcec72d21961e343d6e5d3846d39678c8..629550eda4e8e071b8fa1a3e3eed443a49a51f32 100644 |
| --- a/lib/compiler/implementation/ssa/codegen.dart |
| +++ b/lib/compiler/implementation/ssa/codegen.dart |
| @@ -1471,6 +1471,18 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor { |
| } |
| visitInvokeStatic(HInvokeStatic node) { |
| + if (Elements.isStaticOrTopLevelFunction(node.element) && |
| + node is !HInvokeSuper && |
| + node is !HInvokeInterceptor && |
| + node is !HInvokeBinary && |
| + node is !HInvokeUnary && |
| + node is !HIndex && |
| + node is !HIndexAssign) { |
| + // Register this invocation to collect the types used at all call sites. |
|
floitsch
2012/08/15 09:11:59
assert that the typeCode is the one you expect it
Søren Gjesse
2012/08/15 12:17:10
Done.
We should look into giving named constants
|
| + if (Elements.isStaticOrTopLevelFunction(node.element)) { |
|
floitsch
2012/08/15 09:11:59
redundant if.
Søren Gjesse
2012/08/15 12:17:10
Removed.
|
| + backend.registerStaticInvocation(node); |
| + } |
| + } |
| use(node.target); |
| push(new js.Call(pop(), visitArguments(node.inputs)), node); |
| } |
| @@ -1890,6 +1902,11 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor { |
| } |
| void visitStatic(HStatic node) { |
| + node.usedBy.forEach((HInstruction instr) { |
| + if (instr is !HInvokeStatic || instr.target !== node) { |
|
floitsch
2012/08/15 09:11:59
not enough:
foo(foo);
Søren Gjesse
2012/08/15 12:17:10
Good catch!
Added check that the HStatic is also
|
| + backend.registerNonCallStaticUse(node); |
| + } |
| + }); |
| world.registerStaticUse(node.element); |
| push(new js.VariableUse(compiler.namer.isolateAccess(node.element))); |
| } |