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

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

Issue 1108913003: Use Map<FieldElement, ConstantValue> for fields in ConstructedConstantValue. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 7 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 | Annotate | Revision Log
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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 result = import.prefix.toString(); 506 result = import.prefix.toString();
507 } else { 507 } else {
508 Link<MetadataAnnotation> metadatas = import.metadata; 508 Link<MetadataAnnotation> metadatas = import.metadata;
509 assert(metadatas != null); 509 assert(metadatas != null);
510 for (MetadataAnnotation metadata in metadatas) { 510 for (MetadataAnnotation metadata in metadatas) {
511 metadata.ensureResolved(compiler); 511 metadata.ensureResolved(compiler);
512 Element element = 512 Element element =
513 metadata.constant.value.getType(compiler.coreTypes).element; 513 metadata.constant.value.getType(compiler.coreTypes).element;
514 if (element == deferredLibraryClass) { 514 if (element == deferredLibraryClass) {
515 ConstructedConstantValue constant = metadata.constant.value; 515 ConstructedConstantValue constant = metadata.constant.value;
516 StringConstantValue s = constant.fields[0]; 516 StringConstantValue s = constant.fields.values.single;
517 result = s.primitiveValue.slowToString(); 517 result = s.primitiveValue.slowToString();
518 break; 518 break;
519 } 519 }
520 } 520 }
521 } 521 }
522 assert(result != null); 522 assert(result != null);
523 importDeferName[import] = makeUnique(result, usedImportNames);; 523 importDeferName[import] = makeUnique(result, usedImportNames);;
524 } 524 }
525 525
526 int counter = 1; 526 int counter = 1;
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
860 _importingLibrary = importingLibrary; 860 _importingLibrary = importingLibrary;
861 861
862 String get importingLibraryName { 862 String get importingLibraryName {
863 String libraryName = _importingLibrary.getLibraryName(); 863 String libraryName = _importingLibrary.getLibraryName();
864 return libraryName == "" 864 return libraryName == ""
865 ? "<unnamed>" 865 ? "<unnamed>"
866 : libraryName; 866 : libraryName;
867 } 867 }
868 868
869 } 869 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/constants/values.dart ('k') | pkg/compiler/lib/src/js_backend/constant_emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698