| 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 part of dart2js; | 5 part of dart2js; |
| 6 | 6 |
| 7 typedef ItemCompilationContext ItemCompilationContextCreator(); | 7 typedef ItemCompilationContext ItemCompilationContextCreator(); |
| 8 | 8 |
| 9 class EnqueueTask extends CompilerTask { | 9 class EnqueueTask extends CompilerTask { |
| 10 final ResolutionEnqueuer resolution; | 10 final ResolutionEnqueuer resolution; |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 enableNoSuchMethod(member); | 211 enableNoSuchMethod(member); |
| 212 } | 212 } |
| 213 if (member.name == Compiler.CALL_OPERATOR_NAME && | 213 if (member.name == Compiler.CALL_OPERATOR_NAME && |
| 214 !cls.typeVariables.isEmpty) { | 214 !cls.typeVariables.isEmpty) { |
| 215 registerGenericCallMethod(member, compiler.globalDependencies); | 215 registerGenericCallMethod(member, compiler.globalDependencies); |
| 216 } | 216 } |
| 217 // If there is a property access with the same name as a method we | 217 // If there is a property access with the same name as a method we |
| 218 // need to emit the method. | 218 // need to emit the method. |
| 219 if (universe.hasInvokedGetter(member, compiler)) { | 219 if (universe.hasInvokedGetter(member, compiler)) { |
| 220 registerClosurizedMember(member, compiler.globalDependencies); | 220 registerClosurizedMember(member, compiler.globalDependencies); |
| 221 return addToWorkList(member); | 221 addToWorkList(member); |
| 222 return; |
| 222 } | 223 } |
| 223 // Store the member in [instanceFunctionsByName] to catch | 224 // Store the member in [instanceFunctionsByName] to catch |
| 224 // getters on the function. | 225 // getters on the function. |
| 225 Link<Element> members = instanceFunctionsByName.putIfAbsent( | 226 Link<Element> members = instanceFunctionsByName.putIfAbsent( |
| 226 memberName, () => const Link<Element>()); | 227 memberName, () => const Link<Element>()); |
| 227 instanceFunctionsByName[memberName] = members.prepend(member); | 228 instanceFunctionsByName[memberName] = members.prepend(member); |
| 228 if (universe.hasInvocation(member, compiler)) { | 229 if (universe.hasInvocation(member, compiler)) { |
| 229 return addToWorkList(member); | 230 addToWorkList(member); |
| 231 return; |
| 230 } | 232 } |
| 231 } else if (member.kind == ElementKind.GETTER) { | 233 } else if (member.kind == ElementKind.GETTER) { |
| 232 if (universe.hasInvokedGetter(member, compiler)) { | 234 if (universe.hasInvokedGetter(member, compiler)) { |
| 233 return addToWorkList(member); | 235 addToWorkList(member); |
| 236 return; |
| 234 } | 237 } |
| 235 // We don't know what selectors the returned closure accepts. If | 238 // We don't know what selectors the returned closure accepts. If |
| 236 // the set contains any selector we have to assume that it matches. | 239 // the set contains any selector we have to assume that it matches. |
| 237 if (universe.hasInvocation(member, compiler)) { | 240 if (universe.hasInvocation(member, compiler)) { |
| 238 return addToWorkList(member); | 241 addToWorkList(member); |
| 242 return; |
| 239 } | 243 } |
| 240 } else if (member.kind == ElementKind.SETTER) { | 244 } else if (member.kind == ElementKind.SETTER) { |
| 241 if (universe.hasInvokedSetter(member, compiler)) { | 245 if (universe.hasInvokedSetter(member, compiler)) { |
| 242 return addToWorkList(member); | 246 addToWorkList(member); |
| 247 return; |
| 243 } | 248 } |
| 244 } | 249 } |
| 245 | 250 |
| 246 // The element is not yet used. Add it to the list of instance | 251 // The element is not yet used. Add it to the list of instance |
| 247 // members to still be processed. | 252 // members to still be processed. |
| 248 Link<Element> members = instanceMembersByName.putIfAbsent( | 253 Link<Element> members = instanceMembersByName.putIfAbsent( |
| 249 memberName, () => const Link<Element>()); | 254 memberName, () => const Link<Element>()); |
| 250 instanceMembersByName[memberName] = members.prepend(member); | 255 instanceMembersByName[memberName] = members.prepend(member); |
| 251 } | 256 } |
| 252 | 257 |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 740 } | 745 } |
| 741 CodegenWorkItem workItem = new CodegenWorkItem( | 746 CodegenWorkItem workItem = new CodegenWorkItem( |
| 742 element, itemCompilationContextCreator()); | 747 element, itemCompilationContextCreator()); |
| 743 queue.add(workItem); | 748 queue.add(workItem); |
| 744 } | 749 } |
| 745 | 750 |
| 746 void _logSpecificSummary(log(message)) { | 751 void _logSpecificSummary(log(message)) { |
| 747 log('Compiled ${generatedCode.length} methods.'); | 752 log('Compiled ${generatedCode.length} methods.'); |
| 748 } | 753 } |
| 749 } | 754 } |
| OLD | NEW |