diff options
author | Marek Safar <marek.safar@gmail.com> | 2019-12-29 16:14:31 +0300 |
---|---|---|
committer | Larry Ewing <lewing@microsoft.com> | 2020-01-02 23:24:44 +0300 |
commit | c9036e755580c96a984daad55ff8dec11ff46b44 (patch) | |
tree | 128f77c9f1da96bf74b1b65f50469d718caab439 /mcs/class | |
parent | 33ca3d33e1994cabf9f9b19034624a3495bbc9cb (diff) |
Cleanup a few dependencies to reduce wasm bcl size
Diffstat (limited to 'mcs/class')
6 files changed, 13 insertions, 19 deletions
diff --git a/mcs/class/Mono.CompilerServices.SymbolWriter/SymbolWriterImpl.cs b/mcs/class/Mono.CompilerServices.SymbolWriter/SymbolWriterImpl.cs index 0b25cd7cf5e..930a262187f 100644 --- a/mcs/class/Mono.CompilerServices.SymbolWriter/SymbolWriterImpl.cs +++ b/mcs/class/Mono.CompilerServices.SymbolWriter/SymbolWriterImpl.cs @@ -52,8 +52,6 @@ namespace Mono.CompilerServices.SymbolWriter #if !CECIL && !MOBILE ModuleBuilder mb; - delegate Guid GetGuidFunc (ModuleBuilder mb); - GetGuidFunc get_guid_func; public SymbolWriterImpl (ModuleBuilder mb) { @@ -62,16 +60,7 @@ namespace Mono.CompilerServices.SymbolWriter public void Close () { - MethodInfo mi = typeof (ModuleBuilder).GetMethod ( - "Mono_GetGuid", - BindingFlags.Static | BindingFlags.NonPublic); - if (mi == null) - return; - - get_guid_func = (GetGuidFunc) System.Delegate.CreateDelegate ( - typeof (GetGuidFunc), mi); - - msw.WriteSymbolFile (get_guid_func (mb)); + msw.WriteSymbolFile (mb.ModuleVersionId); } #else Guid guid; diff --git a/mcs/class/corlib/LinkerDescriptor/mscorlib.xml b/mcs/class/corlib/LinkerDescriptor/mscorlib.xml index ecc8c043b63..cc06dbfe9e8 100644 --- a/mcs/class/corlib/LinkerDescriptor/mscorlib.xml +++ b/mcs/class/corlib/LinkerDescriptor/mscorlib.xml @@ -645,7 +645,6 @@ <type fullname="System.Reflection.Emit.LocalBuilder" preserve="fields" feature="sre" /> <type fullname="System.Reflection.Emit.MethodBuilder" preserve="fields" feature="sre" /> <type fullname="System.Reflection.Emit.ModuleBuilder" preserve="fields" feature="sre"> - <method name="Mono_GetGuid" feature="sre" /> </type> <type fullname="System.Reflection.Emit.MonoResource" preserve="fields" feature="sre" /> <type fullname="System.Reflection.Emit.MonoWin32Resource" preserve="fields" feature="sre" /> diff --git a/mcs/class/corlib/System.Diagnostics/StackTrace.cs b/mcs/class/corlib/System.Diagnostics/StackTrace.cs index dc2c7a43399..a70b0ae7d88 100644 --- a/mcs/class/corlib/System.Diagnostics/StackTrace.cs +++ b/mcs/class/corlib/System.Diagnostics/StackTrace.cs @@ -243,6 +243,7 @@ namespace System.Diagnostics { } var filename = frame.GetSecureFileName (); +#if !WASM if (filename[0] == '<') { var mvid = frame.GetMethod ().Module.ModuleVersionId.ToString ("N"); var aotid = GetAotId (); @@ -252,6 +253,7 @@ namespace System.Diagnostics { filename = string.Format ("<{0}#{1}>", mvid, aotid); } } +#endif sb.AppendFormat (" in {0}:{1} ", filename, frame.GetFileLineNumber ()); } diff --git a/mcs/class/corlib/System.Globalization/CultureInfo.cs b/mcs/class/corlib/System.Globalization/CultureInfo.cs index deeecd8b56b..b21a89a7162 100644 --- a/mcs/class/corlib/System.Globalization/CultureInfo.cs +++ b/mcs/class/corlib/System.Globalization/CultureInfo.cs @@ -154,6 +154,9 @@ namespace System.Globalization if (default_current_culture != null) return default_current_culture; + if (GlobalizationMode.Invariant) + return InvariantCulture; + var locale_name = get_current_locale_name (); CultureInfo ci = null; diff --git a/mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs index 598795926af..0fb48003c8b 100644 --- a/mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs +++ b/mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs @@ -1066,12 +1066,6 @@ namespace System.Reflection.Emit { return new Guid (guid); } - // Used by mcs, the symbol writer, and mdb through reflection - internal static Guid Mono_GetGuid (ModuleBuilder mb) - { - return mb.GetModuleVersionId (); - } - public override Assembly Assembly { get { return assemblyb; } } diff --git a/mcs/class/referencesource/mscorlib/system/globalization/numberformatinfo.cs b/mcs/class/referencesource/mscorlib/system/globalization/numberformatinfo.cs index 9ee2657cc88..528814f5b00 100644 --- a/mcs/class/referencesource/mscorlib/system/globalization/numberformatinfo.cs +++ b/mcs/class/referencesource/mscorlib/system/globalization/numberformatinfo.cs @@ -241,6 +241,13 @@ namespace System.Globalization { [System.Security.SecuritySafeCritical] // auto-generated internal NumberFormatInfo(CultureData cultureData) { +#if MONO + if (GlobalizationMode.Invariant) { + this.m_isInvariant = true; + return; + } +#endif + if (cultureData != null) { // We directly use fields here since these data is coming from data table or Win32, so we |