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

Unified Diff: pkg/compiler/lib/src/js_backend/backend_serialization.dart

Issue 2738513007: Split NativeDataImpl (Closed)
Patch Set: Created 3 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
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend.dart ('k') | pkg/compiler/lib/src/js_backend/native_data.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_backend/backend_serialization.dart
diff --git a/pkg/compiler/lib/src/js_backend/backend_serialization.dart b/pkg/compiler/lib/src/js_backend/backend_serialization.dart
index eb4bd6da55b8811f2e3688f99c6fb158ca9dc434..2f9730bc96088acb08afda151123f2fdddfeff99 100644
--- a/pkg/compiler/lib/src/js_backend/backend_serialization.dart
+++ b/pkg/compiler/lib/src/js_backend/backend_serialization.dart
@@ -34,9 +34,12 @@ class JavaScriptBackendSerialization implements BackendSerialization {
final JavaScriptBackendSerializer serializer;
final JavaScriptBackendDeserializer deserializer;
- JavaScriptBackendSerialization(NativeData nativeData)
- : serializer = new JavaScriptBackendSerializer(nativeData),
- deserializer = new JavaScriptBackendDeserializer(nativeData);
+ JavaScriptBackendSerialization(
+ NativeClassData nativeClassData, NativeData nativeData)
+ : serializer =
+ new JavaScriptBackendSerializer(nativeClassData, nativeData),
+ deserializer =
+ new JavaScriptBackendDeserializer(nativeClassData, nativeData);
}
const Key JS_INTEROP_LIBRARY_NAME = const Key('jsInteropLibraryName');
@@ -49,9 +52,10 @@ const Key NATIVE_FIELD_LOAD_BEHAVIOR = const Key('nativeFieldLoadBehavior');
const Key NATIVE_FIELD_STORE_BEHAVIOR = const Key('nativeFieldStoreBehavior');
class JavaScriptBackendSerializer implements SerializerPlugin {
+ final NativeClassDataImpl nativeClassData;
final NativeDataImpl nativeData;
- JavaScriptBackendSerializer(this.nativeData);
+ JavaScriptBackendSerializer(this.nativeClassData, this.nativeData);
@override
void onElement(Element element, ObjectEncoder createEncoder(String tag)) {
@@ -76,9 +80,10 @@ class JavaScriptBackendSerializer implements SerializerPlugin {
if (nativeMemberName != null) {
getEncoder().setString(NATIVE_MEMBER_NAME, nativeMemberName);
}
- String nativeClassTagInfo = nativeData.nativeClassTagInfo[element];
+ NativeClassTag nativeClassTagInfo =
+ nativeClassData.nativeClassTagInfo[element];
if (nativeClassTagInfo != null) {
- getEncoder().setString(NATIVE_CLASS_TAG_INFO, nativeClassTagInfo);
+ getEncoder().setString(NATIVE_CLASS_TAG_INFO, nativeClassTagInfo.text);
}
NativeBehavior nativeMethodBehavior =
nativeData.nativeMethodBehavior[element];
@@ -109,9 +114,10 @@ class JavaScriptBackendSerializer implements SerializerPlugin {
}
class JavaScriptBackendDeserializer implements DeserializerPlugin {
+ final NativeClassDataImpl nativeClassData;
final NativeDataImpl nativeData;
- JavaScriptBackendDeserializer(this.nativeData);
+ JavaScriptBackendDeserializer(this.nativeClassData, this.nativeData);
@override
void onElement(Element element, ObjectDecoder getDecoder(String tag)) {
@@ -132,7 +138,8 @@ class JavaScriptBackendDeserializer implements DeserializerPlugin {
String nativeClassTagInfo =
decoder.getString(NATIVE_CLASS_TAG_INFO, isOptional: true);
if (nativeClassTagInfo != null) {
- nativeData.nativeClassTagInfo[element] = nativeClassTagInfo;
+ nativeClassData.nativeClassTagInfo[element] =
+ new NativeClassTag(nativeClassTagInfo);
}
} else if (element is MemberElement) {
String jsInteropMemberName =
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend.dart ('k') | pkg/compiler/lib/src/js_backend/native_data.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698