| 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 /** | 7 /** |
| 8 * If true, print a warning for each method that was resolved, but not | 8 * If true, print a warning for each method that was resolved, but not |
| 9 * compiled. | 9 * compiled. |
| 10 */ | 10 */ |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 List<CompilerTask> tasks; | 537 List<CompilerTask> tasks; |
| 538 ScannerTask scanner; | 538 ScannerTask scanner; |
| 539 DietParserTask dietParser; | 539 DietParserTask dietParser; |
| 540 ParserTask parser; | 540 ParserTask parser; |
| 541 PatchParserTask patchParser; | 541 PatchParserTask patchParser; |
| 542 LibraryLoader libraryLoader; | 542 LibraryLoader libraryLoader; |
| 543 TreeValidatorTask validator; | 543 TreeValidatorTask validator; |
| 544 ResolverTask resolver; | 544 ResolverTask resolver; |
| 545 closureMapping.ClosureTask closureToClassMapper; | 545 closureMapping.ClosureTask closureToClassMapper; |
| 546 TypeCheckerTask checker; | 546 TypeCheckerTask checker; |
| 547 IrBuilderTask irBuilder; |
| 547 ti.TypesTask typesTask; | 548 ti.TypesTask typesTask; |
| 548 Backend backend; | 549 Backend backend; |
| 549 ConstantHandler constantHandler; | 550 ConstantHandler constantHandler; |
| 550 EnqueueTask enqueuer; | 551 EnqueueTask enqueuer; |
| 551 DeferredLoadTask deferredLoadTask; | 552 DeferredLoadTask deferredLoadTask; |
| 552 MirrorUsageAnalyzerTask mirrorUsageAnalyzerTask; | 553 MirrorUsageAnalyzerTask mirrorUsageAnalyzerTask; |
| 553 String buildId; | 554 String buildId; |
| 554 | 555 |
| 555 static const String MAIN = 'main'; | 556 static const String MAIN = 'main'; |
| 556 static const String CALL_OPERATOR_NAME = 'call'; | 557 static const String CALL_OPERATOR_NAME = 'call'; |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 | 650 |
| 650 tasks = [ | 651 tasks = [ |
| 651 libraryLoader = new LibraryLoaderTask(this), | 652 libraryLoader = new LibraryLoaderTask(this), |
| 652 scanner = new ScannerTask(this), | 653 scanner = new ScannerTask(this), |
| 653 dietParser = new DietParserTask(this), | 654 dietParser = new DietParserTask(this), |
| 654 parser = new ParserTask(this), | 655 parser = new ParserTask(this), |
| 655 patchParser = new PatchParserTask(this), | 656 patchParser = new PatchParserTask(this), |
| 656 resolver = new ResolverTask(this), | 657 resolver = new ResolverTask(this), |
| 657 closureToClassMapper = new closureMapping.ClosureTask(this, closureNamer), | 658 closureToClassMapper = new closureMapping.ClosureTask(this, closureNamer), |
| 658 checker = new TypeCheckerTask(this), | 659 checker = new TypeCheckerTask(this), |
| 660 irBuilder = new IrBuilderTask(this), |
| 659 typesTask = new ti.TypesTask(this), | 661 typesTask = new ti.TypesTask(this), |
| 660 constantHandler = new ConstantHandler(this, backend.constantSystem), | 662 constantHandler = new ConstantHandler(this, backend.constantSystem), |
| 661 deferredLoadTask = new DeferredLoadTask(this), | 663 deferredLoadTask = new DeferredLoadTask(this), |
| 662 mirrorUsageAnalyzerTask = new MirrorUsageAnalyzerTask(this), | 664 mirrorUsageAnalyzerTask = new MirrorUsageAnalyzerTask(this), |
| 663 enqueuer = new EnqueueTask(this)]; | 665 enqueuer = new EnqueueTask(this)]; |
| 664 | 666 |
| 665 tasks.addAll(backend.tasks); | 667 tasks.addAll(backend.tasks); |
| 666 } | 668 } |
| 667 | 669 |
| 668 Universe get resolverWorld => enqueuer.resolution.universe; | 670 Universe get resolverWorld => enqueuer.resolution.universe; |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1104 | 1106 |
| 1105 // TODO(ahe): Remove this line. Eventually, enqueuer.resolution | 1107 // TODO(ahe): Remove this line. Eventually, enqueuer.resolution |
| 1106 // should know this. | 1108 // should know this. |
| 1107 world.populate(); | 1109 world.populate(); |
| 1108 // Compute whole-program-knowledge that the backend needs. (This might | 1110 // Compute whole-program-knowledge that the backend needs. (This might |
| 1109 // require the information computed in [world.populate].) | 1111 // require the information computed in [world.populate].) |
| 1110 backend.onResolutionComplete(); | 1112 backend.onResolutionComplete(); |
| 1111 | 1113 |
| 1112 deferredLoadTask.onResolutionComplete(main); | 1114 deferredLoadTask.onResolutionComplete(main); |
| 1113 | 1115 |
| 1116 log('Building IR...'); |
| 1117 irBuilder.buildNodes(); |
| 1118 |
| 1114 log('Inferring types...'); | 1119 log('Inferring types...'); |
| 1115 typesTask.onResolutionComplete(main); | 1120 typesTask.onResolutionComplete(main); |
| 1116 | 1121 |
| 1117 log('Compiling...'); | 1122 log('Compiling...'); |
| 1118 phase = PHASE_COMPILING; | 1123 phase = PHASE_COMPILING; |
| 1119 // TODO(johnniwinther): Move these to [CodegenEnqueuer]. | 1124 // TODO(johnniwinther): Move these to [CodegenEnqueuer]. |
| 1120 if (hasIsolateSupport()) { | 1125 if (hasIsolateSupport()) { |
| 1121 enqueuer.codegen.addToWorkList( | 1126 enqueuer.codegen.addToWorkList( |
| 1122 isolateHelperLibrary.find(Compiler.START_ROOT_ISOLATE)); | 1127 isolateHelperLibrary.find(Compiler.START_ROOT_ISOLATE)); |
| 1123 enqueuer.codegen.registerGetOfStaticFunction(main); | 1128 enqueuer.codegen.registerGetOfStaticFunction(main); |
| (...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1656 | 1661 |
| 1657 void close() {} | 1662 void close() {} |
| 1658 | 1663 |
| 1659 toString() => name; | 1664 toString() => name; |
| 1660 | 1665 |
| 1661 /// Convenience method for getting an [api.CompilerOutputProvider]. | 1666 /// Convenience method for getting an [api.CompilerOutputProvider]. |
| 1662 static NullSink outputProvider(String name, String extension) { | 1667 static NullSink outputProvider(String name, String extension) { |
| 1663 return new NullSink('$name.$extension'); | 1668 return new NullSink('$name.$extension'); |
| 1664 } | 1669 } |
| 1665 } | 1670 } |
| OLD | NEW |