| 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.resolution; | 5 library dart2js.resolution; |
| 6 | 6 |
| 7 import 'dart:collection' show Queue; | 7 import 'dart:collection' show Queue; |
| 8 | 8 |
| 9 import '../common.dart'; | 9 import '../common.dart'; |
| 10 import '../common/names.dart' show Identifiers; | 10 import '../common/names.dart' show Identifiers; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 import 'members.dart'; | 57 import 'members.dart'; |
| 58 import 'registry.dart'; | 58 import 'registry.dart'; |
| 59 import 'resolution_result.dart'; | 59 import 'resolution_result.dart'; |
| 60 import 'signatures.dart'; | 60 import 'signatures.dart'; |
| 61 import 'tree_elements.dart'; | 61 import 'tree_elements.dart'; |
| 62 import 'typedefs.dart'; | 62 import 'typedefs.dart'; |
| 63 | 63 |
| 64 class ResolverTask extends CompilerTask { | 64 class ResolverTask extends CompilerTask { |
| 65 final ConstantCompiler constantCompiler; | 65 final ConstantCompiler constantCompiler; |
| 66 final Resolution resolution; | 66 final Resolution resolution; |
| 67 final World world; | 67 final OpenWorld world; |
| 68 | 68 |
| 69 ResolverTask( | 69 ResolverTask( |
| 70 this.resolution, this.constantCompiler, this.world, Measurer measurer) | 70 this.resolution, this.constantCompiler, this.world, Measurer measurer) |
| 71 : super(measurer); | 71 : super(measurer); |
| 72 | 72 |
| 73 String get name => 'Resolver'; | 73 String get name => 'Resolver'; |
| 74 | 74 |
| 75 DiagnosticReporter get reporter => resolution.reporter; | 75 DiagnosticReporter get reporter => resolution.reporter; |
| 76 Target get target => resolution.target; | 76 Target get target => resolution.target; |
| 77 CoreTypes get coreTypes => resolution.coreTypes; | 77 CoreTypes get coreTypes => resolution.coreTypes; |
| (...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1011 element, | 1011 element, |
| 1012 new ResolutionRegistry( | 1012 new ResolutionRegistry( |
| 1013 resolution.target, _ensureTreeElements(element)), | 1013 resolution.target, _ensureTreeElements(element)), |
| 1014 defaultValuesError: defaultValuesError, | 1014 defaultValuesError: defaultValuesError, |
| 1015 createRealParameters: true)); | 1015 createRealParameters: true)); |
| 1016 }); | 1016 }); |
| 1017 } | 1017 } |
| 1018 | 1018 |
| 1019 WorldImpact resolveTypedef(TypedefElementX element) { | 1019 WorldImpact resolveTypedef(TypedefElementX element) { |
| 1020 if (element.isResolved) return const ResolutionImpact(); | 1020 if (element.isResolved) return const ResolutionImpact(); |
| 1021 world.allTypedefs.add(element); | 1021 world.registerTypedef(element); |
| 1022 return _resolveTypeDeclaration(element, () { | 1022 return _resolveTypeDeclaration(element, () { |
| 1023 ResolutionRegistry registry = new ResolutionRegistry( | 1023 ResolutionRegistry registry = new ResolutionRegistry( |
| 1024 resolution.target, _ensureTreeElements(element)); | 1024 resolution.target, _ensureTreeElements(element)); |
| 1025 return reporter.withCurrentElement(element, () { | 1025 return reporter.withCurrentElement(element, () { |
| 1026 return measure(() { | 1026 return measure(() { |
| 1027 assert(element.resolutionState == STATE_NOT_STARTED); | 1027 assert(element.resolutionState == STATE_NOT_STARTED); |
| 1028 element.resolutionState = STATE_STARTED; | 1028 element.resolutionState = STATE_STARTED; |
| 1029 Typedef node = element.parseNode(parsingContext); | 1029 Typedef node = element.parseNode(parsingContext); |
| 1030 TypedefResolverVisitor visitor = | 1030 TypedefResolverVisitor visitor = |
| 1031 new TypedefResolverVisitor(resolution, element, registry); | 1031 new TypedefResolverVisitor(resolution, element, registry); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1123 TreeElements get treeElements { | 1123 TreeElements get treeElements { |
| 1124 assert(invariant(this, _treeElements != null, | 1124 assert(invariant(this, _treeElements != null, |
| 1125 message: "TreeElements have not been computed for $this.")); | 1125 message: "TreeElements have not been computed for $this.")); |
| 1126 return _treeElements; | 1126 return _treeElements; |
| 1127 } | 1127 } |
| 1128 | 1128 |
| 1129 void reuseElement() { | 1129 void reuseElement() { |
| 1130 _treeElements = null; | 1130 _treeElements = null; |
| 1131 } | 1131 } |
| 1132 } | 1132 } |
| OLD | NEW |