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

Unified Diff: pkg/compiler/lib/src/serialization/impact_serialization.dart

Issue 1873573004: Serialize TreeElements (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Check only the last test to avoid timeout. Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/serialization/equivalence.dart ('k') | pkg/compiler/lib/src/serialization/keys.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/serialization/impact_serialization.dart
diff --git a/pkg/compiler/lib/src/serialization/impact_serialization.dart b/pkg/compiler/lib/src/serialization/impact_serialization.dart
index 8ab13073e34da27ff9262766a2cd91ee5f766a81..af3cf5d75fe52e6fa8a3373687f0fafc854384f3 100644
--- a/pkg/compiler/lib/src/serialization/impact_serialization.dart
+++ b/pkg/compiler/lib/src/serialization/impact_serialization.dart
@@ -1,4 +1,4 @@
-// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@@ -16,6 +16,7 @@ import '../util/enumset.dart';
import 'keys.dart';
import 'serialization.dart';
+import 'serialization_util.dart';
/// Visitor that serializes a [ResolutionImpact] object using an
/// [ObjectEncoder].
@@ -60,18 +61,7 @@ class ImpactSerializer implements WorldImpactVisitor {
@override
void visitDynamicUse(DynamicUse dynamicUse) {
ObjectEncoder object = dynamicUses.createObject();
- object.setEnum(Key.KIND, dynamicUse.selector.kind);
-
- object.setInt(
- Key.ARGUMENTS, dynamicUse.selector.callStructure.argumentCount);
- object.setStrings(
- Key.NAMED_ARGUMENTS, dynamicUse.selector.callStructure.namedArguments);
-
- object.setString(Key.NAME, dynamicUse.selector.memberName.text);
- object.setBool(Key.IS_SETTER, dynamicUse.selector.memberName.isSetter);
- if (dynamicUse.selector.memberName.library != null) {
- object.setElement(Key.LIBRARY, dynamicUse.selector.memberName.library);
- }
+ serializeSelector(dynamicUse.selector, object);
}
@override
@@ -136,17 +126,8 @@ class ImpactDeserializer {
List<DynamicUse> dynamicUses = <DynamicUse>[];
for (int index = 0; index < dynamicUseDecoder.length; index++) {
ObjectDecoder object = dynamicUseDecoder.getObject(index);
- SelectorKind kind = object.getEnum(Key.KIND, SelectorKind.values);
- int argumentCount = object.getInt(Key.ARGUMENTS);
- List<String> namedArguments =
- object.getStrings(Key.NAMED_ARGUMENTS, isOptional: true);
- String name = object.getString(Key.NAME);
- bool isSetter = object.getBool(Key.IS_SETTER);
- LibraryElement library = object.getElement(Key.LIBRARY, isOptional: true);
- dynamicUses.add(new DynamicUse(
- new Selector(kind, new Name(name, library, isSetter: isSetter),
- new CallStructure(argumentCount, namedArguments)),
- null));
+ Selector selector = deserializeSelector(object);
+ dynamicUses.add(new DynamicUse(selector, null));
}
ListDecoder typeUseDecoder = objectDecoder.getList(Key.TYPE_USES);
« no previous file with comments | « pkg/compiler/lib/src/serialization/equivalence.dart ('k') | pkg/compiler/lib/src/serialization/keys.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698