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

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

Issue 1811173003: Support per-library serialization. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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
Index: pkg/compiler/lib/src/serialization/element_serialization.dart
diff --git a/pkg/compiler/lib/src/serialization/element_serialization.dart b/pkg/compiler/lib/src/serialization/element_serialization.dart
index d1d04a37a4d8a98bde60eecdd376d86569bb4d93..d9877a47400d74d13a84a16a114cd0f955e82265 100644
--- a/pkg/compiler/lib/src/serialization/element_serialization.dart
+++ b/pkg/compiler/lib/src/serialization/element_serialization.dart
@@ -43,6 +43,10 @@ enum SerializedElementKind {
IMPORT,
EXPORT,
PREFIX,
+ EXTERNAL_LIBRARY,
+ EXTERNAL_LIBRARY_MEMBER,
+ EXTERNAL_STATIC_MEMBER,
+ EXTERNAL_CONSTRUCTOR,
}
/// Set of serializers used to serialize different kinds of elements by
@@ -593,9 +597,9 @@ class ElementDeserializer {
/// needs deserialization. The [ObjectDecoder] ensures that any [Element],
/// [DartType], and [ConstantExpression] that the deserialized [Element]
/// depends upon are available.
- static Element deserialize(ObjectDecoder decoder) {
- SerializedElementKind elementKind =
- decoder.getEnum(Key.KIND, SerializedElementKind.values);
+ static Element deserialize(
+ ObjectDecoder decoder,
+ SerializedElementKind elementKind) {
switch (elementKind) {
case SerializedElementKind.LIBRARY:
return new LibraryElementZ(decoder);
@@ -651,6 +655,11 @@ class ElementDeserializer {
return new ExportElementZ(decoder);
case SerializedElementKind.PREFIX:
return new PrefixElementZ(decoder);
+ case SerializedElementKind.EXTERNAL_LIBRARY:
+ case SerializedElementKind.EXTERNAL_LIBRARY_MEMBER:
+ case SerializedElementKind.EXTERNAL_STATIC_MEMBER:
+ case SerializedElementKind.EXTERNAL_CONSTRUCTOR:
+ break;
}
throw new UnsupportedError("Unexpected element kind '${elementKind}.");
}

Powered by Google App Engine
This is Rietveld 408576698