| 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 library dart2js.serialization.task; | 5 library dart2js.serialization.task; |
| 6 | 6 |
| 7 import 'dart:async' show EventSink, Future; | 7 import 'dart:async' show EventSink, Future; |
| 8 import '../common.dart'; | 8 import '../common.dart'; |
| 9 import '../common/resolution.dart' show ResolutionImpact, ResolutionWorkItem; | 9 import '../common/resolution.dart' show ResolutionImpact, ResolutionWorkItem; |
| 10 import '../common/tasks.dart' show CompilerTask; | 10 import '../common/tasks.dart' show CompilerTask; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 sink | 110 sink |
| 111 ..add(createSerializer(libraries) | 111 ..add(createSerializer(libraries) |
| 112 .toText(const JsonSerializationEncoder())) | 112 .toText(const JsonSerializationEncoder())) |
| 113 ..close(); | 113 ..close(); |
| 114 }); | 114 }); |
| 115 } | 115 } |
| 116 | 116 |
| 117 void deserializeFromText(Uri sourceUri, String serializedData) { | 117 void deserializeFromText(Uri sourceUri, String serializedData) { |
| 118 measure(() { | 118 measure(() { |
| 119 if (deserializer == null) { | 119 if (deserializer == null) { |
| 120 deserializer = new DeserializerSystemImpl( | 120 deserializer = new DeserializerSystemImpl(compiler); |
| 121 compiler, compiler.backend.impactTransformer); | |
| 122 } | 121 } |
| 123 DeserializerSystemImpl deserializerImpl = deserializer; | 122 DeserializerSystemImpl deserializerImpl = deserializer; |
| 124 DeserializationContext context = deserializerImpl.deserializationContext; | 123 DeserializationContext context = deserializerImpl.deserializationContext; |
| 125 Deserializer dataDeserializer = new Deserializer.fromText( | 124 Deserializer dataDeserializer = new Deserializer.fromText( |
| 126 context, sourceUri, serializedData, const JsonSerializationDecoder()); | 125 context, sourceUri, serializedData, const JsonSerializationDecoder()); |
| 127 context.deserializers.add(dataDeserializer); | 126 context.deserializers.add(dataDeserializer); |
| 128 }); | 127 }); |
| 129 } | 128 } |
| 130 } | 129 } |
| 131 | 130 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 156 /// elements. | 155 /// elements. |
| 157 abstract class DeserializerSystem { | 156 abstract class DeserializerSystem { |
| 158 Future<LibraryElement> readLibrary(Uri resolvedUri); | 157 Future<LibraryElement> readLibrary(Uri resolvedUri); |
| 159 bool isDeserialized(Element element); | 158 bool isDeserialized(Element element); |
| 160 bool hasResolvedAst(ExecutableElement element); | 159 bool hasResolvedAst(ExecutableElement element); |
| 161 ResolvedAst getResolvedAst(ExecutableElement element); | 160 ResolvedAst getResolvedAst(ExecutableElement element); |
| 162 bool hasResolutionImpact(Element element); | 161 bool hasResolutionImpact(Element element); |
| 163 ResolutionImpact getResolutionImpact(Element element); | 162 ResolutionImpact getResolutionImpact(Element element); |
| 164 WorldImpact computeWorldImpact(Element element); | 163 WorldImpact computeWorldImpact(Element element); |
| 165 } | 164 } |
| OLD | NEW |