| 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.target_implementation; | 5 library fasta.target_implementation; |
| 6 | 6 |
| 7 import 'package:kernel/target/targets.dart' as backend show Target; | 7 import 'package:kernel/target/targets.dart' as backend show Target; |
| 8 | 8 |
| 9 import 'builder/builder.dart' show Builder, ClassBuilder, LibraryBuilder; | 9 import 'builder/builder.dart' show Builder, ClassBuilder, LibraryBuilder; |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 Builder cachedCompileTimeError; | 31 Builder cachedCompileTimeError; |
| 32 Builder cachedAbstractClassInstantiationError; | 32 Builder cachedAbstractClassInstantiationError; |
| 33 Builder cachedNativeAnnotation; | 33 Builder cachedNativeAnnotation; |
| 34 | 34 |
| 35 TargetImplementation(Ticker ticker, this.uriTranslator, this.backendTarget) | 35 TargetImplementation(Ticker ticker, this.uriTranslator, this.backendTarget) |
| 36 : super(ticker); | 36 : super(ticker); |
| 37 | 37 |
| 38 /// Creates a [LibraryBuilder] corresponding to [uri], if one doesn't exist | 38 /// Creates a [LibraryBuilder] corresponding to [uri], if one doesn't exist |
| 39 /// already. | 39 /// already. |
| 40 LibraryBuilder createLibraryBuilder(Uri uri, Uri fileUri); | 40 LibraryBuilder createLibraryBuilder(Uri uri, Uri fileUri, bool isPatch); |
| 41 | 41 |
| 42 /// Add the classes extended or implemented directly by [cls] to [set]. | 42 /// Add the classes extended or implemented directly by [cls] to [set]. |
| 43 void addDirectSupertype(ClassBuilder cls, Set<ClassBuilder> set); | 43 void addDirectSupertype(ClassBuilder cls, Set<ClassBuilder> set); |
| 44 | 44 |
| 45 /// Returns all classes that will be included in the resulting program. | 45 /// Returns all classes that will be included in the resulting program. |
| 46 List<ClassBuilder> collectAllClasses(); | 46 List<ClassBuilder> collectAllClasses(); |
| 47 | 47 |
| 48 /// The class [cls] is involved in a cyclic definition. This method should | 48 /// The class [cls] is involved in a cyclic definition. This method should |
| 49 /// ensure that the cycle is broken, for example, by removing superclass and | 49 /// ensure that the cycle is broken, for example, by removing superclass and |
| 50 /// implemented interfaces. | 50 /// implemented interfaces. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 } | 88 } |
| 89 } | 89 } |
| 90 | 90 |
| 91 Token skipNativeClause(Token token) => vm.skipNativeClause(token); | 91 Token skipNativeClause(Token token) => vm.skipNativeClause(token); |
| 92 | 92 |
| 93 String extractNativeMethodName(Token token) => | 93 String extractNativeMethodName(Token token) => |
| 94 unescapeString(token.next.lexeme); | 94 unescapeString(token.next.lexeme); |
| 95 | 95 |
| 96 void addSourceInformation( | 96 void addSourceInformation( |
| 97 Uri uri, List<int> lineStarts, List<int> sourceCode); | 97 Uri uri, List<int> lineStarts, List<int> sourceCode); |
| 98 |
| 99 void readPatchFiles(LibraryBuilder library) { |
| 100 assert(library.uri.scheme == "dart"); |
| 101 List<Uri> patches = uriTranslator.patches[library.uri.path]; |
| 102 if (patches != null) { |
| 103 for (Uri patch in patches) { |
| 104 library.loader.read(patch, -1, fileUri: patch, isPatch: true); |
| 105 } |
| 106 } |
| 107 } |
| 98 } | 108 } |
| OLD | NEW |