Imported Upstream version 6.0.0.172

Former-commit-id: f3cc9b82f3e5bd8f0fd3ebc098f789556b44e9cd
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-04-12 14:10:50 +00:00
parent 8016999e4d
commit 64ac736ec5
32155 changed files with 3981439 additions and 75368 deletions

View File

@@ -97,4 +97,6 @@ using System.Runtime.InteropServices;
[assembly: InternalsVisibleTo ("Xamarin.Mac, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]
#endif
[assembly: InternalsVisibleTo ("System.Net.Http, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
[assembly: Guid ("BED7F4EA-1A96-11D2-8F08-00A0C9A6186D")]

View File

@@ -19,7 +19,10 @@
</type>
<!-- appdomain.c: mono_runtime_init -->
<type fullname="System.AppDomainSetup" preserve="fields" />
<type fullname="System.AppDomainSetup" preserve="fields" >
<!-- appdomain.c mono_object_new_checked in mono_domain_create_appdomain_checked -->
<method signature="System.Void .ctor()" />
</type>
<!-- exception.c: mono_get_exception_appdomain_unloaded (used in several places), threadpool.c -->
<type fullname="System.AppDomainUnloadedException">
@@ -86,7 +89,7 @@
<!-- domain.c: mono_defaults.attribute_class -->
<!-- used in reflection.c to create array of attributes (no need to preserve everything beside the type itself) -->
<type fullname="System.Attribute" preserve="fields" />
<type fullname="System.Attribute" preserve="nothing" />
<!-- exception.c / mono-error.c -->
<type fullname="System.BadImageFormatException">
@@ -115,18 +118,19 @@
<type fullname="System.DateTime" preserve="fields" />
<!-- reflection.c: mono_get_dbnull_object / comment: Used as the value for ParameterInfo.DefaultValue -->
<type fullname="System.DBNull" preserve="fields" />
<type fullname="System.Decimal" preserve="fields" />
<type fullname="System.DBNull">
<field name="Value" />
</type>
<!-- domain.c: mono_defaults.delegate_class -->
<type fullname="System.Delegate" preserve="fields" />
<!-- domain.c: mono_defaults.stack_frame_class -->
<!-- used in mini-exceptions.c to create array and MonoStackFrame instance, i.e. only fields are required to be preserved -->
<type fullname="System.Diagnostics.StackFrame" preserve="fields" />
<!-- domain.c: mono_defaults.stack_trace_class -->
<!-- does not seems used outside the g_assert in domain.c (maybe it could be removed) -->
<type fullname="System.Diagnostics.StackTrace" preserve="fields" />
<type fullname="System.Diagnostics.StackFrame" preserve="fields" >
<!-- threads.c mono_object_new_checked in mono_threads_get_thread_dump -->
<method signature="System.Void .ctor()" />
</type>
<!-- debugger-agent.c: create_event_list -->
<type fullname="System.Diagnostics.DebuggerNonUserCodeAttribute"/>
@@ -230,7 +234,9 @@
</type>
<!-- reflection.c mono_get_reflection_missing_object -->
<type fullname="System.Reflection.Missing" preserve="fields" />
<type fullname="System.Reflection.Missing">
<field name="Value" />
</type>
<type fullname="System.MarshalByRefObject" preserve="fields" feature="remoting" />
@@ -254,12 +260,15 @@
</type>
<!-- threadpool.c: mono_thread_pool_init (assert) -->
<type fullname="System.MonoAsyncCall" preserve="fields" />
<type fullname="System.MonoAsyncCall" preserve="fields" >
<!-- threadpool.c mono_object_new_checked in mono_threadpool_begin_invoke -->
<method signature="System.Void .ctor()" />
</type>
<!-- mono-mlist.c (managed list): used in threadpool.c and gc.c -->
<type fullname="System.MonoListItem" preserve="fields" />
<!-- domain.c: mono_defaults.type_class -->
<type fullname="System.MonoType" preserve="fields" />
<type fullname="System.MonoType" preserve="nothing" />
<!-- domain.c: mono_defaults.multicastdelegate_class -->
<type fullname="System.MulticastDelegate" preserve="fields" />
@@ -306,6 +315,8 @@
<!-- TransparentProxy.cs, RemotingServices.cs -->
<method name="FieldGetter" feature="remoting" />
<method name="FieldSetter" feature="remoting" />
<!-- appdomain.c mono_object_new_checked in create_domain_objects -->
<method signature="System.Void .ctor()" />
</type>
<!-- appdomain.c (create_domain_objects) domain->out_of_memory_ex -->
@@ -378,9 +389,11 @@
</type>
<!-- domain.c: mono_defaults.systemtype_class -->
<type fullname="System.Type" preserve="fields">
<type fullname="System.Type">
<!-- marshal.c (mono_marshal_get_synchronized_wrapper) -->
<method name="GetTypeFromHandle" />
<!-- sre.c (mono_reflection_type_get_underlying_system_type) -->
<method name="get_UnderlyingSystemType" feature="sre" />
</type>
<!-- exception.c (mono_get_exception_type_initialization) -->
@@ -418,7 +431,7 @@
</type>
<!-- class.c: make_generic_param_class -->
<type fullname="System.ValueType" preserve="fields" />
<type fullname="System.ValueType" preserve="nothing" />
<!-- comiterop.c -->
<type fullname="System.Variant" preserve="fields" feature="com">
@@ -437,7 +450,7 @@
</type>
<!-- domain.c: mono_defaults.void_class -->
<type fullname="System.Void" preserve="fields" />
<type fullname="System.Void" preserve="nothing" />
<!-- comiterop.c -->
<type fullname="System.__ComObject" feature="com" />
@@ -461,11 +474,6 @@
<method name=".ctor" />
</type>
<!-- console-unix.c: do_console_cancel_event -->
<type fullname="System.Console">
<method name="DoConsoleCancelEventInBackground" />
</type>
<!-- icalls - but (at least parts of them) are used thru interfaces at runtime and cannot be linked out -->
<type fullname="System.Globalization.DateTimeFormatInfo" preserve="fields" />
<type fullname="System.Globalization.CompareInfo" preserve="fields" />
@@ -490,83 +498,80 @@
<!-- fileio.h: shared structure between the managed and unmanaged worlds -->
<type fullname="System.IO.MonoIOStat" preserve="fields" />
<!-- domain.c: mono_defaults.math_class
method-to-ir.c: empty branch (wrt Min/Max optimization)
mini-[x86|amd64].c needs the type but then only check for names
note: there's no fields (static type) but that will mark the type itself -->
<type fullname="System.Math" preserve="fields" />
<!-- appdomain.c: ves_icall_System_AppDomain_GetAssemblies -->
<type fullname="System.Reflection.Assembly" preserve="fields"/>
<type fullname="System.Reflection.AssemblyName" preserve="fields" />
<type fullname="System.Reflection.ConstructorInfo" preserve="fields" />
<!-- domain.c: mono_defaults.customattribute_data_class -->
<type fullname="System.Reflection.CustomAttributeData" preserve="fields">
<!-- custom-attrs.c: create_custom_attr_data - create an instance with the ctor using 4 arguments -->
<method signature="System.Void .ctor(System.Reflection.ConstructorInfo,System.Reflection.Assembly,System.IntPtr,System.UInt32)" />
</type>
<!-- reflection.c: create_cattr_named_arg - create an instance with the ctor using 2 parameters -->
<type fullname="System.Reflection.CustomAttributeNamedArgument">
<method signature="System.Void .ctor(System.Reflection.MemberInfo,System.Object)" />
</type>
<!-- reflection.c: create_cattr_typed_arg - create an instance with the ctor using 2 parameters -->
<type fullname="System.Reflection.CustomAttributeTypedArgument">
<method signature="System.Void .ctor(System.Type,System.Object)" />
</type>
<type fullname="System.Reflection.EventInfo" preserve="fields">
<method name="AddEventFrame" />
<method name="StaticAddEventAdapterFrame" />
</type>
<!-- reflection.c: mono_method_body_get_object -->
<type fullname="System.Reflection.ExceptionHandlingClause" preserve="fields" />
<type fullname="System.Reflection.ExceptionHandlingClause" preserve="fields" >
<!-- reflection.c mono_object_new_checked in add_exception_handling_clause_to_array -->
<method signature="System.Void .ctor()" />
</type>
<!-- domain.c: mono_defaults.field_info_class -->
<type fullname="System.Reflection.FieldInfo" preserve="fields" />
<type fullname="System.Reflection.FieldInfo" preserve="nothing" />
<!-- reflection.c: mono_method_body_get_object -->
<type fullname="System.Reflection.LocalVariableInfo" preserve="fields" />
<type fullname="System.Reflection.LocalVariableInfo" preserve="fields" >
<!-- reflection.c mono_object_new_checked in add_local_var_info_to_array -->
<method signature="System.Void .ctor()" />
</type>
<!-- reflection.c: mono_method_body_get_object -->
<type fullname="System.Reflection.MethodBody" preserve="fields" />
<!-- domain.c: mono_defaults.method_info_class -->
<type fullname="System.Reflection.MethodInfo" preserve="fields" />
<type fullname="System.Reflection.MethodInfo" preserve="nothing" />
<type fullname="System.Reflection.Module" preserve="fields" />
<type fullname="System.Reflection.MonoAssembly" preserve="fields" >
<type fullname="System.Reflection.RuntimeAssembly">
<method name=".ctor" />
</type>
<type fullname="System.Reflection.MonoModule" preserve="fields" >
<type fullname="System.Reflection.RuntimeModule">
<method name=".ctor" />
</type>
<type fullname="System.Reflection.MonoCMethod" preserve="fields" />
<type fullname="System.Reflection.MonoEvent" preserve="fields" />
<type fullname="System.Reflection.RuntimeConstructorInfo" preserve="fields" >
<!-- reflection.c mono_object_new_checked in method_object_construct -->
<method signature="System.Void .ctor()" />
</type>
<type fullname="System.Reflection.MonoEventInfo" preserve="fields" />
<type fullname="System.Reflection.MonoField" preserve="fields" />
<type fullname="System.Reflection.MonoMethod" preserve="fields" />
<type fullname="System.Reflection.RuntimeEventInfo" preserve="fields" >
<!-- reflection.c mono_object_new_checked in event_object_construct -->
<method signature="System.Void .ctor()" />
</type>
<type fullname="System.Reflection.RuntimeFieldInfo" preserve="fields" >
<!-- reflection.c mono_object_new_checked in field_object_construct -->
<method signature="System.Void .ctor()" />
</type>
<type fullname="System.Reflection.RuntimeMethodInfo" preserve="fields" >
<!-- reflection.c mono_object_new_checked in method_object_construct -->
<method signature="System.Void .ctor()" />
</type>
<type fullname="System.Reflection.MonoMethodInfo" preserve="fields" />
<type fullname="System.Reflection.MonoPropertyInfo" preserve="fields" />
<type fullname="System.Reflection.MonoProperty" preserve="fields">
<type fullname="System.Reflection.RuntimePropertyInfo" preserve="fields">
<method name="GetterAdapterFrame" />
<method name="StaticGetterAdapterFrame" />
<!-- reflection.c mono_object_new_checked in add_parameter_object_to_array -->
<method signature="System.Void .ctor()" />
</type>
<type fullname="System.Reflection.ParameterInfo" preserve="fields" />
<!-- reflection.c: ves_icall_get_parameter_info -->
<type fullname="System.Reflection.MonoParameterInfo" preserve="fields" />
<type fullname="System.Reflection.RuntimeParameterInfo" preserve="fields" >
<!-- reflection.c mono_object_new_checked in event_object_construct -->
<method signature="System.Void .ctor()" />
</type>
<!-- object.c: mono_field_get_value_object and mono_runtime_invoke_array -->
<type fullname="System.Reflection.Pointer" >
<method name="Box" />
</type>
<type fullname="System.Reflection.PropertyInfo" preserve="fields" />
<!-- exception.c (mono_get_exception_reflection_type_load) -->
<type fullname="System.Reflection.ReflectionTypeLoadException">
<method signature="System.Void .ctor(System.Type[],System.Exception[])" />
@@ -584,46 +589,28 @@
<method signature="System.Void .ctor(System.String)" />
</type>
<type fullname="System.Reflection.Emit.AssemblyBuilder" preserve="fields" feature="sre">
<method name="AddPermissionRequests" feature="sre" />
<method name="AddModule" feature="sre" />
<method name="DefineIconResource" feature="sre" />
<method name="AddTypeForwarder" feature="sre" />
<method name="EmbedResourceFile" feature="sre" />
</type>
<type fullname="System.Reflection.Emit.ConstructorBuilder" preserve="fields" feature="sre">
<method name="RuntimeResolve" feature="sre" />
</type>
<type fullname="System.Reflection.Emit.CustomAttributeBuilder" preserve="fields" feature="sre" />
<type fullname="System.Reflection.Emit.AssemblyBuilder" preserve="fields" feature="sre" />
<type fullname="System.Reflection.Emit.ConstructorBuilder" preserve="fields" feature="sre"/>
<type fullname="System.Reflection.Emit.DynamicMethod" preserve="fields" feature="sre" />
<!-- mono_dynamic_image_register_token -->
<type fullname="System.Reflection.Emit.EnumBuilder" preserve="fields" feature="sre" />
<type fullname="System.Reflection.Emit.EventBuilder" preserve="fields" feature="sre" />
<type fullname="System.Reflection.Emit.FieldBuilder" preserve="fields" feature="sre" >
<method name="RuntimeResolve" feature="sre" />
</type>
<type fullname="System.Reflection.Emit.GenericTypeParameterBuilder" preserve="fields" feature="sre" >
<method name="RuntimeResolve" feature="sre" />
</type>
<type fullname="System.Reflection.Emit.FieldBuilder" preserve="fields" feature="sre" />
<type
fullname="System.Reflection.Emit.GenericTypeParameterBuilder" preserve="fields" feature="sre" />
<type fullname="System.Reflection.Emit.ILExceptionBlock" preserve="fields" feature="sre" />
<type fullname="System.Reflection.Emit.ILExceptionInfo" preserve="fields" feature="sre" />
<type fullname="System.Reflection.Emit.ILGenerator" preserve="fields" feature="sre" >
<method name="Mono_GetCurrentOffset" feature="sre" />
</type>
<type fullname="System.Reflection.Emit.LocalBuilder" preserve="fields" feature="sre" >
<method name="Mono_GetLocalIndex" feature="sre" />
</type>
<type fullname="System.Reflection.Emit.MethodBuilder" preserve="fields" feature="sre" >
<method name="RuntimeResolve" feature="sre" />
</type>
<type fullname="System.Reflection.Emit.ILGenerator" preserve="fields" feature="sre" />
<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" />
<method name="RuntimeResolve" feature="sre" />
</type>
<type fullname="System.Reflection.Emit.MonoResource" preserve="fields" feature="sre" />
<type fullname="System.Reflection.Emit.MonoWin32Resource" preserve="fields" feature="sre" />
<type fullname="System.Reflection.Emit.ParameterBuilder" preserve="fields" feature="sre" />
<type fullname="System.Reflection.Emit.PropertyBuilder" preserve="fields" feature="sre" />
<type fullname="System.Reflection.Emit.SignatureHelper" preserve="fields" feature="sre" />
<type fullname="System.Reflection.Emit.ParameterBuilder" preserve="nothing" feature="sre" />
<type fullname="System.Reflection.Emit.PropertyBuilder" preserve="nothing" feature="sre" />
<type fullname="System.Reflection.Emit.SignatureHelper" preserve="nothing" feature="sre" />
<type fullname="System.Reflection.Emit.TypeBuilder" preserve="fields" feature="sre">
<method name="SetCharSet" feature="sre" />
<!-- reflection.c mono_reflection_call_is_assignable_to () -->
@@ -633,30 +620,12 @@
<method name="DefineCustom" feature="sre" />
<method name="DefineLPArrayInternal" feature="sre" />
</type>
<type fullname="System.Reflection.Emit.TypeBuilderInstantiation" preserve="fields" feature="sre" >
<method name="RuntimeResolve" feature="sre" />
</type>
<type fullname="System.Reflection.Emit.ArrayType" preserve="fields" feature="sre" >
<method name="RuntimeResolve" feature="sre" />
</type>
<type fullname="System.Reflection.Emit.ByRefType" preserve="fields" feature="sre" >
<method name="RuntimeResolve" feature="sre" />
</type>
<type fullname="System.Reflection.Emit.PointerType" preserve="fields" feature="sre" >
<method name="RuntimeResolve" feature="sre" />
</type>
<type fullname="System.Reflection.Emit.FieldOnTypeBuilderInst" preserve="fields" feature="sre" >
<method name="RuntimeResolve" feature="sre" />
</type>
<type fullname="System.Reflection.Emit.MethodOnTypeBuilderInst" preserve="fields" feature="sre" >
<method name="RuntimeResolve" feature="sre" />
</type>
<type fullname="System.Reflection.Emit.ConstructorOnTypeBuilderInst" preserve="fields" feature="sre" >
<method name="RuntimeResolve" feature="sre" />
</type>
<!-- domain.c: mono_defaults.internals_visible_class -->
<type fullname="System.Runtime.CompilerServices.InternalsVisibleToAttribute" />
<type fullname="System.Reflection.Emit.ArrayType" preserve="fields" feature="sre" />
<type fullname="System.Reflection.Emit.ByRefType" preserve="fields" feature="sre" />
<type fullname="System.Reflection.Emit.PointerType" preserve="fields" feature="sre" />
<type fullname="System.Reflection.Emit.FieldOnTypeBuilderInst" preserve="fields" feature="sre" />
<type fullname="System.Reflection.Emit.MethodOnTypeBuilderInst" preserve="fields" feature="sre" />
<type fullname="System.Reflection.Emit.ConstructorOnTypeBuilderInst" preserve="fields" feature="sre" />
<!-- exception.c: mono_get_exception_runtime_wrapped () -->
<type fullname="System.Runtime.CompilerServices.RuntimeWrappedException">
@@ -681,9 +650,6 @@
<method name="DangerousRelease" />
</type>
<!-- object-internals.h: defines MonoReflectionUnmanagedFunctionPointerAttribute, marshal.c: use it -->
<type fullname="System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute" preserve="fields"/>
<!-- marshal.c: mono_mb_emit_exception_marshal_directive -->
<type fullname="System.Runtime.InteropServices.MarshalDirectiveException">
<method signature="System.Void .ctor(System.String)" />
@@ -703,7 +669,10 @@
<!-- domain.c: mono_defaults.asyncresult_class (Stubify can't be applied on this type) -->
<!-- object.c MONO_OBJECT_SETREF in mono_async_result_new -->
<!-- threadpool.c: MONO_OBJECT_SETREF in create_simple_asyncresult -->
<type fullname="System.Runtime.Remoting.Messaging.AsyncResult" preserve="fields" />
<type fullname="System.Runtime.Remoting.Messaging.AsyncResult" preserve="fields" >
<!-- object.c mono_object_new_checked in mono_async_result_new -->
<method signature="System.Void .ctor()" />
</type>
<!-- marshal.c: mono_remoting_marshal_init / removed with DISABLE_REMOTING -->
<type fullname="System.Runtime.Remoting.Messaging.CallContext" feature="remoting" >
@@ -714,16 +683,22 @@
<type fullname="System.Runtime.Remoting.Messaging.MonoMethodMessage" preserve="fields">
<!-- object.c: mono_message_init -->
<method name="InitMessage" />
<!-- marshal.c mono_object_new_checked in mono_delegate_end_invoke-->
<method name=".ctor" feature="remoting" />
</type>
<!-- domain.c: mono_defaults.real_proxy_class / removed with DISABLE_REMOTING -->
<type fullname="System.Runtime.Remoting.Proxies.RealProxy" preserve="fields" feature="remoting" >
<method name="PrivateInvoke" />
<method name="GetAppDomainTarget" />
<!-- object.c mono_object_new_checked in make_transparent_proxy-->
<method name=".ctor" feature="remoting" />
</type>
<!-- domain.c: mono_defaults.transparent_proxy_class / removed with DISABLE_REMOTING -->
<type fullname="System.Runtime.Remoting.Proxies.TransparentProxy" preserve="fields" feature="remoting" >
<method name="LoadRemoteFieldNew" />
<method name="StoreRemoteField" />
<!-- icall.c mono_object_new_checked in ves_icall_Remoting_RealProxy_GetTransparentProxy -->
<method signature="System.Void .ctor()" feature="remoting" />
</type>
<type fullname="System.Runtime.Remoting.RemotingServices" feature="remoting" >
<method name="SerializeCallData" />
@@ -814,9 +789,6 @@
<method name="PerformWaitCallback"/>
</type>
<!-- domain.c: mono_defaults.stringbuilder_class -->
<type fullname="System.Text.StringBuilder" preserve="fields" />
<!-- cominterop.c -->
<type fullname="Mono.Interop.ComInteropProxy" feature="com" />
<type fullname="Mono.Interop.IDispatch" feature="com" />
@@ -828,11 +800,19 @@
to allow such detection logic to work, even if the class is not used
directly.
-->
<type fullname="Mono.Runtime" />
<type fullname="Mono.Runtime" preserve="nothing" />
<!-- marshal.c (mono_marshal_get_native_wrapper) -->
<type fullname="Mono.RuntimeStructs/HandleStackMark" />
<!-- marshal.c (mono_marshal_get_native_wrapper) -->
<!-- marshal-ilgen.c (emit_native_icall_wrapper_ilgen) -->
<type fullname="Mono.RuntimeStructs/MonoError" />
<type fullname="System.Threading.WasmRuntime"/>
<!-- mini-generic-sharing.c -->
<type fullname="Mono.ValueTuple" preserve="fields"/>
<type fullname="Mono.ValueTuple`1" preserve="fields"/>
<type fullname="Mono.ValueTuple`2" preserve="fields"/>
<type fullname="Mono.ValueTuple`3" preserve="fields"/>
<type fullname="Mono.ValueTuple`4" preserve="fields"/>
<type fullname="Mono.ValueTuple`5" preserve="fields"/>
</assembly>
</linker>

View File

@@ -28,7 +28,8 @@ endif
RESX_EXTRA_ARGUMENTS = \
--in=ReferenceSources/SR.cs \
--in=ReferenceSources/SR2.cs
--in=ReferenceSources/SR2.cs \
--in=corefx/SR.missing.cs
RESX_RESOURCE_STRING = \
../../../external/corefx/src/System.Collections/src/Resources/Strings.resx \
@@ -49,6 +50,7 @@ RESX_RESOURCE_STRING = \
../../../external/corefx/src/System.Runtime.Numerics/src/Resources/Strings.resx \
../../../external/corefx/src/System.Security.Cryptography.Encoding/src/Resources/Strings.resx \
../../../external/corefx/src/System.Security.Cryptography.Pkcs/src/Resources/Strings.resx \
../../../external/corefx/src/System.Security.Cryptography.Primitives/src/Resources/Strings.resx \
../../../external/corefx/src/System.Security.Cryptography.ProtectedData/src/Resources/Strings.resx \
../../../external/corefx/src/System.Security.Cryptography.Xml/src/Resources/Strings.resx \
../../../external/corefx/src/System.Security.Cryptography.X509Certificates/src/Resources/Strings.resx \
@@ -66,12 +68,8 @@ include il/il.make
RESOURCE_STRINGS_FILES = --mscorlib-debug
ifneq ($(PROFILE),basic)
RESOURCE_STRINGS = ../referencesource/mscorlib/mscorlib.txt
MODULE_DEPS = $(IL_REPLACE)
endif
MODULE_DEPS += LinkerDescriptor/mscorlib.xml
MODULE_DEPS = $(IL_REPLACE) LinkerDescriptor/mscorlib.xml
RESOURCE_FILES = \
resources/charinfo.nlp \
@@ -86,6 +84,12 @@ RESOURCE_FILES = \
REFERENCE_SOURCES_FLAGS = -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ENCODINGNLS,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS
ifdef NO_SRE
PROFILE_TEST_HARNESS_EXCLUDES := $(PROFILE_TEST_HARNESS_EXCLUDES)SRE,
else
LIB_MCS_FLAGS += -d:MONO_FEATURE_SRE
endif
ifndef MOBILE_PROFILE
REFERENCE_SOURCES_FLAGS += -d:FEATURE_MACL
endif
@@ -138,10 +142,14 @@ XTEST_LIB_FLAGS = -d:netcoreapp -publicsign -keyfile:../mono.snk
XTEST_MCS_FLAGS = -resource:../../../external/corefx/src/System.Reflection/tests/Resources/ResourceTextFile.txt,ResourceTextFile.txt
ifndef AOT_FRIENDLY_PROFILE
ifneq ($(PROFILE),xammac)
ifneq ($(PROFILE),testing_aot_hybrid)
ifneq ($(PROFILE),testing_aot_full_interp)
TEST_LIB_REFS += Mono.Posix
endif
endif
endif
endif
# System.IO/DirectoryInfoTest.cs needs Mono.Posix
TEST_MCS_FLAGS += -debug -nowarn:168,219,618,672 -unsafe \
@@ -215,41 +223,60 @@ satellite_assembly2 = $(test_lib_dir)/nn-NO/$(patsubst %.dll,%.resources.dll,$(t
$(test_lib_output): $(TEST_RESOURCES) $(satellite_assembly1) $(satellite_assembly2) $(test_lib_dir)
mscorlib_for_profile = $(topdir)/class/lib/$(PROFILE)/mscorlib.dll
$(satellite_assembly1): Test/resources/culture-es-ES.cs Test/resources/Resources.es-ES.resources
@mkdir -p $(dir $@)
$(CSCOMPILE) -target:library -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll Test/resources/culture-es-ES.cs -resource:Test/resources/Resources.es-ES.resources -out:$@
$(CSCOMPILE) -target:library -r:$(mscorlib_for_profile) Test/resources/culture-es-ES.cs -resource:Test/resources/Resources.es-ES.resources -out:$@
$(satellite_assembly2): Test/resources/culture-nn-NO.cs Test/resources/Resources.nn-NO.resources
@mkdir -p $(dir $@)
$(CSCOMPILE) -target:library -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll Test/resources/culture-nn-NO.cs -resource:Test/resources/Resources.nn-NO.resources -out:$@
$(CSCOMPILE) -target:library -r:$(mscorlib_for_profile) Test/resources/culture-nn-NO.cs -resource:Test/resources/Resources.nn-NO.resources -out:$@
vtsdir = Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization
test_load_assembly = ${test_lib_dir}/TestLoadAssembly.dll
$(test_load_assembly): ../../../external/corefx/src/System.Runtime/tests/TestLoadAssembly/TestLoadAssembly.cs | $(test_lib_dir)
$(CSCOMPILE) -target:library -r:$(mscorlib_for_profile) -out:${test_lib_dir}/TestLoadAssembly.dll
test_module = $(test_lib_dir)/System.Reflection.TestModule.dll
$(test_module): ../../../external/corefx/src/System.Runtime/tests/TestModule/System.Reflection.TestModule.dll | $(test_lib_dir)
cp $< $(test_lib_dir)
XTEST_LIB_FLAGS += -r:$(test_module)
$(xtest_lib_output): $(test_load_assembly) $(test_module) $(test_lib_dir)
vtsdir_src = Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization
vtsdir = $(test_lib_dir)/vts
vtslibs = \
$(vtsdir)/$(PROFILE)_TestLib/1.0/Address.dll \
$(vtsdir)/$(PROFILE)_TestLib/2.0/Address.dll \
$(vtsdir)/$(PROFILE)_TestLib/3.0/Address.dll \
$(vtsdir)/$(PROFILE)_TestLib/4.0/Address.dll \
$(vtsdir)/$(PROFILE)_TestLib/5.0/Address.dll \
$(vtsdir)/$(PROFILE)_TestLib/6.0/Address.dll
$(vtsdir)/1.0/Address.dll \
$(vtsdir)/2.0/Address.dll \
$(vtsdir)/3.0/Address.dll \
$(vtsdir)/4.0/Address.dll \
$(vtsdir)/5.0/Address.dll \
$(vtsdir)/6.0/Address.dll
test-vts: $(vtslibs) $(vtsdir)/$(PROFILE)_TestLib/BinarySerializationOverVersions.exe
test-vts: $(vtslibs) $(test_lib_dir)/BinarySerializationOverVersionsTest.dll
$(vtsdir)/$(PROFILE)_TestLib/%/Address.dll: $(vtsdir)/VersionTolerantSerializationTestLib/%/Address.cs
$(vtsdir)/%/Address.dll: $(vtsdir_src)/VersionTolerantSerializationTestLib/%/Address.cs
@mkdir -p $(dir $@)
$(CSCOMPILE) -target:library -warn:0 -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll -out:$@ $^
$(CSCOMPILE) -target:library -warn:0 -r:$(mscorlib_for_profile) -out:$@ $^
$(vtsdir)/$(PROFILE)_TestLib/BinarySerializationOverVersions.exe: $(vtsdir)/BinarySerializationOverVersions.cs $(vtsdir)/$(PROFILE)_TestLib/1.0/Address.dll $(test_nunit_dep)
$(test_lib_dir)/BinarySerializationOverVersionsTest.dll: $(vtsdir_src)/BinarySerializationOverVersionsTest.cs $(vtsdir)/1.0/Address.dll $(test_nunit_dep)
@mkdir -p $(dir $@)
$(CSCOMPILE) $(test_nunit_ref) -warn:0 \
-r:$(vtsdir)/$(PROFILE)_TestLib/1.0/Address.dll \
-r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll \
-r:$(vtsdir)/1.0/Address.dll \
-r:$(mscorlib_for_profile) \
-r:$(topdir)/class/lib/$(PROFILE)/System.dll \
$(vtsdir)/BinarySerializationOverVersions.cs -out:$@
@cp $(vtsdir)/$(PROFILE)_TestLib/1.0/Address.dll $(vtsdir)/$(PROFILE)_TestLib
-target:library \
$(vtsdir_src)/BinarySerializationOverVersionsTest.cs -out:$@
cp -f $(topdir)/tools/nunit-lite/nunit-lite-console/nunit-lite-console.exe.config.tmpl $(test_lib_dir)/BinarySerializationOverVersionsTest.dll.nunitlite.config
run-test-vts: test-vts
@echo Running vts tests...
PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" $(TEST_RUNTIME) $(TEST_RUNTIME_FLAGS) $(TEST_HARNESS) $(NOSHADOW_FLAG) \
$(vtsdir)/$(PROFILE)_TestLib/BinarySerializationOverVersions.exe
$(test_lib_dir)/BinarySerializationOverVersionsTest.dll
ifdef NO_TEST
NO_VTS_TEST = yes
@@ -264,13 +291,13 @@ run-test:
endif
EXTRA_DISTFILES += \
$(vtsdir)/VersionTolerantSerializationTestLib/1.0/Address.cs \
$(vtsdir)/VersionTolerantSerializationTestLib/2.0/Address.cs \
$(vtsdir)/VersionTolerantSerializationTestLib/3.0/Address.cs \
$(vtsdir)/VersionTolerantSerializationTestLib/4.0/Address.cs \
$(vtsdir)/VersionTolerantSerializationTestLib/5.0/Address.cs \
$(vtsdir)/VersionTolerantSerializationTestLib/6.0/Address.cs \
$(vtsdir)/BinarySerializationOverVersions.cs \
$(vtsdir_src)/VersionTolerantSerializationTestLib/1.0/Address.cs \
$(vtsdir_src)/VersionTolerantSerializationTestLib/2.0/Address.cs \
$(vtsdir_src)/VersionTolerantSerializationTestLib/3.0/Address.cs \
$(vtsdir_src)/VersionTolerantSerializationTestLib/4.0/Address.cs \
$(vtsdir_src)/VersionTolerantSerializationTestLib/5.0/Address.cs \
$(vtsdir_src)/VersionTolerantSerializationTestLib/6.0/Address.cs \
$(vtsdir_src)/BinarySerializationOverVersionsTest.cs \
System.Runtime.CompilerServices/Unsafe.il \
il/il.make \
il/Makefile
@@ -287,7 +314,7 @@ tzi.exe:System/AndroidPlatform.cs $(wildcard System/TimeZone*.cs) ../../build/co
trap "rm -f $(TMP_FILE1) $(TMP_FILE2)" EXIT INT QUIT TERM && \
sed 's/Environment\.GetResourceString/string.Format/g' ../referencesource/mscorlib/system/timezoneinfo.cs > $(TMP_FILE1) && \
sed 's/StringBuilder\.DefaultCapacity/100/g' ../referencesource/mscorlib/system/text/stringbuildercache.cs > $(TMP_FILE2) && \
$(MCS) /debug+ /out:$@ -unsafe -nowarn:612,618 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC $(REFERENCE_SOURCES_FLAGS) "/d:SELF_TEST;NET_1_1;NET_2_0;MOBILE;NET_3_5;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;MOBILE;MOBILE_DYNAMIC;MONODROID;ANDROID" $^ $(TMP_FILE1) $(TMP_FILE2)
$(MCS) /debug+ /out:$@ -unsafe -nowarn:612,618 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC $(REFERENCE_SOURCES_FLAGS) "/d:SELF_TEST;NET_1_1;NET_2_0;MOBILE;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_DYNAMIC;MONODROID;ANDROID" $^ $(TMP_FILE1) $(TMP_FILE2)
android-pull-tzdb:
mkdir -p android/tzdb/usr/share/zoneinfo

View File

@@ -77,6 +77,11 @@ namespace System.Globalization
this.lcid = lcid;
this.source = source;
this.options = opt;
var source_length = source.Length;
var k = new byte [source_length];
for (int i = 0; i < source_length; ++i)
k [i] = (byte)source [i];
this.key = k;
}
internal SortKey (int lcid, string source, byte [] buffer, CompareOptions opt,

View File

@@ -49,12 +49,6 @@ namespace Mono {
internal int len;
}
// handle.h HandleStackMark
struct HandleStackMark {
int size, interior_size;
IntPtr chunk;
}
// mono-error.h MonoError
struct MonoError {
ushort error_code;
@@ -80,4 +74,47 @@ namespace Mono {
internal ushort major, minor, build, revision;
internal ushort arch;
}
// Used to implement generic sharing
// See mini-generic-sharing.c
// We use these instead of the normal ValueTuple types to avoid linking in the
// c# methods belonging to those types
internal struct ValueTuple
{
}
internal struct ValueTuple<T1>
{
public T1 Item1;
}
internal struct ValueTuple<T1, T2>
{
public T1 Item1;
public T2 Item2;
}
internal struct ValueTuple<T1, T2, T3>
{
public T1 Item1;
public T2 Item2;
public T3 Item3;
}
internal struct ValueTuple<T1, T2, T3, T4>
{
public T1 Item1;
public T2 Item2;
public T3 Item3;
public T4 Item4;
}
internal struct ValueTuple<T1, T2, T3, T4, T5>
{
public T1 Item1;
public T2 Item2;
public T3 Item3;
public T4 Item4;
public T5 Item5;
}
}

View File

@@ -5,6 +5,9 @@ namespace System
internal static class AppContextDefaultValues
{
internal const string SwitchNoAsyncCurrentCulture = "Switch.System.Globalization.NoAsyncCurrentCulture";
internal static readonly string SwitchEnforceJapaneseEraYearRanges = "Switch.System.Globalization.EnforceJapaneseEraYearRanges";
internal static readonly string SwitchFormatJapaneseFirstYearAsANumber = "Switch.System.Globalization.FormatJapaneseFirstYearAsANumber";
internal static readonly string SwitchEnforceLegacyJapaneseDateParsing = "Switch.System.Globalization.EnforceLegacyJapaneseDateParsing";
internal const string SwitchThrowExceptionIfDisposedCancellationTokenSource = "Switch.System.Threading.ThrowExceptionIfDisposedCancellationTokenSource";
internal const string SwitchPreserveEventListnerObjectIdentity = "Switch.System.Diagnostics.EventSource.PreserveEventListnerObjectIdentity";
internal const string SwitchUseLegacyPathHandling = "Switch.System.IO.UseLegacyPathHandling";

View File

@@ -7,10 +7,17 @@ using nuint = System.UInt32;
using System.Runtime.CompilerServices;
using System.Runtime;
#if NETCORE
using Internal.Runtime.CompilerServices;
#endif
namespace System
{
partial class Buffer
{
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal static extern unsafe void InternalMemcpy (byte *dest, byte *src, int count);
public static int ByteLength (Array array)
{
// note: the other methods in this class also use ByteLength to test for
@@ -21,7 +28,7 @@ namespace System
int length = _ByteLength (array);
if (length < 0)
throw new ArgumentException (Locale.GetText ("Object must be an array of primitives."));
throw new ArgumentException ("Object must be an array of primitives.");
return length;
}
@@ -51,25 +58,22 @@ namespace System
throw new ArgumentNullException ("dst");
if (srcOffset < 0)
throw new ArgumentOutOfRangeException ("srcOffset", Locale.GetText(
"Non-negative number required."));
throw new ArgumentOutOfRangeException ("srcOffset", "Non-negative number required.");
if (dstOffset < 0)
throw new ArgumentOutOfRangeException ("dstOffset", Locale.GetText (
"Non-negative number required."));
throw new ArgumentOutOfRangeException ("dstOffset", "Non-negative number required.");
if (count < 0)
throw new ArgumentOutOfRangeException ("count", Locale.GetText (
"Non-negative number required."));
throw new ArgumentOutOfRangeException ("count", "Non-negative number required.");
// We do the checks in unmanaged code for performance reasons
bool res = InternalBlockCopy (src, srcOffset, dst, dstOffset, count);
if (!res) {
// watch for integer overflow
if ((srcOffset > ByteLength (src) - count) || (dstOffset > ByteLength (dst) - count))
throw new ArgumentException (Locale.GetText (
throw new ArgumentException (
"Offset and length were out of bounds for the array or count is greater than " +
"the number of elements from index to the end of the source collection."));
"the number of elements from index to the end of the source collection.");
}
}
@@ -191,6 +195,11 @@ namespace System
}
internal static unsafe void Memcpy (byte *dest, byte *src, int len) {
// For bigger lengths, we use the heavily optimized native code
if (len > 32) {
InternalMemcpy (dest, src, len);
return;
}
// FIXME: if pointers are not aligned, try to align them
// so a faster routine can be used. Handle the case where
// the pointers can't be reduced to have the same alignment
@@ -246,4 +255,4 @@ namespace System
}
}
}
}
}

View File

@@ -77,15 +77,7 @@ namespace System.Globalization
{
if (UseManagedCollation)
return GetCollator ().GetSortKey (source, options);
SortKey key=new SortKey (culture, source, options);
/* Need to do the icall here instead of in the
* SortKey constructor, as we need access to
* this instance's collator.
*/
assign_sortkey (key, source, options);
return(key);
return new SortKey (culture, source, options);
}
int internal_index_switch (string s1, int sindex, int count, string s2, CompareOptions opt, bool first)
@@ -96,7 +88,7 @@ namespace System.Globalization
return UseManagedCollation ?
internal_index_managed (s1, sindex, count, s2, opt, first) :
internal_index (s1, sindex, count, s2, opt, first);
internal_index (s1, sindex, count, s2, first);
}
int internal_compare_switch (string str1, int offset1, int length1, string str2, int offset2, int length2, CompareOptions options)
@@ -129,25 +121,29 @@ namespace System.Globalization
}
[MethodImplAttribute (MethodImplOptions.InternalCall)]
private extern void assign_sortkey (object key, string source,
CompareOptions options);
private static unsafe extern int internal_compare_icall (char* str1, int length1,
char* str2, int length2, CompareOptions options);
private static unsafe int internal_compare (string str1, int offset1,
int length1, string str2, int offset2, int length2, CompareOptions options)
{
fixed (char* fixed_str1 = str1,
fixed_str2 = str2)
return internal_compare_icall (fixed_str1 + offset1, length1,
fixed_str2 + offset2, length2, options);
}
[MethodImplAttribute (MethodImplOptions.InternalCall)]
private extern int internal_compare (string str1, int offset1,
int length1, string str2,
int offset2, int length2,
CompareOptions options);
private static unsafe extern int internal_index_icall (char *source, int sindex,
int count, char *value, int value_length, bool first);
[MethodImplAttribute (MethodImplOptions.InternalCall)]
private extern int internal_index (string source, int sindex,
int count, char value,
CompareOptions options,
bool first);
[MethodImplAttribute (MethodImplOptions.InternalCall)]
private extern int internal_index (string source, int sindex,
int count, string value,
CompareOptions options,
bool first);
private static unsafe int internal_index (string source, int sindex,
int count, string value, bool first)
{
fixed (char* fixed_source = source,
fixed_value = value)
return internal_index_icall (fixed_source, sindex, count,
fixed_value, value?.Length ?? 0, first);
}
}
}
}

