| 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 library dart2js.compiler_base; | 5 library dart2js.compiler_base; |
| 6 | 6 |
| 7 import 'dart:async' show Future; | 7 import 'dart:async' show Future; |
| 8 | 8 |
| 9 import '../compiler_new.dart' as api; | 9 import '../compiler_new.dart' as api; |
| 10 import 'closure.dart' as closureMapping show ClosureTask; | 10 import 'closure.dart' as closureMapping show ClosureTask; |
| (...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 resolveLibraryMetadata(); | 619 resolveLibraryMetadata(); |
| 620 reporter.log('Resolving...'); | 620 reporter.log('Resolving...'); |
| 621 MethodElement mainMethod; | 621 MethodElement mainMethod; |
| 622 if (mainFunction != null && !mainFunction.isMalformed) { | 622 if (mainFunction != null && !mainFunction.isMalformed) { |
| 623 mainFunction.computeType(resolution); | 623 mainFunction.computeType(resolution); |
| 624 mainMethod = mainFunction; | 624 mainMethod = mainFunction; |
| 625 } | 625 } |
| 626 | 626 |
| 627 processQueue(resolutionEnqueuer, mainMethod, libraryLoader.libraries, | 627 processQueue(resolutionEnqueuer, mainMethod, libraryLoader.libraries, |
| 628 onProgress: showResolutionProgress); | 628 onProgress: showResolutionProgress); |
| 629 backend.onResolutionEnd(); | |
| 630 resolutionEnqueuer.logSummary(reporter.log); | 629 resolutionEnqueuer.logSummary(reporter.log); |
| 631 | 630 |
| 632 _reporter.reportSuppressedMessagesSummary(); | 631 _reporter.reportSuppressedMessagesSummary(); |
| 633 | 632 |
| 634 if (compilationFailed) { | 633 if (compilationFailed) { |
| 635 if (!options.generateCodeWithCompileTimeErrors) return; | 634 if (!options.generateCodeWithCompileTimeErrors) return; |
| 636 if (!backend | 635 if (!backend |
| 637 .enableCodegenWithErrorsIfSupported(NO_LOCATION_SPANNABLE)) { | 636 .enableCodegenWithErrorsIfSupported(NO_LOCATION_SPANNABLE)) { |
| 638 return; | 637 return; |
| 639 } | 638 } |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 | 697 |
| 699 backend.onCodegenEnd(); | 698 backend.onCodegenEnd(); |
| 700 | 699 |
| 701 checkQueues(resolutionEnqueuer, codegenEnqueuer); | 700 checkQueues(resolutionEnqueuer, codegenEnqueuer); |
| 702 }); | 701 }); |
| 703 | 702 |
| 704 /// Perform the steps needed to fully end the resolution phase. | 703 /// Perform the steps needed to fully end the resolution phase. |
| 705 ClosedWorldRefiner closeResolution() { | 704 ClosedWorldRefiner closeResolution() { |
| 706 phase = PHASE_DONE_RESOLVING; | 705 phase = PHASE_DONE_RESOLVING; |
| 707 | 706 |
| 708 ClosedWorldImpl world = resolutionWorldBuilder.closeWorld(); | 707 ClosedWorldImpl world = resolutionWorldBuilder.closeWorld(reporter); |
| 709 // Compute whole-program-knowledge that the backend needs. (This might | 708 // Compute whole-program-knowledge that the backend needs. (This might |
| 710 // require the information computed in [world.closeWorld].) | 709 // require the information computed in [world.closeWorld].) |
| 711 backend.onResolutionClosedWorld(world, world); | 710 backend.onResolutionComplete(world, world); |
| 712 | 711 |
| 713 deferredLoadTask.onResolutionComplete(mainFunction); | 712 deferredLoadTask.onResolutionComplete(mainFunction); |
| 714 | 713 |
| 715 // TODO(johnniwinther): Move this after rti computation but before | 714 // TODO(johnniwinther): Move this after rti computation but before |
| 716 // reflection members computation, and (re-)close the world afterwards. | 715 // reflection members computation, and (re-)close the world afterwards. |
| 717 closureToClassMapper.createClosureClasses(world); | 716 closureToClassMapper.createClosureClasses(world); |
| 718 return world; | 717 return world; |
| 719 } | 718 } |
| 720 | 719 |
| 721 /// Compute the [WorldImpact] for accessing all elements in [library]. | 720 /// Compute the [WorldImpact] for accessing all elements in [library]. |
| (...skipping 1277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1999 ResolutionFunctionType getLocalFunctionType(LocalFunctionElement function) { | 1998 ResolutionFunctionType getLocalFunctionType(LocalFunctionElement function) { |
| 2000 return function.type; | 1999 return function.type; |
| 2001 } | 2000 } |
| 2002 | 2001 |
| 2003 @override | 2002 @override |
| 2004 ResolutionDartType getUnaliasedType(ResolutionDartType type) { | 2003 ResolutionDartType getUnaliasedType(ResolutionDartType type) { |
| 2005 type.computeUnaliased(_resolution); | 2004 type.computeUnaliased(_resolution); |
| 2006 return type.unaliased; | 2005 return type.unaliased; |
| 2007 } | 2006 } |
| 2008 } | 2007 } |
| OLD | NEW |