Chromium Code Reviews| 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 import '../commandline_options.dart'; | 8 import '../commandline_options.dart'; |
| 9 import '../common.dart'; | 9 import '../common.dart'; |
| 10 import '../common/backend_api.dart'; | 10 import '../common/backend_api.dart'; |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 122 } | 122 } |
| 123 | 123 |
| 124 @override | 124 @override |
| 125 WorldImpact computeWorldImpact(Element element) { | 125 WorldImpact computeWorldImpact(Element element) { |
| 126 ResolutionImpact resolutionImpact = getResolutionImpact(element); | 126 ResolutionImpact resolutionImpact = getResolutionImpact(element); |
| 127 assert(invariant(element, resolutionImpact != null, | 127 assert(invariant(element, resolutionImpact != null, |
| 128 message: 'No impact found for $element (${element.library})')); | 128 message: 'No impact found for $element (${element.library})')); |
| 129 if (element is ExecutableElement) { | 129 if (element is ExecutableElement) { |
| 130 getResolvedAst(element); | 130 getResolvedAst(element); |
| 131 } | 131 } |
| 132 if (element.isField && !element.isConst) { | |
| 133 FieldElement field = element; | |
| 134 if (field.isTopLevel || field.isStatic) { | |
| 135 if (field.constant == null) { | |
| 136 // TODO(johnniwinther): Find a cleaner way to do this. Maybe | |
|
Siggi Cherem (dart-lang)
2016/05/31 16:48:11
Is this the first call to register something that
Johnni Winther
2016/06/02 09:25:44
I'll look into it now (I have a solution in mind).
| |
| 137 // `Feature.LAZY_FIELD` of the resolution impact should be used | |
| 138 // instead. | |
| 139 _compiler.backend.constants.registerLazyStatic(element); | |
| 140 } | |
| 141 } | |
| 142 } | |
| 132 return _impactTransformer.transformResolutionImpact(resolutionImpact); | 143 return _impactTransformer.transformResolutionImpact(resolutionImpact); |
| 133 } | 144 } |
| 134 | 145 |
| 135 @override | 146 @override |
| 136 bool isDeserialized(Element element) { | 147 bool isDeserialized(Element element) { |
| 137 return deserializedLibraries.contains(element.library); | 148 return deserializedLibraries.contains(element.library); |
| 138 } | 149 } |
| 139 } | 150 } |
| 140 | 151 |
| 141 const String WORLD_IMPACT_TAG = 'worldImpact'; | 152 const String WORLD_IMPACT_TAG = 'worldImpact'; |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 245 } | 256 } |
| 246 | 257 |
| 247 @override | 258 @override |
| 248 void onElement(Element element, ObjectDecoder getDecoder(String tag)) { | 259 void onElement(Element element, ObjectDecoder getDecoder(String tag)) { |
| 249 ObjectDecoder decoder = getDecoder(RESOLVED_AST_TAG); | 260 ObjectDecoder decoder = getDecoder(RESOLVED_AST_TAG); |
| 250 if (decoder != null) { | 261 if (decoder != null) { |
| 251 _decoderMap[element] = decoder; | 262 _decoderMap[element] = decoder; |
| 252 } | 263 } |
| 253 } | 264 } |
| 254 } | 265 } |
| OLD | NEW |