View File

@@ -239,6 +239,9 @@ namespace System.Globalization
case "zh":
waCalendars = new int[] { calendarId, Calendar.CAL_TAIWAN };
break;
case "he":
waCalendars = new int[] { calendarId, Calendar.CAL_HEBREW };
break;
default:
waCalendars = new int [] { calendarId };
break;
@@ -249,6 +252,14 @@ namespace System.Globalization
}
}
internal CalendarId[] GetCalendarIds()
{
var items = new CalendarId[CalendarIds.Length];
for (int i = 0; i < CalendarIds.Length; i++)
items[i] = (CalendarId)CalendarIds[i];
return items;
}
internal bool IsInvariantCulture {
get {
return string.IsNullOrEmpty (sRealName);
@@ -433,6 +444,19 @@ namespace System.Globalization
// Date separator (derived from short date format)
internal String DateSeparator(int calendarId)
{
#if MONO // see https://github.com/dotnet/coreclr/pull/19976
if (calendarId == (int)CalendarId.JAPAN && !AppContextSwitches.EnforceLegacyJapaneseDateParsing)
{
// The date separator is derived from the default short date pattern. So far this pattern is using
// '/' as date separator when using the Japanese calendar which make the formatting and parsing work fine.
// changing the default pattern is likely will happen in the near future which can easily break formatting
// and parsing.
// We are forcing here the date separator to '/' to ensure the parsing is not going to break when changing
// the default short date pattern. The application still can override this in the code by DateTimeFormatInfo.DateSeparartor.
return "/";
}
#endif
return GetDateSeparator(ShortDates(calendarId)[0]);
}

View File

@@ -1,7 +1,6 @@
namespace System.Runtime.CompilerServices {
[FriendAccessAllowed]
internal static class JitHelpers
{
static internal T UnsafeCast<T>(Object o) where T : class

View File

@@ -2,7 +2,9 @@
using System.Reflection.Emit;
#endif
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Text;
namespace System.Reflection
{
@@ -44,30 +46,112 @@ namespace System.Reflection
throw new Exception ("Method is not a builder method");
}
internal static MethodBase GetMethodFromHandleNoGenericCheck (RuntimeMethodHandle handle)
internal virtual string FormatNameAndSig (bool serialization)
{
return GetMethodFromHandleInternalType_native (handle.Value, IntPtr.Zero, false);
// Serialization uses ToString to resolve MethodInfo overloads.
StringBuilder sbName = new StringBuilder (Name);
sbName.Append ("(");
sbName.Append (ConstructParameters (GetParameterTypes (), CallingConvention, serialization));
sbName.Append (")");
return sbName.ToString ();
}
internal static MethodBase GetMethodFromHandleNoGenericCheck (RuntimeMethodHandle handle, RuntimeTypeHandle reflectedType)
internal virtual Type[] GetParameterTypes ()
{
return GetMethodFromHandleInternalType_native (handle.Value, reflectedType.Value, false);
ParameterInfo[] paramInfo = GetParametersNoCopy ();
Type[] parameterTypes = new Type [paramInfo.Length];
for (int i = 0; i < paramInfo.Length; i++)
parameterTypes [i] = paramInfo [i].ParameterType;
return parameterTypes;
}
internal virtual ParameterInfo[] GetParametersNoCopy () => GetParameters ();
public static MethodBase GetMethodFromHandle (RuntimeMethodHandle handle)
{
if (handle.IsNullHandle ())
throw new ArgumentException (Environment.GetResourceString("Argument_InvalidHandle"));
#if MONO
MethodBase m = RuntimeMethodInfo.GetMethodFromHandleInternalType (handle.Value, IntPtr.Zero);
if (m == null)
throw new ArgumentException ("The handle is invalid.");
#else
MethodBase m = RuntimeType.GetMethodBase (handle.GetMethodInfo ());
#endif
Type declaringType = m.DeclaringType;
if (declaringType != null && declaringType.IsGenericType)
throw new ArgumentException (String.Format (
CultureInfo.CurrentCulture, Environment.GetResourceString ("Argument_MethodDeclaringTypeGeneric"),
m, declaringType.GetGenericTypeDefinition ()));
return m;
}
[System.Runtime.InteropServices.ComVisible(false)]
public static MethodBase GetMethodFromHandle (RuntimeMethodHandle handle, RuntimeTypeHandle declaringType)
{
if (handle.IsNullHandle ())
throw new ArgumentException (Environment.GetResourceString("Argument_InvalidHandle"));
#if MONO
MethodBase m = RuntimeMethodInfo.GetMethodFromHandleInternalType (handle.Value, declaringType.Value);
if (m == null)
throw new ArgumentException ("The handle is invalid.");
return m;
#else
return RuntimeType.GetMethodBase (declaringType.GetRuntimeType (), handle.GetMethodInfo ());
#endif
}
internal static string ConstructParameters (Type[] parameterTypes, CallingConventions callingConvention, bool serialization)
{
StringBuilder sbParamList = new StringBuilder ();
string comma = "";
for (int i = 0; i < parameterTypes.Length; i++) {
Type t = parameterTypes [i];
sbParamList.Append (comma);
string typeName = t.FormatTypeName (serialization);
// Legacy: Why use "ByRef" for by ref parameters? What language is this?
// VB uses "ByRef" but it should precede (not follow) the parameter name.
// Why don't we just use "&"?
if (t.IsByRef && !serialization) {
sbParamList.Append (typeName.TrimEnd (new char[] { '&' }));
sbParamList.Append (" ByRef");
} else {
sbParamList.Append (typeName);
}
comma = ", ";
}
if ((callingConvention & CallingConventions.VarArgs) == CallingConventions.VarArgs) {
sbParamList.Append (comma);
sbParamList.Append ("...");
}
return sbParamList.ToString ();
}
#if MONO
[MethodImplAttribute (MethodImplOptions.InternalCall)]
internal extern static MethodBody GetMethodBodyInternal (IntPtr handle);
internal static MethodBody GetMethodBody (IntPtr handle)
public extern static MethodBase GetCurrentMethod ();
#else
[System.Security.DynamicSecurityMethod] // Specify DynamicSecurityMethod attribute to prevent inlining of the caller.
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
public static MethodBase GetCurrentMethod ()
{
return GetMethodBodyInternal (handle);
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeMethodInfo.InternalGetCurrentMethod (ref stackMark);
}
static MethodBase GetMethodFromHandleInternalType (IntPtr method_handle, IntPtr type_handle) {
return GetMethodFromHandleInternalType_native (method_handle, type_handle, true);
}
[MethodImplAttribute (MethodImplOptions.InternalCall)]
internal extern static MethodBase GetMethodFromHandleInternalType_native (IntPtr method_handle, IntPtr type_handle, bool genericCheck);
#endif
}
}

View File

@@ -1,6 +1,6 @@
namespace System.IO
{
static class PathInternal
internal static partial class PathInternal
{
public static bool IsPartiallyQualified (string path)
{

View File

@@ -48,14 +48,16 @@ namespace System
// ,+*&*[]\ in the identifier portions of the names
// have been escaped with a leading backslash (\)
public string full_name;
public MonoCMethod default_ctor;
public RuntimeConstructorInfo default_ctor;
}
[StructLayout (LayoutKind.Sequential)]
partial class RuntimeType
{
#region keep in sync with object-internals.h
[NonSerialized]
MonoTypeInfo type_info;
#endregion
internal Object GenericCache;
@@ -64,9 +66,9 @@ namespace System
throw new NotImplementedException ();
}
internal MonoCMethod GetDefaultConstructor ()
internal RuntimeConstructorInfo GetDefaultConstructor ()
{
MonoCMethod ctor = null;
RuntimeConstructorInfo ctor = null;
if (type_info == null)
type_info = new MonoTypeInfo ();
@@ -78,7 +80,7 @@ namespace System
for (int i = 0; i < ctors.Length; ++i) {
if (ctors [i].GetParametersCount () == 0) {
type_info.default_ctor = ctor = (MonoCMethod) ctors [i];
type_info.default_ctor = ctor = (RuntimeConstructorInfo) ctors [i];
break;
}
}
@@ -93,6 +95,7 @@ namespace System
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern ConstructorInfo GetCorrespondingInflatedConstructor (ConstructorInfo generic);
#if !NETCORE
internal override MethodInfo GetMethod (MethodInfo fromNoninstanciated)
{
if (fromNoninstanciated == null)
@@ -114,6 +117,7 @@ namespace System
flags |= fromNoninstanciated.IsPublic ? BindingFlags.Public : BindingFlags.NonPublic;
return GetField (fromNoninstanciated.Name, flags);
}
#endif
string GetDefaultMemberName ()
{
@@ -168,12 +172,12 @@ namespace System
if (IsValueType)
return CreateInstanceInternal (this);
throw new MissingMethodException (Locale.GetText ("Default constructor not found for type " + FullName));
throw new MissingMethodException ("Default constructor not found for type " + FullName);
}
// TODO: .net does more checks in unmanaged land in RuntimeTypeHandle::CreateInstance
if (IsAbstract) {
throw new MissingMethodException (Locale.GetText ("Cannot create an abstract class '{0}'.", FullName));
throw new MissingMethodException ("Cannot create an abstract class '{0}'.", FullName);
}
return ctor.InternalInvoke (null, null, wrapExceptions);
@@ -419,12 +423,18 @@ namespace System
public override Type MakePointerType ()
{
if (IsByRef)
throw new TypeLoadException ($"Could not load type '{GetType()}' from assembly '{AssemblyQualifiedName}");
return MakePointerType (this);
}
public override StructLayoutAttribute StructLayoutAttribute {
get {
#if NETCORE
throw new NotImplementedException ();
#else
return StructLayoutAttribute.GetCustomAttribute (this);
#endif
}
}
@@ -483,7 +493,7 @@ namespace System
var a = new RuntimeMethodInfo [n];
for (int i = 0; i < n; i++) {
var mh = new RuntimeMethodHandle (h[i]);
a[i] = (RuntimeMethodInfo) MethodBase.GetMethodFromHandleNoGenericCheck (mh, refh);
a[i] = (RuntimeMethodInfo) RuntimeMethodInfo.GetMethodFromHandleNoGenericCheck (mh, refh);
}
return a;
}
@@ -503,7 +513,7 @@ namespace System
var a = new RuntimeConstructorInfo [n];
for (int i = 0; i < n; i++) {
var mh = new RuntimeMethodHandle (h[i]);
a[i] = (RuntimeConstructorInfo) MethodBase.GetMethodFromHandleNoGenericCheck (mh, refh);
a[i] = (RuntimeConstructorInfo) RuntimeMethodInfo.GetMethodFromHandleNoGenericCheck (mh, refh);
}
return a;
}
@@ -518,7 +528,7 @@ namespace System
var a = new RuntimePropertyInfo [n];
for (int i = 0; i < n; i++) {
var ph = new Mono.RuntimePropertyHandle (h[i]);
a[i] = (RuntimePropertyInfo) MonoProperty.GetPropertyFromHandle (ph, refh);
a[i] = (RuntimePropertyInfo) RuntimePropertyInfo.GetPropertyFromHandle (ph, refh);
}
return a;
}
@@ -540,14 +550,14 @@ namespace System
InterfaceMapping res;
if (!ifaceType.IsInterface)
throw new ArgumentException (Locale.GetText ("Argument must be an interface."), "ifaceType");
throw new ArgumentException ("Argument must be an interface.", "ifaceType");
if (IsInterface)
throw new ArgumentException ("'this' type cannot be an interface itself");
res.TargetType = this;
res.InterfaceType = ifaceType;
GetInterfaceMapData (this, ifaceType, out res.TargetMethods, out res.InterfaceMethods);
if (res.TargetMethods == null)
throw new ArgumentException (Locale.GetText ("Interface not found"), "ifaceType");
throw new ArgumentException ("Interface not found", "ifaceType");
return res;
}
@@ -673,7 +683,7 @@ namespace System
extern int GetGenericParameterPosition ();
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern IntPtr GetEvents_native (IntPtr name, BindingFlags bindingAttr, MemberListType listType);
extern IntPtr GetEvents_native (IntPtr name, MemberListType listType);
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern IntPtr GetFields_native (IntPtr name, BindingFlags bindingAttr, MemberListType listType);
@@ -687,7 +697,11 @@ namespace System
var a = new RuntimeFieldInfo[n];
for (int i = 0; i < n; i++) {
var fh = new RuntimeFieldHandle (h[i]);
#if NETCORE
throw new NotImplementedException ();
#else
a[i] = (RuntimeFieldInfo) FieldInfo.GetFieldFromHandle (fh, refh);
#endif
}
return a;
}
@@ -697,12 +711,16 @@ namespace System
{
var refh = new RuntimeTypeHandle (reflectedType);
using (var namePtr = new Mono.SafeStringMarshal (name))
using (var h = new Mono.SafeGPtrArrayHandle (GetEvents_native (namePtr.Value, bindingAttr, listType))) {
using (var h = new Mono.SafeGPtrArrayHandle (GetEvents_native (namePtr.Value, listType))) {
int n = h.Length;
var a = new RuntimeEventInfo[n];
for (int i = 0; i < n; i++) {
var eh = new Mono.RuntimeEventHandle (h[i]);
#if NETCORE
throw new NotImplementedException ();
#else
a[i] = (RuntimeEventInfo) EventInfo.GetEventFromHandle (eh, refh);
#endif
}
return a;
}
@@ -717,8 +735,12 @@ namespace System
RuntimeType[] GetNestedTypes_internal (string displayName, BindingFlags bindingAttr, MemberListType listType)
{
string internalName = null;
#if NETCORE
throw new NotImplementedException ();
#else
if (displayName != null)
internalName = TypeIdentifiers.FromDisplay (displayName).InternalName;
#endif
using (var namePtr = new Mono.SafeStringMarshal (internalName))
using (var h = new Mono.SafeGPtrArrayHandle (GetNestedTypes_native (namePtr.Value, bindingAttr, listType))) {
int n = h.Length;
@@ -800,7 +822,9 @@ namespace System
}
}
#if !NETCORE
public sealed override bool HasSameMetadataDefinitionAs (MemberInfo other) => HasSameMetadataDefinitionAsCore<RuntimeType> (other);
#endif
public override bool IsSZArray {
get {
@@ -809,11 +833,13 @@ namespace System
}
}
#if !NETCORE
internal override bool IsUserType {
get {
return false;
}
}
#endif
[System.Runtime.InteropServices.ComVisible(true)]
[Pure]
@@ -828,5 +854,13 @@ namespace System
return RuntimeTypeHandle.IsSubclassOf (this, rtType);
}
public override bool IsByRefLike {
get {
return RuntimeTypeHandle.IsByRefLike (this);
}
}
public override bool IsTypeDefinition => RuntimeTypeHandle.IsTypeDefinition (this);
}
}

