Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Expose serialization primitives from System.Private.Corelib #6375

Merged
merged 2 commits into from
Jul 21, 2016

Conversation

stephentoub
Copy link
Member

  • Update the model.xml file to expose the serialization primitives from the runtime, e.g. [Serializable], [NonSerialized], ISerializable, etc.
  • Tweak how FEATURE_SERIALIZATION is used on some types. ISerializable and IDeserializationCallback are not ifdef'd based on FEATURE_SERIALIZATION, but their members are, which means there are some types which are implementing the interface but have the implementation of the interface's method ifdef'd. This commit removes the ifdef'ing of the methods on the interface, and then ifdef's the implementation of the interface on the offending types.

cc: @jkotas, @danmosemsft

After this, we can:

  • Update the implementation in corefx to type-forward for these interfaces/attributes/etc. to the runtime (at least for coreclr), and expose them from mscorlib
  • Start using these to implement the various types in corefx that should be serializable
  • Audit the serializable types in mscorlib and start bringing in their serialization implementations... since these serialization primitives are included even when FEATURE_SERIALIZATION isn't set, we should be able to just remove the ifdef'ing from types as they're reviewed, and add the relevant members for each to the model.xml.

@jkotas
Copy link
Member

jkotas commented Jul 21, 2016

Build break - WeakReferenceOfTNative::IsTrackResurrection FCall needs to be enabled in CoreCLR.

@jkotas
Copy link
Member

jkotas commented Jul 21, 2016

LGTM otherwise.

@stephentoub stephentoub force-pushed the serialization_modelxml branch from c6006ee to d08e4c9 Compare July 21, 2016 14:17
- Update the model.xml file to expose the serialization primitives from the runtime, e.g. [Serializable], [NonSerialized], ISerializable, etc.
- Tweak how FEATURE_SERIALIZATION is used on some types.  ISerializable and IDeserializationCallback are not ifdef'd based on FEATURE_SERIALIZATION, but their members are, which means there are some types which are implementing the interface but have the implementation of the interface's method ifdef'd.  This commit removes the ifdef'ing of the methods on the interface, and then ifdef's the implementation of the interface on the offending types.
@stephentoub stephentoub force-pushed the serialization_modelxml branch from d08e4c9 to 292d4ea Compare July 21, 2016 14:51
…reCLR

It brings in an FCall not available on coreclr.
<Member Name="ToInt16(System.Object)" />
<Member Name="ToUInt16(System.Object)" />
<Member Name="ToInt32(System.Object)" />
<Member Name="ToUInt32(System.Object)" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ToUInt32 [](start = 20, length = 8)

nit, it's nice to use alpha order because it makes it easier to diff with the tooling generated one. fine either way though.

<Type Name="System.Runtime.Serialization.IFormatterConverter">
  <Member Name="Convert(System.Object,System.Type)" />
  <Member Name="Convert(System.Object,System.TypeCode)" />
  <Member Name="ToBoolean(System.Object)" />
  <Member Name="ToByte(System.Object)" />
  <Member Name="ToChar(System.Object)" />
  <Member Name="ToDateTime(System.Object)" />
  <Member Name="ToDecimal(System.Object)" />
  <Member Name="ToDouble(System.Object)" />
  <Member Name="ToInt16(System.Object)" />
  <Member Name="ToInt32(System.Object)" />
  <Member Name="ToInt64(System.Object)" />
  <Member Name="ToSByte(System.Object)" />
  <Member Name="ToSingle(System.Object)" />
  <Member Name="ToString(System.Object)" />
  <Member Name="ToUInt16(System.Object)" />
  <Member Name="ToUInt32(System.Object)" />
  <Member Name="ToUInt64(System.Object)" />
</Type>

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. If I need to rev it again, I can reorder it. I was just following the order from the source. If it goes in like this, it's also fine for whoever revs it next via a tool to accept any reordering that comes with that.

@danmoseley
Copy link
Member

:shipit:

@stephentoub
Copy link
Member Author

@jkotas, can you confirm that my second commit here is acceptable?
e95a6e8
Thanks!

@jkotas
Copy link
Member

jkotas commented Jul 21, 2016

Looks good.

@stephentoub
Copy link
Member Author

Thanks.

@stephentoub stephentoub merged commit 2a1fd93 into dotnet:master Jul 21, 2016
@stephentoub stephentoub deleted the serialization_modelxml branch July 21, 2016 17:02
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…_modelxml

Expose serialization primitives from System.Private.Corelib

Commit migrated from dotnet/coreclr@2a1fd93
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants