| 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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 */ | 433 */ |
| 434 void registerStaticUse(Element element) { | 434 void registerStaticUse(Element element) { |
| 435 if (element == null) return; | 435 if (element == null) return; |
| 436 assert(invariant(element, element.isDeclaration)); | 436 assert(invariant(element, element.isDeclaration)); |
| 437 addToWorkList(element); | 437 addToWorkList(element); |
| 438 compiler.backend.registerStaticUse(element, this); | 438 compiler.backend.registerStaticUse(element, this); |
| 439 } | 439 } |
| 440 | 440 |
| 441 void registerGetOfStaticFunction(FunctionElement element) { | 441 void registerGetOfStaticFunction(FunctionElement element) { |
| 442 registerStaticUse(element); | 442 registerStaticUse(element); |
| 443 registerInstantiatedClass(compiler.closureClass, | 443 if (compiler.closureClass != null) { |
| 444 compiler.globalDependencies); | 444 // TODO(johnniwinther): Move this to the JavaScript backend. |
| 445 registerInstantiatedClass(compiler.closureClass, |
| 446 compiler.globalDependencies); |
| 447 } |
| 445 universe.staticFunctionsNeedingGetter.add(element); | 448 universe.staticFunctionsNeedingGetter.add(element); |
| 446 } | 449 } |
| 447 | 450 |
| 448 void registerDynamicInvocation(Selector selector) { | 451 void registerDynamicInvocation(Selector selector) { |
| 449 assert(selector != null); | 452 assert(selector != null); |
| 450 registerInvocation(selector); | 453 registerInvocation(selector); |
| 451 } | 454 } |
| 452 | 455 |
| 453 void registerSelectorUse(Selector selector) { | 456 void registerSelectorUse(Selector selector) { |
| 454 if (selector.isGetter) { | 457 if (selector.isGetter) { |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 745 } | 748 } |
| 746 CodegenWorkItem workItem = new CodegenWorkItem( | 749 CodegenWorkItem workItem = new CodegenWorkItem( |
| 747 element, itemCompilationContextCreator()); | 750 element, itemCompilationContextCreator()); |
| 748 queue.add(workItem); | 751 queue.add(workItem); |
| 749 } | 752 } |
| 750 | 753 |
| 751 void _logSpecificSummary(log(message)) { | 754 void _logSpecificSummary(log(message)) { |
| 752 log('Compiled ${generatedCode.length} methods.'); | 755 log('Compiled ${generatedCode.length} methods.'); |
| 753 } | 756 } |
| 754 } | 757 } |
| OLD | NEW |