View File

@@ -242,25 +242,6 @@ namespace System
return countA - countB;
}
internal static unsafe void CharCopy (char *dest, char *src, int count) {
// Same rules as for memcpy, but with the premise that
// chars can only be aligned to even addresses if their
// enclosing types are correctly aligned
if ((((int)(byte*)dest | (int)(byte*)src) & 3) != 0) {
if (((int)(byte*)dest & 2) != 0 && ((int)(byte*)src & 2) != 0 && count > 0) {
((short*)dest) [0] = ((short*)src) [0];
dest++;
src++;
count--;
}
if ((((int)(byte*)dest | (int)(byte*)src) & 2) != 0) {
Buffer.memcpy2 ((byte*)dest, (byte*)src, count * 2);
return;
}
}
Buffer.memcpy4 ((byte*)dest, (byte*)src, count * 2);
}
#region Runtime method-to-ir dependencies
/* helpers used by the runtime as well as above or eslewhere in corlib */
@@ -453,4 +434,4 @@ namespace System
return hash1 + (hash2 * 1566083941);
}
}
}
}

View File

@@ -29,71 +29,15 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using StackCrawlMark = System.Threading.StackCrawlMark;
namespace System
{
[Serializable]
partial class Type : MemberInfo
{
internal RuntimeTypeHandle _impl;
#region Requires stack backtracing fixes in unmanaged type_from_name
[MethodImplAttribute(MethodImplOptions.InternalCall)]
static extern Type internal_from_name (string name, bool throwOnError, bool ignoreCase);
public static Type GetType(string typeName)
{
return GetType (typeName, false, false);
}
public static Type GetType(string typeName, bool throwOnError)
{
return GetType (typeName, throwOnError, false);
}
public static Type GetType(string typeName, bool throwOnError, bool ignoreCase)
{
if (typeName == null)
throw new ArgumentNullException ("TypeName");
if (typeName == String.Empty)
if (throwOnError)
throw new TypeLoadException ("A null or zero length string does not represent a valid Type.");
else
return null;
Type t = internal_from_name (typeName, throwOnError, ignoreCase);
if (throwOnError && t == null)
throw new TypeLoadException ("Error loading '" + typeName + "'");
return t;
}
#endregion
// TODO: Merge with internal_from_name
public static Type ReflectionOnlyGetType (string typeName,
bool throwIfNotFound,
bool ignoreCase)
{
if (typeName == null)
throw new ArgumentNullException ("typeName");
if (typeName == String.Empty && throwIfNotFound)
throw new TypeLoadException ("A null or zero length string does not represent a valid Type");
int idx = typeName.IndexOf (',');
if (idx < 0 || idx == 0 || idx == typeName.Length - 1)
throw new ArgumentException ("Assembly qualifed type name is required", "typeName");
string an = typeName.Substring (idx + 1);
Assembly a;
try {
a = Assembly.ReflectionOnlyLoad (an);
} catch {
if (throwIfNotFound)
throw;
return null;
}
return a.GetType (typeName.Substring (0, idx), throwIfNotFound, ignoreCase);
}
internal virtual Type InternalResolve ()
{
return UnderlyingSystemType;
@@ -138,5 +82,107 @@ namespace System
[MethodImplAttribute(MethodImplOptions.InternalCall)]
static extern Type internal_from_handle (IntPtr handle);
internal virtual RuntimeTypeHandle GetTypeHandleInternal () => TypeHandle;
#if FEATURE_COMINTEROP || MONO_COM
virtual internal bool IsWindowsRuntimeObjectImpl () => throw new NotImplementedException ();
virtual internal bool IsExportedToWindowsRuntimeImpl () => throw new NotImplementedException ();
internal bool IsWindowsRuntimeObject => IsWindowsRuntimeObjectImpl ();
internal bool IsExportedToWindowsRuntime => IsExportedToWindowsRuntimeImpl ();
#endif // FEATURE_COMINTEROP
internal virtual bool HasProxyAttributeImpl () => false;
internal virtual bool IsSzArray => false;
// This is only ever called on RuntimeType objects.
internal string FormatTypeName () => FormatTypeName (false);
internal virtual string FormatTypeName (bool serialization) => throw new NotImplementedException();
public bool IsInterface {
get {
RuntimeType rt = this as RuntimeType;
if (rt != null)
return RuntimeTypeHandle.IsInterface (rt);
return ((GetAttributeFlagsImpl() & TypeAttributes.ClassSemanticsMask) == TypeAttributes.Interface);
}
}
[MethodImplAttribute (MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
public static Type GetType (String typeName, bool throwOnError, bool ignoreCase)
{
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeType.GetType (typeName, throwOnError, ignoreCase, false, ref stackMark);
}
[MethodImplAttribute (MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
public static Type GetType (String typeName, bool throwOnError)
{
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeType.GetType (typeName, throwOnError, false, false, ref stackMark);
}
[MethodImplAttribute (MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
public static Type GetType (String typeName) {
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeType.GetType (typeName, false, false, false, ref stackMark);
}
// Methods containing StackCrawlMark local var has to be marked non-inlineable
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static Type GetType (
string typeName,
Func<AssemblyName, Assembly> assemblyResolver,
Func<Assembly, string, bool, Type> typeResolver)
{
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return TypeNameParser.GetType (typeName, assemblyResolver, typeResolver, false, false, ref stackMark);
}
// Methods containing StackCrawlMark local var has to be marked non-inlineable
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static Type GetType (
string typeName,
Func<AssemblyName, Assembly> assemblyResolver,
Func<Assembly, string, bool, Type> typeResolver,
bool throwOnError)
{
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return TypeNameParser.GetType (typeName, assemblyResolver, typeResolver, throwOnError, false, ref stackMark);
}
// Methods containing StackCrawlMark local var has to be marked non-inlineable
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static Type GetType(
string typeName,
Func<AssemblyName, Assembly> assemblyResolver,
Func<Assembly, string, bool, Type> typeResolver,
bool throwOnError,
bool ignoreCase)
{
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return TypeNameParser.GetType (typeName, assemblyResolver, typeResolver, throwOnError, ignoreCase, ref stackMark);
}
public static bool operator == (Type left, Type right)
{
return object.ReferenceEquals (left, right);
}
public static bool operator != (Type left, Type right)
{
return !object.ReferenceEquals (left, right);
}
#if !NETCORE
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
public static Type ReflectionOnlyGetType (String typeName, bool throwIfNotFound, bool ignoreCase)
{
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeType.GetType (typeName, throwIfNotFound, ignoreCase, true /*reflectionOnly*/, ref stackMark);
}
#endif
}
}

View File

@@ -14,7 +14,7 @@ namespace System
ref StackCrawlMark stackMark)
{
TypeSpec spec = TypeSpec.Parse (typeName);
return spec.Resolve (assemblyResolver, typeResolver, throwOnError, ignoreCase);
return spec.Resolve (assemblyResolver, typeResolver, throwOnError, ignoreCase, ref stackMark);
}
}
}

View File

@@ -1,83 +0,0 @@
//
// System.Diagnostics.SymbolStore.SymbolToken.cs
//
// Authors:
// Duco Fijma (duco@lorentz.xs4all.nl)
// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
//
// (c) 2002 Duco Fijma
// (C) 2003 Andreas Nahr
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Runtime.InteropServices;
namespace System.Diagnostics.SymbolStore
{
[ComVisible (true)]
public struct SymbolToken
{
private int _val;
public SymbolToken (int val)
{
_val = val;
}
public override bool Equals (object obj)
{
if (!(obj is SymbolToken))
return false;
return ((SymbolToken) obj).GetToken() == _val;
}
public bool Equals (SymbolToken obj)
{
return(obj.GetToken () == _val);
}
public static bool operator == (SymbolToken a, SymbolToken b)
{
return a.Equals (b);
}
public static bool operator != (SymbolToken a, SymbolToken b)
{
return !a.Equals (b);
}
public override int GetHashCode()
{
return _val.GetHashCode();
}
public int GetToken()
{
return _val;
}
}
}

View File

@@ -28,7 +28,7 @@
namespace System.Diagnostics.Tracing
{
public class EventCounter
public class EventCounter : IDisposable
{
public EventCounter (string name, EventSource eventSource)
{
@@ -37,5 +37,9 @@ namespace System.Diagnostics.Tracing
public void WriteMetric (float value)
{
}
public void Dispose ()
{
}
}
}

View File

@@ -71,6 +71,11 @@ namespace System.Diagnostics.Tracing
public virtual void Dispose()
{
}
#pragma warning disable CS0067
public event EventHandler<EventSourceCreatedEventArgs> EventSourceCreated;
public event EventHandler<EventWrittenEventArgs> EventWritten;
#pragma warning restore CS0067
}
}

View File

@@ -277,56 +277,56 @@ namespace System.Diagnostics.Tracing
{
}
[MonoTODO]
// [MonoTODO]
public event EventHandler<EventCommandEventArgs> EventCommandExecuted
{
add { throw new NotImplementedException (); }
remove { throw new NotImplementedException (); }
}
[MonoTODO]
// [MonoTODO]
public static string GenerateManifest (Type eventSourceType, string assemblyPathToIncludeInManifest)
{
throw new NotImplementedException ();
}
[MonoTODO]
// [MonoTODO]
public static string GenerateManifest (Type eventSourceType, string assemblyPathToIncludeInManifest, EventManifestOptions flags)
{
throw new NotImplementedException ();
}
[MonoTODO]
// [MonoTODO]
public static Guid GetGuid (Type eventSourceType)
{
throw new NotImplementedException ();
}
[MonoTODO]
// [MonoTODO]
public static string GetName (Type eventSourceType)
{
throw new NotImplementedException ();
}
[MonoTODO]
// [MonoTODO]
public static IEnumerable<EventSource> GetSources ()
{
throw new NotImplementedException ();
}
[MonoTODO]
// [MonoTODO]
public static void SendCommand (EventSource eventSource, EventCommand command, IDictionary<string, string> commandArguments)
{
throw new NotImplementedException ();
}
[MonoTODO]
// [MonoTODO]
public static void SetCurrentThreadActivityId (Guid activityId)
{
throw new NotImplementedException ();
}
[MonoTODO]
// [MonoTODO]
public static void SetCurrentThreadActivityId (Guid activityId, out Guid oldActivityThatWillContinue)
{
throw new NotImplementedException ();

Some files were not shown because too many files have changed in this diff Show More