Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(320)

Side by Side Diff: pkg/compiler/lib/src/deferred_load.dart

Issue 2685573002: Replace Backend with JavaScriptBackend. (Closed)
Patch Set: Updated cf. comment Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/enqueue.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 deferred_load; 5 library deferred_load;
6 6
7 import 'common/backend_api.dart' show Backend;
8 import 'common/tasks.dart' show CompilerTask; 7 import 'common/tasks.dart' show CompilerTask;
9 import 'common.dart'; 8 import 'common.dart';
10 import 'compiler.dart' show Compiler; 9 import 'compiler.dart' show Compiler;
11 import 'constants/expressions.dart' show ConstantExpression; 10 import 'constants/expressions.dart' show ConstantExpression;
12 import 'constants/values.dart' 11 import 'constants/values.dart'
13 show 12 show
14 ConstantValue, 13 ConstantValue,
15 ConstructedConstantValue, 14 ConstructedConstantValue,
16 DeferredConstantValue, 15 DeferredConstantValue,
17 StringConstantValue; 16 StringConstantValue;
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 149
151 Set<Element> _mainElements = new Set<Element>(); 150 Set<Element> _mainElements = new Set<Element>();
152 151
153 final Compiler compiler; 152 final Compiler compiler;
154 DeferredLoadTask(Compiler compiler) 153 DeferredLoadTask(Compiler compiler)
155 : compiler = compiler, 154 : compiler = compiler,
156 super(compiler.measurer) { 155 super(compiler.measurer) {
157 mainOutputUnit.imports.add(_fakeMainImport); 156 mainOutputUnit.imports.add(_fakeMainImport);
158 } 157 }
159 158
160 Backend get backend => compiler.backend; 159 JavaScriptBackend get backend => compiler.backend;
161 DiagnosticReporter get reporter => compiler.reporter; 160 DiagnosticReporter get reporter => compiler.reporter;
162 161
163 /// Returns the [OutputUnit] where [element] belongs. 162 /// Returns the [OutputUnit] where [element] belongs.
164 OutputUnit outputUnitForElement(Element element) { 163 OutputUnit outputUnitForElement(Element element) {
165 if (!isProgramSplit) return mainOutputUnit; 164 if (!isProgramSplit) return mainOutputUnit;
166 165
167 element = element.implementation; 166 element = element.implementation;
168 while (!_elementToOutputUnit.containsKey(element)) { 167 while (!_elementToOutputUnit.containsKey(element)) {
169 // TODO(21051): workaround: it looks like we output annotation constants 168 // TODO(21051): workaround: it looks like we output annotation constants
170 // for classes that we don't include in the output. This seems to happen 169 // for classes that we don't include in the output. This seems to happen
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after
1052 1051
1053 bool operator ==(other) { 1052 bool operator ==(other) {
1054 if (other is! _DeclaredDeferredImport) return false; 1053 if (other is! _DeclaredDeferredImport) return false;
1055 return declaration == other.declaration; 1054 return declaration == other.declaration;
1056 } 1055 }
1057 1056
1058 int get hashCode => declaration.hashCode * 17; 1057 int get hashCode => declaration.hashCode * 17;
1059 1058
1060 String toString() => '$declaration'; 1059 String toString() => '$declaration';
1061 } 1060 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/enqueue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698