| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 | 6 |
| 7 import 'package:front_end/compilation_message.dart'; | 7 import 'package:front_end/compilation_message.dart'; |
| 8 import 'package:front_end/compiler_options.dart'; | 8 import 'package:front_end/compiler_options.dart'; |
| 9 import 'package:front_end/file_system.dart'; | 9 import 'package:front_end/file_system.dart'; |
| 10 import 'package:front_end/src/base/performace_logger.dart'; | 10 import 'package:front_end/src/base/performace_logger.dart'; |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 _ensureSdkDefaults(); | 82 _ensureSdkDefaults(); |
| 83 return _sdkRoot; | 83 return _sdkRoot; |
| 84 } | 84 } |
| 85 | 85 |
| 86 Uri _sdkSummary; | 86 Uri _sdkSummary; |
| 87 Uri get sdkSummary { | 87 Uri get sdkSummary { |
| 88 _ensureSdkDefaults(); | 88 _ensureSdkDefaults(); |
| 89 return _sdkSummary; | 89 return _sdkSummary; |
| 90 } | 90 } |
| 91 | 91 |
| 92 List<int> _sdkSummaryBytes; |
| 93 |
| 94 /// Get the bytes of the SDK outline, if any. |
| 95 Future<List<int>> loadSdkSummaryBytes() async { |
| 96 if (_sdkSummaryBytes == null) { |
| 97 if (sdkSummary == null) return null; |
| 98 var entry = fileSystem.entityForUri(sdkSummary); |
| 99 _sdkSummaryBytes = await entry.readAsBytes(); |
| 100 } |
| 101 return _sdkSummaryBytes; |
| 102 } |
| 103 |
| 92 Uri _librariesSpecificationUri; | 104 Uri _librariesSpecificationUri; |
| 93 Uri get librariesSpecificationUri { | 105 Uri get librariesSpecificationUri { |
| 94 _ensureSdkDefaults(); | 106 _ensureSdkDefaults(); |
| 95 return _librariesSpecificationUri; | 107 return _librariesSpecificationUri; |
| 96 } | 108 } |
| 97 | 109 |
| 98 Ticker ticker; | 110 Ticker ticker; |
| 99 | 111 |
| 100 bool get verbose => _raw.verbose; | 112 bool get verbose => _raw.verbose; |
| 101 | 113 |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 | 245 |
| 234 Target _target; | 246 Target _target; |
| 235 Target get target => _target ??= | 247 Target get target => _target ??= |
| 236 _raw.target ?? new VmFastaTarget(new TargetFlags(strongMode: strongMode)); | 248 _raw.target ?? new VmFastaTarget(new TargetFlags(strongMode: strongMode)); |
| 237 | 249 |
| 238 /// Get an outline program that summarizes the SDK, if any. | 250 /// Get an outline program that summarizes the SDK, if any. |
| 239 // TODO(sigmund): move, this doesn't feel like an "option". | 251 // TODO(sigmund): move, this doesn't feel like an "option". |
| 240 Future<Program> loadSdkSummary(CanonicalName nameRoot) async { | 252 Future<Program> loadSdkSummary(CanonicalName nameRoot) async { |
| 241 if (_sdkSummaryProgram == null) { | 253 if (_sdkSummaryProgram == null) { |
| 242 if (sdkSummary == null) return null; | 254 if (sdkSummary == null) return null; |
| 243 var bytes = await fileSystem.entityForUri(sdkSummary).readAsBytes(); | 255 var bytes = await loadSdkSummaryBytes(); |
| 244 _sdkSummaryProgram = loadProgram(bytes, nameRoot); | 256 _sdkSummaryProgram = loadProgram(bytes, nameRoot); |
| 245 } | 257 } |
| 246 return _sdkSummaryProgram; | 258 return _sdkSummaryProgram; |
| 247 } | 259 } |
| 248 | 260 |
| 249 /// Get the summary programs for each of the underlying `inputSummaries` | 261 /// Get the summary programs for each of the underlying `inputSummaries` |
| 250 /// provided via [CompilerOptions]. | 262 /// provided via [CompilerOptions]. |
| 251 // TODO(sigmund): move, this doesn't feel like an "option". | 263 // TODO(sigmund): move, this doesn't feel like an "option". |
| 252 Future<List<Program>> loadInputSummaries(CanonicalName nameRoot) async { | 264 Future<List<Program>> loadInputSummaries(CanonicalName nameRoot) async { |
| 253 if (_inputSummariesPrograms == null) { | 265 if (_inputSummariesPrograms == null) { |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 String get dart2jsCode => _original.code.dart2jsCode; | 614 String get dart2jsCode => _original.code.dart2jsCode; |
| 603 | 615 |
| 604 SourceSpan get span => | 616 SourceSpan get span => |
| 605 new SourceLocation(_original.charOffset, sourceUrl: _original.uri) | 617 new SourceLocation(_original.charOffset, sourceUrl: _original.uri) |
| 606 .pointSpan(); | 618 .pointSpan(); |
| 607 | 619 |
| 608 _CompilationMessage(this._original, this.severity); | 620 _CompilationMessage(this._original, this.severity); |
| 609 | 621 |
| 610 String toString() => message; | 622 String toString() => message; |
| 611 } | 623 } |
| OLD | NEW |