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

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

Issue 2995253002: DeferredTask.isDeferredClass Element->Entity (Closed)
Patch Set: Created 3 years, 4 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 | « no previous file | tests/compiler/dart2js_extra/dart2js_extra.status » ('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/tasks.dart' show CompilerTask; 7 import 'common/tasks.dart' show CompilerTask;
8 import 'common.dart'; 8 import 'common.dart';
9 import 'compiler.dart' show Compiler; 9 import 'compiler.dart' show Compiler;
10 import 'constants/expressions.dart' show ConstantExpression; 10 import 'constants/expressions.dart' show ConstantExpression;
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 OutputUnit outputUnitForConstant(ConstantValue constant) { 205 OutputUnit outputUnitForConstant(ConstantValue constant) {
206 if (!isProgramSplit) return mainOutputUnit; 206 if (!isProgramSplit) return mainOutputUnit;
207 return _constantToOutputUnit[constant]; 207 return _constantToOutputUnit[constant];
208 } 208 }
209 209
210 /// Direct access to the output-unit to constants map used for testing. 210 /// Direct access to the output-unit to constants map used for testing.
211 Map<ConstantValue, OutputUnit> get outputUnitForConstantsForTesting { 211 Map<ConstantValue, OutputUnit> get outputUnitForConstantsForTesting {
212 return _constantToOutputUnit; 212 return _constantToOutputUnit;
213 } 213 }
214 214
215 bool isDeferred(Element element) { 215 bool isDeferred(Entity element) {
216 return outputUnitForElement(element) != mainOutputUnit; 216 return outputUnitForElement(element) != mainOutputUnit;
217 } 217 }
218 218
219 bool isDeferredClass(ClassElement element) { 219 bool isDeferredClass(ClassEntity element) {
220 return outputUnitForElement(element) != mainOutputUnit; 220 return outputUnitForElement(element) != mainOutputUnit;
221 } 221 }
222 222
223 /// Returns the unique name for the deferred import of [prefix]. 223 /// Returns the unique name for the deferred import of [prefix].
224 String getImportDeferName(Spannable node, PrefixElement prefix) { 224 String getImportDeferName(Spannable node, PrefixElement prefix) {
225 String name = 225 String name =
226 importDeferName[new _DeclaredDeferredImport(prefix.deferredImport)]; 226 importDeferName[new _DeclaredDeferredImport(prefix.deferredImport)];
227 if (name == null) { 227 if (name == null) {
228 reporter.internalError(node, "No deferred name for $prefix."); 228 reporter.internalError(node, "No deferred name for $prefix.");
229 } 229 }
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after
1118 1118
1119 bool operator ==(other) { 1119 bool operator ==(other) {
1120 if (other is! _DeclaredDeferredImport) return false; 1120 if (other is! _DeclaredDeferredImport) return false;
1121 return declaration == other.declaration; 1121 return declaration == other.declaration;
1122 } 1122 }
1123 1123
1124 int get hashCode => declaration.hashCode * 17; 1124 int get hashCode => declaration.hashCode * 17;
1125 1125
1126 String toString() => '$declaration'; 1126 String toString() => '$declaration';
1127 } 1127 }
OLDNEW
« no previous file with comments | « no previous file | tests/compiler/dart2js_extra/dart2js_extra.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698