[S.R.Serialization] switch to (non-emit) reflection-based implementation stubs.
authorAtsushi Eno <atsushieno@gmail.com>
Wed, 1 Apr 2015 09:08:15 +0000 (18:08 +0900)
committerAtsushi Eno <atsushieno@gmail.com>
Fri, 24 Apr 2015 05:36:51 +0000 (14:36 +0900)
The new code is to implement reflection (non-emit) based serialization
so that it works on iOS.

Actually I _totally_ switched to this new implementation because dynamic
method based implementation also doesn't work fine, even on desktop
(due to invocation failure on internal methods, it seems that our dynamic
method needs some bugfixes).

The new methods with NotImplementedException in new classes need to be
implemented.

mcs/class/System.Runtime.Serialization/Makefile
mcs/class/System.Runtime.Serialization/ReferenceSources/JsonFormatReaderGenerator_static.cs [new file with mode: 0644]
mcs/class/System.Runtime.Serialization/ReferenceSources/JsonFormatWriterGenerator_static.cs [new file with mode: 0644]
mcs/class/System.Runtime.Serialization/ReferenceSources/XmlDataContract_static.cs [new file with mode: 0644]
mcs/class/System.Runtime.Serialization/ReferenceSources/XmlFormatReaderGenerator_static.cs [new file with mode: 0644]
mcs/class/System.Runtime.Serialization/ReferenceSources/XmlFormatWriterGenerator_static.cs [new file with mode: 0644]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.dll.sources

index 877731a3e4a567b342359ee543428e086177a4fd..468cd9f4104c99106c80d7341da39d6d1190115c 100644 (file)
@@ -8,8 +8,8 @@ LIBRARY = System.Runtime.Serialization.dll
 LIB_REFS = System System.Xml System.Core System.ServiceModel.Internals SMDiagnostics
 LIB_MCS_FLAGS = \
                -unsafe \
+               -d:NO_DYNAMIC_CODEGEN \
                /nowarn:168,169,219,414 \
-               -d:USE_REFEMIT \
                $(RESOURCE_FILES:%=/resource:%)
 
 ifneq (2.1, $(FRAMEWORK_VERSION))
diff --git a/mcs/class/System.Runtime.Serialization/ReferenceSources/JsonFormatReaderGenerator_static.cs b/mcs/class/System.Runtime.Serialization/ReferenceSources/JsonFormatReaderGenerator_static.cs
new file mode 100644 (file)
index 0000000..35bc69e
--- /dev/null
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+
+namespace System.Runtime.Serialization.Json
+{
+       internal partial class JsonFormatReaderGenerator
+       {
+               partial class CriticalHelper
+               {
+                       public JsonFormatClassReaderDelegate GenerateClassReader(ClassDataContract classContract)
+                       {
+                               throw new NotImplementedException ();
+                       }
+                       public JsonFormatCollectionReaderDelegate GenerateCollectionReader(CollectionDataContract collectionContract)
+                       {
+                               throw new NotImplementedException ();
+                       }
+                       public JsonFormatGetOnlyCollectionReaderDelegate GenerateGetOnlyCollectionReader(CollectionDataContract collectionContract)
+                       {
+                               throw new NotImplementedException ();
+                       }
+               }
+       }
+}
+
diff --git a/mcs/class/System.Runtime.Serialization/ReferenceSources/JsonFormatWriterGenerator_static.cs b/mcs/class/System.Runtime.Serialization/ReferenceSources/JsonFormatWriterGenerator_static.cs
new file mode 100644 (file)
index 0000000..59c6f52
--- /dev/null
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Xml;
+
+namespace System.Runtime.Serialization.Json
+{
+       internal partial class JsonFormatWriterGenerator
+       {
+               partial class CriticalHelper
+               {
+                       internal JsonFormatClassWriterDelegate GenerateClassWriter(ClassDataContract classContract)
+                       {
+                               throw new NotImplementedException ();
+                       }
+                       internal JsonFormatCollectionWriterDelegate GenerateCollectionWriter(CollectionDataContract collectionContract)
+                       {
+                               throw new NotImplementedException ();
+                       }
+               }
+       }
+}
+
diff --git a/mcs/class/System.Runtime.Serialization/ReferenceSources/XmlDataContract_static.cs b/mcs/class/System.Runtime.Serialization/ReferenceSources/XmlDataContract_static.cs
new file mode 100644 (file)
index 0000000..6ff8070
--- /dev/null
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Xml;
+
+namespace System.Runtime.Serialization
+{
+       internal partial class XmlDataContract
+       {
+        internal CreateXmlSerializableDelegate GenerateCreateXmlSerializableDelegate()
+        {
+                       throw new NotImplementedException ();
+               }
+       }
+}
+
diff --git a/mcs/class/System.Runtime.Serialization/ReferenceSources/XmlFormatReaderGenerator_static.cs b/mcs/class/System.Runtime.Serialization/ReferenceSources/XmlFormatReaderGenerator_static.cs
new file mode 100644 (file)
index 0000000..c2a711d
--- /dev/null
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Xml;
+
+namespace System.Runtime.Serialization
+{
+       internal partial class XmlFormatReaderGenerator
+       {
+               partial class CriticalHelper
+               {
+                       public XmlFormatClassReaderDelegate GenerateClassReader(ClassDataContract classContract)
+                       {
+                               throw new NotImplementedException ();
+                       }
+                       public XmlFormatCollectionReaderDelegate GenerateCollectionReader(CollectionDataContract collectionContract)
+                       {
+                               throw new NotImplementedException ();
+                       }
+                       public XmlFormatGetOnlyCollectionReaderDelegate GenerateGetOnlyCollectionReader(CollectionDataContract collectionContract)
+                       {
+                               throw new NotImplementedException ();
+                       }
+               }
+       }
+}
+
diff --git a/mcs/class/System.Runtime.Serialization/ReferenceSources/XmlFormatWriterGenerator_static.cs b/mcs/class/System.Runtime.Serialization/ReferenceSources/XmlFormatWriterGenerator_static.cs
new file mode 100644 (file)
index 0000000..71d2af8
--- /dev/null
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Xml;
+
+namespace System.Runtime.Serialization
+{
+       internal partial class XmlFormatWriterGenerator
+       {
+               partial class CriticalHelper
+               {
+                       internal XmlFormatClassWriterDelegate GenerateClassWriter(ClassDataContract classContract)
+                       {
+                               throw new NotImplementedException ();
+                       }
+                       internal XmlFormatCollectionWriterDelegate GenerateCollectionWriter(CollectionDataContract collectionContract)
+                       {
+                               throw new NotImplementedException ();
+                       }
+               }
+       }
+}
+
index 1ff345362c7c62518f161a589af5bec11cb0536d..d49b1f5adb070a2fd9a72a430246e57af71df004 100644 (file)
@@ -8,5 +8,9 @@ ReferenceSources/FxTrace.cs
 ReferenceSources/SR.cs
 ReferenceSources/SR_missing.cs
 ReferenceSources/XmlExceptionHelper.cs
-
+ReferenceSources/JsonFormatReaderGenerator_static.cs
+ReferenceSources/JsonFormatWriterGenerator_static.cs
+ReferenceSources/XmlDataContract_static.cs
+ReferenceSources/XmlFormatReaderGenerator_static.cs
+ReferenceSources/XmlFormatWriterGenerator_static.cs