| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 class EnqueueTask extends CompilerTask { | 5 class EnqueueTask extends CompilerTask { |
| 6 EnqueueTask(Compiler compiler) : super(compiler); | 6 EnqueueTask(Compiler compiler) : super(compiler); |
| 7 String get name() => 'Enqueue'; | 7 String get name() => 'Enqueue'; |
| 8 | 8 |
| 9 void enqueueInvokedInstanceMethods() { | 9 void enqueueInvokedInstanceMethods() { |
| 10 // TODO(floitsch): find a more efficient way of doing this. | 10 // TODO(floitsch): find a more efficient way of doing this. |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 if (selectors != null) { | 56 if (selectors != null) { |
| 57 for (Selector selector in selectors) { | 57 for (Selector selector in selectors) { |
| 58 if (selector.applies(compiler, member)) { | 58 if (selector.applies(compiler, member)) { |
| 59 return compiler.addToWorkList(member); | 59 return compiler.addToWorkList(member); |
| 60 } | 60 } |
| 61 } | 61 } |
| 62 } | 62 } |
| 63 // If there is a property access with the same name as a method we | 63 // If there is a property access with the same name as a method we |
| 64 // need to emit the method. | 64 // need to emit the method. |
| 65 if (compiler.universe.invokedGetters.contains(member.name)) { | 65 if (compiler.universe.invokedGetters.contains(member.name)) { |
| 66 // We will emit a closure, so make sure the closure class is |
| 67 // generated. |
| 68 compiler.closureClass.ensureResolved(compiler); |
| 69 compiler.registerInstantiatedClass(compiler.closureClass); |
| 66 return compiler.addToWorkList(member); | 70 return compiler.addToWorkList(member); |
| 67 } | 71 } |
| 68 } else if (member.kind == ElementKind.GETTER) { | 72 } else if (member.kind == ElementKind.GETTER) { |
| 69 if (compiler.universe.invokedGetters.contains(member.name)) { | 73 if (compiler.universe.invokedGetters.contains(member.name)) { |
| 70 return compiler.addToWorkList(member); | 74 return compiler.addToWorkList(member); |
| 71 } | 75 } |
| 72 // A method invocation like in o.foo(x, y) might actually be an | 76 // A method invocation like in o.foo(x, y) might actually be an |
| 73 // invocation of the getter foo followed by an invocation of the | 77 // invocation of the getter foo followed by an invocation of the |
| 74 // returned closure. | 78 // returned closure. |
| 75 Set<Selector> invokedSelectors = | 79 Set<Selector> invokedSelectors = |
| (...skipping 14 matching lines...) Expand all Loading... |
| 90 measure(() { | 94 measure(() { |
| 91 cls.members.forEach((member) { | 95 cls.members.forEach((member) { |
| 92 if (member.kind === ElementKind.GETTER || | 96 if (member.kind === ElementKind.GETTER || |
| 93 member.kind === ElementKind.FIELD) { | 97 member.kind === ElementKind.FIELD) { |
| 94 compiler.universe.instantiatedClassInstanceFields.add(member.name); | 98 compiler.universe.instantiatedClassInstanceFields.add(member.name); |
| 95 } | 99 } |
| 96 }); | 100 }); |
| 97 }); | 101 }); |
| 98 } | 102 } |
| 99 } | 103 } |
| OLD | NEW |