| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 fasta.kernel_target; | 5 library fasta.kernel_target; |
| 6 | 6 |
| 7 import 'dart:async' show Future; | 7 import 'dart:async' show Future; |
| 8 | 8 |
| 9 import 'dart:io' show File, IOSink; | 9 import 'dart:io' show File, IOSink; |
| 10 | 10 |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 loader.computeLibraryScopes(); | 224 loader.computeLibraryScopes(); |
| 225 loader.resolveTypes(); | 225 loader.resolveTypes(); |
| 226 loader.buildProgram(); | 226 loader.buildProgram(); |
| 227 loader.checkSemantics(); | 227 loader.checkSemantics(); |
| 228 List<SourceClassBuilder> sourceClasses = collectAllSourceClasses(); | 228 List<SourceClassBuilder> sourceClasses = collectAllSourceClasses(); |
| 229 installDefaultSupertypes(); | 229 installDefaultSupertypes(); |
| 230 installDefaultConstructors(sourceClasses); | 230 installDefaultConstructors(sourceClasses); |
| 231 loader.resolveConstructors(); | 231 loader.resolveConstructors(); |
| 232 loader.finishTypeVariables(objectClassBuilder); | 232 loader.finishTypeVariables(objectClassBuilder); |
| 233 program = link(new List<Library>.from(loader.libraries)); | 233 program = link(new List<Library>.from(loader.libraries)); |
| 234 loader.computeHierarchy(program); |
| 235 loader.checkOverrides(sourceClasses); |
| 234 if (uri == null) return program; | 236 if (uri == null) return program; |
| 235 return await writeLinkedProgram(uri, program, isFullProgram: false); | 237 return await writeLinkedProgram(uri, program, isFullProgram: false); |
| 236 } on InputError catch (e) { | 238 } on InputError catch (e) { |
| 237 return handleInputError(uri, e, isFullProgram: false); | 239 return handleInputError(uri, e, isFullProgram: false); |
| 238 } catch (e, s) { | 240 } catch (e, s) { |
| 239 return reportCrash(e, s, loader?.currentUriForCrashReporting); | 241 return reportCrash(e, s, loader?.currentUriForCrashReporting); |
| 240 } | 242 } |
| 241 } | 243 } |
| 242 | 244 |
| 243 Future<Program> writeProgram(Uri uri, | 245 Future<Program> writeProgram(Uri uri, |
| 244 {bool dumpIr: false, bool verify: false}) async { | 246 {bool dumpIr: false, bool verify: false}) async { |
| 245 if (loader.first == null) return null; | 247 if (loader.first == null) return null; |
| 246 if (errors.isNotEmpty) { | 248 if (errors.isNotEmpty) { |
| 247 return handleInputError(uri, null, isFullProgram: true); | 249 return handleInputError(uri, null, isFullProgram: true); |
| 248 } | 250 } |
| 249 try { | 251 try { |
| 250 loader.computeHierarchy(program); | |
| 251 await loader.buildBodies(); | 252 await loader.buildBodies(); |
| 252 loader.finishStaticInvocations(); | 253 loader.finishStaticInvocations(); |
| 253 finishAllConstructors(); | 254 finishAllConstructors(); |
| 254 loader.finishNativeMethods(); | 255 loader.finishNativeMethods(); |
| 255 transformMixinApplications(); | 256 transformMixinApplications(); |
| 256 // TODO(ahe): Don't call this from two different places. | 257 // TODO(ahe): Don't call this from two different places. |
| 257 setup_builtin_library.transformProgram(program); | 258 setup_builtin_library.transformProgram(program); |
| 258 otherTransformations(); | 259 otherTransformations(); |
| 259 if (dumpIr) this.dumpIr(); | 260 if (dumpIr) this.dumpIr(); |
| 260 if (verify) this.verify(); | 261 if (verify) this.verify(); |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 } | 669 } |
| 669 for (Constructor constructor in superclass.constructors) { | 670 for (Constructor constructor in superclass.constructors) { |
| 670 if (constructor.name.name.isEmpty) { | 671 if (constructor.name.name.isEmpty) { |
| 671 return constructor.function.requiredParameterCount == 0 | 672 return constructor.function.requiredParameterCount == 0 |
| 672 ? constructor | 673 ? constructor |
| 673 : null; | 674 : null; |
| 674 } | 675 } |
| 675 } | 676 } |
| 676 return null; | 677 return null; |
| 677 } | 678 } |
| OLD | NEW |