Chromium Code Reviews| Index: pkg/compiler/lib/src/ssa/codegen.dart |
| diff --git a/pkg/compiler/lib/src/ssa/codegen.dart b/pkg/compiler/lib/src/ssa/codegen.dart |
| index 697f99e315588dd1eb418b5998e01cf7e73fb934..a50cffe917f140279e31034cff91773381a878e2 100644 |
| --- a/pkg/compiler/lib/src/ssa/codegen.dart |
| +++ b/pkg/compiler/lib/src/ssa/codegen.dart |
| @@ -1718,11 +1718,13 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor { |
| } |
| void registerGetter(HInvokeDynamic node) { |
| - if (node.element != null) { |
| - // This is a dynamic read which we have found to have a single |
| - // target but for some reason haven't inlined. We are _still_ accessing |
| - // the target dynamically but we don't need to enqueue more than target |
| - // for this to work. |
| + if (node.element != null && |
| + (node.element.isGetter || node.element.isField)) { |
| + // This is a dynamic read which we have found to have a single target but |
| + // for some reason haven't inlined. We are _still_ accessing the target |
| + // dynamically but we don't need to enqueue more than target for this to |
| + // work. The test above excludes non-getter functions since the element |
| + // represents two targets - a tearoff getter and the torn-off method. |
|
sra1
2016/10/18 23:18:22
johnni: is this the right way to handle this?
Johnni Winther
2016/10/19 12:04:50
Yes.
|
| registry.registerStaticUse(new StaticUse.directGet(node.element)); |
| } else { |
| Selector selector = node.selector; |