| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 /// Implementation of the element model used for deserialiation. | 5 /// Implementation of the element model used for deserialiation. |
| 6 /// | 6 /// |
| 7 /// These classes are created by [ElementDeserializer] triggered by the | 7 /// These classes are created by [ElementDeserializer] triggered by the |
| 8 /// [Deserializer]. | 8 /// [Deserializer]. |
| 9 | 9 |
| 10 library dart2js.serialization.modelz; | 10 library dart2js.serialization.modelz; |
| 11 | 11 |
| 12 import '../common.dart'; | 12 import '../common.dart'; |
| 13 import '../common/resolution.dart' show | 13 import '../common/resolution.dart' show |
| 14 Resolution; | 14 Resolution; |
| 15 import '../compiler.dart' | |
| 16 show Compiler; | |
| 17 import '../constants/constructors.dart'; | 15 import '../constants/constructors.dart'; |
| 18 import '../constants/expressions.dart'; | 16 import '../constants/expressions.dart'; |
| 19 import '../core_types.dart'; | 17 import '../core_types.dart'; |
| 20 import '../dart_types.dart'; | 18 import '../dart_types.dart'; |
| 21 import '../elements/elements.dart'; | 19 import '../elements/elements.dart'; |
| 22 import '../elements/modelx.dart' show | 20 import '../elements/modelx.dart' show |
| 23 FunctionSignatureX; | 21 FunctionSignatureX; |
| 24 import '../elements/common.dart'; | 22 import '../elements/common.dart'; |
| 25 import '../elements/visitor.dart'; | 23 import '../elements/visitor.dart'; |
| 26 import '../io/source_file.dart'; | 24 import '../io/source_file.dart'; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 87 |
| 90 @override | 88 @override |
| 91 Element get enclosingClassOrCompilationUnit { | 89 Element get enclosingClassOrCompilationUnit { |
| 92 return _unsupported('enclosingClassOrCompilationUnit'); | 90 return _unsupported('enclosingClassOrCompilationUnit'); |
| 93 } | 91 } |
| 94 | 92 |
| 95 @override | 93 @override |
| 96 String get fixedBackendName => _unsupported('fixedBackendName'); | 94 String get fixedBackendName => _unsupported('fixedBackendName'); |
| 97 | 95 |
| 98 @override | 96 @override |
| 99 bool get hasFixedBackendName => _unsupported('hasFixedBackendName'); | |
| 100 | |
| 101 @override | |
| 102 LibraryElement get implementationLibrary => library; | 97 LibraryElement get implementationLibrary => library; |
| 103 | 98 |
| 104 @override | 99 @override |
| 105 bool get isAbstract => false; | 100 bool get isAbstract => false; |
| 106 | 101 |
| 107 @override | 102 @override |
| 108 bool get isAssignable => _unsupported('isAssignable'); | 103 bool get isAssignable => _unsupported('isAssignable'); |
| 109 | 104 |
| 110 @override | 105 @override |
| 111 bool get isClassMember => false; | 106 bool get isClassMember => false; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 125 @override | 120 @override |
| 126 bool get isInstanceMember => false; | 121 bool get isInstanceMember => false; |
| 127 | 122 |
| 128 @override | 123 @override |
| 129 bool get isLocal => false; | 124 bool get isLocal => false; |
| 130 | 125 |
| 131 @override | 126 @override |
| 132 bool get isMixinApplication => false; | 127 bool get isMixinApplication => false; |
| 133 | 128 |
| 134 @override | 129 @override |
| 135 bool get isNative => false; | |
| 136 | |
| 137 @override | |
| 138 bool get isJsInterop => false; | |
| 139 | |
| 140 @override | |
| 141 String get jsInteropName => null; | |
| 142 | |
| 143 @override | |
| 144 bool get isOperator => false; | 130 bool get isOperator => false; |
| 145 | 131 |
| 146 @override | 132 @override |
| 147 bool get isStatic => false; | 133 bool get isStatic => false; |
| 148 | 134 |
| 149 // TODO(johnniwinther): Find a more precise semantics for this. | 135 // TODO(johnniwinther): Find a more precise semantics for this. |
| 150 @override | 136 @override |
| 151 bool get isSynthesized => true; | 137 bool get isSynthesized => true; |
| 152 | 138 |
| 153 @override | 139 @override |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 ContainerMixin, | 354 ContainerMixin, |
| 369 LibraryElementCommon | 355 LibraryElementCommon |
| 370 implements LibraryElement { | 356 implements LibraryElement { |
| 371 Uri _canonicalUri; | 357 Uri _canonicalUri; |
| 372 CompilationUnitElement _entryCompilationUnit; | 358 CompilationUnitElement _entryCompilationUnit; |
| 373 Link<CompilationUnitElement> _compilationUnits; | 359 Link<CompilationUnitElement> _compilationUnits; |
| 374 List<ImportElement> _imports; | 360 List<ImportElement> _imports; |
| 375 List<ExportElement> _exports; | 361 List<ExportElement> _exports; |
| 376 ListedContainer _exportsMap; | 362 ListedContainer _exportsMap; |
| 377 ListedContainer _importsMap; | 363 ListedContainer _importsMap; |
| 378 Map<LibraryTag, LibraryElement> _libraryDependencies; | |
| 379 | 364 |
| 380 LibraryElementZ(ObjectDecoder decoder) | 365 LibraryElementZ(ObjectDecoder decoder) |
| 381 : super(decoder); | 366 : super(decoder); |
| 382 | 367 |
| 383 @override | 368 @override |
| 384 ElementKind get kind => ElementKind.LIBRARY; | 369 ElementKind get kind => ElementKind.LIBRARY; |
| 385 | 370 |
| 386 @override | 371 @override |
| 387 Element get enclosingElement => null; | 372 Element get enclosingElement => null; |
| 388 | 373 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 } | 441 } |
| 457 return element; | 442 return element; |
| 458 } | 443 } |
| 459 | 444 |
| 460 @override | 445 @override |
| 461 Element findLocal(String elementName) { | 446 Element findLocal(String elementName) { |
| 462 return localLookup(elementName); | 447 return localLookup(elementName); |
| 463 } | 448 } |
| 464 | 449 |
| 465 @override | 450 @override |
| 466 bool get canUseNative => false; | |
| 467 | |
| 468 @override | |
| 469 Element findExported(String elementName) => _unsupported('findExported'); | 451 Element findExported(String elementName) => _unsupported('findExported'); |
| 470 | 452 |
| 471 void _ensureImports() { | 453 void _ensureImports() { |
| 472 if (_importsMap == null) { | 454 if (_importsMap == null) { |
| 473 _importsMap = new ListedContainer(_decoder.getElements(Key.IMPORT_SCOPE)); | 455 _importsMap = new ListedContainer(_decoder.getElements(Key.IMPORT_SCOPE)); |
| 474 } | 456 } |
| 475 } | 457 } |
| 476 | 458 |
| 477 @override | 459 @override |
| 478 void forEachImport(f(Element element)) { | 460 void forEachImport(f(Element element)) { |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 886 @override | 868 @override |
| 887 ConstructorElement lookupDefaultConstructor() { | 869 ConstructorElement lookupDefaultConstructor() { |
| 888 ConstructorElement constructor = lookupConstructor(""); | 870 ConstructorElement constructor = lookupConstructor(""); |
| 889 if (constructor != null && constructor.parameters.isEmpty) { | 871 if (constructor != null && constructor.parameters.isEmpty) { |
| 890 return constructor; | 872 return constructor; |
| 891 } | 873 } |
| 892 return null; | 874 return null; |
| 893 } | 875 } |
| 894 | 876 |
| 895 @override | 877 @override |
| 896 String get nativeTagInfo => _unsupported('nativeTagInfo'); | |
| 897 | |
| 898 @override | |
| 899 void reverseBackendMembers() => _unsupported('reverseBackendMembers'); | 878 void reverseBackendMembers() => _unsupported('reverseBackendMembers'); |
| 900 | 879 |
| 901 @override | 880 @override |
| 902 ClassElement get superclass => supertype != null ? supertype.element : null; | 881 ClassElement get superclass => supertype != null ? supertype.element : null; |
| 903 | 882 |
| 904 @override | 883 @override |
| 905 void ensureResolved(Resolution resolution) { | 884 void ensureResolved(Resolution resolution) { |
| 906 resolution.registerClass(this); | 885 resolution.registerClass(this); |
| 907 } | 886 } |
| 908 } | 887 } |
| (...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1567 } | 1546 } |
| 1568 | 1547 |
| 1569 @override | 1548 @override |
| 1570 ElementKind get kind => ElementKind.PREFIX; | 1549 ElementKind get kind => ElementKind.PREFIX; |
| 1571 | 1550 |
| 1572 @override | 1551 @override |
| 1573 Element lookupLocalMember(String memberName) { | 1552 Element lookupLocalMember(String memberName) { |
| 1574 return _unsupported('lookupLocalMember'); | 1553 return _unsupported('lookupLocalMember'); |
| 1575 } | 1554 } |
| 1576 } | 1555 } |
| OLD | NEW |