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

Side by Side Diff: pkg/compiler/lib/src/serialization/system.dart

Issue 2023863002: Register deserialized lazy statics. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 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) 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
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
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 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/constant_handler_javascript.dart ('k') | tests/compiler/dart2js/serialization/model_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698