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

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

Issue 1170673002: Begin to compute constant expressions in resolution. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fix BinaryConstantExpression.getKnownType Created 5 years, 6 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
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 'constants/expressions.dart'; 7 import 'constants/expressions.dart';
8 import 'constants/values.dart' show 8 import 'constants/values.dart' show
9 ConstantValue, 9 ConstantValue,
10 ConstructedConstantValue, 10 ConstructedConstantValue,
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 279
280 for (Element dependency in treeElements.allElements) { 280 for (Element dependency in treeElements.allElements) {
281 if (dependency.isLocal && !dependency.isFunction) continue; 281 if (dependency.isLocal && !dependency.isFunction) continue;
282 if (dependency.isErroneous) continue; 282 if (dependency.isErroneous) continue;
283 if (dependency.isTypeVariable) continue; 283 if (dependency.isTypeVariable) continue;
284 284
285 elements.add(dependency); 285 elements.add(dependency);
286 } 286 }
287 treeElements.forEachConstantNode((Node node, _) { 287 treeElements.forEachConstantNode((Node node, _) {
288 // Explicitly depend on the backend constants. 288 // Explicitly depend on the backend constants.
289 constants.add( 289 ConstantValue value =
290 backend.constants.getConstantValueForNode(node, treeElements)); 290 backend.constants.getConstantValueForNode(node, treeElements);
291 if (value != null) {
292 // TODO(johnniwinther): Assert that all constants have values when
293 // these are directly evaluated.
294 constants.add(value);
295 }
291 }); 296 });
292 elements.addAll(treeElements.otherDependencies); 297 elements.addAll(treeElements.otherDependencies);
293 } 298 }
294 299
295 // TODO(sigurdm): How is metadata on a patch-class handled? 300 // TODO(sigurdm): How is metadata on a patch-class handled?
296 for (MetadataAnnotation metadata in element.metadata) { 301 for (MetadataAnnotation metadata in element.metadata) {
297 ConstantValue constant = 302 ConstantValue constant =
298 backend.constants.getConstantValueForMetadata(metadata); 303 backend.constants.getConstantValueForMetadata(metadata);
299 if (constant != null) { 304 if (constant != null) {
300 constants.add(constant); 305 constants.add(constant);
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 _importingLibrary = importingLibrary; 895 _importingLibrary = importingLibrary;
891 896
892 String get importingLibraryName { 897 String get importingLibraryName {
893 String libraryName = _importingLibrary.getLibraryName(); 898 String libraryName = _importingLibrary.getLibraryName();
894 return libraryName == "" 899 return libraryName == ""
895 ? "<unnamed>" 900 ? "<unnamed>"
896 : libraryName; 901 : libraryName;
897 } 902 }
898 903
899 } 904 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/core_types.dart ('k') | pkg/compiler/lib/src/js_backend/constant_handler_javascript.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698