OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 dart2js.serialization_system; | 5 library dart2js.serialization_system; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import '../common.dart'; | 9 import '../common.dart'; |
10 import '../common/resolution.dart'; | 10 import '../common/resolution.dart'; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 if (element is ExecutableElement) { | 93 if (element is ExecutableElement) { |
94 getResolvedAst(element); | 94 getResolvedAst(element); |
95 } | 95 } |
96 if (element.isField && !element.isConst) { | 96 if (element.isField && !element.isConst) { |
97 FieldElement field = element; | 97 FieldElement field = element; |
98 if (field.isTopLevel || field.isStatic) { | 98 if (field.isTopLevel || field.isStatic) { |
99 if (field.constant == null) { | 99 if (field.constant == null) { |
100 // TODO(johnniwinther): Find a cleaner way to do this. Maybe | 100 // TODO(johnniwinther): Find a cleaner way to do this. Maybe |
101 // `Feature.LAZY_FIELD` of the resolution impact should be used | 101 // `Feature.LAZY_FIELD` of the resolution impact should be used |
102 // instead. | 102 // instead. |
103 _compiler.backend.constants.registerLazyStatic(field); | 103 _compiler.backend.constants.registerLazyStatic(element); |
104 } | 104 } |
105 } | 105 } |
106 } | 106 } |
107 return resolution.transformResolutionImpact(element, resolutionImpact); | 107 return resolution.transformResolutionImpact(element, resolutionImpact); |
108 } | 108 } |
109 | 109 |
110 @override | 110 @override |
111 bool isDeserialized(Element element) { | 111 bool isDeserialized(Element element) { |
112 return deserializedLibraries.contains(element.library); | 112 return deserializedLibraries.contains(element.library); |
113 } | 113 } |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 } | 324 } |
325 | 325 |
326 @override | 326 @override |
327 void onElement(Element element, ObjectDecoder getDecoder(String tag)) { | 327 void onElement(Element element, ObjectDecoder getDecoder(String tag)) { |
328 ObjectDecoder decoder = getDecoder(RESOLVED_AST_TAG); | 328 ObjectDecoder decoder = getDecoder(RESOLVED_AST_TAG); |
329 if (decoder != null) { | 329 if (decoder != null) { |
330 _decoderMap[element] = decoder; | 330 _decoderMap[element] = decoder; |
331 } | 331 } |
332 } | 332 } |
333 } | 333 } |
OLD | NEW |