summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiyoung Yun <jy910.yun@samsung.com>2017-06-13 18:47:36 +0900
committerJiyoung Yun <jy910.yun@samsung.com>2017-06-13 18:47:36 +0900
commit61d6a817e39d3bae0f47dbc09838d51db22a5d30 (patch)
treecb37caa1784bc738b976273335d6ed04a7cc80b0
parent5b975f8233e8c8d17b215372f89ca713b45d6a0b (diff)
downloadcoreclr-61d6a817e39d3bae0f47dbc09838d51db22a5d30.tar.gz
coreclr-61d6a817e39d3bae0f47dbc09838d51db22a5d30.tar.bz2
coreclr-61d6a817e39d3bae0f47dbc09838d51db22a5d30.zip
Imported Upstream version 2.0.0.11992upstream/2.0.0.11992
-rw-r--r--BuildToolsVersion.txt2
-rw-r--r--Documentation/botr/xplat-minidump-generation.md2
-rw-r--r--Documentation/building/debugging-instructions.md7
-rw-r--r--Documentation/building/linux-instructions.md5
-rw-r--r--Documentation/building/unix-test-instructions.md5
-rw-r--r--Documentation/design-docs/eh-writethru.md100
-rw-r--r--Documentation/design-docs/first-class-structs.md2
-rw-r--r--Documentation/dummy.txt1
-rw-r--r--Documentation/project-docs/ci-trigger-phrases.md17
-rw-r--r--Documentation/project-docs/clr-configuration-knobs.md3
-rw-r--r--Documentation/project-docs/contributing-workflow.md24
-rw-r--r--Documentation/project-docs/dotnet-standards.md2
-rw-r--r--Documentation/project-docs/garbage-collector-guidelines.md33
-rw-r--r--Documentation/project-docs/performance-guidelines.md9
-rw-r--r--DotnetCLIVersion.txt2
-rw-r--r--Linkedbin534016 -> 0 bytes
-rw-r--r--THIRD-PARTY-NOTICES.TXT (renamed from THIRD-PARTY-NOTICES)0
-rw-r--r--Tools-Override/codeOptimization.targets118
-rw-r--r--Tools-Override/depProj.targets131
-rw-r--r--Tools-Override/resources.targets76
-rwxr-xr-xbuild-packages.sh12
-rw-r--r--build-test.cmd35
-rw-r--r--build.cmd59
-rw-r--r--build.proj9
-rwxr-xr-xbuild.sh70
-rw-r--r--buildpipeline/DotNet-CoreClr-Trusted-Linux-Crossbuild.json9
-rw-r--r--buildpipeline/DotNet-CoreClr-Trusted-Linux.json9
-rw-r--r--buildpipeline/DotNet-CoreClr-Trusted-Mac.json7
-rw-r--r--buildpipeline/DotNet-CoreClr-Trusted-Windows-x86.json119
-rw-r--r--buildpipeline/DotNet-CoreClr-Trusted-Windows.json47
-rw-r--r--buildpipeline/DotNet-Trusted-Publish-Symbols.json274
-rw-r--r--buildpipeline/DotNet-Trusted-Publish.json25
-rw-r--r--buildpipeline/Dotnet-CoreClr-Trusted-BuildTests.json66
-rw-r--r--buildpipeline/pipelines.json222
-rw-r--r--clr.coreclr.props9
-rw-r--r--clr.defines.targets2
-rw-r--r--clrdefinitions.cmake21
-rw-r--r--clrfeatures.cmake8
-rw-r--r--config.json48
-rwxr-xr-xcross/armel/tizen-fetch.sh46
-rw-r--r--cross/armel/tizen/tizen.patch15
-rw-r--r--cross/armel/toolchain.cmake2
-rw-r--r--dependencies.props35
-rw-r--r--dir.props58
-rwxr-xr-xextract-from-json.py56
-rw-r--r--functions.cmake9
-rw-r--r--init-tools.cmd57
-rw-r--r--init-tools.msbuild16
-rwxr-xr-xinit-tools.sh101
-rwxr-xr-xnetci.groovy89
-rw-r--r--perf.groovy243
-rw-r--r--pgosupport.cmake4
-rw-r--r--run.cmd11
-rwxr-xr-xrun.sh3
-rw-r--r--src/.nuget/Microsoft.NETCore.Jit/runtime.Windows_NT.Microsoft.NETCore.Jit.props1
-rw-r--r--src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/runtime.Linux.Microsoft.NETCore.Runtime.CoreCLR.props11
-rw-r--r--src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/runtime.OSX.Microsoft.NETCore.Runtime.CoreCLR.props3
-rw-r--r--src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/runtime.Windows_NT.Microsoft.NETCore.Runtime.CoreCLR.props9
-rw-r--r--src/.nuget/ThirdPartyNotices.txt31
-rw-r--r--src/.nuget/dir.props41
-rw-r--r--src/.nuget/dir.targets18
-rw-r--r--src/.nuget/dotnet_library_license.txt127
-rw-r--r--src/.nuget/init/init.csproj (renamed from tests/src/Common/external/external.csproj)15
-rw-r--r--src/.nuget/init/project.json10
-rw-r--r--src/.nuget/init/readme.txt1
-rw-r--r--src/.nuget/optdata/nuget.config6
-rw-r--r--src/.nuget/optdata/optdata.csproj24
-rw-r--r--src/.nuget/packages.builds4
-rw-r--r--src/CMakeLists.txt5
-rw-r--r--src/ToolBox/SOS/NETCore/SOS.NETCore.csproj27
-rw-r--r--src/ToolBox/SOS/NETCore/project.json15
-rw-r--r--src/ToolBox/SOS/Strike/sosdocsunix.txt1
-rw-r--r--src/ToolBox/SOS/Strike/strike.cpp8
-rw-r--r--src/ToolBox/SOS/lldbplugin/CMakeLists.txt31
-rw-r--r--src/binder/assemblybinder.cpp36
-rw-r--r--src/build.proj8
-rw-r--r--src/classlibnative/bcltype/arraynative.cpp24
-rw-r--r--src/corefx/System.Globalization.Native/icushim.h2
-rw-r--r--src/createVersionFile.proj13
-rw-r--r--src/debug/createdump/CMakeLists.txt11
-rw-r--r--src/debug/createdump/crashinfo.cpp244
-rw-r--r--src/debug/createdump/crashinfo.h4
-rw-r--r--src/debug/createdump/createdump.cpp8
-rw-r--r--src/debug/createdump/datatarget.cpp1
-rw-r--r--src/debug/createdump/dumpwriter.cpp2
-rw-r--r--src/debug/createdump/main.cpp5
-rw-r--r--src/debug/createdump/memoryregion.h39
-rw-r--r--src/debug/createdump/threadinfo.cpp2
-rw-r--r--src/debug/daccess/daccess.cpp2
-rw-r--r--src/debug/daccess/dacimpl.h1
-rw-r--r--src/debug/daccess/enummem.cpp8
-rw-r--r--src/debug/di/cordb.cpp11
-rw-r--r--src/debug/shared/amd64/primitives.cpp2
-rw-r--r--src/dlls/mscordac/mscordac_unixexports.src1
-rw-r--r--src/dlls/mscoree/CMakeLists.txt5
-rw-r--r--src/dlls/mscoree/coreclr/CMakeLists.txt6
-rw-r--r--src/dlls/mscoree/gdbjit_unixexports.src3
-rw-r--r--src/dlls/mscorpe/iceefilegen.cpp4
-rw-r--r--src/gc/handletablecore.cpp26
-rw-r--r--src/gc/objecthandle.cpp3
-rw-r--r--src/ilasm/asmman.cpp11
-rw-r--r--src/ilasm/asmman.hpp2
-rw-r--r--src/ilasm/assembler.cpp16
-rw-r--r--src/ilasm/prebuilt/asmparse.cpp35
-rw-r--r--src/inc/CrstTypes.def2
-rw-r--r--src/inc/clrconfigvalues.h14
-rw-r--r--src/inc/corcompile.h9
-rw-r--r--src/inc/corprof.idl18
-rw-r--r--src/inc/crsttypes.h3
-rw-r--r--src/inc/daccess.h6
-rw-r--r--src/inc/eventtracebase.h21
-rw-r--r--src/inc/profilepriv.inl15
-rw-r--r--src/inc/switches.h3
-rw-r--r--src/inc/winrt/paraminstanceapi.h7
-rw-r--r--src/jit/assertionprop.cpp2
-rw-r--r--src/jit/bitset.h11
-rw-r--r--src/jit/bitsetasshortlong.h32
-rw-r--r--src/jit/bitsetasuint64.h5
-rw-r--r--src/jit/bitsetasuint64inclass.h17
-rw-r--r--src/jit/bitsetops.h1
-rw-r--r--src/jit/codegenarm.cpp1313
-rw-r--r--src/jit/codegenarm64.cpp1773
-rw-r--r--src/jit/codegenarmarch.cpp834
-rw-r--r--src/jit/codegencommon.cpp26
-rw-r--r--src/jit/codegenlinear.cpp8
-rw-r--r--src/jit/codegenlinear.h63
-rw-r--r--src/jit/codegenxarch.cpp7
-rw-r--r--src/jit/compiler.h7
-rw-r--r--src/jit/copyprop.cpp2
-rw-r--r--src/jit/decomposelongs.cpp8
-rw-r--r--src/jit/ee_il_dll.cpp2
-rw-r--r--src/jit/emit.cpp6
-rw-r--r--src/jit/emit.h43
-rw-r--r--src/jit/emitarm64.cpp303
-rw-r--r--src/jit/emitarm64.h9
-rw-r--r--src/jit/emitxarch.cpp6
-rw-r--r--src/jit/flowgraph.cpp55
-rw-r--r--src/jit/gentree.cpp11
-rw-r--r--src/jit/gentree.h15
-rw-r--r--src/jit/importer.cpp67
-rw-r--r--src/jit/instrsarm64.h18
-rw-r--r--src/jit/lclvars.cpp5
-rw-r--r--src/jit/liveness.cpp3
-rw-r--r--src/jit/lower.cpp10
-rw-r--r--src/jit/lower.h16
-rw-r--r--src/jit/lowerarmarch.cpp7
-rw-r--r--src/jit/lsra.cpp255
-rw-r--r--src/jit/lsra.h6
-rw-r--r--src/jit/lsraarm.cpp2
-rw-r--r--src/jit/lsraarmarch.cpp22
-rw-r--r--src/jit/morph.cpp77
-rw-r--r--src/jit/nodeinfo.h4
-rw-r--r--src/jit/optimizer.cpp82
-rw-r--r--src/jit/regalloc.cpp4
-rw-r--r--src/jit/target.h15
-rw-r--r--src/md/ceefilegen/cceegen.cpp30
-rw-r--r--src/md/enc/mdinternalrw.cpp2
-rw-r--r--src/mscorlib/Resources/Strings.resx9
-rw-r--r--src/mscorlib/System.Private.CoreLib.csproj50
-rw-r--r--src/mscorlib/Tools/Signing/mscorlib.snkbin160 -> 0 bytes
-rw-r--r--src/mscorlib/shared/Interop/Unix/System.Globalization.Native/Interop.Collation.cs (renamed from src/mscorlib/src/Interop/Unix/System.Globalization.Native/Interop.Collation.cs)3
-rw-r--r--src/mscorlib/shared/Interop/Windows/Interop.Libraries.cs1
-rw-r--r--src/mscorlib/shared/Interop/Windows/Kernel32/Interop.Globalization.cs (renamed from src/mscorlib/src/Interop/Windows/kernel32/Interop.Globalization.cs)16
-rw-r--r--src/mscorlib/shared/Interop/Windows/Kernel32/Interop.SetThreadErrorMode.cs (renamed from src/mscorlib/shared/Interop/Windows/Kernel32/Interop.SetErrorMode.cs)4
-rw-r--r--src/mscorlib/shared/Interop/Windows/NtDll/Interop.ZeroMemory.cs16
-rw-r--r--src/mscorlib/shared/Microsoft/Win32/SafeHandles/SafeFileHandle.Unix.cs60
-rw-r--r--src/mscorlib/shared/Microsoft/Win32/SafeHandles/SafeHandleMinusOneIsInvalid.cs19
-rw-r--r--src/mscorlib/shared/Microsoft/Win32/SafeHandles/SafeHandleZeroOrMinusOneIsInvalid.cs19
-rw-r--r--src/mscorlib/shared/System.Private.CoreLib.Shared.projitems41
-rw-r--r--src/mscorlib/shared/System/ApplicationException.cs6
-rw-r--r--src/mscorlib/shared/System/ArgumentException.cs4
-rw-r--r--src/mscorlib/shared/System/ArgumentNullException.cs6
-rw-r--r--src/mscorlib/shared/System/ArgumentOutOfRangeException.cs (renamed from src/mscorlib/src/System/ArgumentOutOfRangeException.cs)61
-rw-r--r--src/mscorlib/shared/System/ArithmeticException.cs6
-rw-r--r--src/mscorlib/shared/System/ArrayTypeMismatchException.cs6
-rw-r--r--src/mscorlib/shared/System/AsyncCallback.cs1
-rw-r--r--src/mscorlib/shared/System/AttributeTargets.cs1
-rw-r--r--src/mscorlib/shared/System/AttributeUsageAttribute.cs1
-rw-r--r--src/mscorlib/shared/System/BadImageFormatException.cs (renamed from src/mscorlib/src/System/BadImageFormatException.cs)88
-rw-r--r--src/mscorlib/shared/System/CLSCompliantAttribute.cs1
-rw-r--r--src/mscorlib/shared/System/Char.cs2
-rw-r--r--src/mscorlib/shared/System/CharEnumerator.cs1
-rw-r--r--src/mscorlib/shared/System/Collections/Generic/KeyNotFoundException.cs6
-rw-r--r--src/mscorlib/shared/System/CurrentSystemTimeZone.cs1
-rw-r--r--src/mscorlib/shared/System/DBNull.cs10
-rw-r--r--src/mscorlib/shared/System/DataMisalignedException.cs3
-rw-r--r--src/mscorlib/shared/System/DateTimeKind.cs1
-rw-r--r--src/mscorlib/shared/System/DayOfWeek.cs1
-rw-r--r--src/mscorlib/shared/System/DefaultBinder.cs2
-rw-r--r--src/mscorlib/shared/System/Diagnostics/ConditionalAttribute.cs1
-rw-r--r--src/mscorlib/shared/System/Diagnostics/Debug.Unix.cs (renamed from src/mscorlib/src/System/Diagnostics/Debug.Unix.cs)0
-rw-r--r--src/mscorlib/shared/System/Diagnostics/Tracing/EventProvider.cs135
-rwxr-xr-x[-rw-r--r--]src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs172
-rw-r--r--src/mscorlib/shared/System/Diagnostics/Tracing/EventSourceException.cs4
-rw-r--r--src/mscorlib/shared/System/Diagnostics/Tracing/IEventProvider.cs42
-rw-r--r--src/mscorlib/shared/System/DivideByZeroException.cs6
-rw-r--r--src/mscorlib/shared/System/DllNotFoundException.cs (renamed from src/mscorlib/src/System/DllNotFoundException.cs)5
-rw-r--r--src/mscorlib/shared/System/DuplicateWaitObjectException.cs9
-rw-r--r--src/mscorlib/shared/System/EntryPointNotFoundException.cs6
-rw-r--r--src/mscorlib/shared/System/EventArgs.cs1
-rw-r--r--src/mscorlib/shared/System/EventHandler.cs2
-rw-r--r--src/mscorlib/shared/System/ExecutionEngineException.cs3
-rw-r--r--src/mscorlib/shared/System/FieldAccessException.cs6
-rw-r--r--src/mscorlib/shared/System/FlagsAttribute.cs1
-rw-r--r--src/mscorlib/shared/System/FormatException.cs6
-rw-r--r--src/mscorlib/shared/System/Globalization/CalendarData.Unix.cs (renamed from src/mscorlib/src/System/Globalization/CalendarData.Unix.cs)27
-rw-r--r--src/mscorlib/shared/System/Globalization/CalendarWeekRule.cs1
-rw-r--r--src/mscorlib/shared/System/Globalization/ChineseLunisolarCalendar.cs1
-rw-r--r--src/mscorlib/shared/System/Globalization/CultureData.Unix.cs (renamed from src/mscorlib/src/System/Globalization/CultureData.Unix.cs)0
-rw-r--r--src/mscorlib/shared/System/Globalization/CultureNotFoundException.cs6
-rw-r--r--src/mscorlib/shared/System/Globalization/DateTimeFormatInfo.cs1
-rw-r--r--src/mscorlib/shared/System/Globalization/DaylightTime.cs1
-rw-r--r--src/mscorlib/shared/System/Globalization/EastAsianLunisolarCalendar.cs1
-rw-r--r--src/mscorlib/shared/System/Globalization/GregorianCalendarTypes.cs1
-rw-r--r--src/mscorlib/shared/System/Globalization/HebrewCalendar.cs1
-rw-r--r--src/mscorlib/shared/System/Globalization/HijriCalendar.Unix.cs (renamed from src/mscorlib/src/System/Globalization/HijriCalendar.Unix.cs)0
-rw-r--r--src/mscorlib/shared/System/Globalization/HijriCalendar.Win32.cs (renamed from src/mscorlib/src/System/Globalization/HijriCalendar.Win32.cs)0
-rw-r--r--src/mscorlib/shared/System/Globalization/HijriCalendar.WinRT.cs (renamed from src/mscorlib/src/System/Globalization/HijriCalendar.WinRT.cs)0
-rw-r--r--src/mscorlib/shared/System/Globalization/HijriCalendar.cs1
-rw-r--r--src/mscorlib/shared/System/Globalization/IdnMapping.Unix.cs (renamed from src/mscorlib/src/System/Globalization/IdnMapping.Unix.cs)4
-rw-r--r--src/mscorlib/shared/System/Globalization/JapaneseCalendar.Unix.cs (renamed from src/mscorlib/src/System/Globalization/JapaneseCalendar.Unix.cs)0
-rw-r--r--src/mscorlib/shared/System/Globalization/JapaneseCalendar.Win32.cs (renamed from src/mscorlib/src/System/Globalization/JapaneseCalendar.Win32.cs)0
-rw-r--r--src/mscorlib/shared/System/Globalization/JapaneseCalendar.WinRT.cs (renamed from src/mscorlib/src/System/Globalization/JapaneseCalendar.WinRT.cs)0
-rw-r--r--src/mscorlib/shared/System/Globalization/JapaneseCalendar.cs1
-rw-r--r--src/mscorlib/shared/System/Globalization/JapaneseLunisolarCalendar.cs1
-rw-r--r--src/mscorlib/shared/System/Globalization/JulianCalendar.cs1
-rw-r--r--src/mscorlib/shared/System/Globalization/KoreanCalendar.cs1
-rw-r--r--src/mscorlib/shared/System/Globalization/KoreanLunisolarCalendar.cs1
-rw-r--r--src/mscorlib/shared/System/Globalization/NumberFormatInfo.cs (renamed from src/mscorlib/src/System/Globalization/NumberFormatInfo.cs)25
-rw-r--r--src/mscorlib/shared/System/Globalization/PersianCalendar.cs1
-rw-r--r--src/mscorlib/shared/System/Globalization/SortKey.cs (renamed from src/mscorlib/src/System/Globalization/SortKey.cs)35
-rw-r--r--src/mscorlib/shared/System/Globalization/SortVersion.cs20
-rw-r--r--src/mscorlib/shared/System/Globalization/StringInfo.cs (renamed from src/mscorlib/src/System/Globalization/StringInfo.cs)11
-rw-r--r--src/mscorlib/shared/System/Globalization/TaiwanCalendar.cs1
-rw-r--r--src/mscorlib/shared/System/Globalization/TaiwanLunisolarCalendar.cs1
-rw-r--r--src/mscorlib/shared/System/Globalization/ThaiBuddhistCalendar.cs1
-rw-r--r--src/mscorlib/shared/System/Globalization/UmAlQuraCalendar.cs1
-rw-r--r--src/mscorlib/shared/System/IO/DirectoryNotFoundException.cs2
-rw-r--r--src/mscorlib/shared/System/IO/EncodingCache.cs (renamed from src/mscorlib/src/System/IO/EncodingCache.cs)0
-rw-r--r--src/mscorlib/shared/System/IO/EndOfStreamException.cs2
-rw-r--r--src/mscorlib/shared/System/IO/FileAccess.cs1
-rw-r--r--src/mscorlib/shared/System/IO/FileLoadException.cs11
-rw-r--r--src/mscorlib/shared/System/IO/FileNotFoundException.cs11
-rw-r--r--src/mscorlib/shared/System/IO/FileStream.Win32.cs13
-rw-r--r--src/mscorlib/shared/System/IO/FileStream.WinRT.cs20
-rw-r--r--src/mscorlib/shared/System/IO/FileStream.Windows.cs8
-rw-r--r--src/mscorlib/shared/System/IO/Path.Unix.cs9
-rw-r--r--src/mscorlib/shared/System/IO/Path.Windows.cs6
-rw-r--r--src/mscorlib/shared/System/IO/Path.cs24
-rw-r--r--src/mscorlib/shared/System/IO/PathInternal.Unix.cs5
-rw-r--r--src/mscorlib/shared/System/IO/PathInternal.Windows.cs5
-rw-r--r--src/mscorlib/shared/System/IO/PathTooLongException.cs2
-rw-r--r--src/mscorlib/shared/System/IO/PinnedBufferMemoryStream.cs (renamed from src/mscorlib/src/System/IO/PinnedBufferMemoryStream.cs)18
-rw-r--r--src/mscorlib/shared/System/IO/UnmanagedMemoryStream.cs (renamed from src/mscorlib/src/System/IO/UnmanagedMemoryStream.cs)254
-rw-r--r--src/mscorlib/shared/System/IO/UnmanagedMemoryStreamWrapper.cs (renamed from src/mscorlib/src/System/IO/UnmanagedMemoryStreamWrapper.cs)16
-rw-r--r--src/mscorlib/shared/System/IndexOutOfRangeException.cs3
-rw-r--r--src/mscorlib/shared/System/InsufficientExecutionStackException.cs3
-rw-r--r--src/mscorlib/shared/System/InvalidCastException.cs6
-rw-r--r--src/mscorlib/shared/System/InvalidOperationException.cs6
-rw-r--r--src/mscorlib/shared/System/InvalidProgramException.cs3
-rw-r--r--src/mscorlib/shared/System/InvalidTimeZoneException.cs6
-rw-r--r--src/mscorlib/shared/System/Lazy.cs15
-rw-r--r--src/mscorlib/shared/System/MarshalByRefObject.cs1
-rw-r--r--src/mscorlib/shared/System/MemberAccessException.cs6
-rw-r--r--src/mscorlib/shared/System/MethodAccessException.cs6
-rw-r--r--src/mscorlib/shared/System/MissingMethodException.cs2
-rw-r--r--src/mscorlib/shared/System/MulticastNotSupportedException.cs3
-rw-r--r--src/mscorlib/shared/System/NotFiniteNumberException.cs4
-rw-r--r--src/mscorlib/shared/System/NotImplementedException.cs6
-rw-r--r--src/mscorlib/shared/System/NotSupportedException.cs6
-rw-r--r--src/mscorlib/shared/System/NullReferenceException.cs6
-rw-r--r--src/mscorlib/shared/System/ObjectDisposedException.cs4
-rw-r--r--src/mscorlib/shared/System/ObsoleteAttribute.cs1
-rw-r--r--src/mscorlib/shared/System/OperationCanceledException.cs (renamed from src/mscorlib/src/System/OperationCanceledException.cs)2
-rw-r--r--src/mscorlib/shared/System/OverflowException.cs6
-rw-r--r--src/mscorlib/shared/System/PlatformNotSupportedException.cs6
-rw-r--r--src/mscorlib/shared/System/Random.cs1
-rw-r--r--src/mscorlib/shared/System/RankException.cs6
-rw-r--r--src/mscorlib/shared/System/Reflection/AmbiguousMatchException.cs6
-rw-r--r--src/mscorlib/shared/System/Reflection/Assembly.cs5
-rw-r--r--src/mscorlib/shared/System/Reflection/AssemblyNameFormatter.cs156
-rw-r--r--src/mscorlib/shared/System/Reflection/CustomAttributeFormatException.cs2
-rw-r--r--src/mscorlib/shared/System/Reflection/DefaultMemberAttribute.cs1
-rw-r--r--src/mscorlib/shared/System/Reflection/InvalidFilterCriteriaException.cs2
-rw-r--r--src/mscorlib/shared/System/Reflection/MemberInfoSerializationHolder.cs315
-rw-r--r--src/mscorlib/shared/System/Reflection/Missing.cs6
-rw-r--r--src/mscorlib/shared/System/Reflection/Module.cs5
-rw-r--r--src/mscorlib/shared/System/Reflection/ParameterInfo.cs41
-rw-r--r--src/mscorlib/shared/System/Reflection/ParameterModifier.cs1
-rw-r--r--src/mscorlib/shared/System/Reflection/Pointer.cs12
-rw-r--r--src/mscorlib/shared/System/Reflection/ReflectionTypeLoadException.cs10
-rw-r--r--src/mscorlib/shared/System/Reflection/StrongNameKeyPair.cs16
-rw-r--r--src/mscorlib/shared/System/Reflection/TargetException.cs2
-rw-r--r--src/mscorlib/shared/System/Reflection/TargetInvocationException.cs6
-rw-r--r--src/mscorlib/shared/System/Reflection/TargetParameterCountException.cs6
-rw-r--r--src/mscorlib/shared/System/Reflection/TypeDelegator.cs2
-rw-r--r--src/mscorlib/shared/System/Resources/MissingManifestResourceException.cs2
-rw-r--r--src/mscorlib/shared/System/Resources/MissingSatelliteAssemblyException.cs2
-rw-r--r--src/mscorlib/shared/System/Resources/ResourceFallbackManager.cs (renamed from src/mscorlib/src/System/Resources/ResourceFallbackManager.cs)9
-rw-r--r--src/mscorlib/shared/System/Resources/RuntimeResourceSet.cs (renamed from src/mscorlib/src/System/Resources/RuntimeResourceSet.cs)60
-rw-r--r--src/mscorlib/shared/System/Runtime/CompilerServices/AsyncStateMachineAttribute.cs1
-rw-r--r--src/mscorlib/shared/System/Runtime/CompilerServices/CompilationRelaxations.cs1
-rw-r--r--src/mscorlib/shared/System/Runtime/CompilerServices/CompilationRelaxationsAttribute.cs1
-rw-r--r--src/mscorlib/shared/System/Runtime/CompilerServices/CompilerGeneratedAttribute.cs1
-rw-r--r--src/mscorlib/shared/System/Runtime/CompilerServices/CompilerGlobalScopeAttribute.cs1
-rw-r--r--src/mscorlib/shared/System/Runtime/CompilerServices/DefaultDependencyAttribute.cs1
-rw-r--r--src/mscorlib/shared/System/Runtime/CompilerServices/DependencyAttribute.cs1
-rw-r--r--src/mscorlib/shared/System/Runtime/CompilerServices/FixedAddressValueTypeAttribute.cs1
-rw-r--r--src/mscorlib/shared/System/Runtime/CompilerServices/IndexerNameAttribute.cs1
-rw-r--r--src/mscorlib/shared/System/Runtime/CompilerServices/IsByRefLikeAttribute.cs21
-rw-r--r--src/mscorlib/shared/System/Runtime/CompilerServices/IteratorStateMachineAttribute.cs1
-rw-r--r--src/mscorlib/shared/System/Runtime/CompilerServices/LoadHint.cs1
-rw-r--r--src/mscorlib/shared/System/Runtime/CompilerServices/MethodCodeType.cs1
-rw-r--r--src/mscorlib/shared/System/Runtime/CompilerServices/ReferenceAssemblyAttribute.cs1
-rw-r--r--src/mscorlib/shared/System/Runtime/CompilerServices/RuntimeCompatibilityAttribute.cs1
-rw-r--r--src/mscorlib/shared/System/Runtime/CompilerServices/StateMachineAttribute.cs1
-rw-r--r--src/mscorlib/shared/System/Runtime/CompilerServices/StringFreezingAttribute.cs1
-rw-r--r--src/mscorlib/shared/System/Runtime/CompilerServices/UnsafeValueTypeAttribute.cs1
-rw-r--r--src/mscorlib/shared/System/Runtime/ConstrainedExecution/Cer.cs1
-rw-r--r--src/mscorlib/shared/System/Runtime/ConstrainedExecution/Consistency.cs1
-rw-r--r--src/mscorlib/shared/System/Runtime/InteropServices/ExternalException.cs2
-rw-r--r--src/mscorlib/shared/System/Runtime/Serialization/SerializationException.cs2
-rw-r--r--src/mscorlib/shared/System/Runtime/Serialization/StreamingContext.cs1
-rw-r--r--src/mscorlib/shared/System/Security/CryptographicException.cs2
-rw-r--r--src/mscorlib/shared/System/Security/SafeBSTRHandle.cs5
-rw-r--r--src/mscorlib/shared/System/Security/SecureString.Unix.cs46
-rw-r--r--src/mscorlib/shared/System/Security/SecureString.Windows.cs13
-rw-r--r--src/mscorlib/shared/System/Security/SecurityException.cs2
-rw-r--r--src/mscorlib/shared/System/Security/VerificationException.cs2
-rw-r--r--src/mscorlib/shared/System/StackOverflowException.cs3
-rw-r--r--src/mscorlib/shared/System/StringComparison.cs1
-rw-r--r--src/mscorlib/shared/System/SystemException.cs6
-rw-r--r--src/mscorlib/shared/System/Text/ASCIIEncoding.cs2
-rw-r--r--src/mscorlib/shared/System/Text/Decoder.cs1
-rw-r--r--src/mscorlib/shared/System/Text/Encoder.cs1
-rw-r--r--src/mscorlib/shared/System/Text/EncodingInfo.cs1
-rw-r--r--src/mscorlib/shared/System/Text/EncodingNLS.cs1
-rw-r--r--src/mscorlib/shared/System/Text/UTF32Encoding.cs2
-rw-r--r--src/mscorlib/shared/System/Text/UTF8Encoding.cs79
-rw-r--r--src/mscorlib/shared/System/Text/UnicodeEncoding.cs41
-rw-r--r--src/mscorlib/shared/System/ThreadStaticAttribute.cs1
-rw-r--r--src/mscorlib/shared/System/Threading/AbandonedMutexException.cs2
-rw-r--r--src/mscorlib/shared/System/Threading/ExecutionContext.cs11
-rw-r--r--src/mscorlib/shared/System/Threading/LockRecursionException.cs6
-rw-r--r--src/mscorlib/shared/System/Threading/SemaphoreFullException.cs2
-rw-r--r--src/mscorlib/shared/System/Threading/SynchronizationLockException.cs2
-rw-r--r--src/mscorlib/shared/System/Threading/Tasks/TaskCanceledException.cs2
-rw-r--r--src/mscorlib/shared/System/Threading/Tasks/TaskSchedulerException.cs2
-rw-r--r--src/mscorlib/shared/System/Threading/ThreadAbortException.cs6
-rw-r--r--src/mscorlib/shared/System/Threading/ThreadStartException.cs6
-rw-r--r--src/mscorlib/shared/System/Threading/ThreadStateException.cs2
-rw-r--r--src/mscorlib/shared/System/Threading/WaitHandleCannotBeOpenedException.cs2
-rw-r--r--src/mscorlib/shared/System/TimeZone.cs1
-rw-r--r--src/mscorlib/shared/System/TimeZoneNotFoundException.cs6
-rw-r--r--src/mscorlib/shared/System/TimeoutException.cs6
-rw-r--r--src/mscorlib/shared/System/Type.cs1
-rw-r--r--src/mscorlib/shared/System/TypeAccessException.cs6
-rw-r--r--src/mscorlib/shared/System/TypeCode.cs1
-rw-r--r--src/mscorlib/shared/System/TypeInitializationException.cs8
-rw-r--r--src/mscorlib/shared/System/TypeUnloadedException.cs7
-rw-r--r--src/mscorlib/shared/System/UnauthorizedAccessException.cs6
-rw-r--r--src/mscorlib/shared/System/UnhandledExceptionEventArgs.cs1
-rw-r--r--src/mscorlib/shared/System/UnhandledExceptionEventHandler.cs1
-rw-r--r--src/mscorlib/shared/System/UnitySerializationHolder.cs329
-rw-r--r--src/mscorlib/shared/System/Void.cs1
-rw-r--r--src/mscorlib/src/Microsoft/Win32/SafeHandles/Win32SafeHandles.cs60
-rw-r--r--src/mscorlib/src/Microsoft/Win32/Win32Native.cs24
-rw-r--r--src/mscorlib/src/System/AccessViolationException.cs6
-rw-r--r--src/mscorlib/src/System/Activator.cs258
-rw-r--r--src/mscorlib/src/System/AppDomain.cs178
-rw-r--r--src/mscorlib/src/System/AppDomainAttributes.cs1
-rw-r--r--src/mscorlib/src/System/AppDomainSetup.cs14
-rw-r--r--src/mscorlib/src/System/AppDomainUnloadedException.cs2
-rw-r--r--src/mscorlib/src/System/Array.cs3
-rw-r--r--src/mscorlib/src/System/ArraySegment.cs1
-rw-r--r--src/mscorlib/src/System/BCLDebug.cs2
-rw-r--r--src/mscorlib/src/System/BadImageFormatException.CoreCLR.cs19
-rw-r--r--src/mscorlib/src/System/Boolean.cs6
-rw-r--r--src/mscorlib/src/System/Byte.cs2
-rw-r--r--src/mscorlib/src/System/Collections/ArrayList.cs626
-rw-r--r--src/mscorlib/src/System/Collections/Comparer.cs27
-rw-r--r--src/mscorlib/src/System/Collections/CompatibleComparer.cs1
-rw-r--r--src/mscorlib/src/System/Collections/Concurrent/ConcurrentQueue.cs1
-rw-r--r--src/mscorlib/src/System/Collections/EmptyReadOnlyDictionaryInternal.cs1
-rw-r--r--src/mscorlib/src/System/Collections/Generic/ArraySortHelper.cs1
-rw-r--r--src/mscorlib/src/System/Collections/Generic/Comparer.cs3
-rw-r--r--src/mscorlib/src/System/Collections/Generic/Dictionary.cs44
-rw-r--r--src/mscorlib/src/System/Collections/Generic/EqualityComparer.cs34
-rw-r--r--src/mscorlib/src/System/Collections/Generic/List.cs1
-rw-r--r--src/mscorlib/src/System/Collections/Hashtable.cs72
-rw-r--r--src/mscorlib/src/System/Collections/ObjectModel/ReadOnlyDictionary.cs4
-rw-r--r--src/mscorlib/src/System/Currency.cs1
-rw-r--r--src/mscorlib/src/System/Delegate.cs4
-rw-r--r--src/mscorlib/src/System/DelegateSerializationHolder.cs287
-rw-r--r--src/mscorlib/src/System/Diagnostics/AssertFilter.cs1
-rw-r--r--src/mscorlib/src/System/Diagnostics/AssertFilters.cs1
-rw-r--r--src/mscorlib/src/System/Diagnostics/Contracts/ContractsBCL.cs13
-rw-r--r--src/mscorlib/src/System/Diagnostics/Debugger.cs114
-rw-r--r--src/mscorlib/src/System/Diagnostics/DebuggerAttributes.cs3
-rw-r--r--src/mscorlib/src/System/Diagnostics/EditAndContinueHelper.cs1
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/EventPipe.cs175
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/EventPipeEventProvider.cs116
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/EventSource_CoreCLR.cs20
-rw-r--r--src/mscorlib/src/System/Diagnostics/LogSwitch.cs1
-rw-r--r--src/mscorlib/src/System/Diagnostics/LoggingLevels.cs1
-rw-r--r--src/mscorlib/src/System/Diagnostics/Stackframe.cs1
-rw-r--r--src/mscorlib/src/System/Diagnostics/Stacktrace.cs2
-rw-r--r--src/mscorlib/src/System/Diagnostics/SymbolStore/SymAddressKind.cs1
-rw-r--r--src/mscorlib/src/System/Diagnostics/log.cs2
-rw-r--r--src/mscorlib/src/System/Double.cs2
-rw-r--r--src/mscorlib/src/System/Empty.cs9
-rw-r--r--src/mscorlib/src/System/Environment.cs3
-rw-r--r--src/mscorlib/src/System/Exception.cs102
-rw-r--r--src/mscorlib/src/System/GC.cs3
-rw-r--r--src/mscorlib/src/System/Globalization/BidiCategory.cs1
-rw-r--r--src/mscorlib/src/System/Globalization/Calendar.cs1
-rw-r--r--src/mscorlib/src/System/Globalization/CalendarData.Windows.cs49
-rw-r--r--src/mscorlib/src/System/Globalization/CompareInfo.Windows.cs4
-rw-r--r--src/mscorlib/src/System/Globalization/CompareInfo.cs34
-rw-r--r--src/mscorlib/src/System/Globalization/CultureData.Windows.cs98
-rw-r--r--src/mscorlib/src/System/Globalization/CultureInfo.cs1
-rw-r--r--src/mscorlib/src/System/Globalization/EncodingDataItem.Unix.cs1
-rw-r--r--src/mscorlib/src/System/Globalization/EncodingDataItem.cs2
-rw-r--r--src/mscorlib/src/System/Globalization/GregorianCalendar.cs3
-rw-r--r--src/mscorlib/src/System/Globalization/GregorianCalendarHelper.cs2
-rw-r--r--src/mscorlib/src/System/Globalization/RegionInfo.cs1
-rw-r--r--src/mscorlib/src/System/Globalization/TextElementEnumerator.cs1
-rw-r--r--src/mscorlib/src/System/Globalization/TextInfo.cs32
-rw-r--r--src/mscorlib/src/System/IO/BinaryWriter.cs1
-rw-r--r--src/mscorlib/src/System/IO/DriveNotFoundException.cs2
-rw-r--r--src/mscorlib/src/System/IO/File.cs27
-rw-r--r--src/mscorlib/src/System/IO/FileLoadException.CoreCLR.cs5
-rw-r--r--src/mscorlib/src/System/IO/FileSystemEnumerable.cs19
-rw-r--r--src/mscorlib/src/System/IO/IOException.cs2
-rw-r--r--src/mscorlib/src/System/IO/MemoryStream.cs1
-rw-r--r--src/mscorlib/src/System/IO/SearchOption.cs1
-rw-r--r--src/mscorlib/src/System/IO/Stream.cs3
-rw-r--r--src/mscorlib/src/System/IO/StreamReader.cs1
-rw-r--r--src/mscorlib/src/System/IO/TextReader.cs3
-rw-r--r--src/mscorlib/src/System/IO/__Error.cs6
-rw-r--r--src/mscorlib/src/System/InsufficientMemoryException.cs5
-rw-r--r--src/mscorlib/src/System/Int16.cs2
-rw-r--r--src/mscorlib/src/System/Int32.cs2
-rw-r--r--src/mscorlib/src/System/Int64.cs2
-rw-r--r--src/mscorlib/src/System/IntPtr.cs60
-rw-r--r--src/mscorlib/src/System/MissingFieldException.cs3
-rw-r--r--src/mscorlib/src/System/MissingMemberException.cs14
-rw-r--r--src/mscorlib/src/System/MulticastDelegate.cs45
-rw-r--r--src/mscorlib/src/System/Object.cs1
-rw-r--r--src/mscorlib/src/System/OleAutBinder.cs1
-rw-r--r--src/mscorlib/src/System/OperatingSystem.cs154
-rw-r--r--src/mscorlib/src/System/OutOfMemoryException.cs2
-rw-r--r--src/mscorlib/src/System/PlatformID.cs27
-rw-r--r--src/mscorlib/src/System/Reflection/Assembly.CoreCLR.cs80
-rw-r--r--src/mscorlib/src/System/Reflection/AssemblyName.cs67
-rw-r--r--src/mscorlib/src/System/Reflection/CustomAttribute.cs31
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/AssemblyBuilderAccess.cs1
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/EnumBuilder.cs2
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/EventToken.cs1
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/FieldToken.cs1
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/FlowControl.cs1
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/GenericTypeParameterBuilder.cs2
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/ILGenerator.cs1
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/Label.cs1
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/MethodToken.cs1
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/ModuleBuilderData.cs1
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/OpcodeType.cs1
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/OperandType.cs1
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/PEFileKinds.cs1
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/ParameterToken.cs1
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/PropertyToken.cs1
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/StackBehaviour.cs1
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/StringToken.cs1
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/SymbolType.cs4
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs3
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/TypeBuilderInstantiation.cs1
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/TypeToken.cs1
-rw-r--r--src/mscorlib/src/System/Reflection/MdFieldInfo.cs1
-rw-r--r--src/mscorlib/src/System/Reflection/MdImport.cs7
-rw-r--r--src/mscorlib/src/System/Reflection/MemberSerializationStringGenerator.cs39
-rw-r--r--src/mscorlib/src/System/Reflection/RtFieldInfo.cs1
-rw-r--r--src/mscorlib/src/System/Reflection/RuntimeAssembly.cs31
-rw-r--r--src/mscorlib/src/System/Reflection/RuntimeConstructorInfo.cs6
-rw-r--r--src/mscorlib/src/System/Reflection/RuntimeEventInfo.cs7
-rw-r--r--src/mscorlib/src/System/Reflection/RuntimeFieldInfo.cs7
-rw-r--r--src/mscorlib/src/System/Reflection/RuntimeMethodInfo.cs10
-rw-r--r--src/mscorlib/src/System/Reflection/RuntimeModule.cs8
-rw-r--r--src/mscorlib/src/System/Reflection/RuntimeParameterInfo.cs31
-rw-r--r--src/mscorlib/src/System/Reflection/RuntimePropertyInfo.cs7
-rw-r--r--src/mscorlib/src/System/Resources/ResourceManager.cs1
-rw-r--r--src/mscorlib/src/System/Resources/ResourceSet.cs84
-rw-r--r--src/mscorlib/src/System/RtType.cs22
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/ConditionalWeakTable.cs38
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/CustomConstantAttribute.cs1
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/DateTimeConstantAttribute.cs1
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/DecimalConstantAttribute.cs1
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/MethodImplAttribute.cs1
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/RuntimeWrappedException.cs14
-rw-r--r--src/mscorlib/src/System/Runtime/GcSettings.cs2
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ArrayWithOffset.cs1
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/Attributes.cs2
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/BStrWrapper.cs1
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/COMException.cs2
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ComEventsHelper.cs1
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ComMemberType.cs1
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ComTypes/ITypeComp.cs1
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ComTypes/ITypeInfo.cs11
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ComTypes/ITypeLib.cs3
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/CurrencyWrapper.cs1
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/DispatchWrapper.cs1
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ErrorWrapper.cs1
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/GcHandle.cs1
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ICustomQueryInterface.cs1
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/InvalidComObjectException.cs2
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/InvalidOleVariantTypeException.cs2
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/Marshal.cs128
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/MarshalDirectiveException.cs2
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/NonPortable.cs5
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/PInvokeMap.cs1
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/PInvokeMarshal.cs24
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/SEHException.cs2
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/SafeArrayRankMismatchException.cs2
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/SafeArrayTypeMismatchException.cs2
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/UnknownWrapper.cs1
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/VariantWrapper.cs2
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ConstantSplittableMap.cs2
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryKeyCollection.cs2
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryValueCollection.cs2
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IMapViewToIReadOnlyDictionaryAdapter.cs4
-rw-r--r--src/mscorlib/src/System/Runtime/Loader/AssemblyLoadContext.cs8
-rw-r--r--src/mscorlib/src/System/Runtime/Remoting/ObjectHandle.cs40
-rw-r--r--src/mscorlib/src/System/Runtime/RuntimeImports.cs9
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/FormatterServices.cs1
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/SerializationInfo.cs1
-rw-r--r--src/mscorlib/src/System/RuntimeHandles.cs98
-rw-r--r--src/mscorlib/src/System/SByte.cs2
-rw-r--r--src/mscorlib/src/System/SharedStatics.cs1
-rw-r--r--src/mscorlib/src/System/Single.cs2
-rw-r--r--src/mscorlib/src/System/StubHelpers.cs31
-rw-r--r--src/mscorlib/src/System/Text/DecoderBestFitFallback.cs1
-rw-r--r--src/mscorlib/src/System/Text/DecoderExceptionFallback.cs3
-rw-r--r--src/mscorlib/src/System/Text/DecoderFallback.cs1
-rw-r--r--src/mscorlib/src/System/Text/DecoderNLS.cs16
-rw-r--r--src/mscorlib/src/System/Text/DecoderReplacementFallback.cs1
-rw-r--r--src/mscorlib/src/System/Text/EncoderBestFitFallback.cs1
-rw-r--r--src/mscorlib/src/System/Text/EncoderExceptionFallback.cs6
-rw-r--r--src/mscorlib/src/System/Text/EncoderFallback.cs1
-rw-r--r--src/mscorlib/src/System/Text/EncoderNLS.cs17
-rw-r--r--src/mscorlib/src/System/Text/EncoderReplacementFallback.cs1
-rw-r--r--src/mscorlib/src/System/Text/Encoding.cs100
-rw-r--r--src/mscorlib/src/System/Text/Latin1Encoding.cs25
-rw-r--r--src/mscorlib/src/System/Text/UTF7Encoding.cs52
-rw-r--r--src/mscorlib/src/System/Threading/ClrThreadPoolBoundHandle.Unix.cs21
-rw-r--r--src/mscorlib/src/System/Threading/ClrThreadPoolBoundHandle.Windows.cs42
-rw-r--r--src/mscorlib/src/System/Threading/ClrThreadPoolBoundHandle.cs23
-rw-r--r--src/mscorlib/src/System/Threading/Monitor.cs1
-rw-r--r--src/mscorlib/src/System/Threading/PinnableBufferCache.cs (renamed from src/mscorlib/Common/PinnableBufferCache.cs)0
-rw-r--r--src/mscorlib/src/System/Threading/Tasks/Task.cs3
-rw-r--r--src/mscorlib/src/System/Threading/Thread.cs1
-rw-r--r--src/mscorlib/src/System/Threading/ThreadInterruptedException.cs2
-rw-r--r--src/mscorlib/src/System/Threading/Timer.cs14
-rw-r--r--src/mscorlib/src/System/Threading/WaitHandle.cs1
-rw-r--r--src/mscorlib/src/System/TypeLoadException.cs21
-rw-r--r--src/mscorlib/src/System/UInt16.cs2
-rw-r--r--src/mscorlib/src/System/UInt32.cs2
-rw-r--r--src/mscorlib/src/System/UInt64.cs2
-rw-r--r--src/mscorlib/src/System/UIntPtr.cs46
-rw-r--r--src/mscorlib/src/System/Variant.cs1
-rw-r--r--src/mscorlib/src/System/__HResults.cs1
-rw-r--r--src/pal/inc/pal.h8
-rw-r--r--src/pal/prebuilt/idl/corprof_i.cpp9
-rw-r--r--src/pal/prebuilt/inc/corprof.h804
-rw-r--r--src/pal/src/CMakeLists.txt4
-rw-r--r--src/pal/src/config.h.in3
-rw-r--r--src/pal/src/configure.cmake20
-rw-r--r--src/pal/src/file/file.cpp6
-rw-r--r--src/pal/src/include/pal/context.h10
-rw-r--r--src/pal/src/include/pal/virtual.h20
-rw-r--r--src/pal/src/map/map.cpp21
-rw-r--r--src/pal/src/map/virtual.cpp229
-rw-r--r--src/pal/src/synchmgr/synchmanager.cpp12
-rw-r--r--src/pal/src/thread/process.cpp4
-rw-r--r--src/pal/src/thread/threadsusp.cpp12
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test1/MapViewOfFile.cpp26
-rw-r--r--src/pal/tests/palsuite/paltestlist.txt1
-rwxr-xr-xsrc/pal/tools/gen-buildsys-clang.sh2
-rw-r--r--src/scripts/genEventPipe.py495
-rw-r--r--src/scripts/genXplatEventing.py89
-rw-r--r--src/scripts/genXplatLttng.py11
-rw-r--r--src/sign.builds53
-rw-r--r--src/syncAzure.proj1
-rw-r--r--src/tools/crossgen/crossgen.cpp27
-rw-r--r--src/utilcode/util.cpp25
-rw-r--r--src/vm/CMakeLists.txt13
-rw-r--r--src/vm/arm/asmhelpers.S18
-rw-r--r--src/vm/arm/asmhelpers.asm21
-rw-r--r--src/vm/arm/cgencpu.h55
-rw-r--r--src/vm/arm/stubs.cpp7
-rw-r--r--src/vm/arm64/asmhelpers.S33
-rw-r--r--src/vm/arm64/crthelpers.S420
-rw-r--r--src/vm/arm64/stubs.cpp13
-rw-r--r--src/vm/assemblyname.cpp19
-rw-r--r--src/vm/assemblynative.cpp140
-rw-r--r--src/vm/assemblynative.hpp8
-rw-r--r--src/vm/assemblyspec.cpp14
-rw-r--r--src/vm/ceeload.cpp10
-rw-r--r--src/vm/ceemain.cpp18
-rw-r--r--src/vm/class.h11
-rw-r--r--src/vm/clrex.cpp13
-rw-r--r--src/vm/codeman.cpp79
-rw-r--r--src/vm/codeman.h6
-rw-r--r--src/vm/comdependenthandle.cpp30
-rw-r--r--src/vm/comdependenthandle.h12
-rw-r--r--src/vm/compile.cpp24
-rw-r--r--src/vm/coreassemblyspec.cpp28
-rw-r--r--src/vm/corhost.cpp2
-rw-r--r--src/vm/coverage.cpp55
-rw-r--r--src/vm/coverage.h19
-rw-r--r--src/vm/dllimport.cpp14
-rw-r--r--src/vm/dwreport.cpp42
-rw-r--r--src/vm/ecalllist.h26
-rw-r--r--src/vm/eeconfig.cpp31
-rw-r--r--src/vm/eeconfig.h15
-rw-r--r--src/vm/eepolicy.cpp98
-rw-r--r--src/vm/eetoprofinterfaceimpl.cpp93
-rw-r--r--src/vm/eetoprofinterfaceimpl.h9
-rw-r--r--src/vm/eventpipe.cpp448
-rw-r--r--src/vm/eventpipe.h200
-rw-r--r--src/vm/eventpipebuffer.cpp281
-rw-r--r--src/vm/eventpipebuffer.h109
-rw-r--r--src/vm/eventpipebuffermanager.cpp808
-rw-r--r--src/vm/eventpipebuffermanager.h161
-rw-r--r--src/vm/eventpipeconfiguration.cpp594
-rw-r--r--src/vm/eventpipeconfiguration.h164
-rw-r--r--src/vm/eventpipeevent.cpp120
-rw-r--r--src/vm/eventpipeevent.h87
-rw-r--r--src/vm/eventpipeeventinstance.cpp238
-rw-r--r--src/vm/eventpipeeventinstance.h90
-rw-r--r--src/vm/eventpipefile.cpp164
-rw-r--r--src/vm/eventpipefile.h85
-rw-r--r--src/vm/eventpipejsonfile.cpp22
-rw-r--r--src/vm/eventpipejsonfile.h12
-rw-r--r--src/vm/eventpipeprovider.cpp244
-rw-r--r--src/vm/eventpipeprovider.h117
-rw-r--r--src/vm/eventtrace.cpp22
-rw-r--r--src/vm/exceptionhandling.cpp6
-rw-r--r--src/vm/fastserializableobject.h32
-rw-r--r--src/vm/fastserializer.cpp337
-rw-r--r--src/vm/fastserializer.h74
-rw-r--r--src/vm/field.cpp9
-rw-r--r--src/vm/field.h6
-rw-r--r--src/vm/i386/cgenx86.cpp24
-rw-r--r--src/vm/i386/excepcpu.h4
-rw-r--r--src/vm/i386/excepx86.cpp54
-rw-r--r--src/vm/i386/gmsx86.cpp2
-rw-r--r--src/vm/i386/unixstubs.cpp6
-rw-r--r--src/vm/jitinterface.cpp14
-rw-r--r--src/vm/method.cpp221
-rw-r--r--src/vm/method.hpp17
-rw-r--r--src/vm/methodtable.h2
-rw-r--r--src/vm/mscorlib.cpp3
-rw-r--r--src/vm/mscorlib.h6
-rw-r--r--src/vm/pefile.cpp14
-rw-r--r--src/vm/pefile.h6
-rw-r--r--src/vm/peimage.cpp6
-rw-r--r--src/vm/peimagelayout.cpp13
-rw-r--r--src/vm/precode.cpp10
-rw-r--r--src/vm/precode.h5
-rw-r--r--src/vm/prestub.cpp22
-rw-r--r--src/vm/runtimehandles.cpp4
-rw-r--r--src/vm/sampleprofiler.cpp79
-rw-r--r--src/vm/sampleprofiler.h35
-rw-r--r--src/vm/threads.cpp29
-rw-r--r--src/vm/threads.h59
-rw-r--r--src/vm/threadsuspend.cpp5
-rw-r--r--src/vm/tieredcompilation.cpp4
-rw-r--r--src/vm/typedesc.cpp20
-rw-r--r--src/vm/win32threadpool.cpp25
-rw-r--r--src/zap/zapheaders.cpp2
-rw-r--r--src/zap/zapimage.cpp6
-rw-r--r--src/zap/zapinfo.cpp39
-rw-r--r--sync.cmd2
-rw-r--r--tests/arm64/Tests.lst230
-rw-r--r--tests/build.proj44
-rw-r--r--tests/dir.props53
-rw-r--r--tests/helixperftasks.targets6
-rw-r--r--tests/helixprep.proj9
-rw-r--r--tests/issues.targets41
-rw-r--r--tests/override.targets13
-rw-r--r--tests/protononjit_testenv.cmd (renamed from tests/x86/legacyjit_x86_testenv.cmd)4
-rw-r--r--tests/publishdependency.targets18
-rw-r--r--tests/runtest.cmd12
-rw-r--r--tests/runtest.proj18
-rwxr-xr-xtests/runtest.sh24
-rwxr-xr-xtests/scripts/arm32_ci_script.sh8
-rwxr-xr-xtests/scripts/arm32_ci_test.sh16
-rw-r--r--tests/scripts/arm64_post_build.py51
-rwxr-xr-xtests/scripts/optdata/bootstrap.py15
-rw-r--r--tests/scripts/optdata/optdata.csproj29
-rw-r--r--tests/scripts/optdata/project.json12
-rw-r--r--tests/scripts/project.json2
-rw-r--r--tests/scripts/run-gc-reliability-framework.cmd10
-rwxr-xr-xtests/scripts/run-gc-reliability-framework.sh6
-rw-r--r--tests/scripts/run-throughput-perf.py6
-rw-r--r--tests/scripts/run-xunit-perf.cmd207
-rwxr-xr-xtests/scripts/run-xunit-perf.sh316
-rw-r--r--tests/scripts/scripts.csproj36
-rwxr-xr-xtests/setup-runtime-dependencies.cmd145
-rwxr-xr-xtests/setup-runtime-dependencies.sh159
-rw-r--r--tests/skipCrossGenFiles.arm.txt1
-rw-r--r--tests/skipCrossGenFiles.arm64.txt1
-rw-r--r--tests/skipCrossGenFiles.x64.txt1
-rw-r--r--tests/skipCrossGenFiles.x86.txt1
-rw-r--r--tests/src/CLRTest.CrossGen.targets22
-rw-r--r--tests/src/CLRTest.Execute.Bash.targets53
-rw-r--r--tests/src/CLRTest.Execute.Batch.targets62
-rw-r--r--tests/src/CLRTest.Jit.targets94
-rw-r--r--tests/src/Common/PerfHarness/PerfHarness.cs2
-rw-r--r--tests/src/Common/PerfHarness/PerfHarness.csproj12
-rw-r--r--tests/src/Common/PerfHarness/project.json19
-rw-r--r--tests/src/Common/build_against_pkg_dependencies/build_against_pkg_dependencies.csproj25
-rw-r--r--tests/src/Common/build_against_pkg_dependencies/project.json35
-rw-r--r--tests/src/Common/empty/project.json19
-rw-r--r--tests/src/Common/external/external.depproj46
-rw-r--r--tests/src/Common/external/project.json26
-rw-r--r--tests/src/Common/netcoreapp/project.json9
-rw-r--r--tests/src/Common/targeting_pack_ref/project.json25
-rw-r--r--tests/src/Common/targeting_pack_ref/targeting_pack_ref.csproj14
-rw-r--r--tests/src/Common/test_dependencies/project.json34
-rw-r--r--tests/src/Common/test_dependencies/test_dependencies.csproj31
-rw-r--r--tests/src/Common/test_runtime/project.json33
-rw-r--r--tests/src/Common/test_runtime/test_runtime.csproj29
-rw-r--r--tests/src/GC/API/GCHandleCollector/Usage.cs13
-rw-r--r--tests/src/GC/Features/HeapExpansion/pluggaps.csproj2
-rw-r--r--tests/src/GC/Scenarios/DoublinkList/dlcollect.cs37
-rw-r--r--tests/src/GC/Scenarios/DoublinkList/dlstack.cs49
-rw-r--r--tests/src/GC/Scenarios/DoublinkList/doublinkgen.cs39
-rw-r--r--tests/src/GC/Stress/Framework/ReliabilityFramework.csproj4
-rw-r--r--tests/src/Interop/MarshalAPI/ReadWrite/ReadWriteObject.cs116
-rw-r--r--tests/src/Interop/MarshalAPI/ReadWrite/ReadWriteObject.csproj40
-rw-r--r--tests/src/Interop/MarshalAPI/String/StringMarshalingTest.cs34
-rw-r--r--tests/src/Interop/StringMarshalling/LPSTR/LPSTRTest.cs21
-rw-r--r--tests/src/Interop/StringMarshalling/LPSTR/LPSTRTestNative.cpp12
-rw-r--r--tests/src/JIT/CheckProjects/CheckProjects.cs6
-rw-r--r--tests/src/JIT/CheckProjects/CheckProjects.csproj10
-rw-r--r--tests/src/JIT/Directed/TypedReference/TypedReference.csproj7
-rw-r--r--tests/src/JIT/Directed/UnrollLoop/loop6_cs_d.csproj7
-rw-r--r--tests/src/JIT/Directed/UnrollLoop/loop6_cs_do.csproj7
-rw-r--r--tests/src/JIT/Directed/UnrollLoop/loop6_cs_r.csproj7
-rw-r--r--tests/src/JIT/Directed/UnrollLoop/loop6_cs_ro.csproj7
-rw-r--r--tests/src/JIT/Generics/Coverage/chaos65204782cs.csproj2
-rw-r--r--tests/src/JIT/Generics/Coverage/chaos65204782cs_o.csproj3
-rw-r--r--tests/src/JIT/Methodical/Boxing/morph/sin3double.ilproj8
-rw-r--r--tests/src/JIT/Methodical/VT/etc/_dbggc_nested.csproj7
-rw-r--r--tests/src/JIT/Methodical/VT/etc/_dbgnested.csproj7
-rw-r--r--tests/src/JIT/Methodical/VT/etc/_relgc_nested.csproj7
-rw-r--r--tests/src/JIT/Methodical/VT/etc/_relnested.csproj7
-rw-r--r--tests/src/JIT/Methodical/VT/etc/_speed_dbggc_nested.csproj7
-rw-r--r--tests/src/JIT/Methodical/VT/etc/_speed_dbgnested.csproj7
-rw-r--r--tests/src/JIT/Methodical/VT/etc/_speed_relgc_nested.csproj7
-rw-r--r--tests/src/JIT/Methodical/VT/etc/_speed_relnested.csproj7
-rw-r--r--tests/src/JIT/Methodical/VT/etc/gc_nested.csproj7
-rw-r--r--tests/src/JIT/Methodical/VT/etc/nested.csproj7
-rw-r--r--tests/src/JIT/Methodical/acceptance/Boxing/boxing001.ilproj8
-rw-r--r--tests/src/JIT/Methodical/refany/_dbggcreport.csproj7
-rw-r--r--tests/src/JIT/Methodical/refany/_dbgnative.csproj7
-rw-r--r--tests/src/JIT/Methodical/refany/_dbgstress1.csproj7
-rw-r--r--tests/src/JIT/Methodical/refany/_dbgstress3.csproj7
-rw-r--r--tests/src/JIT/Methodical/refany/_dbgvirtcall.csproj7
-rw-r--r--tests/src/JIT/Methodical/refany/_relgcreport.csproj7
-rw-r--r--tests/src/JIT/Methodical/refany/_relnative.csproj7
-rw-r--r--tests/src/JIT/Methodical/refany/_relstress1.csproj7
-rw-r--r--tests/src/JIT/Methodical/refany/_relstress3.csproj7
-rw-r--r--tests/src/JIT/Methodical/refany/_relvirtcall.csproj7
-rw-r--r--tests/src/JIT/Methodical/refany/_speed_dbggcreport.csproj7
-rw-r--r--tests/src/JIT/Methodical/refany/_speed_dbgnative.csproj7
-rw-r--r--tests/src/JIT/Methodical/refany/_speed_dbgstress1.csproj7
-rw-r--r--tests/src/JIT/Methodical/refany/_speed_dbgstress3.csproj7
-rw-r--r--tests/src/JIT/Methodical/refany/_speed_dbgvirtcall.csproj7
-rw-r--r--tests/src/JIT/Methodical/refany/_speed_relgcreport.csproj7
-rw-r--r--tests/src/JIT/Methodical/refany/_speed_relnative.csproj7
-rw-r--r--tests/src/JIT/Methodical/refany/_speed_relstress1.csproj7
-rw-r--r--tests/src/JIT/Methodical/refany/_speed_relstress3.csproj7
-rw-r--r--tests/src/JIT/Methodical/refany/_speed_relvirtcall.csproj7
-rw-r--r--tests/src/JIT/Methodical/refany/array1.csproj7
-rw-r--r--tests/src/JIT/Methodical/refany/array2.csproj7
-rw-r--r--tests/src/JIT/Methodical/refany/format.csproj7
-rw-r--r--tests/src/JIT/Methodical/refany/gcreport.csproj7
-rw-r--r--tests/src/JIT/Methodical/refany/lcs.csproj7
-rw-r--r--tests/src/JIT/Methodical/refany/native.csproj7
-rw-r--r--tests/src/JIT/Methodical/refany/virtcall.csproj7
-rw-r--r--tests/src/JIT/Methodical/tailcall_v4/smallFrame.il3
-rw-r--r--tests/src/JIT/Methodical/xxobj/operand/_dbgrefanyval.csproj7
-rw-r--r--tests/src/JIT/Methodical/xxobj/operand/_relrefanyval.csproj7
-rw-r--r--tests/src/JIT/Methodical/xxobj/operand/_speed_dbgrefanyval.csproj7
-rw-r--r--tests/src/JIT/Methodical/xxobj/operand/_speed_relrefanyval.csproj7
-rw-r--r--tests/src/JIT/Methodical/xxobj/operand/refanyval.csproj7
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/Adams/Adams.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/Adams/Adams.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/BenchMk2/BenchMk2.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/BenchMk2/BenchMk2.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/BenchMrk/BenchMrk.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/BenchMrk/BenchMrk.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/Bisect/Bisect.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/Bisect/Bisect.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/DMath/DMath.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/DMath/DMath.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/FFT/FFT.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/FFT/FFT.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/InProd/InProd.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/InProd/InProd.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/InvMt/InvMt.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/InvMt/InvMt.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/LLoops/LLoops.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/LLoops/LLoops.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/Lorenz/Lorenz.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/Lorenz/Lorenz.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/MatInv4/MatInv4.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/MatInv4/MatInv4.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/NewtE/NewtE.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/NewtE/NewtE.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/NewtR/NewtR.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/NewtR/NewtR.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/Regula/Regula.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/Regula/Regula.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/Romber/Romber.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/Romber/Romber.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/Secant/Secant.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/Secant/Secant.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/Simpsn/Simpsn.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/Simpsn/Simpsn.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/SqMtx/SqMtx.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/SqMtx/SqMtx.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/Trap/Trap.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/Trap/Trap.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/Whetsto/Whetsto.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/Whetsto/Whetsto.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/8Queens/8Queens.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/8Queens/8Queens.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/Ackermann/Ackermann.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/Ackermann/Ackermann.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/AddArray/AddArray.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/AddArray/AddArray.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/AddArray2/AddArray2.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/AddArray2/AddArray2.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/Array1/Array1.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/Array1/Array1.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/Array2/Array2.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/Array2/Array2.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/BenchE/BenchE.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/BenchE/BenchE.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/BubbleSort/BubbleSort.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/BubbleSort/BubbleSort.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/BubbleSort2/BubbleSort2.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/BubbleSort2/BubbleSort2.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/CSieve/CSieve.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/CSieve/CSieve.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/Fib/Fib.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/Fib/Fib.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/HeapSort/HeapSort.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/HeapSort/HeapSort.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/IniArray/IniArray.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/IniArray/IniArray.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/LogicArray/LogicArray.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/LogicArray/LogicArray.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/Midpoint/Midpoint.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/Midpoint/Midpoint.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/MulMatrix/MulMatrix.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/MulMatrix/MulMatrix.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/NDhrystone/NDhrystone.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/NDhrystone/NDhrystone.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/Permutate/Permutate.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/Permutate/Permutate.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/Pi/Pi.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/Pi/Pi.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/Puzzle/Puzzle.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/Puzzle/Puzzle.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/QuickSort/QuickSort.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/QuickSort/QuickSort.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/TreeInsert/TreeInsert.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/TreeInsert/TreeInsert.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/TreeSort/TreeSort.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/TreeSort/TreeSort.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/XposMatrix/XposMatrix.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/XposMatrix/XposMatrix.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchmarksGame/binarytrees/binarytrees.csharp.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchmarksGame/binarytrees/binarytrees.csharp3.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchmarksGame/binarytrees/binarytrees.csproj9
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchmarksGame/binarytrees/binarytrees3.csproj9
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchmarksGame/fasta/fasta.csharp-2.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchmarksGame/fasta/fasta.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchmarksGame/fastaredux/fastaredux.csharp.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchmarksGame/fastaredux/fastaredux.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchmarksGame/k-nucleotide/k-nucleotide.cs13
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchmarksGame/k-nucleotide/k-nucleotide.csproj9
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchmarksGame/nbody/nbody.csharp-3.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchmarksGame/nbody/nbody.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchmarksGame/pidigits/pi-digits.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchmarksGame/pidigits/pi-digits.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchmarksGame/regexdna/regexdna.csharp-6.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchmarksGame/regexdna/regexdna.csproj9
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchmarksGame/revcomp/revcomp.csharp-1.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchmarksGame/revcomp/revcomp.csproj9
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchmarksGame/spectralnorm/spectralnorm.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchmarksGame/spectralnorm/spectralnorm.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Burgers/Burgers.cs5
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Burgers/Burgers.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Bytemark/ByteMark.cs31
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Bytemark/Bytemark.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/FractalPerf/FractalPerf.cs11
-rw-r--r--tests/src/JIT/Performance/CodeQuality/FractalPerf/FractalPerf.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Inlining/InlineGCStruct.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Inlining/InlineGCStruct.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Inlining/NoThrowInline.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Inlining/NoThrowInline.csproj9
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Linq/Linq.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Linq/Linq.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AbsDouble.cs2
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AcosDouble.cs2
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AsinDouble.cs2
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/Atan2Double.cs2
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AtanDouble.cs2
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/CeilingDouble.cs2
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/CosDouble.cs2
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/CoshDouble.cs2
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/ExpDouble.cs2
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/FloorDouble.cs2
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/Log10Double.cs2
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/LogDouble.cs2
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/PowDouble.cs2
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/RoundDouble.cs2
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/SinDouble.cs2
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/SinhDouble.cs2
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/SqrtDouble.cs2
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/TanDouble.cs2
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/TanhDouble.cs2
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Functions.cs21
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Functions.csproj33
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/AbsSingle.cs2
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/AcosSingle.cs47
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/AsinSingle.cs47
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/Atan2Single.cs48
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/AtanSingle.cs47
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/CeilingSingle.cs47
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/CosSingle.cs47
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/CoshSingle.cs47
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/ExpSingle.cs47
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/FloorSingle.cs47
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/Log10Single.cs47
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/LogSingle.cs48
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/PowSingle.cs48
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/RoundSingle.cs47
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/SinSingle.cs47
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/SinhSingle.cs47
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/SqrtSingle.cs47
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/TanSingle.cs47
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/TanhSingle.cs47
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Roslyn/CscBench.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Roslyn/CscBench.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/SIMD/ConsoleMandel/ConsoleMandel.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/SIMD/ConsoleMandel/ConsoleMandel.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/SIMD/RayTracer/RayTracer.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/SIMD/RayTracer/RayTracerBench.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/SIMD/SeekUnroll/SeekUnroll.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/SIMD/SeekUnroll/SeekUnroll.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/SciMark/SciMark.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/SciMark/kernel.cs7
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Serialization/Deserialize.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Serialization/Deserialize.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Serialization/Serialize.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Serialization/Serialize.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Span/Indexer.cs5
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Span/Indexer.csproj9
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Span/SpanBench.cs7
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Span/SpanBench.csproj9
-rw-r--r--tests/src/JIT/Performance/CodeQuality/V8/Crypto/Crypto.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/V8/Crypto/Crypto.csproj8
-rw-r--r--tests/src/JIT/Performance/CodeQuality/V8/Richards/Richards.cs1
-rw-r--r--tests/src/JIT/Performance/CodeQuality/V8/Richards/Richards.csproj8
-rw-r--r--tests/src/JIT/Performance/RunBenchmarks/RunBenchmarks.csproj7
-rw-r--r--tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b51817/b51817.csproj7
-rw-r--r--tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b52593/b52593.csproj7
-rw-r--r--tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b52733/b52733.csproj7
-rw-r--r--tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b52840/b52840.csproj7
-rw-r--r--tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53226/b53226a.csproj7
-rw-r--r--tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53226/b53226b.csproj7
-rw-r--r--tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b66533/b66533.csproj7
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_10780/GitHub_10780.cs52
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_10780/GitHub_10780.csproj56
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_11343/GitHub_11343.cs33
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_11343/GitHub_11343.csproj42
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_11408/GitHub_11408.cs45
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_11408/GitHub_11408.csproj53
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_11508/GitHub_11508.cs56
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_11508/GitHub_11508.csproj37
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_11574/GitHub_11574.cs44
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_11574/GitHub_11574.csproj37
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_11689/GitHub_11689.cs39
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_11689/GitHub_11689.csproj56
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_11733/GitHub_11733.cs26
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_11733/GitHub_11733.csproj42
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_11804/GitHub_11804.il85
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_11804/GitHub_11804.ilproj37
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_7906/GitHub_7906.csproj8
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_8220/GitHub_8220.csproj8
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_8231/GitHub_8231.csproj7
-rw-r--r--tests/src/JIT/Regression/VS-ia64-JIT/V1.2-Beta1/b302509/b302509.csproj7
-rw-r--r--tests/src/JIT/RyuJIT/DoWhileBndChk.csproj7
-rw-r--r--tests/src/JIT/config/benchmark+roslyn/benchmark+roslyn.csproj99
-rw-r--r--tests/src/JIT/config/benchmark+roslyn/project.json38
-rw-r--r--tests/src/JIT/config/benchmark+serialize/benchmark+serialize.csproj99
-rw-r--r--tests/src/JIT/config/benchmark+serialize/project.json38
-rw-r--r--tests/src/JIT/config/benchmark/benchmark.csproj114
-rw-r--r--tests/src/JIT/config/benchmark/project.json43
-rw-r--r--tests/src/JIT/opt/Devirtualization/GitHub_9945_2.ilproj8
-rw-r--r--tests/src/JIT/opt/Devirtualization/override.ilproj8
-rw-r--r--tests/src/JIT/opt/Tailcall/TailcallVerifyTransparentLibraryWithPrefix.il6
-rw-r--r--tests/src/JIT/opt/Tailcall/TailcallVerifyWithPrefix.il83
-rw-r--r--tests/src/JIT/opt/virtualstubdispatch/bigvtbl/bigvtbl_cs_d.csproj2
-rw-r--r--tests/src/JIT/opt/virtualstubdispatch/bigvtbl/bigvtbl_cs_r.csproj2
-rw-r--r--tests/src/JIT/superpmi/superpmicollect.csproj1
-rw-r--r--tests/src/Loader/classloader/PrivateInterfaceImpl/Test6_ImplementingClass.ilproj1
-rw-r--r--tests/src/Loader/classloader/regressions/440935/Test.ilproj1
-rw-r--r--tests/src/Regressions/coreclr/9414/readonlyPrefix.cs36
-rw-r--r--tests/src/Regressions/coreclr/9414/readonlyPrefix.csproj31
-rw-r--r--tests/src/TestWrappersConfig/TestWrappersConfig.csproj38
-rw-r--r--tests/src/TestWrappersConfig/project.json32
-rw-r--r--tests/src/baseservices/compilerservices/RuntimeWrappedException/RuntimeWrappedException.cs21
-rw-r--r--tests/src/dir.props12
-rw-r--r--tests/src/dir.targets14
-rw-r--r--tests/src/dirs.proj4
-rw-r--r--tests/src/performance/linkbench/assets/MusicStore/Get-Crossgen.ps177
-rw-r--r--tests/src/performance/linkbench/assets/Roslyn/illinkcsproj7
-rw-r--r--tests/src/performance/linkbench/linkbench.cs387
-rw-r--r--tests/src/performance/linkbench/linkbench.csproj4
-rw-r--r--tests/src/performance/linkbench/scripts/build.cmd138
-rw-r--r--tests/src/performance/linkbench/scripts/clone.cmd60
-rw-r--r--tests/src/performance/perflab/PerfLab.csproj4
-rw-r--r--tests/src/performance/performance.csproj111
-rw-r--r--tests/src/performance/project.json42
-rw-r--r--tests/testsFailingOutsideWindows.txt2
-rw-r--r--tests/x86/compatjit_x86_testenv.cmd8
-rw-r--r--tests/x86/ryujit_x86_testenv.cmd5
-rw-r--r--tests/x86_jit32_issues.targets516
-rw-r--r--tests/xunitwrapper.targets4
1045 files changed, 18763 insertions, 12699 deletions
diff --git a/BuildToolsVersion.txt b/BuildToolsVersion.txt
index 591e3c8e33..a72a2229ed 100644
--- a/BuildToolsVersion.txt
+++ b/BuildToolsVersion.txt
@@ -1 +1 @@
-1.0.27-prerelease-01413-01 \ No newline at end of file
+2.0.0-prerelease-01702-02
diff --git a/Documentation/botr/xplat-minidump-generation.md b/Documentation/botr/xplat-minidump-generation.md
index 78660b659c..03cd517a4a 100644
--- a/Documentation/botr/xplat-minidump-generation.md
+++ b/Documentation/botr/xplat-minidump-generation.md
@@ -62,6 +62,7 @@ Environment variables supported:
-n, --normal - create minidump (default).
-h, --withheap - create minidump with heap.
-t, --triage - create triage minidump.
+ -u, --full - create full core dump.
-d, --diag - enable diagnostic messages.
# Testing #
@@ -73,7 +74,6 @@ The test plan is to modify the SOS tests in the (still) private debuggertests re
- Do we need a full memory dump option? It would not use the _DAC_ to get the memory regions but all the readable memory from the shared module list. Do we include the shared modules' code?
- May need more than just the pid for decorating dump names for docker containers because I think the _pid_ is always 1.
- Do we need all the memory mappings from `/proc/$pid/maps` in the PT\_LOAD sections even though the memory is not actually in the dump? They have a file offset/size of 0. Full dumps generated by the system or _gdb_ do have these un-backed regions.
-- Don't know how to get the proper size/range of the non-main thread stacks. Currently uses 4 pages around the stack pointer. The main thread has a memory region in `/proc/$pid/maps`.
- There is no way to get the signal number, etc. that causes the abort from the _createdump_ utility using _ptrace_ or a /proc file. It would have to be passed from CoreCLR on the command line.
- Do we need the "dynamic" sections of each shared module in the core dump? It is part of the "link_map" entry enumerated when gathering the _DSO_ information.
- There may be more versioning and/or build id information needed to be added to the dump.
diff --git a/Documentation/building/debugging-instructions.md b/Documentation/building/debugging-instructions.md
index 72f198bde9..1a3b0234c9 100644
--- a/Documentation/building/debugging-instructions.md
+++ b/Documentation/building/debugging-instructions.md
@@ -136,10 +136,3 @@ Loading Linux core dumps with lldb 3.7 doesn't work. lldb 3.7 loads OS X and Fre
just fine. lldb 3.8 loads all the platform's core dumps without problem.
For more information on SOS commands see: https://msdn.microsoft.com/en-us/library/bb190764(v=vs.110).aspx
-
-Debugging Mscorlib and/or managed application
-=============================================
-
-To step into and debug managed code of Mscorlib.dll (or the managed application being executed by the runtime you built), using Visual Studio, is something that will be supported with Visual Studio 2015. We are actively working to enable this support.
-
-Until then, you can use [WinDbg](https://msdn.microsoft.com/en-us/library/windows/hardware/ff551063(v=vs.85).aspx) and [SOS](https://msdn.microsoft.com/en-us/library/bb190764(v=vs.110).aspx) (an extension to WinDbg to support managed debugging) to step in and debug the generated managed code. This is what we do on the .NET Runtime team as well :)
diff --git a/Documentation/building/linux-instructions.md b/Documentation/building/linux-instructions.md
index bacbe6d2f0..fecf2c9b60 100644
--- a/Documentation/building/linux-instructions.md
+++ b/Documentation/building/linux-instructions.md
@@ -30,6 +30,7 @@ Install the following packages for the toolchain:
- libcurl4-openssl-dev
- libssl-dev
- uuid-dev
+- libnuma-dev (optional, enables numa support)
In order to get lldb-3.6 on Ubuntu 14.04, we need to add an additional package source:
@@ -50,14 +51,14 @@ For other version of Debian/Ubuntu, please visit http://apt.llvm.org/.
Then install the packages you need:
```
-ellismg@linux:~$ sudo apt-get install cmake llvm-3.5 clang-3.5 lldb-3.6 lldb-3.6-dev libunwind8 libunwind8-dev gettext libicu-dev liblttng-ust-dev libcurl4-openssl-dev libssl-dev uuid-dev
+ellismg@linux:~$ sudo apt-get install cmake llvm-3.5 clang-3.5 lldb-3.6 lldb-3.6-dev libunwind8 libunwind8-dev gettext libicu-dev liblttng-ust-dev libcurl4-openssl-dev libssl-dev uuid-dev libnuma-dev
```
You now have all the required components.
If you are using Fedora, then you will need to install the following packages:
-`$ sudo dnf install llvm cmake clang lldb-devel libunwind-devel lttng-ust-devel libuuid-devel libicu-devel`
+`$ sudo dnf install llvm cmake clang lldb-devel libunwind-devel lttng-ust-devel libuuid-devel libicu-devel numactl-devel`
Git Setup
---------
diff --git a/Documentation/building/unix-test-instructions.md b/Documentation/building/unix-test-instructions.md
index 563c3e8c68..96546a0249 100644
--- a/Documentation/building/unix-test-instructions.md
+++ b/Documentation/building/unix-test-instructions.md
@@ -6,7 +6,7 @@ CoreCLR tests
**Building**
-Build CoreCLR and CoreFX. Refer to building instructions in the respective repository.
+Build CoreCLR on [Windows](https://github.com/dotnet/coreclr/blob/master/Documentation/building/windows-instructions.md) & [Unix](https://github.com/dotnet/coreclr/blob/master/Documentation/building/linux-instructions.md), and CoreFX on [Unix](https://github.com/dotnet/corefx/blob/master/Documentation/building/unix-instructions.md).
To build only the tests, on the Windows machine:
@@ -18,7 +18,6 @@ The following instructions assume that on the Unix machine:
- The CoreCLR repo is cloned at `~/coreclr`
- The CoreFX repo is cloned at `~/corefx`
- The Windows clone of the CoreCLR repo is mounted at `/media/coreclr`
-- The Windows clone of the CoreFX repo is mounted at `/media/corefx`
Tests currently need to be built on Windows and copied over to the Unix machine for testing. Copy the test build over to the Unix machine:
@@ -35,7 +34,7 @@ Run tests (`Debug` may be replaced with `Release` or `Checked`, depending on whi
> --testRootDir=~/test/Windows_NT.x64.Debug
> --testNativeBinDir=~/coreclr/bin/obj/Linux.x64.Debug/tests
> --coreClrBinDir=~/coreclr/bin/Product/Linux.x64.Debug
-> --mscorlibDir=/media/coreclr/bin/Product/Linux.x64.Debug
+> --mscorlibDir=~/coreclr/bin/Product/Linux.x64.Debug
> --coreFxBinDir=~/corefx/bin/runtime/netcoreapp-Linux-Debug-x64
> ```
diff --git a/Documentation/design-docs/eh-writethru.md b/Documentation/design-docs/eh-writethru.md
index 0afa5a7688..311ca2cd91 100644
--- a/Documentation/design-docs/eh-writethru.md
+++ b/Documentation/design-docs/eh-writethru.md
@@ -1,36 +1,113 @@
# Exception Handling Write Through Optimization.
-Write through is an optimization done on local variables that live across exception handling flow like a handler, filter, or finally so that they can be enregistered - treated as a register candidate - throughout a method. For each variable live across one of these constructs, the minimum requirement is that a store to the variables location on the stack is placed between a reaching definition and any point of control flow leading to the handler, as well as a load between any return from a filter or finally and an upward exposed use. Conceptually this maintains the value of the variable on the stack across the exceptional flow which would kill any live registers. This transformation splits a local variable into multiple enregisterable compiler temporaries backed by the local variable on the stack. For local vars that additionally have appearances within a eh construct, a load from the stack local is inserted to a temp that will be enregistered within the handler.
+Write through is an optimization done on local variables that live across
+exception handling flow like a handler, filter, or finally so that they can be
+enregistered - treated as a register candidate - throughout a method. For each
+variable live across one of these constructs, the minimum requirement is that a
+store to the variables location on the stack is placed between a reaching
+definition and any point of control flow leading to the handler, as well as a
+load between any return from a filter or finally and an upward exposed use.
+Conceptually this maintains the value of the variable on the stack across the
+exceptional flow which would kill any live registers. This transformation splits
+a local variable into an enregisterable compiler temporary backed by
+the local variable on the stack. For local vars that additionally have
+appearances within an eh construct, a load from the stack local is inserted to
+a temp that will be enregistered within the handler.
## Motivation
-Historically the JIT has not done this transformation because exception handling was rare and thus the transformation was not worth the compile time. Additionally it was easy to make the recomendation to users to remove EH from performance critical methods since they had control of where the EH appeared. Neither of these points remain true as we increase our focus on cloud workloads. The use of non-blocking async calls are common in performance critical paths for these workloads and async injects exception handling constructs to implement the feature. This in combination with the long standing use of EH in 'foreach' and 'using' statements means that we are seeing EH constructs that are difficult for the user to manage or remove high in the profile (Techempower on Kestrel is a good example). Given these cloud workloads doing the transformation would be a clear benefit.
+Historically the JIT has not done this transformation because exception
+handling was rare and thus the transformation was not worth the compile time.
+Additionally it was easy to make the recomendation to users to remove EH from
+performance critical methods since they had control of where the EH appeared.
+Neither of these points remain true as we increase our focus on cloud
+workloads. The use of non-blocking async calls are common in performance
+critical paths for these workloads and async injects exception handling
+constructs to implement the feature. This in combination with the long
+standing use of EH in 'foreach' and 'using' statements means that we are seeing
+EH constructs that are difficult for the user to manage or remove high in the
+profile (Techempower on Kestrel is a good example). It's also good to consider
+that in MSIL, basic operations can raise semantically meaningful exceptions
+(unlike say C++, where an explicit throw is required to raise an exception) so
+injected handlers can end up pessimizing a number of local variables in the
+method. Given this combination of issues in cloud workloads doing the
+transformation should be a clear benefit.
## Design
-The goal of the design is to preserve the constraints listed above - i.e. preserve a correct value on the stack for any local var that crosses an EH edge in the flow graph. To ensure that the broad set of global optimizations can act on the IR shape produced by this transformation and that phase ordering issues do not block enregistration opportunities the write through phase will be staged just prior to SSA build after morph and it will do a full walk of the IR rewriting appearances to proxies as well as inserting reloads at the appropriate blocks in the flow graph as indicated by EH control flow semantics. To preserve the needed values on the stack a store will also be inserted after every definition to copy the new value in the proxy back to the stack location. This will leave non optimal number of stores (too many) but with the strategy that the more expensive analysis to eliminate/better place stores will be staged as a global optimization in a higher compilation tier.
+The goal of the design is to preserve the constraints listed above - i.e.
+preserve a correct value on the stack for any local var that crosses an EH edge
+in the flow graph. To ensure that the broad set of global optimizations can act
+on the IR shape produced by this transformation and that phase ordering issues
+do not block enregistration opportunities the write through phase will be
+staged just prior to SSA build after morph and it will do a full walk of the
+IR rewriting appearances to proxies as well as inserting reloads at the
+appropriate blocks in the flow graph as indicated by EH control flow semantics.
+To preserve the needed values on the stack a store will also be inserted after
+every definition to copy the new value in the proxy back to the stack location.
+This will leave non optimal number of stores (too many) but with the strategy
+that the more expensive analysis to eliminate/better place stores will be
+staged as a global optimization in a higher compilation tier.
+
+There are a number of wrinkles informing this design based on how the JIT models EH:
+- The jit does not explicitly model the exception flow, so a given block and
+ even a given statement within a block may have multiple exception-raising sites.
+- For statements within protected regions, and for all variables live into any
+ reachable handler, the jit assumes all definitions within the region can
+ potentially reach uses in the handlers, since the exact interleaving of
+ definition points and exception points is not known. Hence every definition
+ is a reaching definition, even both values back from to back stores with no
+ read of the variable in between.
+- The jit does not model which handlers are reachable from a given protected region,
+ so considers a variable live into a handler if it is live into any handler in the method.
+
+It is posible to do better than the "store every definition" approch outlined
+in the design, but the expectation is that this would require posibly
+modifying the model in the JIT and staging more throughput intensive analyses.
+With these considerations this design was selected and further improvements
+left to future optimization.
### Throughput
-To identify EH crossing local vars global liveness is necessary. This comes at the significant cost of the liveness analysis. To mitigate this the write through phase is staged immediately before SSA build for the global optimizer. Since the typical case is that there is no EH, the liveness analysis in write through can be reused directly by SSA build. For the case where EH local vars are present liveness today must be rebuilt for SSA since new local vars have been added, but incremental update to the RyuJIT liveness analysis can be implemented (worklist based live analysis) to improve the throughput. Additionally the write through transformation does a full IR walk - also expensive - to replace EH local var appearances with proxies and insert transfers to and from the stack for EH flow, given this initial implementations may need to be staged as part of AOT (crossgen) compiles until tiering can move the more expensive analysis out of the startup path.
+To identify EH crossing local vars global liveness is necessary. This comes at
+the significant cost of the liveness analysis. To mitigate this the write
+through phase is staged immediately before SSA build for the global optimizer.
+Since the typical case is that there is no EH, the liveness analysis in write
+through can be reused directly by SSA build. For the case where EH local vars
+are present liveness today must be rebuilt for SSA since new local vars have
+been added, but incremental update to the RyuJIT liveness analysis can be
+implemented (worklist based live analysis) to improve the throughput.
+Additionally the write through transformation does a full IR walk - also
+expensive - to replace EH local var appearances with proxies and insert
+transfers to and from the stack for EH flow, given this initial implementations
+may need to be staged as part of AOT (crossgen) compiles until tiering can move
+the more expensive analysis out of the startup path.
### Algorithm
+
On the IR directly before SSA build:
-- Run global liveness to identify local vars that cross EH boundaries (as a byproduct of this these local vars are marked "do not enregister")
+- Run global liveness to identify local vars that cross EH boundaries (as a
+ byproduct of this these local vars are marked "do not enregister")
- Foreach EH local var create a new local var "proxy" that can be enregisterd.
- Iterate each block in the flow graph doing the following:
* Foreach tree in block do a post order traversal and
- Replace all appearances of EH local vars with the defined proxy
- Insert a copy of proxy definition back to the EH local var (on the stack)
- * If EH handler entry block insert reloads from EH local var to proxy at block head
- * If finally or filter exit, insert reloads from EH local var to proxy at successor block heads
-- For method entry block, insert reloads from parameter EH local vars to proxies
+ * If EH handler entry block insert reloads from EH local var to proxy at
+ block head
+ * If finally or filter exit, insert reloads from EH local var to proxy at
+ successor block heads
+- For method entry block, insert reloads from parameter EH local vars to
+ proxies
-At end no proxy should be live across EH flow and all value updates will be written back to the stack location.
+At end no proxy should be live across EH flow and all value updates will be
+written back to the stack location.
## Next steps
-The initial prototype that produced the example bellow is currently being improved to make it production ready. At the same time a more extensive suite of example tests are being developed.
+The initial prototype that produced the example bellow is currently being
+improved to make it production ready. At the same time a more extensive suite
+of example tests are being developed.
- [X] Proof of concept prototype.
- [ ] Production implementation of WriteThru phase.
@@ -42,7 +119,8 @@ The initial prototype that produced the example bellow is currently being improv
## Example
-The following is a simple example that shows enregistration for a local var live, and modified, through a catch.
+The following is a simple example that shows enregistration for a local var
+live, and modified, through a catch.
#### Source code snippet
diff --git a/Documentation/design-docs/first-class-structs.md b/Documentation/design-docs/first-class-structs.md
index fd6a3762c4..f7bd9b6fb4 100644
--- a/Documentation/design-docs/first-class-structs.md
+++ b/Documentation/design-docs/first-class-structs.md
@@ -21,7 +21,7 @@ Struct-Related Issues in RyuJIT
The following issues illustrate some of the motivation for improving the handling of value types
(structs) in RyuJIT:
-* VSO Bug 98404: .NET JIT x86 - poor code generated for value type initialization
+* [\#11407 [RyuJIT] Fully enregister structs that fit into a single register when profitable](https://github.com/dotnet/coreclr/issues/11407), also VSO Bug 98404: .NET JIT x86 - poor code generated for value type initialization
* This is a simple test case that should generate simply `xor eax; ret` on x86 and x64, but
instead generates many unnecessary copies. It is addressed by full enregistration of
structs that fit into a register:
diff --git a/Documentation/dummy.txt b/Documentation/dummy.txt
new file mode 100644
index 0000000000..ec583fd0ac
--- /dev/null
+++ b/Documentation/dummy.txt
@@ -0,0 +1 @@
+Thursday, April 20, 2017 10:00:00 AM \ No newline at end of file
diff --git a/Documentation/project-docs/ci-trigger-phrases.md b/Documentation/project-docs/ci-trigger-phrases.md
index dd0e981ead..f57be03262 100644
--- a/Documentation/project-docs/ci-trigger-phrases.md
+++ b/Documentation/project-docs/ci-trigger-phrases.md
@@ -11,7 +11,10 @@ To trigger a job, post a comment on your PR with "@dotnet-bot {trigger-phrase}".
- **Windows_NT x64 Release Priority 1 Build & Test:** "test Windows_NT pri1"
- **Windows_NT x64 Release IL RoundTrip Build & Test:** "test Windows_NT ilrt"
-- **Windows_NT x64 Release Long-Running GC Build & Test:**: "test Windows_NT x64 Release longgc"
+- **Windows_NT x64 Release Long-Running GC Build & Test:**: "test Windows_NT Release longgc"
+- **Windows_NT x64 Release GC Simulator:**: "test Windows_NT Release gcsimulator"
+- **Windows_NT x64 Release Standalone GC:**: "test Windows_NT Release standalone_gc"
+- **Windows_NT x64 Release GC Reliability Framework:**: "test Windows_NT Release gc_reliability_framework"
- **Windows_NT x64 Release Ready-To-Run Priority 0 Build & Test:** "test Windows_NT Release r2r"
- **Windows_NT x64 Checked Ready-To-Run Priority 0 Build & Test:** "test Windows_NT Checked r2r"
- **Windows_NT x64 Release Ready-To-Run Priority 1 Build & Test:** "test Windows_NT Release pri1r2r"
@@ -69,6 +72,8 @@ To trigger a job, post a comment on your PR with "@dotnet-bot {trigger-phrase}".
- **Windows_NT x64 Checked GCStress=0xc JitStress=2 Build & Test:** "test Windows_NT gcstress0xc_jitstress2"
- **Windows_NT x64 Checked GCStress=0xc MinOpts Heap Verify 1 Build & Test:** "test Windows_NT gcstress0xc_minopts_heapverify1"
- **Windows_NT x64 Checked Long-Running GC Build & Test:**: "test Windows_NT x64 Checked longgc"
+- **Windows_NT x64 Checked Standalone GC:**: "test Windows_NT Checked standalone_gc"
+- **Windows_NT x64 Checked GC Reliability Framework:**: "test Windows_NT Checked gc_reliability_framework"
- **Windows_NT x64 Formatting:**: "test Windows_NT formatting"
- **Windows_NT x64 Checked CoreFX Baseline Build & Test:** "test Windows_NT corefx_baseline"
- **Windows_NT x64 Checked CoreFX MinOpts Build & Test:** "test Windows_NT corefx_minopts"
@@ -166,6 +171,11 @@ To trigger a job, post a comment on your PR with "@dotnet-bot {trigger-phrase}".
- **Ubuntu x64 Release Priority 1 Build & Test:** "test Ubuntu pri1"
- **Ubuntu x64 Release IL RoundTrip Build & Test:** "test Ubuntu ilrt"
- **Ubuntu x64 Release Long-Running GC Build & Test:**: "test Ubuntu Release longgc"
+- **Ubuntu x64 Release GC Simulator:**: "test Ubuntu Release gcsimulator"
+- **Ubuntu x64 Release Standalone GC:**: "test Ubuntu Release standalone_gc"
+- **Ubuntu x64 Checked Standalone GC:**: "test Ubuntu Checked standalone_gc"
+- **Ubuntu x64 Release GC Reliability Framework:**: "test Ubuntu Release gc_reliability_framework"
+- **Ubuntu x64 Checked GC Reliability Framework:**: "test Ubuntu Checked gc_reliability_framework"
- **Ubuntu x64 Release Ready-To-Run Priority 0 Build & Test:** "test Ubuntu Release r2r"
- **Ubuntu x64 Checked Ready-To-Run Priority 0 Build & Test:** "test Ubuntu Checked r2r"
- **Ubuntu x64 Release Ready-To-Run Priority 1 Build & Test:** "test Ubuntu Release pri1r2r"
@@ -248,6 +258,11 @@ To trigger a job, post a comment on your PR with "@dotnet-bot {trigger-phrase}".
- **OSX x64 Release Priority 1 Build & Test:** "test OSX pri1"
- **OSX x64 Release IL RoundTrip Build & Test:** "test OSX ilrt"
- **OSX x64 Release Long-Running GC Build & Test:**: "test OSX Release longgc"
+- **OSX x64 Release GC Simulator:**: "test OSX10.12 Release gcsimulator"
+- **OSX x64 Release Standalone GC:**: "test OSX10.12 Release standalone_gc"
+- **OSX x64 Checked Standalone GC:**: "test OSX10.12 Checked standalone_gc"
+- **OSX x64 Release GC Reliability Framework:**: "test OSX10.12 Release gc_reliability_framework"
+- **OSX x64 Checked GC Reliability Framework:**: "test OSX10.12 Checked gc_reliability_framework"
- **OSX x64 Release Ready-To-Run Priority 0 Build & Test:** "test OSX Release r2r"
- **OSX x64 Checked Ready-To-Run Priority 0 Build & Test:** "test OSX Checked r2r"
- **OSX x64 Release Ready-To-Run Priority 1 Build & Test:** "test OSX Release pri1r2r"
diff --git a/Documentation/project-docs/clr-configuration-knobs.md b/Documentation/project-docs/clr-configuration-knobs.md
index 63f094b8ee..3787666174 100644
--- a/Documentation/project-docs/clr-configuration-knobs.md
+++ b/Documentation/project-docs/clr-configuration-knobs.md
@@ -303,9 +303,6 @@ Name | Description | Type | Class | Default Value | Flags
`StackSamplingNumMethods` | Number of evolving methods to track as hot and JIT them in the background at a given point of execution. | DWORD | UNSUPPORTED | 32 |
`AltJitNgen` | Enables AltJit for NGEN and selectively limits it to the specified methods. | STRING | INTERNAL | | REGUTIL_default
`JitNoCMOV` | | DWORD | INTERNAL | 0 | REGUTIL_default
-`UseRyuJIT` | Set to 1 by .NET 4.6 installer to indicate RyuJIT should be used, not JIT64. | DWORD | INTERNAL | 0 | IgnoreEnv / IgnoreHKCU / IgnoreConfigFiles
-`useLegacyJit` | Set to 1 to do all JITing with compatjit.dll. Only applicable to x64. | DWORD | EXTERNAL | 0 |
-`DisableNativeImageLoadList` | Refuse to load native images corresponding to one of the assemblies on this semicolon-delimited list of assembly names. | STRING | EXTERNAL | | REGUTIL_default
`JitValNumCSE` | Enables ValNum CSE for the specified methods | STRING | INTERNAL | | REGUTIL_default
`JitLexicalCSE` | Enables Lexical CSE for the specified methods | STRING | INTERNAL | | REGUTIL_default
`JitNoCSE` | | DWORD | INTERNAL | 0 | REGUTIL_default
diff --git a/Documentation/project-docs/contributing-workflow.md b/Documentation/project-docs/contributing-workflow.md
index ff21143d7a..3634802a10 100644
--- a/Documentation/project-docs/contributing-workflow.md
+++ b/Documentation/project-docs/contributing-workflow.md
@@ -83,24 +83,24 @@ Suggested Workflow
We use and recommend the following workflow:
1. Create an issue for your work.
- - You can skip this step for trivial changes.
- - Reuse an existing issue on the topic, if there is one.
- - Use [CODE_OWNERS.TXT](https://github.com/dotnet/coreclr/blob/master/CODE_OWNERS.TXT) to find relevant maintainers and @ mention them to ask for feedback on your issue.
- - Get agreement from the team and the community that your proposed change is a good one.
- - If your change adds a new API, follow the [API Review Process](https://github.com/dotnet/corefx/blob/master/Documentation/project-docs/api-review-process.md).
- - Clearly state that you are going to take on implementing it, if that's the case. You can request that the issue be assigned to you. Note: The issue filer and the implementer don't have to be the same person.
+ - You can skip this step for trivial changes.
+ - Reuse an existing issue on the topic, if there is one.
+ - Use [CODE_OWNERS.TXT](https://github.com/dotnet/coreclr/blob/master/CODE_OWNERS.TXT) to find relevant maintainers and @ mention them to ask for feedback on your issue.
+ - Get agreement from the team and the community that your proposed change is a good one.
+ - If your change adds a new API, follow the [API Review Process](https://github.com/dotnet/corefx/blob/master/Documentation/project-docs/api-review-process.md).
+ - Clearly state that you are going to take on implementing it, if that's the case. You can request that the issue be assigned to you. Note: The issue filer and the implementer don't have to be the same person.
2. Create a personal fork of the repository on GitHub (if you don't already have one).
3. Create a branch off of master (`git checkout -b mybranch`).
- - Name the branch so that it clearly communicates your intentions, such as issue-123 or githubhandle-issue.
- - Branches are useful since they isolate your changes from incoming changes from upstream. They also enable you to create multiple PRs from the same fork.
+ - Name the branch so that it clearly communicates your intentions, such as issue-123 or githubhandle-issue.
+ - Branches are useful since they isolate your changes from incoming changes from upstream. They also enable you to create multiple PRs from the same fork.
4. Make and commit your changes.
- - Please follow our [Commit Messages](https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/contributing-workflow.md#commit-messages) guidance.
+ - Please follow our [Commit Messages](https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/contributing-workflow.md#commit-messages) guidance.
5. Add new tests corresponding to your change, if applicable.
6. Build the repository with your changes.
- - Make sure that the builds are clean.
- - Make sure that the tests are all passing, including your new tests.
+ - Make sure that the builds are clean.
+ - Make sure that the tests are all passing, including your new tests.
7. Create a pull request (PR) against the upstream repository's **master** branch.
- - Push your changes to your fork on GitHub (if you haven't already).
+ - Push your changes to your fork on GitHub (if you haven't already).
Note: It is OK for your PR to include a large number of commits. Once your change is accepted, you will be asked to squash your commits into one or some appropriately small number of commits before your PR is merged.
diff --git a/Documentation/project-docs/dotnet-standards.md b/Documentation/project-docs/dotnet-standards.md
index 452c703f0a..d7268369d7 100644
--- a/Documentation/project-docs/dotnet-standards.md
+++ b/Documentation/project-docs/dotnet-standards.md
@@ -49,7 +49,7 @@ ECMA 372 - C++/CLI
The C++/CLI language was standardized as [ECMA 372](http://www.ecma-international.org/publications/standards/Ecma-372.htm) in 2005.
-EMCA 372 is supported by the .NET Framework, but not .NET Core.
+ECMA 372 is supported by the .NET Framework, but not .NET Core.
**ECMA 372 Resources**
diff --git a/Documentation/project-docs/garbage-collector-guidelines.md b/Documentation/project-docs/garbage-collector-guidelines.md
index 66d4c69b9f..1981c8ab6f 100644
--- a/Documentation/project-docs/garbage-collector-guidelines.md
+++ b/Documentation/project-docs/garbage-collector-guidelines.md
@@ -26,12 +26,43 @@ Required Testing: Validation of the behavior of the affected APIs.
## Stress Testing ##
Stress testing must run for at least **48 hours** against a debug build.
-Instructions for running stress are located in the repo at tests\src\GC\Stress\stress_run_readme.txt.
+Stress testing for checked and release builds can be done on pull requests with The .NET CI infrastructure.
+A stress run can be requested using the trigger phrase:
+
+```
+@dotnet_bot test <platform> <flavor> gc_reliability_framework
+```
+
+This will run the stress framework for the default amount of time (15 hours) on the given platform and build flavor.
## Functional Testing ##
A functional test run executes the same code as a stress run, but only runs for 30 minutes.
Instructions for running stress are located in the repo at tests\src\GC\Stress\stress_run_readme.txt.
+It is recommended that you run at least some of the below PR-triggered CI jobs:
+
+```
+@dotnet_bot test Windows_NT Checked longgc
+@dotnet_bot test OSX10.12 Checked longgc
+@dotnet_bot test Ubuntu Checked longgc
+@dotnet_bot test Windows_NT Checked standalone_gc
+@dotnet_bot test OSX10.12 Checked standalone_gc
+@dotnet_bot test Ubuntu Checked standalone_gc
+```
+
+The "Long GC" tests are a series of GC tests whose running time is too long or memory usage is too high to run with
+the rest of the Priority 0 unit tests. The "Standalone GC" build mode builds and runs the GC in a semi-standalone manner
+(see https://github.com/dotnet/coreclr/projects/3).
+
+You may also wish to run the GC Simulator tests. They may take up to 24 hours to complete and are known to sometimes fail on Ubuntu
+due to poor interactions with the Linux OOM killer. However, they have proven to be quite useful in finding bugs in the past:
+
+```
+@dotnet_bot test Windows_NT Release gcsimulator
+@dotnet_bot test Ubuntu Release gcsimulator
+@dotnet_bot test OSX10.12 Release gcsimulator
+```
+
## Performance Testing ##
Coming soon.
diff --git a/Documentation/project-docs/performance-guidelines.md b/Documentation/project-docs/performance-guidelines.md
index f9c5e17c91..a2e15d5e01 100644
--- a/Documentation/project-docs/performance-guidelines.md
+++ b/Documentation/project-docs/performance-guidelines.md
@@ -50,5 +50,14 @@ Capturing a trace using PerfView will allow you to:
PerfView is available at the [Microsoft Download Center](http://www.microsoft.com/en-us/download/details.aspx?id=28567 "Microsoft Download Center"). The help documentation is quite substantial and can help you get started. Clicking the blue links throughout PerfView's UI will also take you to the appropriate help topic. It is also recommended that you watch the [PerfView Tutorial Videos](http://channel9.msdn.com/Series/PerfView-Tutorial).
+# Running the CoreCLR Performance Tests on Windows #
+1. The first step to running the performance tests locally is to do a release build of CoreCLR and all of the performance tests. You can do this with the command `build.cmd x64 Release`, this will of course build the x64 runtime, and you should use x86 if you want to test x86.
+
+2. After building the runtime you will need to generate a core root that contains all of the binaries we just built along with the required dependencies. This can be done with the command `tests\runtest.cmd Release x64 GenerateLayoutOnly`, with the same caveat that x86 should be used if that is the platform that you are testing.
+
+3. Now we need to actually run the performance tests. You can do that with the following command that should be run from the root of your repo `tests\scripts\run-xunit-perf.cmd -arch x64 -configuration Release -testBinLoc bin\tests\Windows_NT.x64.Release\Jit\Performance\CodeQuality`. This will run all of the tests in the JIT CodeQuality directory as the script will walk all sub-directories and look for tests to run. If you want to just run a single test, pass the path of the single test that you want to run.
+
+4. Navigate to the `sandbox` directory in the root of your repo. Inside that directory you will find a bunch of files that follow the name Perf-*.md. These will contain the results, formatted as Markdown files, for each test that was run.
+
# Additional Help #
If you have questions, run into any issues, or would like help with any performance related topics, please feel free to post a question. Someone from the .NET performance team will be happy to help.
diff --git a/DotnetCLIVersion.txt b/DotnetCLIVersion.txt
index e42fc5fdff..32aae90d8a 100644
--- a/DotnetCLIVersion.txt
+++ b/DotnetCLIVersion.txt
@@ -1 +1 @@
-1.0.0-preview2-1-003182 \ No newline at end of file
+2.0.0-preview1-005724 \ No newline at end of file
diff --git a/Linked b/Linked
deleted file mode 100644
index 675a79bf12..0000000000
--- a/Linked
+++ /dev/null
Binary files differ
diff --git a/THIRD-PARTY-NOTICES b/THIRD-PARTY-NOTICES.TXT
index 03d4d3cc65..03d4d3cc65 100644
--- a/THIRD-PARTY-NOTICES
+++ b/THIRD-PARTY-NOTICES.TXT
diff --git a/Tools-Override/codeOptimization.targets b/Tools-Override/codeOptimization.targets
deleted file mode 100644
index 4db340f15e..0000000000
--- a/Tools-Override/codeOptimization.targets
+++ /dev/null
@@ -1,118 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <UsingTask TaskName="ZipFileExtractToDirectory" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll"/>
-
- <PropertyGroup>
- <OptimizationDataVersion Condition="'$(OptimizationDataVersion)'==''">2.0.0-rc-61101-16</OptimizationDataVersion>
- <OptimizationDataPackageName Condition="'$(OptimizationDataPackageName)'==''">RoslynDependencies.OptimizationData</OptimizationDataPackageName>
- <OptimizationDataDir Condition="'$(OptimizationDataDir)'==''">$(ToolsDir)OptimizationData/</OptimizationDataDir>
- <RestoreDefaultOptimizationDataPackage Condition="'$(RestoreDefaultOptimizationDataPackage)'==''">true</RestoreDefaultOptimizationDataPackage>
- <UsePartialNGENOptimization Condition="'$(UsePartialNGENOptimization)'==''">true</UsePartialNGENOptimization>
- </PropertyGroup>
-
- <!-- If IBC data hasn't been merged with the IL yet, preprocess it first -->
- <Target Name="PreProcessIBCData"
- BeforeTargets="OptimizeWithTrainingData"
- DependsOnTargets="ResolveOptionalTools"
- Condition="'$(OS)'=='Windows_NT' and '$(EnableProfileGuidedOptimization)'=='true' and Exists('$(OptimizationDataDir)$(AssemblyName).dll')">
-
- <!-- Find IBCMerge as a resolved optional tool. -->
- <PropertyGroup>
- <IBCMergeToolPath Condition="'%(Filename)%(Extension)'=='ibcmerge.exe'">@(ResolvedOptionalToolReferences)</IBCMergeToolPath>
- </PropertyGroup>
-
- <!-- Enumerate the various files that need merging -->
- <PropertyGroup>
- <InputAssemblyFile>$(OptimizationDataDir)$(AssemblyName).dll</InputAssemblyFile>
- <TargetOptimizationDataFile>$(OptimizationDataDir)$(AssemblyName).pgo</TargetOptimizationDataFile>
- </PropertyGroup>
- <ItemGroup>
- <RawOptimizationDataFiles Include="$(OptimizationDataDir)$(AssemblyName)*.ibc" />
- </ItemGroup>
-
- <!-- Merge the optimization data into the source DLL -->
- <Exec Command="$(IBCMergeToolPath) -q -f -delete -mo $(InputAssemblyFile) @(RawOptimizationDataFiles, ' ')" />
-
- <!-- Verify that the optimization data has been merged -->
- <Exec Command="$(IBCMergeToolPath) -mi $(InputAssemblyFile)" />
-
- <!-- Save the module as *.pgo to match the convention expected in target OptimizeWithTrainingData -->
- <Copy SourceFiles="$(InputAssemblyFile)" DestinationFiles="$(TargetOptimizationDataFile)" />
- </Target>
-
- <!-- We should only run this target on Windows and only if EnableProfileGuidedOptimization is set and we have training data -->
- <Target Name="OptimizeWithTrainingData"
- AfterTargets="AfterBuild"
- BeforeTargets="CopyFilesToOutputDirectory"
- DependsOnTargets="ResolveOptionalTools"
- Condition="'$(OS)'=='Windows_NT' and '$(EnableProfileGuidedOptimization)'=='true' and Exists('$(OptimizationDataDir)$(AssemblyName).pgo')">
-
- <!-- Find IBCMerge as a resolved optional tool. -->
- <PropertyGroup>
- <IBCMergeToolPath Condition="'%(Filename)%(Extension)'=='ibcmerge.exe'">@(ResolvedOptionalToolReferences)</IBCMergeToolPath>
- </PropertyGroup>
-
- <PropertyGroup>
- <OptimizedAssemblyDir>$(IntermediateOutputPath)/OptimizedAssembly</OptimizedAssemblyDir>
- <OptimizedAssemblyFile>$(OptimizedAssemblyDir)/$(AssemblyName).dll</OptimizedAssemblyFile>
- </PropertyGroup>
-
- <!-- Customize IBCMerge's arguments depending on input props -->
- <PropertyGroup>
- <IBCMergeArguments>-q -f -mo $(OptimizedAssemblyFile) -incremental $(OptimizationDataDir)$(AssemblyName).pgo</IBCMergeArguments>
- <IBCMergeArguments Condition="$(UsePartialNGENOptimization)">$(IBCMergeArguments) -partialNGEN -minify</IBCMergeArguments>
- </PropertyGroup>
-
- <!-- Copy the compiled assembly into a folder for further processing -->
- <MakeDir Directories="$(OptimizedAssemblyDir)" />
- <Copy SourceFiles="@(IntermediateAssembly)" DestinationFolder="$(OptimizedAssemblyDir)" />
-
- <!-- Apply optimization data to the compiled assembly -->
- <Exec Command="$(IBCMergeToolPath) $(IBCMergeArguments)" />
-
- <!-- Verify that the optimization data has been applied -->
- <Exec Command="$(IBCMergeToolPath) -mi $(OptimizedAssemblyFile)" />
-
- <!-- We need to make sure that the assembly that gets packaged is the one with the optimization data -->
- <ItemGroup>
- <IntermediateAssembly Remove="@(IntermediateAssembly)"/>
- <IntermediateAssembly Include="$(OptimizedAssemblyDir)/$(AssemblyName).dll"/>
- </ItemGroup>
- </Target>
-
- <!-- We need the OptimizationData package in order to be able to optimize the assembly -->
- <Target Name="RestoreOptimizationDataPackage"
- BeforeTargets="Sync"
- Condition="'$(EnableProfileGuidedOptimization)'=='true' and '$(RestoreDefaultOptimizationDataPackage)'=='true' and !Exists('$(OptimizationDataDir)project.json')">
-
- <!-- Dynamically create a project.json file used to restore the optimization data-->
- <Message Text="Generating project.json for optimization data" Importance="low" />
- <ItemGroup>
- <_OptimizationDataJsonLine Include="{&quot;dependencies&quot;: {" />
- <_OptimizationDataJsonLine Include="&quot;$(OptimizationDataPackageName)&quot; : &quot;$(OptimizationDataVersion)&quot; " />
- <_OptimizationDataJsonLine Include="},&quot;frameworks&quot;: {&quot;netcoreapp1.0&quot;: {},&quot;net46&quot;: {}}}"/>
- </ItemGroup>
-
- <PropertyGroup>
- <OptimizationDataProjectJson>$(OptimizationDataDir)project.json</OptimizationDataProjectJson>
- <OptimizationDataNuGetFeed Condition="'$(OptimizationDataNuGetFeed)'==''">https:%2F%2Fdotnet.myget.org/F/roslyn/api/v3/index.json</OptimizationDataNuGetFeed>
- </PropertyGroup>
-
- <MakeDir Directories="$(OptimizationDataDir)" ContinueOnError="true" />
- <WriteLinesToFile File="$(OptimizationDataProjectJson)" Lines="@(_OptimizationDataJsonLine)" Overwrite="true" />
-
- <!-- Restore the OptimizationData package -->
- <Exec Command="$(DnuRestoreCommand) $(OptimizationDataProjectJson) --source $(OptimizationDataNuGetFeed)"
- StandardOutputImportance="Low"/>
-
- <!-- Copy the restored files into a more accessible location -->
- <ItemGroup>
- <_OptimizationDataFiles Include="$(PackagesDir)/$(OptimizationDataPackageName)/$(OptimizationDataVersion)/content/OptimizationData/*.pgo" />
- </ItemGroup>
-
- <Copy SourceFiles="@(_OptimizationDataFiles)"
- DestinationFiles="@(_OptimizationDataFiles->'$(OptimizationDataDir)%(Filename)%(Extension)')"
- SkipUnchangedFiles="true"
- ContinueOnError="true"/>
- </Target>
-</Project> \ No newline at end of file
diff --git a/Tools-Override/depProj.targets b/Tools-Override/depProj.targets
deleted file mode 100644
index ea32123741..0000000000
--- a/Tools-Override/depProj.targets
+++ /dev/null
@@ -1,131 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-***********************************************************************************************
-depProj.targets
-
-WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
- created a backup copy. Incorrect changes to this file will make it
- impossible to load or build your projects from the command-line or the IDE.
-
-This file defines the steps in the standard build process specific for NuGet deployment
-projects. The remainder of the build process is defined in Microsoft.Common.targets,
-which is imported by this file.
-
-Licensed to the .NET Foundation under one or more agreements.
-The .NET Foundation licenses this file to you under the MIT license.
-See the LICENSE file in the project root for more information.
-***********************************************************************************************
--->
-<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-
- <!-- Deployment project
- Restores NuGet dependencies and copies them to the output directory.
-
- NuGetTargetMoniker - determined by the TargetFramework* and TargetPlatform*
- properties of the project, can be overidden.
- NuGetRuntimeIdentifier - defaults to <empty> (""), can be overidden.
- NuGetDeploySourceItem - defaults to ReferenceCopyLocalPaths, can be overidden to
- specify Reference (for compile assets) or Analyzer(for
- analyzer assets)
-
- For the appropriate behavior of P2P references the project should set the
- TargetName and TargetExt to match one of the files that will be copied
- from the packages.
- -->
-
- <PropertyGroup>
- <NuGetDeploySourceItem Condition="'$(NuGetDeploySourceItem)' == ''">ReferenceCopyLocalPaths</NuGetDeploySourceItem>
-
- <!-- suppress the attempt to copy build output. -->
- <CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>
-
- <!-- Unless overridden, use no runtime identifier. This is transformed in packageresolve.targets.
- We specify "None" here to avoid being assigned the default runtime for projects which set CopyNuGetImplementations=true. -->
- <NuGetRuntimeIdentifier Condition="'$(NuGetRuntimeIdentifier)' == ''">None</NuGetRuntimeIdentifier>
-
- <!-- make sure we tell nuget targets to copy, even if output type would not by default -->
- <CopyNuGetImplementations>true</CopyNuGetImplementations>
-
- <!-- by default there shouldn't be any assets in depproj files that require signing -->
- <SkipSigning Condition="'$(SkipSigning)' == ''">true</SkipSigning>
- </PropertyGroup>
-
- <Target Name="CoreCompile">
-
- <Error Condition="'$(NuGetDeploySourceItem)' != 'ReferenceCopyLocalPaths' AND
- '$(NuGetDeploySourceItem)' != 'Reference' AND
- '$(NuGetDeploySourceItem)' != 'Analyzer'"
- Text="Unexpected value for NuGetDeploySourceItem:'$(NuGetDeploySourceItem)'. Expected ReferenceCopyLocalPaths, Reference, or Analyzer." />
-
- <ItemGroup>
- <!-- Don't set IntermediateAssembly since this is not produced -->
- <IntermediateAssembly Remove="@(IntermediateAssembly)" />
-
- <NuGetDeploy Include="@($(NuGetDeploySourceItem))"/>
-
- <!-- filter to only items that came from packages -->
- <!-- the following condition must be applied after the include because msbuild doesn't seem
- to support property-defined-item-names in a metadata statement -->
- <NuGetDeploy Remove="@(NuGetDeploy)" Condition="'%(NuGetDeploy.NuGetPackageId)' == ''" />
-
- <!-- remove all existing items from NuGet packages we'll be defining these in our own item -->
- <ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.NuGetPackageId)' != ''"/>
- <Reference Remove="@(Reference)" Condition="'%(Reference.NuGetPackageId)' != ''"/>
- <Analyzer Remove="@(Analyzer)" Condition="'%(Analyzer.NuGetPackageId)' != ''"/>
-
- <!-- add items defined by NuGetDeployItem property to Content so that we get clean behavior -->
- <ContentWithTargetPath Include="@(NuGetDeploy)">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <TargetPath>%(FileName)%(Extension)</TargetPath>
- </ContentWithTargetPath>
- </ItemGroup>
-
- <Error Condition="'@(NuGetDeploy)' == ''" Text="Error no assets were resolved from NuGet packages." />
- <Message Importance="High" Text="%(FullPath) (%(NuGetPackageId).%(NuGetPackageVersion)) -&gt; @(NuGetDeploy->'$(TargetDir)%(FileName)%(Extension)')" />
-
- <!-- Include marker files if an extension has been provided -->
- <!-- internal builds use this to distinguish files which have already been signed -->
- <Touch Condition="'$(DeployMarkerExtension)' != ''" Files="@(NuGetDeploy->'$(TargetDir)%(FileName)$(DeployMarkerExtension)')" AlwaysCreate="true">
- <Output TaskParameter="TouchedFiles" ItemName="FileWrites"/>
- </Touch>
- </Target>
-
- <Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
-
- <!-- Required by Common.Targets but not used for depproj -->
- <Target Name="CreateManifestResourceNames" />
-
- <PropertyGroup>
- <!-- don't use TargetingPackReference, we do our own filtering -->
- <SkipFilterTargetingPackResolvedNugetPackages>true</SkipFilterTargetingPackResolvedNugetPackages>
- </PropertyGroup>
-
- <!-- Support filtering to a subset of packages or files -->
- <Target Name="FilterNugetPackages"
- AfterTargets="ResolveNuGetPackages"
- Condition="'@(PackageToInclude)' != '' OR '@(PackageToExclude)' != '' OR '@(FileToInclude)' != '' OR '@(FileToExclude)' != ''">
- <ItemGroup>
- <_nuGetDeploy Include="@($(NuGetDeploySourceItem))"/>
- <_nuGetDeployByFileName Include="@(_nuGetDeploy->'%(FileName)')">
- <OriginalItemSpec>%(Identity)</OriginalItemSpec>
- </_nuGetDeployByFileName>
-
- <_nuGetDeployByFileNameToRemove Include="@(_nuGetDeployByFileName)" Exclude="@(FileToInclude)" Condition="'@(FileToInclude)' != ''" />
- <_filteredNuGetDeployByFileName Include="@(_nuGetDeployByFileName)" Exclude="@(_nuGetDeployByFileNameToRemove);@(FileToExclude)" />
-
- <_nuGetDeployByPackageId Include="@(_filteredNuGetDeployByFileName->'%(NuGetPackageId)')" />
-
- <_nuGetDeployByPackageIdToRemove Include="@(_nuGetDeployByPackageId)" Exclude="@(PackageToInclude)" Condition="'@(PackageToInclude)' != ''" />
- <_filteredNuGetDeployByPackageId Include="@(_nuGetDeployByPackageId)" Exclude="@(_nuGetDeployByPackageIdToRemove);@(PackageToExclude)" />
-
- <ReferenceCopyLocalPaths Condition="'$(NuGetDeploySourceItem)' == 'ReferenceCopyLocalPaths'" Remove="@(ReferenceCopyLocalPaths)" />
- <Reference Condition="'$(NuGetDeploySourceItem)' == 'Reference'" Remove="@(Reference)" />
- <Analyzer Condition="'$(NuGetDeploySourceItem)' == 'Analyzer'" Remove="@(Analyzer)" />
- </ItemGroup>
-
- <CreateItem Include="@(_filteredNuGetDeployByPackageId->'%(OriginalItemSpec)')">
- <Output TaskParameter="Include" ItemName="$(NuGetDeploySourceItem)" />
- </CreateItem>
- </Target>
-
-</Project>
diff --git a/Tools-Override/resources.targets b/Tools-Override/resources.targets
deleted file mode 100644
index 82ce179ac7..0000000000
--- a/Tools-Override/resources.targets
+++ /dev/null
@@ -1,76 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <UsingTask TaskName="GenerateResourcesCode" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll" />
-
- <PropertyGroup>
- <GenerateResourceMSBuildRuntime>CurrentRuntime</GenerateResourceMSBuildRuntime>
- <GenerateResourceMSBuildArchitecture>CurrentArchitecture</GenerateResourceMSBuildArchitecture>
- </PropertyGroup>
-
- <PropertyGroup>
- <ResourcesSourceOutputDirectory Condition="'$(ResourcesSourceOutputDirectory)' == ''">$(MSBuildProjectDirectory)/Resources/</ResourcesSourceOutputDirectory>
- <StringResourcesPath Condition="'$(StringResourcesPath)'=='' And Exists('$(ResourcesSourceOutputDirectory)Strings.resx')">$(ResourcesSourceOutputDirectory)/Strings.resx</StringResourcesPath>
- <IntermediateResOutputFileFullPath Condition="'$(MSBuildProjectExtension)' == '.csproj'">$(IntermediateOutputPath)SR.cs</IntermediateResOutputFileFullPath>
- <IntermediateResOutputFileFullPath Condition="'$(MSBuildProjectExtension)' == '.vbproj'">$(IntermediateOutputPath)SR.vb</IntermediateResOutputFileFullPath>
- <DefineConstants Condition="'$(ConfigurationGroup)' == 'Debug'">$(DefineConstants);DEBUGRESOURCES</DefineConstants>
- </PropertyGroup>
-
- <PropertyGroup Condition="'$(StringResourcesPath)'!=''">
- <CompileDependsOn>
- GenerateResourcesSource;
- $(CompileDependsOn);
- </CompileDependsOn>
- </PropertyGroup>
-
- <Target Name="GenerateResourcesSource"
- Condition="'$(StringResourcesPath)'!='' AND '$(OmitResources)'!='true'"
- Inputs="$(StringResourcesPath)"
- Outputs="$(IntermediateResOutputFileFullPath)">
-
-
-
- <GenerateResourcesCode
- ResxFilePath="$(StringResourcesPath)"
- OutputSourceFilePath="$(IntermediateResOutputFileFullPath)"
- AssemblyName="$(AssemblyName)" />
-
- <ItemGroup>
- <!-- The following Compile element has to be included dynamically inside the Target otherwise intellisense will not work -->
- <Compile Include="$(IntermediateResOutputFileFullPath)" />
- </ItemGroup>
-
- <ItemGroup>
- <FileWrites Include="$(IntermediateResOutputFileFullPath)" />
- </ItemGroup>
- </Target>
-
- <ItemGroup Condition="'$(StringResourcesPath)'!='' AND '$(OmitResources)'!='true'">
- <EmbeddedResource Include="$(StringResourcesPath)">
- <Visible>true</Visible>
- <LogicalName>FxResources.$(AssemblyName).SR.resources</LogicalName>
- </EmbeddedResource>
- </ItemGroup>
-
- <Choose>
- <When Condition="Exists('$(StringResourcesPath)') And '$(SkipCommonResourcesIncludes)'=='' AND '$(OmitResources)'!='true'">
- <Choose>
- <When Condition="'$(MSBuildProjectExtension)' == '.csproj'">
- <ItemGroup>
- <Compile Include="$(CommonPath)/System/SR.cs">
- <Visible>true</Visible>
- <Link>Resources/Common/SR.cs</Link>
- </Compile>
- </ItemGroup>
- </When>
- <When Condition="'$(MSBuildProjectExtension)' == '.vbproj'">
- <ItemGroup>
- <Compile Include="$(CommonPath)/System/SR.vb">
- <Visible>true</Visible>
- <Link>Resources/Common/SR.vb</Link>
- </Compile>
- </ItemGroup>
- </When>
- </Choose>
- </When>
- </Choose>
-</Project>
diff --git a/build-packages.sh b/build-packages.sh
index 382e24db8a..a4184646d5 100755
--- a/build-packages.sh
+++ b/build-packages.sh
@@ -3,16 +3,15 @@
usage()
{
echo "Builds the NuGet packages from the binaries that were built in the Build product binaries step."
- echo "Usage: build-packages -BuildArch -BuildType [-portable]"
+ echo "Usage: build-packages -BuildArch -BuildType"
echo "BuildArch can be x64, x86, arm, arm64 (default is x64)"
echo "BuildType can be release, checked, debug (default is debug)"
- echo "-portable - build for Portable Distribution"
echo
exit 1
}
__ProjectRoot="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-__PortableBuild=0
+__IsPortableBuild=1
# Use uname to determine what the OS is.
OSName=$(uname -s)
@@ -71,8 +70,9 @@ while :; do
__Arch=$(echo $1| cut -d'=' -f 2)
;;
- -portableBuild)
- __PortableBuild=1
+ -PortableBuild=false)
+ unprocessedBuildArgs="$unprocessedBuildArgs $1"
+ __IsPortableBuild=0
;;
*)
unprocessedBuildArgs="$unprocessedBuildArgs $1"
@@ -81,7 +81,7 @@ while :; do
done
# Portable builds target the base RID
-if [ $__PortableBuild == 1 ]; then
+if [ $__IsPortableBuild == 1 ]; then
if [ "$__BuildOS" == "Linux" ]; then
export __DistroRid="linux-$__Arch"
elif [ "$__BuildOS" == "OSX" ]; then
diff --git a/build-test.cmd b/build-test.cmd
index 514bb23971..6291f502ec 100644
--- a/build-test.cmd
+++ b/build-test.cmd
@@ -77,7 +77,6 @@ if /i "%1" == "release" (set __BuildType=Release&set processedArgs
if /i "%1" == "checked" (set __BuildType=Checked&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "skipmanaged" (set __SkipManaged=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
-if /i "%1" == "updateinvalidpackages" (set __UpdateInvalidPackagesArg=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "toolset_dir" (set __ToolsetDir=%2&set __PassThroughArgs=%__PassThroughArgs% %2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
if /i "%1" == "buildagainstpackages" (set __ZipTests=1&set __BuildAgainstPackagesArg=-BuildTestsAgainstPackages&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "ziptests" (set __ZipTests=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
@@ -148,17 +147,6 @@ call "%__ProjectDir%\init-tools.cmd"
REM =========================================================================================
REM ===
-REM === Resolve runtime dependences
-REM ===
-REM =========================================================================================
-call "%__TestDir%\setup-runtime-dependencies.cmd" /arch %__BuildArch% /outputdir %__BinDir%
-
-if defined __UpdateInvalidPackagesArg (
- goto skipnative
-)
-
-REM =========================================================================================
-REM ===
REM === Native test build section
REM ===
REM =========================================================================================
@@ -240,7 +228,7 @@ REM ============================================================================
if not defined XunitTestBinBase set XunitTestBinBase=%__TestWorkingDir%
set "CORE_ROOT=%XunitTestBinBase%\Tests\Core_Root"
-call "%__ProjectDir%\run.cmd" build -Project=%__ProjectDir%\tests\build.proj -UpdateDependencies -BatchRestorePackages -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__unprocessedBuildArgs%
+call "%__ProjectDir%\run.cmd" build -Project=%__ProjectDir%\tests\build.proj -BatchRestorePackages -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__unprocessedBuildArgs%
set __BuildLogRootName=Tests_GenerateRuntimeLayout
@@ -277,11 +265,7 @@ if not defined VSINSTALLDIR (
exit /b 1
)
-if defined __UpdateInvalidPackagesArg (
- set __up=-updateinvalidpackageversions
-)
-
-call "%__ProjectDir%\run.cmd" build -Project=%__ProjectDir%\tests\build.proj -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__up% %__RunArgs% %__BuildAgainstPackagesArg% %__unprocessedBuildArgs%
+call "%__ProjectDir%\run.cmd" build -Project=%__ProjectDir%\tests\build.proj -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__unprocessedBuildArgs%
if errorlevel 1 (
echo %__MsgPrefix%Error: build failed. Refer to the build log files for details:
echo %__BuildLog%
@@ -397,6 +381,13 @@ REM ===
REM =========================================================================================
call %__ProjectDir%\run.cmd build -Project=%__ProjectDir%\tests\helixprep.proj -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %RuntimeIdArg% %TargetsWindowsArg% %__CrossgenArg% %__unprocessedBuildArgs%
+if errorlevel 1 (
+ echo %__MsgPrefix%Error: build failed. Refer to the build log files for details:
+ echo %__BuildLog%
+ echo %__BuildWrn%
+ echo %__BuildErr%
+ exit /b 1
+)
echo %__MsgPrefix% Prepped test binaries for publishing
@@ -421,7 +412,6 @@ echo.
echo. -? -h -help: view this message.
echo Build architecture: -buildArch: only x64 is currently allowed ^(default: x64^).
echo Build type: -buildType: one of Debug, Checked, Release ^(default: Debug^).
-echo updateinvalidpackageversions: Runs the target to update package versions.
echo buildagainstpackages: builds tests against restored packages, instead of against a built product.
echo runtimeid ^<ID^>: Builds a test overlay for the specified OS (Only supported when building against packages). Supported IDs are:
echo alpine.3.4.3-x64: Builds overlay for Alpine 3.4.3
@@ -448,7 +438,6 @@ echo 1: Build all tests with priority 0 and 1
echo 666: Build all tests with priority 0, 1 ... 666
echo -sequential: force a non-parallel build ^(default is to build in parallel
echo using all processors^).
-echo -ilasmroundtrip: enables ilasm round trip build and run of the tests before executing them.
echo -verbose: enables detailed file logging for the msbuild tasks into the msbuild log file.
exit /b 1
@@ -506,7 +495,7 @@ if /I "%2" == "mscorlib.ni.dll" exit /b 0
REM don't precompile anything from CoreCLR
if /I exist %CORE_ROOT_STAGE%\%2 exit /b 0
-"%CORE_ROOT_STAGE%\crossgen.exe" /Platform_Assemblies_Paths "%CORE_ROOT%" "%1" >nul 2>nul
+"%CORE_ROOT_STAGE%\crossgen.exe" /Platform_Assemblies_Paths "%CORE_ROOT%" /in "%1" /out "%CORE_ROOT%/temp.ni.dll" >nul 2>nul
set /a __exitCode = %errorlevel%
if "%__exitCode%" == "-2146230517" (
echo %2 is not a managed assembly.
@@ -517,6 +506,10 @@ if %__exitCode% neq 0 (
echo Unable to precompile %2
exit /b 0
)
+
+:: Delete original .dll & replace it with the Crossgened .dll
+del %1
+ren "%CORE_ROOT%\temp.ni.dll" %2
echo Successfully precompiled %2
exit /b 0
diff --git a/build.cmd b/build.cmd
index 64945cc159..61d5536143 100644
--- a/build.cmd
+++ b/build.cmd
@@ -75,7 +75,6 @@ set __BuildArchArm64=0
set __BuildTypeDebug=0
set __BuildTypeChecked=0
set __BuildTypeRelease=0
-set __BuildJit32=0
set __BuildStandaloneGC="-DFEATURE_STANDALONE_GC=0"
set __PgoInstrument=0
@@ -98,9 +97,6 @@ set __BuildPackages=1
set __BuildNativeCoreLib=1
set __RestoreOptData=1
-REM Is this a portable build?
-set __IsPortableBuild=
-
:Arg_Loop
if "%1" == "" goto ArgsDone
@@ -118,8 +114,6 @@ if /i "%1" == "debug" (set __BuildTypeDebug=1&set processedArgs=!p
if /i "%1" == "checked" (set __BuildTypeChecked=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "release" (set __BuildTypeRelease=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
-if /i "%1" == "-portable" (set __IsPortableBuild=-portable&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
-
REM All arguments after this point will be passed through directly to build.cmd on nested invocations
REM using the "all" argument, and must be added to the __PassThroughArgs variable.
if [!__PassThroughArgs!]==[] (
@@ -142,11 +136,9 @@ if /i "%1" == "skiptests" (set __BuildTests=0&set processedArgs=!proce
if /i "%1" == "skipbuildpackages" (set __BuildPackages=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "skiprestoreoptdata" (set __RestoreOptData=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "usenmakemakefiles" (set __NMakeMakefiles=1&set __ConfigureOnly=1&set __BuildNative=1&set __BuildNativeCoreLib=0&set __BuildCoreLib=0&set __BuildTests=0&set __BuildPackages=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
-if /i "%1" == "buildjit32" (set __BuildJit32=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "pgoinstrument" (set __PgoInstrument=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "ibcinstrument" (set __IbcTuning=/Tuning&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "toolset_dir" (set __ToolsetDir=%2&set __PassThroughArgs=%__PassThroughArgs% %2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
-if /i "%1" == "compatjitcrossgen" (set __CompatJitCrossgen=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "buildstandalonegc" (set __BuildStandaloneGC="-DFEATURE_STANDALONE_GC=1"&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
@REM The following can be deleted once the CI system that passes it is updated to not pass it.
@@ -244,21 +236,6 @@ REM === Restore optimization profile data
REM ===
REM =========================================================================================
-REM Parse the package version out of project.json so that we can pass it on to CMake
-where /q python || (
- echo %__MsgPrefix%Error: Python not found on PATH, please make sure that it is installed.
- exit /b 1
-)
-set OptDataProjectJsonPath=%__ProjectDir%\src\.nuget\optdata\project.json
-if EXIST "%OptDataProjectJsonPath%" (
- for /f "tokens=*" %%s in ('python "%__ProjectDir%\extract-from-json.py" -rf "%OptDataProjectJsonPath%" dependencies optimization.PGO.CoreCLR') do @(
- set __PgoOptDataVersion=%%s
- )
- for /f "tokens=*" %%s in ('python "%__ProjectDir%\extract-from-json.py" -rf "%OptDataProjectJsonPath%" dependencies optimization.IBC.CoreCLR') do @(
- set __IbcOptDataVersion=%%s
- )
-)
-
if %__RestoreOptData% EQU 1 (
echo %__MsgPrefix%Restoring the OptimizationData Package
@call %__ProjectDir%\run.cmd sync -optdata
@@ -268,6 +245,20 @@ if %__RestoreOptData% EQU 1 (
)
)
+REM Parse the optdata package versions out of msbuild so that we can pass them on to CMake
+set DotNetCli=%__ProjectDir%\Tools\dotnetcli\dotnet.exe
+if not exist "%DotNetCli%" (
+ echo Assertion failed: dotnet.exe not found at path "%DotNetCli%"
+ exit /b 1
+)
+set OptDataProjectFilePath=%__ProjectDir%\src\.nuget\optdata\optdata.csproj
+for /f "tokens=*" %%s in ('%DotNetCli% msbuild "%OptDataProjectFilePath%" /t:DumpPgoDataPackageVersion /nologo') do @(
+ set __PgoOptDataVersion=%%s
+)
+for /f "tokens=*" %%s in ('%DotNetCli% msbuild "%OptDataProjectFilePath%" /t:DumpIbcDataPackageVersion /nologo') do @(
+ set __IbcOptDataVersion=%%s
+)
+
REM =========================================================================================
REM ===
REM === Build the CLR VM
@@ -318,7 +309,7 @@ if %__BuildNative% EQU 1 (
pushd "%__IntermediatesDir%"
set __ExtraCmakeArgs=!___SDKVersion! "-DCLR_CMAKE_TARGET_OS=%__BuildOs%" "-DCLR_CMAKE_PACKAGES_DIR=%__PackagesDir%" "-DCLR_CMAKE_PGO_INSTRUMENT=%__PgoInstrument%" "-DCLR_CMAKE_OPTDATA_VERSION=%__PgoOptDataVersion%"
- call "%__SourceDir%\pal\tools\gen-buildsys-win.bat" "%__ProjectDir%" %__VSVersion% %__BuildArch% "-DBUILD_JIT32=%__BuildJit32%" %__BuildStandaloneGC% !__ExtraCmakeArgs!
+ call "%__SourceDir%\pal\tools\gen-buildsys-win.bat" "%__ProjectDir%" %__VSVersion% %__BuildArch% %__BuildStandaloneGC% !__ExtraCmakeArgs!
@if defined _echo @echo on
popd
:SkipConfigure
@@ -430,10 +421,6 @@ if %__BuildCoreLib% EQU 1 (
set __nugetBuildArgs=-buildNugetPackage=true
)
- set PackageCompatJit=
- if "%__BuildJit32%" == "1" (
- set PackageCompatJit=1
- )
@call %__ProjectDir%\run.cmd build -Project=%__ProjectDir%\build.proj -MsBuildLog=!__MsbuildLog! -MsBuildWrn=!__MsbuildWrn! -MsBuildErr=!__MsbuildErr! !__nugetBuildArgs! %__RunArgs% !__ExtraBuildArgs! %__UnprocessedBuildArgs%
if not !errorlevel! == 0 (
echo %__MsgPrefix%Error: System.Private.CoreLib build failed. Refer to the build log files for details:
@@ -450,29 +437,21 @@ set PATH=%PATH%;%WinDir%\Microsoft.Net\Framework64\V4.0.30319;%WinDir%\Microsoft
if %__BuildNativeCoreLib% EQU 1 (
echo %__MsgPrefix%Generating native image of System.Private.CoreLib for %__BuildOS%.%__BuildArch%.%__BuildType%
- if "%__CompatJitCrossgen%"=="1" (
- set COMPlus_UseWindowsX86CoreLegacyJit=1
- )
-
- echo "%__CrossgenExe%" %__IbcTuning% /Platform_Assemblies_Paths "%__BinDir%" /out "%__BinDir%\System.Private.CoreLib.ni.dll" "%__BinDir%\System.Private.CoreLib.dll"
- "%__CrossgenExe%" %__IbcTuning% /Platform_Assemblies_Paths "%__BinDir%" /out "%__BinDir%\System.Private.CoreLib.ni.dll" "%__BinDir%\System.Private.CoreLib.dll" > "%__CrossGenCoreLibLog%" 2>&1
+ echo "%__CrossgenExe%" %__IbcTuning% /Platform_Assemblies_Paths "%__BinDir%"\IL /out "%__BinDir%\System.Private.CoreLib.dll" "%__BinDir%\IL\System.Private.CoreLib.dll"
+ "%__CrossgenExe%" %__IbcTuning% /Platform_Assemblies_Paths "%__BinDir%"\IL /out "%__BinDir%\System.Private.CoreLib.dll" "%__BinDir%\IL\System.Private.CoreLib.dll" > "%__CrossGenCoreLibLog%" 2>&1
if NOT !errorlevel! == 0 (
echo %__MsgPrefix%Error: CrossGen System.Private.CoreLib build failed. Refer to %__CrossGenCoreLibLog%
:: Put it in the same log, helpful for Jenkins
type %__CrossGenCoreLibLog%
goto CrossgenFailure
)
- "%__CrossgenExe%" /Platform_Assemblies_Paths "%__BinDir%" /CreatePdb "%__BinDir%\PDB" "%__BinDir%\System.Private.CoreLib.ni.dll" >> "%__CrossGenCoreLibLog%" 2>&1
+ "%__CrossgenExe%" /Platform_Assemblies_Paths "%__BinDir%" /CreatePdb "%__BinDir%\PDB" "%__BinDir%\System.Private.CoreLib.dll" >> "%__CrossGenCoreLibLog%" 2>&1
if NOT !errorlevel! == 0 (
echo %__MsgPrefix%Error: CrossGen /CreatePdb System.Private.CoreLib build failed. Refer to %__CrossGenCoreLibLog%
:: Put it in the same log, helpful for Jenkins
type %__CrossGenCoreLibLog%
goto CrossgenFailure
)
-
- if "%__CompatJitCrossgen%"=="1" (
- set COMPlus_UseWindowsX86CoreLegacyJit=
- )
)
if %__BuildPackages% EQU 1 (
@@ -483,7 +462,7 @@ if %__BuildPackages% EQU 1 (
set __MsbuildErr=/flp2:ErrorsOnly;LogFile="%__LogsDir%\Nuget_%__BuildOS%__%__BuildArch%__%__BuildType%.err"
REM The conditions as to what to build are captured in the builds file.
- @call %__ProjectDir%\run.cmd build -Project=%__SourceDir%\.nuget\packages.builds %__IsPortableBuild% -platform=%__BuildArch% -MsBuildLog=!__MsbuildLog! -MsBuildWrn=!__MsbuildWrn! -MsBuildErr=!__MsbuildErr! %__RunArgs% %__UnprocessedBuildArgs%
+ @call %__ProjectDir%\run.cmd build -Project=%__SourceDir%\.nuget\packages.builds -platform=%__BuildArch% -MsBuildLog=!__MsbuildLog! -MsBuildWrn=!__MsbuildWrn! -MsBuildErr=!__MsbuildErr! %__RunArgs% %__UnprocessedBuildArgs%
if not !errorlevel! == 0 (
echo %__MsgPrefix%Error: Nuget package generation failed build failed. Refer to the build log files for details:
diff --git a/build.proj b/build.proj
index 07bb11a922..8d15cbcd6e 100644
--- a/build.proj
+++ b/build.proj
@@ -24,12 +24,8 @@
<Delete Files="$(BinDir)System.Private.CoreLib.*" />
</Target>
- <PropertyGroup>
- <OptDataProjectJson>$(SourceDir).nuget/optdata/project.json</OptDataProjectJson>
- <OptDataPackageFeed>https://dotnet.myget.org/F/dotnet-core-optimization-data/api/v3/index.json</OptDataPackageFeed>
- </PropertyGroup>
<Target Name="RestoreOptData">
- <Exec Condition="Exists('$(OptDataProjectJson)')" Command="$(DnuRestoreCommand) &quot;$(OptDataProjectJson)&quot; --source &quot;$(OptDataPackageFeed)&quot;" />
+ <Exec Command="$(DotnetRestoreCommand) $(SourceDir).nuget/optdata/optdata.csproj" />
</Target>
<!--
@@ -40,7 +36,8 @@
<Target Name="Sync" BeforeTargets="Build" />
<Target Name="RestoreNETCorePlatforms" AfterTargets="Build" Condition="'$(RestoreDuringBuild)'=='true'">
- <Exec Command="$(DnuRestoreCommand) &quot;$(SourceDir).nuget/init/project.json&quot; --source https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
+ <Exec Command="$(DotnetRestoreCommand) $(SourceDir).nuget/init/init.csproj"
+ StandardOutputImportance="Low" />
</Target>
</Project>
diff --git a/build.sh b/build.sh
index 018cdf0439..55b4ba3200 100755
--- a/build.sh
+++ b/build.sh
@@ -38,7 +38,6 @@ usage()
echo "skiptests - skip the tests in the 'tests' subdirectory."
echo "skipnuget - skip building nuget packages."
echo "skiprestoreoptdata - skip restoring optimization data used by profile-based optimizations."
- echo "portable - build for portable RID."
echo "verbose - optional argument to enable verbose build output."
echo "-skiprestore: skip restoring packages ^(default: packages are restored during build^)."
echo "-disableoss: Disable Open Source Signing for System.Private.CoreLib."
@@ -142,6 +141,16 @@ restore_optdata()
echo "Failed to restore the optimization data package."
exit 1
fi
+
+ # Parse the optdata package versions out of msbuild so that we can pass them on to CMake
+ local DotNetCli="$__ProjectRoot/Tools/dotnetcli/dotnet"
+ if [ ! -f $DotNetCli ]; then
+ echo "Assertion failed: dotnet CLI not found at '$DotNetCli'"
+ exit 1
+ fi
+ local OptDataProjectFilePath="$__ProjectRoot/src/.nuget/optdata/optdata.csproj"
+ __PgoOptDataVersion=$($DotNetCli msbuild $OptDataProjectFilePath /t:DumpPgoDataPackageVersion /nologo | sed 's/^\s*//')
+ __IbcOptDataVersion=$($DotNetCli msbuild $OptDataProjectFilePath /t:DumpIbcDataPackageVersion /nologo | sed 's/^\s*//')
fi
}
@@ -154,15 +163,27 @@ generate_event_logging_sources()
# Event Logging Infrastructure
__GeneratedIntermediate="$__IntermediatesDir/Generated"
__GeneratedIntermediateEventProvider="$__GeneratedIntermediate/eventprovider_new"
+ __GeneratedIntermediateEventPipe="$__GeneratedIntermediate/eventpipe_new"
+
if [[ -d "$__GeneratedIntermediateEventProvider" ]]; then
rm -rf "$__GeneratedIntermediateEventProvider"
fi
+ if [[ -d "$__GeneratedIntermediateEventPipe" ]]; then
+ rm -rf "$__GeneratedIntermediateEventPipe"
+ fi
+
if [[ ! -d "$__GeneratedIntermediate/eventprovider" ]]; then
mkdir -p "$__GeneratedIntermediate/eventprovider"
fi
+ if [[ ! -d "$__GeneratedIntermediate/eventpipe" ]]; then
+ mkdir -p "$__GeneratedIntermediate/eventpipe"
+ fi
+
mkdir -p "$__GeneratedIntermediateEventProvider"
+ mkdir -p "$__GeneratedIntermediateEventPipe"
+
if [[ $__SkipCoreCLR == 0 || $__ConfigureOnly == 1 ]]; then
echo "Laying out dynamically generated files consumed by the build system "
echo "Laying out dynamically generated Event Logging Test files"
@@ -172,6 +193,18 @@ generate_event_logging_sources()
exit
fi
+ case $__BuildOS in
+ Linux)
+ echo "Laying out dynamically generated EventPipe Implementation"
+ $PYTHON -B -Wall -Werror "$__ProjectRoot/src/scripts/genEventPipe.py" --man "$__ProjectRoot/src/vm/ClrEtwAll.man" --intermediate "$__GeneratedIntermediateEventPipe" --exc "$__ProjectRoot/src/vm/ClrEtwAllMeta.lst"
+ if [[ $? != 0 ]]; then
+ exit
+ fi
+ ;;
+ *)
+ ;;
+ esac
+
#determine the logging system
case $__BuildOS in
Linux)
@@ -193,6 +226,14 @@ generate_event_logging_sources()
fi
rm -rf "$__GeneratedIntermediateEventProvider"
+
+ echo "Cleaning the temp folder of dynamically generated EventPipe files"
+ $PYTHON -B -Wall -Werror -c "import sys;sys.path.insert(0,\"$__ProjectRoot/src/scripts\"); from Utilities import *;UpdateDirectory(\"$__GeneratedIntermediate/eventpipe\",\"$__GeneratedIntermediateEventPipe\")"
+ if [[ $? != 0 ]]; then
+ exit
+ fi
+
+ rm -rf "$__GeneratedIntermediateEventPipe"
}
build_native()
@@ -379,7 +420,7 @@ build_CoreLib_ni()
{
if [ $__SkipCoreCLR == 0 -a -e $__BinDir/crossgen ]; then
echo "Generating native image for System.Private.CoreLib."
- $__BinDir/crossgen $__IbcTuning $__BinDir/System.Private.CoreLib.dll
+ $__BinDir/crossgen /Platform_Assemblies_Paths $__BinDir/IL $__IbcTuning /out $__BinDir/System.Private.CoreLib.dll $__BinDir/IL/System.Private.CoreLib.dll
if [ $? -ne 0 ]; then
echo "Failed to generate native image for System.Private.CoreLib."
exit 1
@@ -387,7 +428,7 @@ build_CoreLib_ni()
if [ "$__BuildOS" == "Linux" ]; then
echo "Generating symbol file for System.Private.CoreLib."
- $__BinDir/crossgen /CreatePerfMap $__BinDir $__BinDir/System.Private.CoreLib.ni.dll
+ $__BinDir/crossgen /CreatePerfMap $__BinDir $__BinDir/System.Private.CoreLib.dll
if [ $? -ne 0 ]; then
echo "Failed to generate symbol file for System.Private.CoreLib."
exit 1
@@ -585,7 +626,7 @@ __DistroRid=""
__cmakeargs=""
__SkipGenerateVersion=0
__DoCrossArchBuild=0
-__PortableBuild=0
+__PortableBuild=1
__msbuildonunsupportedplatform=0
__PgoOptDataVersion=""
__IbcOptDataVersion=""
@@ -642,8 +683,8 @@ while :; do
__CrossBuild=1
;;
- -portable)
- __PortableBuild=1
+ -portablebuild=false)
+ __PortableBuild=0
;;
verbose)
@@ -800,12 +841,22 @@ if [[ $__ClangMajorVersion == 0 && $__ClangMinorVersion == 0 ]]; then
__ClangMajorVersion=3
__ClangMinorVersion=6
fi
+
+ if [[ "$__BuildArch" == "armel" ]]; then
+ # Armel cross build is Tizen specific and does not support Portable RID build
+ __PortableBuild=0
+ fi
+
else
__ClangMajorVersion=3
__ClangMinorVersion=5
fi
fi
+if [ $__PortableBuild == 0 ]; then
+ __RunArgs="$__RunArgs -PortableBuild=false"
+fi
+
# Set dependent variables
__LogsDir="$__RootBinDir/Logs"
@@ -858,13 +909,6 @@ if [ $__CrossBuild == 1 ]; then
fi
fi
-# Parse the optdata package version from its project.json file
-optDataProjectJsonPath="$__ProjectRoot/src/.nuget/optdata/project.json"
-if [ -f $optDataProjectJsonPath ]; then
- __PgoOptDataVersion=$("$__ProjectRoot/extract-from-json.py" -rf $optDataProjectJsonPath dependencies optimization.PGO.CoreCLR)
- __IbcOptDataVersion=$("$__ProjectRoot/extract-from-json.py" -rf $optDataProjectJsonPath dependencies optimization.IBC.CoreCLR)
-fi
-
# init the target distro name
initTargetDistroRid
diff --git a/buildpipeline/DotNet-CoreClr-Trusted-Linux-Crossbuild.json b/buildpipeline/DotNet-CoreClr-Trusted-Linux-Crossbuild.json
index ab8fc1ed4d..312d08c928 100644
--- a/buildpipeline/DotNet-CoreClr-Trusted-Linux-Crossbuild.json
+++ b/buildpipeline/DotNet-CoreClr-Trusted-Linux-Crossbuild.json
@@ -139,7 +139,7 @@
},
"inputs": {
"filename": "docker",
- "arguments": "run --rm -e ROOTFS_DIR $(DockerCommonRunArgs) ./build.sh $(PB_BuildType) $(Architecture) $(portableBuild) skipnuget cross -skiprestore stripSymbols -OfficialBuildId=$(OfficialBuildId) -- /p:\"ConfigurationGroup=\"Release\" /flp:\"v=diag\"",
+ "arguments": "run --rm -e ROOTFS_DIR $(DockerCommonRunArgs) ./build.sh $(PB_BuildType) $(Architecture) skipnuget cross -skiprestore stripSymbols -OfficialBuildId=$(OfficialBuildId) -- /flp:\"v=diag\"",
"workingFolder": "",
"failOnStandardError": "false"
}
@@ -157,7 +157,7 @@
},
"inputs": {
"filename": "docker",
- "arguments": "run --rm $(DockerCommonRunArgs) ./build-packages.sh $(portableBuild) -BuildType=$(PB_BuildType) -BuildArch=$(Architecture)",
+ "arguments": "run --rm $(DockerCommonRunArgs) ./build-packages.sh -BuildType=$(PB_BuildType) -BuildArch=$(Architecture) -- /p:OfficialBuildId=$(OfficialBuildId)",
"workingFolder": "",
"failOnStandardError": "false"
}
@@ -415,9 +415,6 @@
"DockerCopyDest": {
"value": "$(Build.BinariesDirectory)/docker_repo"
},
- "portableBuild": {
- "value": ""
- },
"ROOTFS_DIR": {
"value": "/crossrootfs/$(Architecture)"
},
@@ -450,7 +447,7 @@
"deleteTestResults": true
}
],
- "buildNumberFormat": "$(date:yyyyMMdd)$(rev:-rr)-$(DockerTag)$(portableBuild)",
+ "buildNumberFormat": "$(date:yyyyMMdd)$(rev:-rr)-$(DockerTag)",
"jobAuthorizationScope": "projectCollection",
"jobTimeoutInMinutes": 90,
"repository": {
diff --git a/buildpipeline/DotNet-CoreClr-Trusted-Linux.json b/buildpipeline/DotNet-CoreClr-Trusted-Linux.json
index 0efb91a6e6..882c1127ec 100644
--- a/buildpipeline/DotNet-CoreClr-Trusted-Linux.json
+++ b/buildpipeline/DotNet-CoreClr-Trusted-Linux.json
@@ -121,7 +121,7 @@
},
"inputs": {
"filename": "docker",
- "arguments": "run --rm $(DockerCommonRunArgs) ./build.sh $(PB_BuildType) $(Architecture) $(portableBuild) skipnuget -skiprestore stripSymbols -OfficialBuildId=$(OfficialBuildId) -- /p:\"ConfigurationGroup=\"Release\" /flp:\"v=diag\"",
+ "arguments": "run --rm $(DockerCommonRunArgs) ./build.sh $(PB_BuildType) $(Architecture) skipnuget -skiprestore stripSymbols -OfficialBuildId=$(OfficialBuildId) -- /flp:\"v=diag\"",
"workingFolder": "",
"failOnStandardError": "false"
}
@@ -139,7 +139,7 @@
},
"inputs": {
"filename": "docker",
- "arguments": "run --rm $(DockerCommonRunArgs) ./build-packages.sh $(portableBuild) -BuildType=$(PB_BuildType) -BuildArch=$(Architecture)",
+ "arguments": "run --rm $(DockerCommonRunArgs) ./build-packages.sh -BuildType=$(PB_BuildType) -BuildArch=$(Architecture) -- /p:OfficialBuildId=$(OfficialBuildId)",
"workingFolder": "",
"failOnStandardError": "false"
}
@@ -376,9 +376,6 @@
"value": "HEAD",
"allowOverride": true
},
- "portableBuild": {
- "value": ""
- },
"DockerVolumeName": {
"value": "coreclr-$(Build.BuildId)"
},
@@ -411,7 +408,7 @@
"deleteTestResults": true
}
],
- "buildNumberFormat": "$(date:yyyyMMdd)$(rev:-rr)-$(DockerTag)$(portableBuild)",
+ "buildNumberFormat": "$(date:yyyyMMdd)$(rev:-rr)-$(DockerTag)",
"jobAuthorizationScope": "projectCollection",
"jobTimeoutInMinutes": 90,
"repository": {
diff --git a/buildpipeline/DotNet-CoreClr-Trusted-Mac.json b/buildpipeline/DotNet-CoreClr-Trusted-Mac.json
index 5a441452d7..b96ebb5bbf 100644
--- a/buildpipeline/DotNet-CoreClr-Trusted-Mac.json
+++ b/buildpipeline/DotNet-CoreClr-Trusted-Mac.json
@@ -49,7 +49,7 @@
},
"inputs": {
"filename": "$(Agent.BuildDirectory)/s/build.sh",
- "arguments": "$(PB_BuildType) $(Architecture) $(portableBuild) skipnuget -skiprestore stripSymbols -OfficialBuildId=$(OfficialBuildId) -- /p:\"ConfigurationGroup=Release\"",
+ "arguments": "$(PB_BuildType) $(Architecture) skipnuget -skiprestore stripSymbols -OfficialBuildId=$(OfficialBuildId)",
"workingFolder": "",
"failOnStandardError": "false"
}
@@ -67,7 +67,7 @@
},
"inputs": {
"filename": "$(Agent.BuildDirectory)/s/build-packages.sh",
- "arguments": "-BuildType=$(PB_BuildType) -BuildArch=$(Architecture) $(portableBuild)",
+ "arguments": "-BuildType=$(PB_BuildType) -BuildArch=$(Architecture) -- /p:OfficialBuildId=$(OfficialBuildId)",
"workingFolder": "",
"failOnStandardError": "false"
}
@@ -176,9 +176,6 @@
},
"Label": {
"value": "$(Build.BuildNumber)"
- },
- "portableBuild": {
- "value": ""
}
},
"demands": [
diff --git a/buildpipeline/DotNet-CoreClr-Trusted-Windows-x86.json b/buildpipeline/DotNet-CoreClr-Trusted-Windows-x86.json
index 9b24cc23a9..8ec9054c63 100644
--- a/buildpipeline/DotNet-CoreClr-Trusted-Windows-x86.json
+++ b/buildpipeline/DotNet-CoreClr-Trusted-Windows-x86.json
@@ -39,78 +39,6 @@
},
{
"enabled": true,
- "continueOnError": true,
- "alwaysRun": false,
- "displayName": "Run rd",
- "timeoutInMinutes": 0,
- "task": {
- "id": "d9bafed4-0b18-4f58-968d-86655b4d2ce9",
- "versionSpec": "1.*",
- "definitionType": "task"
- },
- "inputs": {
- "filename": "rd",
- "arguments": "/S /Q jit32",
- "workingFolder": "src",
- "failOnStandardError": "false"
- }
- },
- {
- "enabled": true,
- "continueOnError": false,
- "alwaysRun": false,
- "displayName": "Run md",
- "timeoutInMinutes": 0,
- "task": {
- "id": "d9bafed4-0b18-4f58-968d-86655b4d2ce9",
- "versionSpec": "1.*",
- "definitionType": "task"
- },
- "inputs": {
- "filename": "md",
- "arguments": "jit32",
- "workingFolder": "src",
- "failOnStandardError": "false"
- }
- },
- {
- "enabled": true,
- "continueOnError": false,
- "alwaysRun": false,
- "displayName": "Run git",
- "timeoutInMinutes": 0,
- "task": {
- "id": "d9bafed4-0b18-4f58-968d-86655b4d2ce9",
- "versionSpec": "1.*",
- "definitionType": "task"
- },
- "inputs": {
- "filename": "git",
- "arguments": "clone -b $(Jit32Branch) $(Jit32Repo) jit32",
- "workingFolder": "src",
- "failOnStandardError": "false"
- }
- },
- {
- "enabled": true,
- "continueOnError": true,
- "alwaysRun": false,
- "displayName": "Run rd",
- "timeoutInMinutes": 0,
- "task": {
- "id": "d9bafed4-0b18-4f58-968d-86655b4d2ce9",
- "versionSpec": "1.*",
- "definitionType": "task"
- },
- "inputs": {
- "filename": "rd",
- "arguments": "/S /Q jit32\\.git",
- "workingFolder": "src",
- "failOnStandardError": "false"
- }
- },
- {
- "enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Run clean.cmd",
@@ -158,7 +86,7 @@
},
"inputs": {
"filename": "build.cmd",
- "arguments": "$(Architecture) $(PB_BuildType) skiptests skipbuildpackages buildjit32 -OfficialBuildId=$(OfficialBuildId) -skiprestore -Priority=$(Priority) $(portableBuild) -- /p:\"ConfigurationGroup=Release\"",
+ "arguments": "$(Architecture) $(PB_BuildType) skiptests skipbuildpackages -OfficialBuildId=$(OfficialBuildId) -skiprestore -Priority=$(Priority)",
"workingFolder": "",
"failOnStandardError": "false"
}
@@ -203,7 +131,7 @@
},
"inputs": {
"filename": "build-packages.cmd",
- "arguments": "-BuildArch=$(Architecture) -BuildType=$(PB_BuildType) $(portableBuild) -ExtraParameters=/p:PackageCompatJit=1",
+ "arguments": "-BuildArch=$(Architecture) -BuildType=$(PB_BuildType) -- /p:OfficialBuildId=$(OfficialBuildId)",
"workingFolder": "",
"failOnStandardError": "false"
}
@@ -227,46 +155,6 @@
}
},
{
- "enabled": false,
- "continueOnError": false,
- "alwaysRun": false,
- "displayName": "Publish symbols path: \\\\cpvsbuild\\drops\\DotNetCore\\$(Build.DefinitionName)\\$(Build.BuildNumber)\\symbols",
- "timeoutInMinutes": 0,
- "task": {
- "id": "0675668a-7bba-4ccb-901d-5ad6554ca653",
- "versionSpec": "1.*",
- "definitionType": "task"
- },
- "inputs": {
- "SymbolsPath": "\\\\cpvsbuild\\drops\\DotNetCore\\$(Build.DefinitionName)\\$(Build.BuildNumber)\\symbols",
- "SearchPattern": "bin\\Product\\*$(Architecture).$(PB_BuildType)\\**\\PDB\\*.pdb",
- "SymbolsFolder": "",
- "SkipIndexing": "false",
- "TreatNotIndexedAsWarning": "false",
- "SymbolsMaximumWaitTime": "",
- "SymbolsProduct": "",
- "SymbolsVersion": "",
- "SymbolsArtifactName": "Symbols_$(BuildConfiguration)"
- }
- },
- {
- "enabled": false,
- "continueOnError": false,
- "alwaysRun": false,
- "displayName": "Index Symbols on Symweb",
- "timeoutInMinutes": 0,
- "task": {
- "id": "af503aa3-9d06-44b6-a549-d063a544a5c5",
- "versionSpec": "1.*",
- "definitionType": "task"
- },
- "inputs": {
- "symbolStore": "\\\\cpvsbuild\\drops\\DotNetCore\\$(Build.DefinitionName)\\$(Build.BuildNumber)\\symbols",
- "contacts": "mawilkie",
- "project": "DDE"
- }
- },
- {
"enabled": true,
"continueOnError": false,
"alwaysRun": true,
@@ -406,9 +294,6 @@
"VsoPassword": {
"value": null,
"isSecret": true
- },
- "portableBuild": {
- "value": ""
}
},
"retentionRules": [
diff --git a/buildpipeline/DotNet-CoreClr-Trusted-Windows.json b/buildpipeline/DotNet-CoreClr-Trusted-Windows.json
index 457fe36861..6cf49de9a6 100644
--- a/buildpipeline/DotNet-CoreClr-Trusted-Windows.json
+++ b/buildpipeline/DotNet-CoreClr-Trusted-Windows.json
@@ -86,7 +86,7 @@
},
"inputs": {
"filename": "build.cmd",
- "arguments": "$(Architecture) $(PB_BuildType) skiptests skipbuildpackages toolset_dir C:\\tools\\clr -OfficialBuildId=$(OfficialBuildId) -Priority=$(Priority) -skiprestore -disableoss $(portableBuild) -- /p:\"ConfigurationGroup=Release\" /flp:\"v=diag\"",
+ "arguments": "$(Architecture) $(PB_BuildType) skiptests skipbuildpackages toolset_dir C:\\tools\\clr -OfficialBuildId=$(OfficialBuildId) -Priority=$(Priority) -skiprestore -disableoss -- /flp:\"v=diag\"",
"workingFolder": "",
"failOnStandardError": "false"
}
@@ -131,7 +131,7 @@
},
"inputs": {
"filename": "build-packages.cmd",
- "arguments": "-BuildArch=$(Architecture) -BuildType=$(PB_BuildType) $(portableBuild)",
+ "arguments": "-BuildArch=$(Architecture) -BuildType=$(PB_BuildType) -- /p:OfficialBuildId=$(OfficialBuildId)",
"workingFolder": "",
"failOnStandardError": "false"
}
@@ -155,46 +155,6 @@
}
},
{
- "enabled": false,
- "continueOnError": false,
- "alwaysRun": false,
- "displayName": "Publish symbols path: \\\\cpvsbuild\\drops\\DotNetCore\\$(Build.DefinitionName)\\$(Build.BuildNumber)\\symbols",
- "timeoutInMinutes": 0,
- "task": {
- "id": "0675668a-7bba-4ccb-901d-5ad6554ca653",
- "versionSpec": "1.*",
- "definitionType": "task"
- },
- "inputs": {
- "SymbolsPath": "\\\\cpvsbuild\\drops\\DotNetCore\\$(Build.DefinitionName)\\$(Build.BuildNumber)\\symbols",
- "SearchPattern": "bin\\Product\\*$(Architecture).$(PB_BuildType)\\**\\PDB\\*.pdb",
- "SymbolsFolder": "",
- "SkipIndexing": "false",
- "TreatNotIndexedAsWarning": "false",
- "SymbolsMaximumWaitTime": "",
- "SymbolsProduct": "",
- "SymbolsVersion": "",
- "SymbolsArtifactName": "Symbols_$(BuildConfiguration)"
- }
- },
- {
- "enabled": false,
- "continueOnError": false,
- "alwaysRun": false,
- "displayName": "Index Symbols on Symweb",
- "timeoutInMinutes": 0,
- "task": {
- "id": "af503aa3-9d06-44b6-a549-d063a544a5c5",
- "versionSpec": "1.*",
- "definitionType": "task"
- },
- "inputs": {
- "symbolStore": "\\\\cpvsbuild\\drops\\DotNetCore\\$(Build.DefinitionName)\\$(Build.BuildNumber)\\symbols",
- "contacts": "mawilkie",
- "project": "DDE"
- }
- },
- {
"enabled": true,
"continueOnError": false,
"alwaysRun": true,
@@ -324,9 +284,6 @@
},
"TeamName": {
"value": "DotNetCore"
- },
- "portableBuild": {
- "value": ""
}
},
"retentionRules": [
diff --git a/buildpipeline/DotNet-Trusted-Publish-Symbols.json b/buildpipeline/DotNet-Trusted-Publish-Symbols.json
new file mode 100644
index 0000000000..edbb8c0749
--- /dev/null
+++ b/buildpipeline/DotNet-Trusted-Publish-Symbols.json
@@ -0,0 +1,274 @@
+{
+ "build": [
+ {
+ "enabled": true,
+ "continueOnError": false,
+ "alwaysRun": false,
+ "displayName": "Set up pipeline-specific git repository",
+ "timeoutInMinutes": 0,
+ "task": {
+ "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
+ "versionSpec": "1.*",
+ "definitionType": "task"
+ },
+ "inputs": {
+ "scriptType": "inlineScript",
+ "scriptName": "",
+ "arguments": "-gitUrl $(PB_VstsRepoGitUrl) -root $(Pipeline.SourcesDirectory)",
+ "workingFolder": "",
+ "inlineScript": "param($gitUrl, $root)\n\nif (Test-Path $root)\n{\n Remove-Item -Recurse -Force $root\n}\ngit clone --no-checkout $gitUrl $root 2>&1 | Write-Host\ncd $root\ngit checkout $env:SourceVersion 2>&1 | Write-Host\n\nWrite-Host (\"##vso[task.setvariable variable=Pipeline.SourcesDirectory;]$root\")",
+ "failOnStandardError": "true"
+ }
+ },
+ {
+ "enabled": true,
+ "continueOnError": false,
+ "alwaysRun": false,
+ "displayName": "sync -ab",
+ "timeoutInMinutes": 0,
+ "task": {
+ "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
+ "versionSpec": "1.*",
+ "definitionType": "task"
+ },
+ "inputs": {
+ "scriptType": "inlineScript",
+ "scriptName": "",
+ "arguments": "$(PB_CloudDropAccountName) $(CloudDropAccessToken) $(Label)",
+ "workingFolder": "$(Pipeline.SourcesDirectory)",
+ "inlineScript": "param($account, $token, $container)\n.\\sync.cmd -ab -- /p:CloudDropAccountName=$account /p:CloudDropAccessToken=$token /p:ContainerName=$container",
+ "failOnStandardError": "false"
+ }
+ },
+ {
+ "enabled": true,
+ "continueOnError": false,
+ "alwaysRun": false,
+ "displayName": "Extract symbol packages; if release branch, archive",
+ "timeoutInMinutes": 0,
+ "task": {
+ "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
+ "versionSpec": "1.*",
+ "definitionType": "task"
+ },
+ "inputs": {
+ "scriptType": "inlineScript",
+ "scriptName": "",
+ "arguments": "-BuildType $(PB_BuildType) -SymPkgGlob $(PB_AzureContainerSymbolPackageGlob) -Branch $(SourceBranch)",
+ "workingFolder": "$(Pipeline.SourcesDirectory)",
+ "inlineScript": "param($BuildType, $SymPkgGlob, $Branch)\nif ($BuildType -ne \"Release\") { exit }\n$archive = $Branch.StartsWith(\"release/\")\n\n$target = \"UnzipSymbolPackagesForPublish\"\nif ($archive) { $target = \"SubmitSymbolsRequest\" }\n\n.\\run.cmd build -- `\n/t:$target `\n/p:SymbolPackagesToPublishGlob=$SymPkgGlob `\n/p:ArchiveSymbols=$archive `\n/v:D",
+ "failOnStandardError": "true"
+ }
+ },
+ {
+ "enabled": true,
+ "continueOnError": false,
+ "alwaysRun": false,
+ "displayName": "Publish Symbols to Artifact Services",
+ "timeoutInMinutes": 0,
+ "task": {
+ "id": "29827cd1-5c33-4ff0-a817-abd46970ffc4",
+ "versionSpec": "0.*",
+ "definitionType": "task"
+ },
+ "inputs": {
+ "symbolServiceURI": "https://microsoft.artifacts.visualstudio.com/DefaultCollection",
+ "requestName": "$(system.teamProject)/$(Build.BuildNumber)/$(Build.BuildId)",
+ "sourcePath": "$(Pipeline.SourcesDirectory)\\bin\\obj\\SymbolsRequest\\ExtractedPackages",
+ "assemblyPath": "",
+ "toLowerCase": "true",
+ "detailedLog": "true",
+ "expirationInDays": "30",
+ "usePat": "false"
+ }
+ }
+ ],
+ "options": [
+ {
+ "enabled": false,
+ "definition": {
+ "id": "5bc3cfb7-6b54-4a4b-b5d2-a3905949f8a6"
+ },
+ "inputs": {
+ "additionalFields": "{}"
+ }
+ },
+ {
+ "enabled": false,
+ "definition": {
+ "id": "7c555368-ca64-4199-add6-9ebaf0b0137d"
+ },
+ "inputs": {
+ "multipliers": "[]",
+ "parallel": "false",
+ "continueOnError": "true",
+ "additionalFields": "{}"
+ }
+ },
+ {
+ "enabled": false,
+ "definition": {
+ "id": "a9db38f9-9fdc-478c-b0f9-464221e58316"
+ },
+ "inputs": {
+ "workItemType": "234347",
+ "assignToRequestor": "true",
+ "additionalFields": "{}"
+ }
+ },
+ {
+ "enabled": false,
+ "definition": {
+ "id": "57578776-4c22-4526-aeb0-86b6da17ee9c"
+ },
+ "inputs": {
+ "additionalFields": "{}"
+ }
+ }
+ ],
+ "variables": {
+ "system.debug": {
+ "value": "false",
+ "allowOverride": true
+ },
+ "PB_BuildType": {
+ "value": "Release",
+ "allowOverride": true
+ },
+ "PB_CloudDropAccountName": {
+ "value": "dotnetbuildoutput",
+ "allowOverride": true
+ },
+ "CloudDropAccessToken": {
+ "value": null,
+ "allowOverride": true,
+ "isSecret": true
+ },
+ "OfficialBuildId": {
+ "value": "$(Build.BuildNumber)",
+ "allowOverride": true
+ },
+ "Label": {
+ "value": "$(Build.BuildNumber)",
+ "allowOverride": true
+ },
+ "Pipeline.SourcesDirectory": {
+ "value": "$(Build.BinariesDirectory)\\pipelineRepository"
+ },
+ "PB_VstsAccountName": {
+ "value": "dn-bot"
+ },
+ "PB_VstsRepositoryName": {
+ "value": "DotNet-CoreCLR-Trusted",
+ "allowOverride": true
+ },
+ "PB_VstsRepoGitUrl": {
+ "value": "https://$(PB_VstsAccountName):$(VstsRepoPat)@devdiv.visualstudio.com/DevDiv/_git/$(PB_VstsRepositoryName)/"
+ },
+ "VstsRepoPat": {
+ "value": null,
+ "isSecret": true
+ },
+ "SourceVersion": {
+ "value": "master",
+ "allowOverride": true
+ },
+ "SourceBranch": {
+ "value": "master",
+ "allowOverride": true
+ },
+ "AzureContainerSymbolPackageGlob": {
+ "value": "symbolpkg\\*.nupkg",
+ "allowOverride": true
+ },
+ "PB_AzureContainerSymbolPackageGlob": {
+ "value": "$(Pipeline.SourcesDirectory)\\packages\\AzureTransfer\\$(PB_BuildType)\\$(AzureContainerSymbolPackageGlob)",
+ "allowOverride": true
+ },
+ "PB_DotNetCoreShareDir": {
+ "value": "passed-by-pipebuild",
+ "allowOverride": true
+ },
+ "SymbolsProject": {
+ "value": "CLR"
+ },
+ "SymbolsStatusMail": {
+ "value": "dagood;mawilkie"
+ },
+ "SymbolsUserName": {
+ "value": "dlab"
+ },
+ "SymbolsRelease": {
+ "value": "rtm"
+ },
+ "SymbolsProductGroup": {
+ "value": "Visual_Studio"
+ },
+ "SymbolsProductName": {
+ "value": "dotnetcore"
+ },
+ "SymbolPublishDestinationDir": {
+ "value": "$(PB_DotNetCoreShareDir)\\$(PB_VstsRepositoryName)\\$(Label)\\"
+ }
+ },
+ "retentionRules": [
+ {
+ "branches": [
+ "+refs/heads/*"
+ ],
+ "artifacts": [],
+ "artifactTypesToDelete": [
+ "FilePath",
+ "SymbolStore"
+ ],
+ "daysToKeep": 10,
+ "minimumToKeep": 1,
+ "deleteBuildRecord": true,
+ "deleteTestResults": true
+ }
+ ],
+ "buildNumberFormat": "$(date:yyyyMMdd)$(rev:-rr)",
+ "jobAuthorizationScope": "projectCollection",
+ "jobTimeoutInMinutes": 180,
+ "jobCancelTimeoutInMinutes": 5,
+ "repository": {
+ "properties": {
+ "labelSources": "0",
+ "reportBuildStatus": "false",
+ "fetchDepth": "0",
+ "gitLfsSupport": "false",
+ "skipSyncSource": "false",
+ "cleanOptions": "0",
+ "labelSourcesFormat": "$(build.buildNumber)"
+ },
+ "id": "0a2b2664-c1be-429c-9b40-8a24dee27a4a",
+ "type": "TfsGit",
+ "name": "DotNet-BuildPipeline",
+ "url": "https://devdiv.visualstudio.com/DevDiv/_git/DotNet-BuildPipeline",
+ "defaultBranch": "refs/heads/master",
+ "clean": "true",
+ "checkoutSubmodules": false
+ },
+ "processParameters": {},
+ "quality": "definition",
+ "queue": {
+ "id": 36,
+ "name": "DotNet-Build",
+ "pool": {
+ "id": 39,
+ "name": "DotNet-Build"
+ }
+ },
+ "id": -1,
+ "name": "DotNet-Trusted-Publish-Symbols",
+ "path": "\\",
+ "type": "build",
+ "project": {
+ "id": "0bdbc590-a062-4c3f-b0f6-9383f67865ee",
+ "name": "DevDiv",
+ "description": "Visual Studio and DevDiv team project for git source code repositories. Work items will be added for Adams, Dev14 work items are tracked in vstfdevdiv. ",
+ "url": "https://devdiv.visualstudio.com/DefaultCollection/_apis/projects/0bdbc590-a062-4c3f-b0f6-9383f67865ee",
+ "state": "wellFormed",
+ "revision": 418097642
+ }
+}
diff --git a/buildpipeline/DotNet-Trusted-Publish.json b/buildpipeline/DotNet-Trusted-Publish.json
index 80e9f65b7e..fc4d9d0217 100644
--- a/buildpipeline/DotNet-Trusted-Publish.json
+++ b/buildpipeline/DotNet-Trusted-Publish.json
@@ -172,7 +172,7 @@
"scriptType": "inlineScript",
"scriptName": "",
"arguments": "$(MyGetApiKey) $(ConfigurationGroup)",
- "inlineScript": "param($ApiKey, $ConfigurationGroup)\nif ($ConfigurationGroup -ne \"Release\") { exit }\n& $env:CustomNuGetPath push $env:Build_StagingDirectory\\IndexedSymbolPackages\\*.nupkg $ApiKey -Source $env:MyGetFeedUrl -Timeout 3600",
+ "inlineScript": "param($ApiKey, $ConfigurationGroup)\nif ($ConfigurationGroup -ne \"Release\") { exit }\nif ($env:SourceBranch.StartsWith(\"release/\")) { exit }\n& $env:CustomNuGetPath push $env:Build_StagingDirectory\\IndexedSymbolPackages\\*.nupkg $ApiKey -Source $env:MyGetFeedUrl -Timeout 3600",
"workingFolder": "",
"failOnStandardError": "true"
}
@@ -277,7 +277,7 @@
"detailedLog": "false",
"usePat": "false",
"retentionDays": "",
- "dropMetadataContainerName": "DropMetadata"
+ "dropMetadataContainerName": "Drop-OfficialBuildId"
}
},
{
@@ -300,26 +300,7 @@
"detailedLog": "false",
"usePat": "false",
"retentionDays": "",
- "dropMetadataContainerName": "DropMetadata"
- }
- },
- {
- "enabled": true,
- "continueOnError": false,
- "alwaysRun": true,
- "displayName": "Copy Publish Artifact: PublishLogs",
- "timeoutInMinutes": 0,
- "task": {
- "id": "1d341bb0-2106-458c-8422-d00bcea6512a",
- "versionSpec": "1.*",
- "definitionType": "task"
- },
- "inputs": {
- "CopyRoot": "",
- "Contents": "$(Pipeline.SourcesDirectory)\\*.log",
- "ArtifactName": "PublishLogs",
- "ArtifactType": "Container",
- "TargetPath": "\\\\my\\share\\$(Build.DefinitionName)\\$(Build.BuildNumber)"
+ "dropMetadataContainerName": "Drop-BuildNumber"
}
},
{
diff --git a/buildpipeline/Dotnet-CoreClr-Trusted-BuildTests.json b/buildpipeline/Dotnet-CoreClr-Trusted-BuildTests.json
index 3defd105e7..f7b795c7f1 100644
--- a/buildpipeline/Dotnet-CoreClr-Trusted-BuildTests.json
+++ b/buildpipeline/Dotnet-CoreClr-Trusted-BuildTests.json
@@ -41,7 +41,7 @@
"enabled": true,
"continueOnError": true,
"alwaysRun": false,
- "displayName": "Run sync.cmd",
+ "displayName": "Sync test native binaries",
"timeoutInMinutes": 0,
"task": {
"id": "d9bafed4-0b18-4f58-968d-86655b4d2ce9",
@@ -59,6 +59,60 @@
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
+ "displayName": "Sync packages",
+ "timeoutInMinutes": 0,
+ "task": {
+ "id": "d9bafed4-0b18-4f58-968d-86655b4d2ce9",
+ "versionSpec": "1.*",
+ "definitionType": "task"
+ },
+ "inputs": {
+ "filename": "sync.cmd",
+ "arguments": "-ab -AzureAccount=$(CloudDropAccountName) -AzureToken=$(CloudDropAccessToken) -Container=$(Label) -BlobNamePrefix=$(PB_BuildType)/pkg/Microsoft",
+ "workingFolder": "",
+ "failOnStandardError": "false"
+ }
+ },
+ {
+ "enabled": true,
+ "continueOnError": false,
+ "alwaysRun": false,
+ "displayName": "Sync runtime packages",
+ "timeoutInMinutes": 0,
+ "task": {
+ "id": "d9bafed4-0b18-4f58-968d-86655b4d2ce9",
+ "versionSpec": "1.*",
+ "definitionType": "task"
+ },
+ "inputs": {
+ "filename": "sync.cmd",
+ "arguments": "-ab -AzureAccount=$(CloudDropAccountName) -AzureToken=$(CloudDropAccessToken) -Container=$(Label) -BlobNamePrefix=$(PB_BuildType)/pkg/runtime",
+ "workingFolder": "",
+ "failOnStandardError": "false"
+ }
+ },
+ {
+ "enabled": true,
+ "continueOnError": false,
+ "alwaysRun": false,
+ "displayName": "Generate version props file",
+ "timeoutInMinutes": 0,
+ "task": {
+ "id": "d9bafed4-0b18-4f58-968d-86655b4d2ce9",
+ "versionSpec": "1.*",
+ "definitionType": "task"
+ },
+ "inputs": {
+ "filename": "msbuild",
+ "arguments": "createVersionFile.proj /p:OfficialBuildId=$(OfficialBuildId)",
+ "workingFolder": "src",
+ "failOnStandardError": "false"
+ }
+ },
+ {
+ "enabled": true,
+ "continueOnError": false,
+ "alwaysRun": false,
"displayName": "Run build-test.cmd",
"timeoutInMinutes": 0,
"task": {
@@ -68,7 +122,7 @@
},
"inputs": {
"filename": "build-test.cmd",
- "arguments": "$(PB_BuildType) $(Architecture) buildagainstpackages runtimeid $(Rid) $(TargetsNonWindowsArg)$(CrossgenArg)-OfficialBuildId=$(OfficialBuildId) -Priority=$(Priority)",
+ "arguments": "$(PB_BuildType) $(Architecture) buildagainstpackages runtimeid $(Rid) $(TargetsNonWindowsArg)$(CrossgenArg)-OfficialBuildId=$(OfficialBuildId) -OverwriteCoreClrPackageVersion -Priority=$(Priority)",
"workingFolder": "",
"failOnStandardError": "false"
}
@@ -86,7 +140,7 @@
},
"inputs": {
"filename": "msbuild",
- "arguments": "helixpublish.proj /p:CloudDropAccessToken=$(CloudDropAccessToken) /p:CloudDropAccountName=$(CloudDropAccountName) /p:ContainerName=$(PB_ContainerName) /p:Platform=$(Architecture) /p:BuildType=$(PB_BuildType) /p:CloudResultsAccountName=$(CloudResultsAccountName) /p:CloudResultsAccessToken=$(CloudResultsAccessToken) /p:TargetsWindows=$(TargetsWindows) /p:OverwriteOnUpload=true /p:Rid=$(Rid) /p:TargetQueues=\"$(TargetQueues)\" /p:TestProduct=$(TestProduct) /p:Branch=$(HelixBranch) /p:HelixApiAccessKey=$(HelixApiAccessKey) /p:HelixApiEndpoint=$(HelixApiEndpoint) /p:FilterToOSGroup=$(FilterToOSGroup) /p:FilterToTestTFM=$(FilterToTestTFM) /p:TimeoutInSeconds=1800 /p:HelixJobType=$(HelixJobType) /fileloggerparameters:Verbosity=diag;LogFile=helix.log",
+ "arguments": "helixpublish.proj /p:CloudDropAccessToken=$(CloudDropAccessToken) /p:CloudDropAccountName=$(CloudDropAccountName) /p:ContainerName=$(PB_ContainerName) /p:Platform=$(Architecture) /p:BuildType=$(PB_BuildType) /p:CloudResultsAccountName=$(CloudResultsAccountName) /p:CloudResultsAccessToken=$(CloudResultsAccessToken) /p:TargetsWindows=$(TargetsWindows) /p:OverwriteOnUpload=true /p:Rid=$(Rid) /p:TargetQueues=\"$(TargetQueues)\" /p:TestProduct=$(TestProduct) /p:Branch=$(SourceBranch) /p:HelixApiAccessKey=$(HelixApiAccessKey) /p:HelixApiEndpoint=$(HelixApiEndpoint) /p:FilterToOSGroup=$(FilterToOSGroup) /p:FilterToTestTFM=$(FilterToTestTFM) /p:TimeoutInSeconds=1800 /p:HelixJobType=$(HelixJobType) /fileloggerparameters:Verbosity=diag;LogFile=helix.log",
"workingFolder": "tests",
"failOnStandardError": "false"
}
@@ -204,8 +258,8 @@
"TestProduct": {
"value": "coreclr"
},
- "HelixBranch": {
- "value": "master"
+ "SourceBranch": {
+ "value": "release/2.0.0"
},
"HelixApiAccessKey": {
"value": null,
@@ -294,4 +348,4 @@
"state": "wellFormed",
"revision": 418097633
}
-} \ No newline at end of file
+}
diff --git a/buildpipeline/pipelines.json b/buildpipeline/pipelines.json
index 5714717f1b..c5e98ebcdc 100644
--- a/buildpipeline/pipelines.json
+++ b/buildpipeline/pipelines.json
@@ -3,7 +3,8 @@
"Definitions": {
"Path": ".",
"Type": "VSTS",
- "BaseUrl": "https://devdiv.visualstudio.com/DefaultCollection"
+ "BaseUrl": "https://devdiv.visualstudio.com/DefaultCollection",
+ "SkipBranchAndVersionOverrides": "false"
},
"DefinitionGroups": [
{
@@ -12,99 +13,7 @@
{
"Name": "DotNet-CoreClr-Trusted-Linux",
"Parameters": {
- "DockerTag": "debian82_prereqs_2",
- "Rid": "debian.8"
- },
- "ReportingParameters": {
- "OperatingSystem": "Debian 8.2",
- "Type": "build/product/",
- "Architecture": "x64",
- "PB_BuildType": null
- }
- },
- {
- "Name": "DotNet-CoreClr-Trusted-Linux",
- "Parameters": {
- "DockerTag": "rhel7_prereqs_2",
- "Rid": "rhel.7"
- },
- "ReportingParameters": {
- "OperatingSystem": "RedHat 7",
- "Type": "build/product/",
- "Architecture": "x64",
- "PB_BuildType": null
- }
- },
- {
- "Name": "DotNet-CoreClr-Trusted-Linux",
- "Parameters": {
- "DockerTag": "ubuntu1404_prereqs_v3",
- "Rid": "ubuntu.14.04"
- },
- "ReportingParameters": {
- "OperatingSystem": "Ubuntu 14.04",
- "Type": "build/product/",
- "Architecture": "x64",
- "PB_BuildType": null
- }
- },
- {
- "Name": "DotNet-CoreClr-Trusted-Linux",
- "Parameters": {
- "DockerTag": "ubuntu1604_prereqs",
- "Rid": "ubuntu.16.04"
- },
- "ReportingParameters": {
- "OperatingSystem": "Ubuntu 16.04",
- "Type": "build/product/",
- "Architecture": "x64",
- "PB_BuildType": null
- }
- },
- {
- "Name": "DotNet-CoreClr-Trusted-Linux",
- "Parameters": {
- "DockerTag": "ubuntu1610_prereqs_v2",
- "Rid": "ubuntu.16.10"
- },
- "ReportingParameters": {
- "OperatingSystem": "Ubuntu 16.10",
- "Type": "build/product/",
- "Architecture": "x64",
- "PB_BuildType": null
- }
- },
- {
- "Name": "DotNet-CoreClr-Trusted-Linux",
- "Parameters": {
- "DockerTag": "fedora24_prereqs_v4",
- "Rid": "fedora.24"
- },
- "ReportingParameters": {
- "OperatingSystem": "Fedora 24",
- "Type": "build/product/",
- "Architecture": "x64",
- "PB_BuildType": null
- }
- },
- {
- "Name": "DotNet-CoreClr-Trusted-Linux",
- "Parameters": {
- "DockerTag": "opensuse421_prereqs_v3",
- "Rid": "opensuse.42.1"
- },
- "ReportingParameters": {
- "OperatingSystem": "openSUSE 42.1",
- "Type": "build/product/",
- "Architecture": "x64",
- "PB_BuildType": null
- }
- },
- {
- "Name": "DotNet-CoreClr-Trusted-Linux",
- "Parameters": {
"DockerTag": "rhel7_prereqs_2",
- "portableBuild": "-portable",
"Rid": "linux"
},
"ReportingParameters": {
@@ -117,20 +26,7 @@
{
"Name": "DotNet-CoreClr-Trusted-Mac",
"Parameters": {
- "Rid": "osx.10.12"
- },
- "ReportingParameters": {
- "OperatingSystem": "OSX 10.12",
- "Type": "build/product/",
- "Architecture": "x64",
- "PB_BuildType": null
- }
- },
- {
- "Name": "DotNet-CoreClr-Trusted-Mac",
- "Parameters": {
- "Rid": "osx",
- "portableBuild": "-portable"
+ "Rid": "osx"
},
"ReportingParameters": {
"OperatingSystem": "OSX",
@@ -148,19 +44,6 @@
"ReportingParameters": {
"OperatingSystem": "Windows",
"Type": "build/product/",
- "Architecture": "x64",
- "PB_BuildType": null
- }
- },
- {
- "Name": "DotNet-CoreClr-Trusted-Windows",
- "Parameters": {
- "Architecture": "x64",
- "portableBuild": "-portable"
- },
- "ReportingParameters": {
- "OperatingSystem": "Windows",
- "Type": "build/product/",
"SubType" : "PortableBuild",
"Architecture": "x64",
"PB_BuildType": null
@@ -174,19 +57,6 @@
"ReportingParameters": {
"OperatingSystem": "Windows",
"Type": "build/product/",
- "Architecture": "arm64",
- "PB_BuildType": null
- }
- },
- {
- "Name": "DotNet-CoreClr-Trusted-Windows",
- "Parameters": {
- "Architecture": "arm64",
- "portableBuild": "-portable"
- },
- "ReportingParameters": {
- "OperatingSystem": "Windows",
- "Type": "build/product/",
"SubType" : "PortableBuild",
"Architecture": "arm64",
"PB_BuildType": null
@@ -200,19 +70,6 @@
"ReportingParameters": {
"OperatingSystem": "Windows",
"Type": "build/product/",
- "Architecture": "arm",
- "PB_BuildType": null
- }
- },
- {
- "Name": "DotNet-CoreClr-Trusted-Windows",
- "Parameters": {
- "Architecture": "arm",
- "portableBuild": "-portable"
- },
- "ReportingParameters": {
- "OperatingSystem": "Windows",
- "Type": "build/product/",
"SubType" : "PortableBuild",
"Architecture": "arm",
"PB_BuildType": null
@@ -220,17 +77,8 @@
},
{
"Name": "DotNet-CoreClr-Trusted-Windows-x86",
- "ReportingParameters": {
- "OperatingSystem": "Windows",
- "Type": "build/product/",
- "Architecture": "x86",
- "PB_BuildType": null
- }
- },
- {
- "Name": "DotNet-CoreClr-Trusted-Windows-x86",
"Parameters": {
- "portableBuild": "-portable"
+ "Architecture": "x86"
},
"ReportingParameters": {
"OperatingSystem": "Windows",
@@ -250,23 +98,7 @@
"Parameters": {
"DockerTag": "ubuntu-14.04-cross-0cd4667-20172211042239",
"Architecture": "arm",
- "Rid": "ubuntu.14.04"
- },
- "ReportingParameters": {
- "OperatingSystem": "Ubuntu 14.04",
- "SubType": "CrossBuild",
- "Type": "build/product/",
- "Architecture": "arm",
- "PB_BuildType": null
- }
- },
- {
- "Name": "DotNet-CoreClr-Trusted-Linux-Crossbuild",
- "Parameters": {
- "DockerTag": "ubuntu-14.04-cross-0cd4667-20172211042239",
- "Architecture": "arm",
- "portableBuild": "-portable",
- "Rid": "ubuntu.14.04"
+ "Rid": "linux"
},
"ReportingParameters": {
"OperatingSystem": "Linux",
@@ -275,21 +107,6 @@
"Architecture": "arm",
"PB_BuildType": null
}
- },
- {
- "Name": "DotNet-CoreClr-Trusted-Linux-Crossbuild",
- "Parameters": {
- "DockerTag": "ubuntu-16.04-cross-ef0ac75-20175511035548",
- "Architecture": "arm",
- "Rid": "ubuntu.16.04"
- },
- "ReportingParameters": {
- "OperatingSystem": "Ubuntu 16.04",
- "SubType": "CrossBuild",
- "Type": "build/product/",
- "Architecture": "arm",
- "PB_BuildType": null
- }
}
]
}
@@ -396,6 +213,7 @@
"Definitions": [
{
"Name": "DotNet-Trusted-Publish",
+ "SkipBranchAndVersionOverrides": "true",
"Parameters": {
"VstsRepositoryName": "DotNet-CoreCLR-Trusted",
"GitHubRepositoryName": "coreclr",
@@ -425,6 +243,7 @@
"Definitions": [
{
"Name": "DotNet-Trusted-Publish",
+ "SkipBranchAndVersionOverrides": "true",
"Parameters": {
"VstsRepositoryName": "DotNet-CoreCLR-Trusted",
"GitHubRepositoryName": "coreclr"
@@ -442,6 +261,32 @@
]
},
{
+ "Name": "Publish Symbols - Release",
+ "Parameters": {
+ "TreatWarningsAsErrors": "false"
+ },
+ "BuildParameters": {
+ "PB_BuildType": "Release"
+ },
+ "Definitions": [
+ {
+ "Name": "DotNet-Trusted-Publish-Symbols",
+ "SkipBranchAndVersionOverrides": "true",
+ "Parameters": {
+ },
+ "ReportingParameters": {
+ "TaskName": "Symbol Publish",
+ "Type": "build/publish/",
+ "ConfigurationGroup": "Release - Publish Symbols"
+ }
+ }
+ ],
+ "DependsOn": [
+ "Trusted-All-Release",
+ "Trusted-Crossbuild-Release"
+ ]
+ },
+ {
"Name": "Publish Packages to Drop - Checked",
"Parameters": {
"TreatWarningsAsErrors": "false"
@@ -452,6 +297,7 @@
"Definitions": [
{
"Name": "DotNet-Trusted-Publish",
+ "SkipBranchAndVersionOverrides": "true",
"Parameters": {
"VstsRepositoryName": "DotNet-CoreCLR-Trusted",
"GitHubRepositoryName": "coreclr"
diff --git a/clr.coreclr.props b/clr.coreclr.props
index 5251eab780..059fb3a597 100644
--- a/clr.coreclr.props
+++ b/clr.coreclr.props
@@ -47,7 +47,7 @@
<FeatureRandomizedStringHashing>true</FeatureRandomizedStringHashing>
<!-- The rejit feature is available only on supported architectures (x86 & x64) -->
<FeatureReJIT Condition="('$(TargetArch)' == 'i386') or ('$(TargetArch)' == 'amd64')">true</FeatureReJIT>
- <FeatureManagedEtw>true</FeatureManagedEtw>
+ <FeatureManagedEtw>false</FeatureManagedEtw>
<FeatureManagedEtwChannels>true</FeatureManagedEtwChannels>
<BinderDebugLog Condition="'$(_BuildType)'=='dbg'">true</BinderDebugLog>
<FeatureAppX>true</FeatureAppX>
@@ -76,15 +76,20 @@
<FeatureCominterop>false</FeatureCominterop>
<FeatureCominteropUnmanagedActivation>false</FeatureCominteropUnmanagedActivation>
<FeatureCominteropWinRTManagedActivation>false</FeatureCominteropWinRTManagedActivation>
- <FeatureManagedEtw>false</FeatureManagedEtw>
<FeatureCoreFxGlobalization>true</FeatureCoreFxGlobalization>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetsWindows)' == 'true'">
<FeatureArrayStubAsIL Condition="('$(TargetArch)' == 'arm') or ('$(TargetArch)' == 'amd64') or ('$(TargetArch)' == 'arm64')">true</FeatureArrayStubAsIL>
+ <FeatureManagedEtw>true</FeatureManagedEtw>
<FeatureStubsAsIL Condition="'$(TargetArch)' == 'arm64'">true</FeatureStubsAsIL>
<FeatureUseLcid>true</FeatureUseLcid>
<FeatureImplicitLongPath>true</FeatureImplicitLongPath>
</PropertyGroup>
+
+ <PropertyGroup Condition="'$(TargetsLinux)' == 'true'">
+ <FeatureManagedEtw>true</FeatureManagedEtw>
+ <FeaturePerfTracing>true</FeaturePerfTracing>
+ </PropertyGroup>
</Project>
diff --git a/clr.defines.targets b/clr.defines.targets
index 2f97c8d681..df6a409f97 100644
--- a/clr.defines.targets
+++ b/clr.defines.targets
@@ -18,9 +18,9 @@
<DefineConstants Condition="'$(FeatureMacl)' == 'true'">$(DefineConstants);FEATURE_MACL</DefineConstants>
<DefineConstants Condition="'$(FeatureManagedEtw)' == 'true'">$(DefineConstants);FEATURE_MANAGED_ETW</DefineConstants>
<DefineConstants Condition="'$(FeatureManagedEtwChannels)' == 'true'">$(DefineConstants);FEATURE_MANAGED_ETW_CHANNELS</DefineConstants>
- <DefineConstants Condition="'$(FeatureNongenericCollections)' == 'true'">$(DefineConstants);FEATURE_NONGENERIC_COLLECTIONS</DefineConstants>
<DefineConstants Condition="'$(FeaturePal)' == 'true'">$(DefineConstants);FEATURE_PAL</DefineConstants>
<DefineConstants Condition="'$(FeaturePathCompat)' == 'true'">$(DefineConstants);FEATURE_PATHCOMPAT</DefineConstants>
+ <DefineConstants Condition="'$(FeaturePerfTracing)' == 'true'">$(DefineConstants);FEATURE_PERFTRACING</DefineConstants>
<DefineConstants Condition="'$(FeatureXplatEventSource)' == 'true'">$(DefineConstants);FEATURE_EVENTSOURCE_XPLAT</DefineConstants>
<DefineConstants Condition="'$(FeatureRandomizedStringHashing)' == 'true'">$(DefineConstants);FEATURE_RANDOMIZED_STRING_HASHING</DefineConstants>
<DefineConstants Condition="'$(FeatureSortTables)' == 'true'">$(DefineConstants);FEATURE_SORT_TABLES</DefineConstants>
diff --git a/clrdefinitions.cmake b/clrdefinitions.cmake
index 838be56f62..6db2b24483 100644
--- a/clrdefinitions.cmake
+++ b/clrdefinitions.cmake
@@ -1,9 +1,3 @@
-if(WIN32 AND CLR_CMAKE_TARGET_ARCH_I386 AND BUILD_JIT32)
- set(CLR_BUILD_JIT32 1)
-else()
- set(CLR_BUILD_JIT32 0)
-endif()
-
include(clrfeatures.cmake)
if (CLR_CMAKE_TARGET_ARCH_AMD64)
@@ -117,7 +111,9 @@ endif(FEATURE_DBGIPC)
if(FEATURE_EVENT_TRACE)
add_definitions(-DFEATURE_EVENT_TRACE=1)
endif(FEATURE_EVENT_TRACE)
-add_definitions(-DFEATURE_PERFTRACING)
+if(CLR_CMAKE_PLATFORM_LINUX)
+ add_definitions(-DFEATURE_PERFTRACING)
+endif(CLR_CMAKE_PLATFORM_LINUX)
if(CLR_CMAKE_PLATFORM_UNIX)
add_definitions(-DFEATURE_EVENTSOURCE_XPLAT=1)
endif(CLR_CMAKE_PLATFORM_UNIX)
@@ -139,15 +135,18 @@ if(FEATURE_INTERPRETER)
endif(FEATURE_INTERPRETER)
add_definitions(-DFEATURE_ISYM_READER)
add_definitions(-DFEATURE_LOADER_OPTIMIZATION)
-if (NOT CLR_CMAKE_PLATFORM_UNIX)
+if (CLR_CMAKE_PLATFORM_LINUX OR WIN32)
add_definitions(-DFEATURE_MANAGED_ETW)
-endif(NOT CLR_CMAKE_PLATFORM_UNIX)
+endif(CLR_CMAKE_PLATFORM_LINUX OR WIN32)
add_definitions(-DFEATURE_MANAGED_ETW_CHANNELS)
if(FEATURE_MERGE_JIT_AND_ENGINE)
add_definitions(-DFEATURE_MERGE_JIT_AND_ENGINE)
endif(FEATURE_MERGE_JIT_AND_ENGINE)
add_definitions(-DFEATURE_MULTICOREJIT)
+if (FEATURE_NI_BIND_FALLBACK)
+ add_definitions(-DFEATURE_NI_BIND_FALLBACK)
+endif(FEATURE_NI_BIND_FALLBACK)
if(CLR_CMAKE_PLATFORM_UNIX)
add_definitions(-DFEATURE_PAL)
add_definitions(-DFEATURE_PAL_SXS)
@@ -183,10 +182,10 @@ if(CLR_CMAKE_PLATFORM_UNIX_AMD64)
add_definitions(-DFEATURE_UNIX_AMD64_STRUCT_PASSING)
endif (CLR_CMAKE_PLATFORM_UNIX_AMD64)
add_definitions(-DFEATURE_USE_ASM_GC_WRITE_BARRIERS)
-if(CLR_CMAKE_PLATFORM_ARCH_AMD64 AND NOT WIN32)
+if((CLR_CMAKE_PLATFORM_ARCH_AMD64 OR CLR_CMAKE_PLATFORM_ARCH_ARM64) AND NOT WIN32)
add_definitions(-DFEATURE_MANUALLY_MANAGED_CARD_BUNDLES)
add_definitions(-DFEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP)
-endif(CLR_CMAKE_PLATFORM_ARCH_AMD64 AND NOT WIN32)
+endif((CLR_CMAKE_PLATFORM_ARCH_AMD64 OR CLR_CMAKE_PLATFORM_ARCH_ARM64) AND NOT WIN32)
if(WIN32)
add_definitions(-DFEATURE_VERSIONING_LOG)
endif(WIN32)
diff --git a/clrfeatures.cmake b/clrfeatures.cmake
index 9991b60ed7..f047c91f7a 100644
--- a/clrfeatures.cmake
+++ b/clrfeatures.cmake
@@ -25,3 +25,11 @@ endif(NOT DEFINED FEATURE_DBGIPC)
if(NOT DEFINED FEATURE_INTERPRETER)
set(FEATURE_INTERPRETER 0)
endif(NOT DEFINED FEATURE_INTERPRETER)
+
+if(NOT WIN32)
+ if(NOT DEFINED FEATURE_NI_BIND_FALLBACK)
+ if(NOT CLR_CMAKE_TARGET_ARCH_AMD64 AND NOT CLR_CMAKE_TARGET_ARCH_ARM64)
+ set(FEATURE_NI_BIND_FALLBACK 1)
+ endif()
+ endif(NOT DEFINED FEATURE_NI_BIND_FALLBACK)
+endif(NOT WIN32)
diff --git a/config.json b/config.json
index c975171055..5011de3e7f 100644
--- a/config.json
+++ b/config.json
@@ -30,6 +30,12 @@
"values": [],
"defaultValue": ""
},
+ "__BlobNamePrefix": {
+ "description": "Blob Prefix for Azure download.",
+ "valueType": "property",
+ "values": [],
+ "defaultValue": ""
+ },
"MsBuildFileLogging": {
"description": "MsBuild logging options.",
"valueType": "passThrough",
@@ -174,6 +180,12 @@
"values": [],
"defaultValue": ""
},
+ "OverwriteCoreClrPackageVersion": {
+ "description": "Sets the property specifying to overwrite CoreClr Package version using OfficialBuildId",
+ "valueType": "property",
+ "values": [ true, false ],
+ "defaultValue": true
+ },
"OfficialBuildId": {
"description": "Official Build Id.",
"valueType": "property",
@@ -225,8 +237,8 @@
"PortableBuild": {
"description": "Indicates if this is a portable build.",
"valueType": "property",
- "values": [ "0", "1"],
- "defaultValue": "0"
+ "values": [ "false", "true"],
+ "defaultValue": "true"
},
"Rebuild": {
"description": "Specifies rebuild target.",
@@ -270,12 +282,6 @@
"values": [],
"defaultValue": ""
},
- "IlasmRoundTrip": {
- "description": "Sets ilasm round trip property.",
- "valueType": "property",
- "values": [ true, false ],
- "defaultValue": true
- },
"CreateTestOverlay": {
"description": "Runs CreateTestOverlay target.",
"valueType": "target",
@@ -354,12 +360,6 @@
"values": [ "debian.8-x64", "fedora.24-x64", "fedora.25-x64", "opensuse.42.1-x64", "osx.10.12-x64", "rhel.7-x64", "ubuntu.14.04-x64", "ubuntu.16.04-x64", "ubuntu.16.10-x64" ],
"defaultValue": "${__RuntimeId}"
},
- "UpdateDependencies": {
- "description": "MsBuild target that updates project.json dependencies.",
- "valueType": "target",
- "values": [],
- "defaultValue": ""
- },
"BatchRestorePackages": {
"description": "MsBuild target that restores the packages.",
"valueType": "target",
@@ -474,12 +474,6 @@
"RestoreDuringBuild": false
}
},
- "portable": {
- "description": "Triggers a portable build.",
- "settings": {
- "PortableBuild": "1"
- }
- },
"BuildTarget": {
"description": "Runs the build target.",
"settings": {
@@ -495,6 +489,7 @@
"MsBuildErr": "default",
"MsBuildEventLogging": "default",
"RestoreDefaultOptimizationDataPackage": "false",
+ "PortableBuild": "true",
"UsePartialNGENOptimization": "false"
}
}
@@ -548,6 +543,12 @@
"__Container": "default"
}
},
+ "blobNamePrefix": {
+ "description": "Blob Prefix to download from in Azure container.",
+ "settings": {
+ "__BlobNamePrefix": "default"
+ }
+ },
"runtimeId": {
"description": "Runtime ID of the binaries in the specified container.",
"settings": {
@@ -647,12 +648,6 @@
"__BuildArch": "default"
}
},
- "portable": {
- "description": "Triggers a portable build.",
- "settings": {
- "PortableBuild": "1"
- }
- },
"buildType": {
"description": "Specifies configuration to publish, can be Release, Debug or Checked.",
"settings": {
@@ -672,6 +667,7 @@
"__BuildOS": "default",
"MsBuildFileLogging": "/flp:v=detailed;Append;LogFile=build-packages.log",
"MsBuildEventLogging": "default",
+ "PortableBuild": "true",
"Project": "src/.nuget/packages.builds"
}
}
diff --git a/cross/armel/tizen-fetch.sh b/cross/armel/tizen-fetch.sh
index 1252199481..a0fa72b7d7 100755
--- a/cross/armel/tizen-fetch.sh
+++ b/cross/armel/tizen-fetch.sh
@@ -51,7 +51,7 @@ if [ ! -d $TMPDIR ]; then
mkdir -p $TMPDIR
fi
-TIZEN_URL=http://download.tizen.org/releases/weekly/tizen
+TIZEN_URL=http://download.tizen.org/releases/daily/tizen
BUILD_XML=build.xml
REPOMD_XML=repomd.xml
PRIMARY_XML=primary.xml
@@ -120,19 +120,21 @@ fetch_tizen_pkgs_init()
fetch_tizen_pkgs()
{
- PROFILE=$1
- PACKAGE_XPATH_TPL='string(//*[local-name()="metadata"]/*[local-name()="package"][*[local-name()="name"][text()="_PKG_"]]/*[local-name()="location"]/@href)'
+ ARCH=$1
+ PACKAGE_XPATH_TPL='string(//*[local-name()="metadata"]/*[local-name()="package"][*[local-name()="name"][text()="_PKG_"]][*[local-name()="arch"][text()="_ARCH_"]]/*[local-name()="location"]/@href)'
- PACKAGE_CHECKSUM_XPATH_TPL='string(//*[local-name()="metadata"]/*[local-name()="package"][*[local-name()="name"][text()="_PKG_"]]/*[local-name()="checksum"]/text())'
+ PACKAGE_CHECKSUM_XPATH_TPL='string(//*[local-name()="metadata"]/*[local-name()="package"][*[local-name()="name"][text()="_PKG_"]][*[local-name()="arch"][text()="_ARCH_"]]/*[local-name()="checksum"]/text())'
for pkg in ${@:2}
do
Inform "Fetching... $pkg"
XPATH=${PACKAGE_XPATH_TPL/_PKG_/$pkg}
+ XPATH=${XPATH/_ARCH_/$ARCH}
Xpath_get $XPATH $TMP_PRIMARY
PKG_PATH=$XPATH_RESULT
XPATH=${PACKAGE_CHECKSUM_XPATH_TPL/_PKG_/$pkg}
+ XPATH=${XPATH/_ARCH_/$ARCH}
Xpath_get $XPATH $TMP_PRIMARY
CHECKSUM=$XPATH_RESULT
@@ -142,33 +144,33 @@ fetch_tizen_pkgs()
Debug "Download $PKG_URL to $PKG_PATH"
Fetch $PKG_URL $PKG_PATH true
-
+
echo "$CHECKSUM $PKG_PATH" | sha256sum -c - > /dev/null
if [ $? -ne 0 ]; then
Error "Fail to fetch $PKG_URL to $PKG_PATH"
Debug "Checksum = $CHECKSUM"
exit 1
fi
-
done
}
-Inform "Initialize arm base"
+Inform "Initialize base"
fetch_tizen_pkgs_init arm base
-Inform "fetch base common packages"
-fetch_tizen_pkgs base gcc glibc glibc-devel linux-glibc-devel
-Inform "fetch base coreclr packages"
-fetch_tizen_pkgs base lldb lldb-devel libuuid libuuid-devel libgcc libstdc++ libstdc++-devel
-Inform "fetch base corefx packages"
-fetch_tizen_pkgs base libcom_err libcom_err-devel zlib zlib-devel libopenssl libopenssl-devel
-
-Inform "initialize arm mobile"
-fetch_tizen_pkgs_init arm-wayland mobile
-Inform "fetch mobile common packages"
-fetch_tizen_pkgs mobile libicu-devel
-Inform "fetch mobile coreclr packages"
-fetch_tizen_pkgs mobile libunwind libunwind-devel tizen-release
-Inform "fetch mobile corefx packages"
-fetch_tizen_pkgs mobile gssdp gssdp-devel krb5 krb5-devel libcurl libcurl-devel
+Inform "fetch common packages"
+fetch_tizen_pkgs armv7l gcc glibc glibc-devel
+fetch_tizen_pkgs noarch linux-glibc-devel
+Inform "fetch coreclr packages"
+fetch_tizen_pkgs armv7l lldb lldb-devel libuuid libuuid-devel libgcc libstdc++ libstdc++-devel libunwind libunwind-devel
+Inform "fetch corefx packages"
+fetch_tizen_pkgs armv7l libcom_err libcom_err-devel zlib zlib-devel libopenssl libopenssl-devel
+
+Inform "Initialize unified"
+fetch_tizen_pkgs_init standard unified
+Inform "fetch common packages"
+fetch_tizen_pkgs armv7l libicu-devel
+Inform "fetch coreclr packages"
+fetch_tizen_pkgs armv7l tizen-release
+Inform "fetch corefx packages"
+fetch_tizen_pkgs armv7l gssdp gssdp-devel krb5 krb5-devel libcurl libcurl-devel
diff --git a/cross/armel/tizen/tizen.patch b/cross/armel/tizen/tizen.patch
index c92dc02809..d223427c97 100644
--- a/cross/armel/tizen/tizen.patch
+++ b/cross/armel/tizen/tizen.patch
@@ -16,18 +16,3 @@ diff -u -r a/usr/lib/libpthread.so b/usr/lib/libpthread.so
OUTPUT_FORMAT(elf32-littlearm)
-GROUP ( /lib/libpthread.so.0 /usr/lib/libpthread_nonshared.a )
+GROUP ( libpthread.so.0 libpthread_nonshared.a )
-diff -u -r a/usr/lib/libpthread.so b/usr/lib/libpthread.so
---- a/etc/os-release 2016-10-17 23:39:36.000000000 +0900
-+++ b/etc/os-release 2017-01-05 14:34:39.099867682 +0900
-@@ -1,7 +1,7 @@
- NAME=Tizen
--VERSION="3.0.0 (Tizen3/Mobile)"
-+VERSION="4.0.0 (Tizen4/Mobile)"
- ID=tizen
--VERSION_ID=3.0.0
--PRETTY_NAME="Tizen 3.0.0 (Tizen3/Mobile)"
-+VERSION_ID=4.0.0
-+PRETTY_NAME="Tizen 4.0.0 (Tizen4/Mobile)"
- ANSI_COLOR="0;36"
--CPE_NAME="cpe:/o:tizen:tizen:3.0.0"
-+CPE_NAME="cpe:/o:tizen:tizen:4.0.0"
diff --git a/cross/armel/toolchain.cmake b/cross/armel/toolchain.cmake
index ae3bd7c1ba..86e2306b61 100644
--- a/cross/armel/toolchain.cmake
+++ b/cross/armel/toolchain.cmake
@@ -16,7 +16,7 @@ set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -target ${TOOLCHAIN}")
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} --sysroot=${CROSS_ROOTFS}")
if("$ENV{__DistroRid}" MATCHES "tizen.*")
- set(TIZEN_TOOLCHAIN "armv7l-tizen-linux-gnueabi/4.9.2")
+ set(TIZEN_TOOLCHAIN "armv7l-tizen-linux-gnueabi/6.2.1")
include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/)
include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/armv7l-tizen-linux-gnueabi)
add_compile_options(-Wno-deprecated-declarations) # compile-time option
diff --git a/dependencies.props b/dependencies.props
index c06c465d52..8aada2c0a2 100644
--- a/dependencies.props
+++ b/dependencies.props
@@ -1,25 +1,40 @@
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+ <PropertyGroup>
+ <!-- Central place to set the versions of all nuget packages produced in the repo -->
+ <PackageVersion Condition="'$(PackageVersion)' == ''">2.0.0</PackageVersion>
+
+ <!-- Set the boolean below to true to generate packages with stabilized versions -->
+ <StabilizePackageVersion Condition="'$(StabilizePackageVersion)' == ''">false</StabilizePackageVersion>
+ <StableVersion Condition="'$(StabilizePackageVersion)' == 'true' and '$(StableVersion)' == ''">$(PackageVersion)</StableVersion>
+
+ <PreReleaseLabel>preview2</PreReleaseLabel>
+ </PropertyGroup>
+
<!-- Source of truth for dependency tooling: the commit hash of the dotnet/versions master branch as of the last auto-upgrade. -->
<PropertyGroup>
- <CoreFxCurrentRef>947e90b41c30a1f0a906f8d996443233c2ceedf4</CoreFxCurrentRef>
- <CoreClrCurrentRef>947e90b41c30a1f0a906f8d996443233c2ceedf4</CoreClrCurrentRef>
+ <CoreFxCurrentRef>d4040dc6f74933eec9827d44e288c9cd15996a15</CoreFxCurrentRef>
+ <CoreClrCurrentRef>d4040dc6f74933eec9827d44e288c9cd15996a15</CoreClrCurrentRef>
</PropertyGroup>
<!-- Auto-upgraded properties for each build info dependency. -->
<PropertyGroup>
- <CoreFxExpectedPrerelease>preview1-25221-01</CoreFxExpectedPrerelease>
+ <CoreFxExpectedPrerelease>preview2-25331-01</CoreFxExpectedPrerelease>
</PropertyGroup>
<!-- Full package version strings that are used in other parts of the build. -->
<PropertyGroup>
- <CoreClrPackageVersion>2.0.0-preview1-25221-01</CoreClrPackageVersion>
+ <CoreClrPackageVersion>2.0.0-preview2-25330-02</CoreClrPackageVersion>
<XunitPackageVersion>2.2.0-beta2-build3300</XunitPackageVersion>
+ <XUnitConsoleNetCoreVersion>1.0.2-prerelease-00177</XUnitConsoleNetCoreVersion>
+ <XUnitPerformanceApiVersion>1.0.0-beta-build0007</XUnitPerformanceApiVersion>
+ <MicrosoftDiagnosticsTracingLibraryVersion>1.0.3-alpha-experimental</MicrosoftDiagnosticsTracingLibraryVersion>
</PropertyGroup>
<!-- Package dependency verification/auto-upgrade configuration. -->
<PropertyGroup>
<BaseDotNetBuildInfo>build-info/dotnet/</BaseDotNetBuildInfo>
- <DependencyBranch>master</DependencyBranch>
+ <DependencyBranch>release/2.0.0</DependencyBranch>
<CurrentRefXmlPath>$(MSBuildThisFileFullPath)</CurrentRefXmlPath>
</PropertyGroup>
@@ -72,8 +87,16 @@
<Version>1.0.0-alpha-build0040</Version>
</StaticDependency>
+ <XUnitPerformanceApiDependency Include="xunit.performance.api" />
+ <XUnitPerformanceApiDependency Include="xunit.performance.core" />
+ <XUnitPerformanceApiDependency Include="xunit.performance.execution" />
+ <XUnitPerformanceApiDependency Include="xunit.performance.metrics" />
+ <StaticDependency Include="@(XUnitPerformanceApiDependency)">
+ <Version>$(XUnitPerformanceApiVersion)</Version>
+ </StaticDependency>
+
<StaticDependency Include="xunit.console.netcore">
- <Version>1.0.2-prerelease-00177</Version>
+ <Version>$(XUnitConsoleNetCoreVersion)</Version>
</StaticDependency>
<DependencyBuildInfo Include="@(StaticDependency)">
diff --git a/dir.props b/dir.props
index 496888476a..9668768507 100644
--- a/dir.props
+++ b/dir.props
@@ -21,6 +21,12 @@
<RoslynPackageName>Microsoft.Net.ToolsetCompilers</RoslynPackageName>
</PropertyGroup>
+ <!-- Profile-based optimization data package versions -->
+ <PropertyGroup>
+ <PgoDataPackageVersion>2.0.0-release-20170531-3000</PgoDataPackageVersion>
+ <!--<IbcDataPackageVersion></IbcDataPackageVersion>-->
+ </PropertyGroup>
+
<!--
Switching to the .NET Core version of the BuildTools tasks seems to break numerous scenarios, such as VS intellisense and resource designer
as well as runnning the build on mono. Until we can get these sorted out we will continue using the .NET 4.5 version of the tasks.
@@ -78,6 +84,9 @@
<Platform Condition="'$(Platform)' == ''">$(BuildArch)</Platform>
<Platform Condition="'$(Platform)' == 'amd64'">x64</Platform>
+
+ <!-- Default to portable build if not explicitly set -->
+ <PortableBuild Condition="'$(PortableBuild)' == ''">true</PortableBuild>
</PropertyGroup>
<!-- Output paths -->
@@ -87,37 +96,9 @@
<OutputPath Condition="'$(OutputPath)' == ''">$(BinDir)</OutputPath>
</PropertyGroup>
- <Import Condition="Exists('$(ToolsDir)BuildVersion.targets')" Project="$(ToolsDir)BuildVersion.targets" />
-
<!-- Import Build tools common props file where repo-independent properties are found -->
<Import Condition="Exists('$(ToolsDir)Build.Common.props')" Project="$(ToolsDir)Build.Common.props" />
-
- <!-- Common nuget properties -->
- <PropertyGroup>
- <NuGetToolPath Condition="'$(NuGetToolPath)'==''">$(PackagesDir)NuGet.exe</NuGetToolPath>
- <NuGetConfigFile Condition="'$(NuGetConfigFile)'==''">$(SourceDir)NuGet.Config</NuGetConfigFile>
- <NuGetConfigCommandLine>-ConfigFile "$(NuGetConfigFile)"</NuGetConfigCommandLine>
-
- <NugetRestoreCommand>"$(NuGetToolPath)"</NugetRestoreCommand>
- <NugetRestoreCommand>$(NugetRestoreCommand) install</NugetRestoreCommand>
- <!-- Trim off the last slash so that nuget doesn't get confused and say there are illegal characters on
- the path. -->
- <NugetRestoreCommand>$(NugetRestoreCommand) -OutputDirectory "$(PackagesDir.TrimEnd('\\'))"</NugetRestoreCommand>
- <NugetRestoreCommand>$(NugetRestoreCommand) $(NuGetConfigCommandLine)</NugetRestoreCommand>
- <NugetRestoreCommand>$(NugetRestoreCommand) -Verbosity detailed</NugetRestoreCommand>
- <NugetRestoreCommand Condition="'$(OsEnvironment)'=='Unix'">mono $(NuGetRestoreCommand)</NugetRestoreCommand>
- </PropertyGroup>
-
- <PropertyGroup>
- <DotnetToolCommand Condition="'$(DotnetToolCommand)'=='' and '$(OsEnvironment)'!='Unix'">$(DotnetCliPath)dotnet.exe</DotnetToolCommand>
- <DotnetToolCommand Condition="'$(DotnetToolCommand)'=='' and '$(OsEnvironment)'=='Unix'">$(DotnetCliPath)dotnet</DotnetToolCommand>
-
- <DnuRestoreCommand>$(DnuRestoreCommand) "$(DotnetToolCommand)"</DnuRestoreCommand>
- <DnuRestoreCommand>$(DnuRestoreCommand) restore</DnuRestoreCommand>
- <DnuRestoreCommand>$(DnuRestoreCommand) --packages "$(PackagesDir.TrimEnd('\\'))"</DnuRestoreCommand>
- </PropertyGroup>
-
<!-- Setup common target properties that we use to conditionally include sources -->
<PropertyGroup>
<TargetsFreeBSD Condition="'$(BuildOS)' == 'FreeBSD'">true</TargetsFreeBSD>
@@ -138,25 +119,20 @@
<!-- Packaging properties -->
<PropertyGroup>
- <PreReleaseLabel>preview2</PreReleaseLabel>
+ <LicenseUrl>https://github.com/dotnet/coreclr/blob/master/LICENSE.TXT</LicenseUrl>
<PackageDescriptionFile>$(SourceDir).nuget/descriptions.json</PackageDescriptionFile>
- <PackageLicenseFile>$(SourceDir).nuget/dotnet_library_license.txt</PackageLicenseFile>
- <PackageThirdPartyNoticesFile>$(SourceDir).nuget/ThirdPartyNotices.txt</PackageThirdPartyNoticesFile>
+ <PackageLicenseFile>$(ProjectDir)LICENSE.TXT</PackageLicenseFile>
+ <PackageThirdPartyNoticesFile>$(ProjectDir)THIRD-PARTY-NOTICES.TXT</PackageThirdPartyNoticesFile>
+ <SyncInfoDirectory>$(BaseIntermediateOutputPath)</SyncInfoDirectory>
<!-- This should be kept in sync with package details in src/.nuget/init/project.json -->
- <RuntimeIdGraphDefinitionFile>$(PackagesDir)/Microsoft.NETCore.Platforms/1.0.2-beta-24224-02/runtime.json</RuntimeIdGraphDefinitionFile>
+ <RuntimeIdGraphDefinitionVersion>1.0.2-beta-24224-02</RuntimeIdGraphDefinitionVersion>
+ <RuntimeIdGraphDefinitionFile>$(PackagesDir)/microsoft.netcore.platforms/$(RuntimeIdGraphDefinitionVersion)/runtime.json</RuntimeIdGraphDefinitionFile>
<!-- This link should be updated for each release milestone, currently this points to 1.1.0-beta -->
<ReleaseNotes>https://go.microsoft.com/fwlink/?LinkID=799421</ReleaseNotes>
<ProjectUrl>https://dot.net</ProjectUrl>
-
- <!-- Central place to set the versions of all nuget packages produced in the repo -->
- <PackageVersion Condition="'$(PackageVersion)' == ''">2.0.0</PackageVersion>
-
- <!-- Set the boolean below to true to generate packages with stabilized versions -->
- <StabilizePackageVersion Condition="'$(StabilizePackageVersion)' == ''">false</StabilizePackageVersion>
- <StableVersion Condition="'$(StabilizePackageVersion)' == 'true' and '$(StableVersion)' == ''">$(PackageVersion)</StableVersion>
<!-- On Windows, MSbuild still runs against Desktop FX while it runs on .NET Core on non-Windows. this requires
pulling in different packaging dependencies.
@@ -198,6 +174,10 @@
<PackageIndex Include="$(PackageIndexFile)" />
</ItemGroup>
+ <PropertyGroup>
+ <BuildVersionFile>$(BaseIntermediateOutputPath)BuildVersion-$(OfficialBuildId).props</BuildVersionFile>
+ </PropertyGroup>
+
<!-- Use Roslyn Compilers to build -->
<Import Project="$(RoslynPropsFile)" Condition="'$(RunningOnUnix)'!='true' and Exists('$(RoslynPropsFile)') and '$(UseRoslynCompilers)'!='false'" />
<Import Project="$(RoslynPropsFile)" Condition="'$(RunningOnUnix)'=='true' and Exists('$(RoslynPropsFile)')" />
diff --git a/extract-from-json.py b/extract-from-json.py
deleted file mode 100755
index e432b2b067..0000000000
--- a/extract-from-json.py
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/usr/bin/python
-
-import argparse
-import json
-import sys
-
-def parse_args():
- parser = argparse.ArgumentParser(
- description="""Extracts information from a json file by navigating the JSON object using a
- sequence of property accessors and returning the JSON subtree, or the raw data, found
- at that location."""
- )
-
- parser.add_argument(
- '-f', '--file',
- metavar='<project.json>',
- help="Path to project.json file to parse",
- required=True,
- )
-
- parser.add_argument(
- 'property',
- metavar='property_name',
- help="""Name of property to extract using object notation.
- Pass multiple values to drill down into nested objects (in order).""",
- nargs='*',
- )
-
- parser.add_argument(
- '-r', '--raw',
- help="""Dumps the raw object found at the requested location.
- If omitted, returns a JSON formatted object instead.""",
- action='store_true',
- default=False
- )
-
- return parser.parse_args()
-
-def main():
- args = parse_args()
-
- with open(args.file) as json_file:
- selected_property = json.load(json_file)
-
- for prop in args.property:
- selected_property = selected_property[prop]
-
- if args.raw:
- print(selected_property)
- else:
- print(json.dumps(selected_property))
-
- return 0
-
-if __name__ == "__main__":
- sys.exit(main())
diff --git a/functions.cmake b/functions.cmake
index cbcc70f4d1..cf4d08faaf 100644
--- a/functions.cmake
+++ b/functions.cmake
@@ -86,7 +86,10 @@ function(preprocess_def_file inputFilename outputFilename)
PROPERTIES GENERATED TRUE)
endfunction()
-function(generate_exports_file inputFilename outputFilename)
+function(generate_exports_file)
+ set(INPUT_LIST ${ARGN})
+ list(GET INPUT_LIST -1 outputFilename)
+ list(REMOVE_AT INPUT_LIST -1)
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
set(AWK_SCRIPT generateexportedsymbols.awk)
@@ -96,8 +99,8 @@ function(generate_exports_file inputFilename outputFilename)
add_custom_command(
OUTPUT ${outputFilename}
- COMMAND ${AWK} -f ${CMAKE_SOURCE_DIR}/${AWK_SCRIPT} ${inputFilename} >${outputFilename}
- DEPENDS ${inputFilename} ${CMAKE_SOURCE_DIR}/${AWK_SCRIPT}
+ COMMAND ${AWK} -f ${CMAKE_SOURCE_DIR}/${AWK_SCRIPT} ${INPUT_LIST} >${outputFilename}
+ DEPENDS ${INPUT_LIST} ${CMAKE_SOURCE_DIR}/${AWK_SCRIPT}
COMMENT "Generating exports file ${outputFilename}"
)
set_source_files_properties(${outputFilename}
diff --git a/init-tools.cmd b/init-tools.cmd
index 8efc2f400d..b69239bfe6 100644
--- a/init-tools.cmd
+++ b/init-tools.cmd
@@ -2,20 +2,15 @@
setlocal
set INIT_TOOLS_LOG=%~dp0init-tools.log
-set PACKAGES_DIR=%~dp0packages\
-set TOOLRUNTIME_DIR=%~dp0Tools
-:: This is an isolated script that handles the download of dotnet binaries and shall be removed after bootstrap.ps1/sh refactor (dotnet/corefx#15427)
-set DOTNET_DOWNLOAD_PATH=%~dp0dotnet-download.ps1
+if [%PACKAGES_DIR%]==[] set PACKAGES_DIR=%~dp0packages\
+if [%TOOLRUNTIME_DIR%]==[] set TOOLRUNTIME_DIR=%~dp0Tools
set DOTNET_PATH=%TOOLRUNTIME_DIR%\dotnetcli\
-set DOTNET_CMD=%DOTNET_PATH%dotnet.exe
+if [%DOTNET_CMD%]==[] set DOTNET_CMD=%DOTNET_PATH%dotnet.exe
if [%BUILDTOOLS_SOURCE%]==[] set BUILDTOOLS_SOURCE=https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json
set /P BUILDTOOLS_VERSION=< "%~dp0BuildToolsVersion.txt"
set BUILD_TOOLS_PATH=%PACKAGES_DIR%Microsoft.DotNet.BuildTools\%BUILDTOOLS_VERSION%\lib\
-set PROJECT_JSON_PATH=%TOOLRUNTIME_DIR%\%BUILDTOOLS_VERSION%
-set PROJECT_JSON_FILE=%PROJECT_JSON_PATH%\project.json
-set PROJECT_JSON_CONTENTS={ "dependencies": { "Microsoft.DotNet.BuildTools": "%BUILDTOOLS_VERSION%" , "Microsoft.DotNet.BuildTools.Coreclr": "1.0.4-prerelease"}, "frameworks": { "dnxcore50": { } } }
-set BUILD_TOOLS_SEMAPHORE=%PROJECT_JSON_PATH%\init-tools.completed0
-set TOOLS_INIT_RETURN_CODE=0
+set INIT_TOOLS_RESTORE_PROJECT=%~dp0init-tools.msbuild
+set BUILD_TOOLS_SEMAPHORE=%TOOLRUNTIME_DIR%\%BUILDTOOLS_VERSION%\init-tools.completed
:: if force option is specified then clean the tool runtime and build tools package directory to force it to get recreated
if [%1]==[force] (
@@ -26,7 +21,7 @@ if [%1]==[force] (
:: If sempahore exists do nothing
if exist "%BUILD_TOOLS_SEMAPHORE%" (
echo Tools are already initialized.
- goto :DONE
+ goto :EOF
)
if exist "%TOOLRUNTIME_DIR%" rmdir /S /Q "%TOOLRUNTIME_DIR%"
@@ -37,8 +32,6 @@ if NOT exist "%PACKAGES_DIR%NuGet.exe" (
powershell -NoProfile -ExecutionPolicy unrestricted -Command "(New-Object Net.WebClient).DownloadFile('https://www.nuget.org/nuget.exe', '%PACKAGES_DIR%NuGet.exe')
)
-if NOT exist "%PROJECT_JSON_PATH%" mkdir "%PROJECT_JSON_PATH%"
-echo %PROJECT_JSON_CONTENTS% > "%PROJECT_JSON_FILE%"
echo Running %0 > "%INIT_TOOLS_LOG%"
set /p DOTNET_VERSION=< "%~dp0DotnetCLIVersion.txt"
@@ -46,47 +39,39 @@ if exist "%DOTNET_CMD%" goto :afterdotnetrestore
echo Installing dotnet cli...
if NOT exist "%DOTNET_PATH%" mkdir "%DOTNET_PATH%"
-if [%PROCESSOR_ARCHITECTURE%]==[x86] (set DOTNET_ZIP_NAME=dotnet-dev-win-x86.%DOTNET_VERSION%.zip) else (set DOTNET_ZIP_NAME=dotnet-dev-win-x64.%DOTNET_VERSION%.zip)
-set DOTNET_REMOTE_PATH=https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/%DOTNET_VERSION%/%DOTNET_ZIP_NAME%
+set DOTNET_ZIP_NAME=dotnet-dev-win-x64.%DOTNET_VERSION%.zip
+set DOTNET_REMOTE_PATH=https://dotnetcli.blob.core.windows.net/dotnet/Sdk/%DOTNET_VERSION%/%DOTNET_ZIP_NAME%
set DOTNET_LOCAL_PATH=%DOTNET_PATH%%DOTNET_ZIP_NAME%
echo Installing '%DOTNET_REMOTE_PATH%' to '%DOTNET_LOCAL_PATH%' >> "%INIT_TOOLS_LOG%"
-powershell -NoProfile -ExecutionPolicy unrestricted -File %DOTNET_DOWNLOAD_PATH% -DotnetRemotePath %DOTNET_REMOTE_PATH% -DotnetLocalPath %DOTNET_LOCAL_PATH% -DotnetPath %DOTNET_PATH% >> "%INIT_TOOLS_LOG%"
+powershell -NoProfile -ExecutionPolicy unrestricted -Command "$retryCount = 0; $success = $false; do { try { (New-Object Net.WebClient).DownloadFile('%DOTNET_REMOTE_PATH%', '%DOTNET_LOCAL_PATH%'); $success = $true; } catch { if ($retryCount -ge 6) { throw; } else { $retryCount++; Start-Sleep -Seconds (5 * $retryCount); } } } while ($success -eq $false); Add-Type -Assembly 'System.IO.Compression.FileSystem' -ErrorVariable AddTypeErrors; if ($AddTypeErrors.Count -eq 0) { [System.IO.Compression.ZipFile]::ExtractToDirectory('%DOTNET_LOCAL_PATH%', '%DOTNET_PATH%') } else { (New-Object -com shell.application).namespace('%DOTNET_PATH%').CopyHere((new-object -com shell.application).namespace('%DOTNET_LOCAL_PATH%').Items(),16) }" >> "%INIT_TOOLS_LOG%"
if NOT exist "%DOTNET_LOCAL_PATH%" (
- echo ERROR: Could not install dotnet cli correctly. See '%INIT_TOOLS_LOG%' for more details.
- set TOOLS_INIT_RETURN_CODE=1
- goto :DONE
+ echo ERROR: Could not install dotnet cli correctly. See '%INIT_TOOLS_LOG%' for more details. 1>&2
+ exit /b 1
)
:afterdotnetrestore
if exist "%BUILD_TOOLS_PATH%" goto :afterbuildtoolsrestore
echo Restoring BuildTools version %BUILDTOOLS_VERSION%...
-echo Running: "%DOTNET_CMD%" restore "%PROJECT_JSON_FILE%" --packages "%PACKAGES_DIR% " --source "%BUILDTOOLS_SOURCE%" >> "%INIT_TOOLS_LOG%"
-call "%DOTNET_CMD%" restore "%PROJECT_JSON_FILE%" --packages "%PACKAGES_DIR% " --source "%BUILDTOOLS_SOURCE%" >> "%INIT_TOOLS_LOG%"
+echo Running: "%DOTNET_CMD%" restore "%INIT_TOOLS_RESTORE_PROJECT%" --no-cache --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" /p:BuildToolsPackageVersion=%BUILDTOOLS_VERSION% >> "%INIT_TOOLS_LOG%"
+call "%DOTNET_CMD%" restore "%INIT_TOOLS_RESTORE_PROJECT%" --no-cache --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" /p:BuildToolsPackageVersion=%BUILDTOOLS_VERSION% >> "%INIT_TOOLS_LOG%"
if NOT exist "%BUILD_TOOLS_PATH%init-tools.cmd" (
- echo ERROR: Could not restore build tools correctly. See '%INIT_TOOLS_LOG%' for more details.
- set TOOLS_INIT_RETURN_CODE=1
- goto :DONE
+ echo ERROR: Could not restore build tools correctly. See '%INIT_TOOLS_LOG%' for more details. 1>&2
+ exit /b 1
)
:afterbuildtoolsrestore
-echo Initializing BuildTools ...
+echo Initializing BuildTools...
echo Running: "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> "%INIT_TOOLS_LOG%"
call "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> "%INIT_TOOLS_LOG%"
-
-echo Updating CLI NuGet Frameworks map...
-robocopy "%TOOLRUNTIME_DIR%" "%TOOLRUNTIME_DIR%\dotnetcli\sdk\%DOTNET_VERSION%" NuGet.Frameworks.dll /XO >> "%INIT_TOOLS_LOG%"
-set UPDATE_CLI_ERRORLEVEL=%ERRORLEVEL%
-if %UPDATE_CLI_ERRORLEVEL% GTR 1 (
- echo ERROR: Failed to update Nuget for CLI {Error level %UPDATE_CLI_ERRORLEVEL%}. Please check '%INIT_TOOLS_LOG%' for more details. 1>&2
- exit /b %UPDATE_CLI_ERRORLEVEL%
+set INIT_TOOLS_ERRORLEVEL=%ERRORLEVEL%
+if not [%INIT_TOOLS_ERRORLEVEL%]==[0] (
+ echo ERROR: An error occured when trying to initialize the tools. Please check '%INIT_TOOLS_LOG%' for more details. 1>&2
+ exit /b %INIT_TOOLS_ERRORLEVEL%
)
:: Create sempahore file
echo Done initializing tools.
echo Init-Tools.cmd completed for BuildTools Version: %BUILDTOOLS_VERSION% > "%BUILD_TOOLS_SEMAPHORE%"
-
-:DONE
-
-exit /b %TOOLS_INIT_RETURN_CODE%
+exit /b 0 \ No newline at end of file
diff --git a/init-tools.msbuild b/init-tools.msbuild
new file mode 100644
index 0000000000..ff2a9c3cb4
--- /dev/null
+++ b/init-tools.msbuild
@@ -0,0 +1,16 @@
+<Project Sdk="Microsoft.NET.Sdk">
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.0</TargetFramework>
+ <EnableDefaultItems>false</EnableDefaultItems>
+ <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
+ <BaseIntermediateOutputPath>$(MSBuildThisFileDirectory)Tools/$(BuildToolsPackageVersion)</BaseIntermediateOutputPath>
+ </PropertyGroup>
+ <ItemGroup>
+ <PackageReference Include="Microsoft.DotNet.BuildTools">
+ <Version>$(BuildToolsPackageVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="Microsoft.DotNet.BuildTools.Coreclr">
+ <Version>1.0.4-prerelease</Version>
+ </PackageReference>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/init-tools.sh b/init-tools.sh
index f965583dae..b676ba1846 100755
--- a/init-tools.sh
+++ b/init-tools.sh
@@ -7,63 +7,17 @@ __TOOLRUNTIME_DIR=$__scriptpath/Tools
__DOTNET_PATH=$__TOOLRUNTIME_DIR/dotnetcli
__DOTNET_CMD=$__DOTNET_PATH/dotnet
if [ -z "$__BUILDTOOLS_SOURCE" ]; then __BUILDTOOLS_SOURCE=https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json; fi
+export __BUILDTOOLS_USE_CSPROJ=true
__BUILD_TOOLS_PACKAGE_VERSION=$(cat $__scriptpath/BuildToolsVersion.txt)
__DOTNET_TOOLS_VERSION=$(cat $__scriptpath/DotnetCLIVersion.txt)
-__BUILD_TOOLS_PATH=$__PACKAGES_DIR/Microsoft.DotNet.BuildTools/$__BUILD_TOOLS_PACKAGE_VERSION/lib
-__PROJECT_JSON_PATH=$__TOOLRUNTIME_DIR/$__BUILD_TOOLS_PACKAGE_VERSION
-__PROJECT_JSON_FILE=$__PROJECT_JSON_PATH/project.json
-__PROJECT_JSON_CONTENTS="{ \"dependencies\": { \"Microsoft.DotNet.BuildTools\": \"$__BUILD_TOOLS_PACKAGE_VERSION\" }, \"frameworks\": { \"netcoreapp1.0\": { } } }"
-__INIT_TOOLS_DONE_MARKER=$__PROJECT_JSON_PATH/done
-
-# Extended version of platform detection logic from dotnet/cli/scripts/obtain/dotnet-install.sh 16692fc
-get_current_linux_name() {
- # Detect Distro
- if [ "$(cat /etc/os-release | grep -cim1 ubuntu)" -eq 1 ]; then
- if [ "$(cat /etc/os-release | grep -cim1 16.04)" -eq 1 ]; then
- echo "ubuntu.16.04"
- return 0
- fi
- if [ "$(cat /etc/os-release | grep -cim1 16.10)" -eq 1 ]; then
- echo "ubuntu.16.10"
- return 0
- fi
-
- echo "ubuntu"
- return 0
- elif [ "$(cat /etc/os-release | grep -cim1 centos)" -eq 1 ]; then
- echo "centos"
- return 0
- elif [ "$(cat /etc/os-release | grep -cim1 rhel)" -eq 1 ]; then
- echo "rhel"
- return 0
- elif [ "$(cat /etc/os-release | grep -cim1 debian)" -eq 1 ]; then
- echo "debian"
- return 0
- elif [ "$(cat /etc/os-release | grep -cim1 alpine)" -eq 1 ]; then
- echo "alpine"
- return 0
- elif [ "$(cat /etc/os-release | grep -cim1 fedora)" -eq 1 ]; then
- if [ "$(cat /etc/os-release | grep -cim1 24)" -eq 1 ]; then
- echo "fedora.24"
- return 0
- fi
- if [ "$(cat /etc/os-release | grep -cim1 25)" -eq 1 ]; then
- echo "fedora.25"
- return 0
- fi
- elif [ "$(cat /etc/os-release | grep -cim1 opensuse)" -eq 1 ]; then
- if [ "$(cat /etc/os-release | grep -cim1 42.1)" -eq 1 ]; then
- echo "opensuse.42.1"
- return 0
- fi
- fi
-
- # Cannot determine Linux distribution, assuming Ubuntu 14.04.
- echo "ubuntu"
- return 0
-}
+__BUILD_TOOLS_PATH=$__PACKAGES_DIR/microsoft.dotnet.buildtools/$__BUILD_TOOLS_PACKAGE_VERSION/lib
+__INIT_TOOLS_RESTORE_PROJECT=$__scriptpath/init-tools.msbuild
+__INIT_TOOLS_DONE_MARKER=$__TOOLRUNTIME_DIR/$__BUILD_TOOLS_PACKAGE_VERSION/done
if [ -z "$__DOTNET_PKG" ]; then
+ if [ "$(uname -m | grep "i[3456]86")" = "i686" ]; then
+ echo "Warning: build not supported on 32 bit Unix"
+ fi
OSName=$(uname -s)
case $OSName in
Darwin)
@@ -73,14 +27,14 @@ OSName=$(uname -s)
;;
Linux)
- __DOTNET_PKG="dotnet-dev-$(get_current_linux_name)-x64"
+ __DOTNET_PKG=dotnet-dev-linux-x64
OS=Linux
;;
*)
- echo "Unsupported OS '$OSName' detected. Downloading ubuntu-x64 tools."
+ echo "Unsupported OS '$OSName' detected. Downloading linux-x64 tools."
OS=Linux
- __DOTNET_PKG=dotnet-dev-ubuntu-x64
+ __DOTNET_PKG=dotnet-dev-linux-x64
;;
esac
fi
@@ -103,13 +57,14 @@ if [ ! -e $__INIT_TOOLS_DONE_MARKER ]; then
cp -r $DOTNET_TOOL_DIR/* $__DOTNET_PATH
else
echo "Installing dotnet cli..."
- __DOTNET_LOCATION="https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/${__DOTNET_TOOLS_VERSION}/${__DOTNET_PKG}.${__DOTNET_TOOLS_VERSION}.tar.gz"
+ __DOTNET_LOCATION="https://dotnetcli.blob.core.windows.net/dotnet/Sdk/${__DOTNET_TOOLS_VERSION}/${__DOTNET_PKG}.${__DOTNET_TOOLS_VERSION}.tar.gz"
# curl has HTTPS CA trust-issues less often than wget, so lets try that first.
echo "Installing '${__DOTNET_LOCATION}' to '$__DOTNET_PATH/dotnet.tar'" >> $__init_tools_log
- if command -v curl > /dev/null; then
- curl --retry 10 -sSL --create-dirs -o $__DOTNET_PATH/dotnet.tar ${__DOTNET_LOCATION}
- else
+ which curl > /dev/null 2> /dev/null
+ if [ $? -ne 0 ]; then
wget -q -O $__DOTNET_PATH/dotnet.tar ${__DOTNET_LOCATION}
+ else
+ curl --retry 10 -sSL --create-dirs -o $__DOTNET_PATH/dotnet.tar ${__DOTNET_LOCATION}
fi
cd $__DOTNET_PATH
tar -xf $__DOTNET_PATH/dotnet.tar
@@ -128,18 +83,18 @@ if [ ! -e $__INIT_TOOLS_DONE_MARKER ]; then
echo "Copying $BUILD_TOOLS_TOOL_DIR to $__TOOLRUNTIME_DIR" >> $__init_tools_log
cp -r $BUILD_TOOLS_TOOL_DIR/* $__TOOLRUNTIME_DIR
else
- if [ ! -d "$__PROJECT_JSON_PATH" ]; then mkdir "$__PROJECT_JSON_PATH"; fi
- echo $__PROJECT_JSON_CONTENTS > "$__PROJECT_JSON_FILE"
-
if [ ! -e $__BUILD_TOOLS_PATH ]; then
echo "Restoring BuildTools version $__BUILD_TOOLS_PACKAGE_VERSION..."
- echo "Running: $__DOTNET_CMD restore \"$__PROJECT_JSON_FILE\" --no-cache --packages $__PACKAGES_DIR --source $__BUILDTOOLS_SOURCE" >> $__init_tools_log
- $__DOTNET_CMD restore "$__PROJECT_JSON_FILE" --no-cache --packages $__PACKAGES_DIR --source $__BUILDTOOLS_SOURCE >> $__init_tools_log
+ echo "Running: $__DOTNET_CMD restore \"$__INIT_TOOLS_RESTORE_PROJECT\" --no-cache --packages $__PACKAGES_DIR --source $__BUILDTOOLS_SOURCE /p:BuildToolsPackageVersion=$__BUILD_TOOLS_PACKAGE_VERSION" >> $__init_tools_log
+ $__DOTNET_CMD restore "$__INIT_TOOLS_RESTORE_PROJECT" --no-cache --packages $__PACKAGES_DIR --source $__BUILDTOOLS_SOURCE /p:BuildToolsPackageVersion=$__BUILD_TOOLS_PACKAGE_VERSION >> $__init_tools_log
if [ ! -e "$__BUILD_TOOLS_PATH/init-tools.sh" ]; then echo "ERROR: Could not restore build tools correctly. See '$__init_tools_log' for more details."1>&2; fi
fi
echo "Initializing BuildTools..."
echo "Running: $__BUILD_TOOLS_PATH/init-tools.sh $__scriptpath $__DOTNET_CMD $__TOOLRUNTIME_DIR" >> $__init_tools_log
+
+ # Executables restored with .NET Core 2.0 do not have executable permission flags. https://github.com/NuGet/Home/issues/4424
+ chmod +x $__BUILD_TOOLS_PATH/init-tools.sh
$__BUILD_TOOLS_PATH/init-tools.sh $__scriptpath $__DOTNET_CMD $__TOOLRUNTIME_DIR >> $__init_tools_log
if [ "$?" != "0" ]; then
echo "ERROR: An error occured when trying to initialize the tools. Please check '$__init_tools_log' for more details."1>&2
@@ -147,18 +102,16 @@ if [ ! -e $__INIT_TOOLS_DONE_MARKER ]; then
fi
fi
- if [ $__PATCH_CLI_NUGET_FRAMEWORKS -eq 1 ]; then
- echo "Updating CLI NuGet Frameworks map..."
- cp $__TOOLRUNTIME_DIR/NuGet.Frameworks.dll $__TOOLRUNTIME_DIR/dotnetcli/sdk/$__DOTNET_TOOLS_VERSION >> $__init_tools_log
- if [ "$?" != "0" ]; then
- echo "ERROR: An error occured when updating Nuget for CLI . Please check '$__init_tools_log' for more details."1>&2
- exit 1
- fi
- fi
+ echo "Making all .sh files executable under Tools."
+ # Executables restored with .NET Core 2.0 do not have executable permission flags. https://github.com/NuGet/Home/issues/4424
+ ls $__scriptpath/Tools/*.sh | xargs chmod +x
+ ls $__scriptpath/Tools/scripts/docker/*.sh | xargs chmod +x
+
+ Tools/crossgen.sh $__scriptpath/Tools
touch $__INIT_TOOLS_DONE_MARKER
echo "Done initializing tools."
else
echo "Tools are already initialized"
-fi
+fi \ No newline at end of file
diff --git a/netci.groovy b/netci.groovy
index 9e0339a366..6a97cba321 100755
--- a/netci.groovy
+++ b/netci.groovy
@@ -137,6 +137,7 @@ class Constants {
'gcsimulator',
'jitdiff',
'standalone_gc',
+ 'gc_reliability_framework',
'illink'] + r2rJitStressScenarios
def static configurationList = ['Debug', 'Checked', 'Release']
@@ -205,6 +206,14 @@ def static isJitDiff(def scenario) {
return (scenario == 'jitdiff')
}
+def static isGcReliabilityFramework(def scenario) {
+ return (scenario == 'gc_reliability_framework')
+}
+
+def static scenarioNeedsPri1Build(def scenario) {
+ return (scenario == 'pri1' || scenario == 'pri1r2r' || scenario == 'gcstress15_pri1r2r'|| scenario == 'coverage' || isGcReliabilityFramework(scenario))
+}
+
def static setTestJobTimeOut(newJob, scenario) {
if (isGCStressRelatedTesting(scenario)) {
Utilities.setJobTimeout(newJob, 4320)
@@ -227,6 +236,9 @@ def static setTestJobTimeOut(newJob, scenario) {
else if (isJitDiff(scenario)) {
Utilities.setJobTimeout(newJob, 240)
}
+ else if (isGcReliabilityFramework(scenario)) {
+ Utilities.setJobTimeout(newJob, 1440)
+ }
// Non-test jobs use the default timeout value.
}
@@ -497,6 +509,11 @@ def static addNonPRTriggers(def job, def branch, def isPR, def architecture, def
// addEmailPublisher(job, 'dotnetgctests@microsoft.com')
Utilities.addPeriodicTrigger(job, '@weekly')
break
+ case 'gc_reliability_framework':
+ assert (os == 'Ubuntu' || os == 'Windows_NT' || os == 'OSX10.12')
+ assert (configuration == 'Release' || configuration == 'Checked')
+ // Only triggered by phrase.
+ break
case 'ilrt':
assert !(os in bidailyCrossList)
// ILASM/ILDASM roundtrip one gets a daily build, and only for release
@@ -766,6 +783,16 @@ def static addTriggers(def job, def branch, def isPR, def architecture, def os,
Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GC Simulator", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
}
break
+ case 'standalone_gc':
+ if (configuration == 'Release' || configuration == 'Checked') {
+ Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Standalone GC", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
+ }
+ break
+ case 'gc_reliability_framework':
+ if (configuration == 'Release' || configuration == 'Checked') {
+ Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GC Reliability Framework", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
+ }
+ break
case 'minopts':
case 'forcerelocs':
case 'jitstress1':
@@ -939,6 +966,11 @@ def static addTriggers(def job, def branch, def isPR, def architecture, def os,
Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Standalone GC", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
}
break
+ case 'gc_reliability_framework':
+ if (configuration == 'Release' || configuration == 'Checked') {
+ Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GC Reliability Framework", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
+ }
+ break
case 'minopts':
case 'forcerelocs':
case 'jitstress1':
@@ -1294,6 +1326,7 @@ def static calculateBuildCommands(def newJob, def scenario, def branch, def isPR
scenario == 'default' ||
scenario == 'r2r' ||
scenario == 'jitdiff' ||
+ scenario == 'ilrt' ||
scenario == 'illink' ||
Constants.r2rJitStressScenarios.indexOf(scenario) != -1) {
buildOpts += enableCorefxTesting ? ' skiptests' : ''
@@ -1306,14 +1339,9 @@ def static calculateBuildCommands(def newJob, def scenario, def branch, def isPR
// binaries are sent to a default directory whose name is about
// 35 characters long.
- else if (scenario == 'pri1' || scenario == 'pri1r2r' || scenario == 'gcstress15_pri1r2r'|| scenario == 'coverage') {
+ else if (scenarioNeedsPri1Build(scenario)) {
buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${arch} ${buildOpts} -priority=1"
}
- else if (scenario == 'ilrt') {
- // First do the build with skiptests and then build the tests with ilasm roundtrip
- buildCommands += "build.cmd ${lowerConfiguration} ${arch} ${buildOpts} skiptests"
- buildCommands += "set __TestIntermediateDir=int&&build-test.cmd ${lowerConfiguration} ${arch} -ilasmroundtrip"
- }
else if (isLongGc(scenario)) {
buildCommands += "build.cmd ${lowerConfiguration} ${arch} ${buildOpts} skiptests"
buildCommands += "set __TestIntermediateDir=int&&build-test.cmd ${lowerConfiguration} ${arch}"
@@ -1343,6 +1371,7 @@ def static calculateBuildCommands(def newJob, def scenario, def branch, def isPR
def runjitmioptsStr = ''
def runjitforcerelocsStr = ''
def runjitdisasmStr = ''
+ def runilasmroundtripStr = ''
def gcstressStr = ''
def runtestArguments = ''
def gcTestArguments = ''
@@ -1402,6 +1431,11 @@ def static calculateBuildCommands(def newJob, def scenario, def branch, def isPR
runjitdisasmStr = 'jitdisasm crossgen'
}
+ if (scenario == 'ilrt')
+ {
+ runilasmroundtripStr = 'ilasmroundtrip'
+ }
+
if (isLongGc(scenario)) {
gcTestArguments = "${scenario} sequential"
}
@@ -1411,7 +1445,7 @@ def static calculateBuildCommands(def newJob, def scenario, def branch, def isPR
illinkArguments = "link %WORKSPACE%\\linker\\linker\\bin\\netcore_Release\\netcoreapp2.0\\win10-${arch}\\publish\\illink.exe"
}
- runtestArguments = "${lowerConfiguration} ${arch} ${gcstressStr} ${crossgenStr} ${runcrossgentestsStr} ${runjitstressStr} ${runjitstressregsStr} ${runjitmioptsStr} ${runjitforcerelocsStr} ${runjitdisasmStr} ${gcTestArguments} ${illinkArguments} collectdumps"
+ runtestArguments = "${lowerConfiguration} ${arch} ${gcstressStr} ${crossgenStr} ${runcrossgentestsStr} ${runjitstressStr} ${runjitstressregsStr} ${runjitmioptsStr} ${runjitforcerelocsStr} ${runjitdisasmStr} ${runilasmroundtripStr} ${gcTestArguments} ${illinkArguments} collectdumps"
if (Constants.jitStressModeScenarios.containsKey(scenario)) {
def stepScriptLocation = "%WORKSPACE%\\SetStressModes.bat"
@@ -1433,6 +1467,12 @@ def static calculateBuildCommands(def newJob, def scenario, def branch, def isPR
buildCommands += "%WORKSPACE%\\tests\\runtest.cmd ${runtestArguments} TestEnv ${stepScriptLocation}"
}
}
+ else if (isGcReliabilityFramework(scenario)) {
+ buildCommands += "tests\\runtest.cmd ${runtestArguments} GenerateLayoutOnly"
+ buildCommands += "tests\\scripts\\run-gc-reliability-framework.cmd ${arch} ${configuration}"
+ Utilities.addArchival(newJob, "stdout.txt")
+ Utilities.addArchival(newJob, "Logs/**")
+ }
else if (architecture == 'x64' || architecture == 'x86') {
buildCommands += "tests\\runtest.cmd ${runtestArguments}"
}
@@ -1505,7 +1545,7 @@ def static calculateBuildCommands(def newJob, def scenario, def branch, def isPR
Utilities.setJobTimeout(newJob, 240)
}
- buildCommands += "set __TestIntermediateDir=int&&build.cmd skiptests ${lowerConfiguration} ${architecture} toolset_dir C:\\ats2"
+ buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${architecture} toolset_dir C:\\ats2 -priority=1"
// Test build and run are launched together.
buildCommands += "python tests\\scripts\\arm64_post_build.py -repo_root %WORKSPACE% -arch ${architecture} -build_type ${lowerConfiguration} -scenario ${scenario} -key_location C:\\tools\\key.txt"
//Utilities.addXUnitDotNETResults(newJob, 'bin/tests/testResults.xml')
@@ -1852,7 +1892,7 @@ combinedScenarios.each { scenario ->
if (os != 'Windows_NT') {
return
}
- if (architecture != 'x64') {
+ if (architecture != 'x64' && architecture != 'x86') {
return
}
break
@@ -1868,6 +1908,7 @@ combinedScenarios.each { scenario ->
return
}
break
+ case 'gc_reliability_framework':
case 'standalone_gc':
if (os != 'Windows_NT' && os != 'Ubuntu' && os != 'OSX10.12') {
return
@@ -2118,10 +2159,12 @@ combinedScenarios.each { scenario ->
return
}
break
+ case 'gc_reliability_framework':
case 'standalone_gc':
if (configuration != 'Release' && configuration != 'Checked') {
return
}
+ break
case 'coverage':
//We only want Ubuntu Release for coverage
if (os != 'Ubuntu') {
@@ -2162,7 +2205,7 @@ combinedScenarios.each { scenario ->
// so we didn't create a build only job for windows_nt specific to that stress mode. Just copy
// from the default scenario
def testBuildScenario = scenario
- if (testBuildScenario == 'coverage' || testBuildScenario == 'pri1r2r'|| testBuildScenario == 'gcstress15_pri1r2r') {
+ if (scenarioNeedsPri1Build(scenario)) {
testBuildScenario = 'pri1'
}
else if ( testBuildScenario == 'r2r' || Constants.r2rJitStressScenarios.indexOf(testBuildScenario) != -1 || isLongGc(testBuildScenario)) {
@@ -2205,8 +2248,10 @@ combinedScenarios.each { scenario ->
def runjitmioptsStr = ''
def runjitforcerelocsStr = ''
def runjitdisasmStr = ''
+ def runilasmroundtripStr = ''
def gcstressStr = ''
def illinkStr = ''
+ def layoutOnlyStr =''
if (scenario == 'r2r' ||
scenario == 'pri1r2r' ||
@@ -2283,6 +2328,10 @@ combinedScenarios.each { scenario ->
}
}
+ if (isGcReliabilityFramework(scenario)) {
+ layoutOnlyStr = '--build-overlay-only'
+ }
+
def folder = getJobFolder(scenario)
def newJob = job(Utilities.getFullJobName(project, jobName, isPR, folder)) {
// Add parameters for the inputs
@@ -2435,11 +2484,29 @@ combinedScenarios.each { scenario ->
--mscorlibDir=\"\${WORKSPACE}/bin/Product/${osGroup}.${architecture}.${configuration}\" \\
--coreFxBinDir=\"\${WORKSPACE}/bin/CoreFxBinDir\" \\
--limitedDumpGeneration \\
- ${testEnvOpt} ${serverGCString} ${gcstressStr} ${crossgenStr} ${runcrossgentestsStr} ${runjitstressStr} ${runjitstressregsStr} ${runjitmioptsStr} ${runjitforcerelocsStr} ${runjitdisasmStr} ${illinkStr} ${sequentialString} ${playlistString}""")
+ ${testEnvOpt} ${serverGCString} ${gcstressStr} ${crossgenStr} ${runcrossgentestsStr} ${runjitstressStr} \\
+ ${runjitstressregsStr} ${runjitmioptsStr} ${runjitforcerelocsStr} ${runjitdisasmStr} ${runilasmroundtripStr} \\
+ ${illinkStr} ${sequentialString} ${playlistString} ${layoutOnlyStr}""")
+
+ if (isGcReliabilityFramework(scenario)) {
+ // runtest.sh doesn't actually execute the reliability framework - do it here.
+ if (serverGCString != '') {
+ shell("export COMPlus_gcServer=1")
+ }
+
+ shell("./tests/scripts/run-gc-reliability-framework.sh ${architecture} ${configuration}")
+ }
}
}
}
+ if (isGcReliabilityFramework(scenario))
+ {
+ // Both of these are emitted by the RF
+ Utilities.addArchival(newJob, "stdout.txt")
+ Utilities.addArchival(newJob, "Logs/**")
+ }
+
if (scenario == 'coverage') {
// Publish coverage reports
Utilities.addHtmlPublisher(newJob, '${WORKSPACE}/coverage/Coverage/reports', 'Code Coverage Report', 'coreclr.html')
diff --git a/perf.groovy b/perf.groovy
index 5a88ff13d2..9be47c0b3c 100644
--- a/perf.groovy
+++ b/perf.groovy
@@ -24,100 +24,140 @@ def static getOSGroup(def os) {
assert osGroup != null : "Could not find os group for ${os}"
return osGroupMap[os]
}
+
// Setup perflab tests runs
[true, false].each { isPR ->
['Windows_NT'].each { os ->
- ['x64', 'x86', 'x86jit32'].each { arch ->
- def architecture = arch
- def testEnv = ''
-
- if (arch == 'x86jit32')
- {
- architecture = 'x86'
- testEnv = '-testEnv %WORKSPACE%\\tests\\x86\\compatjit_x86_testenv.cmd'
- }
- else if (arch == 'x86')
- {
- testEnv = '-testEnv %WORKSPACE%\\tests\\x86\\ryujit_x86_testenv.cmd'
- }
+ ['x64', 'x86'].each { arch ->
+ [true, false].each { isSmoketest ->
+ def architecture = arch
+ def jobName = isSmoketest ? "perf_perflab_${os}_${arch}_smoketest" : "perf_perflab_${os}_${arch}"
- def newJob = job(Utilities.getFullJobName(project, "perf_perflab_${os}_${arch}", isPR)) {
- // Set the label.
- label('windows_clr_perf')
- wrappers {
- credentialsBinding {
- string('BV_UPLOAD_SAS_TOKEN', 'CoreCLR Perf BenchView Sas')
- }
+ if (arch == 'x86jit32')
+ {
+ architecture = 'x86'
+ testEnv = '-testEnv %WORKSPACE%\\tests\\x86\\compatjit_x86_testenv.cmd'
}
-
- if (isPR)
- {
- parameters
+ else if (arch == 'x86')
{
- stringParam('BenchviewCommitName', '\${ghprbPullTitle}', 'The name that you will be used to build the full title of a run in Benchview. The final name will be of the form <branch> private BenchviewCommitName')
+ testEnv = '-testEnv %WORKSPACE%\\tests\\x86\\ryujit_x86_testenv.cmd'
}
- }
- def configuration = 'Release'
- def runType = isPR ? 'private' : 'rolling'
- def benchViewName = isPR ? 'coreclr private %BenchviewCommitName%' : 'coreclr rolling %GIT_BRANCH_WITHOUT_ORIGIN% %GIT_COMMIT%'
-
- steps {
- // Batch
- batchFile("if exist \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\" rmdir /s /q \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\"")
- batchFile("C:\\Tools\\nuget.exe install Microsoft.BenchView.JSONFormat -Source http://benchviewtestfeed.azurewebsites.net/nuget -OutputDirectory \"%WORKSPACE%\" -Prerelease -ExcludeVersion")
- //Do this here to remove the origin but at the front of the branch name as this is a problem for BenchView
- //we have to do it all as one statement because cmd is called each time and we lose the set environment variable
- batchFile("if [%GIT_BRANCH:~0,7%] == [origin/] (set GIT_BRANCH_WITHOUT_ORIGIN=%GIT_BRANCH:origin/=%) else (set GIT_BRANCH_WITHOUT_ORIGIN=%GIT_BRANCH%)\n" +
- "set BENCHVIEWNAME=${benchViewName}\n" +
- "set BENCHVIEWNAME=%BENCHVIEWNAME:\"=%\n" +
- "py \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\submission-metadata.py\" --name \"%BENCHVIEWNAME%\" --user \"dotnet-bot@microsoft.com\"\n" +
- "py \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\build.py\" git --branch %GIT_BRANCH_WITHOUT_ORIGIN% --type ${runType}")
- batchFile("py \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\machinedata.py\"")
- batchFile("set __TestIntermediateDir=int&&build.cmd ${configuration} ${architecture}")
+ def newJob = job(Utilities.getFullJobName(project, jobName, isPR)) {
+ // Set the label.
+ label('windows_clr_perf')
+ wrappers {
+ credentialsBinding {
+ string('BV_UPLOAD_SAS_TOKEN', 'CoreCLR Perf BenchView Sas')
+ }
+ }
- if (arch == 'x86jit32')
+ if (isPR)
{
- // Download package and copy compatjit into Core_Root
- batchFile("C:\\Tools\\nuget.exe install runtime.win7-${architecture}.Microsoft.NETCore.Jit -Source https://dotnet.myget.org/F/dotnet-core -OutputDirectory \"%WORKSPACE%\" -Prerelease -ExcludeVersion\n" +
- "xcopy \"%WORKSPACE%\\runtime.win7-x86.Microsoft.NETCore.Jit\\runtimes\\win7-x86\\native\\compatjit.dll\" \"%WORKSPACE%\\bin\\Product\\${os}.${architecture}.${configuration}\" /Y")
+ parameters
+ {
+ stringParam('BenchviewCommitName', '\${ghprbPullTitle}', 'The name that you will be used to build the full title of a run in Benchview. The final name will be of the form <branch> private BenchviewCommitName')
+ }
}
+ if (isSmoketest)
+ {
+ parameters
+ {
+ stringParam('XUNIT_PERFORMANCE_MAX_ITERATION', '2', 'Sets the number of iterations to two. We want to do this so that we can run as fast as possible as this is just for smoke testing')
+ stringParam('XUNIT_PERFORMANCE_MAX_ITERATION_INNER_SPECIFIED', '2', 'Sets the number of iterations to two. We want to do this so that we can run as fast as possible as this is just for smoke testing')
+ }
+ }
+ else
+ {
+ parameters
+ {
+ stringParam('XUNIT_PERFORMANCE_MAX_ITERATION', '21', 'Sets the number of iterations to twenty one. We are doing this to limit the amount of data that we upload as 20 iterations is enought to get a good sample')
+ stringParam('XUNIT_PERFORMANCE_MAX_ITERATION_INNER_SPECIFIED', '21', 'Sets the number of iterations to twenty one. We are doing this to limit the amount of data that we upload as 20 iterations is enought to get a good sample')
+ }
+ }
+ def configuration = 'Release'
+ def runType = isPR ? 'private' : 'rolling'
+ def benchViewName = isPR ? 'coreclr private %BenchviewCommitName%' : 'coreclr rolling %GIT_BRANCH_WITHOUT_ORIGIN% %GIT_COMMIT%'
+ def uploadString = isSmoketest ? '' : '-uploadToBenchview'
- batchFile("tests\\runtest.cmd ${configuration} ${architecture} GenerateLayoutOnly")
+ steps {
+ // Batch
+
+ batchFile("powershell wget https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -OutFile \"%WORKSPACE%\\nuget.exe\"")
+ batchFile("if exist \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\" rmdir /s /q \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\"")
+ batchFile("\"%WORKSPACE%\\nuget.exe\" install Microsoft.BenchView.JSONFormat -Source http://benchviewtestfeed.azurewebsites.net/nuget -OutputDirectory \"%WORKSPACE%\" -Prerelease -ExcludeVersion")
+ //Do this here to remove the origin but at the front of the branch name as this is a problem for BenchView
+ //we have to do it all as one statement because cmd is called each time and we lose the set environment variable
+ batchFile("if [%GIT_BRANCH:~0,7%] == [origin/] (set GIT_BRANCH_WITHOUT_ORIGIN=%GIT_BRANCH:origin/=%) else (set GIT_BRANCH_WITHOUT_ORIGIN=%GIT_BRANCH%)\n" +
+ "set BENCHVIEWNAME=${benchViewName}\n" +
+ "set BENCHVIEWNAME=%BENCHVIEWNAME:\"=%\n" +
+ "py \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\submission-metadata.py\" --name \"%BENCHVIEWNAME%\" --user \"dotnet-bot@microsoft.com\"\n" +
+ "py \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\build.py\" git --branch %GIT_BRANCH_WITHOUT_ORIGIN% --type ${runType}")
+ batchFile("py \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\machinedata.py\"")
+ batchFile("set __TestIntermediateDir=int&&build.cmd ${configuration} ${architecture}")
+
+ if (arch == 'x86jit32')
+ {
+ // Download package and copy compatjit into Core_Root
+ batchFile("C:\\Tools\\nuget.exe install runtime.win7-${architecture}.Microsoft.NETCore.Jit -Source https://dotnet.myget.org/F/dotnet-core -OutputDirectory \"%WORKSPACE%\" -Prerelease -ExcludeVersion\n" +
+ "xcopy \"%WORKSPACE%\\runtime.win7-x86.Microsoft.NETCore.Jit\\runtimes\\win7-x86\\native\\compatjit.dll\" \"%WORKSPACE%\\bin\\Product\\${os}.${architecture}.${configuration}\" /Y")
+ }
- batchFile("tests\\scripts\\run-xunit-perf.cmd -arch ${arch} -configuration ${configuration} ${testEnv} -testBinLoc bin\\tests\\${os}.${architecture}.${configuration}\\performance\\perflab\\Perflab -library -uploadToBenchview \"%WORKSPACE%\\Microsoft.Benchview.JSONFormat\\tools\" -runtype ${runType}")
- batchFile("tests\\scripts\\run-xunit-perf.cmd -arch ${arch} -configuration ${configuration} ${testEnv} -testBinLoc bin\\tests\\${os}.${architecture}.${configuration}\\Jit\\Performance\\CodeQuality -uploadToBenchview \"%WORKSPACE%\\Microsoft.Benchview.JSONFormat\\tools\" -runtype ${runType}")
+ batchFile("tests\\runtest.cmd ${configuration} ${architecture} GenerateLayoutOnly")
+
+ // Run with just stopwatch: Profile=Off
+ batchFile("tests\\scripts\\run-xunit-perf.cmd -arch ${arch} -configuration ${configuration} -testBinLoc bin\\tests\\${os}.${architecture}.${configuration}\\performance\\perflab\\Perflab -library -generateBenchviewData \"%WORKSPACE%\\Microsoft.Benchview.JSONFormat\\tools\" ${uploadString} -runtype ${runType} -stabilityPrefix \"START \"CORECLR_PERF_RUN\" /B /WAIT /HIGH /AFFINITY 0x2\"")
+ batchFile("tests\\scripts\\run-xunit-perf.cmd -arch ${arch} -configuration ${configuration} -testBinLoc bin\\tests\\${os}.${architecture}.${configuration}\\Jit\\Performance\\CodeQuality -generateBenchviewData \"%WORKSPACE%\\Microsoft.Benchview.JSONFormat\\tools\" ${uploadString} -runtype ${runType} -stabilityPrefix \"START \"CORECLR_PERF_RUN\" /B /WAIT /HIGH /AFFINITY 0x2\"")
+ batchFile("tests\\scripts\\run-xunit-perf.cmd -arch ${arch} -configuration ${configuration} -testBinLoc bin\\tests\\${os}.${architecture}.${configuration}\\performance\\linkbench\\linkbench -generateBenchviewData \"%WORKSPACE%\\Microsoft.Benchview.JSONFormat\\tools\" ${uploadString} -nowarmup -runtype ${runType} -scenarioTest -group ILLink")
+
+ // Run with the full set of counters enabled: Profile=On
+ batchFile("tests\\scripts\\run-xunit-perf.cmd -arch ${arch} -configuration ${configuration} -testBinLoc bin\\tests\\${os}.${architecture}.${configuration}\\performance\\perflab\\Perflab -library -generateBenchviewData \"%WORKSPACE%\\Microsoft.Benchview.JSONFormat\\tools\" ${uploadString} -runtype ${runType} -collectionFlags default+BranchMispredictions+CacheMisses+InstructionRetired+gcapi -stabilityPrefix \"START \"CORECLR_PERF_RUN\" /B /WAIT /HIGH /AFFINITY 0x2\"")
+ batchFile("tests\\scripts\\run-xunit-perf.cmd -arch ${arch} -configuration ${configuration} -testBinLoc bin\\tests\\${os}.${architecture}.${configuration}\\Jit\\Performance\\CodeQuality -generateBenchviewData \"%WORKSPACE%\\Microsoft.Benchview.JSONFormat\\tools\" ${uploadString} -runtype ${runType} -collectionFlags default+BranchMispredictions+CacheMisses+InstructionRetired+gcapi -stabilityPrefix \"START \"CORECLR_PERF_RUN\" /B /WAIT /HIGH /AFFINITY 0x2\"")
+ }
}
- }
- // Save machinedata.json to /artifact/bin/ Jenkins dir
- def archiveSettings = new ArchivalSettings()
- archiveSettings.addFiles('Perf-*.xml')
- archiveSettings.addFiles('Perf-*.etl')
- Utilities.addArchival(newJob, archiveSettings)
+ if (isSmoketest)
+ {
+ Utilities.setMachineAffinity(newJob, "Windows_NT", '20170427-elevated')
+ }
+ // Save machinedata.json to /artifact/bin/ Jenkins dir
+ def archiveSettings = new ArchivalSettings()
+ archiveSettings.addFiles('Perf-*.xml')
+ archiveSettings.addFiles('Perf-*.etl')
+ archiveSettings.addFiles('Perf-*.log')
+ archiveSettings.addFiles('machinedata.json')
+ Utilities.addArchival(newJob, archiveSettings)
- Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
-
- newJob.with {
- wrappers {
- timeout {
- absolute(240)
+ Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
+
+ newJob.with {
+ wrappers {
+ timeout {
+ absolute(240)
+ }
}
}
- }
-
- if (isPR) {
- TriggerBuilder builder = TriggerBuilder.triggerOnPullRequest()
- builder.setGithubContext("${os} ${arch} CoreCLR Perf Tests")
- builder.triggerOnlyOnComment()
- builder.setCustomTriggerPhrase("(?i).*test\\W+${os}\\W+${arch}\\W+perf.*")
- builder.triggerForBranch(branch)
- builder.emitTrigger(newJob)
- }
- else {
- // Set a push trigger
- TriggerBuilder builder = TriggerBuilder.triggerOnCommit()
- builder.emitTrigger(newJob)
+
+ if (isPR) {
+ TriggerBuilder builder = TriggerBuilder.triggerOnPullRequest()
+ if (isSmoketest)
+ {
+ builder.setGithubContext("${os} ${arch} CoreCLR Perf Tests Correctness")
+ }
+ else
+ {
+ builder.setGithubContext("${os} ${arch} CoreCLR Perf Tests")
+ builder.triggerOnlyOnComment()
+ builder.setCustomTriggerPhrase("(?i).*test\\W+${os}\\W+${arch}\\W+perf.*")
+ }
+ builder.triggerForBranch(branch)
+ builder.emitTrigger(newJob)
+ }
+ else {
+ // Set a push trigger
+ TriggerBuilder builder = TriggerBuilder.triggerOnCommit()
+ builder.emitTrigger(newJob)
+ }
}
}
}
@@ -126,14 +166,9 @@ def static getOSGroup(def os) {
// Setup throughput perflab tests runs
[true, false].each { isPR ->
['Windows_NT'].each { os ->
- ['x64', 'x86', 'x86jit32'].each { arch ->
+ ['x64', 'x86'].each { arch ->
def architecture = arch
- if (arch == 'x86jit32')
- {
- architecture = 'x86'
- }
-
def newJob = job(Utilities.getFullJobName(project, "perf_throughput_perflab_${os}_${arch}", isPR)) {
// Set the label.
label('windows_clr_perf')
@@ -153,7 +188,7 @@ def static getOSGroup(def os) {
def configuration = 'Release'
def runType = isPR ? 'private' : 'rolling'
def benchViewName = isPR ? 'coreclr-throughput private %BenchviewCommitName%' : 'coreclr-throughput rolling %GIT_BRANCH_WITHOUT_ORIGIN% %GIT_COMMIT%'
-
+
steps {
// Batch
@@ -171,12 +206,6 @@ def static getOSGroup(def os) {
batchFile("py \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\machinedata.py\"")
batchFile("set __TestIntermediateDir=int&&build.cmd ${configuration} ${architecture} skiptests")
batchFile("tests\\runtest.cmd ${configuration} ${architecture} GenerateLayoutOnly")
- if (arch == 'x86jit32')
- {
- // Download package and copy compatjit into Core_Root
- batchFile("C:\\Tools\\nuget.exe install runtime.win7-${architecture}.Microsoft.NETCore.Jit -Source https://dotnet.myget.org/F/dotnet-core -OutputDirectory \"%WORKSPACE%\" -Prerelease -ExcludeVersion\n" +
- "xcopy \"%WORKSPACE%\\runtime.win7-x86.Microsoft.NETCore.Jit\\runtimes\\win7-x86\\native\\compatjit.dll\" \"%WORKSPACE%\\bin\\Product\\${os}.${architecture}.${configuration}\" /Y")
- }
batchFile("py -u tests\\scripts\\run-throughput-perf.py -arch ${arch} -os ${os} -configuration ${configuration} -clr_root \"%WORKSPACE%\" -assembly_root \"%WORKSPACE%\\Microsoft.BenchView.ThroughputBenchmarks.${architecture}.${os}\\lib\" -benchview_path \"%WORKSPACE%\\Microsoft.Benchview.JSONFormat\\tools\" -run_type ${runType}")
}
}
@@ -209,14 +238,14 @@ def static getOSGroup(def os) {
[true, false].each { isPR ->
['Ubuntu14.04'].each { os ->
def newJob = job(Utilities.getFullJobName(project, "perf_${os}", isPR)) {
-
+
label('linux_clr_perf')
- wrappers {
- credentialsBinding {
- string('BV_UPLOAD_SAS_TOKEN', 'CoreCLR Perf BenchView Sas')
- }
+ wrappers {
+ credentialsBinding {
+ string('BV_UPLOAD_SAS_TOKEN', 'CoreCLR Perf BenchView Sas')
}
-
+ }
+
if (isPR)
{
parameters
@@ -224,20 +253,27 @@ def static getOSGroup(def os) {
stringParam('BenchviewCommitName', '\${ghprbPullTitle}', 'The name that you will be used to build the full title of a run in Benchview. The final name will be of the form <branch> private BenchviewCommitName')
}
}
+
+ // Cap the maximum number of iterations to 21.
+ parameters {
+ stringParam('XUNIT_PERFORMANCE_MAX_ITERATION', '21', 'Sets the number of iterations to twenty one. We are doing this to limit the amount of data that we upload as 20 iterations is enought to get a good sample')
+ stringParam('XUNIT_PERFORMANCE_MAX_ITERATION_INNER_SPECIFIED', '21', 'Sets the number of iterations to twenty one. We are doing this to limit the amount of data that we upload as 20 iterations is enought to get a good sample')
+ }
+
def osGroup = getOSGroup(os)
def architecture = 'x64'
def configuration = 'Release'
def runType = isPR ? 'private' : 'rolling'
def benchViewName = isPR ? 'coreclr private \$BenchviewCommitName' : 'coreclr rolling \$GIT_BRANCH_WITHOUT_ORIGIN \$GIT_COMMIT'
-
+
steps {
- shell("bash ./tests/scripts/perf-prep.sh")
+ shell("./tests/scripts/perf-prep.sh")
shell("./init-tools.sh")
shell("./build.sh ${architecture} ${configuration}")
shell("GIT_BRANCH_WITHOUT_ORIGIN=\$(echo \$GIT_BRANCH | sed \"s/[^/]*\\/\\(.*\\)/\\1 /\")\n" +
"python3.5 \"\${WORKSPACE}/tests/scripts/Microsoft.BenchView.JSONFormat/tools/submission-metadata.py\" --name \" ${benchViewName} \" --user \"dotnet-bot@microsoft.com\"\n" +
"python3.5 \"\${WORKSPACE}/tests/scripts/Microsoft.BenchView.JSONFormat/tools/build.py\" git --branch \$GIT_BRANCH_WITHOUT_ORIGIN --type ${runType}")
- shell("""sudo -E bash ./tests/scripts/run-xunit-perf.sh \\
+ shell("""./tests/scripts/run-xunit-perf.sh \\
--testRootDir=\"\${WORKSPACE}/bin/tests/Windows_NT.${architecture}.${configuration}\" \\
--testNativeBinDir=\"\${WORKSPACE}/bin/obj/${osGroup}.${architecture}.${configuration}/tests\" \\
--coreClrBinDir=\"\${WORKSPACE}/bin/Product/${osGroup}.${architecture}.${configuration}\" \\
@@ -245,13 +281,16 @@ def static getOSGroup(def os) {
--coreFxBinDir=\"\${WORKSPACE}/corefx\" \\
--runType=\"${runType}\" \\
--benchViewOS=\"${os}\" \\
+ --generatebenchviewdata=\"\${WORKSPACE}/tests/scripts/Microsoft.BenchView.JSONFormat/tools\" \\
+ --stabilityPrefix=\"taskset 0x00000002 nice --adjustment=-10\" \\
--uploadToBenchview""")
}
}
// Save machinedata.json to /artifact/bin/ Jenkins dir
def archiveSettings = new ArchivalSettings()
- archiveSettings.addFiles('sandbox/perf-*.xml')
+ archiveSettings.addFiles('Perf-*.log')
+ archiveSettings.addFiles('Perf-*.xml')
archiveSettings.addFiles('machinedata.json')
Utilities.addArchival(newJob, archiveSettings)
@@ -287,14 +326,14 @@ def static getOSGroup(def os) {
[true, false].each { isPR ->
['Ubuntu14.04'].each { os ->
def newJob = job(Utilities.getFullJobName(project, "perf_throughput_${os}", isPR)) {
-
+
label('linux_clr_perf')
wrappers {
credentialsBinding {
string('BV_UPLOAD_SAS_TOKEN', 'CoreCLR Perf BenchView Sas')
}
}
-
+
if (isPR)
{
parameters
@@ -307,7 +346,7 @@ def static getOSGroup(def os) {
def configuration = 'Release'
def runType = isPR ? 'private' : 'rolling'
def benchViewName = isPR ? 'coreclr private \$BenchviewCommitName' : 'coreclr rolling \$GIT_BRANCH_WITHOUT_ORIGIN \$GIT_COMMIT'
-
+
steps {
shell("bash ./tests/scripts/perf-prep.sh --throughput")
shell("./init-tools.sh")
diff --git a/pgosupport.cmake b/pgosupport.cmake
index dbba415a61..90bcbc3876 100644
--- a/pgosupport.cmake
+++ b/pgosupport.cmake
@@ -20,6 +20,8 @@ function(add_pgo TargetName)
"${CLR_CMAKE_PACKAGES_DIR}/${CLR_CMAKE_OPTDATA_PACKAGEWITHRID}/${CLR_CMAKE_OPTDATA_VERSION}/data/${ProfileFileName}"
ProfilePath
)
+ # NuGet packages are restored to lowercase paths
+ string(TOLOWER "${ProfilePath}" ProfilePath)
if(CLR_CMAKE_PGO_INSTRUMENT)
if(WIN32)
@@ -40,7 +42,7 @@ function(add_pgo TargetName)
else(WIN32)
if(UPPERCASE_CMAKE_BUILD_TYPE STREQUAL RELEASE OR UPPERCASE_CMAKE_BUILD_TYPE STREQUAL RELWITHDEBINFO)
if(HAVE_LTO)
- target_compile_options(${TargetName} PRIVATE -flto -fprofile-instr-use=${ProfilePath})
+ target_compile_options(${TargetName} PRIVATE -flto -fprofile-instr-use=${ProfilePath} -Wno-profile-instr-out-of-date)
set_property(TARGET ${TargetName} APPEND_STRING PROPERTY LINK_FLAGS " -flto -fuse-ld=gold -fprofile-instr-use=${ProfilePath}")
endif(HAVE_LTO)
endif(UPPERCASE_CMAKE_BUILD_TYPE STREQUAL RELEASE OR UPPERCASE_CMAKE_BUILD_TYPE STREQUAL RELWITHDEBINFO)
diff --git a/run.cmd b/run.cmd
index 5327df4435..cab06d52dd 100644
--- a/run.cmd
+++ b/run.cmd
@@ -48,14 +48,17 @@ if NOT [%ERRORLEVEL%]==[0] (
exit /b 1
)
-:: Always copy over the Tools-Override
-xcopy %~dp0Tools-Override\* %~dp0Tools /y >nul
-
set _toolRuntime=%~dp0Tools
set _dotnet=%_toolRuntime%\dotnetcli\dotnet.exe
+set _json=%~dp0config.json
+
+:: run.exe depends on running in the root directory, notably because the config.json specifies
+:: a relative path to the binclash logger
+pushd %~dp0
echo Running: %_dotnet% %_toolRuntime%\run.exe %~dp0config.json %*
-call %_dotnet% %_toolRuntime%\run.exe %~dp0config.json %*
+call %_dotnet% %_toolRuntime%\run.exe "%_json%" %*
+popd
if NOT [%ERRORLEVEL%]==[0] (
exit /b 1
)
diff --git a/run.sh b/run.sh
index 2612c86f33..bd6a68f2bb 100755
--- a/run.sh
+++ b/run.sh
@@ -5,9 +5,6 @@ working_tree_root="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo "Running init-tools.sh"
$working_tree_root/init-tools.sh
-# Always copy over the Tools-Override
-cp $working_tree_root/Tools-Override/* $working_tree_root/Tools > /dev/null
-
toolRuntime=$working_tree_root/Tools
dotnet=$toolRuntime/dotnetcli/dotnet
diff --git a/src/.nuget/Microsoft.NETCore.Jit/runtime.Windows_NT.Microsoft.NETCore.Jit.props b/src/.nuget/Microsoft.NETCore.Jit/runtime.Windows_NT.Microsoft.NETCore.Jit.props
index c45358dec7..f31b152a79 100644
--- a/src/.nuget/Microsoft.NETCore.Jit/runtime.Windows_NT.Microsoft.NETCore.Jit.props
+++ b/src/.nuget/Microsoft.NETCore.Jit/runtime.Windows_NT.Microsoft.NETCore.Jit.props
@@ -2,7 +2,6 @@
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<NativeBinary Include="$(BinDir)clrjit.dll" />
- <NativeBinary Condition="'$(Platform)' == 'x86' and '$(PackageCompatJit)' != ''" Include="$(BinDir)compatjit.dll" />
<CrossArchitectureSpecificNativeFileAndSymbol Include="$(BinDir)$(CrossTargetComponentFolder)\clrjit.dll" />
<!-- prevent accidental inclusion in AOT projects. -->
diff --git a/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/runtime.Linux.Microsoft.NETCore.Runtime.CoreCLR.props b/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/runtime.Linux.Microsoft.NETCore.Runtime.CoreCLR.props
index 4ad2538826..5f244a911b 100644
--- a/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/runtime.Linux.Microsoft.NETCore.Runtime.CoreCLR.props
+++ b/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/runtime.Linux.Microsoft.NETCore.Runtime.CoreCLR.props
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
- <_PlatformDoesNotSupportNiFiles Condition="'$(Platform)' == 'arm'">true</_PlatformDoesNotSupportNiFiles>
- <_PlatformDoesNotSupportNiFiles Condition="'$(Platform)' == 'armel'">true</_PlatformDoesNotSupportNiFiles>
- <_PlatformDoesNotSupportNiFiles Condition="'$(Platform)' == 'x86'">true</_PlatformDoesNotSupportNiFiles>
+ <_PlatformDoesNotSupportCreatedump Condition="'$(Platform)' == 'arm'">true</_PlatformDoesNotSupportCreatedump>
+ <_PlatformDoesNotSupportCreatedump Condition="'$(Platform)' == 'armel'">true</_PlatformDoesNotSupportCreatedump>
+ <_PlatformDoesNotSupportCreatedump Condition="'$(Platform)' == 'x86'">true</_PlatformDoesNotSupportCreatedump>
+ <_PlatformDoesNotSupportCreatedump Condition="'$(_runtimeOSFamily)' == 'tizen'">true</_PlatformDoesNotSupportCreatedump>
<_PlatformDoesNotSupportEventTrace Condition="'$(_runtimeOSFamily)' == 'tizen'">true</_PlatformDoesNotSupportEventTrace>
<_PlatformDoesNotSupportEventTrace Condition="'$(Platform)' == 'x86'">true</_PlatformDoesNotSupportEventTrace>
</PropertyGroup>
@@ -17,8 +18,8 @@
<NativeBinary Include="$(BinDir)libsosplugin.so" />
<NativeBinary Include="$(BinDir)System.Globalization.Native.so" />
<NativeBinary Include="$(BinDir)sosdocsunix.txt" />
- <NativeBinary Condition="'$(_PlatformDoesNotSupportNiFiles)' != 'true'" Include="$(BinDir)System.Private.CoreLib.ni.dll" />
- <ArchitectureSpecificLibFile Include="$(BinDir)System.Private.CoreLib.dll" />
+ <NativeBinary Include="$(BinDir)System.Private.CoreLib.dll" />
+ <NativeBinary Condition="'$(_PlatformDoesNotSupportCreatedump)' != 'true'" Include="$(BinDir)createdump" />
<ArchitectureSpecificLibFile Include="$(BinDir)SOS.NETCore.dll" />
<ArchitectureSpecificToolFile Include="$(BinDir)crossgen" />
</ItemGroup>
diff --git a/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/runtime.OSX.Microsoft.NETCore.Runtime.CoreCLR.props b/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/runtime.OSX.Microsoft.NETCore.Runtime.CoreCLR.props
index b988a40745..ffb1c2d3f4 100644
--- a/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/runtime.OSX.Microsoft.NETCore.Runtime.CoreCLR.props
+++ b/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/runtime.OSX.Microsoft.NETCore.Runtime.CoreCLR.props
@@ -8,8 +8,7 @@
<NativeBinary Include="$(BinDir)libsos.dylib" />
<NativeBinary Include="$(BinDir)System.Globalization.Native.dylib" />
<NativeBinary Include="$(BinDir)sosdocsunix.txt" />
- <NativeBinary Include="$(BinDir)System.Private.CoreLib.ni.dll" />
- <ArchitectureSpecificLibFile Include="$(BinDir)System.Private.CoreLib.dll" />
+ <NativeBinary Include="$(BinDir)System.Private.CoreLib.dll" />
<ArchitectureSpecificLibFile Include="$(BinDir)SOS.NETCore.dll" />
<ArchitectureSpecificToolFile Include="$(BinDir)crossgen" />
</ItemGroup>
diff --git a/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/runtime.Windows_NT.Microsoft.NETCore.Runtime.CoreCLR.props b/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/runtime.Windows_NT.Microsoft.NETCore.Runtime.CoreCLR.props
index 436901ebd2..57cc46f86e 100644
--- a/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/runtime.Windows_NT.Microsoft.NETCore.Runtime.CoreCLR.props
+++ b/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/runtime.Windows_NT.Microsoft.NETCore.Runtime.CoreCLR.props
@@ -2,8 +2,8 @@
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PackageTargetRuntime>$(MinOSForArch)-$(PackagePlatform)</PackageTargetRuntime>
- <LongNamePlatform>$(PackagePlatform)</LongNamePlatform>
- <LongNamePlatform Condition="'$(LongNamePlatform)'=='x64'">amd64</LongNamePlatform>
+ <LongNamePlatform>$(Platform)</LongNamePlatform>
+ <LongNamePlatform Condition="'$(Platform)'=='x64'">amd64</LongNamePlatform>
<CrossTargetPlatform>$(CrossTargetComponentFolder)</CrossTargetPlatform>
<CrossTargetPlatform Condition="'$(CrossTargetPlatform)'=='x64'">amd64</CrossTargetPlatform>
<LongNameSuffix>_$(LongNamePlatform)_$(LongNamePlatform)_$(MajorVersion).$(MinorVersion).$(BuildNumberMajor).0$(BuildNumberMinor)</LongNameSuffix>
@@ -19,9 +19,8 @@
<NativeBinary Include="$(BinDir)mscorrc.debug.dll" />
<NativeBinary Include="$(BinDir)mscorrc.dll" />
<NativeBinary Include="$(BinDir)sos.dll" />
- <NativeBinary Include="$(BinDir)System.Private.CoreLib.ni.dll" />
<NativeBinary Include="$(UniversalCRTSDKDir)Redist\ucrt\DLLs\$(BuildArch)\*.dll" Condition="'$(BuildType)'=='Release' AND '$(BuildArch)' != 'arm64'" />
- <ArchitectureSpecificLibFile Include="$(BinDir)System.Private.CoreLib.dll" />
+ <NativeBinary Include="$(BinDir)System.Private.CoreLib.dll" />
<ArchitectureSpecificLibFile Include="$(BinDir)SOS.NETCore.dll" />
<ArchitectureSpecificToolFile Include="$(BinDir)crossgen.exe" />
<CrossArchitectureSpecificToolFile Include="$(BinDir)$(CrossTargetComponentFolder)\crossgen.exe" />
@@ -45,7 +44,7 @@
<LongNameFile Include="$(BinDir)$(CrossTargetComponentFolder)\mscordaccore.dll;
$(BinDir)$(CrossTargetComponentFolder)\sos.dll"
Condition="'$(HasCrossTargetComponents)'=='true'">
- <TargetPath>tools\$(CrossTargetComponentFolder)_$(PackagePlatform)\%(FileName)$(CrossTargetLongNameSuffix)%(Extension)</TargetPath>
+ <TargetPath>tools\$(CrossTargetComponentFolder)_$(Platform)\%(FileName)$(CrossTargetLongNameSuffix)%(Extension)</TargetPath>
</LongNameFile>
</ItemGroup>
</Project>
diff --git a/src/.nuget/ThirdPartyNotices.txt b/src/.nuget/ThirdPartyNotices.txt
deleted file mode 100644
index 55cfb20817..0000000000
--- a/src/.nuget/ThirdPartyNotices.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-This Microsoft .NET Library may incorporate components from the projects listed
-below. Microsoft licenses these components under the Microsoft .NET Library
-software license terms. The original copyright notices and the licenses under
-which Microsoft received such components are set forth below for informational
-purposes only. Microsoft reserves all rights not expressly granted herein,
-whether by implication, estoppel or otherwise.
-
-1. .NET Core (https://github.com/dotnet/core/)
-
-.NET Core
-Copyright (c) .NET Foundation and Contributors
-
-The MIT License (MIT)
-
-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. \ No newline at end of file
diff --git a/src/.nuget/dir.props b/src/.nuget/dir.props
index 59b94f75b2..2ff88d9bcf 100644
--- a/src/.nuget/dir.props
+++ b/src/.nuget/dir.props
@@ -26,8 +26,12 @@
<SupportedPackageOSGroups Condition="'$(SupportedPackageOSGroups)' == ''">Windows_NT;OSX;Linux</SupportedPackageOSGroups>
<SupportedPackageOSGroups>;$(SupportedPackageOSGroups);</SupportedPackageOSGroups>
+ <!-- Identify OS family based upon the RuntimeOS, which could be distro specific (e.g. osx.10.12) or
+ portable (e.g. osx).
+ -->
<_runtimeOSVersionIndex>$(RuntimeOS.IndexOfAny(".-0123456789"))</_runtimeOSVersionIndex>
<_runtimeOSFamily Condition="'$(_runtimeOSVersionIndex)' != '-1'">$(RuntimeOS.SubString(0, $(_runtimeOSVersionIndex)))</_runtimeOSFamily>
+ <_runtimeOSFamily Condition="'$(_runtimeOSVersionIndex)' == '-1'">$(RuntimeOS)</_runtimeOSFamily>
<_isSupportedOSGroup>true</_isSupportedOSGroup>
</PropertyGroup>
@@ -66,7 +70,7 @@
<RIDPlatform Condition="'$(ArchGroup)' == 'arm64'">win10</RIDPlatform>
<!-- Set the platform part of the RID if we are doing a portable build -->
- <RIDPlatform Condition="'$(PortableBuild)' == '1'">win</RIDPlatform>
+ <RIDPlatform Condition="'$(PortableBuild)' == 'true'">win</RIDPlatform>
<PackageRID>$(RIDPlatform)-$(ArchGroup)</PackageRID>
</PropertyGroup>
</When>
@@ -74,21 +78,21 @@
<PropertyGroup>
<PackageRID>osx.10.12-$(ArchGroup)</PackageRID>
<!-- Set the platform part of the RID if we are doing a portable build -->
- <PackageRID Condition="'$(PortableBuild)' == '1'">osx-$(ArchGroup)</PackageRID>
+ <PackageRID Condition="'$(PortableBuild)' == 'true'">osx-$(ArchGroup)</PackageRID>
</PropertyGroup>
</When>
<When Condition="'$(_runtimeOSFamily)' == 'rhel'">
<PropertyGroup>
<PackageRID>rhel.7-$(ArchGroup)</PackageRID>
<!-- Set the platform part of the RID if we are doing a portable build -->
- <PackageRID Condition="'$(PortableBuild)' == '1'">linux-$(ArchGroup)</PackageRID>
+ <PackageRID Condition="'$(PortableBuild)' == 'true'">linux-$(ArchGroup)</PackageRID>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<PackageRID>$(RuntimeOS)-$(ArchGroup)</PackageRID>
<!-- Set the platform part of the RID if we are doing a portable build -->
- <PackageRID Condition="'$(PortableBuild)' == '1'">linux-$(ArchGroup)</PackageRID>
+ <PackageRID Condition="'$(PortableBuild)' == 'true'">linux-$(ArchGroup)</PackageRID>
</PropertyGroup>
</Otherwise>
</Choose>
@@ -111,51 +115,22 @@
</Choose>
<ItemGroup Condition="$(SupportedPackageOSGroups.Contains(';Linux;'))">
- <OfficialBuildRID Include="alpine.3.4.3-x64" />
- <OfficialBuildRID Include="debian.8-armel">
- <Platform>armel</Platform>
- </OfficialBuildRID>
- <OfficialBuildRID Include="debian.8-x64" />
- <OfficialBuildRID Include="fedora.23-x64" />
- <OfficialBuildRID Include="fedora.24-x64" />
<OfficialBuildRID Include="linux-x64" />
<OfficialBuildRID Include="linux-arm">
<Platform>arm</Platform>
</OfficialBuildRID>
- <OfficialBuildRID Include="opensuse.42.1-x64" />
- <OfficialBuildRID Include="rhel.7-x64" />
<OfficialBuildRID Include="tizen.4.0.0-armel">
<Platform>armel</Platform>
</OfficialBuildRID>
- <OfficialBuildRID Include="ubuntu.14.04-arm">
- <Platform>arm</Platform>
- </OfficialBuildRID>
- <OfficialBuildRID Include="ubuntu.14.04-x64" />
- <OfficialBuildRID Include="ubuntu.16.04-arm">
- <Platform>arm</Platform>
- </OfficialBuildRID>
- <OfficialBuildRID Include="ubuntu.16.04-x64" />
- <OfficialBuildRID Include="ubuntu.16.10-x64" />
</ItemGroup>
<ItemGroup Condition="$(SupportedPackageOSGroups.Contains(';OSX;'))">
- <OfficialBuildRID Include="osx.10.12-x64" />
<OfficialBuildRID Include="osx-x64" />
</ItemGroup>
<ItemGroup Condition="$(SupportedPackageOSGroups.Contains(';Windows_NT;'))">
- <OfficialBuildRID Include="win7-x86">
- <Platform>x86</Platform>
- </OfficialBuildRID>
<OfficialBuildRID Include="win-x86">
<Platform>x86</Platform>
</OfficialBuildRID>
- <OfficialBuildRID Include="win7-x64" />
<OfficialBuildRID Include="win-x64" />
- <OfficialBuildRID Include="win8-arm">
- <Platform>arm</Platform>
- </OfficialBuildRID>
- <OfficialBuildRID Include="win10-arm64">
- <Platform>arm64</Platform>
- </OfficialBuildRID>
<OfficialBuildRID Include="win-arm">
<Platform>arm</Platform>
</OfficialBuildRID>
diff --git a/src/.nuget/dir.targets b/src/.nuget/dir.targets
index 49e550a4b7..447b071a56 100644
--- a/src/.nuget/dir.targets
+++ b/src/.nuget/dir.targets
@@ -32,10 +32,10 @@
<ItemGroup Condition="'$(HasCrossTargetComponents)'=='true'">
<NativeWithSymbolFile Include="@(CrossArchitectureSpecificNativeFileAndSymbol)">
- <TargetPath>runtimes/$(CrossTargetComponentFolder)_$(PackagePlatform)/native</TargetPath>
+ <TargetPath>runtimes/$(CrossTargetComponentFolder)_$(Platform)/native</TargetPath>
</NativeWithSymbolFile>
<NativeWithSymbolFile Include="@(CrossArchitectureSpecificToolFile)">
- <TargetPath>tools/$(CrossTargetComponentFolder)_$(PackagePlatform)</TargetPath>
+ <TargetPath>tools/$(CrossTargetComponentFolder)_$(Platform)</TargetPath>
</NativeWithSymbolFile>
</ItemGroup>
@@ -84,5 +84,19 @@
</ItemGroup>
</Target>
+ <!-- OverrideLicenseUrl is temporary till we update the buildtools to v2 -->
+ <Target Name="OverrideLicenseUrl" BeforeTargets="GenerateNuSpec">
+ <PropertyGroup>
+ <LicenseUrl>https://github.com/dotnet/coreclr/blob/master/LICENSE.TXT</LicenseUrl>
+ </PropertyGroup>
+ </Target>
+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)\.., dir.targets))\dir.targets" />
+ <ItemGroup>
+ <!-- Add version file to packages -->
+ <File Condition="Exists('$(SyncInfoFile)')"
+ Include="$(SyncInfoFile)">
+ <SkipPackageFileCheck>true</SkipPackageFileCheck>
+ </File>
+ </ItemGroup>
</Project>
diff --git a/src/.nuget/dotnet_library_license.txt b/src/.nuget/dotnet_library_license.txt
deleted file mode 100644
index 9953cbbffb..0000000000
--- a/src/.nuget/dotnet_library_license.txt
+++ /dev/null
@@ -1,127 +0,0 @@
-MICROSOFT SOFTWARE LICENSE TERMS
-
-
-MICROSOFT .NET LIBRARY
-
-These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its affiliates) and you. Please read them. They apply to the software named above, which includes the media on which you received it, if any. The terms also apply to any Microsoft
-
-- updates,
-
-- supplements,
-
-- Internet-based services, and
-
-- support services
-
-for this software, unless other terms accompany those items. If so, those terms apply.
-
-BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS. IF YOU DO NOT ACCEPT THEM, DO NOT USE THE SOFTWARE.
-
-
-IF YOU COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE PERPETUAL RIGHTS BELOW.
-
-1. INSTALLATION AND USE RIGHTS.
-
-a. Installation and Use. You may install and use any number of copies of the software to design, develop and test your programs.
-
-b. Third Party Programs. The software may include third party programs that Microsoft, not the third party, licenses to you under this agreement. Notices, if any, for the third party program are included for your information only.
-
-2. ADDITIONAL LICENSING REQUIREMENTS AND/OR USE RIGHTS.
-
-a. DISTRIBUTABLE CODE. The software is comprised of Distributable Code. "Distributable Code" is code that you are permitted to distribute in programs you develop if you comply with the terms below.
-
-i. Right to Use and Distribute.
-
-- You may copy and distribute the object code form of the software.
-
-- Third Party Distribution. You may permit distributors of your programs to copy and distribute the Distributable Code as part of those programs.
-
-ii. Distribution Requirements. For any Distributable Code you distribute, you must
-
-- add significant primary functionality to it in your programs;
-
-- require distributors and external end users to agree to terms that protect it at least as much as this agreement;
-
-- display your valid copyright notice on your programs; and
-
-- indemnify, defend, and hold harmless Microsoft from any claims, including attorneys' fees, related to the distribution or use of your programs.
-
-iii. Distribution Restrictions. You may not
-
-- alter any copyright, trademark or patent notice in the Distributable Code;
-
-- use Microsoft's trademarks in your programs' names or in a way that suggests your programs come from or are endorsed by Microsoft;
-
-- include Distributable Code in malicious, deceptive or unlawful programs; or
-
-- modify or distribute the source code of any Distributable Code so that any part of it becomes subject to an Excluded License. An Excluded License is one that requires, as a condition of use, modification or distribution, that
-
-- the code be disclosed or distributed in source code form; or
-
-- others have the right to modify it.
-
-3. SCOPE OF LICENSE. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. Unless applicable law gives you more rights despite this limitation, you may use the software only as expressly permitted in this agreement. In doing so, you must comply with any technical limitations in the software that only allow you to use it in certain ways. You may not
-
-- work around any technical limitations in the software;
-
-- reverse engineer, decompile or disassemble the software, except and only to the extent that applicable law expressly permits, despite this limitation;
-
-- publish the software for others to copy;
-
-- rent, lease or lend the software;
-
-- transfer the software or this agreement to any third party; or
-
-- use the software for commercial software hosting services.
-
-4. BACKUP COPY. You may make one backup copy of the software. You may use it only to reinstall the software.
-
-5. DOCUMENTATION. Any person that has valid access to your computer or internal network may copy and use the documentation for your internal, reference purposes.
-
-6. EXPORT RESTRICTIONS. The software is subject to United States export laws and regulations. You must comply with all domestic and international export laws and regulations that apply to the software. These laws include restrictions on destinations, end users and end use. For additional information, see www.microsoft.com/exporting.
-
-7. SUPPORT SERVICES. Because this software is "as is," we may not provide support services for it.
-
-8. ENTIRE AGREEMENT. This agreement, and the terms for supplements, updates, Internet-based services and support services that you use, are the entire agreement for the software and support services.
-
-9. APPLICABLE LAW.
-
-a. United States. If you acquired the software in the United States, Washington state law governs the interpretation of this agreement and applies to claims for breach of it, regardless of conflict of laws principles. The laws of the state where you live govern all other claims, including claims under state consumer protection laws, unfair competition laws, and in tort.
-
-b. Outside the United States. If you acquired the software in any other country, the laws of that country apply.
-
-10. LEGAL EFFECT. This agreement describes certain legal rights. You may have other rights under the laws of your country. You may also have rights with respect to the party from whom you acquired the software. This agreement does not change your rights under the laws of your country if the laws of your country do not permit it to do so.
-
-11. DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED "AS-IS." YOU BEAR THE RISK OF USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES, GUARANTEES OR CONDITIONS. YOU MAY HAVE ADDITIONAL CONSUMER RIGHTS OR STATUTORY GUARANTEES UNDER YOUR LOCAL LAWS WHICH THIS AGREEMENT CANNOT CHANGE. TO THE EXTENT PERMITTED UNDER YOUR LOCAL LAWS, MICROSOFT EXCLUDES THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-
-FOR AUSTRALIA - YOU HAVE STATUTORY GUARANTEES UNDER THE AUSTRALIAN CONSUMER LAW AND NOTHING IN THESE TERMS IS INTENDED TO AFFECT THOSE RIGHTS.
-
-12. LIMITATION ON AND EXCLUSION OF REMEDIES AND DAMAGES. YOU CAN RECOVER FROM MICROSOFT AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP TO U.S. $5.00. YOU CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL, LOST PROFITS, SPECIAL, INDIRECT OR INCIDENTAL DAMAGES.
-
-This limitation applies to
-
-- anything related to the software, services, content (including code) on third party Internet sites, or third party programs; and
-
-- claims for breach of contract, breach of warranty, guarantee or condition, strict liability, negligence, or other tort to the extent permitted by applicable law.
-
-It also applies even if Microsoft knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your country may not allow the exclusion or limitation of incidental, consequential or other damages.
-
-Please note: As this software is distributed in Quebec, Canada, some of the clauses in this agreement are provided below in French.
-
-Remarque : Ce logiciel etant distribue au Quebec, Canada, certaines des clauses dans ce contrat sont fournies ci-dessous en francais.
-
-EXONERATION DE GARANTIE. Le logiciel vise par une licence est offert << tel quel >>. Toute utilisation de ce logiciel est a votre seule risque et peril. Microsoft n'accorde aucune autre garantie expresse. Vous pouvez beneficier de droits additionnels en vertu du droit local sur la protection des consommateurs, que ce contrat ne peut modifier. La ou elles sont permises par le droit locale, les garanties implicites de qualite marchande, d'adequation a un usage particulier et d'absence de contrefacon sont exclues.
-
-LIMITATION DES DOMMAGES-INTERETS ET EXCLUSION DE RESPONSABILITE POUR LES DOMMAGES. Vous pouvez obtenir de Microsoft et de ses fournisseurs une indemnisation en cas de dommages directs uniquement a hauteur de 5,00 $ US. Vous ne pouvez pretendre a aucune indemnisation pour les autres dommages, y compris les dommages speciaux, indirects ou accessoires et pertes de benefices.
-
-Cette limitation concerne :
-
-- tout ce qui est relie au logiciel, aux services ou au contenu (y compris le code) figurant sur des sites Internet tiers ou dans des programmes tiers ; et
-
-- les reclamations au titre de violation de contrat ou de garantie, ou au titre de responsabilite stricte, de negligence ou d'une autre faute dans la limite autorisee par la loi en vigueur.
-
-Elle s'applique egalement, meme si Microsoft connaissait ou devrait connaitre l'eventualite d'un tel dommage. Si votre pays n'autorise pas l'exclusion ou la limitation de responsabilite pour les dommages indirects, accessoires ou de quelque nature que ce soit, il se peut que la limitation ou l'exclusion ci-dessus ne s'appliquera pas a votre egard.
-
-EFFET JURIDIQUE. Le present contrat decrit certains droits juridiques. Vous pourriez avoir d'autres droits prevus par les lois de votre pays. Le present contrat ne modifie pas les droits que vous conferent les lois de votre pays si celles-ci ne le permettent pas.
-
-
diff --git a/tests/src/Common/external/external.csproj b/src/.nuget/init/init.csproj
index f7fa75ed32..115090dd76 100644
--- a/tests/src/Common/external/external.csproj
+++ b/src/.nuget/init/init.csproj
@@ -5,9 +5,20 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<CLRTestKind>BuildOnly</CLRTestKind>
- <NugetTargetMoniker>.NETCoreApp,Version=v1.1</NugetTargetMoniker>
+ </PropertyGroup>
+ <ItemGroup>
+ <PackageReference Include="Microsoft.NETCore.Platforms">
+ <Version>$(RuntimeIdGraphDefinitionVersion)</Version>
+ </PackageReference>
+ </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.0</TargetFramework>
+ <TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier>
+ <PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8</PackageTargetFallback>
+ <ContainsPackageReferences>true</ContainsPackageReferences>
+ <PrereleaseResolveNuGetPackages>false</PrereleaseResolveNuGetPackages>
</PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<Target Name="Build"
DependsOnTargets="ResolveReferences" />
-</Project> \ No newline at end of file
+</Project>
diff --git a/src/.nuget/init/project.json b/src/.nuget/init/project.json
deleted file mode 100644
index 5908fcc3f9..0000000000
--- a/src/.nuget/init/project.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "dependencies": {
- "Microsoft.NETCore.Platforms": "1.0.2-beta-24224-02"
- },
- "frameworks": {
- "dnxcore50": {
- "imports": "portable-net45+win8"
- }
- },
-} \ No newline at end of file
diff --git a/src/.nuget/init/readme.txt b/src/.nuget/init/readme.txt
deleted file mode 100644
index 6792dd555f..0000000000
--- a/src/.nuget/init/readme.txt
+++ /dev/null
@@ -1 +0,0 @@
-Please keep the package details listed in project.json in sync with <repo_root>/dir.props. \ No newline at end of file
diff --git a/src/.nuget/optdata/nuget.config b/src/.nuget/optdata/nuget.config
new file mode 100644
index 0000000000..e747f7ecb9
--- /dev/null
+++ b/src/.nuget/optdata/nuget.config
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+ <packageSources>
+ <add key="myget.org dotnet-core-optimization-data" value="https://dotnet.myget.org/F/dotnet-core-optimization-data/api/v3/index.json" />
+ </packageSources>
+</configuration>
diff --git a/src/.nuget/optdata/optdata.csproj b/src/.nuget/optdata/optdata.csproj
new file mode 100644
index 0000000000..20e2a40ada
--- /dev/null
+++ b/src/.nuget/optdata/optdata.csproj
@@ -0,0 +1,24 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+
+ <PropertyGroup>
+ <TargetFramework>netstandard</TargetFramework>
+ <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
+ <RuntimeIdentifiers>win7-x64;win7-x86;linux-x64</RuntimeIdentifiers>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <PackageReference Include="optimization.PGO.CoreCLR" Version="$(PgoDataPackageVersion)" Condition="'$(PgoDataPackageVersion)'!=''" />
+ <PackageReference Include="optimization.IBC.CoreCLR" Version="$(IbcDataPackageVersion)" Condition="'$(IbcDataPackageVersion)'!=''" />
+ </ItemGroup>
+
+ <Target Name="DumpPgoDataPackageVersion">
+ <Message Importance="high" Text="$(PgoDataPackageVersion)" />
+ </Target>
+
+ <Target Name="DumpIbcDataPackageVersion">
+ <Message Importance="high" Text="$(IbcDataPackageVersion)" />
+ </Target>
+
+</Project>
diff --git a/src/.nuget/packages.builds b/src/.nuget/packages.builds
index f57b9a9b50..0c0f65d3c1 100644
--- a/src/.nuget/packages.builds
+++ b/src/.nuget/packages.builds
@@ -25,5 +25,9 @@
<Project Include="Microsoft.NETCore.ILDAsm\Microsoft.NETCore.ILDAsm.builds" />
</ItemGroup>
+ <Import Project="$(ToolsDir)versioning.targets" />
+ <!-- Make sure we create version.txt file since it will be packaged -->
+ <Target Name="EnsureVersionInfoFileExists" BeforeTargets="Build" DependsOnTargets="CreateVersionInfoFile" />
+
<Import Project="$(MSBuildThisFileDirectory)..\..\dir.traversal.targets" />
</Project>
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 9598d0c36b..b761b6a82d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -149,11 +149,6 @@ add_subdirectory(utilcode)
add_subdirectory(gcinfo)
add_subdirectory(coreclr)
add_subdirectory(jit)
-
-if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/jit32")
- add_subdirectory(jit32)
-endif()
-
add_subdirectory(gc)
add_subdirectory(vm)
add_subdirectory(md)
diff --git a/src/ToolBox/SOS/NETCore/SOS.NETCore.csproj b/src/ToolBox/SOS/NETCore/SOS.NETCore.csproj
index 440cff5d82..c579b59dc0 100644
--- a/src/ToolBox/SOS/NETCore/SOS.NETCore.csproj
+++ b/src/ToolBox/SOS/NETCore/SOS.NETCore.csproj
@@ -11,13 +11,15 @@
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<NoStdLib>true</NoStdLib>
<NoCompilerStandardLib>true</NoCompilerStandardLib>
- <UseOpenKey Condition="'$(UseOpenKey)'==''">true</UseOpenKey>
+ <IsDotNetFrameworkProductAssembly>true</IsDotNetFrameworkProductAssembly>
+ <AssemblyKey>Open</AssemblyKey>
+ <ExcludeMscorlibFacade>true</ExcludeMscorlibFacade>
+ <ContainsPackageReferences>true</ContainsPackageReferences>
<!-- We don't use any of MSBuild's resolution logic for resolving the framework, so just set these two properties to any folder that exists to skip
the GenerateReferenceAssemblyPaths task (not target) and to prevent it from outputting a warning (MSB3644). -->
<_TargetFrameworkDirectories>$(MSBuildThisFileDirectory)/Documentation</_TargetFrameworkDirectories>
<_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory)/Documentation</_FullFrameworkReferenceAssemblyPaths>
-
</PropertyGroup>
<!-- Default configurations to help VS understand the options -->
@@ -39,8 +41,25 @@
<Compile Include="SymbolReader.cs" />
</ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.0</TargetFramework>
+ <TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier>
+ <PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8</PackageTargetFallback>
+ </PropertyGroup>
+
<ItemGroup>
- <None Include="project.json" />
+ <PackageReference Include="Microsoft.NETCore.Platforms">
+ <Version>$(RuntimeIdGraphDefinitionVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="System.IO.FileSystem">
+ <Version>4.0.1</Version>
+ </PackageReference>
+ <PackageReference Include="System.Runtime.InteropServices">
+ <Version>4.1.0</Version>
+ </PackageReference>
+ <PackageReference Include="System.Reflection.Metadata">
+ <Version>1.4.1</Version>
+ </PackageReference>
</ItemGroup>
<Target Name="CopyItemsToDirectory" AfterTargets="Build">
@@ -52,7 +71,7 @@
UseHardlinksIfPossible="false">
</Copy>
- <Copy
+ <Copy
SourceFiles="$(OutputPath)$(AssemblyName).pdb"
DestinationFolder="$(BinDir)\PDB"
SkipUnchangedFiles="false"
diff --git a/src/ToolBox/SOS/NETCore/project.json b/src/ToolBox/SOS/NETCore/project.json
deleted file mode 100644
index a92b173569..0000000000
--- a/src/ToolBox/SOS/NETCore/project.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "dependencies": {
- "Microsoft.NETCore.Platforms": "1.0.1",
- "System.IO.FileSystem": "4.0.1",
- "System.Runtime.InteropServices": "4.1.0",
- "System.Reflection.Metadata": "1.4.1"
- },
- "frameworks": {
- "netcoreapp1.0": {
- "imports": [
- "portable-net45+win8"
- ]
- }
- }
-}
diff --git a/src/ToolBox/SOS/Strike/sosdocsunix.txt b/src/ToolBox/SOS/Strike/sosdocsunix.txt
index 517227c092..e9fd59cd5f 100644
--- a/src/ToolBox/SOS/Strike/sosdocsunix.txt
+++ b/src/ToolBox/SOS/Strike/sosdocsunix.txt
@@ -623,6 +623,7 @@ createdump [options] [dumpFileName]
-n - create minidump.
-h - create minidump with heap (default).
-t - create triage minidump.
+-f - create full core dump (everything).
-d - enable diagnostic messages.
Creates a platform (ELF core on Linux, etc.) minidump. The pid can be placed in the dump
diff --git a/src/ToolBox/SOS/Strike/strike.cpp b/src/ToolBox/SOS/Strike/strike.cpp
index 0d5d8c3b8b..1fff17fb26 100644
--- a/src/ToolBox/SOS/Strike/strike.cpp
+++ b/src/ToolBox/SOS/Strike/strike.cpp
@@ -14385,6 +14385,7 @@ DECLARE_API(CreateDump)
BOOL normal = FALSE;
BOOL withHeap = FALSE;
BOOL triage = FALSE;
+ BOOL full = FALSE;
BOOL diag = FALSE;
size_t nArg = 0;
@@ -14393,6 +14394,7 @@ DECLARE_API(CreateDump)
{"-n", &normal, COBOOL, FALSE},
{"-h", &withHeap, COBOOL, FALSE},
{"-t", &triage, COBOOL, FALSE},
+ {"-f", &full, COBOOL, FALSE},
{"-d", &diag, COBOOL, FALSE},
};
CMDValue arg[] =
@@ -14407,7 +14409,11 @@ DECLARE_API(CreateDump)
ULONG pid = 0;
g_ExtSystem->GetCurrentProcessId(&pid);
- if (withHeap)
+ if (full)
+ {
+ minidumpType = MiniDumpWithFullMemory;
+ }
+ else if (withHeap)
{
minidumpType = MiniDumpWithPrivateReadWriteMemory;
}
diff --git a/src/ToolBox/SOS/lldbplugin/CMakeLists.txt b/src/ToolBox/SOS/lldbplugin/CMakeLists.txt
index f0c2176fe2..fe816abebd 100644
--- a/src/ToolBox/SOS/lldbplugin/CMakeLists.txt
+++ b/src/ToolBox/SOS/lldbplugin/CMakeLists.txt
@@ -45,7 +45,6 @@ elseif(CLR_CMAKE_PLATFORM_ARCH_ARM64)
SET(REQUIRE_LLDBPLUGIN false)
endif()
-
set(LLVM_HOST_DIR "$ENV{LLVM_HOME}")
set(WITH_LLDB_LIBS "${LLVM_HOST_DIR}/lib" CACHE PATH "Path to LLDB libraries")
set(WITH_LLDB_INCLUDES "${LLVM_HOST_DIR}/include" CACHE PATH "Path to LLDB headers")
@@ -54,20 +53,22 @@ if(NOT ENABLE_LLDBPLUGIN)
return()
endif()
-# Check for LLDB library
-find_library(LLDB NAMES LLDB lldb lldb-4.0 lldb-3.9 lldb-3.8 lldb-3.7 lldb-3.6 lldb-3.5 PATHS "${WITH_LLDB_LIBS}" PATH_SUFFIXES llvm NO_DEFAULT_PATH)
-find_library(LLDB NAMES LLDB lldb lldb-4.0 lldb-3.8 lldb-3.7 lldb-3.6 lldb-3.5 PATH_SUFFIXES llvm)
-if(LLDB STREQUAL LLDB-NOTFOUND)
- if(REQUIRE_LLDBPLUGIN)
- set(MESSAGE_MODE FATAL_ERROR)
- else()
- set(MESSAGE_MODE WARNING)
+if (CLR_CMAKE_PLATFORM_DARWIN)
+ # Check for LLDB library
+ find_library(LLDB NAMES LLDB lldb lldb-4.0 lldb-3.9 lldb-3.8 lldb-3.7 lldb-3.6 lldb-3.5 PATHS "${WITH_LLDB_LIBS}" PATH_SUFFIXES llvm NO_DEFAULT_PATH)
+ find_library(LLDB NAMES LLDB lldb lldb-4.0 lldb-3.9 lldb-3.8 lldb-3.7 lldb-3.6 lldb-3.5 PATH_SUFFIXES llvm)
+ if(LLDB STREQUAL LLDB-NOTFOUND)
+ if(REQUIRE_LLDBPLUGIN)
+ set(MESSAGE_MODE FATAL_ERROR)
+ else()
+ set(MESSAGE_MODE WARNING)
+ endif()
+ message(${MESSAGE_MODE} "Cannot find lldb-3.5, lldb-3.6, lldb-3.8, lldb-3.9 or lldb-4.0. Try installing lldb-3.6-dev (or the appropriate package for your platform)")
+ return()
endif()
- message(${MESSAGE_MODE} "Cannot find lldb-3.5, lldb-3.6, lldb-3.8, lldb-3.9 or lldb-4.0. Try installing lldb-3.6-dev (or the appropriate package for your platform)")
- return()
-endif()
-message(STATUS "LLDB: ${LLDB}")
+ message(STATUS "LLDB: ${LLDB}")
+endif()
# Check for LLDB headers
# Multiple versions of LLDB can install side-by-side, so we need to check for lldb in various locations.
@@ -120,8 +121,8 @@ endif(UPPERCASE_CMAKE_BUILD_TYPE STREQUAL DEBUG OR UPPERCASE_CMAKE_BUILD_TYPE ST
_add_library(sosplugin SHARED ${SOURCES})
add_dependencies(sosplugin sos)
-if (CLR_CMAKE_PLATFORM_UNIX)
- target_link_libraries(sosplugin ${LLDB})
+if (CLR_CMAKE_PLATFORM_DARWIN)
+ target_link_libraries(sosplugin ${LLDB})
endif()
# add the install targets
diff --git a/src/binder/assemblybinder.cpp b/src/binder/assemblybinder.cpp
index a73f79fb65..73ea025ae8 100644
--- a/src/binder/assemblybinder.cpp
+++ b/src/binder/assemblybinder.cpp
@@ -685,26 +685,21 @@ namespace BINDER_SPACE
StackSString sCoreLib;
- // At run-time, System.Private.CoreLib.ni.dll is typically always available, and
- // System.Private.CoreLib.dll is typically not. So check for the NI first.
+ // At run-time, System.Private.CoreLib.dll is expected to be the NI image.
sCoreLib = sCoreLibDir;
- sCoreLib.Append(CoreLibName_NI_W);
- if (!fBindToNativeImage || FAILED(AssemblyBinder::GetAssembly(sCoreLib,
- FALSE /* fInspectionOnly */,
- TRUE /* fIsInGAC */,
- TRUE /* fExplicitBindToNativeImage */,
- &pSystemAssembly)))
- {
- // If System.Private.CoreLib.ni.dll is unavailable, look for System.Private.CoreLib.dll instead
- sCoreLib = sCoreLibDir;
- sCoreLib.Append(CoreLibName_IL_W);
- IF_FAIL_GO(AssemblyBinder::GetAssembly(sCoreLib,
+ sCoreLib.Append(CoreLibName_IL_W);
+ BOOL fExplicitBindToNativeImage = (fBindToNativeImage == true)? TRUE:FALSE;
+#ifdef FEATURE_NI_BIND_FALLBACK
+ // Some non-Windows platforms do not automatically generate the NI image as CoreLib.dll.
+ // If those platforms also do not support automatic fallback from NI to IL, bind as IL.
+ fExplicitBindToNativeImage = FALSE;
+#endif // FEATURE_NI_BIND_FALLBACK
+ IF_FAIL_GO(AssemblyBinder::GetAssembly(sCoreLib,
FALSE /* fInspectionOnly */,
TRUE /* fIsInGAC */,
- FALSE /* fExplicitBindToNativeImage */,
+ fExplicitBindToNativeImage,
&pSystemAssembly));
- }
-
+
*ppSystemAssembly = pSystemAssembly.Extract();
Exit:
@@ -1601,8 +1596,13 @@ namespace BINDER_SPACE
IF_FAIL_GO(BinderHasNativeHeader(pNativePEImage, &hasHeader));
if (!hasHeader)
{
- pPEImage = pNativePEImage;
- pNativePEImage = NULL;
+ BinderReleasePEImage(pPEImage);
+ BinderReleasePEImage(pNativePEImage);
+
+ BINDER_LOG_ENTER(W("BinderAcquirePEImageIL"));
+ hr = BinderAcquirePEImage(szAssemblyPath, &pPEImage, &pNativePEImage, false);
+ BINDER_LOG_LEAVE_HR(W("BinderAcquirePEImageIL"), hr);
+ IF_FAIL_GO(hr);
}
}
diff --git a/src/build.proj b/src/build.proj
index 5da94e44c1..7962d27e99 100644
--- a/src/build.proj
+++ b/src/build.proj
@@ -17,13 +17,21 @@
</Target>
<ItemGroup>
+ <ILToCopy Include="$(BinDir)System.Private.CoreLib.dll"/>
<PDBSToMove Include="$(BinDir)System.Private.CoreLib.pdb"/>
</ItemGroup>
<PropertyGroup>
+ <CoreLibPath>$(BinDir)System.Private.CoreLib.dll</CoreLibPath>
<CoreLibPDBPath>$(BinDir)System.Private.CoreLib.pdb</CoreLibPDBPath>
</PropertyGroup>
+ <Target Name="CopyCoreLib" AfterTargets="Build">
+ <Copy Condition="Exists($(CoreLibPath))"
+ SourceFiles="@(ILToCopy)"
+ DestinationFolder="$(BinDir)IL" />
+ </Target>
+
<Target Name="MovePDB" AfterTargets="Build">
<Move Condition="Exists($(CoreLibPDBPath))"
SourceFiles="@(PDBSToMove)"
diff --git a/src/classlibnative/bcltype/arraynative.cpp b/src/classlibnative/bcltype/arraynative.cpp
index c54d2f3c31..232f59dfca 100644
--- a/src/classlibnative/bcltype/arraynative.cpp
+++ b/src/classlibnative/bcltype/arraynative.cpp
@@ -319,14 +319,16 @@ ArrayNative::AssignArrayEnum ArrayNative::CanAssignArrayTypeNoGC(const BASEARRAY
return AssignDontKnow;
}
- const CorElementType srcElType = srcTH.GetSignatureCorElementType();
- const CorElementType destElType = destTH.GetSignatureCorElementType();
+ const CorElementType srcElType = srcTH.GetVerifierCorElementType();
+ const CorElementType destElType = destTH.GetVerifierCorElementType();
_ASSERTE(srcElType < ELEMENT_TYPE_MAX);
_ASSERTE(destElType < ELEMENT_TYPE_MAX);
// Copying primitives from one type to another
if (CorTypeInfo::IsPrimitiveType_NoThrow(srcElType) && CorTypeInfo::IsPrimitiveType_NoThrow(destElType))
{
+ if (srcElType == destElType)
+ return AssignWillWork;
if (InvokeUtil::CanPrimitiveWiden(destElType, srcElType))
return AssignPrimitiveWiden;
else
@@ -349,10 +351,6 @@ ArrayNative::AssignArrayEnum ArrayNative::CanAssignArrayTypeNoGC(const BASEARRAY
if (srcTH.IsInterface() && destElType != ELEMENT_TYPE_VALUETYPE)
return AssignMustCast;
- // Enum is stored as a primitive of type dest.
- if (srcTH.IsEnum() && srcTH.GetInternalCorElementType() == destElType)
- return AssignWillWork;
-
return AssignDontKnow;
}
@@ -405,14 +403,16 @@ ArrayNative::AssignArrayEnum ArrayNative::CanAssignArrayType(const BASEARRAYREF
return AssignWrongType;
}
- const CorElementType srcElType = srcTH.GetSignatureCorElementType();
- const CorElementType destElType = destTH.GetSignatureCorElementType();
+ const CorElementType srcElType = srcTH.GetVerifierCorElementType();
+ const CorElementType destElType = destTH.GetVerifierCorElementType();
_ASSERTE(srcElType < ELEMENT_TYPE_MAX);
_ASSERTE(destElType < ELEMENT_TYPE_MAX);
// Copying primitives from one type to another
if (CorTypeInfo::IsPrimitiveType_NoThrow(srcElType) && CorTypeInfo::IsPrimitiveType_NoThrow(destElType))
{
+ if (srcElType == destElType)
+ return AssignWillWork;
if (InvokeUtil::CanPrimitiveWiden(destElType, srcElType))
return AssignPrimitiveWiden;
else
@@ -435,10 +435,6 @@ ArrayNative::AssignArrayEnum ArrayNative::CanAssignArrayType(const BASEARRAYREF
if (srcTH.IsInterface() && destElType != ELEMENT_TYPE_VALUETYPE)
return AssignMustCast;
- // Enum is stored as a primitive of type dest.
- if (srcTH.IsEnum() && srcTH.GetInternalCorElementType() == destElType)
- return AssignWillWork;
-
return AssignWrongType;
}
@@ -631,8 +627,8 @@ void ArrayNative::PrimitiveWiden(BASEARRAYREF pSrc, unsigned int srcIndex, BASEA
TypeHandle srcTH = pSrc->GetArrayElementTypeHandle();
TypeHandle destTH = pDest->GetArrayElementTypeHandle();
- const CorElementType srcElType = srcTH.GetSignatureCorElementType();
- const CorElementType destElType = destTH.GetSignatureCorElementType();
+ const CorElementType srcElType = srcTH.GetVerifierCorElementType();
+ const CorElementType destElType = destTH.GetVerifierCorElementType();
const unsigned int srcSize = GetSizeForCorElementType(srcElType);
const unsigned int destSize = GetSizeForCorElementType(destElType);
diff --git a/src/corefx/System.Globalization.Native/icushim.h b/src/corefx/System.Globalization.Native/icushim.h
index 408ec15edd..313002ebb6 100644
--- a/src/corefx/System.Globalization.Native/icushim.h
+++ b/src/corefx/System.Globalization.Native/icushim.h
@@ -32,6 +32,8 @@
#include <unicode/usearch.h>
#include <unicode/utf16.h>
#include <unicode/utypes.h>
+#include <unicode/urename.h>
+#include <unicode/ustring.h>
// List of all functions from the ICU libraries that are used in the System.Globalization.Native.so
#define FOR_ALL_UNCONDITIONAL_ICU_FUNCTIONS \
diff --git a/src/createVersionFile.proj b/src/createVersionFile.proj
new file mode 100644
index 0000000000..4edddc7118
--- /dev/null
+++ b/src/createVersionFile.proj
@@ -0,0 +1,13 @@
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+ <Import Project="..\dir.props" />
+ <Import Project="$(ToolsDir)versioning.targets" Condition="Exists('$(ToolsDir)versioning.targets')"/>
+
+ <PropertyGroup>
+ <VersionPropsImported>false</VersionPropsImported>
+ </PropertyGroup>
+
+ <Target Name="Build"
+ DependsOnTargets="CreateOrUpdateCurrentVersionFile">
+ </Target>
+</Project> \ No newline at end of file
diff --git a/src/debug/createdump/CMakeLists.txt b/src/debug/createdump/CMakeLists.txt
index 5b5ec0a5c6..4272cfcb87 100644
--- a/src/debug/createdump/CMakeLists.txt
+++ b/src/debug/createdump/CMakeLists.txt
@@ -2,6 +2,17 @@ project(createdump)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
+# Set the RPATH of createdump so that it can find dependencies without needing to set LD_LIBRARY_PATH
+# For more information: http://www.cmake.org/Wiki/CMake_RPATH_handling.
+if (CORECLR_SET_RPATH)
+ set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
+ if(CLR_CMAKE_PLATFORM_DARWIN)
+ set(CMAKE_INSTALL_RPATH "@loader_path")
+ else()
+ set(CMAKE_INSTALL_RPATH "\$ORIGIN")
+ endif(CLR_CMAKE_PLATFORM_DARWIN)
+endif (CORECLR_SET_RPATH)
+
remove_definitions(-DUNICODE)
remove_definitions(-D_UNICODE)
diff --git a/src/debug/createdump/crashinfo.cpp b/src/debug/createdump/crashinfo.cpp
index cae8857d65..b825f4d301 100644
--- a/src/debug/createdump/crashinfo.cpp
+++ b/src/debug/createdump/crashinfo.cpp
@@ -155,33 +155,68 @@ CrashInfo::GatherCrashInfo(const char* programPath, MINIDUMP_TYPE minidumpType)
{
return false;
}
- // Get shared module debug info
- if (!GetDSOInfo())
- {
- return false;
- }
// Gather all the module memory mappings (from /dev/$pid/maps)
if (!EnumerateModuleMappings())
{
return false;
}
- // Gather all the useful memory regions from the DAC
- if (!EnumerateMemoryRegionsWithDAC(programPath, minidumpType))
+ // Get shared module debug info
+ if (!GetDSOInfo())
{
return false;
}
- // Add the thread's stack and some code memory to core
- for (ThreadInfo* thread : m_threads)
+ // If full memory dump, include everything regardless of permissions
+ if (minidumpType & MiniDumpWithFullMemory)
+ {
+ for (const MemoryRegion& region : m_moduleMappings)
+ {
+ if (ValidRegion(region))
+ {
+ InsertMemoryRegion(region);
+ }
+ }
+ for (const MemoryRegion& region : m_otherMappings)
+ {
+ if (ValidRegion(region))
+ {
+ InsertMemoryRegion(region);
+ }
+ }
+ }
+ else
{
- uint64_t start;
- size_t size;
+ // Add all the heap (read/write) memory regions but not the modules' r/w data segments
+ if (minidumpType & MiniDumpWithPrivateReadWriteMemory)
+ {
+ for (const MemoryRegion& region : m_otherMappings)
+ {
+ if (region.Permissions() == (PF_R | PF_W))
+ {
+ if (ValidRegion(region))
+ {
+ InsertMemoryRegion(region);
+ }
+ }
+ }
+ }
+ // Gather all the useful memory regions from the DAC
+ if (!EnumerateMemoryRegionsWithDAC(programPath, minidumpType))
+ {
+ return false;
+ }
+ // Add the thread's stack and some code memory to core
+ for (ThreadInfo* thread : m_threads)
+ {
+ uint64_t start;
+ size_t size;
- // Add the thread's stack and some of the code
- thread->GetThreadStack(*this, &start, &size);
- InsertMemoryRegion(start, size);
+ // Add the thread's stack and some of the code
+ thread->GetThreadStack(*this, &start, &size);
+ InsertMemoryRegion(start, size);
- thread->GetThreadCode(&start, &size);
- InsertMemoryRegion(start, size);
+ thread->GetThreadCode(&start, &size);
+ InsertMemoryRegion(start, size);
+ }
}
// Join all adjacent memory regions
CombineMemoryRegions();
@@ -240,7 +275,7 @@ CrashInfo::EnumerateModuleMappings()
// Here we read /proc/<pid>/maps file in order to parse it and figure out what it says
// about a library we are looking for. This file looks something like this:
//
- // [address] [perms] [offset] [dev] [inode] [pathname] - HEADER is not preset in an actual file
+ // [address] [perms] [offset] [dev] [inode] [pathname] - HEADER is not preset in an actual file
//
// 35b1800000-35b1820000 r-xp 00000000 08:02 135522 /usr/lib64/ld-2.15.so
// 35b1a1f000-35b1a20000 r--p 0001f000 08:02 135522 /usr/lib64/ld-2.15.so
@@ -282,8 +317,8 @@ CrashInfo::EnumerateModuleMappings()
char* permissions = nullptr;
char* moduleName = nullptr;
- int c = 0;
- if ((c = sscanf(line, "%lx-%lx %m[-rwxsp] %lx %*[:0-9a-f] %*d %ms\n", &start, &end, &permissions, &offset, &moduleName)) == 5)
+ int c = sscanf(line, "%lx-%lx %m[-rwxsp] %lx %*[:0-9a-f] %*d %ms\n", &start, &end, &permissions, &offset, &moduleName);
+ if (c == 4 || c == 5)
{
if (linuxGateAddress != nullptr && reinterpret_cast<void*>(start) == linuxGateAddress)
{
@@ -335,60 +370,6 @@ CrashInfo::EnumerateModuleMappings()
}
bool
-CrashInfo::EnumerateMemoryRegionsWithDAC(const char* programPath, MINIDUMP_TYPE minidumpType)
-{
- PFN_CLRDataCreateInstance pfnCLRDataCreateInstance = nullptr;
- ICLRDataEnumMemoryRegions *clrDataEnumRegions = nullptr;
- HMODULE hdac = nullptr;
- HRESULT hr = S_OK;
- bool result = false;
-
- // We assume that the DAC is in the same location as this createdump exe
- std::string dacPath;
- dacPath.append(programPath);
- dacPath.append("/");
- dacPath.append(MAKEDLLNAME_A("mscordaccore"));
-
- // Load and initialize the DAC
- hdac = LoadLibraryA(dacPath.c_str());
- if (hdac == nullptr)
- {
- fprintf(stderr, "LoadLibraryA(%s) FAILED %d\n", dacPath.c_str(), GetLastError());
- goto exit;
- }
- pfnCLRDataCreateInstance = (PFN_CLRDataCreateInstance)GetProcAddress(hdac, "CLRDataCreateInstance");
- if (pfnCLRDataCreateInstance == nullptr)
- {
- fprintf(stderr, "GetProcAddress(CLRDataCreateInstance) FAILED %d\n", GetLastError());
- goto exit;
- }
- hr = pfnCLRDataCreateInstance(__uuidof(ICLRDataEnumMemoryRegions), m_dataTarget, (void**)&clrDataEnumRegions);
- if (FAILED(hr))
- {
- fprintf(stderr, "CLRDataCreateInstance(ICLRDataEnumMemoryRegions) FAILED %08x\n", hr);
- goto exit;
- }
- // Calls CrashInfo::EnumMemoryRegion for each memory region found by the DAC
- hr = clrDataEnumRegions->EnumMemoryRegions(this, minidumpType, CLRDATA_ENUM_MEM_DEFAULT);
- if (FAILED(hr))
- {
- fprintf(stderr, "EnumMemoryRegions FAILED %08x\n", hr);
- goto exit;
- }
- result = true;
-exit:
- if (clrDataEnumRegions != nullptr)
- {
- clrDataEnumRegions->Release();
- }
- if (hdac != nullptr)
- {
- FreeLibrary(hdac);
- }
- return result;
-}
-
-bool
CrashInfo::GetDSOInfo()
{
Phdr* phdrAddr = reinterpret_cast<Phdr*>(m_auxvValues[AT_PHDR]);
@@ -453,24 +434,87 @@ CrashInfo::GetDSOInfo()
}
// Add the DSO link_map entries
+ ArrayHolder<char> moduleName = new char[PATH_MAX];
for (struct link_map* linkMapAddr = debugEntry.r_map; linkMapAddr != nullptr;) {
struct link_map map;
if (!ReadMemory(linkMapAddr, &map, sizeof(map))) {
return false;
}
- char moduleName[257] = { 0 };
+ int i = 0;
if (map.l_name != nullptr) {
- if (!ReadMemory(map.l_name, &moduleName, sizeof(moduleName) - 1)) {
- return false;
+ for (; i < PATH_MAX; i++)
+ {
+ if (!ReadMemory(map.l_name + i, &moduleName[i], 1)) {
+ TRACE("DSO: ReadMemory link_map name %p + %d FAILED\n", map.l_name, i);
+ break;
+ }
+ if (moduleName[i] == '\0') {
+ break;
+ }
}
}
- TRACE("DSO: link_map entry %p l_ld %p l_addr %lx %s\n", linkMapAddr, map.l_ld, map.l_addr, moduleName);
+ moduleName[i] = '\0';
+ TRACE("DSO: link_map entry %p l_ld %p l_addr %lx %s\n", linkMapAddr, map.l_ld, map.l_addr, (char*)moduleName);
linkMapAddr = map.l_next;
}
return true;
}
+bool
+CrashInfo::EnumerateMemoryRegionsWithDAC(const char* programPath, MINIDUMP_TYPE minidumpType)
+{
+ PFN_CLRDataCreateInstance pfnCLRDataCreateInstance = nullptr;
+ ICLRDataEnumMemoryRegions *clrDataEnumRegions = nullptr;
+ HMODULE hdac = nullptr;
+ HRESULT hr = S_OK;
+ bool result = false;
+
+ // We assume that the DAC is in the same location as this createdump exe
+ std::string dacPath;
+ dacPath.append(programPath);
+ dacPath.append("/");
+ dacPath.append(MAKEDLLNAME_A("mscordaccore"));
+
+ // Load and initialize the DAC
+ hdac = LoadLibraryA(dacPath.c_str());
+ if (hdac == nullptr)
+ {
+ fprintf(stderr, "LoadLibraryA(%s) FAILED %d\n", dacPath.c_str(), GetLastError());
+ goto exit;
+ }
+ pfnCLRDataCreateInstance = (PFN_CLRDataCreateInstance)GetProcAddress(hdac, "CLRDataCreateInstance");
+ if (pfnCLRDataCreateInstance == nullptr)
+ {
+ fprintf(stderr, "GetProcAddress(CLRDataCreateInstance) FAILED %d\n", GetLastError());
+ goto exit;
+ }
+ hr = pfnCLRDataCreateInstance(__uuidof(ICLRDataEnumMemoryRegions), m_dataTarget, (void**)&clrDataEnumRegions);
+ if (FAILED(hr))
+ {
+ fprintf(stderr, "CLRDataCreateInstance(ICLRDataEnumMemoryRegions) FAILED %08x\n", hr);
+ goto exit;
+ }
+ // Calls CrashInfo::EnumMemoryRegion for each memory region found by the DAC
+ hr = clrDataEnumRegions->EnumMemoryRegions(this, minidumpType, CLRDATA_ENUM_MEM_DEFAULT);
+ if (FAILED(hr))
+ {
+ fprintf(stderr, "EnumMemoryRegions FAILED %08x\n", hr);
+ goto exit;
+ }
+ result = true;
+exit:
+ if (clrDataEnumRegions != nullptr)
+ {
+ clrDataEnumRegions->Release();
+ }
+ if (hdac != nullptr)
+ {
+ FreeLibrary(hdac);
+ }
+ return result;
+}
+
//
// ReadMemory from target and add to memory regions list
//
@@ -480,6 +524,7 @@ CrashInfo::ReadMemory(void* address, void* buffer, size_t size)
uint32_t read = 0;
if (FAILED(m_dataTarget->ReadVirtual(reinterpret_cast<CLRDATA_ADDRESS>(address), reinterpret_cast<PBYTE>(buffer), size, &read)))
{
+ fprintf(stderr, "ReadMemory(%p, %lx) FAILED\n", address, size);
return false;
}
InsertMemoryRegion(reinterpret_cast<uint64_t>(address), size);
@@ -501,38 +546,67 @@ CrashInfo::InsertMemoryRegion(uint64_t address, size_t size)
uint64_t end = ((address + size) + (PAGE_SIZE - 1)) & PAGE_MASK;
assert(end > 0);
- MemoryRegion memoryRegionFull(start, end);
+ MemoryRegion region(start, end);
+ InsertMemoryRegion(region);
+}
+//
+// Add a memory region to the list
+//
+void
+CrashInfo::InsertMemoryRegion(const MemoryRegion& region)
+{
// First check if the full memory region can be added without conflicts
- const auto& found = m_memoryRegions.find(memoryRegionFull);
+ const auto& found = m_memoryRegions.find(region);
if (found == m_memoryRegions.end())
{
// Add full memory region
- m_memoryRegions.insert(memoryRegionFull);
+ m_memoryRegions.insert(region);
}
else
{
// The memory region is not wholely contained in region found
- if (!found->Contains(memoryRegionFull))
+ if (!found->Contains(region))
{
+ uint64_t start = region.StartAddress();
+
// The region overlaps/conflicts with one already in the set so
// add one page at a time to avoid the overlapping pages.
- uint64_t numberPages = (end - start) >> PAGE_SHIFT;
+ uint64_t numberPages = region.Size() >> PAGE_SHIFT;
for (int p = 0; p < numberPages; p++, start += PAGE_SIZE)
{
- MemoryRegion memoryRegion(start, start + PAGE_SIZE);
+ MemoryRegion memoryRegionPage(start, start + PAGE_SIZE);
- const auto& found = m_memoryRegions.find(memoryRegion);
+ const auto& found = m_memoryRegions.find(memoryRegionPage);
if (found == m_memoryRegions.end())
{
- m_memoryRegions.insert(memoryRegion);
+ m_memoryRegions.insert(memoryRegionPage);
}
}
}
}
}
+bool
+CrashInfo::ValidRegion(const MemoryRegion& region)
+{
+ uint64_t start = region.StartAddress();
+ uint64_t numberPages = region.Size() >> PAGE_SHIFT;
+
+ for (int p = 0; p < numberPages; p++, start += PAGE_SIZE)
+ {
+ BYTE buffer[1];
+ uint32_t read;
+
+ if (FAILED(m_dataTarget->ReadVirtual(start, buffer, 1, &read)))
+ {
+ return false;
+ }
+ }
+ return true;
+}
+
//
// Combine any adjacent memory regions into one
//
diff --git a/src/debug/createdump/crashinfo.h b/src/debug/createdump/crashinfo.h
index 40d7f5da45..914a88e8dd 100644
--- a/src/debug/createdump/crashinfo.h
+++ b/src/debug/createdump/crashinfo.h
@@ -65,9 +65,11 @@ public:
private:
bool GetAuxvEntries();
bool EnumerateModuleMappings();
- bool EnumerateMemoryRegionsWithDAC(const char* programPath, MINIDUMP_TYPE minidumpType);
bool GetDSOInfo();
+ bool EnumerateMemoryRegionsWithDAC(const char* programPath, MINIDUMP_TYPE minidumpType);
bool ReadMemory(void* address, void* buffer, size_t size);
void InsertMemoryRegion(uint64_t address, size_t size);
+ void InsertMemoryRegion(const MemoryRegion& region);
+ bool ValidRegion(const MemoryRegion& region);
void CombineMemoryRegions();
};
diff --git a/src/debug/createdump/createdump.cpp b/src/debug/createdump/createdump.cpp
index 0a95e535aa..f6ea1db7de 100644
--- a/src/debug/createdump/createdump.cpp
+++ b/src/debug/createdump/createdump.cpp
@@ -15,8 +15,8 @@ CreateDumpCommon(const char* programPath, const char* dumpPathTemplate, MINIDUMP
ReleaseHolder<DumpWriter> dumpWriter = new DumpWriter(*crashInfo);
bool result = false;
- ArrayHolder<char> dumpPath = new char[MAX_LONGPATH];
- snprintf(dumpPath, MAX_LONGPATH, dumpPathTemplate, crashInfo->Pid());
+ ArrayHolder<char> dumpPath = new char[PATH_MAX];
+ snprintf(dumpPath, PATH_MAX, dumpPathTemplate, crashInfo->Pid());
const char* dumpType = "minidump";
switch (minidumpType)
@@ -29,6 +29,10 @@ CreateDumpCommon(const char* programPath, const char* dumpPathTemplate, MINIDUMP
dumpType = "triage minidump";
break;
+ case MiniDumpWithFullMemory:
+ dumpType = "full dump";
+ break;
+
default:
break;
}
diff --git a/src/debug/createdump/datatarget.cpp b/src/debug/createdump/datatarget.cpp
index 38505e2d45..9609fa30a7 100644
--- a/src/debug/createdump/datatarget.cpp
+++ b/src/debug/createdump/datatarget.cpp
@@ -159,7 +159,6 @@ DumpDataTarget::ReadVirtual(
size_t read = pread64(m_fd, buffer, size, (off64_t)address);
if (read == -1)
{
- fprintf(stderr, "ReadVirtual FAILED %016lx %08x\n", address, size);
*done = 0;
return E_FAIL;
}
diff --git a/src/debug/createdump/dumpwriter.cpp b/src/debug/createdump/dumpwriter.cpp
index 9057d180e1..69f0ece8af 100644
--- a/src/debug/createdump/dumpwriter.cpp
+++ b/src/debug/createdump/dumpwriter.cpp
@@ -209,7 +209,7 @@ DumpWriter::WriteDump()
// Write all the thread's state and registers
for (const ThreadInfo* thread : m_crashInfo.Threads())
{
- if (!WriteThread(*thread, 0)) {
+ if (!WriteThread(*thread, SIGABRT)) {
return false;
}
}
diff --git a/src/debug/createdump/main.cpp b/src/debug/createdump/main.cpp
index 03382779a5..cb4d3c6fce 100644
--- a/src/debug/createdump/main.cpp
+++ b/src/debug/createdump/main.cpp
@@ -9,6 +9,7 @@ const char* g_help = "createdump [options] pid\n"
"-n, --normal - create minidump.\n"
"-h, --withheap - create minidump with heap (default).\n"
"-t, --triage - create triage minidump.\n"
+"-u, --full - create full core dump.\n"
"-d, --diag - enable diagnostic messages.\n";
bool CreateDumpCommon(const char* programPath, const char* dumpPathTemplate, MINIDUMP_TYPE minidumpType, CrashInfo* crashInfo);
@@ -60,6 +61,10 @@ int __cdecl main(const int argc, const char* argv[])
{
minidumpType = MiniDumpFilterTriage;
}
+ else if ((strcmp(*argv, "-u") == 0) || (strcmp(*argv, "--full") == 0))
+ {
+ minidumpType = MiniDumpWithFullMemory;
+ }
else if ((strcmp(*argv, "-d") == 0) || (strcmp(*argv, "--diag") == 0))
{
g_diagnostics = true;
diff --git a/src/debug/createdump/memoryregion.h b/src/debug/createdump/memoryregion.h
index 16c4d1c693..1332ab1416 100644
--- a/src/debug/createdump/memoryregion.h
+++ b/src/debug/createdump/memoryregion.h
@@ -36,35 +36,12 @@ public:
assert((end & ~PAGE_MASK) == 0);
}
- const uint32_t Permissions() const
- {
- return m_permissions;
- }
-
- const uint64_t StartAddress() const
- {
- return m_startAddress;
- }
-
- const uint64_t EndAddress() const
- {
- return m_endAddress;
- }
-
- const uint64_t Size() const
- {
- return m_endAddress - m_startAddress;
- }
-
- const uint64_t Offset() const
- {
- return m_offset;
- }
-
- const char* FileName() const
- {
- return m_fileName;
- }
+ const uint32_t Permissions() const { return m_permissions; }
+ const uint64_t StartAddress() const { return m_startAddress; }
+ const uint64_t EndAddress() const { return m_endAddress; }
+ const uint64_t Size() const { return m_endAddress - m_startAddress; }
+ const uint64_t Offset() const { return m_offset; }
+ const char* FileName() const { return m_fileName; }
bool operator<(const MemoryRegion& rhs) const
{
@@ -88,10 +65,10 @@ public:
void Print() const
{
if (m_fileName != nullptr) {
- TRACE("%016lx - %016lx (%04ld) %016lx %x %s\n", m_startAddress, m_endAddress, (Size() >> PAGE_SHIFT), m_offset, m_permissions, m_fileName);
+ TRACE("%016lx - %016lx (%06ld) %016lx %x %s\n", m_startAddress, m_endAddress, (Size() >> PAGE_SHIFT), m_offset, m_permissions, m_fileName);
}
else {
- TRACE("%016lx - %016lx (%04ld) %02x\n", m_startAddress, m_endAddress, (Size() >> PAGE_SHIFT), m_permissions);
+ TRACE("%016lx - %016lx (%06ld) %x\n", m_startAddress, m_endAddress, (Size() >> PAGE_SHIFT), m_permissions);
}
}
};
diff --git a/src/debug/createdump/threadinfo.cpp b/src/debug/createdump/threadinfo.cpp
index 8e73fcf2cb..e2c10fc4b7 100644
--- a/src/debug/createdump/threadinfo.cpp
+++ b/src/debug/createdump/threadinfo.cpp
@@ -38,7 +38,7 @@ ThreadInfo::Initialize(ICLRDataTarget* dataTarget)
return false;
}
}
- TRACE("Thread %04x RIP %016llx RSP %016llx\n", m_tid, m_gpRegisters.rip, m_gpRegisters.rsp);
+ TRACE("Thread %04x RIP %016llx RSP %016llx\n", m_tid, (unsigned long long)m_gpRegisters.rip, (unsigned long long)m_gpRegisters.rsp);
return true;
}
diff --git a/src/debug/daccess/daccess.cpp b/src/debug/daccess/daccess.cpp
index dcf6314549..14ce251bfc 100644
--- a/src/debug/daccess/daccess.cpp
+++ b/src/debug/daccess/daccess.cpp
@@ -6305,8 +6305,6 @@ bool ClrDataAccess::ReportMem(TADDR addr, TSIZE_T size, bool fExpectSuccess /*=
status = m_enumMemCb->EnumMemoryRegion(TO_CDADDR(addr), enumSize);
if (status != S_OK)
{
- m_memStatus = status;
-
// If dump generation was cancelled, allow us to throw upstack so we'll actually quit.
if ((fExpectSuccess) && (status != COR_E_OPERATIONCANCELED))
return false;
diff --git a/src/debug/daccess/dacimpl.h b/src/debug/daccess/dacimpl.h
index 635be80232..cd133ebf1e 100644
--- a/src/debug/daccess/dacimpl.h
+++ b/src/debug/daccess/dacimpl.h
@@ -1432,7 +1432,6 @@ private:
ICLRMetadataLocator * m_legacyMetaDataLocator;
LONG m_refs;
- HRESULT m_memStatus;
MDImportsCache m_mdImports;
ICLRDataEnumMemoryRegionsCallback* m_enumMemCb;
ICLRDataEnumMemoryRegionsCallback2* m_updateMemCb;
diff --git a/src/debug/daccess/enummem.cpp b/src/debug/daccess/enummem.cpp
index 9305bba488..ebe0fc87bb 100644
--- a/src/debug/daccess/enummem.cpp
+++ b/src/debug/daccess/enummem.cpp
@@ -374,7 +374,6 @@ HRESULT ClrDataAccess::EnumMemoryRegionsWorkerHeap(IN CLRDataEnumMemoryFlags fla
// now dump the memory get dragged in by using DAC API implicitly.
m_dumpStats.m_cbImplicity = m_instances.DumpAllInstances(m_enumMemCb);
- status = m_memStatus;
// Do not let any remaining implicitly enumerated memory leak out.
Flush();
@@ -394,7 +393,7 @@ HRESULT ClrDataAccess::DumpManagedObject(CLRDataEnumMemoryFlags flags, OBJECTREF
{
SUPPORTS_DAC;
- HRESULT status = S_OK;
+ HRESULT status = S_OK;
if (objRef == NULL)
{
@@ -1616,7 +1615,6 @@ HRESULT ClrDataAccess::EnumMemoryRegionsWorkerSkinny(IN CLRDataEnumMemoryFlags f
// now dump the memory get dragged in by using DAC API implicitly.
m_dumpStats.m_cbImplicity = m_instances.DumpAllInstances(m_enumMemCb);
- status = m_memStatus;
// Do not let any remaining implicitly enumerated memory leak out.
Flush();
@@ -1667,7 +1665,6 @@ HRESULT ClrDataAccess::EnumMemoryRegionsWorkerMicroTriage(IN CLRDataEnumMemoryFl
// now dump the memory get dragged in by using DAC API implicitly.
m_dumpStats.m_cbImplicity = m_instances.DumpAllInstances(m_enumMemCb);
- status = m_memStatus;
// Do not let any remaining implicitly enumerated memory leak out.
Flush();
@@ -1811,8 +1808,6 @@ HRESULT ClrDataAccess::EnumMemoryRegionsWorkerCustom()
status = E_INVALIDARG;
}
- status = m_memStatus;
-
return S_OK;
}
@@ -1935,7 +1930,6 @@ ClrDataAccess::EnumMemoryRegions(IN ICLRDataEnumMemoryRegionsCallback* callback,
// We should not be trying to enumerate while we have an enumeration outstanding
_ASSERTE(m_enumMemCb==NULL);
- m_memStatus = S_OK;
m_enumMemCb = callback;
// QI for ICLRDataEnumMemoryRegionsCallback2 will succeed only for Win8+.
diff --git a/src/debug/di/cordb.cpp b/src/debug/di/cordb.cpp
index e6ed44ddb9..ae74c34b54 100644
--- a/src/debug/di/cordb.cpp
+++ b/src/debug/di/cordb.cpp
@@ -20,6 +20,13 @@
#include "dbgtransportmanager.h"
#endif // FEATURE_DBGIPC_TRANSPORT_DI
+#if defined(PLATFORM_UNIX) || defined(__ANDROID__)
+// Local (in-process) debugging is not supported for UNIX and Android.
+#define SUPPORT_LOCAL_DEBUGGING 0
+#else
+#define SUPPORT_LOCAL_DEBUGGING 1
+#endif
+
//********** Globals. *********************************************************
#ifndef FEATURE_PAL
HINSTANCE g_hInst; // Instance handle to this piece of code.
@@ -499,7 +506,7 @@ DbiGetThreadContext(HANDLE hThread,
DT_CONTEXT *lpContext)
{
// if we aren't local debugging this isn't going to work
-#if !defined(_ARM_) || defined(FEATURE_DBGIPC_TRANSPORT_DI) || defined(__ANDROID__)
+#if !defined(_ARM_) || defined(FEATURE_DBGIPC_TRANSPORT_DI) || !SUPPORT_LOCAL_DEBUGGING
_ASSERTE(!"Can't use local GetThreadContext remotely, this needed to go to datatarget");
return FALSE;
#else
@@ -538,7 +545,7 @@ BOOL
DbiSetThreadContext(HANDLE hThread,
const DT_CONTEXT *lpContext)
{
-#if !defined(_ARM_) || defined(FEATURE_DBGIPC_TRANSPORT_DI) || defined(__ANDROID__)
+#if !defined(_ARM_) || defined(FEATURE_DBGIPC_TRANSPORT_DI) || !SUPPORT_LOCAL_DEBUGGING
_ASSERTE(!"Can't use local GetThreadContext remotely, this needed to go to datatarget");
return FALSE;
#else
diff --git a/src/debug/shared/amd64/primitives.cpp b/src/debug/shared/amd64/primitives.cpp
index fb5d95b0d6..6fead570cf 100644
--- a/src/debug/shared/amd64/primitives.cpp
+++ b/src/debug/shared/amd64/primitives.cpp
@@ -63,7 +63,7 @@ void CORDbgCopyThreadContext(DT_CONTEXT* pDst, const DT_CONTEXT* pSrc)
if ((dstFlags & srcFlags & CONTEXT_FLOATING_POINT) == CONTEXT_FLOATING_POINT)
{
// Xmm0-Xmm15
- CopyContextChunk(&(pDst->Xmm0), &(pSrc->Xmm0), &(pDst->Xmm15) + sizeof(M128A),
+ CopyContextChunk(&(pDst->Xmm0), &(pSrc->Xmm0), &(pDst->Xmm15) + 1,
CONTEXT_FLOATING_POINT);
// MxCsr
diff --git a/src/dlls/mscordac/mscordac_unixexports.src b/src/dlls/mscordac/mscordac_unixexports.src
index b0c3b0463c..9881def613 100644
--- a/src/dlls/mscordac/mscordac_unixexports.src
+++ b/src/dlls/mscordac/mscordac_unixexports.src
@@ -39,6 +39,7 @@ PAL_fprintf
PAL__wcstoui64
PAL_wcstoul
PAL_iswprint
+PAL_VirtualReserveFromExecutableMemoryAllocatorWithinRange
PAL_wcslen
PAL_wcsncmp
PAL_wcsrchr
diff --git a/src/dlls/mscoree/CMakeLists.txt b/src/dlls/mscoree/CMakeLists.txt
index b9c129db5e..8fc3ebfb41 100644
--- a/src/dlls/mscoree/CMakeLists.txt
+++ b/src/dlls/mscoree/CMakeLists.txt
@@ -22,6 +22,11 @@ else()
set (DEF_SOURCES
mscorwks_unixexports.src
)
+if(FEATURE_GDBJIT)
+ list(APPEND DEF_SOURCES
+ gdbjit_unixexports.src
+ )
+endif(FEATURE_GDBJIT)
endif(WIN32)
convert_to_absolute_path(DEF_SOURCES ${DEF_SOURCES})
diff --git a/src/dlls/mscoree/coreclr/CMakeLists.txt b/src/dlls/mscoree/coreclr/CMakeLists.txt
index afa253f08f..7a4617fc52 100644
--- a/src/dlls/mscoree/coreclr/CMakeLists.txt
+++ b/src/dlls/mscoree/coreclr/CMakeLists.txt
@@ -141,6 +141,12 @@ if(CLR_CMAKE_PLATFORM_UNIX AND FEATURE_EVENT_TRACE)
)
endif(CLR_CMAKE_PLATFORM_UNIX AND FEATURE_EVENT_TRACE)
+if(CLR_CMAKE_PLATFORM_LINUX)
+ list(APPEND CORECLR_LIBRARIES
+ eventpipe
+ )
+endif(CLR_CMAKE_PLATFORM_LINUX)
+
target_link_libraries(coreclr ${CORECLR_LIBRARIES})
if(WIN32)
diff --git a/src/dlls/mscoree/gdbjit_unixexports.src b/src/dlls/mscoree/gdbjit_unixexports.src
new file mode 100644
index 0000000000..b820aebf9b
--- /dev/null
+++ b/src/dlls/mscoree/gdbjit_unixexports.src
@@ -0,0 +1,3 @@
+; exported for GDBJIT
+__jit_debug_register_code
+__jit_debug_descriptor \ No newline at end of file
diff --git a/src/dlls/mscorpe/iceefilegen.cpp b/src/dlls/mscorpe/iceefilegen.cpp
index f4323b9e8c..c48ae7e094 100644
--- a/src/dlls/mscorpe/iceefilegen.cpp
+++ b/src/dlls/mscorpe/iceefilegen.cpp
@@ -151,7 +151,9 @@ HRESULT ICeeFileGen::CreateCeeFileFromICeeGen(ICeeGen *pICeeGen, HCEEFILE *ceeFi
return E_POINTER;
CCeeGen *genFrom = reinterpret_cast<CCeeGen*>(pICeeGen);
CeeFileGenWriter *gen = NULL;
- if (FAILED(CeeFileGenWriter::CreateNewInstance(genFrom, gen, createFlags))) return FALSE;
+ HRESULT hr = CeeFileGenWriter::CreateNewInstance(genFrom, gen, createFlags);
+ if (FAILED(hr))
+ return hr;
TESTANDRETURN(gen != NULL, E_OUTOFMEMORY);
*ceeFile = gen;
return S_OK;
diff --git a/src/gc/handletablecore.cpp b/src/gc/handletablecore.cpp
index 00ab6a24b9..228b8bfa09 100644
--- a/src/gc/handletablecore.cpp
+++ b/src/gc/handletablecore.cpp
@@ -1592,6 +1592,7 @@ void SegmentResortChains(TableSegment *pSegment)
// clear the sort flag for this segment
pSegment->fResortChains = FALSE;
+ BOOL fScavengingOccurred = FALSE;
// first, do we need to scavenge any blocks?
if (pSegment->fNeedsScavenging)
@@ -1599,6 +1600,8 @@ void SegmentResortChains(TableSegment *pSegment)
// clear the scavenge flag
pSegment->fNeedsScavenging = FALSE;
+ fScavengingOccurred = TRUE;
+
// we may need to explicitly scan the user data chain too
BOOL fCleanupUserData = FALSE;
@@ -1758,6 +1761,21 @@ void SegmentResortChains(TableSegment *pSegment)
if (pSegment->rgBlockType[pSegment->rgHint[uType]] != uType)
pSegment->rgHint[uType] = bBlock;
}
+ else
+ {
+ // No blocks of this type were found in the rgBlockType array, meaning either there were no
+ // such blocks on entry to this function (in which case the associated tail is guaranteed
+ // to already be marked invalid) OR that there were blocks but all of them were reclaimed
+ // by the scavenging logic above (in which case the associated tail is guaranteed to point
+ // to one of the scavenged blocks). In the latter case, the tail is currently "stale"
+ // and therefore needs to be manually updated.
+ if (pSegment->rgTail[uType] != BLOCK_INVALID)
+ {
+ _ASSERTE(fScavengingOccurred);
+ pSegment->rgTail[uType] = BLOCK_INVALID;
+ pSegment->rgHint[uType] = BLOCK_INVALID;
+ }
+ }
}
// store the new free list head
@@ -2549,6 +2567,14 @@ uint32_t BlockFreeHandles(TableSegment *pSegment, uint32_t uBlock, OBJECTHANDLE
if (fAllMasksWeTouchedAreFree)
{
// is the block unlocked?
+ // NOTE: This check is incorrect and defeats the intended purpose of scavenging. If the
+ // current block is locked and has just been emptied, then it cannot be removed right now
+ // and therefore will nominally need to be scavenged. The only code that triggers
+ // scavenging is in SegmentRemoveFreeBlocks, and setting the flag is the only way to
+ // trigger a call into SegmentRemoveFreeBlocks call. As a result, by NOT setting the flag
+ // this code is generally PREVENTING scavenging in exactly the cases where scavenging is
+ // needed. The code is not being changed because it has always been this way and scavenging
+ // itself generally has extremely low value.
if (!BlockIsLocked(pSegment, uBlock))
{
// tell the caller it might be a good idea to scan for free blocks
diff --git a/src/gc/objecthandle.cpp b/src/gc/objecthandle.cpp
index dd43ec23d5..7df915fb72 100644
--- a/src/gc/objecthandle.cpp
+++ b/src/gc/objecthandle.cpp
@@ -608,7 +608,8 @@ HandleTableBucketHolder::~HandleTableBucketHolder()
}
delete [] m_bucket->pTable;
}
- delete m_bucket;
+
+ // we do not own m_bucket, so we shouldn't delete it here.
}
bool Ref_Initialize()
diff --git a/src/ilasm/asmman.cpp b/src/ilasm/asmman.cpp
index 22e780f554..47dc6eb5c5 100644
--- a/src/ilasm/asmman.cpp
+++ b/src/ilasm/asmman.cpp
@@ -131,6 +131,17 @@ mdToken AsmMan::GetAsmRefTokByName(__in __nullterminated const char*
AsmManAssembly* tmp = GetAsmRefByName(szAsmRefName);
return(tmp ? tmp->tkTok : mdAssemblyRefNil);
}
+AsmManAssembly* AsmMan::GetAsmRefByAsmName(__in __nullterminated const char* szAsmName)
+{
+ AsmManAssembly* ret = NULL;
+ if(szAsmName)
+ {
+ for(int i=0; (ret = m_AsmRefLst.PEEK(i))&&
+ (strcmp(ret->szName,szAsmName)); i++);
+ }
+ return ret;
+}
+
//==============================================================================================================
void AsmMan::SetModuleName(__inout_opt __nullterminated char* szName)
{
diff --git a/src/ilasm/asmman.hpp b/src/ilasm/asmman.hpp
index 0ee875b805..00f4d52f13 100644
--- a/src/ilasm/asmman.hpp
+++ b/src/ilasm/asmman.hpp
@@ -272,6 +272,8 @@ public:
void SetManifestResFile(__in __nullterminated char* szFileName, ULONG ulOffset);
void SetManifestResAsmRef(__in __nullterminated char* szAsmRefName);
+ AsmManAssembly* GetAsmRefByAsmName(__in __nullterminated const char* szAsmName);
+
mdToken GetFileTokByName(__in __nullterminated char* szFileName);
mdToken GetAsmRefTokByName(__in __nullterminated const char* szAsmRefName);
mdToken GetAsmTokByName(__in __nullterminated const char* szAsmName)
diff --git a/src/ilasm/assembler.cpp b/src/ilasm/assembler.cpp
index 957b0bd22b..be535abce8 100644
--- a/src/ilasm/assembler.cpp
+++ b/src/ilasm/assembler.cpp
@@ -276,14 +276,22 @@ mdToken Assembler::GetAsmRef(__in __nullterminated const char* szName)
mdToken Assembler::GetBaseAsmRef()
{
- if (RidFromToken(m_pManifest->GetAsmRefTokByName("System.Runtime")) != 0)
+ AsmManAssembly* sysRuntime = m_pManifest->GetAsmRefByAsmName("System.Runtime");
+ if(sysRuntime != NULL)
{
- return GetAsmRef("System.Runtime");
+ return GetAsmRef(sysRuntime->szAlias ? sysRuntime->szAlias : sysRuntime->szName);
}
- if (RidFromToken(m_pManifest->GetAsmRefTokByName("netstandard")) != 0)
+ AsmManAssembly* mscorlibAsm = m_pManifest->GetAsmRefByAsmName("mscorlib");
+ if(mscorlibAsm != NULL)
{
- return GetAsmRef("netstandard");
+ return GetAsmRef(mscorlibAsm->szAlias ? mscorlibAsm->szAlias : mscorlibAsm->szName);
+ }
+
+ AsmManAssembly* netstandardAsm = m_pManifest->GetAsmRefByAsmName("netstandard");
+ if (netstandardAsm != NULL)
+ {
+ return GetAsmRef(netstandardAsm->szAlias ? netstandardAsm->szAlias : netstandardAsm->szName);
}
return GetAsmRef("mscorlib");
diff --git a/src/ilasm/prebuilt/asmparse.cpp b/src/ilasm/prebuilt/asmparse.cpp
index 50c62030ff..389546edb2 100644
--- a/src/ilasm/prebuilt/asmparse.cpp
+++ b/src/ilasm/prebuilt/asmparse.cpp
@@ -4,12 +4,13 @@
#line 2 "asmparse.y"
- // Licensed to the .NET Foundation under one or more agreements.
- // The .NET Foundation licenses this file to you under the MIT license.
- // See the LICENSE file in the project root for more information.
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
//
// File asmparse.y
//
+
#include "ilasmpch.h"
#include "grammar_before.cpp"
@@ -1729,7 +1730,7 @@ YYSTATIC YYCONST short yyrecover[] = {
#endif
/* SCCSWHAT( "@(#)yypars.c 3.1 88/11/16 22:00:49 " ) */
-#line 3 "D:\\ProjectK3\\src\\tools\\devdiv\\x86\\yypars.c"
+#line 3 "O:\\tfs\\cgm\\src\\Tools\\devdiv\\amd64\\yypars.c"
#if ! defined(YYAPI_PACKAGE)
/*
** YYAPI_TOKENNAME : name used for return value of yylex
@@ -1833,9 +1834,16 @@ YYSTATIC char *yyscpy(register char*t, register char*f)
YYSTATIC short yyn;
YYSTATIC short yystate = 0;
- YYSTATIC short *yyps= &yys[-1];
+#ifdef _PREFAST_
+#pragma warning(push)
+#pragma warning(disable: 6200) // Index '-1' is out of valid index range...for non-stack buffer...
+#endif
+ YYSTATIC short *yyps= &yys[-1];
YYSTATIC YYSTYPE *yypv= &yyv[-1];
- YYSTATIC short yyj;
+#ifdef _PREFAST_
+#pragma warning(pop)
+#endif
+ YYSTATIC short yyj;
YYSTATIC short yym;
#endif
@@ -1852,8 +1860,17 @@ YYLOCAL YYNEAR YYPASCAL YYPARSER()
YYAPI_TOKENNAME = YYAPI_TOKENNONE;
yystate = 0;
- yyps= &yys[-1];
- yypv= &yyv[-1];
+
+#ifdef _PREFAST_
+#pragma warning(push)
+#pragma warning(disable:6200) // Index '-1' is out of valid index range...for non-stack buffer...
+#endif
+ yyps= &yys[-1];
+ yypv= &yyv[-1];
+#ifdef _PREFAST_
+#pragma warning(pop)
+#endif
+
#endif
#ifdef YYDUMP
@@ -4872,7 +4889,7 @@ case 834:
case 835:
#line 2045 "asmparse.y"
{ PASMM->SetManifestResAsmRef(yypvt[-0].string); } break;/* End of actions */
-#line 329 "D:\\ProjectK3\\src\\tools\\devdiv\\x86\\yypars.c"
+#line 329 "O:\\tfs\\cgm\\src\\Tools\\devdiv\\amd64\\yypars.c"
}
}
goto yystack; /* stack new state and value */
diff --git a/src/inc/CrstTypes.def b/src/inc/CrstTypes.def
index 227f986a85..5bf4ec63db 100644
--- a/src/inc/CrstTypes.def
+++ b/src/inc/CrstTypes.def
@@ -781,5 +781,5 @@ Crst InlineTrackingMap
End
Crst EventPipe
- AcquiredBefore ThreadIdDispenser ThreadStore
+ AcquiredBefore ThreadIdDispenser ThreadStore DomainLocalBlock InstMethodHashTable
End
diff --git a/src/inc/clrconfigvalues.h b/src/inc/clrconfigvalues.h
index a0c24567d7..c4722bc44a 100644
--- a/src/inc/clrconfigvalues.h
+++ b/src/inc/clrconfigvalues.h
@@ -460,20 +460,6 @@ RETAIL_CONFIG_STRING_INFO_EX(INTERNAL_AltJitNgen, W("AltJitNgen"), "Enables AltJ
#endif // defined(ALLOW_SXS_JIT_NGEN)
CONFIG_DWORD_INFO_EX(INTERNAL_JitNoCMOV, W("JitNoCMOV"), 0, "", CLRConfig::REGUTIL_default)
-#if defined(_TARGET_AMD64_)
-// UseRyuJIT is only looked up in HKLM in the registry, not in config files or environment variables. It should only be set by the .NET 4.6 (and later version) installers,
-// not by users. See the "RyuJIT Compatibility Fallback Design Specification.docx" document for details.
-RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_UseRyuJit, W("UseRyuJIT"), 0, "Set to 1 by .NET 4.6 installer to indicate RyuJIT should be used, not JIT64.", CLRConfig::IgnoreEnv | CLRConfig::IgnoreHKCU | CLRConfig::IgnoreConfigFiles)
-RETAIL_CONFIG_DWORD_INFO(EXTERNAL_UseLegacyJit, W("useLegacyJit"), 0, "Set to 1 to do all JITing with compatjit.dll. Only applicable to x64.")
-RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_DisableNativeImageLoadList, W("DisableNativeImageLoadList"), "Refuse to load native images corresponding to one of the assemblies on this semicolon-delimited list of assembly names.", CLRConfig::REGUTIL_default)
-#endif
-
-#if defined(_TARGET_X86_)
-RETAIL_CONFIG_DWORD_INFO(EXTERNAL_UseWindowsX86CoreLegacyJit, W("UseWindowsX86CoreLegacyJit"), 0, "Set to 1 to do all JITing with compatjit.dll. Only applicable to Windows x86 .NET Core.")
-#endif
-
-RETAIL_CONFIG_DWORD_INFO(EXTERNAL_RequireLegacyJit, W("RequireLegacyJit"), 0, "Set to 1 to require the use of legacy JIT (via COMPlus_useLegacyJit=1 or COMPlus_UseWindowsX86CoreLegacyJit=1).")
-
CONFIG_STRING_INFO_EX(INTERNAL_JitValNumCSE, W("JitValNumCSE"), "Enables ValNum CSE for the specified methods", CLRConfig::REGUTIL_default)
CONFIG_STRING_INFO_EX(INTERNAL_JitLexicalCSE, W("JitLexicalCSE"), "Enables Lexical CSE for the specified methods", CLRConfig::REGUTIL_default)
CONFIG_DWORD_INFO_EX(INTERNAL_JitNoCSE, W("JitNoCSE"), 0, "", CLRConfig::REGUTIL_default)
diff --git a/src/inc/corcompile.h b/src/inc/corcompile.h
index f99e27eec0..68eefc143a 100644
--- a/src/inc/corcompile.h
+++ b/src/inc/corcompile.h
@@ -468,15 +468,6 @@ struct CORCOMPILE_EE_INFO_TABLE
DWORD threadTlsIndex;
DWORD rvaStaticTlsIndex;
-
-// These are used by the 64-bit JITs to detect calls to thunks in the .nep section
-// and conditionally eliminate double-thunking (managed-to-native-to-managed).
-// During prejit these are set to the RVAs of the .nep section. When the prejitted
-// image is actually loaded, these are fixed up to point to the actual .nep section
-// of the ijw image (not the native image).
-
- BYTE * nativeEntryPointStart;
- BYTE * nativeEntryPointEnd;
};
/*********************************************************************************/
diff --git a/src/inc/corprof.idl b/src/inc/corprof.idl
index 3378431317..db67b3c6bb 100644
--- a/src/inc/corprof.idl
+++ b/src/inc/corprof.idl
@@ -621,9 +621,11 @@ typedef enum
COR_PRF_HIGH_IN_MEMORY_SYMBOLS_UPDATED = 0x00000002,
+ COR_PRF_HIGH_MONITOR_DYNAMIC_FUNCTION_UNLOADS = 0x00000004,
+
COR_PRF_HIGH_REQUIRE_PROFILE_IMAGE = 0,
- COR_PRF_HIGH_ALLOWABLE_AFTER_ATTACH = COR_PRF_HIGH_IN_MEMORY_SYMBOLS_UPDATED,
+ COR_PRF_HIGH_ALLOWABLE_AFTER_ATTACH = COR_PRF_HIGH_IN_MEMORY_SYMBOLS_UPDATED | COR_PRF_HIGH_MONITOR_DYNAMIC_FUNCTION_UNLOADS,
// MONITOR_IMMUTABLE represents all flags that may only be set during initialization.
// Trying to change any of these flags elsewhere will result in a
@@ -2408,6 +2410,20 @@ interface ICorProfilerCallback8 : ICorProfilerCallback7
[in] BOOL fIsSafeToBlock);
}
+[
+ object,
+ uuid(27583EC3-C8F5-482F-8052-194B8CE4705A),
+ pointer_default(unique),
+ local
+]
+interface ICorProfilerCallback9 : ICorProfilerCallback8
+{
+ // This event is triggered whenever a dynamic method is garbage collected
+ // and subsequently unloaded.
+
+ HRESULT DynamicMethodUnloaded([in] FunctionID functionId);
+}
+
/*
* COR_PRF_CODEGEN_FLAGS controls various flags and hooks for a specific
diff --git a/src/inc/crsttypes.h b/src/inc/crsttypes.h
index b4f6f49e64..55dc5bd4ab 100644
--- a/src/inc/crsttypes.h
+++ b/src/inc/crsttypes.h
@@ -237,7 +237,7 @@ int g_rgCrstLevelMap[] =
3, // CrstDynamicMT
3, // CrstDynLinkZapItems
7, // CrstEtwTypeLogHash
- 11, // CrstEventPipe
+ 17, // CrstEventPipe
0, // CrstEventStore
0, // CrstException
7, // CrstExecuteManLock
@@ -560,4 +560,3 @@ inline static LPCSTR GetCrstName(CrstType crstType)
}
#endif // defined(__IN_CRST_CPP) && defined(_DEBUG)
-
diff --git a/src/inc/daccess.h b/src/inc/daccess.h
index 7d82e86cb9..40aba86f21 100644
--- a/src/inc/daccess.h
+++ b/src/inc/daccess.h
@@ -617,6 +617,11 @@ typedef struct _DacGlobals
ULONG fn__ThreadpoolMgr__AsyncTimerCallbackCompletion;
ULONG fn__DACNotifyCompilationFinished;
ULONG fn__ThePreStub;
+
+#ifdef _TARGET_ARM_
+ ULONG fn__ThePreStubCompactARM;
+#endif // _TARGET_ARM_
+
ULONG fn__ThePreStubPatchLabel;
ULONG fn__PrecodeFixupThunk;
ULONG fn__StubDispatchFixupStub;
@@ -2345,6 +2350,7 @@ typedef ArrayDPTR(signed char) PTR_SBYTE;
typedef ArrayDPTR(const BYTE) PTR_CBYTE;
typedef DPTR(INT8) PTR_INT8;
typedef DPTR(INT16) PTR_INT16;
+typedef DPTR(UINT16) PTR_UINT16;
typedef DPTR(WORD) PTR_WORD;
typedef DPTR(USHORT) PTR_USHORT;
typedef DPTR(DWORD) PTR_DWORD;
diff --git a/src/inc/eventtracebase.h b/src/inc/eventtracebase.h
index bd5ad1a2d0..2ed5317250 100644
--- a/src/inc/eventtracebase.h
+++ b/src/inc/eventtracebase.h
@@ -103,7 +103,18 @@ enum EtwThreadFlags
#else //defined(FEATURE_PAL)
+#if defined(FEATURE_PERFTRACING)
+#define ETW_INLINE
+#define ETWOnStartup(StartEventName, EndEventName)
+#define ETWFireEvent(EventName)
+#define ETW_TRACING_INITIALIZED(RegHandle) (TRUE)
+#define ETW_EVENT_ENABLED(Context, EventDescriptor) (EventPipeHelper::Enabled() || XplatEventLogger::IsEventLoggingEnabled())
+#define ETW_CATEGORY_ENABLED(Context, Level, Keyword) (EventPipeHelper::Enabled() || XplatEventLogger::IsEventLoggingEnabled())
+#define ETW_TRACING_ENABLED(Context, EventDescriptor) (EventEnabled##EventDescriptor())
+#define ETW_TRACING_CATEGORY_ENABLED(Context, Level, Keyword) (EventPipeHelper::Enabled() || XplatEventLogger::IsEventLoggingEnabled())
+#define ETW_PROVIDER_ENABLED(ProviderSymbol) (TRUE)
+#else //defined(FEATURE_PERFTRACING)
#define ETW_INLINE
#define ETWOnStartup(StartEventName, EndEventName)
#define ETWFireEvent(EventName)
@@ -114,7 +125,7 @@ enum EtwThreadFlags
#define ETW_TRACING_ENABLED(Context, EventDescriptor) (EventEnabled##EventDescriptor())
#define ETW_TRACING_CATEGORY_ENABLED(Context, Level, Keyword) (XplatEventLogger::IsEventLoggingEnabled())
#define ETW_PROVIDER_ENABLED(ProviderSymbol) (TRUE)
-
+#endif // defined(FEATURE_PERFTRACING)
#endif // !defined(FEATURE_PAL)
#else // FEATURE_EVENT_TRACE
@@ -217,6 +228,14 @@ extern BOOL g_fEEIJWStartup;
#define GetClrInstanceId() (static_cast<UINT16>(g_nClrInstanceId))
+#if defined(FEATURE_PERFTRACING)
+class EventPipeHelper
+{
+public:
+ static bool Enabled();
+};
+#endif // defined(FEATURE_PERFTRACING)
+
#if defined(FEATURE_EVENT_TRACE) || defined(FEATURE_EVENTSOURCE_XPLAT)
#include "clrconfig.h"
diff --git a/src/inc/profilepriv.inl b/src/inc/profilepriv.inl
index e7c82074be..d334e1086b 100644
--- a/src/inc/profilepriv.inl
+++ b/src/inc/profilepriv.inl
@@ -736,6 +736,21 @@ inline BOOL CORProfilerInMemorySymbolsUpdatesEnabled()
((&g_profControlBlock)->dwEventMaskHigh & COR_PRF_HIGH_IN_MEMORY_SYMBOLS_UPDATED));
}
+inline BOOL CORProfilerIsMonitoringDynamicFunctionUnloads()
+{
+ CONTRACTL
+ {
+ NOTHROW;
+ GC_NOTRIGGER;
+ CANNOT_TAKE_LOCK;
+ SO_NOT_MAINLINE;
+ }
+ CONTRACTL_END;
+
+ return (CORProfilerPresent() &&
+ ((&g_profControlBlock)->dwEventMaskHigh & COR_PRF_HIGH_MONITOR_DYNAMIC_FUNCTION_UNLOADS));
+}
+
#if defined(PROFILING_SUPPORTED) && !defined(CROSSGEN_COMPILE)
#if defined(FEATURE_PROFAPI_ATTACH_DETACH)
diff --git a/src/inc/switches.h b/src/inc/switches.h
index bb303876e8..79964530fa 100644
--- a/src/inc/switches.h
+++ b/src/inc/switches.h
@@ -235,3 +235,6 @@
#endif // !defined(CROSSGEN_COMPILE)
+#if defined(FEATURE_INTERPRETER) && defined(CROSSGEN_COMPILE)
+#undef FEATURE_INTERPRETER
+#endif
diff --git a/src/inc/winrt/paraminstanceapi.h b/src/inc/winrt/paraminstanceapi.h
index 062c7f3d08..81ee4c51c9 100644
--- a/src/inc/winrt/paraminstanceapi.h
+++ b/src/inc/winrt/paraminstanceapi.h
@@ -1642,7 +1642,14 @@ namespace Ro { namespace detail {
DWORD dwcb;
DWORD dwcbResult;
+#ifdef _PREFAST_
+#pragma warning(push)
+#pragma warning(disable: 33098) // "Banned hash algorithm is used" - SHA-1 is required for compatibility
+#endif // _PREFAST_
CHKNT(BCryptOpenAlgorithmProvider(&_hAlg, BCRYPT_SHA1_ALGORITHM, MS_PRIMITIVE_PROVIDER, 0));
+#ifdef _PREFAST_
+#pragma warning(pop)
+#endif // _PREFAST_
CHKNT(BCryptGetProperty(_hAlg, BCRYPT_OBJECT_LENGTH, reinterpret_cast<PBYTE>(&dwcb), sizeof(dwcb), &dwcbResult, 0));
diff --git a/src/jit/assertionprop.cpp b/src/jit/assertionprop.cpp
index 767d63a0df..04f2fbed4c 100644
--- a/src/jit/assertionprop.cpp
+++ b/src/jit/assertionprop.cpp
@@ -4556,7 +4556,7 @@ ASSERT_TP* Compiler::optInitAssertionDataflowFlags()
}
// Compute the data flow values for all tracked expressions
// IN and OUT never change for the initial basic block B1
- BitVecOps::ClearD(apTraits, fgFirstBB->bbAssertionIn);
+ BitVecOps::OldStyleClearD(apTraits, fgFirstBB->bbAssertionIn);
return jumpDestOut;
}
diff --git a/src/jit/bitset.h b/src/jit/bitset.h
index 4ecb2fc0d4..a4b0091eb0 100644
--- a/src/jit/bitset.h
+++ b/src/jit/bitset.h
@@ -205,9 +205,13 @@ class BitSetOps
// Destructively set "bs" to be the empty set. This method is unique, in that it does *not*
// require "bs" to be a bitset of the current epoch. It ensures that it is after, however.
// (If the representation is indirect, this requires allocating a new, empty representation.
- // If this is a performance issue, we could provide a new version of ClearD that assumes/asserts
+ // If this is a performance issue, we could provide a new version of OldStyleClearD that assumes/asserts
// that the rep is for the current epoch -- this would be useful if a given bitset were repeatedly
// cleared within an epoch.)
+ // TODO #11263: delete it.
+ static void OldStyleClearD(Env env, BitSetType& bs);
+
+ // Destructively set "bs" to be the empty set.
static void ClearD(Env env, BitSetType& bs);
// Returns a copy of "bs". If the representation of "bs" involves a level of indirection, the data
@@ -326,6 +330,11 @@ public:
BitSetTraits::GetOpCounter(env)->RecordOp(BitSetSupport::BSOP_AssignNocopy);
BSO::AssignNoCopy(env, lhs, rhs);
}
+ static void OldStyleClearD(Env env, BitSetType& bs)
+ {
+ BitSetTraits::GetOpCounter(env)->RecordOp(BitSetSupport::BSOP_OldStyleClearD);
+ BSO::OldStyleClearD(env, bs);
+ }
static void ClearD(Env env, BitSetType& bs)
{
BitSetTraits::GetOpCounter(env)->RecordOp(BitSetSupport::BSOP_ClearD);
diff --git a/src/jit/bitsetasshortlong.h b/src/jit/bitsetasshortlong.h
index 163cb366cb..962a8bb374 100644
--- a/src/jit/bitsetasshortlong.h
+++ b/src/jit/bitsetasshortlong.h
@@ -43,6 +43,7 @@ private:
static void DiffDLong(Env env, BitSetShortLongRep& bs1, BitSetShortLongRep bs2);
static void AddElemDLong(Env env, BitSetShortLongRep& bs, unsigned i);
static void RemoveElemDLong(Env env, BitSetShortLongRep& bs, unsigned i);
+ static void OldStyleClearDLong(Env env, BitSetShortLongRep& bs);
static void ClearDLong(Env env, BitSetShortLongRep& bs);
static BitSetShortLongRep MakeUninitArrayBits(Env env);
static BitSetShortLongRep MakeEmptyArrayBits(Env env);
@@ -122,6 +123,19 @@ public:
lhs = rhs;
}
+ static void OldStyleClearD(Env env, BitSetShortLongRep& bs)
+ {
+ if (IsShort(env))
+ {
+ bs = (BitSetShortLongRep) nullptr;
+ }
+ else
+ {
+ assert(bs != UninitVal());
+ OldStyleClearDLong(env, bs);
+ }
+ }
+
static void ClearD(Env env, BitSetShortLongRep& bs)
{
if (IsShort(env))
@@ -661,15 +675,29 @@ template <typename Env, typename BitSetTraits>
void BitSetOps</*BitSetType*/ BitSetShortLongRep,
/*Brand*/ BSShortLong,
/*Env*/ Env,
- /*BitSetTraits*/ BitSetTraits>::ClearDLong(Env env, BitSetShortLongRep& bs)
+ /*BitSetTraits*/ BitSetTraits>::OldStyleClearDLong(Env env, BitSetShortLongRep& bs)
{
assert(!IsShort(env));
- // Recall that ClearD does *not* require "bs" to be of the current epoch.
+ // Recall that OldStyleClearD does *not* require "bs" to be of the current epoch.
// Therefore, we must allocate a new representation.
bs = MakeEmptyArrayBits(env);
}
template <typename Env, typename BitSetTraits>
+void BitSetOps</*BitSetType*/ BitSetShortLongRep,
+ /*Brand*/ BSShortLong,
+ /*Env*/ Env,
+ /*BitSetTraits*/ BitSetTraits>::ClearDLong(Env env, BitSetShortLongRep& bs)
+{
+ assert(!IsShort(env));
+ unsigned len = BitSetTraits::GetArrSize(env, sizeof(size_t));
+ for (unsigned i = 0; i < len; i++)
+ {
+ bs[i] = 0;
+ }
+}
+
+template <typename Env, typename BitSetTraits>
BitSetShortLongRep BitSetOps</*BitSetType*/ BitSetShortLongRep,
/*Brand*/ BSShortLong,
/*Env*/ Env,
diff --git a/src/jit/bitsetasuint64.h b/src/jit/bitsetasuint64.h
index 243e9e33b4..aec4d05c35 100644
--- a/src/jit/bitsetasuint64.h
+++ b/src/jit/bitsetasuint64.h
@@ -44,6 +44,11 @@ public:
lhs = rhs;
}
+ static void OldStyleClearD(Env env, UINT64& bs)
+ {
+ bs = 0;
+ }
+
static void ClearD(Env env, UINT64& bs)
{
bs = 0;
diff --git a/src/jit/bitsetasuint64inclass.h b/src/jit/bitsetasuint64inclass.h
index be92624613..ffa99d30a1 100644
--- a/src/jit/bitsetasuint64inclass.h
+++ b/src/jit/bitsetasuint64inclass.h
@@ -178,16 +178,22 @@ private:
return res;
}
- inline void ClearD(Env env)
+ inline void OldStyleClearD(Env env)
{
- // Recall that ClearD does *not* require "*this" to be of the current epoch.
- Uint64BitSetOps::ClearD(env, m_bits);
+ // Recall that OldStyleClearD does *not* require "*this" to be of the current epoch.
+ Uint64BitSetOps::OldStyleClearD(env, m_bits);
#ifdef DEBUG
// But it updates it to of the current epoch.
m_epoch = BitSetTraits::GetEpoch(env);
#endif
}
+ inline void ClearD(Env env)
+ {
+ assert(m_epoch == BitSetTraits::GetEpoch(env));
+ Uint64BitSetOps::ClearD(env, m_bits);
+ }
+
inline bool IsEmpty(Env env) const
{
CheckEpoch(env);
@@ -369,6 +375,11 @@ public:
lhs = rhs;
}
+ static void OldStyleClearD(Env env, BST& bs)
+ {
+ bs.OldStyleClearD(env);
+ }
+
static void ClearD(Env env, BST& bs)
{
bs.ClearD(env);
diff --git a/src/jit/bitsetops.h b/src/jit/bitsetops.h
index edf39eaf56..bb4db9d5fd 100644
--- a/src/jit/bitsetops.h
+++ b/src/jit/bitsetops.h
@@ -5,6 +5,7 @@
BSOPNAME(BSOP_Assign)
BSOPNAME(BSOP_AssignAllowUninitRhs)
BSOPNAME(BSOP_AssignNocopy)
+BSOPNAME(BSOP_OldStyleClearD)
BSOPNAME(BSOP_ClearD)
BSOPNAME(BSOP_MakeSingleton)
BSOPNAME(BSOP_MakeEmpty)
diff --git a/src/jit/codegenarm.cpp b/src/jit/codegenarm.cpp
index c28b27bf9b..40371e358c 100644
--- a/src/jit/codegenarm.cpp
+++ b/src/jit/codegenarm.cpp
@@ -259,6 +259,11 @@ void CodeGen::genReturn(GenTreePtr treeNode)
GenTreePtr op1 = treeNode->gtGetOp1();
var_types targetType = treeNode->TypeGet();
+ // A void GT_RETFILT is the end of a finally. For non-void filter returns we need to load the result in the return
+ // register, if it's not already there. The processing is the same as GT_RETURN. For filters, the IL spec says the
+ // result is type int32. Further, the only legal values are 0 or 1; the use of other values is "undefined".
+ assert(!treeNode->OperIs(GT_RETFILT) || (targetType == TYP_VOID) || (targetType == TYP_INT));
+
#ifdef DEBUG
if (targetType == TYP_VOID)
{
@@ -315,741 +320,6 @@ void CodeGen::genReturn(GenTreePtr treeNode)
}
//------------------------------------------------------------------------
-// genCodeForTreeNode Generate code for a single node in the tree.
-//
-// Preconditions:
-// All operands have been evaluated.
-//
-void CodeGen::genCodeForTreeNode(GenTreePtr treeNode)
-{
- regNumber targetReg = treeNode->gtRegNum;
- var_types targetType = treeNode->TypeGet();
- emitter* emit = getEmitter();
-
-#ifdef DEBUG
- lastConsumedNode = nullptr;
- if (compiler->verbose)
- {
- unsigned seqNum = treeNode->gtSeqNum; // Useful for setting a conditional break in Visual Studio
- compiler->gtDispLIRNode(treeNode, "Generating: ");
- }
-#endif
-
- // contained nodes are part of their parents for codegen purposes
- // ex : immediates, most LEAs
- if (treeNode->isContained())
- {
- return;
- }
-
- switch (treeNode->gtOper)
- {
- case GT_LCLHEAP:
- genLclHeap(treeNode);
- break;
-
- case GT_CNS_INT:
- case GT_CNS_DBL:
- genSetRegToConst(targetReg, targetType, treeNode);
- genProduceReg(treeNode);
- break;
-
- case GT_NOT:
- assert(!varTypeIsFloating(targetType));
-
- __fallthrough;
-
- case GT_NEG:
- {
- instruction ins = genGetInsForOper(treeNode->OperGet(), targetType);
-
- // The arithmetic node must be sitting in a register (since it's not contained)
- assert(!treeNode->isContained());
- // The dst can only be a register.
- assert(targetReg != REG_NA);
-
- GenTreePtr operand = treeNode->gtGetOp1();
- assert(!operand->isContained());
- // The src must be a register.
- regNumber operandReg = genConsumeReg(operand);
-
- if (ins == INS_vneg)
- {
- getEmitter()->emitIns_R_R(ins, emitTypeSize(treeNode), targetReg, operandReg);
- }
- else
- {
- getEmitter()->emitIns_R_R_I(ins, emitTypeSize(treeNode), targetReg, operandReg, 0);
- }
- }
- genProduceReg(treeNode);
- break;
-
- case GT_OR:
- case GT_XOR:
- case GT_AND:
- assert(varTypeIsIntegralOrI(treeNode));
- __fallthrough;
-
- case GT_ADD_LO:
- case GT_ADD_HI:
- case GT_SUB_LO:
- case GT_SUB_HI:
- case GT_ADD:
- case GT_SUB:
- case GT_MUL:
- genConsumeOperands(treeNode->AsOp());
- genCodeForBinary(treeNode);
- break;
-
- case GT_LSH:
- case GT_RSH:
- case GT_RSZ:
- case GT_ROR:
- genCodeForShift(treeNode);
- break;
-
- case GT_LSH_HI:
- case GT_RSH_LO:
- genCodeForShiftLong(treeNode);
- break;
-
- case GT_CAST:
- // Cast is never contained (?)
- noway_assert(targetReg != REG_NA);
-
- if (varTypeIsFloating(targetType) && varTypeIsFloating(treeNode->gtOp.gtOp1))
- {
- // Casts float/double <--> double/float
- genFloatToFloatCast(treeNode);
- }
- else if (varTypeIsFloating(treeNode->gtOp.gtOp1))
- {
- // Casts float/double --> int32/int64
- genFloatToIntCast(treeNode);
- }
- else if (varTypeIsFloating(targetType))
- {
- // Casts int32/uint32/int64/uint64 --> float/double
- genIntToFloatCast(treeNode);
- }
- else
- {
- // Casts int <--> int
- genIntToIntCast(treeNode);
- }
- // The per-case functions call genProduceReg()
- break;
-
- case GT_LCL_VAR:
- {
- GenTreeLclVarCommon* lcl = treeNode->AsLclVarCommon();
- // lcl_vars are not defs
- assert((treeNode->gtFlags & GTF_VAR_DEF) == 0);
-
- bool isRegCandidate = compiler->lvaTable[lcl->gtLclNum].lvIsRegCandidate();
-
- if (isRegCandidate && !(treeNode->gtFlags & GTF_VAR_DEATH))
- {
- assert((treeNode->InReg()) || (treeNode->gtFlags & GTF_SPILLED));
- }
-
- // If this is a register candidate that has been spilled, genConsumeReg() will
- // reload it at the point of use. Otherwise, if it's not in a register, we load it here.
-
- if (!treeNode->InReg() && !(treeNode->gtFlags & GTF_SPILLED))
- {
- assert(!isRegCandidate);
- emit->emitIns_R_S(ins_Load(treeNode->TypeGet()), emitTypeSize(treeNode), treeNode->gtRegNum,
- lcl->gtLclNum, 0);
- genProduceReg(treeNode);
- }
- }
- break;
-
- case GT_LCL_FLD_ADDR:
- case GT_LCL_VAR_ADDR:
- {
- // Address of a local var. This by itself should never be allocated a register.
- // If it is worth storing the address in a register then it should be cse'ed into
- // a temp and that would be allocated a register.
- noway_assert(targetType == TYP_BYREF);
- noway_assert(!treeNode->InReg());
-
- inst_RV_TT(INS_lea, targetReg, treeNode, 0, EA_BYREF);
- }
- genProduceReg(treeNode);
- break;
-
- case GT_LCL_FLD:
- {
- NYI_IF(targetType == TYP_STRUCT, "GT_LCL_FLD: struct load local field not supported");
- NYI_IF(treeNode->gtRegNum == REG_NA, "GT_LCL_FLD: load local field not into a register is not supported");
-
- emitAttr size = emitTypeSize(targetType);
- unsigned offs = treeNode->gtLclFld.gtLclOffs;
- unsigned varNum = treeNode->gtLclVarCommon.gtLclNum;
- assert(varNum < compiler->lvaCount);
-
- if (varTypeIsFloating(targetType))
- {
- if (treeNode->InReg())
- {
- NYI("GT_LCL_FLD with reg-to-reg floating point move");
- }
- else
- {
- emit->emitIns_R_S(ins_Load(targetType), size, targetReg, varNum, offs);
- }
- }
- else
- {
- emit->emitIns_R_S(ins_Move_Extend(targetType, treeNode->InReg()), size, targetReg, varNum, offs);
- }
- }
- genProduceReg(treeNode);
- break;
-
- case GT_STORE_LCL_FLD:
- {
- noway_assert(targetType != TYP_STRUCT);
-
- // record the offset
- unsigned offset = treeNode->gtLclFld.gtLclOffs;
-
- // We must have a stack store with GT_STORE_LCL_FLD
- noway_assert(!treeNode->InReg());
- noway_assert(targetReg == REG_NA);
-
- GenTreeLclVarCommon* varNode = treeNode->AsLclVarCommon();
- unsigned varNum = varNode->gtLclNum;
- assert(varNum < compiler->lvaCount);
- LclVarDsc* varDsc = &(compiler->lvaTable[varNum]);
-
- // Ensure that lclVar nodes are typed correctly.
- assert(!varDsc->lvNormalizeOnStore() || targetType == genActualType(varDsc->TypeGet()));
-
- GenTreePtr data = treeNode->gtOp.gtOp1->gtEffectiveVal();
- instruction ins = ins_Store(targetType);
- emitAttr attr = emitTypeSize(targetType);
- if (data->isContainedIntOrIImmed())
- {
- assert(data->IsIntegralConst(0));
- NYI_ARM("st.lclFld contained operand");
- }
- else
- {
- assert(!data->isContained());
- genConsumeReg(data);
- emit->emitIns_S_R(ins, attr, data->gtRegNum, varNum, offset);
- }
-
- genUpdateLife(varNode);
- varDsc->lvRegNum = REG_STK;
- }
- break;
-
- case GT_STORE_LCL_VAR:
- {
- GenTreeLclVarCommon* varNode = treeNode->AsLclVarCommon();
-
- unsigned varNum = varNode->gtLclNum;
- assert(varNum < compiler->lvaCount);
- LclVarDsc* varDsc = &(compiler->lvaTable[varNum]);
- unsigned offset = 0;
-
- // Ensure that lclVar nodes are typed correctly.
- assert(!varDsc->lvNormalizeOnStore() || targetType == genActualType(varDsc->TypeGet()));
-
- GenTreePtr data = treeNode->gtOp.gtOp1->gtEffectiveVal();
-
- // var = call, where call returns a multi-reg return value
- // case is handled separately.
- if (data->gtSkipReloadOrCopy()->IsMultiRegCall())
- {
- genMultiRegCallStoreToLocal(treeNode);
- break;
- }
- else
- {
- if (treeNode->TypeGet() == TYP_LONG)
- {
- genStoreLongLclVar(treeNode);
- break;
- }
-
- genConsumeRegs(data);
-
- regNumber dataReg = REG_NA;
- if (data->isContainedIntOrIImmed())
- {
- assert(data->IsIntegralConst(0));
- NYI_ARM("st.lclVar contained operand");
- }
- else
- {
- assert(!data->isContained());
- dataReg = data->gtRegNum;
- }
- assert(dataReg != REG_NA);
-
- if (targetReg == REG_NA) // store into stack based LclVar
- {
- inst_set_SV_var(varNode);
-
- instruction ins = ins_Store(targetType);
- emitAttr attr = emitTypeSize(targetType);
-
- emit->emitIns_S_R(ins, attr, dataReg, varNum, offset);
-
- genUpdateLife(varNode);
-
- varDsc->lvRegNum = REG_STK;
- }
- else // store into register (i.e move into register)
- {
- if (dataReg != targetReg)
- {
- // Assign into targetReg when dataReg (from op1) is not the same register
- inst_RV_RV(ins_Copy(targetType), targetReg, dataReg, targetType);
- }
- genProduceReg(treeNode);
- }
- }
- }
- break;
-
- case GT_RETFILT:
- // A void GT_RETFILT is the end of a finally. For non-void filter returns we need to load the result in
- // the return register, if it's not already there. The processing is the same as GT_RETURN.
- if (targetType != TYP_VOID)
- {
- // For filters, the IL spec says the result is type int32. Further, the only specified legal values
- // are 0 or 1, with the use of other values "undefined".
- assert(targetType == TYP_INT);
- }
-
- __fallthrough;
-
- case GT_RETURN:
- genReturn(treeNode);
- break;
-
- case GT_LEA:
- {
- // if we are here, it is the case where there is an LEA that cannot
- // be folded into a parent instruction
- GenTreeAddrMode* lea = treeNode->AsAddrMode();
- genLeaInstruction(lea);
- }
- // genLeaInstruction calls genProduceReg()
- break;
-
- case GT_IND:
- genConsumeAddress(treeNode->AsIndir()->Addr());
- emit->emitInsLoadStoreOp(ins_Load(targetType), emitTypeSize(treeNode), targetReg, treeNode->AsIndir());
- genProduceReg(treeNode);
- break;
-
- case GT_MOD:
- case GT_UDIV:
- case GT_UMOD:
- // We shouldn't be seeing GT_MOD on float/double args as it should get morphed into a
- // helper call by front-end. Similarly we shouldn't be seeing GT_UDIV and GT_UMOD
- // on float/double args.
- noway_assert(!varTypeIsFloating(treeNode));
- __fallthrough;
-
- case GT_DIV:
- {
- genConsumeOperands(treeNode->AsOp());
-
- noway_assert(targetReg != REG_NA);
-
- GenTreePtr dst = treeNode;
- GenTreePtr src1 = treeNode->gtGetOp1();
- GenTreePtr src2 = treeNode->gtGetOp2();
- instruction ins = genGetInsForOper(treeNode->OperGet(), targetType);
- emitAttr attr = emitTypeSize(treeNode);
- regNumber result = REG_NA;
-
- // dst can only be a reg
- assert(!dst->isContained());
-
- // src can be only reg
- assert(!src1->isContained() || !src2->isContained());
-
- if (varTypeIsFloating(targetType))
- {
- // Floating point divide never raises an exception
-
- emit->emitIns_R_R_R(ins, attr, dst->gtRegNum, src1->gtRegNum, src2->gtRegNum);
- }
- else // an signed integer divide operation
- {
- // TODO-ARM-Bug: handle zero division exception.
-
- emit->emitIns_R_R_R(ins, attr, dst->gtRegNum, src1->gtRegNum, src2->gtRegNum);
- }
-
- genProduceReg(treeNode);
- }
- break;
-
- case GT_INTRINSIC:
- {
- genIntrinsic(treeNode);
- }
- break;
-
- case GT_EQ:
- case GT_NE:
- case GT_LT:
- case GT_LE:
- case GT_GE:
- case GT_GT:
- {
- // TODO-ARM-CQ: Check if we can use the currently set flags.
- // TODO-ARM-CQ: Check for the case where we can simply transfer the carry bit to a register
- // (signed < or >= where targetReg != REG_NA)
-
- GenTreeOp* tree = treeNode->AsOp();
- GenTreePtr op1 = tree->gtOp1->gtEffectiveVal();
- GenTreePtr op2 = tree->gtOp2->gtEffectiveVal();
-
- genConsumeIfReg(op1);
- genConsumeIfReg(op2);
-
- instruction ins = INS_cmp;
- emitAttr cmpAttr;
- if (varTypeIsFloating(op1))
- {
- assert(op1->TypeGet() == op2->TypeGet());
- ins = INS_vcmp;
- cmpAttr = emitTypeSize(op1->TypeGet());
- emit->emitInsBinary(ins, cmpAttr, op1, op2);
- // vmrs with register 0xf has special meaning of transferring flags
- emit->emitIns_R(INS_vmrs, EA_4BYTE, REG_R15);
- }
- else if (varTypeIsLong(op1))
- {
-#ifdef DEBUG
- // The result of an unlowered long compare on a 32-bit target must either be
- // a) materialized into a register, or
- // b) unused.
- //
- // A long compare that has a result that is used but not materialized into a register should
- // have been handled by Lowering::LowerCompare.
-
- LIR::Use use;
- assert((treeNode->gtRegNum != REG_NA) || !LIR::AsRange(compiler->compCurBB).TryGetUse(treeNode, &use));
-#endif
- genCompareLong(treeNode);
- break;
- }
- else
- {
- var_types op1Type = op1->TypeGet();
- var_types op2Type = op2->TypeGet();
- assert(!varTypeIsFloating(op2Type));
- ins = INS_cmp;
- if (op1Type == op2Type)
- {
- cmpAttr = emitTypeSize(op1Type);
- }
- else
- {
- var_types cmpType = TYP_INT;
- bool op1Is64Bit = (varTypeIsLong(op1Type) || op1Type == TYP_REF);
- bool op2Is64Bit = (varTypeIsLong(op2Type) || op2Type == TYP_REF);
- NYI_IF(op1Is64Bit || op2Is64Bit, "Long compare");
- assert(!op1->isUsedFromMemory() || op1Type == op2Type);
- assert(!op2->isUsedFromMemory() || op1Type == op2Type);
- cmpAttr = emitTypeSize(cmpType);
- }
- emit->emitInsBinary(ins, cmpAttr, op1, op2);
- }
-
- // Are we evaluating this into a register?
- if (targetReg != REG_NA)
- {
- genSetRegToCond(targetReg, tree);
- genProduceReg(tree);
- }
- }
- break;
-
- case GT_JTRUE:
- genCodeForJumpTrue(treeNode);
- break;
-
- case GT_JCC:
- {
- GenTreeJumpCC* jcc = treeNode->AsJumpCC();
-
- assert(compiler->compCurBB->bbJumpKind == BBJ_COND);
-
- CompareKind compareKind = ((jcc->gtFlags & GTF_UNSIGNED) != 0) ? CK_UNSIGNED : CK_SIGNED;
- emitJumpKind jumpKind = genJumpKindForOper(jcc->gtCondition, compareKind);
-
- inst_JMP(jumpKind, compiler->compCurBB->bbJumpDest);
- }
- break;
-
- case GT_RETURNTRAP:
- {
- // this is nothing but a conditional call to CORINFO_HELP_STOP_FOR_GC
- // based on the contents of 'data'
-
- GenTree* data = treeNode->gtOp.gtOp1->gtEffectiveVal();
- genConsumeIfReg(data);
- GenTreeIntCon cns = intForm(TYP_INT, 0);
- emit->emitInsBinary(INS_cmp, emitTypeSize(TYP_INT), data, &cns);
-
- BasicBlock* skipLabel = genCreateTempLabel();
-
- emitJumpKind jmpEqual = genJumpKindForOper(GT_EQ, CK_SIGNED);
- inst_JMP(jmpEqual, skipLabel);
- // emit the call to the EE-helper that stops for GC (or other reasons)
-
- genEmitHelperCall(CORINFO_HELP_STOP_FOR_GC, 0, EA_UNKNOWN);
- genDefineTempLabel(skipLabel);
- }
- break;
-
- case GT_STOREIND:
- {
- GenTreeStoreInd* storeInd = treeNode->AsStoreInd();
- GenTree* data = storeInd->Data();
- GenTree* addr = storeInd->Addr();
- var_types targetType = storeInd->TypeGet();
-
- assert(!varTypeIsFloating(targetType) || (targetType == data->TypeGet()));
-
- GCInfo::WriteBarrierForm writeBarrierForm = gcInfo.gcIsWriteBarrierCandidate(treeNode, data);
- if (writeBarrierForm != GCInfo::WBF_NoBarrier)
- {
- // data and addr must be in registers.
- // Consume both registers so that any copies of interfering
- // registers are taken care of.
- genConsumeOperands(storeInd->AsOp());
-
-#if NOGC_WRITE_BARRIERS
- NYI_ARM("NOGC_WRITE_BARRIERS");
-#else
- // At this point, we should not have any interference.
- // That is, 'data' must not be in REG_ARG_0,
- // as that is where 'addr' must go.
- noway_assert(data->gtRegNum != REG_ARG_0);
-
- // addr goes in REG_ARG_0
- if (addr->gtRegNum != REG_ARG_0)
- {
- inst_RV_RV(INS_mov, REG_ARG_0, addr->gtRegNum, addr->TypeGet());
- }
-
- // data goes in REG_ARG_1
- if (data->gtRegNum != REG_ARG_1)
- {
- inst_RV_RV(INS_mov, REG_ARG_1, data->gtRegNum, data->TypeGet());
- }
-#endif // NOGC_WRITE_BARRIERS
-
- genGCWriteBarrier(storeInd, writeBarrierForm);
- }
- else // A normal store, not a WriteBarrier store
- {
- bool reverseOps = ((storeInd->gtFlags & GTF_REVERSE_OPS) != 0);
- bool dataIsUnary = false;
-
- // We must consume the operands in the proper execution order,
- // so that liveness is updated appropriately.
- if (!reverseOps)
- {
- genConsumeAddress(addr);
- }
-
- if (!data->isContained())
- {
- genConsumeRegs(data);
- }
-
- if (reverseOps)
- {
- genConsumeAddress(addr);
- }
-
- emit->emitInsLoadStoreOp(ins_Store(targetType), emitTypeSize(storeInd), data->gtRegNum,
- treeNode->AsIndir());
- }
- }
- break;
-
- case GT_COPY:
- // This is handled at the time we call genConsumeReg() on the GT_COPY
- break;
-
- case GT_LIST:
- case GT_FIELD_LIST:
- case GT_ARGPLACE:
- // Nothing to do
- break;
-
- case GT_PUTARG_STK:
- genPutArgStk(treeNode->AsPutArgStk());
- break;
-
- case GT_PUTARG_REG:
- {
- NYI_IF(targetType == TYP_STRUCT, "GT_PUTARG_REG: struct support not implemented");
-
- // commas show up here commonly, as part of a nullchk operation
- GenTree* op1 = treeNode->gtOp.gtOp1->gtEffectiveVal();
- // If child node is not already in the register we need, move it
- genConsumeReg(op1);
- if (treeNode->gtRegNum != op1->gtRegNum)
- {
- inst_RV_RV(ins_Move_Extend(targetType, true), treeNode->gtRegNum, op1->gtRegNum, targetType);
- }
- }
- genProduceReg(treeNode);
- break;
-
- case GT_CALL:
- genCallInstruction(treeNode->AsCall());
- break;
-
- case GT_LOCKADD:
- case GT_XCHG:
- case GT_XADD:
- genLockedInstructions(treeNode->AsOp());
- break;
-
- case GT_MEMORYBARRIER:
- instGen_MemoryBarrier();
- break;
-
- case GT_CMPXCHG:
- {
- NYI("GT_CMPXCHG");
- }
- genProduceReg(treeNode);
- break;
-
- case GT_RELOAD:
- // do nothing - reload is just a marker.
- // The parent node will call genConsumeReg on this which will trigger the unspill of this node's child
- // into the register specified in this node.
- break;
-
- case GT_NOP:
- break;
-
- case GT_NO_OP:
- if (treeNode->gtFlags & GTF_NO_OP_NO)
- {
- noway_assert(!"GTF_NO_OP_NO should not be set");
- }
- else
- {
- instGen(INS_nop);
- }
- break;
-
- case GT_ARR_BOUNDS_CHECK:
- genRangeCheck(treeNode);
- break;
-
- case GT_PHYSREG:
- if (treeNode->gtRegNum != treeNode->AsPhysReg()->gtSrcReg)
- {
- inst_RV_RV(INS_mov, treeNode->gtRegNum, treeNode->AsPhysReg()->gtSrcReg, targetType);
-
- genTransferRegGCState(treeNode->gtRegNum, treeNode->AsPhysReg()->gtSrcReg);
- }
- break;
-
- case GT_PHYSREGDST:
- break;
-
- case GT_NULLCHECK:
- {
- assert(!treeNode->gtOp.gtOp1->isContained());
- regNumber addrReg = genConsumeReg(treeNode->gtOp.gtOp1);
- emit->emitIns_R_R_I(INS_ldr, EA_4BYTE, targetReg, addrReg, 0);
- }
- break;
-
- case GT_CATCH_ARG:
-
- noway_assert(handlerGetsXcptnObj(compiler->compCurBB->bbCatchTyp));
-
- /* Catch arguments get passed in a register. genCodeForBBlist()
- would have marked it as holding a GC object, but not used. */
-
- noway_assert(gcInfo.gcRegGCrefSetCur & RBM_EXCEPTION_OBJECT);
- genConsumeReg(treeNode);
- break;
-
- case GT_PINVOKE_PROLOG:
- noway_assert(((gcInfo.gcRegGCrefSetCur | gcInfo.gcRegByrefSetCur) & ~fullIntArgRegMask()) == 0);
-
- // the runtime side requires the codegen here to be consistent
- emit->emitDisableRandomNops();
- break;
-
- case GT_LABEL:
- genPendingCallLabel = genCreateTempLabel();
- treeNode->gtLabel.gtLabBB = genPendingCallLabel;
- emit->emitIns_J_R(INS_adr, EA_PTRSIZE, genPendingCallLabel, treeNode->gtRegNum);
- break;
-
- case GT_CLS_VAR_ADDR:
- emit->emitIns_R_C(INS_lea, EA_PTRSIZE, targetReg, treeNode->gtClsVar.gtClsVarHnd, 0);
- genProduceReg(treeNode);
- break;
-
- case GT_STORE_DYN_BLK:
- case GT_STORE_BLK:
- genCodeForStoreBlk(treeNode->AsBlk());
- break;
-
- case GT_JMPTABLE:
- genJumpTable(treeNode);
- break;
-
- case GT_SWITCH_TABLE:
- genTableBasedSwitch(treeNode);
- break;
-
- case GT_ARR_INDEX:
- genCodeForArrIndex(treeNode->AsArrIndex());
- break;
-
- case GT_ARR_OFFSET:
- genCodeForArrOffset(treeNode->AsArrOffs());
- break;
-
- case GT_IL_OFFSET:
- // Do nothing; these nodes are simply markers for debug info.
- break;
-
- default:
- {
-#ifdef DEBUG
- char message[256];
- _snprintf_s(message, _countof(message), _TRUNCATE, "NYI: Unimplemented node type %s",
- GenTree::NodeName(treeNode->OperGet()));
- NYIRAW(message);
-#else
- NYI("unimplemented node");
-#endif
- }
- break;
- }
-}
-
-//------------------------------------------------------------------------
// genLockedInstructions: Generate code for the locked operations.
//
// Notes:
@@ -1511,43 +781,161 @@ void CodeGen::genCodeForInitBlkUnroll(GenTreeBlk* initBlkNode)
NYI_ARM("genCodeForInitBlkUnroll");
}
-void CodeGen::genCodeForStoreBlk(GenTreeBlk* blkOp)
+//------------------------------------------------------------------------
+// genCodeForNegNot: Produce code for a GT_NEG/GT_NOT node.
+//
+// Arguments:
+// tree - the node
+//
+void CodeGen::genCodeForNegNot(GenTree* tree)
{
- if (blkOp->gtBlkOpGcUnsafe)
+ assert(tree->OperIs(GT_NEG, GT_NOT));
+
+ var_types targetType = tree->TypeGet();
+
+ assert(!tree->OperIs(GT_NOT) || !varTypeIsFloating(targetType));
+
+ regNumber targetReg = tree->gtRegNum;
+ instruction ins = genGetInsForOper(tree->OperGet(), targetType);
+
+ // The arithmetic node must be sitting in a register (since it's not contained)
+ assert(!tree->isContained());
+ // The dst can only be a register.
+ assert(targetReg != REG_NA);
+
+ GenTreePtr operand = tree->gtGetOp1();
+ assert(!operand->isContained());
+ // The src must be a register.
+ regNumber operandReg = genConsumeReg(operand);
+
+ if (ins == INS_vneg)
{
- getEmitter()->emitDisableGC();
+ getEmitter()->emitIns_R_R(ins, emitTypeSize(tree), targetReg, operandReg);
}
- bool isCopyBlk = blkOp->OperIsCopyBlkOp();
+ else
+ {
+ getEmitter()->emitIns_R_R_I(ins, emitTypeSize(tree), targetReg, operandReg, 0);
+ }
+
+ genProduceReg(tree);
+}
- switch (blkOp->gtBlkOpKind)
+// Generate code for CpObj nodes wich copy structs that have interleaved
+// GC pointers.
+// For this case we'll generate a sequence of loads/stores in the case of struct
+// slots that don't contain GC pointers. The generated code will look like:
+// ldr tempReg, [R13, #8]
+// str tempReg, [R14, #8]
+//
+// In the case of a GC-Pointer we'll call the ByRef write barrier helper
+// who happens to use the same registers as the previous call to maintain
+// the same register requirements and register killsets:
+// bl CORINFO_HELP_ASSIGN_BYREF
+//
+// So finally an example would look like this:
+// ldr tempReg, [R13, #8]
+// str tempReg, [R14, #8]
+// bl CORINFO_HELP_ASSIGN_BYREF
+// ldr tempReg, [R13, #8]
+// str tempReg, [R14, #8]
+// bl CORINFO_HELP_ASSIGN_BYREF
+// ldr tempReg, [R13, #8]
+// str tempReg, [R14, #8]
+void CodeGen::genCodeForCpObj(GenTreeObj* cpObjNode)
+{
+ GenTreePtr dstAddr = cpObjNode->Addr();
+ GenTreePtr source = cpObjNode->Data();
+ var_types srcAddrType = TYP_BYREF;
+ bool sourceIsLocal = false;
+ regNumber dstReg = REG_NA;
+ regNumber srcReg = REG_NA;
+
+ assert(source->isContained());
+ if (source->gtOper == GT_IND)
{
- case GenTreeBlk::BlkOpKindHelper:
- if (isCopyBlk)
- {
- genCodeForCpBlk(blkOp);
- }
- else
- {
- genCodeForInitBlk(blkOp);
- }
- break;
- case GenTreeBlk::BlkOpKindUnroll:
- if (isCopyBlk)
- {
- genCodeForCpBlkUnroll(blkOp);
- }
- else
- {
- genCodeForInitBlkUnroll(blkOp);
- }
- break;
- default:
- unreached();
+ GenTree* srcAddr = source->gtGetOp1();
+ assert(!srcAddr->isContained());
+ srcAddrType = srcAddr->TypeGet();
+ }
+ else
+ {
+ noway_assert(source->IsLocal());
+ sourceIsLocal = true;
+ }
+
+ bool dstOnStack = dstAddr->OperIsLocalAddr();
+
+#ifdef DEBUG
+ assert(!dstAddr->isContained());
+
+ // This GenTree node has data about GC pointers, this means we're dealing
+ // with CpObj.
+ assert(cpObjNode->gtGcPtrCount > 0);
+#endif // DEBUG
+
+ // Consume the operands and get them into the right registers.
+ // They may now contain gc pointers (depending on their type; gcMarkRegPtrVal will "do the right thing").
+ genConsumeBlockOp(cpObjNode, REG_WRITE_BARRIER_DST_BYREF, REG_WRITE_BARRIER_SRC_BYREF, REG_NA);
+ gcInfo.gcMarkRegPtrVal(REG_WRITE_BARRIER_SRC_BYREF, srcAddrType);
+ gcInfo.gcMarkRegPtrVal(REG_WRITE_BARRIER_DST_BYREF, dstAddr->TypeGet());
+
+ // Temp register used to perform the sequence of loads and stores.
+ regNumber tmpReg = cpObjNode->ExtractTempReg();
+ assert(genIsValidIntReg(tmpReg));
+
+ unsigned slots = cpObjNode->gtSlots;
+ emitter* emit = getEmitter();
+
+ BYTE* gcPtrs = cpObjNode->gtGcPtrs;
+
+ // If we can prove it's on the stack we don't need to use the write barrier.
+ emitAttr attr = EA_PTRSIZE;
+ if (dstOnStack)
+ {
+ for (unsigned i = 0; i < slots; ++i)
+ {
+ if (gcPtrs[i] == GCT_GCREF)
+ attr = EA_GCREF;
+ else if (gcPtrs[i] == GCT_BYREF)
+ attr = EA_BYREF;
+ emit->emitIns_R_R_I(INS_ldr, attr, tmpReg, REG_WRITE_BARRIER_SRC_BYREF, TARGET_POINTER_SIZE,
+ INS_FLAGS_DONT_CARE, INS_OPTS_LDST_POST_INC);
+ emit->emitIns_R_R_I(INS_str, attr, tmpReg, REG_WRITE_BARRIER_DST_BYREF, TARGET_POINTER_SIZE,
+ INS_FLAGS_DONT_CARE, INS_OPTS_LDST_POST_INC);
+ }
}
- if (blkOp->gtBlkOpGcUnsafe)
+ else
{
- getEmitter()->emitEnableGC();
+ unsigned gcPtrCount = cpObjNode->gtGcPtrCount;
+
+ unsigned i = 0;
+ while (i < slots)
+ {
+ switch (gcPtrs[i])
+ {
+ case TYPE_GC_NONE:
+ emit->emitIns_R_R_I(INS_ldr, attr, tmpReg, REG_WRITE_BARRIER_SRC_BYREF, TARGET_POINTER_SIZE,
+ INS_FLAGS_DONT_CARE, INS_OPTS_LDST_POST_INC);
+ emit->emitIns_R_R_I(INS_str, attr, tmpReg, REG_WRITE_BARRIER_DST_BYREF, TARGET_POINTER_SIZE,
+ INS_FLAGS_DONT_CARE, INS_OPTS_LDST_POST_INC);
+ break;
+
+ default:
+ // In the case of a GC-Pointer we'll call the ByRef write barrier helper
+ genEmitHelperCall(CORINFO_HELP_ASSIGN_BYREF, 0, EA_PTRSIZE);
+
+ gcPtrCount--;
+ break;
+ }
+ ++i;
+ }
+ assert(gcPtrCount == 0);
}
+
+ // Clear the gcInfo for registers of source and dest.
+ // While we normally update GC info prior to the last instruction that uses them,
+ // these actually live into the helper call.
+ gcInfo.gcMarkRegSetNpt(RBM_WRITE_BARRIER_SRC_BYREF | RBM_WRITE_BARRIER_DST_BYREF);
}
//------------------------------------------------------------------------
@@ -1614,6 +1002,155 @@ void CodeGen::genCodeForShiftLong(GenTreePtr tree)
}
//------------------------------------------------------------------------
+// genCodeForLclVar: Produce code for a GT_LCL_VAR node.
+//
+// Arguments:
+// tree - the GT_LCL_VAR node
+//
+void CodeGen::genCodeForLclVar(GenTreeLclVar* tree)
+{
+ // lcl_vars are not defs
+ assert((tree->gtFlags & GTF_VAR_DEF) == 0);
+
+ bool isRegCandidate = compiler->lvaTable[tree->gtLclNum].lvIsRegCandidate();
+
+ if (isRegCandidate && !(tree->gtFlags & GTF_VAR_DEATH))
+ {
+ assert((tree->InReg()) || (tree->gtFlags & GTF_SPILLED));
+ }
+
+ // If this is a register candidate that has been spilled, genConsumeReg() will
+ // reload it at the point of use. Otherwise, if it's not in a register, we load it here.
+
+ if (!tree->InReg() && !(tree->gtFlags & GTF_SPILLED))
+ {
+ assert(!isRegCandidate);
+ getEmitter()->emitIns_R_S(ins_Load(tree->TypeGet()), emitTypeSize(tree), tree->gtRegNum, tree->gtLclNum, 0);
+ genProduceReg(tree);
+ }
+}
+
+//------------------------------------------------------------------------
+// genCodeForStoreLclFld: Produce code for a GT_STORE_LCL_FLD node.
+//
+// Arguments:
+// tree - the GT_STORE_LCL_FLD node
+//
+void CodeGen::genCodeForStoreLclFld(GenTreeLclFld* tree)
+{
+ var_types targetType = tree->TypeGet();
+ regNumber targetReg = tree->gtRegNum;
+ emitter* emit = getEmitter();
+
+ noway_assert(targetType != TYP_STRUCT);
+
+ // record the offset
+ unsigned offset = tree->gtLclOffs;
+
+ // We must have a stack store with GT_STORE_LCL_FLD
+ noway_assert(!tree->InReg());
+ noway_assert(targetReg == REG_NA);
+
+ unsigned varNum = tree->gtLclNum;
+ assert(varNum < compiler->lvaCount);
+ LclVarDsc* varDsc = &(compiler->lvaTable[varNum]);
+
+ // Ensure that lclVar nodes are typed correctly.
+ assert(!varDsc->lvNormalizeOnStore() || targetType == genActualType(varDsc->TypeGet()));
+
+ GenTreePtr data = tree->gtOp1->gtEffectiveVal();
+ instruction ins = ins_Store(targetType);
+ emitAttr attr = emitTypeSize(targetType);
+ if (data->isContainedIntOrIImmed())
+ {
+ assert(data->IsIntegralConst(0));
+ NYI_ARM("st.lclFld contained operand");
+ }
+ else
+ {
+ assert(!data->isContained());
+ genConsumeReg(data);
+ emit->emitIns_S_R(ins, attr, data->gtRegNum, varNum, offset);
+ }
+
+ genUpdateLife(tree);
+ varDsc->lvRegNum = REG_STK;
+}
+
+//------------------------------------------------------------------------
+// genCodeForStoreLclVar: Produce code for a GT_STORE_LCL_VAR node.
+//
+// Arguments:
+// tree - the GT_STORE_LCL_VAR node
+//
+void CodeGen::genCodeForStoreLclVar(GenTreeLclVar* tree)
+{
+ var_types targetType = tree->TypeGet();
+ regNumber targetReg = tree->gtRegNum;
+ emitter* emit = getEmitter();
+
+ unsigned varNum = tree->gtLclNum;
+ assert(varNum < compiler->lvaCount);
+ LclVarDsc* varDsc = &(compiler->lvaTable[varNum]);
+
+ // Ensure that lclVar nodes are typed correctly.
+ assert(!varDsc->lvNormalizeOnStore() || targetType == genActualType(varDsc->TypeGet()));
+
+ GenTreePtr data = tree->gtOp1->gtEffectiveVal();
+
+ // var = call, where call returns a multi-reg return value
+ // case is handled separately.
+ if (data->gtSkipReloadOrCopy()->IsMultiRegCall())
+ {
+ genMultiRegCallStoreToLocal(tree);
+ }
+ else if (tree->TypeGet() == TYP_LONG)
+ {
+ genStoreLongLclVar(tree);
+ }
+ else
+ {
+ genConsumeRegs(data);
+
+ regNumber dataReg = REG_NA;
+ if (data->isContainedIntOrIImmed())
+ {
+ assert(data->IsIntegralConst(0));
+ NYI_ARM("st.lclVar contained operand");
+ }
+ else
+ {
+ assert(!data->isContained());
+ dataReg = data->gtRegNum;
+ }
+ assert(dataReg != REG_NA);
+
+ if (targetReg == REG_NA) // store into stack based LclVar
+ {
+ inst_set_SV_var(tree);
+
+ instruction ins = ins_Store(targetType);
+ emitAttr attr = emitTypeSize(targetType);
+
+ emit->emitIns_S_R(ins, attr, dataReg, varNum, /* offset */ 0);
+
+ genUpdateLife(tree);
+
+ varDsc->lvRegNum = REG_STK;
+ }
+ else // store into register (i.e move into register)
+ {
+ if (dataReg != targetReg)
+ {
+ // Assign into targetReg when dataReg (from op1) is not the same register
+ inst_RV_RV(ins_Copy(targetType), targetReg, dataReg, targetType);
+ }
+ genProduceReg(tree);
+ }
+ }
+}
+
+//------------------------------------------------------------------------
// genLeaInstruction: Produce code for a GT_LEA subnode.
//
void CodeGen::genLeaInstruction(GenTreeAddrMode* lea)
@@ -1641,6 +1178,254 @@ void CodeGen::genLeaInstruction(GenTreeAddrMode* lea)
}
//------------------------------------------------------------------------
+// genCodeForDivMod: Produce code for a GT_DIV/GT_UDIV/GT_MOD/GT_UMOD node.
+//
+// Arguments:
+// tree - the node
+//
+void CodeGen::genCodeForDivMod(GenTreeOp* tree)
+{
+ assert(tree->OperIs(GT_DIV, GT_UDIV, GT_MOD, GT_UMOD));
+
+ // We shouldn't be seeing GT_MOD on float/double args as it should get morphed into a
+ // helper call by front-end. Similarly we shouldn't be seeing GT_UDIV and GT_UMOD
+ // on float/double args.
+ noway_assert(tree->OperIs(GT_DIV) || !varTypeIsFloating(tree));
+
+ var_types targetType = tree->TypeGet();
+ regNumber targetReg = tree->gtRegNum;
+ emitter* emit = getEmitter();
+
+ genConsumeOperands(tree);
+
+ noway_assert(targetReg != REG_NA);
+
+ GenTreePtr dst = tree;
+ GenTreePtr src1 = tree->gtGetOp1();
+ GenTreePtr src2 = tree->gtGetOp2();
+ instruction ins = genGetInsForOper(tree->OperGet(), targetType);
+ emitAttr attr = emitTypeSize(tree);
+ regNumber result = REG_NA;
+
+ // dst can only be a reg
+ assert(!dst->isContained());
+
+ // src can be only reg
+ assert(!src1->isContained() || !src2->isContained());
+
+ if (varTypeIsFloating(targetType))
+ {
+ // Floating point divide never raises an exception
+
+ emit->emitIns_R_R_R(ins, attr, dst->gtRegNum, src1->gtRegNum, src2->gtRegNum);
+ }
+ else // an signed integer divide operation
+ {
+ // TODO-ARM-Bug: handle zero division exception.
+
+ emit->emitIns_R_R_R(ins, attr, dst->gtRegNum, src1->gtRegNum, src2->gtRegNum);
+ }
+
+ genProduceReg(tree);
+}
+
+//------------------------------------------------------------------------
+// genCodeForCompare: Produce code for a GT_EQ/GT_NE/GT_LT/GT_LE/GT_GE/GT_GT node.
+//
+// Arguments:
+// tree - the node
+//
+void CodeGen::genCodeForCompare(GenTreeOp* tree)
+{
+ // TODO-ARM-CQ: Check if we can use the currently set flags.
+ // TODO-ARM-CQ: Check for the case where we can simply transfer the carry bit to a register
+ // (signed < or >= where targetReg != REG_NA)
+
+ GenTreePtr op1 = tree->gtOp1->gtEffectiveVal();
+ GenTreePtr op2 = tree->gtOp2->gtEffectiveVal();
+
+ if (varTypeIsLong(op1))
+ {
+#ifdef DEBUG
+ // The result of an unlowered long compare on a 32-bit target must either be
+ // a) materialized into a register, or
+ // b) unused.
+ //
+ // A long compare that has a result that is used but not materialized into a register should
+ // have been handled by Lowering::LowerCompare.
+
+ LIR::Use use;
+ assert((tree->gtRegNum != REG_NA) || !LIR::AsRange(compiler->compCurBB).TryGetUse(tree, &use));
+#endif
+ genCompareLong(tree);
+ }
+ else
+ {
+ regNumber targetReg = tree->gtRegNum;
+ emitter* emit = getEmitter();
+ emitAttr cmpAttr;
+
+ genConsumeIfReg(op1);
+ genConsumeIfReg(op2);
+
+ if (varTypeIsFloating(op1))
+ {
+ assert(op1->TypeGet() == op2->TypeGet());
+ instruction ins = INS_vcmp;
+ cmpAttr = emitTypeSize(op1->TypeGet());
+ emit->emitInsBinary(ins, cmpAttr, op1, op2);
+ // vmrs with register 0xf has special meaning of transferring flags
+ emit->emitIns_R(INS_vmrs, EA_4BYTE, REG_R15);
+ }
+ else
+ {
+ var_types op1Type = op1->TypeGet();
+ var_types op2Type = op2->TypeGet();
+ assert(!varTypeIsFloating(op2Type));
+ instruction ins = INS_cmp;
+ if (op1Type == op2Type)
+ {
+ cmpAttr = emitTypeSize(op1Type);
+ }
+ else
+ {
+ var_types cmpType = TYP_INT;
+ bool op1Is64Bit = (varTypeIsLong(op1Type) || op1Type == TYP_REF);
+ bool op2Is64Bit = (varTypeIsLong(op2Type) || op2Type == TYP_REF);
+ NYI_IF(op1Is64Bit || op2Is64Bit, "Long compare");
+ assert(!op1->isUsedFromMemory() || op1Type == op2Type);
+ assert(!op2->isUsedFromMemory() || op1Type == op2Type);
+ cmpAttr = emitTypeSize(cmpType);
+ }
+ emit->emitInsBinary(ins, cmpAttr, op1, op2);
+ }
+
+ // Are we evaluating this into a register?
+ if (targetReg != REG_NA)
+ {
+ genSetRegToCond(targetReg, tree);
+ genProduceReg(tree);
+ }
+ }
+}
+
+//------------------------------------------------------------------------
+// genCodeForJcc: Produce code for a GT_JCC node.
+//
+// Arguments:
+// tree - the node
+//
+void CodeGen::genCodeForJcc(GenTreeJumpCC* tree)
+{
+ assert(compiler->compCurBB->bbJumpKind == BBJ_COND);
+
+ CompareKind compareKind = ((tree->gtFlags & GTF_UNSIGNED) != 0) ? CK_UNSIGNED : CK_SIGNED;
+ emitJumpKind jumpKind = genJumpKindForOper(tree->gtCondition, compareKind);
+
+ inst_JMP(jumpKind, compiler->compCurBB->bbJumpDest);
+}
+
+//------------------------------------------------------------------------
+// genCodeForReturnTrap: Produce code for a GT_RETURNTRAP node.
+//
+// Arguments:
+// tree - the GT_RETURNTRAP node
+//
+void CodeGen::genCodeForReturnTrap(GenTreeOp* tree)
+{
+ assert(tree->OperGet() == GT_RETURNTRAP);
+
+ // this is nothing but a conditional call to CORINFO_HELP_STOP_FOR_GC
+ // based on the contents of 'data'
+
+ GenTree* data = tree->gtOp1->gtEffectiveVal();
+ genConsumeIfReg(data);
+ GenTreeIntCon cns = intForm(TYP_INT, 0);
+ getEmitter()->emitInsBinary(INS_cmp, emitTypeSize(TYP_INT), data, &cns);
+
+ BasicBlock* skipLabel = genCreateTempLabel();
+
+ emitJumpKind jmpEqual = genJumpKindForOper(GT_EQ, CK_SIGNED);
+ inst_JMP(jmpEqual, skipLabel);
+ // emit the call to the EE-helper that stops for GC (or other reasons)
+
+ genEmitHelperCall(CORINFO_HELP_STOP_FOR_GC, 0, EA_UNKNOWN);
+ genDefineTempLabel(skipLabel);
+}
+
+//------------------------------------------------------------------------
+// genCodeForStoreInd: Produce code for a GT_STOREIND node.
+//
+// Arguments:
+// tree - the GT_STOREIND node
+//
+void CodeGen::genCodeForStoreInd(GenTreeStoreInd* tree)
+{
+ GenTree* data = tree->Data();
+ GenTree* addr = tree->Addr();
+ var_types targetType = tree->TypeGet();
+ emitter* emit = getEmitter();
+
+ assert(!varTypeIsFloating(targetType) || (targetType == data->TypeGet()));
+
+ GCInfo::WriteBarrierForm writeBarrierForm = gcInfo.gcIsWriteBarrierCandidate(tree, data);
+ if (writeBarrierForm != GCInfo::WBF_NoBarrier)
+ {
+ // data and addr must be in registers.
+ // Consume both registers so that any copies of interfering
+ // registers are taken care of.
+ genConsumeOperands(tree);
+
+#if NOGC_WRITE_BARRIERS
+ NYI_ARM("NOGC_WRITE_BARRIERS");
+#else
+ // At this point, we should not have any interference.
+ // That is, 'data' must not be in REG_ARG_0,
+ // as that is where 'addr' must go.
+ noway_assert(data->gtRegNum != REG_ARG_0);
+
+ // addr goes in REG_ARG_0
+ if (addr->gtRegNum != REG_ARG_0)
+ {
+ inst_RV_RV(INS_mov, REG_ARG_0, addr->gtRegNum, addr->TypeGet());
+ }
+
+ // data goes in REG_ARG_1
+ if (data->gtRegNum != REG_ARG_1)
+ {
+ inst_RV_RV(INS_mov, REG_ARG_1, data->gtRegNum, data->TypeGet());
+ }
+#endif // NOGC_WRITE_BARRIERS
+
+ genGCWriteBarrier(tree, writeBarrierForm);
+ }
+ else // A normal store, not a WriteBarrier store
+ {
+ bool reverseOps = ((tree->gtFlags & GTF_REVERSE_OPS) != 0);
+ bool dataIsUnary = false;
+
+ // We must consume the operands in the proper execution order,
+ // so that liveness is updated appropriately.
+ if (!reverseOps)
+ {
+ genConsumeAddress(addr);
+ }
+
+ if (!data->isContained())
+ {
+ genConsumeRegs(data);
+ }
+
+ if (reverseOps)
+ {
+ genConsumeAddress(addr);
+ }
+
+ emit->emitInsLoadStoreOp(ins_Store(targetType), emitTypeSize(tree), data->gtRegNum, tree);
+ }
+}
+
+//------------------------------------------------------------------------
// genCompareLong: Generate code for comparing two longs when the result of the compare
// is manifested in a register.
//
diff --git a/src/jit/codegenarm64.cpp b/src/jit/codegenarm64.cpp
index 7de19f9043..0aa14210bb 100644
--- a/src/jit/codegenarm64.cpp
+++ b/src/jit/codegenarm64.cpp
@@ -1366,18 +1366,59 @@ void CodeGen::instGen_Set_Reg_To_Imm(emitAttr size, regNumber reg, ssize_t imm,
}
else
{
- getEmitter()->emitIns_R_I(INS_mov, size, reg, (imm & 0xffff));
- getEmitter()->emitIns_R_I_I(INS_movk, size, reg, ((imm >> 16) & 0xffff), 16, INS_OPTS_LSL);
+ // Arm64 allows any arbitrary 16-bit constant to be loaded into a register halfword
+ // There are three forms
+ // movk which loads into any halfword preserving the remaining halfwords
+ // movz which loads into any halfword zeroing the remaining halfwords
+ // movn which loads into any halfword zeroing the remaining halfwords then bitwise inverting the register
+ // In some cases it is preferable to use movn, because it has the side effect of filling the other halfwords
+ // with ones
+
+ // Determine whether movn or movz will require the fewest instructions to populate the immediate
+ int preferMovn = 0;
+
+ for (int i = (size == EA_8BYTE) ? 48 : 16; i >= 0; i -= 16)
+ {
+ if (uint16_t(imm >> i) == 0xffff)
+ ++preferMovn; // a single movk 0xffff could be skipped if movn was used
+ else if (uint16_t(imm >> i) == 0x0000)
+ --preferMovn; // a single movk 0 could be skipped if movz was used
+ }
+
+ // Select the first instruction. Any additional instruction will use movk
+ instruction ins = (preferMovn > 0) ? INS_movn : INS_movz;
- if ((size == EA_8BYTE) &&
- ((imm >> 32) != 0)) // Sometimes the upper 32 bits are zero and the first mov has zero-ed them
+ // Initial movz or movn will fill the remaining bytes with the skipVal
+ // This can allow skipping filling a halfword
+ uint16_t skipVal = (preferMovn > 0) ? 0xffff : 0;
+
+ unsigned bits = (size == EA_8BYTE) ? 64 : 32;
+
+ // Iterate over imm examining 16 bits at a time
+ for (unsigned i = 0; i < bits; i += 16)
{
- getEmitter()->emitIns_R_I_I(INS_movk, EA_8BYTE, reg, ((imm >> 32) & 0xffff), 32, INS_OPTS_LSL);
- if ((imm >> 48) != 0) // Frequently the upper 16 bits are zero and the first mov has zero-ed them
+ uint16_t imm16 = uint16_t(imm >> i);
+
+ if (imm16 != skipVal)
{
- getEmitter()->emitIns_R_I_I(INS_movk, EA_8BYTE, reg, ((imm >> 48) & 0xffff), 48, INS_OPTS_LSL);
+ if (ins == INS_movn)
+ {
+ // For the movn case, we need to bitwise invert the immediate. This is because
+ // (movn x0, ~imm16) === (movz x0, imm16; or x0, x0, #0xffff`ffff`ffff`0000)
+ imm16 = ~imm16;
+ }
+
+ getEmitter()->emitIns_R_I_I(ins, size, reg, imm16, i, INS_OPTS_LSL);
+
+ // Once the initial movz/movn is emitted the remaining instructions will all use movk
+ ins = INS_movk;
}
}
+
+ // We must emit a movn or movz or we have not done anything
+ // The cases which hit this assert should be (emitIns_valid_imm_for_mov() == true) and
+ // should not be in this else condition
+ assert(ins == INS_movk);
}
// The caller may have requested that the flags be set on this mov (rarely/never)
if (flags == INS_FLAGS_SET)
@@ -1503,18 +1544,13 @@ void CodeGen::genCodeForMulHi(GenTreeOp* treeNode)
{
inst_RV_RV(INS_mov, targetReg, REG_RDX, targetType);
}
+
+ genProduceReg(treeNode);
#else // !0
NYI("genCodeForMulHi");
#endif // !0
}
-// generate code for a DIV or MOD operation
-//
-void CodeGen::genCodeForDivMod(GenTreeOp* treeNode)
-{
- // unused on ARM64
-}
-
// Generate code for ADD, SUB, MUL, DIV, UDIV, AND, OR and XOR
// This method is expected to have called genConsumeOperands() before calling it.
void CodeGen::genCodeForBinary(GenTree* treeNode)
@@ -1541,6 +1577,177 @@ void CodeGen::genCodeForBinary(GenTree* treeNode)
}
//------------------------------------------------------------------------
+// genCodeForLclVar: Produce code for a GT_LCL_VAR node.
+//
+// Arguments:
+// tree - the GT_LCL_VAR node
+//
+void CodeGen::genCodeForLclVar(GenTreeLclVar* tree)
+{
+ var_types targetType = tree->TypeGet();
+ emitter* emit = getEmitter();
+
+ unsigned varNum = tree->gtLclNum;
+ assert(varNum < compiler->lvaCount);
+ LclVarDsc* varDsc = &(compiler->lvaTable[varNum]);
+ bool isRegCandidate = varDsc->lvIsRegCandidate();
+
+ // lcl_vars are not defs
+ assert((tree->gtFlags & GTF_VAR_DEF) == 0);
+
+ if (isRegCandidate && !(tree->gtFlags & GTF_VAR_DEATH))
+ {
+ assert((tree->InReg()) || (tree->gtFlags & GTF_SPILLED));
+ }
+
+ // If this is a register candidate that has been spilled, genConsumeReg() will
+ // reload it at the point of use. Otherwise, if it's not in a register, we load it here.
+
+ if (!tree->InReg() && !(tree->gtFlags & GTF_SPILLED))
+ {
+ assert(!isRegCandidate);
+
+ // targetType must be a normal scalar type and not a TYP_STRUCT
+ assert(targetType != TYP_STRUCT);
+
+ instruction ins = ins_Load(targetType);
+ emitAttr attr = emitTypeSize(targetType);
+
+ attr = emit->emitInsAdjustLoadStoreAttr(ins, attr);
+
+ emit->emitIns_R_S(ins, attr, tree->gtRegNum, varNum, 0);
+ genProduceReg(tree);
+ }
+}
+
+//------------------------------------------------------------------------
+// genCodeForStoreLclFld: Produce code for a GT_STORE_LCL_FLD node.
+//
+// Arguments:
+// tree - the GT_STORE_LCL_FLD node
+//
+void CodeGen::genCodeForStoreLclFld(GenTreeLclFld* tree)
+{
+ var_types targetType = tree->TypeGet();
+ regNumber targetReg = tree->gtRegNum;
+ emitter* emit = getEmitter();
+ noway_assert(targetType != TYP_STRUCT);
+
+ // record the offset
+ unsigned offset = tree->gtLclOffs;
+
+ // We must have a stack store with GT_STORE_LCL_FLD
+ noway_assert(!tree->InReg());
+ noway_assert(targetReg == REG_NA);
+
+ unsigned varNum = tree->gtLclNum;
+ assert(varNum < compiler->lvaCount);
+ LclVarDsc* varDsc = &(compiler->lvaTable[varNum]);
+
+ // Ensure that lclVar nodes are typed correctly.
+ assert(!varDsc->lvNormalizeOnStore() || targetType == genActualType(varDsc->TypeGet()));
+
+ GenTreePtr data = tree->gtOp1->gtEffectiveVal();
+ genConsumeRegs(data);
+
+ regNumber dataReg = REG_NA;
+ if (data->isContainedIntOrIImmed())
+ {
+ assert(data->IsIntegralConst(0));
+ dataReg = REG_ZR;
+ }
+ else
+ {
+ assert(!data->isContained());
+ dataReg = data->gtRegNum;
+ }
+ assert(dataReg != REG_NA);
+
+ instruction ins = ins_Store(targetType);
+
+ emitAttr attr = emitTypeSize(targetType);
+
+ attr = emit->emitInsAdjustLoadStoreAttr(ins, attr);
+
+ emit->emitIns_S_R(ins, attr, dataReg, varNum, offset);
+
+ genUpdateLife(tree);
+
+ varDsc->lvRegNum = REG_STK;
+}
+
+//------------------------------------------------------------------------
+// genCodeForStoreLclVar: Produce code for a GT_STORE_LCL_VAR node.
+//
+// Arguments:
+// tree - the GT_STORE_LCL_VAR node
+//
+void CodeGen::genCodeForStoreLclVar(GenTreeLclVar* tree)
+{
+ var_types targetType = tree->TypeGet();
+ regNumber targetReg = tree->gtRegNum;
+ emitter* emit = getEmitter();
+
+ unsigned varNum = tree->gtLclNum;
+ assert(varNum < compiler->lvaCount);
+ LclVarDsc* varDsc = &(compiler->lvaTable[varNum]);
+
+ // Ensure that lclVar nodes are typed correctly.
+ assert(!varDsc->lvNormalizeOnStore() || targetType == genActualType(varDsc->TypeGet()));
+
+ GenTreePtr data = tree->gtOp1->gtEffectiveVal();
+
+ // var = call, where call returns a multi-reg return value
+ // case is handled separately.
+ if (data->gtSkipReloadOrCopy()->IsMultiRegCall())
+ {
+ genMultiRegCallStoreToLocal(tree);
+ }
+ else
+ {
+ genConsumeRegs(data);
+
+ regNumber dataReg = REG_NA;
+ if (data->isContainedIntOrIImmed())
+ {
+ assert(data->IsIntegralConst(0));
+ dataReg = REG_ZR;
+ }
+ else
+ {
+ assert(!data->isContained());
+ dataReg = data->gtRegNum;
+ }
+ assert(dataReg != REG_NA);
+
+ if (targetReg == REG_NA) // store into stack based LclVar
+ {
+ inst_set_SV_var(tree);
+
+ instruction ins = ins_Store(targetType);
+ emitAttr attr = emitTypeSize(targetType);
+
+ attr = emit->emitInsAdjustLoadStoreAttr(ins, attr);
+
+ emit->emitIns_S_R(ins, attr, dataReg, varNum, /* offset */ 0);
+
+ genUpdateLife(tree);
+
+ varDsc->lvRegNum = REG_STK;
+ }
+ else // store into register (i.e move into register)
+ {
+ if (dataReg != targetReg)
+ {
+ // Assign into targetReg when dataReg (from op1) is not the same register
+ inst_RV_RV(ins_Copy(targetType), targetReg, dataReg, targetType);
+ }
+ genProduceReg(tree);
+ }
+ }
+}
+
+//------------------------------------------------------------------------
// isStructReturn: Returns whether the 'treeNode' is returning a struct.
//
// Arguments:
@@ -1771,6 +1978,11 @@ void CodeGen::genReturn(GenTreePtr treeNode)
GenTreePtr op1 = treeNode->gtGetOp1();
var_types targetType = treeNode->TypeGet();
+ // A void GT_RETFILT is the end of a finally. For non-void filter returns we need to load the result in the return
+ // register, if it's not already there. The processing is the same as GT_RETURN. For filters, the IL spec says the
+ // result is type int32. Further, the only legal values are 0 or 1; the use of other values is "undefined".
+ assert(!treeNode->OperIs(GT_RETFILT) || (targetType == TYP_VOID) || (targetType == TYP_INT));
+
#ifdef DEBUG
if (targetType == TYP_VOID)
{
@@ -1840,985 +2052,6 @@ void CodeGen::genReturn(GenTreePtr treeNode)
#endif
}
-/*****************************************************************************
- *
- * Generate code for a single node in the tree.
- * Preconditions: All operands have been evaluated
- *
- */
-void CodeGen::genCodeForTreeNode(GenTreePtr treeNode)
-{
- regNumber targetReg = treeNode->gtRegNum;
- var_types targetType = treeNode->TypeGet();
- emitter* emit = getEmitter();
-
-#ifdef DEBUG
- // Validate that all the operands for the current node are consumed in order.
- // This is important because LSRA ensures that any necessary copies will be
- // handled correctly.
- lastConsumedNode = nullptr;
- if (compiler->verbose)
- {
- unsigned seqNum = treeNode->gtSeqNum; // Useful for setting a conditional break in Visual Studio
- compiler->gtDispLIRNode(treeNode, "Generating: ");
- }
-#endif // DEBUG
-
- // Is this a node whose value is already in a register? LSRA denotes this by
- // setting the GTF_REUSE_REG_VAL flag.
- if (treeNode->IsReuseRegVal())
- {
- // For now, this is only used for constant nodes.
- assert((treeNode->OperGet() == GT_CNS_INT) || (treeNode->OperGet() == GT_CNS_DBL));
- JITDUMP(" TreeNode is marked ReuseReg\n");
- return;
- }
-
- // contained nodes are part of their parents for codegen purposes
- // ex : immediates, most LEAs
- if (treeNode->isContained())
- {
- return;
- }
-
- switch (treeNode->gtOper)
- {
- case GT_START_NONGC:
- getEmitter()->emitDisableGC();
- break;
-
- case GT_PROF_HOOK:
- // We should be seeing this only if profiler hook is needed
- noway_assert(compiler->compIsProfilerHookNeeded());
-
-#ifdef PROFILING_SUPPORTED
- // Right now this node is used only for tail calls. In future if
- // we intend to use it for Enter or Leave hooks, add a data member
- // to this node indicating the kind of profiler hook. For example,
- // helper number can be used.
- genProfilingLeaveCallback(CORINFO_HELP_PROF_FCN_TAILCALL);
-#endif // PROFILING_SUPPORTED
- break;
-
- case GT_LCLHEAP:
- genLclHeap(treeNode);
- break;
-
- case GT_CNS_INT:
- case GT_CNS_DBL:
- genSetRegToConst(targetReg, targetType, treeNode);
- genProduceReg(treeNode);
- break;
-
- case GT_NOT:
- assert(!varTypeIsFloating(targetType));
-
- __fallthrough;
-
- case GT_NEG:
- {
- instruction ins = genGetInsForOper(treeNode->OperGet(), targetType);
-
- // The arithmetic node must be sitting in a register (since it's not contained)
- assert(!treeNode->isContained());
- // The dst can only be a register.
- assert(targetReg != REG_NA);
-
- GenTreePtr operand = treeNode->gtGetOp1();
- assert(!operand->isContained());
- // The src must be a register.
- regNumber operandReg = genConsumeReg(operand);
-
- getEmitter()->emitIns_R_R(ins, emitTypeSize(treeNode), targetReg, operandReg);
- }
- genProduceReg(treeNode);
- break;
-
- case GT_DIV:
- case GT_UDIV:
- genConsumeOperands(treeNode->AsOp());
-
- if (varTypeIsFloating(targetType))
- {
- // Floating point divide never raises an exception
- genCodeForBinary(treeNode);
- }
- else // an integer divide operation
- {
- GenTreePtr divisorOp = treeNode->gtGetOp2();
- emitAttr size = EA_ATTR(genTypeSize(genActualType(treeNode->TypeGet())));
-
- if (divisorOp->IsIntegralConst(0))
- {
- // We unconditionally throw a divide by zero exception
- genJumpToThrowHlpBlk(EJ_jmp, SCK_DIV_BY_ZERO);
-
- // We still need to call genProduceReg
- genProduceReg(treeNode);
- }
- else // the divisor is not the constant zero
- {
- regNumber divisorReg = divisorOp->gtRegNum;
-
- // Generate the require runtime checks for GT_DIV or GT_UDIV
- if (treeNode->gtOper == GT_DIV)
- {
- BasicBlock* sdivLabel = genCreateTempLabel();
-
- // Two possible exceptions:
- // (AnyVal / 0) => DivideByZeroException
- // (MinInt / -1) => ArithmeticException
- //
- bool checkDividend = true;
-
- // Do we have an immediate for the 'divisorOp'?
- //
- if (divisorOp->IsCnsIntOrI())
- {
- GenTreeIntConCommon* intConstTree = divisorOp->AsIntConCommon();
- ssize_t intConstValue = intConstTree->IconValue();
- assert(intConstValue != 0); // already checked above by IsIntegralConst(0))
- if (intConstValue != -1)
- {
- checkDividend = false; // We statically know that the dividend is not -1
- }
- }
- else // insert check for divison by zero
- {
- // Check if the divisor is zero throw a DivideByZeroException
- emit->emitIns_R_I(INS_cmp, size, divisorReg, 0);
- emitJumpKind jmpEqual = genJumpKindForOper(GT_EQ, CK_SIGNED);
- genJumpToThrowHlpBlk(jmpEqual, SCK_DIV_BY_ZERO);
- }
-
- if (checkDividend)
- {
- // Check if the divisor is not -1 branch to 'sdivLabel'
- emit->emitIns_R_I(INS_cmp, size, divisorReg, -1);
-
- emitJumpKind jmpNotEqual = genJumpKindForOper(GT_NE, CK_SIGNED);
- inst_JMP(jmpNotEqual, sdivLabel);
- // If control flow continues past here the 'divisorReg' is known to be -1
-
- regNumber dividendReg = treeNode->gtGetOp1()->gtRegNum;
- // At this point the divisor is known to be -1
- //
- // Issue the 'adds zr, dividendReg, dividendReg' instruction
- // this will set both the Z and V flags only when dividendReg is MinInt
- //
- emit->emitIns_R_R_R(INS_adds, size, REG_ZR, dividendReg, dividendReg);
- inst_JMP(jmpNotEqual, sdivLabel); // goto sdiv if the Z flag is clear
- genJumpToThrowHlpBlk(EJ_vs, SCK_ARITH_EXCPN); // if the V flags is set throw
- // ArithmeticException
-
- genDefineTempLabel(sdivLabel);
- }
- genCodeForBinary(treeNode); // Generate the sdiv instruction
- }
- else // (treeNode->gtOper == GT_UDIV)
- {
- // Only one possible exception
- // (AnyVal / 0) => DivideByZeroException
- //
- // Note that division by the constant 0 was already checked for above by the
- // op2->IsIntegralConst(0) check
- //
- if (!divisorOp->IsCnsIntOrI())
- {
- // divisorOp is not a constant, so it could be zero
- //
- emit->emitIns_R_I(INS_cmp, size, divisorReg, 0);
- emitJumpKind jmpEqual = genJumpKindForOper(GT_EQ, CK_SIGNED);
- genJumpToThrowHlpBlk(jmpEqual, SCK_DIV_BY_ZERO);
- }
- genCodeForBinary(treeNode);
- }
- }
- }
- break;
-
- case GT_OR:
- case GT_XOR:
- case GT_AND:
- assert(varTypeIsIntegralOrI(treeNode));
- __fallthrough;
- case GT_ADD:
- case GT_SUB:
- case GT_MUL:
- genConsumeOperands(treeNode->AsOp());
- genCodeForBinary(treeNode);
- break;
-
- case GT_LSH:
- case GT_RSH:
- case GT_RSZ:
- case GT_ROR:
- genCodeForShift(treeNode);
- // genCodeForShift() calls genProduceReg()
- break;
-
- case GT_CAST:
- if (varTypeIsFloating(targetType) && varTypeIsFloating(treeNode->gtOp.gtOp1))
- {
- // Casts float/double <--> double/float
- genFloatToFloatCast(treeNode);
- }
- else if (varTypeIsFloating(treeNode->gtOp.gtOp1))
- {
- // Casts float/double --> int32/int64
- genFloatToIntCast(treeNode);
- }
- else if (varTypeIsFloating(targetType))
- {
- // Casts int32/uint32/int64/uint64 --> float/double
- genIntToFloatCast(treeNode);
- }
- else
- {
- // Casts int <--> int
- genIntToIntCast(treeNode);
- }
- // The per-case functions call genProduceReg()
- break;
-
- case GT_LCL_FLD_ADDR:
- case GT_LCL_VAR_ADDR:
- // Address of a local var. This by itself should never be allocated a register.
- // If it is worth storing the address in a register then it should be cse'ed into
- // a temp and that would be allocated a register.
- noway_assert(targetType == TYP_BYREF);
- noway_assert(!treeNode->InReg());
-
- inst_RV_TT(INS_lea, targetReg, treeNode, 0, EA_BYREF);
- genProduceReg(treeNode);
- break;
-
- case GT_LCL_FLD:
- {
- GenTreeLclVarCommon* varNode = treeNode->AsLclVarCommon();
- assert(varNode->gtLclNum < compiler->lvaCount);
- unsigned varNum = varNode->gtLclNum;
- LclVarDsc* varDsc = &(compiler->lvaTable[varNum]);
-
- if (targetType == TYP_STRUCT)
- {
- NYI("GT_LCL_FLD with TYP_STRUCT");
- }
- emitAttr size = emitTypeSize(targetType);
-
- noway_assert(targetType != TYP_STRUCT);
- noway_assert(targetReg != REG_NA);
-
- unsigned offset = treeNode->gtLclFld.gtLclOffs;
-
- if (varTypeIsFloating(targetType))
- {
- if (treeNode->InReg())
- {
- NYI("GT_LCL_FLD with register to register Floating point move");
- }
- else
- {
- emit->emitIns_R_S(ins_Load(targetType), size, targetReg, varNum, offset);
- }
- }
- else
- {
- size = EA_SET_SIZE(size, EA_8BYTE);
- emit->emitIns_R_S(ins_Move_Extend(targetType, treeNode->InReg()), size, targetReg, varNum, offset);
- }
- genProduceReg(treeNode);
- }
- break;
-
- case GT_LCL_VAR:
- {
- GenTreeLclVarCommon* varNode = treeNode->AsLclVarCommon();
-
- unsigned varNum = varNode->gtLclNum;
- assert(varNum < compiler->lvaCount);
- LclVarDsc* varDsc = &(compiler->lvaTable[varNum]);
- bool isRegCandidate = varDsc->lvIsRegCandidate();
-
- // lcl_vars are not defs
- assert((treeNode->gtFlags & GTF_VAR_DEF) == 0);
-
- if (isRegCandidate && !(treeNode->gtFlags & GTF_VAR_DEATH))
- {
- assert((treeNode->InReg()) || (treeNode->gtFlags & GTF_SPILLED));
- }
-
- // If this is a register candidate that has been spilled, genConsumeReg() will
- // reload it at the point of use. Otherwise, if it's not in a register, we load it here.
-
- if (!treeNode->InReg() && !(treeNode->gtFlags & GTF_SPILLED))
- {
- assert(!isRegCandidate);
-
- // targetType must be a normal scalar type and not a TYP_STRUCT
- assert(targetType != TYP_STRUCT);
-
- instruction ins = ins_Load(targetType);
- emitAttr attr = emitTypeSize(targetType);
-
- attr = emit->emitInsAdjustLoadStoreAttr(ins, attr);
-
- emit->emitIns_R_S(ins, attr, targetReg, varNum, 0);
- genProduceReg(treeNode);
- }
- }
- break;
-
- case GT_STORE_LCL_FLD:
- {
- noway_assert(targetType != TYP_STRUCT);
-
- // record the offset
- unsigned offset = treeNode->gtLclFld.gtLclOffs;
-
- // We must have a stack store with GT_STORE_LCL_FLD
- noway_assert(!treeNode->InReg());
- noway_assert(targetReg == REG_NA);
-
- GenTreeLclVarCommon* varNode = treeNode->AsLclVarCommon();
- unsigned varNum = varNode->gtLclNum;
- assert(varNum < compiler->lvaCount);
- LclVarDsc* varDsc = &(compiler->lvaTable[varNum]);
-
- // Ensure that lclVar nodes are typed correctly.
- assert(!varDsc->lvNormalizeOnStore() || targetType == genActualType(varDsc->TypeGet()));
-
- GenTreePtr data = treeNode->gtOp.gtOp1->gtEffectiveVal();
- genConsumeRegs(data);
-
- regNumber dataReg = REG_NA;
- if (data->isContainedIntOrIImmed())
- {
- assert(data->IsIntegralConst(0));
- dataReg = REG_ZR;
- }
- else
- {
- assert(!data->isContained());
- dataReg = data->gtRegNum;
- }
- assert(dataReg != REG_NA);
-
- instruction ins = ins_Store(targetType);
-
- emitAttr attr = emitTypeSize(targetType);
-
- attr = emit->emitInsAdjustLoadStoreAttr(ins, attr);
-
- emit->emitIns_S_R(ins, attr, dataReg, varNum, offset);
-
- genUpdateLife(varNode);
-
- varDsc->lvRegNum = REG_STK;
- }
- break;
-
- case GT_STORE_LCL_VAR:
- {
- GenTreeLclVarCommon* varNode = treeNode->AsLclVarCommon();
-
- unsigned varNum = varNode->gtLclNum;
- assert(varNum < compiler->lvaCount);
- LclVarDsc* varDsc = &(compiler->lvaTable[varNum]);
- unsigned offset = 0;
-
- // Ensure that lclVar nodes are typed correctly.
- assert(!varDsc->lvNormalizeOnStore() || targetType == genActualType(varDsc->TypeGet()));
-
- GenTreePtr data = treeNode->gtOp.gtOp1->gtEffectiveVal();
-
- // var = call, where call returns a multi-reg return value
- // case is handled separately.
- if (data->gtSkipReloadOrCopy()->IsMultiRegCall())
- {
- genMultiRegCallStoreToLocal(treeNode);
- }
- else
- {
- genConsumeRegs(data);
-
- regNumber dataReg = REG_NA;
- if (data->isContainedIntOrIImmed())
- {
- assert(data->IsIntegralConst(0));
- dataReg = REG_ZR;
- }
- else
- {
- assert(!data->isContained());
- dataReg = data->gtRegNum;
- }
- assert(dataReg != REG_NA);
-
- if (targetReg == REG_NA) // store into stack based LclVar
- {
- inst_set_SV_var(varNode);
-
- instruction ins = ins_Store(targetType);
- emitAttr attr = emitTypeSize(targetType);
-
- attr = emit->emitInsAdjustLoadStoreAttr(ins, attr);
-
- emit->emitIns_S_R(ins, attr, dataReg, varNum, offset);
-
- genUpdateLife(varNode);
-
- varDsc->lvRegNum = REG_STK;
- }
- else // store into register (i.e move into register)
- {
- if (dataReg != targetReg)
- {
- // Assign into targetReg when dataReg (from op1) is not the same register
- inst_RV_RV(ins_Copy(targetType), targetReg, dataReg, targetType);
- }
- genProduceReg(treeNode);
- }
- }
- }
- break;
-
- case GT_RETFILT:
- // A void GT_RETFILT is the end of a finally. For non-void filter returns we need to load the result in
- // the return register, if it's not already there. The processing is the same as GT_RETURN.
- if (targetType != TYP_VOID)
- {
- // For filters, the IL spec says the result is type int32. Further, the only specified legal values
- // are 0 or 1, with the use of other values "undefined".
- assert(targetType == TYP_INT);
- }
-
- __fallthrough;
-
- case GT_RETURN:
- genReturn(treeNode);
- break;
-
- case GT_LEA:
- {
- // if we are here, it is the case where there is an LEA that cannot
- // be folded into a parent instruction
- GenTreeAddrMode* lea = treeNode->AsAddrMode();
- genLeaInstruction(lea);
- }
- // genLeaInstruction calls genProduceReg()
- break;
-
- case GT_IND:
- genConsumeAddress(treeNode->AsIndir()->Addr());
- emit->emitInsLoadStoreOp(ins_Load(targetType), emitTypeSize(treeNode), targetReg, treeNode->AsIndir());
- genProduceReg(treeNode);
- break;
-
- case GT_MULHI:
- genCodeForMulHi(treeNode->AsOp());
- genProduceReg(treeNode);
- break;
-
- case GT_MOD:
- case GT_UMOD:
- // Integer MOD should have been morphed into a sequence of sub, mul, div in fgMorph.
- //
- // We shouldn't be seeing GT_MOD on float/double as it is morphed into a helper call by front-end.
- noway_assert(!"Codegen for GT_MOD/GT_UMOD");
- break;
-
- case GT_INTRINSIC:
- genIntrinsic(treeNode);
- break;
-
-#ifdef FEATURE_SIMD
- case GT_SIMD:
- genSIMDIntrinsic(treeNode->AsSIMD());
- break;
-#endif // FEATURE_SIMD
-
- case GT_CKFINITE:
- genCkfinite(treeNode);
- break;
-
- case GT_EQ:
- case GT_NE:
- case GT_LT:
- case GT_LE:
- case GT_GE:
- case GT_GT:
- {
- // TODO-ARM64-CQ: Check if we can use the currently set flags.
- // TODO-ARM64-CQ: Check for the case where we can simply transfer the carry bit to a register
- // (signed < or >= where targetReg != REG_NA)
-
- GenTreeOp* tree = treeNode->AsOp();
- GenTreePtr op1 = tree->gtOp1;
- GenTreePtr op2 = tree->gtOp2;
- var_types op1Type = op1->TypeGet();
- var_types op2Type = op2->TypeGet();
-
- assert(!op1->isUsedFromMemory());
- assert(!op2->isUsedFromMemory());
-
- genConsumeOperands(tree);
-
- emitAttr cmpSize = EA_UNKNOWN;
-
- if (varTypeIsFloating(op1Type))
- {
- assert(varTypeIsFloating(op2Type));
- assert(!op1->isContained());
- assert(op1Type == op2Type);
- cmpSize = EA_ATTR(genTypeSize(op1Type));
-
- if (op2->IsIntegralConst(0))
- {
- emit->emitIns_R_F(INS_fcmp, cmpSize, op1->gtRegNum, 0.0);
- }
- else
- {
- assert(!op2->isContained());
- emit->emitIns_R_R(INS_fcmp, cmpSize, op1->gtRegNum, op2->gtRegNum);
- }
- }
- else
- {
- assert(!varTypeIsFloating(op2Type));
- // We don't support swapping op1 and op2 to generate cmp reg, imm
- assert(!op1->isContainedIntOrIImmed());
-
- // TODO-ARM64-CQ: the second register argument of a CMP can be sign/zero
- // extended as part of the instruction (using "CMP (extended register)").
- // We should use that if possible, swapping operands
- // (and reversing the condition) if necessary.
- unsigned op1Size = genTypeSize(op1Type);
- unsigned op2Size = genTypeSize(op2Type);
-
- if ((op1Size < 4) || (op1Size < op2Size))
- {
- // We need to sign/zero extend op1 up to 32 or 64 bits.
- instruction ins = ins_Move_Extend(op1Type, true);
- inst_RV_RV(ins, op1->gtRegNum, op1->gtRegNum);
- }
-
- if (!op2->isContainedIntOrIImmed())
- {
- if ((op2Size < 4) || (op2Size < op1Size))
- {
- // We need to sign/zero extend op2 up to 32 or 64 bits.
- instruction ins = ins_Move_Extend(op2Type, true);
- inst_RV_RV(ins, op2->gtRegNum, op2->gtRegNum);
- }
- }
- cmpSize = EA_4BYTE;
- if ((op1Size == EA_8BYTE) || (op2Size == EA_8BYTE))
- {
- cmpSize = EA_8BYTE;
- }
-
- if (op2->isContainedIntOrIImmed())
- {
- GenTreeIntConCommon* intConst = op2->AsIntConCommon();
- emit->emitIns_R_I(INS_cmp, cmpSize, op1->gtRegNum, intConst->IconValue());
- }
- else
- {
- emit->emitIns_R_R(INS_cmp, cmpSize, op1->gtRegNum, op2->gtRegNum);
- }
- }
-
- // Are we evaluating this into a register?
- if (targetReg != REG_NA)
- {
- genSetRegToCond(targetReg, tree);
- genProduceReg(tree);
- }
- }
- break;
-
- case GT_JTRUE:
- genCodeForJumpTrue(treeNode);
- break;
-
- case GT_RETURNTRAP:
- {
- // this is nothing but a conditional call to CORINFO_HELP_STOP_FOR_GC
- // based on the contents of 'data'
-
- GenTree* data = treeNode->gtOp.gtOp1;
- genConsumeRegs(data);
- emit->emitIns_R_I(INS_cmp, EA_4BYTE, data->gtRegNum, 0);
-
- BasicBlock* skipLabel = genCreateTempLabel();
-
- emitJumpKind jmpEqual = genJumpKindForOper(GT_EQ, CK_SIGNED);
- inst_JMP(jmpEqual, skipLabel);
- // emit the call to the EE-helper that stops for GC (or other reasons)
-
- genEmitHelperCall(CORINFO_HELP_STOP_FOR_GC, 0, EA_UNKNOWN);
- genDefineTempLabel(skipLabel);
- }
- break;
-
- case GT_STOREIND:
- {
- GenTree* data = treeNode->gtOp.gtOp2;
- GenTree* addr = treeNode->gtOp.gtOp1;
- GCInfo::WriteBarrierForm writeBarrierForm = gcInfo.gcIsWriteBarrierCandidate(treeNode, data);
- if (writeBarrierForm != GCInfo::WBF_NoBarrier)
- {
- // data and addr must be in registers.
- // Consume both registers so that any copies of interfering
- // registers are taken care of.
- genConsumeOperands(treeNode->AsOp());
-
-#if NOGC_WRITE_BARRIERS
- // At this point, we should not have any interference.
- // That is, 'data' must not be in REG_WRITE_BARRIER_DST_BYREF,
- // as that is where 'addr' must go.
- noway_assert(data->gtRegNum != REG_WRITE_BARRIER_DST_BYREF);
-
- // 'addr' goes into x14 (REG_WRITE_BARRIER_DST_BYREF)
- if (addr->gtRegNum != REG_WRITE_BARRIER_DST_BYREF)
- {
- inst_RV_RV(INS_mov, REG_WRITE_BARRIER_DST_BYREF, addr->gtRegNum, addr->TypeGet());
- }
-
- // 'data' goes into x15 (REG_WRITE_BARRIER)
- if (data->gtRegNum != REG_WRITE_BARRIER)
- {
- inst_RV_RV(INS_mov, REG_WRITE_BARRIER, data->gtRegNum, data->TypeGet());
- }
-#else
- // At this point, we should not have any interference.
- // That is, 'data' must not be in REG_ARG_0,
- // as that is where 'addr' must go.
- noway_assert(data->gtRegNum != REG_ARG_0);
-
- // addr goes in REG_ARG_0
- if (addr->gtRegNum != REG_ARG_0)
- {
- inst_RV_RV(INS_mov, REG_ARG_0, addr->gtRegNum, addr->TypeGet());
- }
-
- // data goes in REG_ARG_1
- if (data->gtRegNum != REG_ARG_1)
- {
- inst_RV_RV(INS_mov, REG_ARG_1, data->gtRegNum, data->TypeGet());
- }
-#endif // NOGC_WRITE_BARRIERS
-
- genGCWriteBarrier(treeNode, writeBarrierForm);
- }
- else // A normal store, not a WriteBarrier store
- {
- bool reverseOps = ((treeNode->gtFlags & GTF_REVERSE_OPS) != 0);
- bool dataIsUnary = false;
- GenTree* nonRMWsrc = nullptr;
- // We must consume the operands in the proper execution order,
- // so that liveness is updated appropriately.
- if (!reverseOps)
- {
- genConsumeAddress(addr);
- }
-
- if (!data->isContained())
- {
- genConsumeRegs(data);
- }
-
- if (reverseOps)
- {
- genConsumeAddress(addr);
- }
-
- regNumber dataReg = REG_NA;
- if (data->isContainedIntOrIImmed())
- {
- assert(data->IsIntegralConst(0));
- dataReg = REG_ZR;
- }
- else // data is not contained, so evaluate it into a register
- {
- assert(!data->isContained());
- dataReg = data->gtRegNum;
- }
-
- emit->emitInsLoadStoreOp(ins_Store(targetType), emitTypeSize(treeNode), dataReg, treeNode->AsIndir());
- }
- }
- break;
-
- case GT_COPY:
- // This is handled at the time we call genConsumeReg() on the GT_COPY
- break;
-
- case GT_SWAP:
- {
- // Swap is only supported for lclVar operands that are enregistered
- // We do not consume or produce any registers. Both operands remain enregistered.
- // However, the gc-ness may change.
- assert(genIsRegCandidateLocal(treeNode->gtOp.gtOp1) && genIsRegCandidateLocal(treeNode->gtOp.gtOp2));
-
- GenTreeLclVarCommon* lcl1 = treeNode->gtOp.gtOp1->AsLclVarCommon();
- LclVarDsc* varDsc1 = &(compiler->lvaTable[lcl1->gtLclNum]);
- var_types type1 = varDsc1->TypeGet();
- GenTreeLclVarCommon* lcl2 = treeNode->gtOp.gtOp2->AsLclVarCommon();
- LclVarDsc* varDsc2 = &(compiler->lvaTable[lcl2->gtLclNum]);
- var_types type2 = varDsc2->TypeGet();
-
- // We must have both int or both fp regs
- assert(!varTypeIsFloating(type1) || varTypeIsFloating(type2));
-
- // FP swap is not yet implemented (and should have NYI'd in LSRA)
- assert(!varTypeIsFloating(type1));
-
- regNumber oldOp1Reg = lcl1->gtRegNum;
- regMaskTP oldOp1RegMask = genRegMask(oldOp1Reg);
- regNumber oldOp2Reg = lcl2->gtRegNum;
- regMaskTP oldOp2RegMask = genRegMask(oldOp2Reg);
-
- // We don't call genUpdateVarReg because we don't have a tree node with the new register.
- varDsc1->lvRegNum = oldOp2Reg;
- varDsc2->lvRegNum = oldOp1Reg;
-
- // Do the xchg
- emitAttr size = EA_PTRSIZE;
- if (varTypeGCtype(type1) != varTypeGCtype(type2))
- {
- // If the type specified to the emitter is a GC type, it will swap the GC-ness of the registers.
- // Otherwise it will leave them alone, which is correct if they have the same GC-ness.
- size = EA_GCREF;
- }
-
- NYI("register swap");
- // inst_RV_RV(INS_xchg, oldOp1Reg, oldOp2Reg, TYP_I_IMPL, size);
-
- // Update the gcInfo.
- // Manually remove these regs for the gc sets (mostly to avoid confusing duplicative dump output)
- gcInfo.gcRegByrefSetCur &= ~(oldOp1RegMask | oldOp2RegMask);
- gcInfo.gcRegGCrefSetCur &= ~(oldOp1RegMask | oldOp2RegMask);
-
- // gcMarkRegPtrVal will do the appropriate thing for non-gc types.
- // It will also dump the updates.
- gcInfo.gcMarkRegPtrVal(oldOp2Reg, type1);
- gcInfo.gcMarkRegPtrVal(oldOp1Reg, type2);
- }
- break;
-
- case GT_LIST:
- case GT_FIELD_LIST:
- case GT_ARGPLACE:
- // Nothing to do
- break;
-
- case GT_PUTARG_STK:
- genPutArgStk(treeNode->AsPutArgStk());
- break;
-
- case GT_PUTARG_REG:
- assert(targetType != TYP_STRUCT); // Any TYP_STRUCT register args should have been removed by
- // fgMorphMultiregStructArg
- // We have a normal non-Struct targetType
- {
- GenTree* op1 = treeNode->gtOp.gtOp1;
- // If child node is not already in the register we need, move it
- genConsumeReg(op1);
- if (targetReg != op1->gtRegNum)
- {
- inst_RV_RV(ins_Copy(targetType), targetReg, op1->gtRegNum, targetType);
- }
- }
- genProduceReg(treeNode);
- break;
-
- case GT_CALL:
- genCallInstruction(treeNode->AsCall());
- break;
-
- case GT_JMP:
- genJmpMethod(treeNode);
- break;
-
- case GT_LOCKADD:
- case GT_XCHG:
- case GT_XADD:
- genLockedInstructions(treeNode->AsOp());
- break;
-
- case GT_MEMORYBARRIER:
- instGen_MemoryBarrier();
- break;
-
- case GT_CMPXCHG:
- NYI("GT_CMPXCHG");
- break;
-
- case GT_RELOAD:
- // do nothing - reload is just a marker.
- // The parent node will call genConsumeReg on this which will trigger the unspill of this node's child
- // into the register specified in this node.
- break;
-
- case GT_NOP:
- break;
-
- case GT_NO_OP:
- if (treeNode->gtFlags & GTF_NO_OP_NO)
- {
- noway_assert(!"GTF_NO_OP_NO should not be set");
- }
- else
- {
- instGen(INS_nop);
- }
- break;
-
- case GT_ARR_BOUNDS_CHECK:
-#ifdef FEATURE_SIMD
- case GT_SIMD_CHK:
-#endif // FEATURE_SIMD
- genRangeCheck(treeNode);
- break;
-
- case GT_PHYSREG:
- if (targetReg != treeNode->AsPhysReg()->gtSrcReg)
- {
- inst_RV_RV(ins_Copy(targetType), targetReg, treeNode->AsPhysReg()->gtSrcReg, targetType);
-
- genTransferRegGCState(targetReg, treeNode->AsPhysReg()->gtSrcReg);
- }
- genProduceReg(treeNode);
- break;
-
- case GT_PHYSREGDST:
- break;
-
- case GT_NULLCHECK:
- {
- assert(!treeNode->gtOp.gtOp1->isContained());
- regNumber reg = genConsumeReg(treeNode->gtOp.gtOp1);
- emit->emitIns_R_R_I(INS_ldr, EA_4BYTE, REG_ZR, reg, 0);
- }
- break;
-
- case GT_CATCH_ARG:
-
- noway_assert(handlerGetsXcptnObj(compiler->compCurBB->bbCatchTyp));
-
- /* Catch arguments get passed in a register. genCodeForBBlist()
- would have marked it as holding a GC object, but not used. */
-
- noway_assert(gcInfo.gcRegGCrefSetCur & RBM_EXCEPTION_OBJECT);
- genConsumeReg(treeNode);
- break;
-
- case GT_PINVOKE_PROLOG:
- noway_assert(((gcInfo.gcRegGCrefSetCur | gcInfo.gcRegByrefSetCur) & ~fullIntArgRegMask()) == 0);
-
- // the runtime side requires the codegen here to be consistent
- emit->emitDisableRandomNops();
- break;
-
- case GT_LABEL:
- genPendingCallLabel = genCreateTempLabel();
- treeNode->gtLabel.gtLabBB = genPendingCallLabel;
-
- // For long address (default): `adrp + add` will be emitted.
- // For short address (proven later): `adr` will be emitted.
- emit->emitIns_R_L(INS_adr, EA_PTRSIZE, genPendingCallLabel, targetReg);
- break;
-
- case GT_STORE_OBJ:
- if (treeNode->OperIsCopyBlkOp())
- {
- assert(treeNode->AsObj()->gtGcPtrCount != 0);
- genCodeForCpObj(treeNode->AsObj());
- break;
- }
- __fallthrough;
-
- case GT_STORE_DYN_BLK:
- case GT_STORE_BLK:
- {
- GenTreeBlk* blkOp = treeNode->AsBlk();
- if (blkOp->gtBlkOpGcUnsafe)
- {
- getEmitter()->emitDisableGC();
- }
- bool isCopyBlk = blkOp->OperIsCopyBlkOp();
-
- switch (blkOp->gtBlkOpKind)
- {
- case GenTreeBlk::BlkOpKindHelper:
- if (isCopyBlk)
- {
- genCodeForCpBlk(blkOp);
- }
- else
- {
- genCodeForInitBlk(blkOp);
- }
- break;
- case GenTreeBlk::BlkOpKindUnroll:
- if (isCopyBlk)
- {
- genCodeForCpBlkUnroll(blkOp);
- }
- else
- {
- genCodeForInitBlkUnroll(blkOp);
- }
- break;
- default:
- unreached();
- }
- if (blkOp->gtBlkOpGcUnsafe)
- {
- getEmitter()->emitEnableGC();
- }
- }
- break;
-
- case GT_JMPTABLE:
- genJumpTable(treeNode);
- break;
-
- case GT_SWITCH_TABLE:
- genTableBasedSwitch(treeNode);
- break;
-
- case GT_ARR_INDEX:
- genCodeForArrIndex(treeNode->AsArrIndex());
- break;
-
- case GT_ARR_OFFSET:
- genCodeForArrOffset(treeNode->AsArrOffs());
- break;
-
- case GT_CLS_VAR_ADDR:
- NYI("GT_CLS_VAR_ADDR");
- break;
-
- case GT_IL_OFFSET:
- // Do nothing; these nodes are simply markers for debug info.
- break;
-
- default:
- {
-#ifdef DEBUG
- char message[256];
- _snprintf_s(message, _countof(message), _TRUNCATE, "Unimplemented node type %s\n",
- GenTree::NodeName(treeNode->OperGet()));
-#endif
- assert(!"Unknown node in codegen");
- }
- break;
- }
-}
-
/***********************************************************************************************
* Generate code for localloc
*/
@@ -3158,6 +2391,154 @@ BAILOUT:
genProduceReg(tree);
}
+//------------------------------------------------------------------------
+// genCodeForNegNot: Produce code for a GT_NEG/GT_NOT node.
+//
+// Arguments:
+// tree - the node
+//
+void CodeGen::genCodeForNegNot(GenTree* tree)
+{
+ assert(tree->OperIs(GT_NEG, GT_NOT));
+
+ var_types targetType = tree->TypeGet();
+
+ assert(!tree->OperIs(GT_NOT) || !varTypeIsFloating(targetType));
+
+ regNumber targetReg = tree->gtRegNum;
+ instruction ins = genGetInsForOper(tree->OperGet(), targetType);
+
+ // The arithmetic node must be sitting in a register (since it's not contained)
+ assert(!tree->isContained());
+ // The dst can only be a register.
+ assert(targetReg != REG_NA);
+
+ GenTreePtr operand = tree->gtGetOp1();
+ assert(!operand->isContained());
+ // The src must be a register.
+ regNumber operandReg = genConsumeReg(operand);
+
+ getEmitter()->emitIns_R_R(ins, emitTypeSize(tree), targetReg, operandReg);
+
+ genProduceReg(tree);
+}
+
+//------------------------------------------------------------------------
+// genCodeForDivMod: Produce code for a GT_DIV/GT_UDIV node. We don't see MOD:
+// (1) integer MOD is morphed into a sequence of sub, mul, div in fgMorph;
+// (2) float/double MOD is morphed into a helper call by front-end.
+//
+// Arguments:
+// tree - the node
+//
+void CodeGen::genCodeForDivMod(GenTreeOp* tree)
+{
+ assert(tree->OperIs(GT_DIV, GT_UDIV));
+
+ var_types targetType = tree->TypeGet();
+ emitter* emit = getEmitter();
+
+ genConsumeOperands(tree);
+
+ if (varTypeIsFloating(targetType))
+ {
+ // Floating point divide never raises an exception
+ genCodeForBinary(tree);
+ }
+ else // an integer divide operation
+ {
+ GenTreePtr divisorOp = tree->gtGetOp2();
+ emitAttr size = EA_ATTR(genTypeSize(genActualType(tree->TypeGet())));
+
+ if (divisorOp->IsIntegralConst(0))
+ {
+ // We unconditionally throw a divide by zero exception
+ genJumpToThrowHlpBlk(EJ_jmp, SCK_DIV_BY_ZERO);
+
+ // We still need to call genProduceReg
+ genProduceReg(tree);
+ }
+ else // the divisor is not the constant zero
+ {
+ regNumber divisorReg = divisorOp->gtRegNum;
+
+ // Generate the require runtime checks for GT_DIV or GT_UDIV
+ if (tree->gtOper == GT_DIV)
+ {
+ BasicBlock* sdivLabel = genCreateTempLabel();
+
+ // Two possible exceptions:
+ // (AnyVal / 0) => DivideByZeroException
+ // (MinInt / -1) => ArithmeticException
+ //
+ bool checkDividend = true;
+
+ // Do we have an immediate for the 'divisorOp'?
+ //
+ if (divisorOp->IsCnsIntOrI())
+ {
+ GenTreeIntConCommon* intConstTree = divisorOp->AsIntConCommon();
+ ssize_t intConstValue = intConstTree->IconValue();
+ assert(intConstValue != 0); // already checked above by IsIntegralConst(0))
+ if (intConstValue != -1)
+ {
+ checkDividend = false; // We statically know that the dividend is not -1
+ }
+ }
+ else // insert check for divison by zero
+ {
+ // Check if the divisor is zero throw a DivideByZeroException
+ emit->emitIns_R_I(INS_cmp, size, divisorReg, 0);
+ emitJumpKind jmpEqual = genJumpKindForOper(GT_EQ, CK_SIGNED);
+ genJumpToThrowHlpBlk(jmpEqual, SCK_DIV_BY_ZERO);
+ }
+
+ if (checkDividend)
+ {
+ // Check if the divisor is not -1 branch to 'sdivLabel'
+ emit->emitIns_R_I(INS_cmp, size, divisorReg, -1);
+
+ emitJumpKind jmpNotEqual = genJumpKindForOper(GT_NE, CK_SIGNED);
+ inst_JMP(jmpNotEqual, sdivLabel);
+ // If control flow continues past here the 'divisorReg' is known to be -1
+
+ regNumber dividendReg = tree->gtGetOp1()->gtRegNum;
+ // At this point the divisor is known to be -1
+ //
+ // Issue the 'adds zr, dividendReg, dividendReg' instruction
+ // this will set both the Z and V flags only when dividendReg is MinInt
+ //
+ emit->emitIns_R_R_R(INS_adds, size, REG_ZR, dividendReg, dividendReg);
+ inst_JMP(jmpNotEqual, sdivLabel); // goto sdiv if the Z flag is clear
+ genJumpToThrowHlpBlk(EJ_vs, SCK_ARITH_EXCPN); // if the V flags is set throw
+ // ArithmeticException
+
+ genDefineTempLabel(sdivLabel);
+ }
+ genCodeForBinary(tree); // Generate the sdiv instruction
+ }
+ else // (tree->gtOper == GT_UDIV)
+ {
+ // Only one possible exception
+ // (AnyVal / 0) => DivideByZeroException
+ //
+ // Note that division by the constant 0 was already checked for above by the
+ // op2->IsIntegralConst(0) check
+ //
+ if (!divisorOp->IsCnsIntOrI())
+ {
+ // divisorOp is not a constant, so it could be zero
+ //
+ emit->emitIns_R_I(INS_cmp, size, divisorReg, 0);
+ emitJumpKind jmpEqual = genJumpKindForOper(GT_EQ, CK_SIGNED);
+ genJumpToThrowHlpBlk(jmpEqual, SCK_DIV_BY_ZERO);
+ }
+ genCodeForBinary(tree);
+ }
+ }
+ }
+}
+
// Generate code for InitBlk by performing a loop unroll
// Preconditions:
// a) Both the size and fill byte value are integer constants.
@@ -3182,6 +2563,12 @@ void CodeGen::genCodeForInitBlkUnroll(GenTreeBlk* initBlkNode)
genConsumeOperands(initBlkNode);
+ if (initBlkNode->gtFlags & GTF_BLK_VOLATILE)
+ {
+ // issue a full memory barrier before volatile an initBlockUnroll operation
+ instGen_MemoryBarrier();
+ }
+
regNumber valReg = initVal->IsIntegralConst(0) ? REG_ZR : initVal->gtRegNum;
assert(!initVal->IsIntegralConst(0) || (valReg == REG_ZR));
@@ -3257,9 +2644,7 @@ void CodeGen::genCodeForLoadPairOffset(regNumber dst, regNumber dst2, GenTree* b
if (base->gtOper == GT_LCL_FLD_ADDR)
offset += base->gtLclFld.gtLclOffs;
- // TODO-ARM64-CQ: Implement support for using a ldp instruction with a varNum (see emitIns_R_S)
- emit->emitIns_R_S(INS_ldr, EA_8BYTE, dst, base->gtLclVarCommon.gtLclNum, offset);
- emit->emitIns_R_S(INS_ldr, EA_8BYTE, dst2, base->gtLclVarCommon.gtLclNum, offset + REGSIZE_BYTES);
+ emit->emitIns_R_R_S_S(INS_ldp, EA_8BYTE, EA_8BYTE, dst, dst2, base->gtLclVarCommon.gtLclNum, offset);
}
else
{
@@ -3298,9 +2683,7 @@ void CodeGen::genCodeForStorePairOffset(regNumber src, regNumber src2, GenTree*
if (base->gtOper == GT_LCL_FLD_ADDR)
offset += base->gtLclFld.gtLclOffs;
- // TODO-ARM64-CQ: Implement support for using a stp instruction with a varNum (see emitIns_S_R)
- emit->emitIns_S_R(INS_str, EA_8BYTE, src, base->gtLclVarCommon.gtLclNum, offset);
- emit->emitIns_S_R(INS_str, EA_8BYTE, src2, base->gtLclVarCommon.gtLclNum, offset + REGSIZE_BYTES);
+ emit->emitIns_S_S_R_R(INS_stp, EA_8BYTE, EA_8BYTE, src, src2, base->gtLclVarCommon.gtLclNum, offset);
}
else
{
@@ -3324,6 +2707,12 @@ void CodeGen::genCodeForCpBlkUnroll(GenTreeBlk* cpBlkNode)
emitter* emit = getEmitter();
+ if (cpBlkNode->gtFlags & GTF_BLK_VOLATILE)
+ {
+ // issue a full memory barrier before & after a volatile CpBlkUnroll operation
+ instGen_MemoryBarrier();
+ }
+
if (source->gtOper == GT_IND)
{
srcAddr = source->gtGetOp1();
@@ -3402,6 +2791,12 @@ void CodeGen::genCodeForCpBlkUnroll(GenTreeBlk* cpBlkNode)
genCodeForStoreOffset(INS_strb, EA_1BYTE, tmpReg, dstAddr, offset);
}
}
+
+ if (cpBlkNode->gtFlags & GTF_BLK_VOLATILE)
+ {
+ // issue a full memory barrier before & after a volatile CpBlkUnroll operation
+ instGen_MemoryBarrier();
+ }
}
// Generate code for CpObj nodes wich copy structs that have interleaved
@@ -3461,30 +2856,60 @@ void CodeGen::genCodeForCpObj(GenTreeObj* cpObjNode)
gcInfo.gcMarkRegPtrVal(REG_WRITE_BARRIER_SRC_BYREF, srcAddrType);
gcInfo.gcMarkRegPtrVal(REG_WRITE_BARRIER_DST_BYREF, dstAddr->TypeGet());
- // Temp register used to perform the sequence of loads and stores.
- regNumber tmpReg = cpObjNode->GetSingleTempReg();
+ unsigned slots = cpObjNode->gtSlots;
+
+ // Temp register(s) used to perform the sequence of loads and stores.
+ regNumber tmpReg = cpObjNode->ExtractTempReg();
+ regNumber tmpReg2 = REG_NA;
+
assert(genIsValidIntReg(tmpReg));
+ assert(tmpReg != REG_WRITE_BARRIER_SRC_BYREF);
+ assert(tmpReg != REG_WRITE_BARRIER_DST_BYREF);
- unsigned slots = cpObjNode->gtSlots;
- emitter* emit = getEmitter();
+ if (slots > 1)
+ {
+ tmpReg2 = cpObjNode->GetSingleTempReg();
+ assert(tmpReg2 != tmpReg);
+ assert(genIsValidIntReg(tmpReg2));
+ assert(tmpReg2 != REG_WRITE_BARRIER_DST_BYREF);
+ assert(tmpReg2 != REG_WRITE_BARRIER_SRC_BYREF);
+ }
+
+ if (cpObjNode->gtFlags & GTF_BLK_VOLATILE)
+ {
+ // issue a full memory barrier before & after a volatile CpObj operation
+ instGen_MemoryBarrier();
+ }
+
+ emitter* emit = getEmitter();
BYTE* gcPtrs = cpObjNode->gtGcPtrs;
// If we can prove it's on the stack we don't need to use the write barrier.
if (dstOnStack)
{
- // TODO-ARM64-CQ: Consider using LDP/STP to save codesize.
- for (unsigned i = 0; i < slots; ++i)
+ unsigned i = 0;
+ // Check if two or more remaining slots and use a ldp/stp sequence
+ while (i < slots - 1)
{
- emitAttr attr = EA_8BYTE;
- if (gcPtrs[i] == GCT_GCREF)
- attr = EA_GCREF;
- else if (gcPtrs[i] == GCT_BYREF)
- attr = EA_BYREF;
+ emitAttr attr0 = emitTypeSize(compiler->getJitGCType(gcPtrs[i + 0]));
+ emitAttr attr1 = emitTypeSize(compiler->getJitGCType(gcPtrs[i + 1]));
+
+ emit->emitIns_R_R_R_I(INS_ldp, attr0, tmpReg, tmpReg2, REG_WRITE_BARRIER_SRC_BYREF, 2 * TARGET_POINTER_SIZE,
+ INS_OPTS_POST_INDEX, attr1);
+ emit->emitIns_R_R_R_I(INS_stp, attr0, tmpReg, tmpReg2, REG_WRITE_BARRIER_DST_BYREF, 2 * TARGET_POINTER_SIZE,
+ INS_OPTS_POST_INDEX, attr1);
+ i += 2;
+ }
+
+ // Use a ldr/str sequence for the last remainder
+ if (i < slots)
+ {
+ emitAttr attr0 = emitTypeSize(compiler->getJitGCType(gcPtrs[i + 0]));
- emit->emitIns_R_R_I(INS_ldr, attr, tmpReg, REG_WRITE_BARRIER_SRC_BYREF, TARGET_POINTER_SIZE,
+ emit->emitIns_R_R_I(INS_ldr, attr0, tmpReg, REG_WRITE_BARRIER_SRC_BYREF, TARGET_POINTER_SIZE,
INS_OPTS_POST_INDEX);
- emit->emitIns_R_R_I(INS_str, attr, tmpReg, REG_WRITE_BARRIER_DST_BYREF, TARGET_POINTER_SIZE,
+ emit->emitIns_R_R_I(INS_str, attr0, tmpReg, REG_WRITE_BARRIER_DST_BYREF, TARGET_POINTER_SIZE,
INS_OPTS_POST_INDEX);
}
}
@@ -3498,11 +2923,22 @@ void CodeGen::genCodeForCpObj(GenTreeObj* cpObjNode)
switch (gcPtrs[i])
{
case TYPE_GC_NONE:
- // TODO-ARM64-CQ: Consider using LDP/STP to save codesize in case of contigous NON-GC slots.
- emit->emitIns_R_R_I(INS_ldr, EA_8BYTE, tmpReg, REG_WRITE_BARRIER_SRC_BYREF, TARGET_POINTER_SIZE,
- INS_OPTS_POST_INDEX);
- emit->emitIns_R_R_I(INS_str, EA_8BYTE, tmpReg, REG_WRITE_BARRIER_DST_BYREF, TARGET_POINTER_SIZE,
- INS_OPTS_POST_INDEX);
+ // Check if the next slot's type is also TYP_GC_NONE and use ldp/stp
+ if ((i + 1 < slots) && (gcPtrs[i + 1] == TYPE_GC_NONE))
+ {
+ emit->emitIns_R_R_R_I(INS_ldp, EA_8BYTE, tmpReg, tmpReg2, REG_WRITE_BARRIER_SRC_BYREF,
+ 2 * TARGET_POINTER_SIZE, INS_OPTS_POST_INDEX);
+ emit->emitIns_R_R_R_I(INS_stp, EA_8BYTE, tmpReg, tmpReg2, REG_WRITE_BARRIER_DST_BYREF,
+ 2 * TARGET_POINTER_SIZE, INS_OPTS_POST_INDEX);
+ ++i; // extra increment of i, since we are copying two items
+ }
+ else
+ {
+ emit->emitIns_R_R_I(INS_ldr, EA_8BYTE, tmpReg, REG_WRITE_BARRIER_SRC_BYREF, TARGET_POINTER_SIZE,
+ INS_OPTS_POST_INDEX);
+ emit->emitIns_R_R_I(INS_str, EA_8BYTE, tmpReg, REG_WRITE_BARRIER_DST_BYREF, TARGET_POINTER_SIZE,
+ INS_OPTS_POST_INDEX);
+ }
break;
default:
@@ -3517,6 +2953,12 @@ void CodeGen::genCodeForCpObj(GenTreeObj* cpObjNode)
assert(gcPtrCount == 0);
}
+ if (cpObjNode->gtFlags & GTF_BLK_VOLATILE)
+ {
+ // issue a full memory barrier before & after a volatile CpObj operation
+ instGen_MemoryBarrier();
+ }
+
// Clear the gcInfo for REG_WRITE_BARRIER_SRC_BYREF and REG_WRITE_BARRIER_DST_BYREF.
// While we normally update GC info prior to the last instruction that uses them,
// these actually live into the helper call.
@@ -4069,6 +3511,194 @@ void CodeGen::genLeaInstruction(GenTreeAddrMode* lea)
genProduceReg(lea);
}
+//------------------------------------------------------------------------
+// genCodeForReturnTrap: Produce code for a GT_RETURNTRAP node.
+//
+// Arguments:
+// tree - the GT_RETURNTRAP node
+//
+void CodeGen::genCodeForReturnTrap(GenTreeOp* tree)
+{
+ assert(tree->OperGet() == GT_RETURNTRAP);
+
+ // this is nothing but a conditional call to CORINFO_HELP_STOP_FOR_GC
+ // based on the contents of 'data'
+
+ GenTree* data = tree->gtOp1;
+ genConsumeRegs(data);
+ getEmitter()->emitIns_R_I(INS_cmp, EA_4BYTE, data->gtRegNum, 0);
+
+ BasicBlock* skipLabel = genCreateTempLabel();
+
+ emitJumpKind jmpEqual = genJumpKindForOper(GT_EQ, CK_SIGNED);
+ inst_JMP(jmpEqual, skipLabel);
+ // emit the call to the EE-helper that stops for GC (or other reasons)
+
+ genEmitHelperCall(CORINFO_HELP_STOP_FOR_GC, 0, EA_UNKNOWN);
+ genDefineTempLabel(skipLabel);
+}
+
+//------------------------------------------------------------------------
+// genCodeForStoreInd: Produce code for a GT_STOREIND node.
+//
+// Arguments:
+// tree - the GT_STOREIND node
+//
+void CodeGen::genCodeForStoreInd(GenTreeStoreInd* tree)
+{
+ GenTree* data = tree->Data();
+ GenTree* addr = tree->Addr();
+ var_types targetType = tree->TypeGet();
+ emitter* emit = getEmitter();
+
+ GCInfo::WriteBarrierForm writeBarrierForm = gcInfo.gcIsWriteBarrierCandidate(tree, data);
+ if (writeBarrierForm != GCInfo::WBF_NoBarrier)
+ {
+ // data and addr must be in registers.
+ // Consume both registers so that any copies of interfering
+ // registers are taken care of.
+ genConsumeOperands(tree);
+
+#if NOGC_WRITE_BARRIERS
+ // At this point, we should not have any interference.
+ // That is, 'data' must not be in REG_WRITE_BARRIER_DST_BYREF,
+ // as that is where 'addr' must go.
+ noway_assert(data->gtRegNum != REG_WRITE_BARRIER_DST_BYREF);
+
+ // 'addr' goes into x14 (REG_WRITE_BARRIER_DST_BYREF)
+ if (addr->gtRegNum != REG_WRITE_BARRIER_DST_BYREF)
+ {
+ inst_RV_RV(INS_mov, REG_WRITE_BARRIER_DST_BYREF, addr->gtRegNum, addr->TypeGet());
+ }
+
+ // 'data' goes into x15 (REG_WRITE_BARRIER)
+ if (data->gtRegNum != REG_WRITE_BARRIER)
+ {
+ inst_RV_RV(INS_mov, REG_WRITE_BARRIER, data->gtRegNum, data->TypeGet());
+ }
+#else
+ // At this point, we should not have any interference.
+ // That is, 'data' must not be in REG_ARG_0,
+ // as that is where 'addr' must go.
+ noway_assert(data->gtRegNum != REG_ARG_0);
+
+ // addr goes in REG_ARG_0
+ if (addr->gtRegNum != REG_ARG_0)
+ {
+ inst_RV_RV(INS_mov, REG_ARG_0, addr->gtRegNum, addr->TypeGet());
+ }
+
+ // data goes in REG_ARG_1
+ if (data->gtRegNum != REG_ARG_1)
+ {
+ inst_RV_RV(INS_mov, REG_ARG_1, data->gtRegNum, data->TypeGet());
+ }
+#endif // NOGC_WRITE_BARRIERS
+
+ genGCWriteBarrier(tree, writeBarrierForm);
+ }
+ else // A normal store, not a WriteBarrier store
+ {
+ bool reverseOps = ((tree->gtFlags & GTF_REVERSE_OPS) != 0);
+ bool dataIsUnary = false;
+ GenTree* nonRMWsrc = nullptr;
+ // We must consume the operands in the proper execution order,
+ // so that liveness is updated appropriately.
+ if (!reverseOps)
+ {
+ genConsumeAddress(addr);
+ }
+
+ if (!data->isContained())
+ {
+ genConsumeRegs(data);
+ }
+
+ if (reverseOps)
+ {
+ genConsumeAddress(addr);
+ }
+
+ regNumber dataReg = REG_NA;
+ if (data->isContainedIntOrIImmed())
+ {
+ assert(data->IsIntegralConst(0));
+ dataReg = REG_ZR;
+ }
+ else // data is not contained, so evaluate it into a register
+ {
+ assert(!data->isContained());
+ dataReg = data->gtRegNum;
+ }
+
+ if (tree->gtFlags & GTF_IND_VOLATILE)
+ {
+ // issue a full memory barrier a before volatile StInd
+ instGen_MemoryBarrier();
+ }
+
+ emit->emitInsLoadStoreOp(ins_Store(targetType), emitTypeSize(tree), dataReg, tree);
+ }
+}
+
+//------------------------------------------------------------------------
+// genCodeForSwap: Produce code for a GT_SWAP node.
+//
+// Arguments:
+// tree - the GT_SWAP node
+//
+void CodeGen::genCodeForSwap(GenTreeOp* tree)
+{
+ // Swap is only supported for lclVar operands that are enregistered
+ // We do not consume or produce any registers. Both operands remain enregistered.
+ // However, the gc-ness may change.
+ assert(genIsRegCandidateLocal(tree->gtOp1) && genIsRegCandidateLocal(tree->gtOp2));
+
+ GenTreeLclVarCommon* lcl1 = tree->gtOp1->AsLclVarCommon();
+ LclVarDsc* varDsc1 = &(compiler->lvaTable[lcl1->gtLclNum]);
+ var_types type1 = varDsc1->TypeGet();
+ GenTreeLclVarCommon* lcl2 = tree->gtOp2->AsLclVarCommon();
+ LclVarDsc* varDsc2 = &(compiler->lvaTable[lcl2->gtLclNum]);
+ var_types type2 = varDsc2->TypeGet();
+
+ // We must have both int or both fp regs
+ assert(!varTypeIsFloating(type1) || varTypeIsFloating(type2));
+
+ // FP swap is not yet implemented (and should have NYI'd in LSRA)
+ assert(!varTypeIsFloating(type1));
+
+ regNumber oldOp1Reg = lcl1->gtRegNum;
+ regMaskTP oldOp1RegMask = genRegMask(oldOp1Reg);
+ regNumber oldOp2Reg = lcl2->gtRegNum;
+ regMaskTP oldOp2RegMask = genRegMask(oldOp2Reg);
+
+ // We don't call genUpdateVarReg because we don't have a tree node with the new register.
+ varDsc1->lvRegNum = oldOp2Reg;
+ varDsc2->lvRegNum = oldOp1Reg;
+
+ // Do the xchg
+ emitAttr size = EA_PTRSIZE;
+ if (varTypeGCtype(type1) != varTypeGCtype(type2))
+ {
+ // If the type specified to the emitter is a GC type, it will swap the GC-ness of the registers.
+ // Otherwise it will leave them alone, which is correct if they have the same GC-ness.
+ size = EA_GCREF;
+ }
+
+ NYI("register swap");
+ // inst_RV_RV(INS_xchg, oldOp1Reg, oldOp2Reg, TYP_I_IMPL, size);
+
+ // Update the gcInfo.
+ // Manually remove these regs for the gc sets (mostly to avoid confusing duplicative dump output)
+ gcInfo.gcRegByrefSetCur &= ~(oldOp1RegMask | oldOp2RegMask);
+ gcInfo.gcRegGCrefSetCur &= ~(oldOp1RegMask | oldOp2RegMask);
+
+ // gcMarkRegPtrVal will do the appropriate thing for non-gc types.
+ // It will also dump the updates.
+ gcInfo.gcMarkRegPtrVal(oldOp2Reg, type1);
+ gcInfo.gcMarkRegPtrVal(oldOp1Reg, type2);
+}
+
//-------------------------------------------------------------------------------------------
// genSetRegToCond: Set a register 'dstReg' to the appropriate one or zero value
// corresponding to a binary Relational operator result.
@@ -4335,6 +3965,104 @@ void CodeGen::genCkfinite(GenTreePtr treeNode)
genProduceReg(treeNode);
}
+//------------------------------------------------------------------------
+// genCodeForCompare: Produce code for a GT_EQ/GT_NE/GT_LT/GT_LE/GT_GE/GT_GT node.
+//
+// Arguments:
+// tree - the node
+//
+void CodeGen::genCodeForCompare(GenTreeOp* tree)
+{
+ regNumber targetReg = tree->gtRegNum;
+ emitter* emit = getEmitter();
+
+ // TODO-ARM64-CQ: Check if we can use the currently set flags.
+ // TODO-ARM64-CQ: Check for the case where we can simply transfer the carry bit to a register
+ // (signed < or >= where targetReg != REG_NA)
+
+ GenTreePtr op1 = tree->gtOp1;
+ GenTreePtr op2 = tree->gtOp2;
+ var_types op1Type = op1->TypeGet();
+ var_types op2Type = op2->TypeGet();
+
+ assert(!op1->isUsedFromMemory());
+ assert(!op2->isUsedFromMemory());
+
+ genConsumeOperands(tree);
+
+ emitAttr cmpSize = EA_UNKNOWN;
+
+ if (varTypeIsFloating(op1Type))
+ {
+ assert(varTypeIsFloating(op2Type));
+ assert(!op1->isContained());
+ assert(op1Type == op2Type);
+ cmpSize = EA_ATTR(genTypeSize(op1Type));
+
+ if (op2->IsIntegralConst(0))
+ {
+ emit->emitIns_R_F(INS_fcmp, cmpSize, op1->gtRegNum, 0.0);
+ }
+ else
+ {
+ assert(!op2->isContained());
+ emit->emitIns_R_R(INS_fcmp, cmpSize, op1->gtRegNum, op2->gtRegNum);
+ }
+ }
+ else
+ {
+ assert(!varTypeIsFloating(op2Type));
+ // We don't support swapping op1 and op2 to generate cmp reg, imm
+ assert(!op1->isContainedIntOrIImmed());
+
+ // TODO-ARM64-CQ: the second register argument of a CMP can be sign/zero
+ // extended as part of the instruction (using "CMP (extended register)").
+ // We should use that if possible, swapping operands
+ // (and reversing the condition) if necessary.
+ unsigned op1Size = genTypeSize(op1Type);
+ unsigned op2Size = genTypeSize(op2Type);
+
+ if ((op1Size < 4) || (op1Size < op2Size))
+ {
+ // We need to sign/zero extend op1 up to 32 or 64 bits.
+ instruction ins = ins_Move_Extend(op1Type, true);
+ inst_RV_RV(ins, op1->gtRegNum, op1->gtRegNum);
+ }
+
+ if (!op2->isContainedIntOrIImmed())
+ {
+ if ((op2Size < 4) || (op2Size < op1Size))
+ {
+ // We need to sign/zero extend op2 up to 32 or 64 bits.
+ instruction ins = ins_Move_Extend(op2Type, true);
+ inst_RV_RV(ins, op2->gtRegNum, op2->gtRegNum);
+ }
+ }
+ cmpSize = EA_4BYTE;
+ if ((op1Size == EA_8BYTE) || (op2Size == EA_8BYTE))
+ {
+ cmpSize = EA_8BYTE;
+ }
+
+ if (op2->isContainedIntOrIImmed())
+ {
+ GenTreeIntConCommon* intConst = op2->AsIntConCommon();
+ emit->emitIns_R_I(INS_cmp, cmpSize, op1->gtRegNum, intConst->IconValue());
+ }
+ else
+ {
+ emit->emitIns_R_R(INS_cmp, cmpSize, op1->gtRegNum, op2->gtRegNum);
+ }
+ }
+
+ // Are we evaluating this into a register?
+ if (targetReg != REG_NA)
+ {
+ genSetRegToCond(targetReg, tree);
+ genProduceReg(tree);
+ }
+}
+
int CodeGenInterface::genSPtoFPdelta()
{
int delta;
@@ -4552,6 +4280,17 @@ void CodeGen::genArm64EmitterUnitTests()
theEmitter->emitIns_R_R_I(INS_ldr, EA_8BYTE, REG_R8, REG_R9, 1, INS_OPTS_POST_INDEX);
theEmitter->emitIns_R_R_I(INS_ldr, EA_8BYTE, REG_R8, REG_R9, 1, INS_OPTS_PRE_INDEX);
+ // ldar/stlr Rt, [reg]
+ theEmitter->emitIns_R_R(INS_ldar, EA_8BYTE, REG_R9, REG_R8);
+ theEmitter->emitIns_R_R(INS_ldar, EA_4BYTE, REG_R7, REG_R10);
+ theEmitter->emitIns_R_R(INS_ldarb, EA_4BYTE, REG_R5, REG_R11);
+ theEmitter->emitIns_R_R(INS_ldarh, EA_4BYTE, REG_R5, REG_R12);
+
+ theEmitter->emitIns_R_R(INS_stlr, EA_8BYTE, REG_R9, REG_R8);
+ theEmitter->emitIns_R_R(INS_stlr, EA_4BYTE, REG_R7, REG_R13);
+ theEmitter->emitIns_R_R(INS_stlrb, EA_4BYTE, REG_R5, REG_R14);
+ theEmitter->emitIns_R_R(INS_stlrh, EA_4BYTE, REG_R3, REG_R15);
+
#endif // ALL_ARM64_EMITTER_UNIT_TESTS
#ifdef ALL_ARM64_EMITTER_UNIT_TESTS
diff --git a/src/jit/codegenarmarch.cpp b/src/jit/codegenarmarch.cpp
index c541472284..103ce47625 100644
--- a/src/jit/codegenarmarch.cpp
+++ b/src/jit/codegenarmarch.cpp
@@ -25,6 +25,382 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include "emit.h"
//------------------------------------------------------------------------
+// genCodeForTreeNode Generate code for a single node in the tree.
+//
+// Preconditions:
+// All operands have been evaluated.
+//
+void CodeGen::genCodeForTreeNode(GenTreePtr treeNode)
+{
+ regNumber targetReg = treeNode->gtRegNum;
+ var_types targetType = treeNode->TypeGet();
+ emitter* emit = getEmitter();
+
+#ifdef DEBUG
+ // Validate that all the operands for the current node are consumed in order.
+ // This is important because LSRA ensures that any necessary copies will be
+ // handled correctly.
+ lastConsumedNode = nullptr;
+ if (compiler->verbose)
+ {
+ unsigned seqNum = treeNode->gtSeqNum; // Useful for setting a conditional break in Visual Studio
+ compiler->gtDispLIRNode(treeNode, "Generating: ");
+ }
+#endif // DEBUG
+
+#ifdef _TARGET_ARM64_ // TODO-ARM: is this applicable to ARM32?
+ // Is this a node whose value is already in a register? LSRA denotes this by
+ // setting the GTF_REUSE_REG_VAL flag.
+ if (treeNode->IsReuseRegVal())
+ {
+ // For now, this is only used for constant nodes.
+ assert((treeNode->OperGet() == GT_CNS_INT) || (treeNode->OperGet() == GT_CNS_DBL));
+ JITDUMP(" TreeNode is marked ReuseReg\n");
+ return;
+ }
+#endif // _TARGET_ARM64_
+
+ // contained nodes are part of their parents for codegen purposes
+ // ex : immediates, most LEAs
+ if (treeNode->isContained())
+ {
+ return;
+ }
+
+ switch (treeNode->gtOper)
+ {
+#ifdef _TARGET_ARM64_
+
+ case GT_START_NONGC:
+ getEmitter()->emitDisableGC();
+ break;
+
+ case GT_PROF_HOOK:
+ // We should be seeing this only if profiler hook is needed
+ noway_assert(compiler->compIsProfilerHookNeeded());
+
+#ifdef PROFILING_SUPPORTED
+ // Right now this node is used only for tail calls. In future if
+ // we intend to use it for Enter or Leave hooks, add a data member
+ // to this node indicating the kind of profiler hook. For example,
+ // helper number can be used.
+ genProfilingLeaveCallback(CORINFO_HELP_PROF_FCN_TAILCALL);
+#endif // PROFILING_SUPPORTED
+ break;
+
+#endif // _TARGET_ARM64_
+
+ case GT_LCLHEAP:
+ genLclHeap(treeNode);
+ break;
+
+ case GT_CNS_INT:
+ case GT_CNS_DBL:
+ genSetRegToConst(targetReg, targetType, treeNode);
+ genProduceReg(treeNode);
+ break;
+
+ case GT_NOT:
+ case GT_NEG:
+ genCodeForNegNot(treeNode);
+ break;
+
+ case GT_MOD:
+ case GT_UMOD:
+ case GT_DIV:
+ case GT_UDIV:
+ genCodeForDivMod(treeNode->AsOp());
+ break;
+
+ case GT_OR:
+ case GT_XOR:
+ case GT_AND:
+ assert(varTypeIsIntegralOrI(treeNode));
+
+ __fallthrough;
+
+#ifdef _TARGET_ARM_
+ case GT_ADD_LO:
+ case GT_ADD_HI:
+ case GT_SUB_LO:
+ case GT_SUB_HI:
+#endif // _TARGET_ARM_
+
+ case GT_ADD:
+ case GT_SUB:
+ case GT_MUL:
+ genConsumeOperands(treeNode->AsOp());
+ genCodeForBinary(treeNode);
+ break;
+
+ case GT_LSH:
+ case GT_RSH:
+ case GT_RSZ:
+ case GT_ROR:
+ genCodeForShift(treeNode);
+ break;
+
+#ifdef _TARGET_ARM_
+
+ case GT_LSH_HI:
+ case GT_RSH_LO:
+ genCodeForShiftLong(treeNode);
+ break;
+
+#endif // _TARGET_ARM_
+
+ case GT_CAST:
+ genCodeForCast(treeNode->AsOp());
+ break;
+
+ case GT_LCL_FLD_ADDR:
+ case GT_LCL_VAR_ADDR:
+ genCodeForLclAddr(treeNode);
+ break;
+
+ case GT_LCL_FLD:
+ genCodeForLclFld(treeNode->AsLclFld());
+ break;
+
+ case GT_LCL_VAR:
+ genCodeForLclVar(treeNode->AsLclVar());
+ break;
+
+ case GT_STORE_LCL_FLD:
+ genCodeForStoreLclFld(treeNode->AsLclFld());
+ break;
+
+ case GT_STORE_LCL_VAR:
+ genCodeForStoreLclVar(treeNode->AsLclVar());
+ break;
+
+ case GT_RETFILT:
+ case GT_RETURN:
+ genReturn(treeNode);
+ break;
+
+ case GT_LEA:
+ // if we are here, it is the case where there is an LEA that cannot
+ // be folded into a parent instruction
+ genLeaInstruction(treeNode->AsAddrMode());
+ break;
+
+ case GT_IND:
+ genCodeForIndir(treeNode->AsIndir());
+ break;
+
+#ifdef _TARGET_ARM64_
+
+ case GT_MULHI:
+ genCodeForMulHi(treeNode->AsOp());
+ break;
+
+ case GT_CKFINITE:
+ genCkfinite(treeNode);
+ break;
+
+ case GT_SWAP:
+ genCodeForSwap(treeNode->AsOp());
+ break;
+
+ case GT_JMP:
+ genJmpMethod(treeNode);
+ break;
+
+#endif // _TARGET_ARM64_
+
+ case GT_INTRINSIC:
+ genIntrinsic(treeNode);
+ break;
+
+#ifdef FEATURE_SIMD
+ case GT_SIMD:
+ genSIMDIntrinsic(treeNode->AsSIMD());
+ break;
+#endif // FEATURE_SIMD
+
+ case GT_EQ:
+ case GT_NE:
+ case GT_LT:
+ case GT_LE:
+ case GT_GE:
+ case GT_GT:
+ genCodeForCompare(treeNode->AsOp());
+ break;
+
+ case GT_JTRUE:
+ genCodeForJumpTrue(treeNode);
+ break;
+
+#ifdef _TARGET_ARM_
+
+ case GT_JCC:
+ genCodeForJcc(treeNode->AsJumpCC());
+ break;
+
+#endif // _TARGET_ARM_
+
+ case GT_RETURNTRAP:
+ genCodeForReturnTrap(treeNode->AsOp());
+ break;
+
+ case GT_STOREIND:
+ genCodeForStoreInd(treeNode->AsStoreInd());
+ break;
+
+ case GT_COPY:
+ // This is handled at the time we call genConsumeReg() on the GT_COPY
+ break;
+
+ case GT_LIST:
+ case GT_FIELD_LIST:
+ case GT_ARGPLACE:
+ // Nothing to do
+ break;
+
+ case GT_PUTARG_STK:
+ genPutArgStk(treeNode->AsPutArgStk());
+ break;
+
+ case GT_PUTARG_REG:
+ genPutArgReg(treeNode->AsOp());
+ break;
+
+ case GT_CALL:
+ genCallInstruction(treeNode->AsCall());
+ break;
+
+ case GT_LOCKADD:
+ case GT_XCHG:
+ case GT_XADD:
+ genLockedInstructions(treeNode->AsOp());
+ break;
+
+ case GT_MEMORYBARRIER:
+ instGen_MemoryBarrier();
+ break;
+
+ case GT_CMPXCHG:
+ NYI("GT_CMPXCHG");
+ break;
+
+ case GT_RELOAD:
+ // do nothing - reload is just a marker.
+ // The parent node will call genConsumeReg on this which will trigger the unspill of this node's child
+ // into the register specified in this node.
+ break;
+
+ case GT_NOP:
+ break;
+
+ case GT_NO_OP:
+ if (treeNode->gtFlags & GTF_NO_OP_NO)
+ {
+ noway_assert(!"GTF_NO_OP_NO should not be set");
+ }
+ else
+ {
+ instGen(INS_nop);
+ }
+ break;
+
+ case GT_ARR_BOUNDS_CHECK:
+#ifdef FEATURE_SIMD
+ case GT_SIMD_CHK:
+#endif // FEATURE_SIMD
+ genRangeCheck(treeNode);
+ break;
+
+ case GT_PHYSREG:
+ genCodeForPhysReg(treeNode->AsPhysReg());
+ break;
+
+ case GT_PHYSREGDST:
+ break;
+
+ case GT_NULLCHECK:
+ genCodeForNullCheck(treeNode->AsOp());
+ break;
+
+ case GT_CATCH_ARG:
+
+ noway_assert(handlerGetsXcptnObj(compiler->compCurBB->bbCatchTyp));
+
+ /* Catch arguments get passed in a register. genCodeForBBlist()
+ would have marked it as holding a GC object, but not used. */
+
+ noway_assert(gcInfo.gcRegGCrefSetCur & RBM_EXCEPTION_OBJECT);
+ genConsumeReg(treeNode);
+ break;
+
+ case GT_PINVOKE_PROLOG:
+ noway_assert(((gcInfo.gcRegGCrefSetCur | gcInfo.gcRegByrefSetCur) & ~fullIntArgRegMask()) == 0);
+
+ // the runtime side requires the codegen here to be consistent
+ emit->emitDisableRandomNops();
+ break;
+
+ case GT_LABEL:
+ genPendingCallLabel = genCreateTempLabel();
+ treeNode->gtLabel.gtLabBB = genPendingCallLabel;
+#if defined(_TARGET_ARM_)
+ emit->emitIns_J_R(INS_adr, EA_PTRSIZE, genPendingCallLabel, targetReg);
+#elif defined(_TARGET_ARM64_)
+ emit->emitIns_R_L(INS_adr, EA_PTRSIZE, genPendingCallLabel, targetReg);
+#endif
+ break;
+
+ case GT_STORE_OBJ:
+ case GT_STORE_DYN_BLK:
+ case GT_STORE_BLK:
+ genCodeForStoreBlk(treeNode->AsBlk());
+ break;
+
+ case GT_JMPTABLE:
+ genJumpTable(treeNode);
+ break;
+
+ case GT_SWITCH_TABLE:
+ genTableBasedSwitch(treeNode);
+ break;
+
+ case GT_ARR_INDEX:
+ genCodeForArrIndex(treeNode->AsArrIndex());
+ break;
+
+ case GT_ARR_OFFSET:
+ genCodeForArrOffset(treeNode->AsArrOffs());
+ break;
+
+#ifdef _TARGET_ARM_
+
+ case GT_CLS_VAR_ADDR:
+ emit->emitIns_R_C(INS_lea, EA_PTRSIZE, targetReg, treeNode->gtClsVar.gtClsVarHnd, 0);
+ genProduceReg(treeNode);
+ break;
+
+#endif // _TARGET_ARM_
+
+ case GT_IL_OFFSET:
+ // Do nothing; these nodes are simply markers for debug info.
+ break;
+
+ default:
+ {
+#ifdef DEBUG
+ char message[256];
+ _snprintf_s(message, _countof(message), _TRUNCATE, "NYI: Unimplemented node type %s",
+ GenTree::NodeName(treeNode->OperGet()));
+ NYIRAW(message);
+#else
+ NYI("unimplemented node");
+#endif
+ }
+ break;
+ }
+}
+
+//------------------------------------------------------------------------
// genSetRegToIcon: Generate code that will set the given register to the integer constant.
//
void CodeGen::genSetRegToIcon(regNumber reg, ssize_t val, var_types type, insFlags flags)
@@ -51,6 +427,8 @@ void CodeGen::genSetRegToIcon(regNumber reg, ssize_t val, var_types type, insFla
//
void CodeGen::genIntrinsic(GenTreePtr treeNode)
{
+ assert(treeNode->OperIs(GT_INTRINSIC));
+
// Both operand and its result must be of the same floating point type.
GenTreePtr srcNode = treeNode->gtOp.gtOp1;
assert(varTypeIsFloating(srcNode));
@@ -95,7 +473,7 @@ void CodeGen::genIntrinsic(GenTreePtr treeNode)
//
void CodeGen::genPutArgStk(GenTreePutArgStk* treeNode)
{
- assert(treeNode->OperGet() == GT_PUTARG_STK);
+ assert(treeNode->OperIs(GT_PUTARG_STK));
var_types targetType = treeNode->TypeGet();
GenTreePtr source = treeNode->gtOp1;
emitter* emit = getEmitter();
@@ -284,6 +662,14 @@ void CodeGen::genPutArgStk(GenTreePutArgStk* treeNode)
genConsumeAddress(addrNode);
addrReg = addrNode->gtRegNum;
+ // If addrReg equal to loReg, swap(loReg, hiReg)
+ // This reduces code complexity by only supporting one addrReg overwrite case
+ if (loReg == addrReg)
+ {
+ loReg = hiReg;
+ hiReg = addrReg;
+ }
+
CORINFO_CLASS_HANDLE objClass = source->gtObj.gtClass;
structSize = compiler->info.compCompHnd->getClassSize(objClass);
@@ -291,8 +677,6 @@ void CodeGen::genPutArgStk(GenTreePutArgStk* treeNode)
gcPtrCount = compiler->info.compCompHnd->getClassGClayout(objClass, &gcPtrs[0]);
}
- bool hasGCpointers = (gcPtrCount > 0); // true if there are any GC pointers in the struct
-
// If we have an HFA we can't have any GC pointers,
// if not then the max size for the the struct is 16 bytes
if (isHfa)
@@ -306,28 +690,9 @@ void CodeGen::genPutArgStk(GenTreePutArgStk* treeNode)
noway_assert(structSize <= MAX_PASS_MULTIREG_BYTES);
- // For a 16-byte structSize with GC pointers we will use two ldr and two str instructions
- // ldr x2, [x0]
- // ldr x3, [x0, #8]
- // str x2, [sp, #16]
- // str x3, [sp, #24]
- //
- // For a 16-byte structSize with no GC pointers we will use a ldp and two str instructions
+ // For a >= 16-byte structSize we will generate a ldp and stp instruction each loop
// ldp x2, x3, [x0]
- // str x2, [sp, #16]
- // str x3, [sp, #24]
- //
- // For a 32-byte structSize with no GC pointers we will use two ldp and four str instructions
- // ldp x2, x3, [x0]
- // str x2, [sp, #16]
- // str x3, [sp, #24]
- // ldp x2, x3, [x0]
- // str x2, [sp, #32]
- // str x3, [sp, #40]
- //
- // Note that when loading from a varNode we currently can't use the ldp instruction
- // TODO-ARM64-CQ: Implement support for using a ldp instruction with a varNum (see emitIns_R_S)
- //
+ // stp x2, x3, [sp, #16]
int remainingSize = structSize;
unsigned structOffset = 0;
@@ -338,63 +703,26 @@ void CodeGen::genPutArgStk(GenTreePutArgStk* treeNode)
var_types type0 = compiler->getJitGCType(gcPtrs[nextIndex + 0]);
var_types type1 = compiler->getJitGCType(gcPtrs[nextIndex + 1]);
- if (hasGCpointers)
+ if (varNode != nullptr)
{
- // We have GC pointers, so use two ldr instructions
- //
- // We must do it this way because we can't currently pass or track
- // two different emitAttr values for a ldp instruction.
-
- // Make sure that the first load instruction does not overwrite the addrReg.
- //
- if (loReg != addrReg)
- {
- if (varNode != nullptr)
- {
- // Load from our varNumImp source
- emit->emitIns_R_S(ins_Load(type0), emitTypeSize(type0), loReg, varNumInp, 0);
- emit->emitIns_R_S(ins_Load(type1), emitTypeSize(type1), hiReg, varNumInp,
- TARGET_POINTER_SIZE);
- }
- else
- {
- // Load from our address expression source
- emit->emitIns_R_R_I(ins_Load(type0), emitTypeSize(type0), loReg, addrReg, structOffset);
- emit->emitIns_R_R_I(ins_Load(type1), emitTypeSize(type1), hiReg, addrReg,
- structOffset + TARGET_POINTER_SIZE);
- }
- }
- else // loReg == addrReg
- {
- assert(varNode == nullptr); // because addrReg is REG_NA when varNode is non-null
- assert(hiReg != addrReg);
- // Load from our address expression source
- emit->emitIns_R_R_I(ins_Load(type1), emitTypeSize(type1), hiReg, addrReg,
- structOffset + TARGET_POINTER_SIZE);
- emit->emitIns_R_R_I(ins_Load(type0), emitTypeSize(type0), loReg, addrReg, structOffset);
- }
+ // Load from our varNumImp source
+ emit->emitIns_R_R_S_S(INS_ldp, emitTypeSize(type0), emitTypeSize(type1), loReg, hiReg, varNumInp,
+ 0);
}
- else // our struct has no GC pointers
+ else
{
- if (varNode != nullptr)
- {
- // Load from our varNumImp source, currently we can't use a ldp instruction to do this
- emit->emitIns_R_S(ins_Load(type0), emitTypeSize(type0), loReg, varNumInp, 0);
- emit->emitIns_R_S(ins_Load(type1), emitTypeSize(type1), hiReg, varNumInp, TARGET_POINTER_SIZE);
- }
- else
- {
- // Use a ldp instruction
+ // check for case of destroying the addrRegister while we still need it
+ assert(loReg != addrReg);
+ noway_assert((remainingSize == 2 * TARGET_POINTER_SIZE) || (hiReg != addrReg));
- // Load from our address expression source
- emit->emitIns_R_R_R_I(INS_ldp, EA_PTRSIZE, loReg, hiReg, addrReg, structOffset);
- }
+ // Load from our address expression source
+ emit->emitIns_R_R_R_I(INS_ldp, emitTypeSize(type0), loReg, hiReg, addrReg, structOffset,
+ INS_OPTS_NONE, emitTypeSize(type0));
}
- // Emit two store instructions to store the two registers into the outgoing argument area
- emit->emitIns_S_R(ins_Store(type0), emitTypeSize(type0), loReg, varNumOut, argOffsetOut);
- emit->emitIns_S_R(ins_Store(type1), emitTypeSize(type1), hiReg, varNumOut,
- argOffsetOut + TARGET_POINTER_SIZE);
+ // Emit stp instruction to store the two registers into the outgoing argument area
+ emit->emitIns_S_S_R_R(INS_stp, emitTypeSize(type0), emitTypeSize(type1), loReg, hiReg, varNumOut,
+ argOffsetOut);
argOffsetOut += (2 * TARGET_POINTER_SIZE); // We stored 16-bytes of the struct
assert(argOffsetOut <= argOffsetMax); // We can't write beyound the outgoing area area
@@ -408,23 +736,9 @@ void CodeGen::genPutArgStk(GenTreePutArgStk* treeNode)
// ldr w3, [x0, #8]
// str x2, [sp, #16]
// str w3, [sp, #24]
- //
- // When the first instruction has a loReg that is the same register as the addrReg,
- // we set deferLoad to true and issue the intructions in the reverse order
- // ldr x3, [x2, #8]
- // ldr x2, [x2]
- // str x2, [sp, #16]
- // str x3, [sp, #24]
- //
var_types nextType = compiler->getJitGCType(gcPtrs[nextIndex]);
emitAttr nextAttr = emitTypeSize(nextType);
- regNumber curReg = loReg;
-
- bool deferLoad = false;
- var_types deferType = TYP_UNKNOWN;
- emitAttr deferAttr = EA_PTRSIZE;
- int deferOffset = 0;
while (remainingSize > 0)
{
@@ -432,31 +746,23 @@ void CodeGen::genPutArgStk(GenTreePutArgStk* treeNode)
{
remainingSize -= TARGET_POINTER_SIZE;
- if ((curReg == addrReg) && (remainingSize != 0))
+ if (varNode != nullptr)
{
- deferLoad = true;
- deferType = nextType;
- deferAttr = emitTypeSize(nextType);
- deferOffset = structOffset;
+ // Load from our varNumImp source
+ emit->emitIns_R_S(ins_Load(nextType), nextAttr, loReg, varNumInp, structOffset);
}
- else // the typical case
+ else
{
- if (varNode != nullptr)
- {
- // Load from our varNumImp source
- emit->emitIns_R_S(ins_Load(nextType), nextAttr, curReg, varNumInp, structOffset);
- }
- else
- {
- // Load from our address expression source
- emit->emitIns_R_R_I(ins_Load(nextType), nextAttr, curReg, addrReg, structOffset);
- }
- // Emit a store instruction to store the register into the outgoing argument area
- emit->emitIns_S_R(ins_Store(nextType), nextAttr, curReg, varNumOut, argOffsetOut);
- argOffsetOut += EA_SIZE_IN_BYTES(nextAttr);
- assert(argOffsetOut <= argOffsetMax); // We can't write beyound the outgoing area area
+ assert(loReg != addrReg);
+
+ // Load from our address expression source
+ emit->emitIns_R_R_I(ins_Load(nextType), nextAttr, loReg, addrReg, structOffset);
}
- curReg = hiReg;
+ // Emit a store instruction to store the register into the outgoing argument area
+ emit->emitIns_S_R(ins_Store(nextType), nextAttr, loReg, varNumOut, argOffsetOut);
+ argOffsetOut += EA_SIZE_IN_BYTES(nextAttr);
+ assert(argOffsetOut <= argOffsetMax); // We can't write beyound the outgoing area area
+
structOffset += TARGET_POINTER_SIZE;
nextIndex++;
nextType = compiler->getJitGCType(gcPtrs[nextIndex]);
@@ -491,39 +797,52 @@ void CodeGen::genPutArgStk(GenTreePutArgStk* treeNode)
instruction loadIns = ins_Load(loadType);
emitAttr loadAttr = emitAttr(loadSize);
- // When deferLoad is false, curReg can be the same as addrReg
- // because the last instruction is allowed to overwrite addrReg.
- //
- noway_assert(!deferLoad || (curReg != addrReg));
+ assert(loReg != addrReg);
- emit->emitIns_R_R_I(loadIns, loadAttr, curReg, addrReg, structOffset);
+ emit->emitIns_R_R_I(loadIns, loadAttr, loReg, addrReg, structOffset);
// Emit a store instruction to store the register into the outgoing argument area
- emit->emitIns_S_R(ins_Store(loadType), loadAttr, curReg, varNumOut, argOffsetOut);
+ emit->emitIns_S_R(ins_Store(loadType), loadAttr, loReg, varNumOut, argOffsetOut);
argOffsetOut += EA_SIZE_IN_BYTES(loadAttr);
assert(argOffsetOut <= argOffsetMax); // We can't write beyound the outgoing area area
}
}
- if (deferLoad)
- {
- // We should never have to do a deferred load when we have a LclVar source
- assert(varNode == nullptr);
+#endif // _TARGET_ARM64_
+ }
+ }
+}
+
+//---------------------------------------------------------------------
+// genPutArgReg - generate code for a GT_PUTARG_REG node
+//
+// Arguments
+// tree - the GT_PUTARG_REG node
+//
+// Return value:
+// None
+//
+void CodeGen::genPutArgReg(GenTreeOp* tree)
+{
+ assert(tree->OperIs(GT_PUTARG_REG));
+ var_types targetType = tree->TypeGet();
+ regNumber targetReg = tree->gtRegNum;
- curReg = addrReg;
+ // Any TYP_STRUCT register args should have been removed by fgMorphMultiregStructArg
+ assert(targetType != TYP_STRUCT);
- // Load from our address expression source
- emit->emitIns_R_R_I(ins_Load(deferType), deferAttr, curReg, addrReg, deferOffset);
+ // We have a normal non-Struct targetType
- // Emit a store instruction to store the register into the outgoing argument area
- emit->emitIns_S_R(ins_Store(nextType), nextAttr, curReg, varNumOut, argOffsetOut);
- argOffsetOut += EA_SIZE_IN_BYTES(nextAttr);
- assert(argOffsetOut <= argOffsetMax); // We can't write beyound the outgoing area area
- }
+ GenTree* op1 = tree->gtOp1;
+ genConsumeReg(op1);
-#endif // _TARGET_ARM64_
- }
+ // If child node is not already in the register we need, move it
+ if (targetReg != op1->gtRegNum)
+ {
+ inst_RV_RV(ins_Copy(targetType), targetReg, op1->gtRegNum, targetType);
}
+
+ genProduceReg(tree);
}
//----------------------------------------------------------------------------------
@@ -646,6 +965,54 @@ void CodeGen::genRangeCheck(GenTreePtr oper)
genJumpToThrowHlpBlk(jmpKind, SCK_RNGCHK_FAIL, bndsChk->gtIndRngFailBB);
}
+//---------------------------------------------------------------------
+// genCodeForPhysReg - generate code for a GT_PHYSREG node
+//
+// Arguments
+// tree - the GT_PHYSREG node
+//
+// Return value:
+// None
+//
+void CodeGen::genCodeForPhysReg(GenTreePhysReg* tree)
+{
+ assert(tree->OperIs(GT_PHYSREG));
+ var_types targetType = tree->TypeGet();
+ regNumber targetReg = tree->gtRegNum;
+
+ if (targetReg != tree->gtSrcReg)
+ {
+ inst_RV_RV(ins_Copy(targetType), targetReg, tree->gtSrcReg, targetType);
+ genTransferRegGCState(targetReg, tree->gtSrcReg);
+ }
+
+ genProduceReg(tree);
+}
+
+//---------------------------------------------------------------------
+// genCodeForNullCheck - generate code for a GT_NULLCHECK node
+//
+// Arguments
+// tree - the GT_NULLCHECK node
+//
+// Return value:
+// None
+//
+void CodeGen::genCodeForNullCheck(GenTreeOp* tree)
+{
+ assert(tree->OperIs(GT_NULLCHECK));
+ assert(!tree->gtOp1->isContained());
+ regNumber addrReg = genConsumeReg(tree->gtOp1);
+
+#ifdef _TARGET_ARM64_
+ regNumber targetReg = REG_ZR;
+#else
+ regNumber targetReg = tree->gtRegNum;
+#endif
+
+ getEmitter()->emitIns_R_R_I(INS_ldr, EA_4BYTE, targetReg, addrReg, 0);
+}
+
//------------------------------------------------------------------------
// genOffsetOfMDArrayLowerBound: Returns the offset from the Array object to the
// lower bound for the given dimension.
@@ -853,6 +1220,137 @@ void CodeGen::genCodeForShift(GenTreePtr tree)
genProduceReg(tree);
}
+//------------------------------------------------------------------------
+// genCodeForCast: Generates the code for GT_CAST.
+//
+// Arguments:
+// tree - the GT_CAST node.
+//
+void CodeGen::genCodeForCast(GenTreeOp* tree)
+{
+ assert(tree->OperIs(GT_CAST));
+
+ var_types targetType = tree->TypeGet();
+ regNumber targetReg = tree->gtRegNum;
+
+ // Cast is never contained (?)
+ noway_assert(targetReg != REG_NA);
+
+ if (varTypeIsFloating(targetType) && varTypeIsFloating(tree->gtOp1))
+ {
+ // Casts float/double <--> double/float
+ genFloatToFloatCast(tree);
+ }
+ else if (varTypeIsFloating(tree->gtOp1))
+ {
+ // Casts float/double --> int32/int64
+ genFloatToIntCast(tree);
+ }
+ else if (varTypeIsFloating(targetType))
+ {
+ // Casts int32/uint32/int64/uint64 --> float/double
+ genIntToFloatCast(tree);
+ }
+ else
+ {
+ // Casts int <--> int
+ genIntToIntCast(tree);
+ }
+ // The per-case functions call genProduceReg()
+}
+
+//------------------------------------------------------------------------
+// genCodeForLclAddr: Generates the code for GT_LCL_FLD_ADDR/GT_LCL_VAR_ADDR.
+//
+// Arguments:
+// tree - the node.
+//
+void CodeGen::genCodeForLclAddr(GenTree* tree)
+{
+ assert(tree->OperIs(GT_LCL_FLD_ADDR, GT_LCL_VAR_ADDR));
+
+ var_types targetType = tree->TypeGet();
+ regNumber targetReg = tree->gtRegNum;
+
+ // Address of a local var. This by itself should never be allocated a register.
+ // If it is worth storing the address in a register then it should be cse'ed into
+ // a temp and that would be allocated a register.
+ noway_assert(targetType == TYP_BYREF);
+ noway_assert(!tree->InReg());
+
+ inst_RV_TT(INS_lea, targetReg, tree, 0, EA_BYREF);
+ genProduceReg(tree);
+}
+
+//------------------------------------------------------------------------
+// genCodeForLclFld: Produce code for a GT_LCL_FLD node.
+//
+// Arguments:
+// tree - the GT_LCL_FLD node
+//
+void CodeGen::genCodeForLclFld(GenTreeLclFld* tree)
+{
+ assert(tree->OperIs(GT_LCL_FLD));
+
+ var_types targetType = tree->TypeGet();
+ regNumber targetReg = tree->gtRegNum;
+ emitter* emit = getEmitter();
+
+ NYI_IF(targetType == TYP_STRUCT, "GT_LCL_FLD: struct load local field not supported");
+ NYI_IF(targetReg == REG_NA, "GT_LCL_FLD: load local field not into a register is not supported");
+
+ emitAttr size = emitTypeSize(targetType);
+ unsigned offs = tree->gtLclOffs;
+ unsigned varNum = tree->gtLclNum;
+ assert(varNum < compiler->lvaCount);
+
+ if (varTypeIsFloating(targetType))
+ {
+ if (tree->InReg())
+ {
+ NYI("GT_LCL_FLD with register to register Floating point move");
+ }
+ else
+ {
+ emit->emitIns_R_S(ins_Load(targetType), size, targetReg, varNum, offs);
+ }
+ }
+ else
+ {
+#ifdef _TARGET_ARM64_
+ size = EA_SET_SIZE(size, EA_8BYTE);
+#endif // _TARGET_ARM64_
+ emit->emitIns_R_S(ins_Move_Extend(targetType, tree->InReg()), size, targetReg, varNum, offs);
+ }
+
+ genProduceReg(tree);
+}
+
+//------------------------------------------------------------------------
+// genCodeForIndir: Produce code for a GT_IND node.
+//
+// Arguments:
+// tree - the GT_IND node
+//
+void CodeGen::genCodeForIndir(GenTreeIndir* tree)
+{
+ assert(tree->OperIs(GT_IND));
+
+ var_types targetType = tree->TypeGet();
+ regNumber targetReg = tree->gtRegNum;
+ emitter* emit = getEmitter();
+
+ genConsumeAddress(tree->Addr());
+ emit->emitInsLoadStoreOp(ins_Load(targetType), emitTypeSize(tree), targetReg, tree);
+ genProduceReg(tree);
+
+ if (tree->gtFlags & GTF_IND_VOLATILE)
+ {
+ // issue a full memory barrier after a volatile LdInd operation
+ instGen_MemoryBarrier();
+ }
+}
+
// Generate code for a CpBlk node by the means of the VM memcpy helper call
// Preconditions:
// a) The size argument of the CpBlk is not an integer constant
@@ -873,7 +1371,19 @@ void CodeGen::genCodeForCpBlk(GenTreeBlk* cpBlkNode)
}
#endif // _TARGET_ARM64_
+ if (cpBlkNode->gtFlags & GTF_BLK_VOLATILE)
+ {
+ // issue a full memory barrier before & after a volatile CpBlkUnroll operation
+ instGen_MemoryBarrier();
+ }
+
genEmitHelperCall(CORINFO_HELP_MEMCPY, 0, EA_UNKNOWN);
+
+ if (cpBlkNode->gtFlags & GTF_BLK_VOLATILE)
+ {
+ // issue a full memory barrier before & after a volatile CpBlkUnroll operation
+ instGen_MemoryBarrier();
+ }
}
// Generates code for InitBlk by calling the VM memset helper function.
@@ -910,6 +1420,13 @@ void CodeGen::genCodeForInitBlk(GenTreeBlk* initBlkNode)
#endif // _TARGET_ARM64_
genConsumeBlockOp(initBlkNode, REG_ARG_0, REG_ARG_1, REG_ARG_2);
+
+ if (initBlkNode->gtFlags & GTF_BLK_VOLATILE)
+ {
+ // issue a full memory barrier before a volatile initBlock Operation
+ instGen_MemoryBarrier();
+ }
+
genEmitHelperCall(CORINFO_HELP_MEMSET, 0, EA_UNKNOWN);
}
@@ -1830,6 +2347,63 @@ void CodeGen::genCodeForJumpTrue(GenTreePtr tree)
}
}
+//------------------------------------------------------------------------
+// genCodeForStoreBlk: Produce code for a GT_STORE_OBJ/GT_STORE_DYN_BLK/GT_STORE_BLK node.
+//
+// Arguments:
+// tree - the node
+//
+void CodeGen::genCodeForStoreBlk(GenTreeBlk* blkOp)
+{
+ assert(blkOp->OperIs(GT_STORE_OBJ, GT_STORE_DYN_BLK, GT_STORE_BLK));
+
+ if (blkOp->OperIs(GT_STORE_OBJ) && blkOp->OperIsCopyBlkOp())
+ {
+ assert(blkOp->AsObj()->gtGcPtrCount != 0);
+ genCodeForCpObj(blkOp->AsObj());
+ return;
+ }
+
+ if (blkOp->gtBlkOpGcUnsafe)
+ {
+ getEmitter()->emitDisableGC();
+ }
+ bool isCopyBlk = blkOp->OperIsCopyBlkOp();
+
+ switch (blkOp->gtBlkOpKind)
+ {
+ case GenTreeBlk::BlkOpKindHelper:
+ if (isCopyBlk)
+ {
+ genCodeForCpBlk(blkOp);
+ }
+ else
+ {
+ genCodeForInitBlk(blkOp);
+ }
+ break;
+
+ case GenTreeBlk::BlkOpKindUnroll:
+ if (isCopyBlk)
+ {
+ genCodeForCpBlkUnroll(blkOp);
+ }
+ else
+ {
+ genCodeForInitBlkUnroll(blkOp);
+ }
+ break;
+
+ default:
+ unreached();
+ }
+
+ if (blkOp->gtBlkOpGcUnsafe)
+ {
+ getEmitter()->emitEnableGC();
+ }
+}
+
#endif // _TARGET_ARMARCH_
#endif // !LEGACY_BACKEND
diff --git a/src/jit/codegencommon.cpp b/src/jit/codegencommon.cpp
index 64561de567..94cc9b9712 100644
--- a/src/jit/codegencommon.cpp
+++ b/src/jit/codegencommon.cpp
@@ -631,6 +631,8 @@ regMaskTP Compiler::compHelperCallKillSet(CorInfoHelpFunc helper)
return RBM_WRITE_BARRIER_SRC_BYREF | RBM_WRITE_BARRIER_DST_BYREF | RBM_CALLEE_TRASH_NOGC;
#elif defined(_TARGET_X86_)
return RBM_ESI | RBM_EDI | RBM_ECX;
+#elif defined(_TARGET_ARM_)
+ return RBM_ARG_1 | RBM_ARG_0 | RBM_CALLEE_TRASH_NOGC;
#else
NYI("Model kill set for CORINFO_HELP_ASSIGN_BYREF on target arch");
return RBM_CALLEE_TRASH;
@@ -7444,7 +7446,17 @@ void CodeGen::genProfilingEnterCallback(regNumber initReg, bool* pInitRegZeroed)
var_types storeType = varDsc->lvaArgType();
regNumber argReg = varDsc->lvArgReg;
- getEmitter()->emitIns_S_R(ins_Store(storeType), emitTypeSize(storeType), argReg, varNum, 0);
+
+ instruction store_ins = ins_Store(storeType);
+
+#ifdef FEATURE_SIMD
+ if ((storeType == TYP_SIMD8) && genIsValidIntReg(argReg))
+ {
+ store_ins = INS_mov;
+ }
+#endif // FEATURE_SIMD
+
+ getEmitter()->emitIns_S_R(store_ins, emitTypeSize(storeType), argReg, varNum, 0);
}
}
@@ -7507,7 +7519,17 @@ void CodeGen::genProfilingEnterCallback(regNumber initReg, bool* pInitRegZeroed)
var_types loadType = varDsc->lvaArgType();
regNumber argReg = varDsc->lvArgReg;
- getEmitter()->emitIns_R_S(ins_Load(loadType), emitTypeSize(loadType), argReg, varNum, 0);
+
+ instruction load_ins = ins_Load(loadType);
+
+#ifdef FEATURE_SIMD
+ if ((loadType == TYP_SIMD8) && genIsValidIntReg(argReg))
+ {
+ load_ins = INS_mov;
+ }
+#endif // FEATURE_SIMD
+
+ getEmitter()->emitIns_R_S(load_ins, emitTypeSize(loadType), argReg, varNum, 0);
#if FEATURE_VARARG
if (compiler->info.compIsVarArgs && varTypeIsFloating(loadType))
diff --git a/src/jit/codegenlinear.cpp b/src/jit/codegenlinear.cpp
index c8fcd88c10..afc7db3c46 100644
--- a/src/jit/codegenlinear.cpp
+++ b/src/jit/codegenlinear.cpp
@@ -1087,7 +1087,11 @@ void CodeGen::genCheckConsumeNode(GenTree* const node)
if (verbose)
{
- if ((node->gtDebugFlags & GTF_DEBUG_NODE_CG_CONSUMED) != 0)
+ if (node->gtUseNum == -1)
+ {
+ // nothing wrong if the node was not consumed
+ }
+ else if ((node->gtDebugFlags & GTF_DEBUG_NODE_CG_CONSUMED) != 0)
{
printf("Node was consumed twice:\n");
compiler->gtDispTree(node, nullptr, nullptr, true);
@@ -1224,7 +1228,7 @@ void CodeGen::genConsumeRegs(GenTree* tree)
genConsumeAddress(tree->AsIndir()->Addr());
}
#ifdef _TARGET_XARCH_
- else if (tree->OperGet() == GT_LCL_VAR)
+ else if (tree->OperIsLocalRead())
{
// A contained lcl var must be living on stack and marked as reg optional, or not be a
// register candidate.
diff --git a/src/jit/codegenlinear.h b/src/jit/codegenlinear.h
index 715e87a944..3bd0eacf0d 100644
--- a/src/jit/codegenlinear.h
+++ b/src/jit/codegenlinear.h
@@ -11,9 +11,7 @@
#ifndef LEGACY_BACKEND // Not necessary (it's this way in the #include location), but helpful to IntelliSense
void genSetRegToConst(regNumber targetReg, var_types targetType, GenTreePtr tree);
-
void genCodeForTreeNode(GenTreePtr treeNode);
-
void genCodeForBinary(GenTreePtr treeNode);
#if defined(_TARGET_X86_)
@@ -21,11 +19,8 @@ void genCodeForLongUMod(GenTreeOp* node);
#endif // _TARGET_X86_
void genCodeForDivMod(GenTreeOp* treeNode);
-
void genCodeForMulHi(GenTreeOp* treeNode);
-
void genLeaInstruction(GenTreeAddrMode* lea);
-
void genSetRegToCond(regNumber dstReg, GenTreePtr tree);
#if !defined(_TARGET_64BIT_)
@@ -33,26 +28,24 @@ void genLongToIntCast(GenTreePtr treeNode);
#endif
void genIntToIntCast(GenTreePtr treeNode);
-
void genFloatToFloatCast(GenTreePtr treeNode);
-
void genFloatToIntCast(GenTreePtr treeNode);
-
void genIntToFloatCast(GenTreePtr treeNode);
-
void genCkfinite(GenTreePtr treeNode);
-
+void genCodeForCompare(GenTreeOp* tree);
void genIntrinsic(GenTreePtr treeNode);
-
void genPutArgStk(GenTreePutArgStk* treeNode);
+void genPutArgReg(GenTreeOp* tree);
+
+#if defined(_TARGET_XARCH_)
unsigned getBaseVarForPutArgStk(GenTreePtr treeNode);
+#endif // _TARGET_XARCH_
#if defined(_TARGET_XARCH_) || defined(_TARGET_ARM64_)
unsigned getFirstArgWithStackSlot();
#endif // _TARGET_XARCH_ || _TARGET_ARM64_
void genCompareFloat(GenTreePtr treeNode);
-
void genCompareInt(GenTreePtr treeNode);
#if !defined(_TARGET_64BIT_)
@@ -87,7 +80,6 @@ void genSIMDIntrinsicGetItem(GenTreeSIMD* simdNode);
void genSIMDIntrinsicShuffleSSE2(GenTreeSIMD* simdNode);
void genSIMDIntrinsicUpperSave(GenTreeSIMD* simdNode);
void genSIMDIntrinsicUpperRestore(GenTreeSIMD* simdNode);
-
void genSIMDIntrinsic(GenTreeSIMD* simdNode);
void genSIMDCheck(GenTree* treeNode);
@@ -115,11 +107,8 @@ void genStoreLongLclVar(GenTree* treeNode);
#endif // !defined(_TARGET_64BIT_)
void genProduceReg(GenTree* tree);
-
void genUnspillRegIfNeeded(GenTree* tree);
-
regNumber genConsumeReg(GenTree* tree);
-
void genCopyRegIfNeeded(GenTree* tree, regNumber needReg);
void genConsumeRegAndCopy(GenTree* tree, regNumber needReg);
@@ -132,13 +121,9 @@ void genConsumeIfReg(GenTreePtr tree)
}
void genRegCopy(GenTreePtr tree);
-
void genTransferRegGCState(regNumber dst, regNumber src);
-
void genConsumeAddress(GenTree* addr);
-
void genConsumeAddrMode(GenTreeAddrMode* mode);
-
void genSetBlockSize(GenTreeBlk* blkNode, regNumber sizeReg);
void genConsumeBlockSrc(GenTreeBlk* blkNode);
void genSetBlockSrc(GenTreeBlk* blkNode, regNumber srcReg);
@@ -149,13 +134,9 @@ void genConsumePutStructArgStk(GenTreePutArgStk* putArgStkNode, regNumber dstReg
#endif // FEATURE_PUT_STRUCT_ARG_STK
void genConsumeRegs(GenTree* tree);
-
void genConsumeOperands(GenTreeOp* tree);
-
void genEmitGSCookieCheck(bool pushReg);
-
void genSetRegToIcon(regNumber reg, ssize_t val, var_types type = TYP_INT, insFlags flags = INS_FLAGS_DONT_CARE);
-
void genCodeForShift(GenTreePtr tree);
#if defined(_TARGET_X86_) || defined(_TARGET_ARM_)
@@ -166,13 +147,24 @@ void genCodeForShiftLong(GenTreePtr tree);
void genCodeForShiftRMW(GenTreeStoreInd* storeInd);
#endif // _TARGET_XARCH_
+void genCodeForCast(GenTreeOp* tree);
+void genCodeForLclAddr(GenTree* tree);
+void genCodeForIndir(GenTreeIndir* tree);
+void genCodeForNegNot(GenTree* tree);
+void genCodeForLclVar(GenTreeLclVar* tree);
+void genCodeForLclFld(GenTreeLclFld* tree);
+void genCodeForStoreLclFld(GenTreeLclFld* tree);
+void genCodeForStoreLclVar(GenTreeLclVar* tree);
+void genCodeForReturnTrap(GenTreeOp* tree);
+void genCodeForJcc(GenTreeJumpCC* tree);
+void genCodeForStoreInd(GenTreeStoreInd* tree);
+void genCodeForSwap(GenTreeOp* tree);
void genCodeForCpObj(GenTreeObj* cpObjNode);
-
void genCodeForCpBlk(GenTreeBlk* cpBlkNode);
-
void genCodeForCpBlkRepMovs(GenTreeBlk* cpBlkNode);
-
void genCodeForCpBlkUnroll(GenTreeBlk* cpBlkNode);
+void genCodeForPhysReg(GenTreePhysReg* tree);
+void genCodeForNullCheck(GenTreeOp* tree);
void genAlignStackBeforeCall(GenTreePutArgStk* putArgStk);
void genAlignStackBeforeCall(GenTreeCall* call);
@@ -231,43 +223,27 @@ void genStoreRegToStackArg(var_types type, regNumber reg, int offset);
#endif // FEATURE_PUT_STRUCT_ARG_STK
void genCodeForLoadOffset(instruction ins, emitAttr size, regNumber dst, GenTree* base, unsigned offset);
-
void genCodeForStoreOffset(instruction ins, emitAttr size, regNumber src, GenTree* base, unsigned offset);
#ifdef _TARGET_ARM64_
void genCodeForLoadPairOffset(regNumber dst, regNumber dst2, GenTree* base, unsigned offset);
-
void genCodeForStorePairOffset(regNumber src, regNumber src2, GenTree* base, unsigned offset);
#endif // _TARGET_ARM64_
void genCodeForStoreBlk(GenTreeBlk* storeBlkNode);
-
void genCodeForInitBlk(GenTreeBlk* initBlkNode);
-
void genCodeForInitBlkRepStos(GenTreeBlk* initBlkNode);
-
void genCodeForInitBlkUnroll(GenTreeBlk* initBlkNode);
-
void genJumpTable(GenTree* tree);
-
void genTableBasedSwitch(GenTree* tree);
-
void genCodeForArrIndex(GenTreeArrIndex* treeNode);
-
void genCodeForArrOffset(GenTreeArrOffs* treeNode);
-
instruction genGetInsForOper(genTreeOps oper, var_types type);
-
void genStoreInd(GenTreePtr node);
-
bool genEmitOptimizedGCWriteBarrier(GCInfo::WriteBarrierForm writeBarrierForm, GenTree* addr, GenTree* data);
-
void genCallInstruction(GenTreeCall* call);
-
void genJmpMethod(GenTreePtr jmp);
-
BasicBlock* genCallFinally(BasicBlock* block);
-
void genCodeForJumpTrue(GenTreePtr tree);
#if FEATURE_EH_FUNCLETS
@@ -282,7 +258,6 @@ void genMultiRegCallStoreToLocal(GenTreePtr treeNode);
bool isStructReturn(GenTreePtr treeNode);
void genStructReturn(GenTreePtr treeNode);
-// Codegen for GT_RETURN.
void genReturn(GenTreePtr treeNode);
void genLclHeap(GenTreePtr tree);
diff --git a/src/jit/codegenxarch.cpp b/src/jit/codegenxarch.cpp
index d693ff914a..252f004853 100644
--- a/src/jit/codegenxarch.cpp
+++ b/src/jit/codegenxarch.cpp
@@ -1558,6 +1558,8 @@ void CodeGen::genCodeForTreeNode(GenTreePtr treeNode)
GenTreePtr op1 = treeNode->gtGetOp1();
genConsumeRegs(op1);
emit->emitInsBinary(ins_Store(targetType), emitTypeSize(treeNode), treeNode, op1);
+
+ genUpdateLife(treeNode);
}
break;
@@ -5404,8 +5406,9 @@ void CodeGen::genJmpMethod(GenTreePtr jmp)
// assert should hold.
assert(varDsc->lvRegNum != REG_STK);
- var_types loadType = varDsc->lvaArgType();
- getEmitter()->emitIns_S_R(ins_Store(loadType), emitTypeSize(loadType), varDsc->lvRegNum, varNum, 0);
+ assert(!varDsc->lvIsStructField || (compiler->lvaTable[varDsc->lvParentLcl].lvFieldCnt == 1));
+ var_types storeType = genActualType(varDsc->lvaArgType()); // We own the memory and can use the full move.
+ getEmitter()->emitIns_S_R(ins_Store(storeType), emitTypeSize(storeType), varDsc->lvRegNum, varNum, 0);
// Update lvRegNum life and GC info to indicate lvRegNum is dead and varDsc stack slot is going live.
// Note that we cannot modify varDsc->lvRegNum here because another basic block may not be expecting it.
diff --git a/src/jit/compiler.h b/src/jit/compiler.h
index 998b647702..5bff8ddc1f 100644
--- a/src/jit/compiler.h
+++ b/src/jit/compiler.h
@@ -3187,7 +3187,7 @@ private:
static fgWalkPreFn impFindValueClasses;
void impSpillLclRefs(ssize_t lclNum);
- BasicBlock* impPushCatchArgOnStack(BasicBlock* hndBlk, CORINFO_CLASS_HANDLE clsHnd);
+ BasicBlock* impPushCatchArgOnStack(BasicBlock* hndBlk, CORINFO_CLASS_HANDLE clsHnd, bool isSingleBlockFilter);
void impImportBlockCode(BasicBlock* block);
@@ -4719,7 +4719,7 @@ private:
const SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structDescPtr));
void fgFixupStructReturn(GenTreePtr call);
- GenTreePtr fgMorphLocalVar(GenTreePtr tree);
+ GenTreePtr fgMorphLocalVar(GenTreePtr tree, bool forceRemorph);
bool fgAddrCouldBeNull(GenTreePtr addr);
GenTreePtr fgMorphField(GenTreePtr tree, MorphAddrContext* mac);
bool fgCanFastTailCall(GenTreeCall* call);
@@ -5005,7 +5005,8 @@ protected:
unsigned lnum,
LoopHoistContext* hoistCtxt,
bool* firstBlockAndBeforeSideEffect,
- bool* pHoistable);
+ bool* pHoistable,
+ bool* pCctorDependent);
// Performs the hoisting 'tree' into the PreHeader for loop 'lnum'
void optHoistCandidate(GenTreePtr tree, unsigned lnum, LoopHoistContext* hoistCtxt);
diff --git a/src/jit/copyprop.cpp b/src/jit/copyprop.cpp
index bf714f0963..b17956d3f2 100644
--- a/src/jit/copyprop.cpp
+++ b/src/jit/copyprop.cpp
@@ -296,7 +296,7 @@ void Compiler::optBlockCopyProp(BasicBlock* block, LclNumToGenTreePtrStack* curS
VarSetOps::Assign(this, compCurLife, block->bbLiveIn);
for (GenTreePtr stmt = block->bbTreeList; stmt; stmt = stmt->gtNext)
{
- VarSetOps::ClearD(this, optCopyPropKillSet);
+ VarSetOps::OldStyleClearD(this, optCopyPropKillSet);
// Walk the tree to find if any local variable can be replaced with current live definitions.
for (GenTreePtr tree = stmt->gtStmt.gtStmtList; tree; tree = tree->gtNext)
diff --git a/src/jit/decomposelongs.cpp b/src/jit/decomposelongs.cpp
index d284c1cb47..4168e77c1c 100644
--- a/src/jit/decomposelongs.cpp
+++ b/src/jit/decomposelongs.cpp
@@ -922,11 +922,15 @@ GenTree* DecomposeLongs::DecomposeNeg(LIR::Use& use)
loResult->gtType = TYP_INT;
loResult->gtOp.gtOp1 = loOp1;
- GenTree* zero = m_compiler->gtNewZeroConNode(TYP_INT);
+ GenTree* zero = m_compiler->gtNewZeroConNode(TYP_INT);
+#if defined(_TARGET_X86_)
GenTree* hiAdjust = m_compiler->gtNewOperNode(GT_ADD_HI, TYP_INT, hiOp1, zero);
GenTree* hiResult = m_compiler->gtNewOperNode(GT_NEG, TYP_INT, hiAdjust);
-
Range().InsertAfter(loResult, zero, hiAdjust, hiResult);
+#elif defined(_TARGET_ARM_)
+ GenTree* hiResult = m_compiler->gtNewOperNode(GT_SUB_HI, TYP_INT, zero, hiOp1);
+ Range().InsertAfter(loResult, zero, hiResult);
+#endif
return FinalizeDecomposition(use, loResult, hiResult, hiResult);
}
diff --git a/src/jit/ee_il_dll.cpp b/src/jit/ee_il_dll.cpp
index c0384f3858..33896080b8 100644
--- a/src/jit/ee_il_dll.cpp
+++ b/src/jit/ee_il_dll.cpp
@@ -1295,7 +1295,7 @@ const char* Compiler::eeGetMethodName(CORINFO_METHOD_HANDLE method, const char**
// If it's something unknown from a RET VM, or from SuperPMI, then use our own helper name table.
if ((strcmp(name, "AnyJITHelper") == 0) || (strcmp(name, "Yickish helper name") == 0))
{
- if (ftnNum < CORINFO_HELP_COUNT)
+ if ((unsigned)ftnNum < CORINFO_HELP_COUNT)
{
name = jitHlpFuncTable[ftnNum];
}
diff --git a/src/jit/emit.cpp b/src/jit/emit.cpp
index 3b765b9db2..d2aa29fd7a 100644
--- a/src/jit/emit.cpp
+++ b/src/jit/emit.cpp
@@ -1472,8 +1472,8 @@ void emitter::emitBegProlog()
/* Nothing is live on entry to the prolog */
// These were initialized to Empty at the start of compilation.
- VarSetOps::ClearD(emitComp, emitInitGCrefVars);
- VarSetOps::ClearD(emitComp, emitPrevGCrefVars);
+ VarSetOps::OldStyleClearD(emitComp, emitInitGCrefVars);
+ VarSetOps::OldStyleClearD(emitComp, emitPrevGCrefVars);
emitInitGCrefRegs = RBM_NONE;
emitPrevGCrefRegs = RBM_NONE;
emitInitByrefRegs = RBM_NONE;
@@ -4564,7 +4564,7 @@ unsigned emitter::emitEndCodeGen(Compiler* comp,
/* Assume no live GC ref variables on entry */
- VarSetOps::ClearD(emitComp, emitThisGCrefVars); // This is initialized to Empty at the start of codegen.
+ VarSetOps::OldStyleClearD(emitComp, emitThisGCrefVars); // This is initialized to Empty at the start of codegen.
emitThisGCrefRegs = emitThisByrefRegs = RBM_NONE;
emitThisGCrefVset = true;
diff --git a/src/jit/emit.h b/src/jit/emit.h
index e1c924f467..5ec8a6af06 100644
--- a/src/jit/emit.h
+++ b/src/jit/emit.h
@@ -718,7 +718,7 @@ protected:
#define ID_EXTRA_BITFIELD_BITS (16)
#elif defined(_TARGET_ARM64_)
-// For Arm64, we have used 15 bits from the second DWORD.
+// For Arm64, we have used 16 bits from the second DWORD.
#define ID_EXTRA_BITFIELD_BITS (16)
#elif defined(_TARGET_XARCH_) && !defined(LEGACY_BACKEND)
// For xarch !LEGACY_BACKEND, we have used 14 bits from the second DWORD.
@@ -882,14 +882,16 @@ protected:
void checkSizes();
union idAddrUnion {
- // TODO-Cleanup: We should really add a DEBUG-only tag to this union so we can add asserts
- // about reading what we think is here, to avoid unexpected corruption issues.
+// TODO-Cleanup: We should really add a DEBUG-only tag to this union so we can add asserts
+// about reading what we think is here, to avoid unexpected corruption issues.
+#ifndef _TARGET_ARM64_
emitLclVarAddr iiaLclVar;
- BasicBlock* iiaBBlabel;
- insGroup* iiaIGlabel;
- BYTE* iiaAddr;
- emitAddrMode iiaAddrMode;
+#endif
+ BasicBlock* iiaBBlabel;
+ insGroup* iiaIGlabel;
+ BYTE* iiaAddr;
+ emitAddrMode iiaAddrMode;
CORINFO_FIELD_HANDLE iiaFieldHnd; // iiaFieldHandle is also used to encode
// an offset into the JIT data constant area
@@ -920,11 +922,14 @@ protected:
struct
{
- regNumber _idReg3 : REGNUM_BITS;
- regNumber _idReg4 : REGNUM_BITS;
#ifdef _TARGET_ARM64_
- unsigned _idReg3Scaled : 1; // Reg3 is scaled by idOpSize bits
+ // For 64-bit architecture this 32-bit structure can pack with these unsigned bit fields
+ emitLclVarAddr iiaLclVar;
+ unsigned _idReg3Scaled : 1; // Reg3 is scaled by idOpSize bits
+ GCtype _idGCref2 : 2;
#endif
+ regNumber _idReg3 : REGNUM_BITS;
+ regNumber _idReg4 : REGNUM_BITS;
};
#elif defined(_TARGET_XARCH_) && !defined(LEGACY_BACKEND)
struct
@@ -1072,6 +1077,21 @@ protected:
assert(reg == _idReg1);
}
+#ifdef _TARGET_ARM64_
+ GCtype idGCrefReg2() const
+ {
+ assert(!idIsTiny());
+ assert(!idIsSmallDsc());
+ return (GCtype)idAddr()->_idGCref2;
+ }
+ void idGCrefReg2(GCtype gctype)
+ {
+ assert(!idIsTiny());
+ assert(!idIsSmallDsc());
+ idAddr()->_idGCref2 = gctype;
+ }
+#endif // _TARGET_ARM64_
+
regNumber idReg2() const
{
return _idReg2;
@@ -2006,6 +2026,9 @@ public:
// Returns true if the instruction may write to more than one register.
bool emitInsMayWriteMultipleRegs(instrDesc* id);
+
+ // Returns "true" if instruction "id->idIns()" writes to a LclVar stack slot pair.
+ bool emitInsWritesToLclVarStackLocPair(instrDesc* id);
#endif // _TARGET_ARMARCH_
/************************************************************************/
diff --git a/src/jit/emitarm64.cpp b/src/jit/emitarm64.cpp
index 0328cb6712..4097b662f0 100644
--- a/src/jit/emitarm64.cpp
+++ b/src/jit/emitarm64.cpp
@@ -883,6 +883,26 @@ bool emitter::emitInsWritesToLclVarStackLoc(instrDesc* id)
}
}
+bool emitter::emitInsWritesToLclVarStackLocPair(instrDesc* id)
+{
+ if (!id->idIsLclVar())
+ return false;
+
+ instruction ins = id->idIns();
+
+ // This list is related to the list of instructions used to store local vars in emitIns_S_S_R_R().
+ // We don't accept writing to float local vars.
+
+ switch (ins)
+ {
+ case INS_stnp:
+ case INS_stp:
+ return true;
+ default:
+ return false;
+ }
+}
+
bool emitter::emitInsMayWriteMultipleRegs(instrDesc* id)
{
instruction ins = id->idIns();
@@ -3858,6 +3878,26 @@ void emitter::emitIns_R_R(
fmt = IF_DV_2M;
break;
+ case INS_ldar:
+ case INS_stlr:
+ assert(isValidGeneralDatasize(size));
+
+ __fallthrough;
+
+ case INS_ldarb:
+ case INS_ldarh:
+ case INS_stlrb:
+ case INS_stlrh:
+ assert(isValidGeneralLSDatasize(size));
+ assert(isGeneralRegisterOrZR(reg1));
+ assert(isGeneralRegisterOrSP(reg2));
+ assert(insOptsNone(opt));
+
+ reg2 = encodingSPtoZR(reg2);
+
+ fmt = IF_LS_2A;
+ break;
+
case INS_ldr:
case INS_ldrb:
case INS_ldrh:
@@ -5072,7 +5112,8 @@ void emitter::emitIns_R_R_R_I(instruction ins,
regNumber reg2,
regNumber reg3,
ssize_t imm,
- insOpts opt /* = INS_OPTS_NONE */)
+ insOpts opt /* = INS_OPTS_NONE */,
+ emitAttr attrReg2 /* = EA_UNKNOWN */)
{
emitAttr size = EA_SIZE(attr);
emitAttr elemsize = EA_UNKNOWN;
@@ -5347,6 +5388,22 @@ void emitter::emitIns_R_R_R_I(instruction ins,
id->idReg2(reg2);
id->idReg3(reg3);
+ // Record the attribute for the second register in the pair
+ id->idGCrefReg2(GCT_NONE);
+ if (attrReg2 != EA_UNKNOWN)
+ {
+ // Record the attribute for the second register in the pair
+ assert((fmt == IF_LS_3B) || (fmt == IF_LS_3C));
+ if (EA_IS_GCREF(attrReg2))
+ {
+ id->idGCrefReg2(GCT_GCREF);
+ }
+ else if (EA_IS_BYREF(attrReg2))
+ {
+ id->idGCrefReg2(GCT_BYREF);
+ }
+ }
+
dispIns(id);
appendToCurIG(id);
}
@@ -6072,6 +6129,102 @@ void emitter::emitIns_R_S(instruction ins, emitAttr attr, regNumber reg1, int va
/*****************************************************************************
*
+ * Add an instruction referencing two register and consectutive stack-based local variable slots.
+ */
+void emitter::emitIns_R_R_S_S(
+ instruction ins, emitAttr attr1, emitAttr attr2, regNumber reg1, regNumber reg2, int varx, int offs)
+{
+ assert((ins == INS_ldp) || (ins == INS_ldnp));
+ assert(EA_8BYTE == EA_SIZE(attr1));
+ assert(EA_8BYTE == EA_SIZE(attr2));
+ assert(isGeneralRegisterOrZR(reg1));
+ assert(isGeneralRegisterOrZR(reg2));
+ assert(offs >= 0);
+
+ emitAttr size = EA_SIZE(attr1);
+ insFormat fmt = IF_LS_3B;
+ int disp = 0;
+ const unsigned scale = 3;
+
+ /* Figure out the variable's frame position */
+ int base;
+ bool FPbased;
+
+ base = emitComp->lvaFrameAddress(varx, &FPbased);
+ disp = base + offs;
+
+ // TODO-ARM64-CQ: with compLocallocUsed, should we use REG_SAVED_LOCALLOC_SP instead?
+ regNumber reg3 = FPbased ? REG_FPBASE : REG_SPBASE;
+ reg3 = encodingSPtoZR(reg3);
+
+ bool useRegForAdr = true;
+ ssize_t imm = disp;
+ ssize_t mask = (1 << scale) - 1; // the mask of low bits that must be zero to encode the immediate
+ if (imm == 0)
+ {
+ useRegForAdr = false;
+ }
+ else
+ {
+ if ((imm & mask) == 0)
+ {
+ ssize_t immShift = imm >> scale; // The immediate is scaled by the size of the ld/st
+
+ if ((immShift >= -64) && (immShift <= 63))
+ {
+ fmt = IF_LS_3C;
+ useRegForAdr = false;
+ imm = immShift;
+ }
+ }
+ }
+
+ if (useRegForAdr)
+ {
+ regNumber rsvd = codeGen->rsGetRsvdReg();
+ emitIns_R_R_Imm(INS_add, EA_8BYTE, rsvd, reg3, imm);
+ reg3 = rsvd;
+ imm = 0;
+ }
+
+ assert(fmt != IF_NONE);
+
+ instrDesc* id = emitNewInstrCns(attr1, imm);
+
+ id->idIns(ins);
+ id->idInsFmt(fmt);
+ id->idInsOpt(INS_OPTS_NONE);
+
+ // Record the attribute for the second register in the pair
+ if (EA_IS_GCREF(attr2))
+ {
+ id->idGCrefReg2(GCT_GCREF);
+ }
+ else if (EA_IS_BYREF(attr2))
+ {
+ id->idGCrefReg2(GCT_BYREF);
+ }
+ else
+ {
+ id->idGCrefReg2(GCT_NONE);
+ }
+
+ id->idReg1(reg1);
+ id->idReg2(reg2);
+ id->idReg3(reg3);
+ id->idAddr()->iiaLclVar.initLclVarAddr(varx, offs);
+ id->idSetIsLclVar();
+
+#ifdef DEBUG
+ id->idDebugOnlyInfo()->idVarRefOffs = emitVarRefOffs;
+#endif
+
+ dispIns(id);
+ appendToCurIG(id);
+}
+
+/*****************************************************************************
+ *
* Add an instruction referencing a stack-based local variable and a register
*/
void emitter::emitIns_S_R(instruction ins, emitAttr attr, regNumber reg1, int varx, int offs)
@@ -6202,6 +6355,102 @@ void emitter::emitIns_S_R(instruction ins, emitAttr attr, regNumber reg1, int va
/*****************************************************************************
*
+ * Add an instruction referencing consecutive stack-based local variable slots and two registers
+ */
+void emitter::emitIns_S_S_R_R(
+ instruction ins, emitAttr attr1, emitAttr attr2, regNumber reg1, regNumber reg2, int varx, int offs)
+{
+ assert((ins == INS_stp) || (ins == INS_stnp));
+ assert(EA_8BYTE == EA_SIZE(attr1));
+ assert(EA_8BYTE == EA_SIZE(attr2));
+ assert(isGeneralRegisterOrZR(reg1));
+ assert(isGeneralRegisterOrZR(reg2));
+ assert(offs >= 0);
+
+ emitAttr size = EA_SIZE(attr1);
+ insFormat fmt = IF_LS_3B;
+ int disp = 0;
+ const unsigned scale = 3;
+
+ /* Figure out the variable's frame position */
+ int base;
+ bool FPbased;
+
+ base = emitComp->lvaFrameAddress(varx, &FPbased);
+ disp = base + offs;
+
+ // TODO-ARM64-CQ: with compLocallocUsed, should we use REG_SAVED_LOCALLOC_SP instead?
+ regNumber reg3 = FPbased ? REG_FPBASE : REG_SPBASE;
+ reg3 = encodingSPtoZR(reg3);
+
+ bool useRegForAdr = true;
+ ssize_t imm = disp;
+ ssize_t mask = (1 << scale) - 1; // the mask of low bits that must be zero to encode the immediate
+ if (imm == 0)
+ {
+ useRegForAdr = false;
+ }
+ else
+ {
+ if ((imm & mask) == 0)
+ {
+ ssize_t immShift = imm >> scale; // The immediate is scaled by the size of the ld/st
+
+ if ((immShift >= -64) && (immShift <= 63))
+ {
+ fmt = IF_LS_3C;
+ useRegForAdr = false;
+ imm = immShift;
+ }
+ }
+ }
+
+ if (useRegForAdr)
+ {
+ regNumber rsvd = codeGen->rsGetRsvdReg();
+ emitIns_R_R_Imm(INS_add, EA_8BYTE, rsvd, reg3, imm);
+ reg3 = rsvd;
+ imm = 0;
+ }
+
+ assert(fmt != IF_NONE);
+
+ instrDesc* id = emitNewInstrCns(attr1, imm);
+
+ id->idIns(ins);
+ id->idInsFmt(fmt);
+ id->idInsOpt(INS_OPTS_NONE);
+
+ // Record the attribute for the second register in the pair
+ if (EA_IS_GCREF(attr2))
+ {
+ id->idGCrefReg2(GCT_GCREF);
+ }
+ else if (EA_IS_BYREF(attr2))
+ {
+ id->idGCrefReg2(GCT_BYREF);
+ }
+ else
+ {
+ id->idGCrefReg2(GCT_NONE);
+ }
+
+ id->idReg1(reg1);
+ id->idReg2(reg2);
+ id->idReg3(reg3);
+ id->idAddr()->iiaLclVar.initLclVarAddr(varx, offs);
+ id->idSetIsLclVar();
+
+#ifdef DEBUG
+ id->idDebugOnlyInfo()->idVarRefOffs = emitVarRefOffs;
+#endif
+
+ dispIns(id);
+ appendToCurIG(id);
+}
+
+/*****************************************************************************
+ *
* Add an instruction referencing stack-based local variable and an immediate
*/
void emitter::emitIns_S_I(instruction ins, emitAttr attr, int varx, int offs, int val)
@@ -9324,33 +9573,34 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp)
// for stores, but we ignore those cases here.)
if (emitInsMayWriteToGCReg(id)) // True if "id->idIns()" writes to a register than can hold GC ref.
{
- // If we ever generate instructions that write to multiple registers,
- // then we'd need to more work here to ensure that changes in the status of GC refs are
- // tracked properly.
- if (emitInsMayWriteMultipleRegs(id))
+ // We assume that "idReg1" is the primary destination register for all instructions
+ if (id->idGCref() != GCT_NONE)
{
- // INS_ldp etc...
- // We assume that "idReg1" and "idReg2" are the destination register for all instructions
- emitGCregDeadUpd(id->idReg1(), dst);
- emitGCregDeadUpd(id->idReg2(), dst);
+ emitGCregLiveUpd(id->idGCref(), id->idReg1(), dst);
}
else
{
- // We assume that "idReg1" is the destination register for all instructions
- if (id->idGCref() != GCT_NONE)
+ emitGCregDeadUpd(id->idReg1(), dst);
+ }
+
+ if (emitInsMayWriteMultipleRegs(id))
+ {
+ // INS_ldp etc...
+ // "idReg2" is the secondary destination register
+ if (id->idGCrefReg2() != GCT_NONE)
{
- emitGCregLiveUpd(id->idGCref(), id->idReg1(), dst);
+ emitGCregLiveUpd(id->idGCrefReg2(), id->idReg2(), dst);
}
else
{
- emitGCregDeadUpd(id->idReg1(), dst);
+ emitGCregDeadUpd(id->idReg2(), dst);
}
}
}
// Now we determine if the instruction has written to a (local variable) stack location, and either written a GC
// ref or overwritten one.
- if (emitInsWritesToLclVarStackLoc(id))
+ if (emitInsWritesToLclVarStackLoc(id) || emitInsWritesToLclVarStackLocPair(id))
{
int varNum = id->idAddr()->iiaLclVar.lvaVarNum();
unsigned ofs = AlignDown(id->idAddr()->iiaLclVar.lvaOffset(), sizeof(size_t));
@@ -9377,6 +9627,31 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp)
if (vt == TYP_REF || vt == TYP_BYREF)
emitGCvarDeadUpd(adr + ofs, dst);
}
+ if (emitInsWritesToLclVarStackLocPair(id))
+ {
+ unsigned ofs2 = ofs + sizeof(size_t);
+ if (id->idGCrefReg2() != GCT_NONE)
+ {
+ emitGCvarLiveUpd(adr + ofs2, varNum, id->idGCrefReg2(), dst);
+ }
+ else
+ {
+ // If the type of the local is a gc ref type, update the liveness.
+ var_types vt;
+ if (varNum >= 0)
+ {
+ // "Regular" (non-spill-temp) local.
+ vt = var_types(emitComp->lvaTable[varNum].lvType);
+ }
+ else
+ {
+ TempDsc* tmpDsc = emitComp->tmpFindNum(varNum);
+ vt = tmpDsc->tdTempType();
+ }
+ if (vt == TYP_REF || vt == TYP_BYREF)
+ emitGCvarDeadUpd(adr + ofs2, dst);
+ }
+ }
}
#ifdef DEBUG
diff --git a/src/jit/emitarm64.h b/src/jit/emitarm64.h
index 6a8e42b86f..09158fb796 100644
--- a/src/jit/emitarm64.h
+++ b/src/jit/emitarm64.h
@@ -724,7 +724,8 @@ void emitIns_R_R_R_I(instruction ins,
regNumber reg2,
regNumber reg3,
ssize_t imm,
- insOpts opt = INS_OPTS_NONE);
+ insOpts opt = INS_OPTS_NONE,
+ emitAttr attrReg2 = EA_UNKNOWN);
void emitIns_R_R_R_Ext(instruction ins,
emitAttr attr,
@@ -757,8 +758,14 @@ void emitIns_S(instruction ins, emitAttr attr, int varx, int offs);
void emitIns_S_R(instruction ins, emitAttr attr, regNumber ireg, int varx, int offs);
+void emitIns_S_S_R_R(
+ instruction ins, emitAttr attr, emitAttr attr2, regNumber ireg, regNumber ireg2, int varx, int offs);
+
void emitIns_R_S(instruction ins, emitAttr attr, regNumber ireg, int varx, int offs);
+void emitIns_R_R_S_S(
+ instruction ins, emitAttr attr, emitAttr attr2, regNumber ireg, regNumber ireg2, int varx, int offs);
+
void emitIns_S_I(instruction ins, emitAttr attr, int varx, int offs, int val);
void emitIns_R_C(
diff --git a/src/jit/emitxarch.cpp b/src/jit/emitxarch.cpp
index 760813004c..86140696c6 100644
--- a/src/jit/emitxarch.cpp
+++ b/src/jit/emitxarch.cpp
@@ -4821,6 +4821,12 @@ void emitter::emitIns_S_R(instruction ins, emitAttr attr, regNumber ireg, int va
UNATIVE_OFFSET sz = emitInsSizeSV(insCodeMR(ins), varx, offs);
insFormat fmt = emitInsModeFormat(ins, IF_SRD_RRD);
+#ifdef _TARGET_X86_
+ if (attr == EA_1BYTE)
+ {
+ assert(isByteReg(ireg));
+ }
+#endif
// 16-bit operand instructions will need a prefix
if (EA_SIZE(attr) == EA_2BYTE)
{
diff --git a/src/jit/flowgraph.cpp b/src/jit/flowgraph.cpp
index 0c57862768..f11d55622d 100644
--- a/src/jit/flowgraph.cpp
+++ b/src/jit/flowgraph.cpp
@@ -1815,9 +1815,9 @@ void Compiler::fgComputeReachabilitySets()
for (block = fgFirstBB; block != nullptr; block = block->bbNext)
{
- // Initialize the per-block bbReach sets. (Note that we can't just call BlockSetOps::ClearD()
- // when re-running this computation, because if the epoch changes, the size and representation of the
- // sets might change).
+ // Initialize the per-block bbReach sets. It creates a new empty set,
+ // because the block epoch could change since the previous initialization
+ // and the old set could have wrong size.
block->bbReach = BlockSetOps::MakeEmpty(this);
/* Mark block as reaching itself */
@@ -4335,7 +4335,7 @@ void Compiler::fgFindJumpTargets(const BYTE* codeAddr, IL_OFFSET codeSize, BYTE*
DECODE_OPCODE:
- if (opcode >= CEE_COUNT)
+ if ((unsigned)opcode >= CEE_COUNT)
{
BADCODE3("Illegal opcode", ": %02X", (int)opcode);
}
@@ -5231,7 +5231,7 @@ unsigned Compiler::fgMakeBasicBlocks(const BYTE* codeAddr, IL_OFFSET codeSize, B
/* Get the size of additional parameters */
- noway_assert(opcode < CEE_COUNT);
+ noway_assert((unsigned)opcode < CEE_COUNT);
sz = opcodeSizes[opcode];
@@ -10011,7 +10011,7 @@ void Compiler::fgCompactBlocks(BasicBlock* block, BasicBlock* bNext)
if (fgDomsComputed && block->bbNum > fgDomBBcount)
{
BlockSetOps::Assign(this, block->bbReach, bNext->bbReach);
- BlockSetOps::ClearD(this, bNext->bbReach);
+ BlockSetOps::OldStyleClearD(this, bNext->bbReach);
block->bbIDom = bNext->bbIDom;
bNext->bbIDom = nullptr;
@@ -17055,8 +17055,8 @@ bool Compiler::fgCheckEHCanInsertAfterBlock(BasicBlock* blk, unsigned regionInde
//
// Return Value:
// A block with the desired characteristics, so the new block will be inserted after this one.
-// If there is no suitable location, return nullptr. This should basically never happen except in the case of
-// single-block filters.
+// If there is no suitable location, return nullptr. This should basically never happen.
+//
BasicBlock* Compiler::fgFindInsertPoint(unsigned regionIndex,
bool putInTryRegion,
BasicBlock* startBlk,
@@ -17284,19 +17284,21 @@ BasicBlock* Compiler::fgFindInsertPoint(unsigned regionIndex,
DONE:
+#if defined(JIT32_GCENCODER)
// If we are inserting into a filter and the best block is the end of the filter region, we need to
- // insert after its predecessor instead: the CLR ABI states that the terminal block of a filter region
- // is its exit block. If the filter region consists of a single block, a new block cannot be inserted
- // without either splitting the single block before inserting a new block or inserting the new block
- // before the single block and updating the filter description such that the inserted block is marked
- // as the entry block for the filter. This work must be done by the caller; this function returns
- // `nullptr` to indicate this case.
- if (insertingIntoFilter && (bestBlk == endBlk->bbPrev) && (bestBlk == startBlk))
+ // insert after its predecessor instead: the JIT32 GC encoding used by the x86 CLR ABI states that the
+ // terminal block of a filter region is its exit block. If the filter region consists of a single block,
+ // a new block cannot be inserted without either splitting the single block before inserting a new block
+ // or inserting the new block before the single block and updating the filter description such that the
+ // inserted block is marked as the entry block for the filter. Becuase this sort of split can be complex
+ // (especially given that it must ensure that the liveness of the exception object is properly tracked),
+ // we avoid this situation by never generating single-block filters on x86 (see impPushCatchArgOnStack).
+ if (insertingIntoFilter && (bestBlk == endBlk->bbPrev))
{
- assert(bestBlk != nullptr);
- assert(bestBlk->bbJumpKind == BBJ_EHFILTERRET);
- bestBlk = nullptr;
+ assert(bestBlk != startBlk);
+ bestBlk = bestBlk->bbPrev;
}
+#endif // defined(JIT32_GCENCODER)
return bestBlk;
}
@@ -17475,21 +17477,6 @@ BasicBlock* Compiler::fgNewBBinRegion(BBjumpKinds jumpKind,
// Now find the insertion point.
afterBlk = fgFindInsertPoint(regionIndex, putInTryRegion, startBlk, endBlk, nearBlk, nullptr, runRarely);
- // If afterBlk is nullptr, we must be inserting into a single-block filter region. Because the CLR ABI requires
- // that control exits a filter via the last instruction in the filter range, this situation requires logically
- // splitting the single block. In practice, we simply insert a new block at the beginning of the filter region
- // that transfers control flow to the existing single block.
- if (afterBlk == nullptr)
- {
- assert(putInFilter);
-
- BasicBlock* newFilterEntryBlock = fgNewBBbefore(BBJ_ALWAYS, startBlk, true);
- newFilterEntryBlock->bbJumpDest = startBlk;
- fgAddRefPred(startBlk, newFilterEntryBlock);
-
- afterBlk = newFilterEntryBlock;
- }
-
_FoundAfterBlk:;
/* We have decided to insert the block after 'afterBlk'. */
@@ -17788,10 +17775,12 @@ BasicBlock* Compiler::fgAddCodeRef(BasicBlock* srcBlk, unsigned refData, Special
#if defined(UNIX_X86_ABI)
codeGen->setFrameRequired(true);
+ codeGen->setFramePointerRequiredGCInfo(true);
#else // !defined(UNIX_X86_ABI)
if (add->acdStkLvl != stkDepth)
{
codeGen->setFrameRequired(true);
+ codeGen->setFramePointerRequiredGCInfo(true);
}
#endif // !defined(UNIX_X86_ABI)
#endif // _TARGET_X86_
diff --git a/src/jit/gentree.cpp b/src/jit/gentree.cpp
index a2156d035e..25e9e102e7 100644
--- a/src/jit/gentree.cpp
+++ b/src/jit/gentree.cpp
@@ -5249,6 +5249,13 @@ unsigned Compiler::gtSetEvalOrder(GenTree* tree)
// so if possible it was set above.
tryToSwap = false;
}
+ else if ((oper == GT_INTRINSIC) &&
+ Compiler::IsIntrinsicImplementedByUserCall(tree->AsIntrinsic()->gtIntrinsicId))
+ {
+ // We do not swap operand execution order for intrinsics that are implemented by user calls
+ // because of trickiness around ensuring the execution order does not change during rationalization.
+ tryToSwap = false;
+ }
else
{
if (tree->gtFlags & GTF_REVERSE_OPS)
@@ -11162,7 +11169,7 @@ void Compiler::gtDispLeaf(GenTree* tree, IndentStack* indentStack)
}
else
{
- printf("%d", jitGetILoffs(tree->gtStmt.gtStmtILoffsx));
+ printf("0x%x", jitGetILoffs(tree->gtStmt.gtStmtILoffsx));
}
break;
@@ -17083,4 +17090,4 @@ regNumber GenTree::ExtractTempReg(regMaskTP mask /* = (regMaskTP)-1 */)
return genRegNumFromMask(tempRegMask);
}
-#endif // !LEGACY_BACKEND \ No newline at end of file
+#endif // !LEGACY_BACKEND
diff --git a/src/jit/gentree.h b/src/jit/gentree.h
index d3a03ee1b7..1833a3904b 100644
--- a/src/jit/gentree.h
+++ b/src/jit/gentree.h
@@ -926,6 +926,7 @@ public:
#define GTF_FLD_NULLCHECK 0x80000000 // GT_FIELD -- need to nullcheck the "this" pointer
#define GTF_FLD_VOLATILE 0x40000000 // GT_FIELD/GT_CLS_VAR -- same as GTF_IND_VOLATILE
+#define GTF_FLD_INITCLASS 0x20000000 // GT_FIELD/GT_CLS_VAR -- field access requires preceding class/static init helper
#define GTF_INX_RNGCHK 0x80000000 // GT_INDEX -- the array reference should be range-checked.
#define GTF_INX_REFARR_LAYOUT 0x20000000 // GT_INDEX -- same as GTF_IND_REFARR_LAYOUT
@@ -955,8 +956,10 @@ public:
(GTF_IND_VOLATILE | GTF_IND_REFARR_LAYOUT | GTF_IND_TGTANYWHERE | GTF_IND_NONFAULTING | GTF_IND_TLS_REF | \
GTF_IND_UNALIGNED | GTF_IND_INVARIANT | GTF_IND_ARR_INDEX)
-#define GTF_CLS_VAR_ASG_LHS 0x04000000 // GT_CLS_VAR -- this GT_CLS_VAR node is (the effective val) of the LHS
- // of an assignment; don't evaluate it independently.
+#define GTF_CLS_VAR_ASG_LHS 0x04000000 // GT_CLS_VAR -- this GT_CLS_VAR node is (the effective val) of the LHS
+ // of an assignment; don't evaluate it independently.
+#define GTF_CLS_VAR_VOLATILE 0x40000000 // GT_FIELD/GT_CLS_VAR -- same as GTF_IND_VOLATILE
+#define GTF_CLS_VAR_INITCLASS 0x20000000 // GT_FIELD/GT_CLS_VAR -- same as GTF_FLD_INITCLASS
#define GTF_ADDR_ONSTACK 0x80000000 // GT_ADDR -- this expression is guaranteed to be on the stack
@@ -1004,6 +1007,14 @@ public:
#define GTF_ICON_SIMD_COUNT 0x04000000 // GT_CNS_INT -- constant is Vector<T>.Count
+#define GTF_ICON_INITCLASS 0x02000000 // GT_CNS_INT -- Constant is used to access a static that requires preceding
+ // class/static init helper. In some cases, the constant is
+ // the address of the static field itself, and in other cases
+ // there's an extra layer of indirection and it is the address
+ // of the cell that the runtime will fill in with the address
+ // of the static field; in both of those cases, the constant
+ // is what gets flagged.
+
#define GTF_BLK_VOLATILE 0x40000000 // GT_ASG, GT_STORE_BLK, GT_STORE_OBJ, GT_STORE_DYNBLK
// -- is a volatile block operation
#define GTF_BLK_UNALIGNED 0x02000000 // GT_ASG, GT_STORE_BLK, GT_STORE_OBJ, GT_STORE_DYNBLK
diff --git a/src/jit/importer.cpp b/src/jit/importer.cpp
index a991598258..74018c48d4 100644
--- a/src/jit/importer.cpp
+++ b/src/jit/importer.cpp
@@ -2402,7 +2402,7 @@ void Compiler::impSpillLclRefs(ssize_t lclNum)
* Returns the basic block of the actual handler.
*/
-BasicBlock* Compiler::impPushCatchArgOnStack(BasicBlock* hndBlk, CORINFO_CLASS_HANDLE clsHnd)
+BasicBlock* Compiler::impPushCatchArgOnStack(BasicBlock* hndBlk, CORINFO_CLASS_HANDLE clsHnd, bool isSingleBlockFilter)
{
// Do not inject the basic block twice on reimport. This should be
// hit only under JIT stress. See if the block is the one we injected.
@@ -2440,8 +2440,14 @@ BasicBlock* Compiler::impPushCatchArgOnStack(BasicBlock* hndBlk, CORINFO_CLASS_H
* moved around since it is tied to a fixed location (EAX) */
arg->gtFlags |= GTF_ORDER_SIDEEFF;
+#if defined(JIT32_GCENCODER)
+ const bool forceInsertNewBlock = isSingleBlockFilter || compStressCompile(STRESS_CATCH_ARG, 5);
+#else
+ const bool forceInsertNewBlock = compStressCompile(STRESS_CATCH_ARG, 5);
+#endif // defined(JIT32_GCENCODER)
+
/* Spill GT_CATCH_ARG to a temp if there are jumps to the beginning of the handler */
- if (hndBlk->bbRefs > 1 || compStressCompile(STRESS_CATCH_ARG, 5))
+ if (hndBlk->bbRefs > 1 || forceInsertNewBlock)
{
if (hndBlk->bbRefs == 1)
{
@@ -3520,6 +3526,10 @@ GenTreePtr Compiler::impIntrinsic(GenTreePtr newobjThis,
gtNewIconNode(offsetof(CORINFO_String, stringLen), TYP_I_IMPL));
op1 = gtNewOperNode(GT_IND, TYP_INT, op1);
}
+
+ // Getting the length of a null string should throw
+ op1->gtFlags |= GTF_EXCEPT;
+
retNode = op1;
break;
@@ -6047,6 +6057,11 @@ GenTreePtr Compiler::impImportStaticFieldAccess(CORINFO_RESOLVED_TOKEN* pResolve
// In future, it may be better to just create the right tree here instead of folding it later.
op1 = gtNewFieldRef(lclTyp, pResolvedToken->hField);
+ if (pFieldInfo->fieldFlags & CORINFO_FLG_FIELD_INITCLASS)
+ {
+ op1->gtFlags |= GTF_FLD_INITCLASS;
+ }
+
if (pFieldInfo->fieldFlags & CORINFO_FLG_FIELD_STATIC_IN_HEAP)
{
op1->gtType = TYP_REF; // points at boxed object
@@ -6078,14 +6093,16 @@ GenTreePtr Compiler::impImportStaticFieldAccess(CORINFO_RESOLVED_TOKEN* pResolve
FieldSeqNode* fldSeq = GetFieldSeqStore()->CreateSingleton(pResolvedToken->hField);
/* Create the data member node */
- if (pFldAddr == nullptr)
+ op1 = gtNewIconHandleNode(pFldAddr == nullptr ? (size_t)fldAddr : (size_t)pFldAddr, GTF_ICON_STATIC_HDL,
+ fldSeq);
+
+ if (pFieldInfo->fieldFlags & CORINFO_FLG_FIELD_INITCLASS)
{
- op1 = gtNewIconHandleNode((size_t)fldAddr, GTF_ICON_STATIC_HDL, fldSeq);
+ op1->gtFlags |= GTF_ICON_INITCLASS;
}
- else
- {
- op1 = gtNewIconHandleNode((size_t)pFldAddr, GTF_ICON_STATIC_HDL, fldSeq);
+ if (pFldAddr != nullptr)
+ {
// There are two cases here, either the static is RVA based,
// in which case the type of the FIELD node is not a GC type
// and the handle to the RVA is a TYP_I_IMPL. Or the FIELD node is
@@ -7325,8 +7342,7 @@ var_types Compiler::impImportCall(OPCODE opcode,
// instParam.
instParam = gtNewIconNode(0, TYP_REF);
}
-
- if (!exactContextNeedsRuntimeLookup)
+ else if (!exactContextNeedsRuntimeLookup)
{
#ifdef FEATURE_READYTORUN_COMPILER
if (opts.IsReadyToRun())
@@ -14806,6 +14822,11 @@ void Compiler::impImportBlockCode(BasicBlock* block)
// Could point anywhere, example a boxed class static int
op1->gtFlags |= GTF_IND_TGTANYWHERE | GTF_GLOB_REF;
assertImp(varTypeIsArithmetic(op1->gtType));
+
+ if (prefixFlags & PREFIX_UNALIGNED)
+ {
+ op1->gtFlags |= GTF_IND_UNALIGNED;
+ }
}
else
{
@@ -15616,7 +15637,7 @@ void Compiler::impVerifyEHBlock(BasicBlock* block, bool isTryStart)
// push catch arg the stack, spill to a temp if necessary
// Note: can update HBtab->ebdHndBeg!
- hndBegBB = impPushCatchArgOnStack(hndBegBB, clsHnd);
+ hndBegBB = impPushCatchArgOnStack(hndBegBB, clsHnd, false);
}
// Queue up the handler for importing
@@ -15637,7 +15658,8 @@ void Compiler::impVerifyEHBlock(BasicBlock* block, bool isTryStart)
// push catch arg the stack, spill to a temp if necessary
// Note: can update HBtab->ebdFilter!
- filterBB = impPushCatchArgOnStack(filterBB, impGetObjectClass());
+ const bool isSingleBlockFilter = (filterBB->bbNext == hndBegBB);
+ filterBB = impPushCatchArgOnStack(filterBB, impGetObjectClass(), isSingleBlockFilter);
impImportBlockPending(filterBB);
}
@@ -17954,8 +17976,12 @@ GenTreePtr Compiler::impInlineFetchArg(unsigned lclNum, InlArgInfo* inlArgInfo,
op1 = argInfo.argNode;
argInfo.argTmpNum = op1->gtLclVarCommon.gtLclNum;
- // Use an equivalent copy if this is the second or subsequent use.
- if (argInfo.argIsUsed)
+ // Use an equivalent copy if this is the second or subsequent
+ // use, or if we need to retype.
+ //
+ // Note argument type mismatches that prevent inlining should
+ // have been caught in impInlineInitVars.
+ if (argInfo.argIsUsed || (op1->TypeGet() != lclTyp))
{
assert(op1->gtOper == GT_LCL_VAR);
assert(lclNum == op1->gtLclVar.gtLclILoffs);
@@ -18568,7 +18594,20 @@ void Compiler::impDevirtualizeCall(GenTreeCall* call,
#if defined(DEBUG)
// Validate that callInfo has up to date method flags
const DWORD freshBaseMethodAttribs = info.compCompHnd->getMethodAttribs(baseMethod);
- assert(freshBaseMethodAttribs == baseMethodAttribs);
+
+ // All the base method attributes should agree, save that
+ // CORINFO_FLG_DONT_INLINE may have changed from 0 to 1
+ // because of concurrent jitting activity.
+ //
+ // Note we don't look at this particular flag bit below, and
+ // later on (if we do try and inline) we will rediscover why
+ // the method can't be inlined, so there's no danger here in
+ // seeing this particular flag bit in different states between
+ // the cached and fresh values.
+ if ((freshBaseMethodAttribs & ~CORINFO_FLG_DONT_INLINE) != (baseMethodAttribs & ~CORINFO_FLG_DONT_INLINE))
+ {
+ assert(!"mismatched method attributes");
+ }
#endif // DEBUG
}
diff --git a/src/jit/instrsarm64.h b/src/jit/instrsarm64.h
index e91aaa6836..d8c66b344c 100644
--- a/src/jit/instrsarm64.h
+++ b/src/jit/instrsarm64.h
@@ -555,6 +555,15 @@ INST2(sli, "sli", 0, 0, IF_EN2N, 0x7F005400, 0x2F005400)
// sli Vd,Vn,imm DV_2N 011111110iiiiiii 010101nnnnnddddd 7F00 5400 Vd Vn imm (shift - scalar)
// sli Vd,Vn,imm DV_2O 0Q1011110iiiiiii 010101nnnnnddddd 2F00 5400 Vd,Vn imm (shift - vector)
+INST1(ldar, "ldar", 0,LD, IF_LS_2A, 0x88DFFC00)
+ // ldar Rt,[Xn] LS_2A 1X00100011011111 111111nnnnnttttt 88DF FC00
+
+INST1(ldarb, "ldarb", 0,LD, IF_LS_2A, 0x08DFFC00)
+ // ldarb Rt,[Xn] LS_2A 0000100011011111 111111nnnnnttttt 08DF FC00
+
+INST1(ldarh, "ldarh", 0,LD, IF_LS_2A, 0x48DFFC00)
+ // ldarh Rt,[Xn] LS_2A 0100100011011111 111111nnnnnttttt 48DF FC00
+
INST1(ldur, "ldur", 0,LD, IF_LS_2C, 0xB8400000)
// ldur Rt,[Xn+simm9] LS_2C 1X111000010iiiii iiii00nnnnnttttt B840 0000 [Xn imm(-256..+255)]
@@ -573,6 +582,15 @@ INST1(ldursh, "ldursh", 0,LD, IF_LS_2C, 0x78800000)
INST1(ldursw, "ldursw", 0,LD, IF_LS_2C, 0xB8800000)
// ldursw Rt,[Xn+simm9] LS_2C 10111000100iiiii iiii00nnnnnttttt B880 0000 [Xn imm(-256..+255)]
+INST1(stlr, "stlr", 0,ST, IF_LS_2A, 0x889FFC00)
+ // stlr Rt,[Xn] LS_2A 1X00100010011111 111111nnnnnttttt 889F FC00
+
+INST1(stlrb, "stlrb", 0,ST, IF_LS_2A, 0x089FFC00)
+ // stlrb Rt,[Xn] LS_2A 0000100010011111 111111nnnnnttttt 089F FC00
+
+INST1(stlrh, "stlrh", 0,ST, IF_LS_2A, 0x489FFC00)
+ // stlrh Rt,[Xn] LS_2A 0100100010011111 111111nnnnnttttt 489F FC00
+
INST1(stur, "stur", 0,ST, IF_LS_2C, 0xB8000000)
// stur Rt,[Xn+simm9] LS_2C 1X111000000iiiii iiii00nnnnnttttt B800 0000 [Xn imm(-256..+255)]
diff --git a/src/jit/lclvars.cpp b/src/jit/lclvars.cpp
index e64b5a1645..4770a1d2ba 100644
--- a/src/jit/lclvars.cpp
+++ b/src/jit/lclvars.cpp
@@ -1833,7 +1833,10 @@ bool Compiler::lvaShouldPromoteStructVar(unsigned lclNum, lvaStructPromotionInfo
// TODO-PERF - Implement struct promotion for incoming multireg structs
// Currently it hits assert(lvFieldCnt==1) in lclvar.cpp line 4417
-
+ // Also the implementation of jmp uses the 4 byte move to store
+ // byte parameters to the stack, so that if we have a byte field
+ // with something else occupying the same 4-byte slot, it will
+ // overwrite other fields.
if (structPromotionInfo->fieldCnt != 1)
{
JITDUMP("Not promoting promotable struct local V%02u, because lvIsParam is true and #fields = "
diff --git a/src/jit/liveness.cpp b/src/jit/liveness.cpp
index d498a6f419..73f72e7edb 100644
--- a/src/jit/liveness.cpp
+++ b/src/jit/liveness.cpp
@@ -418,6 +418,8 @@ void Compiler::fgPerBlockLocalVarLiveness()
}
#endif // DEBUG
+ unsigned livenessVarEpoch = GetCurLVEpoch();
+
BasicBlock* block;
#if CAN_DISABLE_DFA
@@ -587,6 +589,7 @@ void Compiler::fgPerBlockLocalVarLiveness()
block->bbMemoryLiveIn = emptyMemoryKindSet;
}
+ noway_assert(livenessVarEpoch == GetCurLVEpoch());
#ifdef DEBUG
if (verbose)
{
diff --git a/src/jit/lower.cpp b/src/jit/lower.cpp
index 035f0947c2..72dba4ee7e 100644
--- a/src/jit/lower.cpp
+++ b/src/jit/lower.cpp
@@ -2872,8 +2872,10 @@ void Lowering::InsertPInvokeMethodProlog()
store->gtOp.gtOp1 = call;
store->gtFlags |= GTF_VAR_DEF;
+ GenTree* const insertionPoint = firstBlockRange.FirstNonPhiOrCatchArgNode();
+
comp->fgMorphTree(store);
- firstBlockRange.InsertAtEnd(LIR::SeqTree(comp, store));
+ firstBlockRange.InsertBefore(insertionPoint, LIR::SeqTree(comp, store));
DISPTREERANGE(firstBlockRange, store);
#if !defined(_TARGET_X86_) && !defined(_TARGET_ARM_)
@@ -2887,7 +2889,7 @@ void Lowering::InsertPInvokeMethodProlog()
GenTreeLclFld(GT_STORE_LCL_FLD, TYP_I_IMPL, comp->lvaInlinedPInvokeFrameVar, callFrameInfo.offsetOfCallSiteSP);
storeSP->gtOp1 = PhysReg(REG_SPBASE);
- firstBlockRange.InsertAtEnd(LIR::SeqTree(comp, storeSP));
+ firstBlockRange.InsertBefore(insertionPoint, LIR::SeqTree(comp, storeSP));
DISPTREERANGE(firstBlockRange, storeSP);
#endif // !defined(_TARGET_X86_) && !defined(_TARGET_ARM_)
@@ -2903,7 +2905,7 @@ void Lowering::InsertPInvokeMethodProlog()
callFrameInfo.offsetOfCalleeSavedFP);
storeFP->gtOp1 = PhysReg(REG_FPBASE);
- firstBlockRange.InsertAtEnd(LIR::SeqTree(comp, storeFP));
+ firstBlockRange.InsertBefore(insertionPoint, LIR::SeqTree(comp, storeFP));
DISPTREERANGE(firstBlockRange, storeFP);
#endif // !defined(_TARGET_ARM_)
@@ -2918,7 +2920,7 @@ void Lowering::InsertPInvokeMethodProlog()
// Push a frame - if we are NOT in an IL stub, this is done right before the call
// The init routine sets InlinedCallFrame's m_pNext, so we just set the thead's top-of-stack
GenTree* frameUpd = CreateFrameLinkUpdate(PushFrame);
- firstBlockRange.InsertAtEnd(LIR::SeqTree(comp, frameUpd));
+ firstBlockRange.InsertBefore(insertionPoint, LIR::SeqTree(comp, frameUpd));
DISPTREERANGE(firstBlockRange, frameUpd);
}
#endif // _TARGET_64BIT_
diff --git a/src/jit/lower.h b/src/jit/lower.h
index bcc2bafdab..5a55d2d69f 100644
--- a/src/jit/lower.h
+++ b/src/jit/lower.h
@@ -178,15 +178,19 @@ private:
{
assert(GenTree::OperIsBinary(tree->OperGet()));
- GenTree* op1 = tree->gtGetOp1();
- GenTree* op2 = tree->gtGetOp2();
+ GenTree* const op1 = tree->gtGetOp1();
+ GenTree* const op2 = tree->gtGetOp2();
- if (tree->OperIsCommutative() && tree->TypeGet() == op1->TypeGet())
+ const unsigned operatorSize = genTypeSize(tree->TypeGet());
+
+ const bool op1Legal = tree->OperIsCommutative() && (operatorSize == genTypeSize(op1->TypeGet()));
+ const bool op2Legal = operatorSize == genTypeSize(op2->TypeGet());
+
+ if (op1Legal)
{
- GenTree* preferredOp = PreferredRegOptionalOperand(tree);
- SetRegOptional(preferredOp);
+ SetRegOptional(op2Legal ? PreferredRegOptionalOperand(tree) : op1);
}
- else if (tree->TypeGet() == op2->TypeGet())
+ else if (op2Legal)
{
SetRegOptional(op2);
}
diff --git a/src/jit/lowerarmarch.cpp b/src/jit/lowerarmarch.cpp
index 4ff3552eb0..4c269af87c 100644
--- a/src/jit/lowerarmarch.cpp
+++ b/src/jit/lowerarmarch.cpp
@@ -175,11 +175,6 @@ void Lowering::LowerBlockStore(GenTreeBlk* blkNode)
if (blkNode->OperGet() == GT_STORE_OBJ)
{
// CopyObj
-
- NYI_ARM("Lowering for GT_STORE_OBJ isn't implemented");
-
-#ifdef _TARGET_ARM64_
-
GenTreeObj* objNode = blkNode->AsObj();
unsigned slots = objNode->gtSlots;
@@ -205,8 +200,6 @@ void Lowering::LowerBlockStore(GenTreeBlk* blkNode)
#endif
blkNode->gtBlkOpKind = GenTreeBlk::BlkOpKindUnroll;
-
-#endif // _TARGET_ARM64_
}
else
{
diff --git a/src/jit/lsra.cpp b/src/jit/lsra.cpp
index 3718ddfb8a..647b0587f6 100644
--- a/src/jit/lsra.cpp
+++ b/src/jit/lsra.cpp
@@ -737,15 +737,30 @@ void LinearScan::associateRefPosWithInterval(RefPosition* rp)
else if (rp->refType == RefTypeUse)
{
// Ensure that we have consistent def/use on SDSU temps.
- // However, in the case of a non-commutative rmw def, we must avoid over-constraining
- // the def, so don't propagate a single-register restriction from the consumer to the producer
+ // However, there are a couple of cases where this may over-constrain allocation:
+ // 1. In the case of a non-commutative rmw def (in which the rmw source must be delay-free), or
+ // 2. In the case where the defining node requires a temp distinct from the target (also a
+ // delay-free case).
+ // In those cases, if we propagate a single-register restriction from the consumer to the producer
+ // the delayed uses will not see a fixed reference in the PhysReg at that position, and may
+ // incorrectly allocate that register.
+ // TODO-CQ: This means that we may often require a copy at the use of this node's result.
+ // This case could be moved to BuildRefPositionsForNode, at the point where the def RefPosition is
+ // created, causing a RefTypeFixedRef to be added at that location. This, however, results in
+ // more PhysReg RefPositions (a throughput impact), and a large number of diffs that require
+ // further analysis to determine benefit.
+ // See Issue #11274.
RefPosition* prevRefPosition = theInterval->recentRefPosition;
assert(prevRefPosition != nullptr && theInterval->firstRefPosition == prevRefPosition);
+ // All defs must have a valid treeNode, but we check it below to be conservative.
+ assert(prevRefPosition->treeNode != nullptr);
regMaskTP prevAssignment = prevRefPosition->registerAssignment;
regMaskTP newAssignment = (prevAssignment & rp->registerAssignment);
if (newAssignment != RBM_NONE)
{
- if (!theInterval->hasNonCommutativeRMWDef || !isSingleRegister(newAssignment))
+ if (!isSingleRegister(newAssignment) ||
+ (!theInterval->hasNonCommutativeRMWDef && (prevRefPosition->treeNode != nullptr) &&
+ !prevRefPosition->treeNode->gtLsraInfo.isInternalRegDelayFree))
{
prevRefPosition->registerAssignment = newAssignment;
}
@@ -1317,6 +1332,8 @@ void LinearScan::setBlockSequence()
compiler->EnsureBasicBlockEpoch();
bbVisitedSet = BlockSetOps::MakeEmpty(compiler);
BlockSet BLOCKSET_INIT_NOCOPY(readySet, BlockSetOps::MakeEmpty(compiler));
+ BlockSet BLOCKSET_INIT_NOCOPY(predSet, BlockSetOps::MakeEmpty(compiler));
+
assert(blockSequence == nullptr && bbSeqCount == 0);
blockSequence = new (compiler, CMK_LSRA) BasicBlock*[compiler->fgBBcount];
bbNumMaxBeforeResolution = compiler->fgBBNumMax;
@@ -1400,7 +1417,7 @@ void LinearScan::setBlockSequence()
// (i.e. pred-first or random, since layout order is handled above).
if (!BlockSetOps::IsMember(compiler, readySet, succ->bbNum))
{
- addToBlockSequenceWorkList(readySet, succ);
+ addToBlockSequenceWorkList(readySet, succ, predSet);
BlockSetOps::AddElemD(compiler, readySet, succ->bbNum);
}
}
@@ -1433,7 +1450,7 @@ void LinearScan::setBlockSequence()
{
if (!isBlockVisited(block))
{
- addToBlockSequenceWorkList(readySet, block);
+ addToBlockSequenceWorkList(readySet, block, predSet);
BlockSetOps::AddElemD(compiler, readySet, block->bbNum);
}
}
@@ -1442,7 +1459,7 @@ void LinearScan::setBlockSequence()
{
if (!isBlockVisited(block))
{
- addToBlockSequenceWorkList(readySet, block);
+ addToBlockSequenceWorkList(readySet, block, predSet);
BlockSetOps::AddElemD(compiler, readySet, block->bbNum);
}
}
@@ -1540,6 +1557,9 @@ int LinearScan::compareBlocksForSequencing(BasicBlock* block1, BasicBlock* block
// Arguments:
// sequencedBlockSet - the set of blocks that are already sequenced
// block - the new block to be added
+// predSet - the buffer to save predecessors set. A block set allocated by the caller used here as a
+// temporary block set for constructing a predecessor set. Allocated by the caller to avoid reallocating a new block
+// set with every call to this function
//
// Return Value:
// None.
@@ -1561,13 +1581,13 @@ int LinearScan::compareBlocksForSequencing(BasicBlock* block1, BasicBlock* block
// Note also that, when random traversal order is implemented, this method
// should insert the blocks into the list in random order, so that we can always
// simply select the first block in the list.
-void LinearScan::addToBlockSequenceWorkList(BlockSet sequencedBlockSet, BasicBlock* block)
+void LinearScan::addToBlockSequenceWorkList(BlockSet sequencedBlockSet, BasicBlock* block, BlockSet& predSet)
{
// The block that is being added is not already sequenced
assert(!BlockSetOps::IsMember(compiler, sequencedBlockSet, block->bbNum));
// Get predSet of block
- BlockSet BLOCKSET_INIT_NOCOPY(predSet, BlockSetOps::MakeEmpty(compiler));
+ BlockSetOps::ClearD(compiler, predSet);
flowList* pred;
for (pred = block->bbPreds; pred != nullptr; pred = pred->flNext)
{
@@ -1723,6 +1743,8 @@ void LinearScan::doLinearScan()
}
#endif // DEBUG
+ unsigned lsraBlockEpoch = compiler->GetCurBasicBlockEpoch();
+
splitBBNumToTargetBBNumMap = nullptr;
// This is complicated by the fact that physical registers have refs associated
@@ -1738,7 +1760,7 @@ void LinearScan::doLinearScan()
DBEXEC(VERBOSE, lsraDumpIntervals("after buildIntervals"));
- BlockSetOps::ClearD(compiler, bbVisitedSet);
+ clearVisitedBlocks();
initVarRegMaps();
allocateRegisters();
compiler->EndPhase(PHASE_LINEAR_SCAN_ALLOC);
@@ -1759,6 +1781,7 @@ void LinearScan::doLinearScan()
DBEXEC(VERBOSE, TupleStyleDump(LSRA_DUMP_POST));
compiler->compLSRADone = true;
+ noway_assert(lsraBlockEpoch = compiler->GetCurBasicBlockEpoch());
}
//------------------------------------------------------------------------
@@ -2747,16 +2770,6 @@ regMaskTP LinearScan::getKillSetForNode(GenTree* tree)
}
break;
- case GT_LSH:
- case GT_RSH:
- case GT_RSZ:
- case GT_ROL:
- case GT_ROR:
- if (tree->gtLsraInfo.isHelperCallWithKills)
- {
- killMask = RBM_CALLEE_TRASH;
- }
- break;
case GT_RETURNTRAP:
killMask = compiler->compHelperCallKillSet(CORINFO_HELP_STOP_FOR_GC);
break;
@@ -5607,6 +5620,22 @@ regNumber LinearScan::tryAllocateFreeReg(Interval* currentInterval, RefPosition*
else if ((bestScore & UNASSIGNED) != 0 && intervalToUnassign != nullptr)
{
availablePhysRegInterval->previousInterval = intervalToUnassign;
+#ifdef _TARGET_ARM_
+ // TODO-ARM-Throughput: For ARM, this should not be necessary, i.e. keeping a same
+ // previous interval in two RegRecords, because we will always manage the register
+ // assignment of TYP_DOUBLE intervals together.
+ // Later we should be able to remove this and update unassignPhysReg() where
+ // previousInterval is used. Please also take a look at unassignPhysReg().
+
+ // Update overlapping floating point register for TYP_DOUBLE
+ if (intervalToUnassign->registerType == TYP_DOUBLE)
+ {
+ assert(isFloatRegType(availablePhysRegInterval->registerType));
+ regNumber nextRegNum = REG_NEXT(availablePhysRegInterval->regNum);
+ RegRecord* nextRegRec = getRegisterRecord(nextRegNum);
+ nextRegRec->previousInterval = intervalToUnassign;
+ }
+#endif
}
}
else
@@ -6027,6 +6056,19 @@ void LinearScan::checkAndAssignInterval(RegRecord* regRec, Interval* interval)
}
regRec->assignedInterval = interval;
+
+#ifdef _TARGET_ARM_
+ // Update second RegRecord of double register
+ if ((interval->registerType == TYP_DOUBLE) && isFloatRegType(regRec->registerType))
+ {
+ assert(genIsValidDoubleReg(regRec->regNum));
+
+ regNumber nextRegNum = REG_NEXT(regRec->regNum);
+ RegRecord* nextRegRec = getRegisterRecord(nextRegNum);
+
+ nextRegRec->assignedInterval = interval;
+ }
+#endif // _TARGET_ARM_
}
// Assign the given physical register interval to the given interval
@@ -6038,16 +6080,6 @@ void LinearScan::assignPhysReg(RegRecord* regRec, Interval* interval)
checkAndAssignInterval(regRec, interval);
interval->assignedReg = regRec;
-#ifdef _TARGET_ARM_
- if ((interval->registerType == TYP_DOUBLE) && isFloatRegType(regRec->registerType))
- {
- regNumber nextRegNum = REG_NEXT(regRec->regNum);
- RegRecord* nextRegRec = getRegisterRecord(nextRegNum);
-
- checkAndAssignInterval(nextRegRec, interval);
- }
-#endif // _TARGET_ARM_
-
interval->physReg = regRec->regNum;
interval->isActive = true;
if (interval->isLocalVar)
@@ -6239,6 +6271,19 @@ void LinearScan::checkAndClearInterval(RegRecord* regRec, RefPosition* spillRefP
}
regRec->assignedInterval = nullptr;
+
+#ifdef _TARGET_ARM_
+ // Update second RegRecord of double register
+ if ((assignedInterval->registerType == TYP_DOUBLE) && isFloatRegType(regRec->registerType))
+ {
+ assert(genIsValidDoubleReg(regRec->regNum));
+
+ regNumber nextRegNum = REG_NEXT(regRec->regNum);
+ RegRecord* nextRegRec = getRegisterRecord(nextRegNum);
+
+ nextRegRec->assignedInterval = nullptr;
+ }
+#endif // _TARGET_ARM_
}
//------------------------------------------------------------------------
@@ -6262,15 +6307,35 @@ void LinearScan::unassignPhysReg(RegRecord* regRec, RefPosition* spillRefPositio
{
Interval* assignedInterval = regRec->assignedInterval;
assert(assignedInterval != nullptr);
- checkAndClearInterval(regRec, spillRefPosition);
+
regNumber thisRegNum = regRec->regNum;
#ifdef _TARGET_ARM_
- if ((assignedInterval->registerType == TYP_DOUBLE) && isFloatRegType(regRec->registerType))
+ regNumber nextRegNum = REG_NA;
+ RegRecord* nextRegRec = nullptr;
+
+ // Prepare second half RegRecord of a double register for TYP_DOUBLE
+ if (assignedInterval->registerType == TYP_DOUBLE)
{
- regNumber nextRegNum = REG_NEXT(regRec->regNum);
- RegRecord* nextRegRec = getRegisterRecord(nextRegNum);
- checkAndClearInterval(nextRegRec, spillRefPosition);
+ assert(isFloatRegType(regRec->registerType));
+ assert(genIsValidDoubleReg(regRec->regNum));
+
+ nextRegNum = REG_NEXT(regRec->regNum);
+ nextRegRec = getRegisterRecord(nextRegNum);
+
+ // Both two RegRecords should have been assigned to the same interval.
+ assert(assignedInterval == nextRegRec->assignedInterval);
+ }
+#endif // _TARGET_ARM_
+
+ checkAndClearInterval(regRec, spillRefPosition);
+
+#ifdef _TARGET_ARM_
+ if (assignedInterval->registerType == TYP_DOUBLE)
+ {
+ // Both two RegRecords should have been unassigned together.
+ assert(regRec->assignedInterval == nullptr);
+ assert(nextRegRec->assignedInterval == nullptr);
}
#endif // _TARGET_ARM_
@@ -6376,6 +6441,18 @@ void LinearScan::unassignPhysReg(RegRecord* regRec, RefPosition* spillRefPositio
{
regRec->assignedInterval = regRec->previousInterval;
regRec->previousInterval = nullptr;
+#ifdef _TARGET_ARM_
+ // Update second half RegRecord of a double register for TYP_DOUBLE
+ if (regRec->assignedInterval->registerType == TYP_DOUBLE)
+ {
+ assert(isFloatRegType(regRec->registerType));
+ assert(genIsValidDoubleReg(regRec->regNum));
+
+ nextRegRec->assignedInterval = nextRegRec->previousInterval;
+ nextRegRec->previousInterval = nullptr;
+ }
+#endif // _TARGET_ARM_
+
#ifdef DEBUG
if (spill)
{
@@ -6392,6 +6469,18 @@ void LinearScan::unassignPhysReg(RegRecord* regRec, RefPosition* spillRefPositio
{
regRec->assignedInterval = nullptr;
regRec->previousInterval = nullptr;
+
+#ifdef _TARGET_ARM_
+ // Update second half RegRecord of a double register for TYP_DOUBLE
+ if (assignedInterval->registerType == TYP_DOUBLE)
+ {
+ assert(isFloatRegType(regRec->registerType));
+ assert(genIsValidDoubleReg(regRec->regNum));
+
+ nextRegRec->assignedInterval = nullptr;
+ nextRegRec->previousInterval = nullptr;
+ }
+#endif // _TARGET_ARM_
}
}
@@ -6505,6 +6594,45 @@ regNumber LinearScan::rotateBlockStartLocation(Interval* interval, regNumber tar
}
#endif // DEBUG
+#ifdef _TARGET_ARM_
+//--------------------------------------------------------------------------------------
+// isSecondHalfReg: Test if recRec is second half of double reigster
+// which is assigned to an interval.
+//
+// Arguments:
+// regRec - a register to be tested
+// interval - an interval which is assigned to some register
+//
+// Assumptions:
+// None
+//
+// Return Value:
+// True only if regRec is second half of assignedReg in interval
+//
+bool LinearScan::isSecondHalfReg(RegRecord* regRec, Interval* interval)
+{
+ RegRecord* assignedReg = interval->assignedReg;
+
+ if (assignedReg != nullptr && interval->registerType == TYP_DOUBLE)
+ {
+ // interval should have been allocated to a valid double register
+ assert(genIsValidDoubleReg(assignedReg->regNum));
+
+ // Find a second half RegRecord of double register
+ regNumber firstRegNum = assignedReg->regNum;
+ regNumber secondRegNum = REG_NEXT(firstRegNum);
+
+ assert(genIsValidFloatReg(secondRegNum) && !genIsValidDoubleReg(secondRegNum));
+
+ RegRecord* secondRegRec = getRegisterRecord(secondRegNum);
+
+ return secondRegRec == regRec;
+ }
+
+ return false;
+}
+#endif
+
//------------------------------------------------------------------------
// processBlockStartLocations: Update var locations on entry to 'currentBlock'
//
@@ -6703,6 +6831,7 @@ void LinearScan::processBlockStartLocations(BasicBlock* currentBlock, bool alloc
if (assignedInterval != nullptr)
{
assert(assignedInterval->isLocalVar || assignedInterval->isConstant);
+
if (!assignedInterval->isConstant && assignedInterval->assignedReg == physRegRecord)
{
assignedInterval->isActive = false;
@@ -6712,6 +6841,13 @@ void LinearScan::processBlockStartLocations(BasicBlock* currentBlock, bool alloc
}
inVarToRegMap[assignedInterval->getVarIndex(compiler)] = REG_STK;
}
+#ifdef _TARGET_ARM_
+ // Consider overlapping floating point register for TYP_DOUBLE
+ else if (!assignedInterval->isConstant && assignedInterval->registerType == TYP_DOUBLE)
+ {
+ assert(!assignedInterval->isActive || isSecondHalfReg(physRegRecord, assignedInterval));
+ }
+#endif // _TARGET_ARM_
else
{
// This interval may still be active, but was in another register in an
@@ -6839,6 +6975,9 @@ void LinearScan::freeRegister(RegRecord* physRegRecord)
// we wouldn't unnecessarily link separate live ranges to the same register.
if (nextRefPosition == nullptr || RefTypeIsDef(nextRefPosition->refType))
{
+#ifdef _TARGET_ARM_
+ assert((assignedInterval->registerType != TYP_DOUBLE) || genIsValidDoubleReg(physRegRecord->regNum));
+#endif // _TARGET_ARM_
unassignPhysReg(physRegRecord, nullptr);
}
}
@@ -7070,11 +7209,24 @@ void LinearScan::allocateRegisters()
// Otherwise, do nothing.
if (refType == RefTypeFixedReg)
{
- RegRecord* regRecord = currentRefPosition->getReg();
- if (regRecord->assignedInterval != nullptr && !regRecord->assignedInterval->isActive &&
- regRecord->assignedInterval->isConstant)
+ RegRecord* regRecord = currentRefPosition->getReg();
+ Interval* assignedInterval = regRecord->assignedInterval;
+
+ if (assignedInterval != nullptr && !assignedInterval->isActive && assignedInterval->isConstant)
{
regRecord->assignedInterval = nullptr;
+
+#ifdef _TARGET_ARM_
+ // Update overlapping floating point register for TYP_DOUBLE
+ if (assignedInterval->registerType == TYP_DOUBLE)
+ {
+ regRecord = getRegisterRecord(REG_NEXT(regRecord->regNum));
+ assignedInterval = regRecord->assignedInterval;
+
+ assert(assignedInterval != nullptr && !assignedInterval->isActive && assignedInterval->isConstant);
+ regRecord->assignedInterval = nullptr;
+ }
+#endif
}
INDEBUG(dumpLsraAllocationEvent(LSRA_EVENT_FIXED_REG, nullptr, currentRefPosition->assignedReg()));
continue;
@@ -7567,11 +7719,13 @@ void LinearScan::allocateRegisters()
if (currentRefPosition->delayRegFree)
{
delayRegsToFree |= assignedRegBit;
+
INDEBUG(dumpLsraAllocationEvent(LSRA_EVENT_LAST_USE_DELAYED));
}
else
{
regsToFree |= assignedRegBit;
+
INDEBUG(dumpLsraAllocationEvent(LSRA_EVENT_LAST_USE));
}
}
@@ -7911,6 +8065,18 @@ void LinearScan::resolveLocalRef(BasicBlock* block, GenTreePtr treeNode, RefPosi
interval->isActive = true;
physRegRecord->assignedInterval = interval;
interval->assignedReg = physRegRecord;
+#ifdef _TARGET_ARM_
+ // Update overlapping floating point register for TYP_DOUBLE
+ if (interval->registerType == TYP_DOUBLE)
+ {
+ assert(isFloatRegType(physRegRecord->registerType));
+
+ regNumber nextRegNum = REG_NEXT(physRegRecord->regNum);
+ RegRecord* nextPhysRegRecord = getRegisterRecord(nextRegNum);
+
+ nextPhysRegRecord->assignedInterval = interval;
+ }
+#endif
}
}
@@ -9943,12 +10109,11 @@ void TreeNodeInfo::Initialize(LinearScan* lsra, GenTree* node, LsraLocation loca
dstCandidates = genRegMask(node->gtRegNum);
}
- internalIntCount = 0;
- internalFloatCount = 0;
- isLocalDefUse = false;
- isHelperCallWithKills = false;
- isLsraAdded = false;
- definesAnyRegisters = false;
+ internalIntCount = 0;
+ internalFloatCount = 0;
+ isLocalDefUse = false;
+ isLsraAdded = false;
+ definesAnyRegisters = false;
setDstCandidates(lsra, dstCandidates);
srcCandsIndex = dstCandsIndex;
@@ -10373,10 +10538,6 @@ void TreeNodeInfo::dump(LinearScan* lsra)
{
printf(" I");
}
- if (isHelperCallWithKills)
- {
- printf(" H");
- }
if (isLsraAdded)
{
printf(" A");
diff --git a/src/jit/lsra.h b/src/jit/lsra.h
index b6f83792a7..f0a9d54aad 100644
--- a/src/jit/lsra.h
+++ b/src/jit/lsra.h
@@ -694,6 +694,10 @@ private:
void processBlockStartLocations(BasicBlock* current, bool allocationPass);
void processBlockEndLocations(BasicBlock* current);
+#ifdef _TARGET_ARM_
+ bool isSecondHalfReg(RegRecord* regRec, Interval* interval);
+#endif
+
RefType CheckBlockType(BasicBlock* block, BasicBlock* prevBlock);
// insert refpositions representing prolog zero-inits which will be added later
@@ -1131,7 +1135,7 @@ private:
int compareBlocksForSequencing(BasicBlock* block1, BasicBlock* block2, bool useBlockWeights);
BasicBlockList* blockSequenceWorkList;
bool blockSequencingDone;
- void addToBlockSequenceWorkList(BlockSet sequencedBlockSet, BasicBlock* block);
+ void addToBlockSequenceWorkList(BlockSet sequencedBlockSet, BasicBlock* block, BlockSet& predSet);
void removeFromBlockSequenceWorkList(BasicBlockList* listNode, BasicBlockList* prevNode);
BasicBlock* getNextCandidateFromWorkList();
diff --git a/src/jit/lsraarm.cpp b/src/jit/lsraarm.cpp
index e83f50c051..0d1cfe6bfa 100644
--- a/src/jit/lsraarm.cpp
+++ b/src/jit/lsraarm.cpp
@@ -229,8 +229,6 @@ void Lowering::TreeNodeInfoInit(GenTree* tree)
JITDUMP("TreeNodeInfoInit for: ");
DISPNODE(tree);
- NYI_IF(tree->TypeGet() == TYP_DOUBLE, "lowering double");
-
switch (tree->OperGet())
{
GenTree* op1;
diff --git a/src/jit/lsraarmarch.cpp b/src/jit/lsraarmarch.cpp
index 7d999d880f..f661babc5b 100644
--- a/src/jit/lsraarmarch.cpp
+++ b/src/jit/lsraarmarch.cpp
@@ -784,15 +784,24 @@ void Lowering::TreeNodeInfoInitBlockStore(GenTreeBlk* blkNode)
if (blkNode->OperGet() == GT_STORE_OBJ)
{
// CopyObj
- NYI_ARM("GT_STORE_OBJ is needed of write barriers implementation");
-
-#ifdef _TARGET_ARM64_
-
// We don't need to materialize the struct size but we still need
// a temporary register to perform the sequence of loads and stores.
blkNode->gtLsraInfo.internalIntCount = 1;
+ if (size >= 2 * REGSIZE_BYTES)
+ {
+ // We will use ldp/stp to reduce code size and improve performance
+ // so we need to reserve an extra internal register
+ blkNode->gtLsraInfo.internalIntCount++;
+ }
+
+ // We can't use the special Write Barrier registers, so exclude them from the mask
+ regMaskTP internalIntCandidates = RBM_ALLINT & ~(RBM_WRITE_BARRIER_DST_BYREF | RBM_WRITE_BARRIER_SRC_BYREF);
+ blkNode->gtLsraInfo.setInternalCandidates(l, internalIntCandidates);
+
+ // If we have a dest address we want it in RBM_WRITE_BARRIER_DST_BYREF.
dstAddr->gtLsraInfo.setSrcCandidates(l, RBM_WRITE_BARRIER_DST_BYREF);
+
// If we have a source address we want it in REG_WRITE_BARRIER_SRC_BYREF.
// Otherwise, if it is a local, codegen will put its address in REG_WRITE_BARRIER_SRC_BYREF,
// which is killed by a StoreObj (and thus needn't be reserved).
@@ -800,8 +809,6 @@ void Lowering::TreeNodeInfoInitBlockStore(GenTreeBlk* blkNode)
{
srcAddrOrFill->gtLsraInfo.setSrcCandidates(l, RBM_WRITE_BARRIER_SRC_BYREF);
}
-
-#endif // _TARGET_ARM64_
}
else
{
@@ -824,7 +831,8 @@ void Lowering::TreeNodeInfoInitBlockStore(GenTreeBlk* blkNode)
if (size >= 2 * REGSIZE_BYTES)
{
- // Use ldp/stp to reduce code size and improve performance
+ // We will use ldp/stp to reduce code size and improve performance
+ // so we need to reserve an extra internal register
internalIntCount++;
}
diff --git a/src/jit/morph.cpp b/src/jit/morph.cpp
index f63496b686..6928c3c393 100644
--- a/src/jit/morph.cpp
+++ b/src/jit/morph.cpp
@@ -6099,7 +6099,7 @@ GenTreePtr Compiler::fgMorphStackArgForVarArgs(unsigned lclNum, var_types varTyp
* Transform the given GT_LCL_VAR tree for code generation.
*/
-GenTreePtr Compiler::fgMorphLocalVar(GenTreePtr tree)
+GenTreePtr Compiler::fgMorphLocalVar(GenTreePtr tree, bool forceRemorph)
{
noway_assert(tree->gtOper == GT_LCL_VAR);
@@ -6129,7 +6129,7 @@ GenTreePtr Compiler::fgMorphLocalVar(GenTreePtr tree)
/* If not during the global morphing phase bail */
- if (!fgGlobalMorph)
+ if (!fgGlobalMorph && !forceRemorph)
{
return tree;
}
@@ -6560,6 +6560,13 @@ GenTreePtr Compiler::fgMorphField(GenTreePtr tree, MorphAddrContext* mac)
GenTreePtr tlsRef = gtNewIconHandleNode(WIN32_TLS_SLOTS, GTF_ICON_TLS_HDL);
+ // Translate GTF_FLD_INITCLASS to GTF_ICON_INITCLASS
+ if ((tree->gtFlags & GTF_FLD_INITCLASS) != 0)
+ {
+ tree->gtFlags &= ~GTF_FLD_INITCLASS;
+ tlsRef->gtFlags |= GTF_ICON_INITCLASS;
+ }
+
tlsRef = gtNewOperNode(GT_IND, TYP_I_IMPL, tlsRef);
if (dllRef != nullptr)
@@ -6614,6 +6621,12 @@ GenTreePtr Compiler::fgMorphField(GenTreePtr tree, MorphAddrContext* mac)
FieldSeqNode* fieldSeq =
fieldMayOverlap ? FieldSeqStore::NotAField() : GetFieldSeqStore()->CreateSingleton(symHnd);
addr->gtIntCon.gtFieldSeq = fieldSeq;
+ // Translate GTF_FLD_INITCLASS to GTF_ICON_INITCLASS
+ if ((tree->gtFlags & GTF_FLD_INITCLASS) != 0)
+ {
+ tree->gtFlags &= ~GTF_FLD_INITCLASS;
+ addr->gtFlags |= GTF_ICON_INITCLASS;
+ }
tree->SetOper(GT_IND);
// The GTF_FLD_NULLCHECK is the same bit as GTF_IND_ARR_LEN.
@@ -6628,9 +6641,10 @@ GenTreePtr Compiler::fgMorphField(GenTreePtr tree, MorphAddrContext* mac)
else
#endif // _TARGET_64BIT_
{
- // Only volatile could be set, and it maps over
- noway_assert((tree->gtFlags & ~(GTF_FLD_VOLATILE | GTF_COMMON_MASK)) == 0);
- noway_assert(GTF_FLD_VOLATILE == GTF_IND_VOLATILE);
+ // Only volatile or classinit could be set, and they map over
+ noway_assert((tree->gtFlags & ~(GTF_FLD_VOLATILE | GTF_FLD_INITCLASS | GTF_COMMON_MASK)) == 0);
+ static_assert_no_msg(GTF_FLD_VOLATILE == GTF_CLS_VAR_VOLATILE);
+ static_assert_no_msg(GTF_FLD_INITCLASS == GTF_CLS_VAR_INITCLASS);
tree->SetOper(GT_CLS_VAR);
tree->gtClsVar.gtClsVarHnd = symHnd;
FieldSeqNode* fieldSeq =
@@ -6644,6 +6658,13 @@ GenTreePtr Compiler::fgMorphField(GenTreePtr tree, MorphAddrContext* mac)
{
GenTreePtr addr = gtNewIconHandleNode((size_t)pFldAddr, GTF_ICON_STATIC_HDL);
+ // Translate GTF_FLD_INITCLASS to GTF_ICON_INITCLASS
+ if ((tree->gtFlags & GTF_FLD_INITCLASS) != 0)
+ {
+ tree->gtFlags &= ~GTF_FLD_INITCLASS;
+ addr->gtFlags |= GTF_ICON_INITCLASS;
+ }
+
// There are two cases here, either the static is RVA based,
// in which case the type of the FIELD node is not a GC type
// and the handle to the RVA is a TYP_I_IMPL. Or the FIELD node is
@@ -8522,7 +8543,8 @@ GenTreePtr Compiler::fgMorphLeaf(GenTreePtr tree)
if (tree->gtOper == GT_LCL_VAR)
{
- return fgMorphLocalVar(tree);
+ const bool forceRemorph = false;
+ return fgMorphLocalVar(tree, forceRemorph);
}
#ifdef _TARGET_X86_
else if (tree->gtOper == GT_LCL_FLD)
@@ -13132,26 +13154,14 @@ GenTreePtr Compiler::fgMorphSmpOp(GenTreePtr tree, MorphAddrContext* mac)
varTypeIsStruct(tempTyp) || (tempTyp == TYP_BLK) || (tempTyp == TYP_LCLBLK);
const unsigned varSize = useExactSize ? varDsc->lvExactSize : genTypeSize(temp);
+ // Make sure we do not enregister this lclVar.
+ lvaSetVarDoNotEnregister(lclNum DEBUGARG(DNER_LocalField));
+
// If the size of the load is greater than the size of the lclVar, we cannot fold this access into
// a lclFld: the access represented by an lclFld node must begin at or after the start of the
// lclVar and must not extend beyond the end of the lclVar.
- if ((ival1 < 0) || ((ival1 + genTypeSize(typ)) > varSize))
- {
- lvaSetVarDoNotEnregister(lclNum DEBUGARG(DNER_LocalField));
- }
- else
+ if ((ival1 >= 0) && ((ival1 + genTypeSize(typ)) <= varSize))
{
- // Make sure we don't separately promote the fields of this struct.
- if (varDsc->lvRegStruct)
- {
- // We can enregister, but can't promote.
- varDsc->lvPromoted = false;
- }
- else
- {
- lvaSetVarDoNotEnregister(lclNum DEBUGARG(DNER_LocalField));
- }
-
// We will turn a GT_LCL_VAR into a GT_LCL_FLD with an gtLclOffs of 'ival'
// or if we already have a GT_LCL_FLD we will adjust the gtLclOffs by adding 'ival'
// Then we change the type of the GT_LCL_FLD to match the orginal GT_IND type.
@@ -13195,6 +13205,25 @@ GenTreePtr Compiler::fgMorphSmpOp(GenTreePtr tree, MorphAddrContext* mac)
DEBUG_DESTROY_NODE(op1); // GT_ADD or GT_ADDR
DEBUG_DESTROY_NODE(tree); // GT_IND
+ // If the result of the fold is a local var, we may need to perform further adjustments e.g. for
+ // normalization.
+ if (temp->OperIs(GT_LCL_VAR))
+ {
+#ifdef DEBUG
+ // We clear this flag on `temp` because `fgMorphLocalVar` may assert that this bit is clear
+ // and the node in question must have this bit set (as it has already been morphed).
+ temp->gtDebugFlags &= ~GTF_DEBUG_NODE_MORPHED;
+#endif // DEBUG
+ const bool forceRemorph = true;
+ temp = fgMorphLocalVar(temp, forceRemorph);
+#ifdef DEBUG
+ // We then set this flag on `temp` because `fgMorhpLocalVar` may not set it itself, and the
+ // caller of `fgMorphSmpOp` may assert that this flag is set on `temp` once this function
+ // returns.
+ temp->gtDebugFlags |= GTF_DEBUG_NODE_MORPHED;
+#endif // DEBUG
+ }
+
return temp;
}
@@ -13644,7 +13673,7 @@ GenTree* Compiler::fgMorphSmpOpOptional(GenTreeOp* tree)
GenTree* op2 = tree->gtOp2;
var_types typ = tree->TypeGet();
- if (GenTree::OperIsCommutative(oper))
+ if (fgGlobalMorph && GenTree::OperIsCommutative(oper))
{
/* Swap the operands so that the more expensive one is 'op1' */
@@ -13682,7 +13711,7 @@ GenTree* Compiler::fgMorphSmpOpOptional(GenTreeOp* tree)
/* Change "((x+icon)+y)" to "((x+y)+icon)"
Don't reorder floating-point operations */
- if ((oper == GT_ADD) && !tree->gtOverflow() && (op1->gtOper == GT_ADD) && !op1->gtOverflow() &&
+ if (fgGlobalMorph && (oper == GT_ADD) && !tree->gtOverflow() && (op1->gtOper == GT_ADD) && !op1->gtOverflow() &&
varTypeIsIntegralOrI(typ))
{
GenTreePtr ad2 = op1->gtOp.gtOp2;
diff --git a/src/jit/nodeinfo.h b/src/jit/nodeinfo.h
index 1937cc4377..5f03da2776 100644
--- a/src/jit/nodeinfo.h
+++ b/src/jit/nodeinfo.h
@@ -25,7 +25,6 @@ public:
dstCandsIndex = 0;
internalCandsIndex = 0;
isLocalDefUse = false;
- isHelperCallWithKills = false;
isLsraAdded = false;
isDelayFree = false;
hasDelayFreeSrc = false;
@@ -117,9 +116,6 @@ public:
// nodes, or top-level nodes that are non-void.
unsigned char isLocalDefUse : 1;
- // isHelperCallWithKills is set when this is a helper call that kills more than just its in/out regs.
- unsigned char isHelperCallWithKills : 1;
-
// Is this node added by LSRA, e.g. as a resolution or copy/reload move.
unsigned char isLsraAdded : 1;
diff --git a/src/jit/optimizer.cpp b/src/jit/optimizer.cpp
index 710dac540c..1e50e537e0 100644
--- a/src/jit/optimizer.cpp
+++ b/src/jit/optimizer.cpp
@@ -2838,6 +2838,11 @@ void Compiler::optUnrollLoops()
// to outermost order
for (unsigned lnum = optLoopCount - 1; lnum != ~0U; --lnum)
{
+ // This is necessary due to an apparent analysis limitation since
+ // optLoopCount must be strictly greater than 0 upon entry and lnum
+ // cannot wrap due to the loop termination condition.
+ PREFAST_ASSUME(lnum != 0U - 1);
+
BasicBlock* block;
BasicBlock* head;
BasicBlock* bottom;
@@ -6003,7 +6008,9 @@ void Compiler::optHoistLoopExprsForBlock(BasicBlock* blk, unsigned lnum, LoopHoi
{
GenTreePtr stmtTree = stmt->gtStmtExpr;
bool hoistable;
- (void)optHoistLoopExprsForTree(stmtTree, lnum, hoistCtxt, &firstBlockAndBeforeSideEffect, &hoistable);
+ bool cctorDependent;
+ (void)optHoistLoopExprsForTree(stmtTree, lnum, hoistCtxt, &firstBlockAndBeforeSideEffect, &hoistable,
+ &cctorDependent);
if (hoistable)
{
// we will try to hoist the top-level stmtTree
@@ -6109,43 +6116,87 @@ bool Compiler::optIsProfitableToHoistableTree(GenTreePtr tree, unsigned lnum)
//
// This function returns true if 'tree' is a loop invariant expression.
-// It also sets '*pHoistable' to true if 'tree' can be hoisted into a loop PreHeader block
+// It also sets '*pHoistable' to true if 'tree' can be hoisted into a loop PreHeader block,
+// and sets '*pCctorDependent' if 'tree' is a function of a static field that must not be
+// hoisted (even if '*pHoistable' is true) unless a preceding corresponding cctor init helper
+// call is also hoisted.
//
-bool Compiler::optHoistLoopExprsForTree(
- GenTreePtr tree, unsigned lnum, LoopHoistContext* hoistCtxt, bool* pFirstBlockAndBeforeSideEffect, bool* pHoistable)
+bool Compiler::optHoistLoopExprsForTree(GenTreePtr tree,
+ unsigned lnum,
+ LoopHoistContext* hoistCtxt,
+ bool* pFirstBlockAndBeforeSideEffect,
+ bool* pHoistable,
+ bool* pCctorDependent)
{
// First do the children.
// We must keep track of whether each child node was hoistable or not
//
unsigned nChildren = tree->NumChildren();
bool childrenHoistable[GenTree::MAX_CHILDREN];
+ bool childrenCctorDependent[GenTree::MAX_CHILDREN];
// Initialize the array elements for childrenHoistable[] to false
for (unsigned i = 0; i < nChildren; i++)
{
- childrenHoistable[i] = false;
+ childrenHoistable[i] = false;
+ childrenCctorDependent[i] = false;
}
+ // Initclass CLS_VARs and IconHandles are the base cases of cctor dependent trees.
+ // In the IconHandle case, it's of course the dereference, rather than the constant itself, that is
+ // truly dependent on the cctor. So a more precise approach would be to separately propagate
+ // isCctorDependent and isAddressWhoseDereferenceWouldBeCctorDependent, but we don't for simplicity/throughput;
+ // the constant itself would be considered non-hoistable anyway, since optIsCSEcandidate returns
+ // false for constants.
+ bool treeIsCctorDependent = ((tree->OperIs(GT_CLS_VAR) && ((tree->gtFlags & GTF_CLS_VAR_INITCLASS) != 0)) ||
+ (tree->OperIs(GT_CNS_INT) && ((tree->gtFlags & GTF_ICON_INITCLASS) != 0)));
bool treeIsInvariant = true;
for (unsigned childNum = 0; childNum < nChildren; childNum++)
{
if (!optHoistLoopExprsForTree(tree->GetChild(childNum), lnum, hoistCtxt, pFirstBlockAndBeforeSideEffect,
- &childrenHoistable[childNum]))
+ &childrenHoistable[childNum], &childrenCctorDependent[childNum]))
{
treeIsInvariant = false;
}
+
+ if (childrenCctorDependent[childNum])
+ {
+ // Normally, a parent of a cctor-dependent tree is also cctor-dependent.
+ treeIsCctorDependent = true;
+
+ // Check for the case where we can stop propagating cctor-dependent upwards.
+ if (tree->OperIs(GT_COMMA) && (childNum == 1))
+ {
+ GenTreePtr op1 = tree->gtGetOp1();
+ if (op1->OperIs(GT_CALL))
+ {
+ GenTreeCall* call = op1->AsCall();
+ if ((call->gtCallType == CT_HELPER) &&
+ s_helperCallProperties.MayRunCctor(eeGetHelperNum(call->gtCallMethHnd)))
+ {
+ // Hoisting the comma is ok because it would hoist the initialization along
+ // with the static field reference.
+ treeIsCctorDependent = false;
+ // Hoisting the static field without hoisting the initialization would be
+ // incorrect, make sure we consider the field (which we flagged as
+ // cctor-dependent) non-hoistable.
+ noway_assert(!childrenHoistable[childNum]);
+ }
+ }
+ }
+ }
}
- // If all the children of "tree" are hoistable, then "tree" itself can be hoisted
- //
- bool treeIsHoistable = treeIsInvariant;
+ // If all the children of "tree" are hoistable, then "tree" itself can be hoisted,
+ // unless it has a static var reference that can't be hoisted past its cctor call.
+ bool treeIsHoistable = treeIsInvariant && !treeIsCctorDependent;
// But we must see if anything else prevents "tree" from being hoisted.
//
if (treeIsInvariant)
{
// Tree must be a suitable CSE candidate for us to be able to hoist it.
- treeIsHoistable = optIsCSEcandidate(tree);
+ treeIsHoistable &= optIsCSEcandidate(tree);
// If it's a call, it must be a helper call, and be pure.
// Further, if it may run a cctor, it must be labeled as "Hoistable"
@@ -6184,14 +6235,6 @@ bool Compiler::optHoistLoopExprsForTree(
treeIsHoistable = false;
}
}
- // Currently we must give up on reads from static variables (even if we are in the first block).
- //
- if (tree->OperGet() == GT_CLS_VAR)
- {
- // TODO-CQ: test that fails if we hoist GT_CLS_VAR: JIT\Directed\Languages\ComponentPascal\pi_r.exe
- // method Main
- treeIsHoistable = false;
- }
}
// Is the value of the whole tree loop invariant?
@@ -6285,7 +6328,8 @@ bool Compiler::optHoistLoopExprsForTree(
}
}
- *pHoistable = treeIsHoistable;
+ *pHoistable = treeIsHoistable;
+ *pCctorDependent = treeIsCctorDependent;
return treeIsInvariant;
}
diff --git a/src/jit/regalloc.cpp b/src/jit/regalloc.cpp
index 938f8e8124..38967a4df5 100644
--- a/src/jit/regalloc.cpp
+++ b/src/jit/regalloc.cpp
@@ -1340,7 +1340,7 @@ RET:
while (iter.NextElem(this, &varNum))
{
// We'll need this for one of the calls...
- VarSetOps::ClearD(this, varAsSet);
+ VarSetOps::OldStyleClearD(this, varAsSet);
VarSetOps::AddElemD(this, varAsSet, varNum);
// If this varBit and lastUse?
@@ -6348,7 +6348,7 @@ void Compiler::rpPredictRegUse()
/* Zero the variable/register interference graph */
for (unsigned i = 0; i < REG_COUNT; i++)
{
- VarSetOps::ClearD(this, raLclRegIntf[i]);
+ VarSetOps::OldStyleClearD(this, raLclRegIntf[i]);
}
// if there are PInvoke calls and compLvFrameListRoot is enregistered,
diff --git a/src/jit/target.h b/src/jit/target.h
index f62d90519b..9fa5e3322e 100644
--- a/src/jit/target.h
+++ b/src/jit/target.h
@@ -1357,6 +1357,13 @@ typedef unsigned short regPairNoSmall; // arm: need 12 bits
#define RBM_WRITE_BARRIER RBM_R1
#endif
+ //In the ARM case, registers of write barrier use the normal argument registers.
+ #define REG_WRITE_BARRIER_SRC_BYREF REG_ARG_1
+ #define RBM_WRITE_BARRIER_SRC_BYREF RBM_ARG_1
+
+ #define REG_WRITE_BARRIER_DST_BYREF REG_ARG_0
+ #define RBM_WRITE_BARRIER_DST_BYREF RBM_ARG_0
+
// GenericPInvokeCalliHelper VASigCookie Parameter
#define REG_PINVOKE_COOKIE_PARAM REG_R4
#define RBM_PINVOKE_COOKIE_PARAM RBM_R4
@@ -1520,7 +1527,7 @@ typedef unsigned short regPairNoSmall; // arm: need 12 bits
#define FEATURE_STRUCTPROMOTE 1 // JIT Optimization to promote fields of structs into registers
#define FEATURE_MULTIREG_STRUCT_PROMOTE 1 // True when we want to promote fields of a multireg struct into registers
#define FEATURE_FASTTAILCALL 1 // Tail calls made as epilog+jmp
- #define FEATURE_TAILCALL_OPT 0 // opportunistic Tail calls (i.e. without ".tail" prefix) made as fast tail calls.
+ #define FEATURE_TAILCALL_OPT 1 // opportunistic Tail calls (i.e. without ".tail" prefix) made as fast tail calls.
#define FEATURE_SET_FLAGS 1 // Set to true to force the JIT to mark the trees with GTF_SET_FLAGS when the flags need to be set
#define FEATURE_MULTIREG_ARGS_OR_RET 1 // Support for passing and/or returning single values in more than one register
#define FEATURE_MULTIREG_ARGS 1 // Support for passing a single argument in more than one register
@@ -1573,7 +1580,7 @@ typedef unsigned short regPairNoSmall; // arm: need 12 bits
#define RBM_CALLEE_SAVED (RBM_INT_CALLEE_SAVED | RBM_FLT_CALLEE_SAVED)
#define RBM_CALLEE_TRASH (RBM_INT_CALLEE_TRASH | RBM_FLT_CALLEE_TRASH)
- #define RBM_CALLEE_TRASH_NOGC (RBM_R12|RBM_R13|RBM_R14|RBM_R15)
+ #define RBM_CALLEE_TRASH_NOGC (RBM_R12|RBM_R13|RBM_R14|RBM_R15|RBM_IP1)
#define REG_DEFAULT_HELPER_CALL_TARGET REG_R12
#define RBM_ALLINT (RBM_INT_CALLEE_SAVED | RBM_INT_CALLEE_TRASH)
@@ -1950,7 +1957,7 @@ inline bool genIsValidFloatReg(regNumber reg)
return reg >= REG_FP_FIRST && reg <= REG_FP_LAST;
}
-#if defined(LEGACY_BACKEND) && defined(_TARGET_ARM_)
+#ifdef _TARGET_ARM_
/*****************************************************************************
* Return true if the register is a valid floating point double register
@@ -1960,7 +1967,7 @@ inline bool genIsValidDoubleReg(regNumber reg)
return genIsValidFloatReg(reg) && (((reg - REG_FP_FIRST) & 0x1) == 0);
}
-#endif // defined(LEGACY_BACKEND) && defined(_TARGET_ARM_)
+#endif // _TARGET_ARM_
//-------------------------------------------------------------------------------------------
// hasFixedRetBuffReg:
diff --git a/src/md/ceefilegen/cceegen.cpp b/src/md/ceefilegen/cceegen.cpp
index 0cf0780d15..bd69c8daed 100644
--- a/src/md/ceefilegen/cceegen.cpp
+++ b/src/md/ceefilegen/cceegen.cpp
@@ -38,22 +38,30 @@ HRESULT STDMETHODCALLTYPE CreateICeeGen(REFIID riid, void **pCeeGen)
HRESULT CCeeGen::CreateNewInstance(CCeeGen* & pGen) // static, public
{
- pGen = new CCeeGen();
- _ASSERTE(pGen != NULL);
- TESTANDRETURNMEMORY(pGen);
+ NewHolder<CCeeGen> pGenHolder(new CCeeGen());
+ _ASSERTE(pGenHolder != NULL);
+ TESTANDRETURNMEMORY(pGenHolder);
- pGen->m_peSectionMan = new PESectionMan;
- _ASSERTE(pGen->m_peSectionMan != NULL);
- TESTANDRETURNMEMORY(pGen->m_peSectionMan);
+ pGenHolder->m_peSectionMan = new PESectionMan;
+ _ASSERTE(pGenHolder->m_peSectionMan != NULL);
+ TESTANDRETURNMEMORY(pGenHolder->m_peSectionMan);
- HRESULT hr = pGen->m_peSectionMan->Init();
- TESTANDRETURNHR(hr);
+ HRESULT hr = pGenHolder->m_peSectionMan->Init();
+ if (FAILED(hr))
+ {
+ pGenHolder->Cleanup();
+ return hr;
+ }
- hr = pGen->Init();
- TESTANDRETURNHR(hr);
+ hr = pGenHolder->Init();
+ if (FAILED(hr))
+ {
+ // Init() calls Cleanup() on failure
+ return hr;
+ }
+ pGen = pGenHolder.Extract();
return hr;
-
}
STDMETHODIMP CCeeGen::QueryInterface(REFIID riid, void** ppv)
diff --git a/src/md/enc/mdinternalrw.cpp b/src/md/enc/mdinternalrw.cpp
index 02fb407358..75c793967e 100644
--- a/src/md/enc/mdinternalrw.cpp
+++ b/src/md/enc/mdinternalrw.cpp
@@ -2393,7 +2393,7 @@ HRESULT MDInternalRW::GetItemGuid( // return hresult
// Get the GUID, if any.
hr = GetCustomAttributeByName(tkObj, INTEROP_GUID_TYPE, (const void**)&pBlob, &cbBlob);
- if (hr != S_FALSE)
+ if (SUCCEEDED(hr) && hr != S_FALSE)
{
// Should be in format. Total length == 41
// <0x0001><0x24>01234567-0123-0123-0123-001122334455<0x0000>
diff --git a/src/mscorlib/Resources/Strings.resx b/src/mscorlib/Resources/Strings.resx
index 791d1ca04d..cbf969e8fe 100644
--- a/src/mscorlib/Resources/Strings.resx
+++ b/src/mscorlib/Resources/Strings.resx
@@ -1628,9 +1628,6 @@
<data name="ArgumentOutOfRange_ArrayLBAndLength" xml:space="preserve">
<value>Higher indices will exceed Int32.MaxValue because of large lower bound and/or length.</value>
</data>
- <data name="ArgumentOutOfRange_ArrayListInsert" xml:space="preserve">
- <value>Insertion index was out of range. Must be non-negative and less than or equal to size.</value>
- </data>
<data name="ArgumentOutOfRange_BadHourMinuteSecond" xml:space="preserve">
<value>Hour, Minute, and Second parameters describe an un-representable DateTime.</value>
</data>
@@ -3185,6 +3182,9 @@
<data name="PlatformNotSupported_WinRT" xml:space="preserve">
<value>Windows Runtime is not supported on this operating system.</value>
</data>
+ <data name="PlatformNotSupported_OverlappedIO" xml:space="preserve">
+ <value>This API is specific to the way in which Windows handles asynchronous I/O, and is not supported on this platform.</value>
+ </data>
<data name="Policy_CannotLoadSemiTrustAssembliesDuringInit" xml:space="preserve">
<value>All assemblies loaded as part of AppDomain initialization must be fully trusted.</value>
</data>
@@ -3287,6 +3287,9 @@
<data name="Serialization_DateTimeTicksOutOfRange" xml:space="preserve">
<value>Invalid serialized DateTime data. Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks.</value>
</data>
+ <data name="Serialization_DelegatesNotSupported" xml:space="preserve">
+ <value>Serializing delegates is not supported on this platform.</value>
+ </data>
<data name="Serialization_InsufficientDeserializationState" xml:space="preserve">
<value>Insufficient state to deserialize the object. Missing field '{0}'. More information is needed.</value>
</data>
diff --git a/src/mscorlib/System.Private.CoreLib.csproj b/src/mscorlib/System.Private.CoreLib.csproj
index df86533182..513e002497 100644
--- a/src/mscorlib/System.Private.CoreLib.csproj
+++ b/src/mscorlib/System.Private.CoreLib.csproj
@@ -20,6 +20,7 @@
<!-- This prevents the default MsBuild targets from referencing System.Core.dll -->
<AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
<!-- These prevent the default MsBuild targets from referencing System.dll and mscorlib.dll -->
+ <ExcludeMscorlibFacade>true</ExcludeMscorlibFacade>
<NoStdLib>true</NoStdLib>
<NoCompilerStandardLib>true</NoCompilerStandardLib>
<SubsystemVersion>6.00</SubsystemVersion>
@@ -86,11 +87,9 @@
<PropertyGroup Condition="'$(OsEnvironment)' == 'Unix'">
<DebugType>portable</DebugType>
</PropertyGroup>
-
<PropertyGroup Condition="'$(TargetsOSX)' == 'true'">
<DefineConstants>PLATFORM_OSX;$(DefineConstants)</DefineConstants>
</PropertyGroup>
-
<!-- Assembly attributes -->
<PropertyGroup>
<AssemblyName>System.Private.CoreLib</AssemblyName>
@@ -104,6 +103,7 @@
<AssemblyInfoLines Include="[assembly: System.Security.AllowPartiallyTrustedCallers]" />
<AssemblyInfoLines Include="[assembly: System.Runtime.InteropServices.ComVisible(false)]" />
<AssemblyInfoLines Include="[assembly: System.Resources.NeutralResourcesLanguage(&quot;en-US&quot;)]" />
+ <AssemblyInfoLines Include="[assembly: System.Runtime.InteropServices.DefaultDllImportSearchPathsAttribute(System.Runtime.InteropServices.DllImportSearchPath.AssemblyDirectory | System.Runtime.InteropServices.DllImportSearchPath.System32)]" />
</ItemGroup>
<!--
Helper Paths
@@ -152,7 +152,6 @@
<Compile Include="$(BclSourcesRoot)\System\Runtime\GcSettings.cs" />
</ItemGroup>
<ItemGroup>
- <Compile Include="$(BclSourcesRoot)\System\Collections\ArrayList.cs" />
<Compile Include="$(BclSourcesRoot)\System\Collections\Comparer.cs" />
<Compile Include="$(BclSourcesRoot)\System\Collections\CompatibleComparer.cs" />
<Compile Include="$(BclSourcesRoot)\System\Collections\ListDictionaryInternal.cs" />
@@ -173,6 +172,7 @@
<Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\Marshal.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\MarshalDirectiveException.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\PInvokeMap.cs" />
+ <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\PInvokeMarshal.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\RuntimeEnvironment.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\SEHException.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\SafeBuffer.cs" />
@@ -314,10 +314,9 @@
<Compile Include="$(BclSourcesRoot)\System\IAppDomainPauseManager.cs" />
<Compile Include="$(BclSourcesRoot)\System\AppDomainAttributes.cs" />
<Compile Include="$(BclSourcesRoot)\System\AppDomainUnloadedException.cs" />
- <Compile Include="$(BclSourcesRoot)\System\ArgumentOutOfRangeException.cs" />
<Compile Include="$(BclSourcesRoot)\System\ArgIterator.cs" />
<Compile Include="$(BclSourcesRoot)\System\Attribute.cs" />
- <Compile Include="$(BclSourcesRoot)\System\BadImageFormatException.cs" />
+ <Compile Include="$(BclSourcesRoot)\System\BadImageFormatException.CoreCLR.cs" />
<Compile Include="$(BclSourcesRoot)\System\BitConverter.cs" />
<Compile Include="$(BclSourcesRoot)\System\Boolean.cs" />
<Compile Include="$(BclSourcesRoot)\System\Buffer.cs" />
@@ -326,11 +325,9 @@
<Compile Include="$(BclSourcesRoot)\System\Currency.cs" />
<Compile Include="$(BclSourcesRoot)\System\Decimal.cs" />
<Compile Include="$(BclSourcesRoot)\System\DefaultBinder.CanConvert.cs" />
- <Compile Include="$(BclSourcesRoot)\System\DelegateSerializationHolder.cs" />
<Compile Include="$(BclSourcesRoot)\System\Double.cs" />
<Compile Include="$(BclSourcesRoot)\System\Empty.cs" />
<Compile Include="$(BclSourcesRoot)\System\Enum.cs" />
- <Compile Include="$(BclSourcesRoot)\System\DllNotFoundException.cs" />
<Compile Include="$(BclSourcesRoot)\System\Environment.cs" />
<Compile Include="$(BclSourcesRoot)\System\GC.cs" />
<Compile Include="$(BclSourcesRoot)\System\Guid.cs" />
@@ -347,10 +344,7 @@
<Compile Include="$(BclSourcesRoot)\System\MissingMemberException.cs" />
<Compile Include="$(BclSourcesRoot)\System\NonSerializedAttribute.cs" />
<Compile Include="$(BclSourcesRoot)\System\Number.cs" />
- <Compile Include="$(BclSourcesRoot)\System\OperatingSystem.cs" />
- <Compile Include="$(BclSourcesRoot)\System\OperationCanceledException.cs" />
<Compile Include="$(BclSourcesRoot)\System\ParseNumbers.cs" />
- <Compile Include="$(BclSourcesRoot)\System\PlatformID.cs" />
<Compile Include="$(BclSourcesRoot)\System\ResId.cs" />
<Compile Include="$(BclSourcesRoot)\System\RtType.cs" />
<Compile Include="$(BclSourcesRoot)\System\RuntimeArgumentHandle.cs" />
@@ -403,7 +397,6 @@
<Compile Include="$(BclSourcesRoot)\System\Reflection\MdFieldInfo.cs" />
<Compile Include="$(BclSourcesRoot)\System\Reflection\MdImport.cs" />
<Compile Include="$(BclSourcesRoot)\System\Reflection\MemberInfo.Internal.cs" />
- <Compile Include="$(BclSourcesRoot)\System\Reflection\MemberSerializationStringGenerator.cs" />
<Compile Include="$(BclSourcesRoot)\System\Reflection\MethodBase.CoreCLR.cs" />
<Compile Include="$(BclSourcesRoot)\System\Reflection\MethodBody.cs" />
<Compile Include="$(BclSourcesRoot)\System\Reflection\RtFieldInfo.cs" />
@@ -478,10 +471,7 @@
<Compile Include="$(BclSourcesRoot)\System\Globalization\GregorianCalendar.cs" />
<Compile Include="$(BclSourcesRoot)\System\Globalization\GregorianCalendarHelper.cs" />
<Compile Include="$(BclSourcesRoot)\System\Globalization\IdnMapping.cs" />
- <Compile Include="$(BclSourcesRoot)\System\Globalization\NumberFormatInfo.cs" />
<Compile Include="$(BclSourcesRoot)\System\Globalization\RegionInfo.cs" />
- <Compile Include="$(BclSourcesRoot)\System\Globalization\SortKey.cs" />
- <Compile Include="$(BclSourcesRoot)\System\Globalization\StringInfo.cs" />
<Compile Include="$(BclSourcesRoot)\System\Globalization\TextElementEnumerator.cs" />
<Compile Include="$(BclSourcesRoot)\System\Globalization\TextInfo.cs" />
<Compile Include="$(BclSourcesRoot)\System\Globalization\TimeSpanFormat.cs" />
@@ -499,6 +489,7 @@
<Compile Include="$(BclSourcesRoot)\System\Threading\Monitor.cs" />
<Compile Include="$(BclSourcesRoot)\System\Threading\Mutex.cs" />
<Compile Include="$(BclSourcesRoot)\System\Threading\Overlapped.cs" />
+ <Compile Include="$(BclSourcesRoot)\System\Threading\PinnableBufferCache.cs" />
<Compile Include="$(BclSourcesRoot)\System\Threading\Semaphore.cs" />
<Compile Include="$(BclSourcesRoot)\System\Threading\Thread.cs" />
<Compile Include="$(BclSourcesRoot)\System\Threading\ThreadInterruptedException.cs" />
@@ -546,17 +537,13 @@
<Compile Include="$(BclSourcesRoot)\System\IO\Directory.cs" />
<Compile Include="$(BclSourcesRoot)\System\IO\SearchOption.cs" />
<Compile Include="$(BclSourcesRoot)\System\IO\DriveNotFoundException.cs" />
- <Compile Include="$(BclSourcesRoot)\System\IO\EncodingCache.cs" />
<Compile Include="$(BclSourcesRoot)\System\IO\File.cs" />
<Compile Include="$(BclSourcesRoot)\System\IO\FileLoadException.CoreCLR.cs" />
<Compile Include="$(BclSourcesRoot)\System\IO\FileNotFoundException.CoreCLR.cs" />
<Compile Include="$(BclSourcesRoot)\System\IO\IOException.cs" />
<Compile Include="$(BclSourcesRoot)\System\IO\MemoryStream.cs" />
- <Compile Include="$(BclSourcesRoot)\System\IO\PinnedBufferMemoryStream.cs" />
<Compile Include="$(BclSourcesRoot)\System\IO\Stream.cs" />
<Compile Include="$(BclSourcesRoot)\System\IO\UnmanagedMemoryAccessor.cs" />
- <Compile Include="$(BclSourcesRoot)\System\IO\UnmanagedMemoryStream.cs" />
- <Compile Include="$(BclSourcesRoot)\System\IO\UnmanagedMemoryStreamWrapper.cs" />
</ItemGroup>
<ItemGroup>
<Compile Include="$(BclSourcesRoot)\System\Security\DynamicSecurityMethodAttribute.cs" />
@@ -577,6 +564,8 @@
<Compile Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\EventSource_CoreCLR.cs" />
<Compile Condition="'$(FeatureXplatEventSource)' == 'true'" Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\XplatEventLogger.cs" />
<Compile Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\FrameworkEventSource.cs" />
+ <Compile Condition="'$(FeaturePerfTracing)' == 'true'" Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\EventPipe.cs" />
+ <Compile Condition="'$(FeaturePerfTracing)' == 'true'" Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\EventPipeEventProvider.cs" />
</ItemGroup>
<ItemGroup>
<Compile Include="$(BclSourcesRoot)\System\Diagnostics\Contracts\Contracts.cs" />
@@ -602,9 +591,6 @@
<Compile Include="$(BclSourcesRoot)\System\Runtime\Serialization\SerializationInfo.cs" />
</ItemGroup>
<ItemGroup>
- <Compile Include="$(BclSourcesRoot)\System\Runtime\Remoting\ObjectHandle.cs" />
- </ItemGroup>
- <ItemGroup>
<Compile Include="$(BclSourcesRoot)\System\Text\DecoderNLS.cs" />
<Compile Include="$(BclSourcesRoot)\System\Text\DecoderBestFitFallback.cs" />
<Compile Include="$(BclSourcesRoot)\System\Text\DecoderExceptionFallback.cs" />
@@ -635,11 +621,9 @@
<Compile Include="$(BclSourcesRoot)\System\Resources\IResourceGroveler.cs" />
<Compile Include="$(BclSourcesRoot)\System\Resources\LooselyLinkedResourceReference.cs" />
<Compile Include="$(BclSourcesRoot)\System\Resources\ManifestBasedResourceGroveler.cs" />
- <Compile Include="$(BclSourcesRoot)\System\Resources\ResourceFallbackManager.cs" />
<Compile Include="$(BclSourcesRoot)\System\Resources\ResourceManager.cs" />
<Compile Include="$(BclSourcesRoot)\System\Resources\ResourceReader.cs" />
<Compile Include="$(BclSourcesRoot)\System\Resources\ResourceSet.cs" />
- <Compile Include="$(BclSourcesRoot)\System\Resources\RuntimeResourceSet.cs" />
</ItemGroup>
<ItemGroup>
<Compile Include="$(BclSourcesRoot)\System\Nullable.cs" />
@@ -662,36 +646,28 @@
<Compile Include="$(BclSourcesRoot)\Microsoft\Win32\SafeHandles\SafeFindHandle.cs" />
<Compile Include="$(BclSourcesRoot)\Microsoft\Win32\SafeHandles\SafeLibraryHandle.cs" />
<Compile Include="$(BclSourcesRoot)\Microsoft\Win32\SafeHandles\SafeWaitHandle.cs" />
- <Compile Include="$(BclSourcesRoot)\Microsoft\Win32\SafeHandles\Win32SafeHandles.cs" />
<Compile Condition="'$(FeatureWin32Registry)' == 'true'" Include="$(BclSourcesRoot)\Microsoft\Win32\SafeHandles\SafeRegistryHandle.cs" />
</ItemGroup>
<ItemGroup>
<Compile Include="$(BclSourcesRoot)\System\Numerics\Hashing\HashHelpers.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetsUnix)' == 'true'">
- <Compile Include="$(BclSourcesRoot)\Interop\Unix\System.Globalization.Native\Interop.Collation.cs" />
<Compile Include="$(BclSourcesRoot)\Interop\Unix\System.Globalization.Native\Interop.ICU.cs" />
- <Compile Include="$(BclSourcesRoot)\System\Diagnostics\Debug.Unix.cs" />
- <Compile Include="$(BclSourcesRoot)\System\Globalization\CalendarData.Unix.cs" />
<Compile Include="$(BclSourcesRoot)\System\Globalization\CompareInfo.Unix.cs" />
- <Compile Include="$(BclSourcesRoot)\System\Globalization\CultureData.Unix.cs" />
<Compile Include="$(BclSourcesRoot)\System\Globalization\CultureInfo.Unix.cs" />
<Compile Include="$(BclSourcesRoot)\System\Globalization\EncodingTable.Unix.cs" />
<Compile Include="$(BclSourcesRoot)\System\Globalization\EncodingDataItem.Unix.cs" />
<Compile Include="$(BclSourcesRoot)\System\Globalization\GlobalizationMode.Unix.cs" />
- <Compile Include="$(BclSourcesRoot)\System\Globalization\HijriCalendar.Unix.cs" />
- <Compile Include="$(BclSourcesRoot)\System\Globalization\IdnMapping.Unix.cs" />
- <Compile Include="$(BclSourcesRoot)\System\Globalization\JapaneseCalendar.Unix.cs" />
<Compile Include="$(BclSourcesRoot)\System\Globalization\TextInfo.Unix.cs" />
<Compile Include="$(BclSourcesRoot)\System\IO\FileSystemEnumerable.cs" />
<Compile Include="$(BclSourcesRoot)\System\IO\TextReader.cs" />
<Compile Include="$(BclSourcesRoot)\System\IO\StreamReader.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\Versioning\CompatibilitySwitch.cs" />
<Compile Include="$(BclSourcesRoot)\System\Text\Normalization.Unix.cs" />
+ <Compile Include="$(BclSourcesRoot)\System\Threading\ClrThreadPoolBoundHandle.Unix.cs" />
<Compile Include="$(BclSourcesRoot)\System\TimeZoneInfo.Unix.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetsWindows)' == 'true'">
- <Compile Include="$(BclSourcesRoot)\Interop\Windows\kernel32\Interop.Globalization.cs" />
<Compile Include="$(BclSourcesRoot)\Interop\Windows\Normaliz\Interop.Idna.cs" />
<Compile Include="$(BclSourcesRoot)\Interop\Windows\Normaliz\Interop.Normalization.cs" />
<Compile Include="$(BclSourcesRoot)\System\Diagnostics\Debug.Windows.cs" />
@@ -700,11 +676,10 @@
<Compile Include="$(BclSourcesRoot)\System\Globalization\CultureData.Windows.cs" />
<Compile Include="$(BclSourcesRoot)\System\Globalization\CultureInfo.Windows.cs" />
<Compile Include="$(BclSourcesRoot)\System\Globalization\GlobalizationMode.Windows.cs" />
- <Compile Include="$(BclSourcesRoot)\System\Globalization\HijriCalendar.Win32.cs" />
<Compile Include="$(BclSourcesRoot)\System\Globalization\IdnMapping.Windows.cs" />
- <Compile Include="$(BclSourcesRoot)\System\Globalization\JapaneseCalendar.Win32.cs" />
<Compile Include="$(BclSourcesRoot)\System\Globalization\TextInfo.Windows.cs" />
<Compile Include="$(BclSourcesRoot)\System\Text\Normalization.Windows.cs" />
+ <Compile Include="$(BclSourcesRoot)\System\Threading\ClrThreadPoolBoundHandle.Windows.cs" />
<Compile Include="$(BclSourcesRoot)\System\TimeZoneInfo.Win32.cs" />
</ItemGroup>
<!-- Include additional sources shared files in the compilation -->
@@ -713,7 +688,6 @@
<Compile Include="$(CommonPath)\Preprocessed\AssemblyRefs.g.cs" />
<!-- These files are shared with other framework components and don't live the same folder as the rest of them-->
<Compile Include="$(CommonPath)\NotImplemented.cs" />
- <Compile Include="$(CommonPath)\PinnableBufferCache.cs" />
<Compile Include="$(CommonPath)\System\SR.cs" />
<!-- Include Internals visible to file in the compilation -->
<Compile Include="$(BclSourcesRoot)\mscorlib.Friends.cs" />
@@ -753,9 +727,11 @@
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup>
<!-- Overwrite the key that we are going to use for signing -->
- <AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)Tools\Signing\mscorlib.snk</AssemblyOriginatorKeyFile>
+ <AssemblyOriginatorKeyFile>$(ToolsDir)SilverlightPlatformPublicKey.snk</AssemblyOriginatorKeyFile>
+ <!-- Don't need a strong name signature because we only ship the native image -->
+ <StrongNameSig>None</StrongNameSig>
<!-- Use a different nativeresource file to avoid conflicts with mscorlib-->
<Win32Resource Condition="'$(GenerateNativeVersionInfo)'=='true'">$(IntermediateOutputPath)\System.Private.CoreLib.res</Win32Resource>
</PropertyGroup>
<Import Project="GenerateCompilerResponseFile.targets" />
-</Project>
+</Project> \ No newline at end of file
diff --git a/src/mscorlib/Tools/Signing/mscorlib.snk b/src/mscorlib/Tools/Signing/mscorlib.snk
deleted file mode 100644
index 60146e8891..0000000000
--- a/src/mscorlib/Tools/Signing/mscorlib.snk
+++ /dev/null
Binary files differ
diff --git a/src/mscorlib/src/Interop/Unix/System.Globalization.Native/Interop.Collation.cs b/src/mscorlib/shared/Interop/Unix/System.Globalization.Native/Interop.Collation.cs
index fe14560a3a..79aedd74d3 100644
--- a/src/mscorlib/src/Interop/Unix/System.Globalization.Native/Interop.Collation.cs
+++ b/src/mscorlib/shared/Interop/Unix/System.Globalization.Native/Interop.Collation.cs
@@ -3,7 +3,6 @@
// See the LICENSE file in the project root for more information.
using System;
-using System.Diagnostics;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Security;
@@ -61,8 +60,6 @@ internal static partial class Interop
protected override bool ReleaseHandle()
{
- Debug.Assert(!GlobalizationMode.Invariant);
-
CloseSortHandle(handle);
SetHandle(IntPtr.Zero);
return true;
diff --git a/src/mscorlib/shared/Interop/Windows/Interop.Libraries.cs b/src/mscorlib/shared/Interop/Windows/Interop.Libraries.cs
index 58bb12d637..bf07a6815b 100644
--- a/src/mscorlib/shared/Interop/Windows/Interop.Libraries.cs
+++ b/src/mscorlib/shared/Interop/Windows/Interop.Libraries.cs
@@ -9,7 +9,6 @@ internal static partial class Interop
internal const string BCrypt = "BCrypt.dll";
internal const string Crypt32 = "crypt32.dll";
internal const string Kernel32 = "kernel32.dll";
- internal const string NtDll = "ntdll.dll";
internal const string OleAut32 = "oleaut32.dll";
}
}
diff --git a/src/mscorlib/src/Interop/Windows/kernel32/Interop.Globalization.cs b/src/mscorlib/shared/Interop/Windows/Kernel32/Interop.Globalization.cs
index 2bb349d670..7d3287fe1a 100644
--- a/src/mscorlib/src/Interop/Windows/kernel32/Interop.Globalization.cs
+++ b/src/mscorlib/shared/Interop/Windows/Kernel32/Interop.Globalization.cs
@@ -89,20 +89,20 @@ internal static partial class Interop
internal static extern bool GetUserPreferredUILanguages(uint dwFlags, out uint pulNumLanguages, char [] pwszLanguagesBuffer, ref uint pcchLanguagesBuffer);
[DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
- internal static extern int GetLocaleInfoEx(string lpLocaleName, uint LCType, IntPtr lpLCData, int cchData);
+ internal static extern int GetLocaleInfoEx(string lpLocaleName, uint LCType, void* lpLCData, int cchData);
[DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
- internal extern static bool EnumSystemLocalesEx(EnumLocalesProcEx lpLocaleEnumProcEx, uint dwFlags, IntPtr lParam, IntPtr reserved);
+ internal extern static bool EnumSystemLocalesEx(EnumLocalesProcEx lpLocaleEnumProcEx, uint dwFlags, void* lParam, IntPtr reserved);
- internal delegate BOOL EnumLocalesProcEx(IntPtr lpLocaleString, uint dwFlags, IntPtr lParam);
+ internal delegate BOOL EnumLocalesProcEx(char* lpLocaleString, uint dwFlags, void* lParam);
[DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
internal extern static int ResolveLocaleName(string lpNameToResolve, char* lpLocaleName, int cchLocaleName);
[DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
- internal extern static bool EnumTimeFormatsEx(EnumTimeFormatsProcEx lpTimeFmtEnumProcEx, string lpLocaleName, uint dwFlags, IntPtr lParam);
+ internal extern static bool EnumTimeFormatsEx(EnumTimeFormatsProcEx lpTimeFmtEnumProcEx, string lpLocaleName, uint dwFlags, void* lParam);
- internal delegate BOOL EnumTimeFormatsProcEx(IntPtr lpTimeFormatString, IntPtr lParam);
+ internal delegate BOOL EnumTimeFormatsProcEx(char* lpTimeFormatString, void* lParam);
[DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
internal extern static int GetCalendarInfoEx(string lpLocaleName, uint Calendar, IntPtr lpReserved, uint CalType, IntPtr lpCalData, int cchData, out int lpValue);
@@ -111,12 +111,12 @@ internal static partial class Interop
internal extern static int GetCalendarInfoEx(string lpLocaleName, uint Calendar, IntPtr lpReserved, uint CalType, IntPtr lpCalData, int cchData, IntPtr lpValue);
[DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
- internal extern static bool EnumCalendarInfoExEx(EnumCalendarInfoProcExEx pCalInfoEnumProcExEx, string lpLocaleName, uint Calendar, string lpReserved, uint CalType, IntPtr lParam);
+ internal extern static bool EnumCalendarInfoExEx(EnumCalendarInfoProcExEx pCalInfoEnumProcExEx, string lpLocaleName, uint Calendar, string lpReserved, uint CalType, void* lParam);
- internal delegate BOOL EnumCalendarInfoProcExEx(IntPtr lpCalendarInfoString, uint Calendar, IntPtr lpReserved, IntPtr lParam);
+ internal delegate BOOL EnumCalendarInfoProcExEx(char* lpCalendarInfoString, uint Calendar, IntPtr lpReserved, void* lParam);
[StructLayout(LayoutKind.Sequential)]
- internal struct NlsVersionInfoEx
+ internal struct NlsVersionInfoEx
{
internal int dwNLSVersionInfoSize;
internal int dwNLSVersion;
diff --git a/src/mscorlib/shared/Interop/Windows/Kernel32/Interop.SetErrorMode.cs b/src/mscorlib/shared/Interop/Windows/Kernel32/Interop.SetThreadErrorMode.cs
index 276f49c519..123eb75d7b 100644
--- a/src/mscorlib/shared/Interop/Windows/Kernel32/Interop.SetErrorMode.cs
+++ b/src/mscorlib/shared/Interop/Windows/Kernel32/Interop.SetThreadErrorMode.cs
@@ -8,8 +8,8 @@ internal partial class Interop
{
internal partial class Kernel32
{
- [DllImport(Libraries.Kernel32, SetLastError = false, EntryPoint = "SetErrorMode", ExactSpelling = true)]
- internal static extern uint SetErrorMode(uint newMode);
+ [DllImport(Libraries.Kernel32, SetLastError = true, ExactSpelling = true)]
+ internal static extern bool SetThreadErrorMode(uint dwNewMode, out uint lpOldMode);
internal const uint SEM_FAILCRITICALERRORS = 1;
}
diff --git a/src/mscorlib/shared/Interop/Windows/NtDll/Interop.ZeroMemory.cs b/src/mscorlib/shared/Interop/Windows/NtDll/Interop.ZeroMemory.cs
deleted file mode 100644
index 9bf7321f2a..0000000000
--- a/src/mscorlib/shared/Interop/Windows/NtDll/Interop.ZeroMemory.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-using System;
-using System.Runtime.InteropServices;
-using System.Security;
-
-internal partial class Interop
-{
- internal partial class NtDll
- {
- [DllImport(Libraries.NtDll, CharSet = CharSet.Unicode, EntryPoint = "RtlZeroMemory")]
- internal static extern void ZeroMemory(IntPtr address, UIntPtr length);
- }
-}
diff --git a/src/mscorlib/shared/Microsoft/Win32/SafeHandles/SafeFileHandle.Unix.cs b/src/mscorlib/shared/Microsoft/Win32/SafeHandles/SafeFileHandle.Unix.cs
index d13b536204..f28f44fdad 100644
--- a/src/mscorlib/shared/Microsoft/Win32/SafeHandles/SafeFileHandle.Unix.cs
+++ b/src/mscorlib/shared/Microsoft/Win32/SafeHandles/SafeFileHandle.Unix.cs
@@ -4,6 +4,7 @@
using System;
using System.Diagnostics;
+using System.IO;
using System.Runtime.InteropServices;
namespace Microsoft.Win32.SafeHandles
@@ -38,18 +39,30 @@ namespace Microsoft.Win32.SafeHandles
internal static SafeFileHandle Open(string path, Interop.Sys.OpenFlags flags, int mode)
{
Debug.Assert(path != null);
+ SafeFileHandle handle = Interop.Sys.Open(path, flags, mode);
- // If we fail to open the file due to a path not existing, we need to know whether to blame
- // the file itself or its directory. If we're creating the file, then we blame the directory,
- // otherwise we blame the file.
- bool enoentDueToDirectory = (flags & Interop.Sys.OpenFlags.O_CREAT) != 0;
-
- // Open the file.
- SafeFileHandle handle = Interop.CheckIo(
- Interop.Sys.Open(path, flags, mode),
- path,
- isDirectory: enoentDueToDirectory,
- errorRewriter: e => (e.Error == Interop.Error.EISDIR) ? Interop.Error.EACCES.Info() : e);
+ if (handle.IsInvalid)
+ {
+ handle.Dispose();
+ Interop.ErrorInfo error = Interop.Sys.GetLastErrorInfo();
+
+ // If we fail to open the file due to a path not existing, we need to know whether to blame
+ // the file itself or its directory. If we're creating the file, then we blame the directory,
+ // otherwise we blame the file.
+ //
+ // When opening, we need to align with Windows, which considers a missing path to be
+ // FileNotFound only if the containing directory exists.
+
+ bool isDirectory = (error.Error == Interop.Error.ENOENT) &&
+ ((flags & Interop.Sys.OpenFlags.O_CREAT) != 0
+ || !DirectoryExists(Path.GetDirectoryName(PathInternal.TrimEndingDirectorySeparator(path))));
+
+ Interop.CheckIo(
+ error.Error,
+ path,
+ isDirectory,
+ errorRewriter: e => (e.Error == Interop.Error.EISDIR) ? Interop.Error.EACCES.Info() : e);
+ }
// Make sure it's not a directory; we do this after opening it once we have a file descriptor
// to avoid race conditions.
@@ -68,6 +81,31 @@ namespace Microsoft.Win32.SafeHandles
return handle;
}
+ private static bool DirectoryExists(string fullPath)
+ {
+ int fileType = Interop.Sys.FileTypes.S_IFDIR;
+
+ Interop.Sys.FileStatus fileinfo;
+ Interop.ErrorInfo errorInfo = default(Interop.ErrorInfo);
+
+ // First use stat, as we want to follow symlinks. If that fails, it could be because the symlink
+ // is broken, we don't have permissions, etc., in which case fall back to using LStat to evaluate
+ // based on the symlink itself.
+ if (Interop.Sys.Stat(fullPath, out fileinfo) < 0 &&
+ Interop.Sys.LStat(fullPath, out fileinfo) < 0)
+ {
+ errorInfo = Interop.Sys.GetLastErrorInfo();
+ return false;
+ }
+
+ // Something exists at this path. If the caller is asking for a directory, return true if it's
+ // a directory and false for everything else. If the caller is asking for a file, return false for
+ // a directory and true for everything else.
+ return
+ (fileType == Interop.Sys.FileTypes.S_IFDIR) ==
+ ((fileinfo.Mode & Interop.Sys.FileTypes.S_IFMT) == Interop.Sys.FileTypes.S_IFDIR);
+ }
+
/// <summary>Opens a SafeFileHandle for a file descriptor created by a provided delegate.</summary>
/// <param name="fdFunc">
/// The function that creates the file descriptor. Returns the file descriptor on success, or an invalid
diff --git a/src/mscorlib/shared/Microsoft/Win32/SafeHandles/SafeHandleMinusOneIsInvalid.cs b/src/mscorlib/shared/Microsoft/Win32/SafeHandles/SafeHandleMinusOneIsInvalid.cs
new file mode 100644
index 0000000000..5415f2c35d
--- /dev/null
+++ b/src/mscorlib/shared/Microsoft/Win32/SafeHandles/SafeHandleMinusOneIsInvalid.cs
@@ -0,0 +1,19 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Microsoft.Win32.SafeHandles
+{
+ // Class of safe handle which uses only -1 as an invalid handle.
+ public abstract class SafeHandleMinusOneIsInvalid : SafeHandle
+ {
+ protected SafeHandleMinusOneIsInvalid(bool ownsHandle) : base(new IntPtr(-1), ownsHandle)
+ {
+ }
+
+ public override bool IsInvalid => handle == new IntPtr(-1);
+ }
+}
diff --git a/src/mscorlib/shared/Microsoft/Win32/SafeHandles/SafeHandleZeroOrMinusOneIsInvalid.cs b/src/mscorlib/shared/Microsoft/Win32/SafeHandles/SafeHandleZeroOrMinusOneIsInvalid.cs
new file mode 100644
index 0000000000..8d0220bf90
--- /dev/null
+++ b/src/mscorlib/shared/Microsoft/Win32/SafeHandles/SafeHandleZeroOrMinusOneIsInvalid.cs
@@ -0,0 +1,19 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Microsoft.Win32.SafeHandles
+{
+ // Class of safe handle which uses 0 or -1 as an invalid handle.
+ public abstract class SafeHandleZeroOrMinusOneIsInvalid : SafeHandle
+ {
+ protected SafeHandleZeroOrMinusOneIsInvalid(bool ownsHandle) : base(IntPtr.Zero, ownsHandle)
+ {
+ }
+
+ public override bool IsInvalid => handle == IntPtr.Zero || handle == new IntPtr(-1);
+ }
+}
diff --git a/src/mscorlib/shared/System.Private.CoreLib.Shared.projitems b/src/mscorlib/shared/System.Private.CoreLib.Shared.projitems
index 3443a2b339..e409be0364 100644
--- a/src/mscorlib/shared/System.Private.CoreLib.Shared.projitems
+++ b/src/mscorlib/shared/System.Private.CoreLib.Shared.projitems
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
@@ -16,10 +16,13 @@
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)Microsoft\Win32\SafeHandles\CriticalHandleMinusOneIsInvalid.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Microsoft\Win32\SafeHandles\CriticalHandleZeroOrMinusOneIsInvalid.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Microsoft\Win32\SafeHandles\SafeHandleMinusOneIsInvalid.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Microsoft\Win32\SafeHandles\SafeHandleZeroOrMinusOneIsInvalid.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Action.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\ApplicationException.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\ArgumentException.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\ArgumentNullException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\ArgumentOutOfRangeException.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\ArithmeticException.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\ArrayTypeMismatchException.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\AssemblyLoadEventArgs.cs" />
@@ -27,6 +30,7 @@
<Compile Include="$(MSBuildThisFileDirectory)System\AsyncCallback.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\AttributeTargets.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\AttributeUsageAttribute.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\BadImageFormatException.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Buffers\ArrayPool.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Buffers\ConfigurableArrayPool.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Buffers\TlsOverPerCoreLockedStacksArrayPool.cs"/>
@@ -74,6 +78,7 @@
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics\ConditionalAttribute.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics\Debug.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\DivideByZeroException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\DllNotFoundException.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\DuplicateWaitObjectException.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\EntryPointNotFoundException.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\EventArgs.cs"/>
@@ -107,9 +112,12 @@
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\JulianCalendar.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\KoreanCalendar.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\KoreanLunisolarCalendar.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Globalization\NumberFormatInfo.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\NumberStyles.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\PersianCalendar.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Globalization\SortKey.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\SortVersion.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Globalization\StringInfo.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\TaiwanCalendar.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\TaiwanLunisolarCalendar.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\ThaiBuddhistCalendar.cs"/>
@@ -132,6 +140,7 @@
<Compile Include="$(MSBuildThisFileDirectory)System\InvalidProgramException.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\InvalidTimeZoneException.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\IO\DirectoryNotFoundException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\IO\EncodingCache.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\IO\EndOfStreamException.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\IO\Error.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\IO\FileAccess.cs"/>
@@ -144,8 +153,11 @@
<Compile Include="$(MSBuildThisFileDirectory)System\IO\Path.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\IO\PathInternal.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\IO\PathTooLongException.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\IO\PinnedBufferMemoryStream.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\IO\SeekOrigin.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\IO\StreamHelpers.CopyValidation.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\IO\UnmanagedMemoryStream.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\IO\UnmanagedMemoryStreamWrapper.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\IObservable.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\IObserver.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\IProgress.cs"/>
@@ -162,6 +174,7 @@
<Compile Include="$(MSBuildThisFileDirectory)System\NullReferenceException.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\ObjectDisposedException.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\ObsoleteAttribute.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\OperationCanceledException.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\OverflowException.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\ParamArrayAttribute.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\ParamsArray.cs"/>
@@ -188,6 +201,7 @@
<Compile Include="$(MSBuildThisFileDirectory)System\Reflection\AssemblyKeyNameAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Reflection\AssemblyMetadataAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Reflection\AssemblyNameFlags.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)System\Reflection\AssemblyNameFormatter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Reflection\AssemblyProductAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Reflection\AssemblySignatureKeyAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Reflection\AssemblyTitleAttribute.cs" />
@@ -215,7 +229,6 @@
<Compile Include="$(MSBuildThisFileDirectory)System\Reflection\ManifestResourceInfo.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Reflection\MemberFilter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Reflection\MemberInfo.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)System\Reflection\MemberInfoSerializationHolder.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Reflection\MemberTypes.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Reflection\MethodAttributes.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Reflection\MethodBase.cs" />
@@ -252,7 +265,9 @@
<Compile Include="$(MSBuildThisFileDirectory)System\Resources\MissingManifestResourceException.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Resources\MissingSatelliteAssemblyException.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Resources\NeutralResourcesLanguageAttribute.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Resources\ResourceFallbackManager.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Resources\ResourceTypeCode.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Resources\RuntimeResourceSet.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Resources\SatelliteContractVersionAttribute.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Resources\UltimateResourceFallbackLocation.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\AccessedThroughPropertyAttribute.cs"/>
@@ -274,9 +289,10 @@
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\FormattableStringFactory.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\IAsyncStateMachine.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\IndexerNameAttribute.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\InternalsVisibleToAttribute.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\INotifyCompletion.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\InternalsVisibleToAttribute.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\IsConst.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\IsByRefLikeAttribute.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\IsVolatile.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\IteratorStateMachineAttribute.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\ITuple.cs"/>
@@ -354,9 +370,9 @@
<Compile Include="$(MSBuildThisFileDirectory)System\Text\EncodingProvider.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Text\Normalization.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Text\StringBuilder.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Text\UnicodeEncoding.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Text\UTF32Encoding.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Text\UTF8Encoding.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)System\Text\UnicodeEncoding.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\ThreadAttributes.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\AbandonedMutexException.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\ApartmentState.cs"/>
@@ -399,7 +415,6 @@
<Compile Include="$(MSBuildThisFileDirectory)System\UnauthorizedAccessException.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\UnhandledExceptionEventArgs.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\UnhandledExceptionEventHandler.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)System\UnitySerializationHolder.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\ValueTuple.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Version.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Void.cs"/>
@@ -411,6 +426,7 @@
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics\Tracing\EventProvider.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics\Tracing\EventSource.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics\Tracing\EventSourceException.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics\Tracing\IEventProvider.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics\Tracing\StubEnvironment.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics\Tracing\Winmeta.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics\Tracing\TraceLogging\ArrayTypeInfo.cs" />
@@ -465,6 +481,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.GetLongPathNameW.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.GetTempFileNameW.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.GetTempPathW.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.Globalization.cs" Condition="'$(EnableDummyGlobalizationImplementation)' != 'true'"/>
<Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.LockFile.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.OutputDebugString.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.ReadFile_SafeHandle_IntPtr.cs"/>
@@ -472,16 +489,19 @@
<Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.SECURITY_ATTRIBUTES.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.SecurityOptions.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.SetEndOfFile.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.SetErrorMode.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.SetThreadErrorMode.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.SetFilePointerEx.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.WideCharToMultiByte.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.WriteFile_SafeHandle_IntPtr.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.WriteFile_SafeHandle_NativeOverlapped.cs"/>
- <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\NtDll\Interop.ZeroMemory.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\OleAut32\Interop.SysAllocStringLen.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\OleAut32\Interop.SysFreeString.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\OleAut32\Interop.SysStringLen.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Microsoft\Win32\SafeHandles\SafeFileHandle.Windows.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)System\Globalization\HijriCalendar.Win32.cs" Condition="'$(IsProjectNLibrary)' != 'true' and '$(EnableDummyGlobalizationImplementation)' != 'true'"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Globalization\HijriCalendar.WinRT.cs" Condition="'$(IsProjectNLibrary)' == 'true'"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Globalization\JapaneseCalendar.Win32.cs" Condition="'$(IsProjectNLibrary)' != 'true' and '$(EnableDummyGlobalizationImplementation)' != 'true'"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Globalization\JapaneseCalendar.WinRT.cs" Condition="'$(IsProjectNLibrary)' == 'true'"/>
<Compile Include="$(MSBuildThisFileDirectory)System\IO\FileStream.Win32.cs" Condition="'$(IsProjectNLibrary)' != 'true'" />
<Compile Include="$(MSBuildThisFileDirectory)System\IO\FileStream.Windows.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IO\FileStream.WinRT.cs" Condition="'$(IsProjectNLibrary)' == 'true'" />
@@ -500,6 +520,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Interop\Unix\Interop.Libraries.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Interop\Unix\System.Globalization.Native\Interop.Calendar.cs" Condition="'$(EnableDummyGlobalizationImplementation)' != 'true'"/>
<Compile Include="$(MSBuildThisFileDirectory)Interop\Unix\System.Globalization.Native\Interop.Casing.cs" Condition="'$(EnableDummyGlobalizationImplementation)' != 'true'"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Unix\System.Globalization.Native\Interop.Collation.cs" Condition="'$(EnableDummyGlobalizationImplementation)' != 'true'"/>
<Compile Include="$(MSBuildThisFileDirectory)Interop\Unix\System.Globalization.Native\Interop.Idna.cs" Condition="'$(EnableDummyGlobalizationImplementation)' != 'true'"/>
<Compile Include="$(MSBuildThisFileDirectory)Interop\Unix\System.Globalization.Native\Interop.Locale.cs" Condition="'$(EnableDummyGlobalizationImplementation)' != 'true'"/>
<Compile Include="$(MSBuildThisFileDirectory)Interop\Unix\System.Globalization.Native\Interop.Normalization.cs" Condition="'$(EnableDummyGlobalizationImplementation)' != 'true'"/>
@@ -526,7 +547,13 @@
<Compile Include="$(MSBuildThisFileDirectory)Interop\Unix\System.Native\Interop.Unlink.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Interop\Unix\System.Native\Interop.Write.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Microsoft\Win32\SafeHandles\SafeFileHandle.Unix.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics\Debug.Unix.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Globalization\CalendarData.Unix.cs" Condition="'$(EnableDummyGlobalizationImplementation)' != 'true'"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Globalization\CultureData.Unix.cs" Condition="'$(EnableDummyGlobalizationImplementation)' != 'true'"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Globalization\HijriCalendar.Unix.cs" Condition="'$(EnableDummyGlobalizationImplementation)' != 'true'"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Globalization\IdnMapping.Unix.cs" Condition="'$(EnableDummyGlobalizationImplementation)' != 'true'"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\LocaleData.Unix.cs" Condition="'$(EnableDummyGlobalizationImplementation)' != 'true'"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\Globalization\JapaneseCalendar.Unix.cs" Condition="'$(EnableDummyGlobalizationImplementation)' != 'true'"/>
<Compile Include="$(MSBuildThisFileDirectory)System\IO\FileStream.OSX.cs" Condition="'$(TargetsOSX)' == 'true'"/>
<Compile Include="$(MSBuildThisFileDirectory)System\IO\FileStream.Linux.cs" Condition="'$(TargetsOSX)' != 'true'"/>
<Compile Include="$(MSBuildThisFileDirectory)System\IO\FileStream.Unix.cs"/>
diff --git a/src/mscorlib/shared/System/ApplicationException.cs b/src/mscorlib/shared/System/ApplicationException.cs
index 900feb57f9..cb98902de1 100644
--- a/src/mscorlib/shared/System/ApplicationException.cs
+++ b/src/mscorlib/shared/System/ApplicationException.cs
@@ -23,7 +23,6 @@ namespace System
// ApplicationException extends but adds no new functionality to
// RecoverableException.
//
- [Serializable]
public class ApplicationException : Exception
{
// Creates a new ApplicationException with its message string set to
@@ -51,6 +50,9 @@ namespace System
HResult = __HResults.COR_E_APPLICATION;
}
- protected ApplicationException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ protected ApplicationException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ throw new PlatformNotSupportedException();
+ }
}
}
diff --git a/src/mscorlib/shared/System/ArgumentException.cs b/src/mscorlib/shared/System/ArgumentException.cs
index 96afbe10d9..de2d775c84 100644
--- a/src/mscorlib/shared/System/ArgumentException.cs
+++ b/src/mscorlib/shared/System/ArgumentException.cs
@@ -20,7 +20,6 @@ namespace System
// the contract of the method. Ideally it should give a meaningful error
// message describing what was wrong and which parameter is incorrect.
//
- [Serializable]
public class ArgumentException : SystemException
{
private String _paramName;
@@ -65,13 +64,12 @@ namespace System
protected ArgumentException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
- _paramName = info.GetString("ParamName");
+ throw new PlatformNotSupportedException();
}
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
base.GetObjectData(info, context);
- info.AddValue("ParamName", _paramName, typeof(String));
}
public override String Message
diff --git a/src/mscorlib/shared/System/ArgumentNullException.cs b/src/mscorlib/shared/System/ArgumentNullException.cs
index 3a86223ccf..74b39fed8e 100644
--- a/src/mscorlib/shared/System/ArgumentNullException.cs
+++ b/src/mscorlib/shared/System/ArgumentNullException.cs
@@ -18,7 +18,6 @@ namespace System
// The ArgumentException is thrown when an argument
// is null when it shouldn't be.
//
- [Serializable]
public class ArgumentNullException : ArgumentException
{
// Creates a new ArgumentNullException with its message
@@ -48,6 +47,9 @@ namespace System
HResult = __HResults.E_POINTER;
}
- protected ArgumentNullException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ protected ArgumentNullException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ throw new PlatformNotSupportedException();
+ }
}
}
diff --git a/src/mscorlib/src/System/ArgumentOutOfRangeException.cs b/src/mscorlib/shared/System/ArgumentOutOfRangeException.cs
index 90837810d1..4721a503b6 100644
--- a/src/mscorlib/src/System/ArgumentOutOfRangeException.cs
+++ b/src/mscorlib/shared/System/ArgumentOutOfRangeException.cs
@@ -11,43 +11,27 @@
**
=============================================================================*/
-
-using System;
-using System.Runtime.Remoting;
-using System.Runtime.Serialization;
using System.Globalization;
-using System.Diagnostics.Contracts;
+using System.Runtime.Serialization;
namespace System
{
// The ArgumentOutOfRangeException is thrown when an argument
// is outside the legal range for that argument.
- [Serializable]
- public class ArgumentOutOfRangeException : ArgumentException, ISerializable
+ public class ArgumentOutOfRangeException : ArgumentException
{
- private static volatile String _rangeMessage;
- private Object m_actualValue;
-
- private static String RangeMessage
- {
- get
- {
- if (_rangeMessage == null)
- _rangeMessage = SR.Arg_ArgumentOutOfRangeException;
- return _rangeMessage;
- }
- }
+ private Object _actualValue;
// Creates a new ArgumentOutOfRangeException with its message
// string set to a default message explaining an argument was out of range.
public ArgumentOutOfRangeException()
- : base(RangeMessage)
+ : base(SR.Arg_ArgumentOutOfRangeException)
{
HResult = __HResults.COR_E_ARGUMENTOUTOFRANGE;
}
public ArgumentOutOfRangeException(String paramName)
- : base(RangeMessage, paramName)
+ : base(SR.Arg_ArgumentOutOfRangeException, paramName)
{
HResult = __HResults.COR_E_ARGUMENTOUTOFRANGE;
}
@@ -70,18 +54,29 @@ namespace System
public ArgumentOutOfRangeException(String paramName, Object actualValue, String message)
: base(message, paramName)
{
- m_actualValue = actualValue;
+ _actualValue = actualValue;
HResult = __HResults.COR_E_ARGUMENTOUTOFRANGE;
}
+ protected ArgumentOutOfRangeException(SerializationInfo info, StreamingContext context)
+ : base(info, context)
+ {
+ throw new PlatformNotSupportedException();
+ }
+
+ public override void GetObjectData(SerializationInfo info, StreamingContext context)
+ {
+ base.GetObjectData(info, context);
+ }
+
public override String Message
{
get
{
String s = base.Message;
- if (m_actualValue != null)
+ if (_actualValue != null)
{
- String valueMessage = SR.Format(SR.ArgumentOutOfRange_ActualValue, m_actualValue.ToString());
+ String valueMessage = SR.Format(SR.ArgumentOutOfRange_ActualValue, _actualValue.ToString());
if (s == null)
return valueMessage;
return s + Environment.NewLine + valueMessage;
@@ -96,23 +91,7 @@ namespace System
// want to avoid sticking printf's in their code.
public virtual Object ActualValue
{
- get { return m_actualValue; }
- }
-
- public override void GetObjectData(SerializationInfo info, StreamingContext context)
- {
- if (info == null)
- {
- throw new ArgumentNullException(nameof(info));
- }
- Contract.EndContractBlock();
- base.GetObjectData(info, context);
- info.AddValue("ActualValue", m_actualValue, typeof(Object));
- }
-
- protected ArgumentOutOfRangeException(SerializationInfo info, StreamingContext context) : base(info, context)
- {
- m_actualValue = info.GetValue("ActualValue", typeof(Object));
+ get { return _actualValue; }
}
}
}
diff --git a/src/mscorlib/shared/System/ArithmeticException.cs b/src/mscorlib/shared/System/ArithmeticException.cs
index 081ba454f5..2c8abe51fa 100644
--- a/src/mscorlib/shared/System/ArithmeticException.cs
+++ b/src/mscorlib/shared/System/ArithmeticException.cs
@@ -18,7 +18,6 @@ namespace System
// The ArithmeticException is thrown when overflow or underflow
// occurs.
//
- [Serializable]
public class ArithmeticException : SystemException
{
// Creates a new ArithmeticException with its message string set to
@@ -46,6 +45,9 @@ namespace System
HResult = __HResults.COR_E_ARITHMETIC;
}
- protected ArithmeticException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ protected ArithmeticException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ throw new PlatformNotSupportedException();
+ }
}
}
diff --git a/src/mscorlib/shared/System/ArrayTypeMismatchException.cs b/src/mscorlib/shared/System/ArrayTypeMismatchException.cs
index 3e941fdf8e..d06a450603 100644
--- a/src/mscorlib/shared/System/ArrayTypeMismatchException.cs
+++ b/src/mscorlib/shared/System/ArrayTypeMismatchException.cs
@@ -18,7 +18,6 @@ namespace System
// The ArrayMismatchException is thrown when an attempt to store
// an object of the wrong type within an array occurs.
//
- [Serializable]
public class ArrayTypeMismatchException : SystemException
{
// Creates a new ArrayMismatchException with its message string set to
@@ -46,6 +45,9 @@ namespace System
HResult = __HResults.COR_E_ARRAYTYPEMISMATCH;
}
- protected ArrayTypeMismatchException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ protected ArrayTypeMismatchException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ throw new PlatformNotSupportedException();
+ }
}
}
diff --git a/src/mscorlib/shared/System/AsyncCallback.cs b/src/mscorlib/shared/System/AsyncCallback.cs
index 5c49535cff..036d44a4b9 100644
--- a/src/mscorlib/shared/System/AsyncCallback.cs
+++ b/src/mscorlib/shared/System/AsyncCallback.cs
@@ -12,6 +12,5 @@
namespace System
{
- [Serializable]
public delegate void AsyncCallback(IAsyncResult ar);
}
diff --git a/src/mscorlib/shared/System/AttributeTargets.cs b/src/mscorlib/shared/System/AttributeTargets.cs
index fdfa4ab730..c33d19e85e 100644
--- a/src/mscorlib/shared/System/AttributeTargets.cs
+++ b/src/mscorlib/shared/System/AttributeTargets.cs
@@ -10,7 +10,6 @@ namespace System
// Enum used to indicate all the elements of the
// VOS it is valid to attach this element to.
[Flags]
- [Serializable]
public enum AttributeTargets
{
Assembly = 0x0001,
diff --git a/src/mscorlib/shared/System/AttributeUsageAttribute.cs b/src/mscorlib/shared/System/AttributeUsageAttribute.cs
index 6f9aeb20f3..219dc43e15 100644
--- a/src/mscorlib/shared/System/AttributeUsageAttribute.cs
+++ b/src/mscorlib/shared/System/AttributeUsageAttribute.cs
@@ -16,7 +16,6 @@ using System.Reflection;
namespace System
{
/* By default, attributes are inherited and multiple attributes are not allowed */
- [Serializable]
[AttributeUsage(AttributeTargets.Class, Inherited = true)]
public sealed class AttributeUsageAttribute : Attribute
{
diff --git a/src/mscorlib/src/System/BadImageFormatException.cs b/src/mscorlib/shared/System/BadImageFormatException.cs
index 42005cccce..6bed5e9b78 100644
--- a/src/mscorlib/src/System/BadImageFormatException.cs
+++ b/src/mscorlib/shared/System/BadImageFormatException.cs
@@ -11,16 +11,13 @@
**
===========================================================*/
+using System.Globalization;
+using System.IO;
+using System.Runtime.Serialization;
+
namespace System
{
- using System;
- using System.Runtime.Serialization;
- using FileLoadException = System.IO.FileLoadException;
- using SecurityException = System.Security.SecurityException;
- using System.Globalization;
-
- [Serializable]
- public class BadImageFormatException : SystemException
+ public partial class BadImageFormatException : SystemException
{
private String _fileName; // The name of the corrupt PE file.
private String _fusionLog; // fusion log (when applicable)
@@ -56,6 +53,17 @@ namespace System
_fileName = fileName;
}
+ protected BadImageFormatException(SerializationInfo info, StreamingContext context)
+ : base(info, context)
+ {
+ throw new PlatformNotSupportedException();
+ }
+
+ public override void GetObjectData(SerializationInfo info, StreamingContext context)
+ {
+ base.GetObjectData(info, context);
+ }
+
public override String Message
{
get
@@ -70,7 +78,7 @@ namespace System
if (_message == null)
{
if ((_fileName == null) &&
- (HResult == System.__HResults.COR_E_EXCEPTION))
+ (HResult == __HResults.COR_E_EXCEPTION))
_message = SR.Arg_BadImageFormatException;
else
@@ -85,7 +93,7 @@ namespace System
public override String ToString()
{
- String s = GetType().FullName + ": " + Message;
+ String s = GetType().ToString() + ": " + Message;
if (_fileName != null && _fileName.Length != 0)
s += Environment.NewLine + SR.Format(SR.IO_FileName_Name, _fileName);
@@ -95,68 +103,22 @@ namespace System
if (StackTrace != null)
s += Environment.NewLine + StackTrace;
- try
- {
- if (FusionLog != null)
- {
- if (s == null)
- s = " ";
- s += Environment.NewLine;
- s += Environment.NewLine;
- s += FusionLog;
- }
- }
- catch (SecurityException)
- {
- }
- return s;
- }
-
- protected BadImageFormatException(SerializationInfo info, StreamingContext context) : base(info, context)
- {
- // Base class constructor will check info != null.
- _fileName = info.GetString("BadImageFormat_FileName");
- try
+ if (_fusionLog != null)
{
- _fusionLog = info.GetString("BadImageFormat_FusionLog");
+ if (s == null)
+ s = " ";
+ s += Environment.NewLine;
+ s += Environment.NewLine;
+ s += _fusionLog;
}
- catch
- {
- _fusionLog = null;
- }
- }
- private BadImageFormatException(String fileName, String fusionLog, int hResult)
- : base(null)
- {
- HResult = hResult;
- _fileName = fileName;
- _fusionLog = fusionLog;
- SetMessageField();
+ return s;
}
public String FusionLog
{
-#pragma warning disable CS0618 // Type or member is obsolete
-#pragma warning restore CS0618 // Type or member is obsolete
get { return _fusionLog; }
}
-
- public override void GetObjectData(SerializationInfo info, StreamingContext context)
- {
- // Serialize data for our base classes. base will verify info != null.
- base.GetObjectData(info, context);
-
- // Serialize data for this class
- info.AddValue("BadImageFormat_FileName", _fileName, typeof(String));
- try
- {
- info.AddValue("BadImageFormat_FusionLog", FusionLog, typeof(String));
- }
- catch (SecurityException)
- {
- }
- }
}
}
diff --git a/src/mscorlib/shared/System/CLSCompliantAttribute.cs b/src/mscorlib/shared/System/CLSCompliantAttribute.cs
index e03600d132..d895b5ac71 100644
--- a/src/mscorlib/shared/System/CLSCompliantAttribute.cs
+++ b/src/mscorlib/shared/System/CLSCompliantAttribute.cs
@@ -13,7 +13,6 @@
namespace System
{
- [Serializable]
[AttributeUsage(AttributeTargets.All, Inherited = true, AllowMultiple = false)]
public sealed class CLSCompliantAttribute : Attribute
{
diff --git a/src/mscorlib/shared/System/Char.cs b/src/mscorlib/shared/System/Char.cs
index 2b3133a669..3fad7a4827 100644
--- a/src/mscorlib/shared/System/Char.cs
+++ b/src/mscorlib/shared/System/Char.cs
@@ -26,7 +26,7 @@ namespace System
//
// Member Variables
//
- internal char m_value;
+ private char m_value; // Do not rename (binary serialization)
//
// Public Constants
diff --git a/src/mscorlib/shared/System/CharEnumerator.cs b/src/mscorlib/shared/System/CharEnumerator.cs
index 4dbd5cd587..ea9915a7c4 100644
--- a/src/mscorlib/shared/System/CharEnumerator.cs
+++ b/src/mscorlib/shared/System/CharEnumerator.cs
@@ -17,7 +17,6 @@ using System.Collections.Generic;
namespace System
{
- [Serializable]
public sealed class CharEnumerator : IEnumerator, IEnumerator<char>, IDisposable, ICloneable
{
private String _str;
diff --git a/src/mscorlib/shared/System/Collections/Generic/KeyNotFoundException.cs b/src/mscorlib/shared/System/Collections/Generic/KeyNotFoundException.cs
index 1fca7732ae..cdd6faf030 100644
--- a/src/mscorlib/shared/System/Collections/Generic/KeyNotFoundException.cs
+++ b/src/mscorlib/shared/System/Collections/Generic/KeyNotFoundException.cs
@@ -7,7 +7,6 @@ using System.Runtime.Serialization;
namespace System.Collections.Generic
{
- [Serializable]
public class KeyNotFoundException : SystemException
{
public KeyNotFoundException()
@@ -28,6 +27,9 @@ namespace System.Collections.Generic
HResult = __HResults.COR_E_KEYNOTFOUND;
}
- protected KeyNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ protected KeyNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ throw new PlatformNotSupportedException();
+ }
}
}
diff --git a/src/mscorlib/shared/System/CurrentSystemTimeZone.cs b/src/mscorlib/shared/System/CurrentSystemTimeZone.cs
index 2d848397a9..3f17d6f371 100644
--- a/src/mscorlib/shared/System/CurrentSystemTimeZone.cs
+++ b/src/mscorlib/shared/System/CurrentSystemTimeZone.cs
@@ -28,7 +28,6 @@ using System.Runtime.Versioning;
namespace System
{
[Obsolete("System.CurrentSystemTimeZone has been deprecated. Please investigate the use of System.TimeZoneInfo.Local instead.")]
- [Serializable]
internal partial class CurrentSystemTimeZone : TimeZone
{
// Standard offset in ticks to the Universal time if
diff --git a/src/mscorlib/shared/System/DBNull.cs b/src/mscorlib/shared/System/DBNull.cs
index 486eb72f2a..4f4d64bf66 100644
--- a/src/mscorlib/shared/System/DBNull.cs
+++ b/src/mscorlib/shared/System/DBNull.cs
@@ -6,23 +6,17 @@ using System.Runtime.Serialization;
namespace System
{
- [Serializable]
public sealed class DBNull : ISerializable, IConvertible
{
private DBNull()
{
}
-
- private DBNull(SerializationInfo info, StreamingContext context)
- {
- throw new NotSupportedException(SR.NotSupported_DBNullSerial);
- }
-
+
public static readonly DBNull Value = new DBNull();
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
- UnitySerializationHolder.GetUnitySerializationInfo(info, UnitySerializationHolder.NullUnity, null, null);
+ throw new PlatformNotSupportedException();
}
public override string ToString()
diff --git a/src/mscorlib/shared/System/DataMisalignedException.cs b/src/mscorlib/shared/System/DataMisalignedException.cs
index b1991a048e..ff5b29f1cf 100644
--- a/src/mscorlib/shared/System/DataMisalignedException.cs
+++ b/src/mscorlib/shared/System/DataMisalignedException.cs
@@ -13,7 +13,6 @@ using System.Runtime.Serialization;
namespace System
{
- [Serializable]
public sealed class DataMisalignedException : SystemException
{
public DataMisalignedException()
@@ -33,7 +32,5 @@ namespace System
{
HResult = __HResults.COR_E_DATAMISALIGNED;
}
-
- internal DataMisalignedException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}
diff --git a/src/mscorlib/shared/System/DateTimeKind.cs b/src/mscorlib/shared/System/DateTimeKind.cs
index 6b5e690df0..33c9bd925f 100644
--- a/src/mscorlib/shared/System/DateTimeKind.cs
+++ b/src/mscorlib/shared/System/DateTimeKind.cs
@@ -7,7 +7,6 @@ namespace System
// This enum is used to indentify DateTime instances in cases when they are known to be in local time,
// UTC time or if this information has not been specified or is not applicable.
- [Serializable]
public enum DateTimeKind
{
Unspecified = 0,
diff --git a/src/mscorlib/shared/System/DayOfWeek.cs b/src/mscorlib/shared/System/DayOfWeek.cs
index 5d84257158..f67d10e181 100644
--- a/src/mscorlib/shared/System/DayOfWeek.cs
+++ b/src/mscorlib/shared/System/DayOfWeek.cs
@@ -13,7 +13,6 @@
namespace System
{
- [Serializable]
public enum DayOfWeek
{
Sunday = 0,
diff --git a/src/mscorlib/shared/System/DefaultBinder.cs b/src/mscorlib/shared/System/DefaultBinder.cs
index 3b46d5f4d3..9adf702a02 100644
--- a/src/mscorlib/shared/System/DefaultBinder.cs
+++ b/src/mscorlib/shared/System/DefaultBinder.cs
@@ -8,8 +8,6 @@ using CultureInfo = System.Globalization.CultureInfo;
namespace System
{
- //Marked serializable even though it has no state.
- [Serializable]
#if CORECLR
internal
#else
diff --git a/src/mscorlib/shared/System/Diagnostics/ConditionalAttribute.cs b/src/mscorlib/shared/System/Diagnostics/ConditionalAttribute.cs
index d5bca6e208..416625b779 100644
--- a/src/mscorlib/shared/System/Diagnostics/ConditionalAttribute.cs
+++ b/src/mscorlib/shared/System/Diagnostics/ConditionalAttribute.cs
@@ -4,7 +4,6 @@
namespace System.Diagnostics
{
- [Serializable]
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = true)]
public sealed class ConditionalAttribute : Attribute
{
diff --git a/src/mscorlib/src/System/Diagnostics/Debug.Unix.cs b/src/mscorlib/shared/System/Diagnostics/Debug.Unix.cs
index 495f2f713c..495f2f713c 100644
--- a/src/mscorlib/src/System/Diagnostics/Debug.Unix.cs
+++ b/src/mscorlib/shared/System/Diagnostics/Debug.Unix.cs
diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/EventProvider.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/EventProvider.cs
index e18574c1b4..5292551314 100644
--- a/src/mscorlib/shared/System/Diagnostics/Tracing/EventProvider.cs
+++ b/src/mscorlib/shared/System/Diagnostics/Tracing/EventProvider.cs
@@ -54,6 +54,7 @@ namespace System.Diagnostics.Tracing
// subclasses of EventProvider use when creating efficient (but unsafe) version of
// EventWrite. We do make it a nested type because we really don't expect anyone to use
// it except subclasses (and then only rarely).
+ [StructLayout(LayoutKind.Sequential)]
public struct EventData
{
internal unsafe ulong Ptr;
@@ -78,6 +79,7 @@ namespace System.Diagnostics.Tracing
private static bool m_setInformationMissing;
+ internal IEventProvider m_eventProvider; // The interface that implements the specific logging mechanism functions.
UnsafeNativeMethods.ManifestEtw.EtwEnableCallback m_etwCallback; // Trace Callback function
private long m_regHandle; // Trace Registration Handle
private byte m_level; // Tracing Level
@@ -119,6 +121,13 @@ namespace System.Diagnostics.Tracing
// EventSource has special logic to do this, no one else should be calling EventProvider.
internal EventProvider()
{
+#if PLATFORM_WINDOWS
+ m_eventProvider = new EtwEventProvider();
+#elif FEATURE_PERFTRACING
+ m_eventProvider = new EventPipeEventProvider();
+#else
+ m_eventProvider = new NoOpEventProvider();
+#endif
}
/// <summary>
@@ -429,7 +438,7 @@ namespace System.Diagnostics.Tracing
// However the framework version of EventSource DOES have ES_SESSION_INFO defined and thus
// does not have this issue.
-#if ES_SESSION_INFO || !ES_BUILD_STANDALONE
+#if (PLATFORM_WINDOWS && (ES_SESSION_INFO || !ES_BUILD_STANDALONE))
int buffSize = 256; // An initial guess that probably works most of the time.
byte* buffer;
for (; ; )
@@ -469,7 +478,7 @@ namespace System.Diagnostics.Tracing
providerInstance = (UnsafeNativeMethods.ManifestEtw.TRACE_PROVIDER_INSTANCE_INFO*)&structBase[providerInstance->NextOffset];
}
#else
-#if !ES_BUILD_PCL && !FEATURE_PAL // TODO command arguments don't work on PCL builds...
+#if !ES_BUILD_PCL && PLATFORM_WINDOWS // TODO command arguments don't work on PCL builds...
// This code is only used in the Nuget Package Version of EventSource. because
// the code above is using APIs baned from UWP apps.
//
@@ -553,7 +562,7 @@ namespace System.Diagnostics.Tracing
dataStart = 0;
if (filterData == null)
{
-#if (!ES_BUILD_PCL && !ES_BUILD_PN && !FEATURE_PAL)
+#if (!ES_BUILD_PCL && !ES_BUILD_PN && PLATFORM_WINDOWS)
string regKey = @"\Microsoft\Windows\CurrentVersion\Winevt\Publishers\{" + m_providerId + "}";
if (System.Runtime.InteropServices.Marshal.SizeOf(typeof(IntPtr)) == 8)
regKey = @"HKEY_LOCAL_MACHINE\Software" + @"\Wow6432Node" + regKey;
@@ -928,7 +937,7 @@ namespace System.Diagnostics.Tracing
// </SecurityKernel>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "Performance-critical code")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference")]
- internal unsafe bool WriteEvent(ref EventDescriptor eventDescriptor, Guid* activityID, Guid* childActivityID, params object[] eventPayload)
+ internal unsafe bool WriteEvent(ref EventDescriptor eventDescriptor, IntPtr eventHandle, Guid* activityID, Guid* childActivityID, params object[] eventPayload)
{
int status = 0;
@@ -1056,7 +1065,7 @@ namespace System.Diagnostics.Tracing
userDataPtr[refObjPosition[7]].Ptr = (ulong)v7;
}
- status = UnsafeNativeMethods.ManifestEtw.EventWriteTransferWrapper(m_regHandle, ref eventDescriptor, activityID, childActivityID, argCount, userData);
+ status = m_eventProvider.EventWriteTransferWrapper(m_regHandle, ref eventDescriptor, eventHandle, activityID, childActivityID, argCount, userData);
}
}
else
@@ -1082,7 +1091,7 @@ namespace System.Diagnostics.Tracing
}
}
- status = UnsafeNativeMethods.ManifestEtw.EventWriteTransferWrapper(m_regHandle, ref eventDescriptor, activityID, childActivityID, argCount, userData);
+ status = m_eventProvider.EventWriteTransferWrapper(m_regHandle, ref eventDescriptor, eventHandle, activityID, childActivityID, argCount, userData);
for (int i = 0; i < refObjIndex; ++i)
{
@@ -1124,7 +1133,7 @@ namespace System.Diagnostics.Tracing
// <CallsSuppressUnmanagedCode Name="UnsafeNativeMethods.ManifestEtw.EventWrite(System.Int64,EventDescriptor&,System.UInt32,System.Void*):System.UInt32" />
// </SecurityKernel>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference")]
- internal unsafe protected bool WriteEvent(ref EventDescriptor eventDescriptor, Guid* activityID, Guid* childActivityID, int dataCount, IntPtr data)
+ internal unsafe protected bool WriteEvent(ref EventDescriptor eventDescriptor, IntPtr eventHandle, Guid* activityID, Guid* childActivityID, int dataCount, IntPtr data)
{
if (childActivityID != null)
{
@@ -1135,7 +1144,7 @@ namespace System.Diagnostics.Tracing
(EventOpcode)eventDescriptor.Opcode == EventOpcode.Stop);
}
- int status = UnsafeNativeMethods.ManifestEtw.EventWriteTransferWrapper(m_regHandle, ref eventDescriptor, activityID, childActivityID, dataCount, (EventData*)data);
+ int status = m_eventProvider.EventWriteTransferWrapper(m_regHandle, ref eventDescriptor, eventHandle, activityID, childActivityID, dataCount, (EventData*)data);
if (status != 0)
{
@@ -1155,9 +1164,10 @@ namespace System.Diagnostics.Tracing
{
int status;
- status = UnsafeNativeMethods.ManifestEtw.EventWriteTransferWrapper(
+ status = m_eventProvider.EventWriteTransferWrapper(
m_regHandle,
ref eventDescriptor,
+ IntPtr.Zero,
activityID,
relatedActivityID,
dataCount,
@@ -1178,12 +1188,12 @@ namespace System.Diagnostics.Tracing
{
m_providerId = providerId;
m_etwCallback = enableCallback;
- return UnsafeNativeMethods.ManifestEtw.EventRegister(ref providerId, enableCallback, null, ref m_regHandle);
+ return m_eventProvider.EventRegister(ref providerId, enableCallback, null, ref m_regHandle);
}
private uint EventUnregister(long registrationHandle)
{
- return UnsafeNativeMethods.ManifestEtw.EventUnregister(registrationHandle);
+ return m_eventProvider.EventUnregister(registrationHandle);
}
static int[] nibblebits = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4 };
@@ -1203,5 +1213,108 @@ namespace System.Diagnostics.Tracing
return idx;
}
}
+
+#if PLATFORM_WINDOWS
+
+ // A wrapper around the ETW-specific API calls.
+ internal sealed class EtwEventProvider : IEventProvider
+ {
+ // Register an event provider.
+ unsafe uint IEventProvider.EventRegister(
+ ref Guid providerId,
+ UnsafeNativeMethods.ManifestEtw.EtwEnableCallback enableCallback,
+ void* callbackContext,
+ ref long registrationHandle)
+ {
+ return UnsafeNativeMethods.ManifestEtw.EventRegister(
+ ref providerId,
+ enableCallback,
+ callbackContext,
+ ref registrationHandle);
+ }
+
+ // Unregister an event provider.
+ uint IEventProvider.EventUnregister(long registrationHandle)
+ {
+ return UnsafeNativeMethods.ManifestEtw.EventUnregister(registrationHandle);
+ }
+
+ // Write an event.
+ unsafe int IEventProvider.EventWriteTransferWrapper(
+ long registrationHandle,
+ ref EventDescriptor eventDescriptor,
+ IntPtr eventHandle,
+ Guid* activityId,
+ Guid* relatedActivityId,
+ int userDataCount,
+ EventProvider.EventData* userData)
+ {
+ return UnsafeNativeMethods.ManifestEtw.EventWriteTransferWrapper(
+ registrationHandle,
+ ref eventDescriptor,
+ activityId,
+ relatedActivityId,
+ userDataCount,
+ userData);
+ }
+
+ // Get or set the per-thread activity ID.
+ int IEventProvider.EventActivityIdControl(UnsafeNativeMethods.ManifestEtw.ActivityControl ControlCode, ref Guid ActivityId)
+ {
+ return UnsafeNativeMethods.ManifestEtw.EventActivityIdControl(
+ ControlCode,
+ ref ActivityId);
+ }
+
+ // Define an EventPipeEvent handle.
+ unsafe IntPtr IEventProvider.DefineEventHandle(uint eventID, string eventName, Int64 keywords, uint eventVersion, uint level, byte *pMetadata, uint metadataLength)
+ {
+ throw new System.NotSupportedException();
+ }
+ }
+
+#elif !FEATURE_PERFTRACING
+
+ internal sealed class NoOpEventProvider : IEventProvider
+ {
+ unsafe uint IEventProvider.EventRegister(
+ ref Guid providerId,
+ UnsafeNativeMethods.ManifestEtw.EtwEnableCallback enableCallback,
+ void* callbackContext,
+ ref long registrationHandle)
+ {
+ return 0;
+ }
+
+ uint IEventProvider.EventUnregister(long registrationHandle)
+ {
+ return 0;
+ }
+
+ unsafe int IEventProvider.EventWriteTransferWrapper(
+ long registrationHandle,
+ ref EventDescriptor eventDescriptor,
+ IntPtr eventHandle,
+ Guid* activityId,
+ Guid* relatedActivityId,
+ int userDataCount,
+ EventProvider.EventData* userData)
+ {
+ return 0;
+ }
+
+ int IEventProvider.EventActivityIdControl(UnsafeNativeMethods.ManifestEtw.ActivityControl ControlCode, ref Guid ActivityId)
+ {
+ return 0;
+ }
+
+ // Define an EventPipeEvent handle.
+ unsafe IntPtr IEventProvider.DefineEventHandle(uint eventID, string eventName, Int64 keywords, uint eventVersion, uint level, byte *pMetadata, uint metadataLength)
+ {
+ throw new System.NotSupportedException();
+ }
+ }
+
+#endif
}
diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs
index cf4901de6f..3349c069c6 100644..100755
--- a/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs
+++ b/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs
@@ -4,16 +4,10 @@
// This program uses code hyperlinks available as part of the HyperAddin Visual Studio plug-in.
// It is available from http://www.codeplex.com/hyperAddin
-#if PLATFORM_WINDOWS
-
-#define FEATURE_MANAGED_ETW
-
-#if !ES_BUILD_STANDALONE && !CORECLR && !ES_BUILD_PN
+#if PLATFORM_WINDOWS && !ES_BUILD_STANDALONE && !CORECLR && !ES_BUILD_PN
#define FEATURE_ACTIVITYSAMPLING
#endif // !ES_BUILD_STANDALONE
-#endif // PLATFORM_WINDOWS
-
#if ES_BUILD_STANDALONE
#define FEATURE_MANAGED_ETW_CHANNELS
// #define FEATURE_ADVANCED_MANAGED_ETW_CHANNELS
@@ -692,6 +686,106 @@ namespace System.Diagnostics.Tracing
Initialize(eventSourceGuid, eventSourceName, traits);
}
+#if FEATURE_PERFTRACING
+ // Generate the serialized blobs that describe events for all strongly typed events (that is events that define strongly
+ // typed event methods. Dynamically defined events (that use Write) hare defined on the fly and are handled elsewhere.
+ private unsafe void DefineEventPipeEvents()
+ {
+ Debug.Assert(m_eventData != null);
+ Debug.Assert(m_provider != null);
+ int cnt = m_eventData.Length;
+ for (int i = 0; i < cnt; i++)
+ {
+ uint eventID = (uint)m_eventData[i].Descriptor.EventId;
+ if (eventID == 0)
+ continue;
+
+ string eventName = m_eventData[i].Name;
+ Int64 keywords = m_eventData[i].Descriptor.Keywords;
+ uint eventVersion = m_eventData[i].Descriptor.Version;
+ uint level = m_eventData[i].Descriptor.Level;
+
+ // evnetID : 4 bytes
+ // eventName : (eventName.Length + 1) * 2 bytes
+ // keywords : 8 bytes
+ // eventVersion : 4 bytes
+ // level : 4 bytes
+ // parameterCount : 4 bytes
+ uint metadataLength = 24 + ((uint)eventName.Length + 1) * 2;
+
+ // Increase the metadataLength for the types of all parameters.
+ metadataLength += (uint)m_eventData[i].Parameters.Length * 4;
+
+ // Increase the metadataLength for the names of all parameters.
+ foreach (var parameter in m_eventData[i].Parameters)
+ {
+ string parameterName = parameter.Name;
+ metadataLength = metadataLength + ((uint)parameterName.Length + 1) * 2;
+ }
+
+ byte[] metadata = new byte[metadataLength];
+
+ // Write metadata: evnetID, eventName, keywords, eventVersion, level, parameterCount, param1 type, param1 name...
+ fixed (byte *pMetadata = metadata)
+ {
+ uint offset = 0;
+ WriteToBuffer(pMetadata, metadataLength, ref offset, eventID);
+ fixed(char *pEventName = eventName)
+ {
+ WriteToBuffer(pMetadata, metadataLength, ref offset, (byte *)pEventName, ((uint)eventName.Length + 1) * 2);
+ }
+ WriteToBuffer(pMetadata, metadataLength, ref offset, keywords);
+ WriteToBuffer(pMetadata, metadataLength, ref offset, eventVersion);
+ WriteToBuffer(pMetadata, metadataLength, ref offset, level);
+ WriteToBuffer(pMetadata, metadataLength, ref offset, (uint)m_eventData[i].Parameters.Length);
+ foreach (var parameter in m_eventData[i].Parameters)
+ {
+ // Write parameter type.
+ WriteToBuffer(pMetadata, metadataLength, ref offset, (uint)Type.GetTypeCode(parameter.ParameterType));
+
+ // Write parameter name.
+ string parameterName = parameter.Name;
+ fixed (char *pParameterName = parameterName)
+ {
+ WriteToBuffer(pMetadata, metadataLength, ref offset, (byte *)pParameterName, ((uint)parameterName.Length + 1) * 2);
+ }
+ }
+ Debug.Assert(metadataLength == offset);
+ IntPtr eventHandle = m_provider.m_eventProvider.DefineEventHandle(eventID, eventName, keywords, eventVersion, level, pMetadata, metadataLength);
+ m_eventData[i].EventHandle = eventHandle;
+ }
+ }
+ }
+
+ // Copy src to buffer and modify the offset.
+ // Note: We know the buffer size ahead of time to make sure no buffer overflow.
+ private static unsafe void WriteToBuffer(byte *buffer, uint bufferLength, ref uint offset, byte *src, uint srcLength)
+ {
+ Debug.Assert(bufferLength >= (offset + srcLength));
+ for (int i = 0; i < srcLength; i++)
+ {
+ *(byte *)(buffer + offset + i) = *(byte *)(src + i);
+ }
+ offset += srcLength;
+ }
+
+ // Copy uint value to buffer.
+ private static unsafe void WriteToBuffer(byte *buffer, uint bufferLength, ref uint offset, uint value)
+ {
+ Debug.Assert(bufferLength >= (offset + 4));
+ *(uint *)(buffer + offset) = value;
+ offset += 4;
+ }
+
+ // Copy long value to buffer.
+ private static unsafe void WriteToBuffer(byte *buffer, uint bufferLength, ref uint offset, long value)
+ {
+ Debug.Assert(bufferLength >= (offset + 8));
+ *(long *)(buffer + offset) = value;
+ offset += 8;
+ }
+#endif
+
internal virtual void GetMetadata(out Guid eventSourceGuid, out string eventSourceName, out EventMetadata[] eventData, out byte[] manifestBytes)
{
//
@@ -1185,7 +1279,7 @@ namespace System.Diagnostics.Tracing
// by default the Descriptor.Keyword will have the perEventSourceSessionId bit
// mask set to 0x0f so, when all ETW sessions want the event we don't need to
// synthesize a new one
- if (!m_provider.WriteEvent(ref m_eventData[eventId].Descriptor, pActivityId, relatedActivityId, eventDataCount, (IntPtr)data))
+ if (!m_provider.WriteEvent(ref m_eventData[eventId].Descriptor, m_eventData[eventId].EventHandle, pActivityId, relatedActivityId, eventDataCount, (IntPtr)data))
ThrowEventSourceException(m_eventData[eventId].Name);
}
else
@@ -1205,7 +1299,7 @@ namespace System.Diagnostics.Tracing
m_eventData[eventId].Descriptor.Task,
unchecked((long)etwSessions.ToEventKeywords() | origKwd));
- if (!m_provider.WriteEvent(ref desc, pActivityId, relatedActivityId, eventDataCount, (IntPtr)data))
+ if (!m_provider.WriteEvent(ref desc, m_eventData[eventId].EventHandle, pActivityId, relatedActivityId, eventDataCount, (IntPtr)data))
ThrowEventSourceException(m_eventData[eventId].Name);
}
}
@@ -1235,7 +1329,7 @@ namespace System.Diagnostics.Tracing
#else
if (!SelfDescribingEvents)
{
- if (!m_provider.WriteEvent(ref m_eventData[eventId].Descriptor, pActivityId, relatedActivityId, eventDataCount, (IntPtr)data))
+ if (!m_provider.WriteEvent(ref m_eventData[eventId].Descriptor, m_eventData[eventId].EventHandle, pActivityId, relatedActivityId, eventDataCount, (IntPtr)data))
ThrowEventSourceException(m_eventData[eventId].Name);
}
else
@@ -1328,6 +1422,7 @@ namespace System.Diagnostics.Tracing
if (disposing)
{
#if FEATURE_MANAGED_ETW
+#if !FEATURE_PERFTRACING
// Send the manifest one more time to ensure circular buffers have a chance to get to this information
// even in scenarios with a high volume of ETW events.
if (m_eventSourceEnabled)
@@ -1340,6 +1435,7 @@ namespace System.Diagnostics.Tracing
{ } // If it fails, simply give up.
m_eventSourceEnabled = false;
}
+#endif
if (m_provider != null)
{
m_provider.Dispose();
@@ -1474,6 +1570,7 @@ namespace System.Diagnostics.Tracing
// Set m_provider, which allows this.
m_provider = provider;
+#if PLATFORM_WINDOWS
#if (!ES_BUILD_STANDALONE && !ES_BUILD_PN)
// API available on OS >= Win 8 and patched Win 7.
// Disable only for FrameworkEventSource to avoid recursion inside exception handling.
@@ -1492,8 +1589,8 @@ namespace System.Diagnostics.Tracing
metadataHandle.Free();
}
+#endif // PLATFORM_WINDOWS
#endif // FEATURE_MANAGED_ETW
-
Debug.Assert(!m_eventSourceEnabled); // We can't be enabled until we are completely initted.
// We are logically completely initialized at this point.
m_completelyInited = true;
@@ -1945,7 +2042,7 @@ namespace System.Diagnostics.Tracing
// by default the Descriptor.Keyword will have the perEventSourceSessionId bit
// mask set to 0x0f so, when all ETW sessions want the event we don't need to
// synthesize a new one
- if (!m_provider.WriteEvent(ref m_eventData[eventId].Descriptor, pActivityId, childActivityID, args))
+ if (!m_provider.WriteEvent(ref m_eventData[eventId].Descriptor, m_eventData[eventId].EventHandle, pActivityId, childActivityID, args))
ThrowEventSourceException(m_eventData[eventId].Name);
}
else
@@ -1962,7 +2059,7 @@ namespace System.Diagnostics.Tracing
m_eventData[eventId].Descriptor.Task,
unchecked((long)etwSessions.ToEventKeywords() | origKwd));
- if (!m_provider.WriteEvent(ref desc, pActivityId, childActivityID, args))
+ if (!m_provider.WriteEvent(ref desc, m_eventData[eventId].EventHandle, pActivityId, childActivityID, args))
ThrowEventSourceException(m_eventData[eventId].Name);
}
}
@@ -1992,7 +2089,7 @@ namespace System.Diagnostics.Tracing
#else
if (!SelfDescribingEvents)
{
- if (!m_provider.WriteEvent(ref m_eventData[eventId].Descriptor, pActivityId, childActivityID, args))
+ if (!m_provider.WriteEvent(ref m_eventData[eventId].Descriptor, m_eventData[eventId].EventHandle, pActivityId, childActivityID, args))
ThrowEventSourceException(m_eventData[eventId].Name);
}
else
@@ -2102,32 +2199,26 @@ namespace System.Diagnostics.Tracing
#endif //!ES_BUILD_PCL
}
- private int GetParamLenghtIncludingByteArray(ParameterInfo[] parameters)
+ unsafe private void WriteToAllListeners(int eventId, Guid* childActivityID, int eventDataCount, EventSource.EventData* data)
{
- int sum = 0;
- foreach (ParameterInfo info in parameters)
+ // We represent a byte[] as a integer denoting the length and then a blob of bytes in the data pointer. This causes a spurious
+ // warning because eventDataCount is off by one for the byte[] case since a byte[] has 2 items associated it. So we want to check
+ // that the number of parameters is correct against the byte[] case, but also we the args array would be one too long if
+ // we just used the modifiedParamCount here -- so we need both.
+ int paramCount = GetParameterCount(m_eventData[eventId]);
+ int modifiedParamCount = 0;
+ for (int i = 0; i < paramCount; i++)
{
- if (info.ParameterType == typeof(byte[]))
+ Type parameterType = GetDataType(m_eventData[eventId], i);
+ if (parameterType == typeof(byte[]))
{
- sum += 2;
+ modifiedParamCount += 2;
}
else
{
- sum++;
+ modifiedParamCount++;
}
}
-
- return sum;
- }
-
- unsafe private void WriteToAllListeners(int eventId, Guid* childActivityID, int eventDataCount, EventSource.EventData* data)
- {
- // We represent a byte[] as a integer denoting the length and then a blob of bytes in the data pointer. This causes a spurious
- // warning because eventDataCount is off by one for the byte[] case since a byte[] has 2 items associated it. So we want to check
- // that the number of parameters is correct against the byte[] case, but also we the args array would be one too long if
- // we just used the modifiedParamCount here -- so we need both.
- int paramCount = m_eventData[eventId].Parameters.Length;
- int modifiedParamCount = GetParamLenghtIncludingByteArray(m_eventData[eventId].Parameters);
if (eventDataCount != modifiedParamCount)
{
ReportOutOfBandMessage(Resources.GetResourceString("EventSource_EventParametersMismatch", eventId, eventDataCount, paramCount), true);
@@ -2200,7 +2291,7 @@ namespace System.Diagnostics.Tracing
[SuppressMessage("Microsoft.Concurrency", "CA8001", Justification = "This does not need to be correct when racing with other threads")]
private unsafe void WriteEventString(EventLevel level, long keywords, string msgString)
{
-#if FEATURE_MANAGED_ETW
+#if FEATURE_MANAGED_ETW && !FEATURE_PERFTRACING
if (m_provider != null)
{
string eventName = "EventSourceMessage";
@@ -2236,7 +2327,7 @@ namespace System.Diagnostics.Tracing
data.Ptr = (ulong)msgStringPtr;
data.Size = (uint)(2 * (msgString.Length + 1));
data.Reserved = 0;
- m_provider.WriteEvent(ref descr, null, null, 1, (IntPtr)((void*)&data));
+ m_provider.WriteEvent(ref descr, IntPtr.Zero, null, null, 1, (IntPtr)((void*)&data));
}
}
}
@@ -2521,6 +2612,7 @@ namespace System.Diagnostics.Tracing
partial struct EventMetadata
{
public EventDescriptor Descriptor;
+ public IntPtr EventHandle; // EventPipeEvent handle.
public EventTags Tags;
public bool EnabledForAnyListener; // true if any dispatcher has this event turned on
public bool EnabledForETW; // is this event on for the OS ETW data dispatcher?
@@ -2683,11 +2775,13 @@ namespace System.Diagnostics.Tracing
{
// eventSourceDispatcher == null means this is the ETW manifest
+#if !FEATURE_PERFTRACING
// Note that we unconditionally send the manifest whenever we are enabled, even if
// we were already enabled. This is because there may be multiple sessions active
// and we can't know that all the sessions have seen the manifest.
if (!SelfDescribingEvents)
SendManifest(m_rawManifest);
+#endif
}
#if FEATURE_ACTIVITYSAMPLING
@@ -2811,12 +2905,14 @@ namespace System.Diagnostics.Tracing
}
else
{
+#if !FEATURE_PERFTRACING
if (commandArgs.Command == EventCommand.SendManifest)
{
// TODO: should we generate the manifest here if we hadn't already?
if (m_rawManifest != null)
SendManifest(m_rawManifest);
}
+#endif
// These are not used for non-update commands and thus should always be 'default' values
// Debug.Assert(enable == true);
@@ -3036,6 +3132,7 @@ namespace System.Diagnostics.Tracing
{
// GetMetadata failed, so we have to set it via reflection.
Debug.Assert(m_rawManifest == null);
+
m_rawManifest = CreateManifestAndDescriptors(this.GetType(), Name, this);
Debug.Assert(m_eventData != null);
@@ -3069,6 +3166,10 @@ namespace System.Diagnostics.Tracing
dispatcher.m_EventEnabled = new bool[m_eventData.Length];
dispatcher = dispatcher.m_Next;
}
+#if FEATURE_PERFTRACING
+ // Initialize the EventPipe event handles.
+ DefineEventPipeEvents();
+#endif
}
if (s_currentPid == 0)
{
@@ -3123,7 +3224,7 @@ namespace System.Diagnostics.Tracing
dataDescrs[1].Size = (uint)Math.Min(dataLeft, chunkSize);
if (m_provider != null)
{
- if (!m_provider.WriteEvent(ref manifestDescr, null, null, 2, (IntPtr)dataDescrs))
+ if (!m_provider.WriteEvent(ref manifestDescr, IntPtr.Zero, null, null, 2, (IntPtr)dataDescrs))
{
// Turns out that if users set the BufferSize to something less than 64K then WriteEvent
// can fail. If we get this failure on the first chunk try again with something smaller
@@ -3690,6 +3791,7 @@ namespace System.Diagnostics.Tracing
eventData[eventAttribute.EventId].Message = eventAttribute.Message;
eventData[eventAttribute.EventId].ActivityOptions = eventAttribute.ActivityOptions;
eventData[eventAttribute.EventId].HasRelatedActivityID = hasRelatedActivityID;
+ eventData[eventAttribute.EventId].EventHandle = IntPtr.Zero;
}
// Helper used by code:CreateManifestAndDescriptors that trims the m_eventData array to the correct
diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/EventSourceException.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/EventSourceException.cs
index 88b8da93cd..73e32aaf53 100644
--- a/src/mscorlib/shared/System/Diagnostics/Tracing/EventSourceException.cs
+++ b/src/mscorlib/shared/System/Diagnostics/Tracing/EventSourceException.cs
@@ -18,9 +18,9 @@ namespace System.Diagnostics.Tracing
/// <summary>
/// Exception that is thrown when an error occurs during EventSource operation.
/// </summary>
-#if !ES_BUILD_PCL
+#if !CORECLR && !ES_BUILD_PN && !ES_BUILD_PCL && !CORERT
[Serializable]
-#endif
+#endif // !CORECLR && !ES_BUILD_PN && !ES_BUILD_PCL && !CORERT
public class EventSourceException : Exception
{
/// <summary>
diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/IEventProvider.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/IEventProvider.cs
new file mode 100644
index 0000000000..71a2fe4d44
--- /dev/null
+++ b/src/mscorlib/shared/System/Diagnostics/Tracing/IEventProvider.cs
@@ -0,0 +1,42 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using Microsoft.Win32;
+
+#if ES_BUILD_STANDALONE
+namespace Microsoft.Diagnostics.Tracing
+#else
+namespace System.Diagnostics.Tracing
+#endif
+{
+ // Represents the interface between EventProvider and an external logging mechanism.
+ internal interface IEventProvider
+ {
+ // Register an event provider.
+ unsafe uint EventRegister(
+ ref Guid providerId,
+ UnsafeNativeMethods.ManifestEtw.EtwEnableCallback enableCallback,
+ void* callbackContext,
+ ref long registrationHandle);
+
+ // Unregister an event provider.
+ uint EventUnregister(long registrationHandle);
+
+ // Write an event.
+ unsafe int EventWriteTransferWrapper(
+ long registrationHandle,
+ ref EventDescriptor eventDescriptor,
+ IntPtr eventHandle,
+ Guid* activityId,
+ Guid* relatedActivityId,
+ int userDataCount,
+ EventProvider.EventData* userData);
+
+ // Get or set the per-thread activity ID.
+ int EventActivityIdControl(UnsafeNativeMethods.ManifestEtw.ActivityControl ControlCode, ref Guid ActivityId);
+
+ // Define an EventPipeEvent handle.
+ unsafe IntPtr DefineEventHandle(uint eventID, string eventName, Int64 keywords, uint eventVersion, uint level, byte *pMetadata, uint metadataLength);
+ }
+}
diff --git a/src/mscorlib/shared/System/DivideByZeroException.cs b/src/mscorlib/shared/System/DivideByZeroException.cs
index 4abd43adaf..0fad2f8d56 100644
--- a/src/mscorlib/shared/System/DivideByZeroException.cs
+++ b/src/mscorlib/shared/System/DivideByZeroException.cs
@@ -15,7 +15,6 @@ using System.Runtime.Serialization;
namespace System
{
- [Serializable]
public class DivideByZeroException : ArithmeticException
{
public DivideByZeroException()
@@ -36,6 +35,9 @@ namespace System
HResult = __HResults.COR_E_DIVIDEBYZERO;
}
- protected DivideByZeroException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ protected DivideByZeroException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ throw new PlatformNotSupportedException();
+ }
}
}
diff --git a/src/mscorlib/src/System/DllNotFoundException.cs b/src/mscorlib/shared/System/DllNotFoundException.cs
index a3b46c76b3..8c69e45eda 100644
--- a/src/mscorlib/src/System/DllNotFoundException.cs
+++ b/src/mscorlib/shared/System/DllNotFoundException.cs
@@ -4,6 +4,7 @@
/*=============================================================================
**
+** Class: DllNotFoundException
**
**
** Purpose: The exception class for some failed P/Invoke calls.
@@ -11,13 +12,10 @@
**
=============================================================================*/
-
-using System;
using System.Runtime.Serialization;
namespace System
{
- [Serializable]
public class DllNotFoundException : TypeLoadException
{
public DllNotFoundException()
@@ -40,6 +38,7 @@ namespace System
protected DllNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context)
{
+ throw new PlatformNotSupportedException();
}
}
}
diff --git a/src/mscorlib/shared/System/DuplicateWaitObjectException.cs b/src/mscorlib/shared/System/DuplicateWaitObjectException.cs
index da29e2ad76..7eadead8c7 100644
--- a/src/mscorlib/shared/System/DuplicateWaitObjectException.cs
+++ b/src/mscorlib/shared/System/DuplicateWaitObjectException.cs
@@ -18,7 +18,6 @@ namespace System
// The DuplicateWaitObjectException is thrown when an object
// appears more than once in the list of objects to WaitAll or WaitAny.
//
- [Serializable]
public class DuplicateWaitObjectException : ArgumentException
{
private static volatile String s_duplicateWaitObjectMessage = null;
@@ -58,8 +57,10 @@ namespace System
{
HResult = __HResults.COR_E_DUPLICATEWAITOBJECT;
}
-
- // This constructor is required for serialization
- protected DuplicateWaitObjectException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+
+ protected DuplicateWaitObjectException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ throw new PlatformNotSupportedException();
+ }
}
}
diff --git a/src/mscorlib/shared/System/EntryPointNotFoundException.cs b/src/mscorlib/shared/System/EntryPointNotFoundException.cs
index 835d33413d..0b881cec05 100644
--- a/src/mscorlib/shared/System/EntryPointNotFoundException.cs
+++ b/src/mscorlib/shared/System/EntryPointNotFoundException.cs
@@ -16,7 +16,6 @@ using System.Runtime.Serialization;
namespace System
{
- [Serializable]
public class EntryPointNotFoundException : TypeLoadException
{
public EntryPointNotFoundException()
@@ -37,6 +36,9 @@ namespace System
HResult = __HResults.COR_E_ENTRYPOINTNOTFOUND;
}
- protected EntryPointNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ protected EntryPointNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ throw new PlatformNotSupportedException();
+ }
}
}
diff --git a/src/mscorlib/shared/System/EventArgs.cs b/src/mscorlib/shared/System/EventArgs.cs
index c0356613de..be12af25b6 100644
--- a/src/mscorlib/shared/System/EventArgs.cs
+++ b/src/mscorlib/shared/System/EventArgs.cs
@@ -7,7 +7,6 @@ using System;
namespace System
{
// The base class for all event classes.
- [Serializable]
public class EventArgs
{
public static readonly EventArgs Empty = new EventArgs();
diff --git a/src/mscorlib/shared/System/EventHandler.cs b/src/mscorlib/shared/System/EventHandler.cs
index e6923cf637..3d1cbfef26 100644
--- a/src/mscorlib/shared/System/EventHandler.cs
+++ b/src/mscorlib/shared/System/EventHandler.cs
@@ -6,9 +6,7 @@ using System;
namespace System
{
- [Serializable]
public delegate void EventHandler(Object sender, EventArgs e);
- [Serializable]
public delegate void EventHandler<TEventArgs>(Object sender, TEventArgs e); // Removed TEventArgs constraint post-.NET 4
}
diff --git a/src/mscorlib/shared/System/ExecutionEngineException.cs b/src/mscorlib/shared/System/ExecutionEngineException.cs
index bebfd493a0..b89f6d9a8d 100644
--- a/src/mscorlib/shared/System/ExecutionEngineException.cs
+++ b/src/mscorlib/shared/System/ExecutionEngineException.cs
@@ -21,7 +21,6 @@ using System.Runtime.Serialization;
namespace System
{
[Obsolete("This type previously indicated an unspecified fatal error in the runtime. The runtime no longer raises this exception so this type is obsolete.")]
- [Serializable]
public sealed class ExecutionEngineException : SystemException
{
public ExecutionEngineException()
@@ -41,7 +40,5 @@ namespace System
{
HResult = __HResults.COR_E_EXECUTIONENGINE;
}
-
- internal ExecutionEngineException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}
diff --git a/src/mscorlib/shared/System/FieldAccessException.cs b/src/mscorlib/shared/System/FieldAccessException.cs
index ac62c0fcac..b56d749771 100644
--- a/src/mscorlib/shared/System/FieldAccessException.cs
+++ b/src/mscorlib/shared/System/FieldAccessException.cs
@@ -13,7 +13,6 @@ using System.Runtime.Serialization;
namespace System
{
- [Serializable]
public class FieldAccessException : MemberAccessException
{
public FieldAccessException()
@@ -34,6 +33,9 @@ namespace System
HResult = __HResults.COR_E_FIELDACCESS;
}
- protected FieldAccessException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ protected FieldAccessException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ throw new PlatformNotSupportedException();
+ }
}
}
diff --git a/src/mscorlib/shared/System/FlagsAttribute.cs b/src/mscorlib/shared/System/FlagsAttribute.cs
index 5f8c108ae4..4f3ab36bfd 100644
--- a/src/mscorlib/shared/System/FlagsAttribute.cs
+++ b/src/mscorlib/shared/System/FlagsAttribute.cs
@@ -11,7 +11,6 @@ namespace System
// should be treated as a bitfield (or set of flags).
// An IDE may use this information to provide a richer
// development experience.
- [Serializable]
[AttributeUsage(AttributeTargets.Enum, Inherited = false)]
public class FlagsAttribute : Attribute
{
diff --git a/src/mscorlib/shared/System/FormatException.cs b/src/mscorlib/shared/System/FormatException.cs
index c5758e11cd..9baaac2353 100644
--- a/src/mscorlib/shared/System/FormatException.cs
+++ b/src/mscorlib/shared/System/FormatException.cs
@@ -15,7 +15,6 @@ using System.Runtime.Serialization;
namespace System
{
- [Serializable]
public class FormatException : SystemException
{
public FormatException()
@@ -36,6 +35,9 @@ namespace System
HResult = __HResults.COR_E_FORMAT;
}
- protected FormatException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ protected FormatException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ throw new PlatformNotSupportedException();
+ }
}
}
diff --git a/src/mscorlib/src/System/Globalization/CalendarData.Unix.cs b/src/mscorlib/shared/System/Globalization/CalendarData.Unix.cs
index 319f66ae8c..a2ceeb1e67 100644
--- a/src/mscorlib/src/System/Globalization/CalendarData.Unix.cs
+++ b/src/mscorlib/shared/System/Globalization/CalendarData.Unix.cs
@@ -306,21 +306,30 @@ namespace System.Globalization
private static void EnumCalendarInfoCallback(string calendarString, IntPtr context)
{
- CallbackContext callbackContext = (CallbackContext)((GCHandle)context).Target;
-
- if (callbackContext.DisallowDuplicates)
+ try
{
- foreach (string existingResult in callbackContext.Results)
+ CallbackContext callbackContext = (CallbackContext)((GCHandle)context).Target;
+
+ if (callbackContext.DisallowDuplicates)
{
- if (string.Equals(calendarString, existingResult, StringComparison.Ordinal))
+ foreach (string existingResult in callbackContext.Results)
{
- // the value is already in the results, so don't add it again
- return;
+ if (string.Equals(calendarString, existingResult, StringComparison.Ordinal))
+ {
+ // the value is already in the results, so don't add it again
+ return;
+ }
}
}
- }
- callbackContext.Results.Add(calendarString);
+ callbackContext.Results.Add(calendarString);
+ }
+ catch (Exception e)
+ {
+ Debug.Assert(false, e.ToString());
+ // we ignore the managed exceptions here because EnumCalendarInfoCallback will get called from the native code.
+ // If we don't ignore the exception here that can cause the runtime to fail fast.
+ }
}
private class CallbackContext
diff --git a/src/mscorlib/shared/System/Globalization/CalendarWeekRule.cs b/src/mscorlib/shared/System/Globalization/CalendarWeekRule.cs
index b381b5c544..f683ed05e7 100644
--- a/src/mscorlib/shared/System/Globalization/CalendarWeekRule.cs
+++ b/src/mscorlib/shared/System/Globalization/CalendarWeekRule.cs
@@ -4,7 +4,6 @@
namespace System.Globalization
{
- [Serializable]
public enum CalendarWeekRule
{
FirstDay = 0, // Week 1 begins on the first day of the year
diff --git a/src/mscorlib/shared/System/Globalization/ChineseLunisolarCalendar.cs b/src/mscorlib/shared/System/Globalization/ChineseLunisolarCalendar.cs
index 404add0936..e09011a9d8 100644
--- a/src/mscorlib/shared/System/Globalization/ChineseLunisolarCalendar.cs
+++ b/src/mscorlib/shared/System/Globalization/ChineseLunisolarCalendar.cs
@@ -14,7 +14,6 @@ namespace System.Globalization
** ChineseLunisolar 1901/01/01 2100/12/29
*/
- [Serializable]
public class ChineseLunisolarCalendar : EastAsianLunisolarCalendar
{
//
diff --git a/src/mscorlib/src/System/Globalization/CultureData.Unix.cs b/src/mscorlib/shared/System/Globalization/CultureData.Unix.cs
index 4f685de580..4f685de580 100644
--- a/src/mscorlib/src/System/Globalization/CultureData.Unix.cs
+++ b/src/mscorlib/shared/System/Globalization/CultureData.Unix.cs
diff --git a/src/mscorlib/shared/System/Globalization/CultureNotFoundException.cs b/src/mscorlib/shared/System/Globalization/CultureNotFoundException.cs
index 929f4bb000..dde1a8b2ba 100644
--- a/src/mscorlib/shared/System/Globalization/CultureNotFoundException.cs
+++ b/src/mscorlib/shared/System/Globalization/CultureNotFoundException.cs
@@ -6,7 +6,6 @@ using System.Runtime.Serialization;
namespace System.Globalization
{
- [Serializable]
public class CultureNotFoundException : ArgumentException
{
private string _invalidCultureName; // unrecognized culture name
@@ -59,15 +58,12 @@ namespace System.Globalization
protected CultureNotFoundException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
- _invalidCultureId = (int?)info.GetValue("InvalidCultureId", typeof(int?));
- _invalidCultureName = (string)info.GetValue("InvalidCultureName", typeof(string));
+ throw new PlatformNotSupportedException();
}
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
base.GetObjectData(info, context);
- info.AddValue("InvalidCultureId", _invalidCultureId, typeof(int?));
- info.AddValue("InvalidCultureName", _invalidCultureName, typeof(string));
}
public virtual Nullable<int> InvalidCultureId
diff --git a/src/mscorlib/shared/System/Globalization/DateTimeFormatInfo.cs b/src/mscorlib/shared/System/Globalization/DateTimeFormatInfo.cs
index d3f1ea9a45..5d3239ebfc 100644
--- a/src/mscorlib/shared/System/Globalization/DateTimeFormatInfo.cs
+++ b/src/mscorlib/shared/System/Globalization/DateTimeFormatInfo.cs
@@ -49,7 +49,6 @@ namespace System.Globalization
}
- [Serializable]
public sealed class DateTimeFormatInfo : IFormatProvider, ICloneable
{
// cache for the invariant culture.
diff --git a/src/mscorlib/shared/System/Globalization/DaylightTime.cs b/src/mscorlib/shared/System/Globalization/DaylightTime.cs
index b3c70e1d10..10f074dc24 100644
--- a/src/mscorlib/shared/System/Globalization/DaylightTime.cs
+++ b/src/mscorlib/shared/System/Globalization/DaylightTime.cs
@@ -5,7 +5,6 @@
namespace System.Globalization
{
// This class represents a starting/ending time for a period of daylight saving time.
- [Serializable]
public class DaylightTime
{
private readonly DateTime _start;
diff --git a/src/mscorlib/shared/System/Globalization/EastAsianLunisolarCalendar.cs b/src/mscorlib/shared/System/Globalization/EastAsianLunisolarCalendar.cs
index d06b13cd7d..0697b602db 100644
--- a/src/mscorlib/shared/System/Globalization/EastAsianLunisolarCalendar.cs
+++ b/src/mscorlib/shared/System/Globalization/EastAsianLunisolarCalendar.cs
@@ -6,7 +6,6 @@ using System.Diagnostics.Contracts;
namespace System.Globalization
{
- [Serializable]
public abstract class EastAsianLunisolarCalendar : Calendar
{
internal const int LeapMonth = 0;
diff --git a/src/mscorlib/shared/System/Globalization/GregorianCalendarTypes.cs b/src/mscorlib/shared/System/Globalization/GregorianCalendarTypes.cs
index 1b61e5256e..46f13b00e0 100644
--- a/src/mscorlib/shared/System/Globalization/GregorianCalendarTypes.cs
+++ b/src/mscorlib/shared/System/Globalization/GregorianCalendarTypes.cs
@@ -6,7 +6,6 @@ namespace System.Globalization
{
// Note: The values of the members of this enum must match the coresponding values
// in the CalendarId enum (since we cast between GregorianCalendarTypes and CalendarId).
- [Serializable]
public enum GregorianCalendarTypes
{
Localized = CalendarId.GREGORIAN,
diff --git a/src/mscorlib/shared/System/Globalization/HebrewCalendar.cs b/src/mscorlib/shared/System/Globalization/HebrewCalendar.cs
index b4f54f8fbb..6ba4f082f1 100644
--- a/src/mscorlib/shared/System/Globalization/HebrewCalendar.cs
+++ b/src/mscorlib/shared/System/Globalization/HebrewCalendar.cs
@@ -62,7 +62,6 @@ namespace System.Globalization
// Gregorian to Hebrew Lunar from 1583 to 2239.
- [Serializable]
public class HebrewCalendar : Calendar
{
public static readonly int HebrewEra = 1;
diff --git a/src/mscorlib/src/System/Globalization/HijriCalendar.Unix.cs b/src/mscorlib/shared/System/Globalization/HijriCalendar.Unix.cs
index a6e8f73d3e..a6e8f73d3e 100644
--- a/src/mscorlib/src/System/Globalization/HijriCalendar.Unix.cs
+++ b/src/mscorlib/shared/System/Globalization/HijriCalendar.Unix.cs
diff --git a/src/mscorlib/src/System/Globalization/HijriCalendar.Win32.cs b/src/mscorlib/shared/System/Globalization/HijriCalendar.Win32.cs
index 869b809bff..869b809bff 100644
--- a/src/mscorlib/src/System/Globalization/HijriCalendar.Win32.cs
+++ b/src/mscorlib/shared/System/Globalization/HijriCalendar.Win32.cs
diff --git a/src/mscorlib/src/System/Globalization/HijriCalendar.WinRT.cs b/src/mscorlib/shared/System/Globalization/HijriCalendar.WinRT.cs
index fb91c27ef6..fb91c27ef6 100644
--- a/src/mscorlib/src/System/Globalization/HijriCalendar.WinRT.cs
+++ b/src/mscorlib/shared/System/Globalization/HijriCalendar.WinRT.cs
diff --git a/src/mscorlib/shared/System/Globalization/HijriCalendar.cs b/src/mscorlib/shared/System/Globalization/HijriCalendar.cs
index cafde5fbb8..125248a685 100644
--- a/src/mscorlib/shared/System/Globalization/HijriCalendar.cs
+++ b/src/mscorlib/shared/System/Globalization/HijriCalendar.cs
@@ -42,7 +42,6 @@ namespace System.Globalization
** Hijri 0001/01/01 9666/04/03
*/
- [Serializable]
public partial class HijriCalendar : Calendar
{
public static readonly int HijriEra = 1;
diff --git a/src/mscorlib/src/System/Globalization/IdnMapping.Unix.cs b/src/mscorlib/shared/System/Globalization/IdnMapping.Unix.cs
index f1ad6f1d0a..2bbda0d3a7 100644
--- a/src/mscorlib/src/System/Globalization/IdnMapping.Unix.cs
+++ b/src/mscorlib/shared/System/Globalization/IdnMapping.Unix.cs
@@ -39,7 +39,7 @@ namespace System.Globalization
}
char[] outputHeap = new char[actualLength];
- fixed (char* pOutputHeap = outputHeap)
+ fixed (char* pOutputHeap = &outputHeap[0])
{
actualLength = Interop.GlobalizationInterop.ToAscii(flags, unicode, count, pOutputHeap, actualLength);
if (actualLength == 0 || actualLength > outputHeap.Length)
@@ -66,7 +66,7 @@ namespace System.Globalization
else
{
char[] output = new char[count];
- fixed (char* pOutput = output)
+ fixed (char* pOutput = &output[0])
{
return GetUnicodeCore(ascii, count, flags, pOutput, count, reattempt: true);
}
diff --git a/src/mscorlib/src/System/Globalization/JapaneseCalendar.Unix.cs b/src/mscorlib/shared/System/Globalization/JapaneseCalendar.Unix.cs
index 51ff8095a3..51ff8095a3 100644
--- a/src/mscorlib/src/System/Globalization/JapaneseCalendar.Unix.cs
+++ b/src/mscorlib/shared/System/Globalization/JapaneseCalendar.Unix.cs
diff --git a/src/mscorlib/src/System/Globalization/JapaneseCalendar.Win32.cs b/src/mscorlib/shared/System/Globalization/JapaneseCalendar.Win32.cs
index a83c4fad9e..a83c4fad9e 100644
--- a/src/mscorlib/src/System/Globalization/JapaneseCalendar.Win32.cs
+++ b/src/mscorlib/shared/System/Globalization/JapaneseCalendar.Win32.cs
diff --git a/src/mscorlib/src/System/Globalization/JapaneseCalendar.WinRT.cs b/src/mscorlib/shared/System/Globalization/JapaneseCalendar.WinRT.cs
index 6a9df97200..6a9df97200 100644
--- a/src/mscorlib/src/System/Globalization/JapaneseCalendar.WinRT.cs
+++ b/src/mscorlib/shared/System/Globalization/JapaneseCalendar.WinRT.cs
diff --git a/src/mscorlib/shared/System/Globalization/JapaneseCalendar.cs b/src/mscorlib/shared/System/Globalization/JapaneseCalendar.cs
index 4655e08a4e..0db1e6517a 100644
--- a/src/mscorlib/shared/System/Globalization/JapaneseCalendar.cs
+++ b/src/mscorlib/shared/System/Globalization/JapaneseCalendar.cs
@@ -36,7 +36,6 @@ namespace System.Globalization
============================================================================*/
- [Serializable]
public partial class JapaneseCalendar : Calendar
{
internal static readonly DateTime calendarMinValue = new DateTime(1868, 9, 8);
diff --git a/src/mscorlib/shared/System/Globalization/JapaneseLunisolarCalendar.cs b/src/mscorlib/shared/System/Globalization/JapaneseLunisolarCalendar.cs
index 95e87f85d7..a90c4e8f21 100644
--- a/src/mscorlib/shared/System/Globalization/JapaneseLunisolarCalendar.cs
+++ b/src/mscorlib/shared/System/Globalization/JapaneseLunisolarCalendar.cs
@@ -14,7 +14,6 @@ namespace System.Globalization
** JapaneseLunisolar 1960/01/01 2049/12/29
*/
- [Serializable]
public class JapaneseLunisolarCalendar : EastAsianLunisolarCalendar
{
//
diff --git a/src/mscorlib/shared/System/Globalization/JulianCalendar.cs b/src/mscorlib/shared/System/Globalization/JulianCalendar.cs
index f4678c1a85..8d94290547 100644
--- a/src/mscorlib/shared/System/Globalization/JulianCalendar.cs
+++ b/src/mscorlib/shared/System/Globalization/JulianCalendar.cs
@@ -17,7 +17,6 @@ namespace System.Globalization
//* Gregorian 0001/01/01 9999/12/31
//* Julia 0001/01/03 9999/10/19
- [Serializable]
public class JulianCalendar : Calendar
{
public static readonly int JulianEra = 1;
diff --git a/src/mscorlib/shared/System/Globalization/KoreanCalendar.cs b/src/mscorlib/shared/System/Globalization/KoreanCalendar.cs
index b962b1c427..ef7495f07d 100644
--- a/src/mscorlib/shared/System/Globalization/KoreanCalendar.cs
+++ b/src/mscorlib/shared/System/Globalization/KoreanCalendar.cs
@@ -23,7 +23,6 @@ namespace System.Globalization
============================================================================*/
- [Serializable]
public class KoreanCalendar : Calendar
{
//
diff --git a/src/mscorlib/shared/System/Globalization/KoreanLunisolarCalendar.cs b/src/mscorlib/shared/System/Globalization/KoreanLunisolarCalendar.cs
index d4c71632aa..8364532c9e 100644
--- a/src/mscorlib/shared/System/Globalization/KoreanLunisolarCalendar.cs
+++ b/src/mscorlib/shared/System/Globalization/KoreanLunisolarCalendar.cs
@@ -14,7 +14,6 @@ namespace System.Globalization
** KoreanLunisolar 918/01/01 2050/13/29
*/
- [Serializable]
public class KoreanLunisolarCalendar : EastAsianLunisolarCalendar
{
//
diff --git a/src/mscorlib/src/System/Globalization/NumberFormatInfo.cs b/src/mscorlib/shared/System/Globalization/NumberFormatInfo.cs
index c44c085a69..9fea694cca 100644
--- a/src/mscorlib/src/System/Globalization/NumberFormatInfo.cs
+++ b/src/mscorlib/shared/System/Globalization/NumberFormatInfo.cs
@@ -41,7 +41,6 @@ namespace System.Globalization
// CurrencySymbol "$" String used as local monetary symbol.
//
- [Serializable]
sealed public class NumberFormatInfo : IFormatProvider, ICloneable
{
// invariantInfo is constant irrespective of your current culture.
@@ -84,7 +83,7 @@ namespace System.Globalization
internal int percentDecimalDigits = 2;
[OptionalField(VersionAdded = 2)]
- internal int digitSubstitution = (int) DigitShapes.None;
+ internal int digitSubstitution = (int)DigitShapes.None;
internal bool isReadOnly = false;
@@ -131,7 +130,7 @@ namespace System.Globalization
Contract.EndContractBlock();
}
- private static void VerifyNativeDigits(string [] nativeDig, string propertyName)
+ private static void VerifyNativeDigits(string[] nativeDig, string propertyName)
{
if (nativeDig == null)
{
@@ -157,7 +156,7 @@ namespace System.Globalization
{
// Not 1 or 2 UTF-16 code points
throw new ArgumentException(SR.Argument_InvalidNativeDigitValue, propertyName);
- }
+ }
else if (!char.IsSurrogatePair(nativeDig[i][0], nativeDig[i][1]))
{
// 2 UTF-6 code points, but not a surrogate pair
@@ -175,8 +174,8 @@ namespace System.Globalization
}
}
- private static void VerifyDigitSubstitution(DigitShapes digitSub, string propertyName)
- {
+ private static void VerifyDigitSubstitution(DigitShapes digitSub, string propertyName)
+ {
switch (digitSub)
{
case DigitShapes.Context:
@@ -309,7 +308,7 @@ namespace System.Globalization
set
{
VerifyWritable();
- VerifyDecimalSeparator(value, "CurrencyDecimalSeparator");
+ VerifyDecimalSeparator(value, nameof(CurrencyDecimalSeparator));
currencyDecimalSeparator = value;
}
}
@@ -404,13 +403,13 @@ namespace System.Globalization
{
if (value == null)
{
- throw new ArgumentNullException("PercentGroupSizes",
+ throw new ArgumentNullException(nameof(PercentGroupSizes),
SR.ArgumentNull_Obj);
}
Contract.EndContractBlock();
VerifyWritable();
Int32[] inputSizes = (Int32[])value.Clone();
- CheckGroupSize("PercentGroupSizes", inputSizes);
+ CheckGroupSize(nameof(PercentGroupSizes), inputSizes);
percentGroupSizes = inputSizes;
}
}
@@ -807,9 +806,9 @@ namespace System.Globalization
}
}
- public string [] NativeDigits
+ public string[] NativeDigits
{
- get { return (String[]) nativeDigits.Clone(); }
+ get { return (String[])nativeDigits.Clone(); }
set
{
VerifyWritable();
@@ -820,12 +819,12 @@ namespace System.Globalization
public DigitShapes DigitSubstitution
{
- get { return (DigitShapes) digitSubstitution; }
+ get { return (DigitShapes)digitSubstitution; }
set
{
VerifyWritable();
VerifyDigitSubstitution(value, nameof(DigitSubstitution));
- digitSubstitution = (int) value;
+ digitSubstitution = (int)value;
}
}
diff --git a/src/mscorlib/shared/System/Globalization/PersianCalendar.cs b/src/mscorlib/shared/System/Globalization/PersianCalendar.cs
index 445bbd6d0c..78a081e1b9 100644
--- a/src/mscorlib/shared/System/Globalization/PersianCalendar.cs
+++ b/src/mscorlib/shared/System/Globalization/PersianCalendar.cs
@@ -19,7 +19,6 @@ namespace System.Globalization
** Persian 0001/01/01 9378/10/13
*/
- [Serializable]
public class PersianCalendar : Calendar
{
public static readonly int PersianEra = 1;
diff --git a/src/mscorlib/src/System/Globalization/SortKey.cs b/src/mscorlib/shared/System/Globalization/SortKey.cs
index 0930965e5d..d65e097cb4 100644
--- a/src/mscorlib/src/System/Globalization/SortKey.cs
+++ b/src/mscorlib/shared/System/Globalization/SortKey.cs
@@ -11,15 +11,14 @@
//
////////////////////////////////////////////////////////////////////////////
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.Serialization;
+using System.Diagnostics;
+using System.Diagnostics.Contracts;
+
namespace System.Globalization
{
- using System;
- using System.Runtime.CompilerServices;
- using System.Runtime.Serialization;
- using System.Diagnostics;
- using System.Diagnostics.Contracts;
-
- [Serializable]
public partial class SortKey
{
//--------------------------------------------------------------------//
@@ -30,8 +29,7 @@ namespace System.Globalization
internal string _localeName; // locale identifier
[OptionalField(VersionAdded = 1)] // LCID field so serialization is Whidbey compatible though we don't officially support it
- internal int _win32LCID;
- // Whidbey serialization
+ internal int _win32LCID;
internal CompareOptions _options; // options
internal string _string; // original string
@@ -45,8 +43,8 @@ namespace System.Globalization
{
_keyData = keyData;
_localeName = localeName;
- _options = options;
- _string = str;
+ _options = options;
+ _string = str;
}
[OnSerializing]
@@ -84,7 +82,7 @@ namespace System.Globalization
return (_string);
}
}
-
+
////////////////////////////////////////////////////////////////////////
//
// GetKeyData
@@ -100,7 +98,7 @@ namespace System.Globalization
return (byte[])(_keyData.Clone());
}
}
-
+
////////////////////////////////////////////////////////////////////////
//
// Compare
@@ -112,14 +110,15 @@ namespace System.Globalization
////////////////////////////////////////////////////////////////////////
public static int Compare(SortKey sortkey1, SortKey sortkey2)
{
- if (sortkey1==null || sortkey2==null)
+ if (sortkey1 == null || sortkey2 == null)
{
throw new ArgumentNullException((sortkey1 == null ? nameof(sortkey1) : nameof(sortkey2)));
}
Contract.EndContractBlock();
+
byte[] key1Data = sortkey1._keyData;
byte[] key2Data = sortkey2._keyData;
-
+
Debug.Assert(key1Data != null, "key1Data != null");
Debug.Assert(key2Data != null, "key2Data != null");
@@ -138,13 +137,13 @@ namespace System.Globalization
int compLen = (key1Data.Length < key2Data.Length) ? key1Data.Length : key2Data.Length;
- for (int i=0; i<compLen; i++)
+ for (int i = 0; i < compLen; i++)
{
- if (key1Data[i]>key2Data[i])
+ if (key1Data[i] > key2Data[i])
{
return (1);
}
- if (key1Data[i]<key2Data[i])
+ if (key1Data[i] < key2Data[i])
{
return (-1);
}
diff --git a/src/mscorlib/shared/System/Globalization/SortVersion.cs b/src/mscorlib/shared/System/Globalization/SortVersion.cs
index a7aef6d84b..94c04d7063 100644
--- a/src/mscorlib/shared/System/Globalization/SortVersion.cs
+++ b/src/mscorlib/shared/System/Globalization/SortVersion.cs
@@ -7,14 +7,14 @@ namespace System.Globalization
[Serializable]
public sealed class SortVersion : IEquatable<SortVersion>
{
- private int _nlsVersion;
- private Guid _sortId;
+ private int m_NlsVersion; // Do not rename (binary serialization)
+ private Guid m_SortId; // Do not rename (binary serialization)
public int FullVersion
{
get
{
- return _nlsVersion;
+ return m_NlsVersion;
}
}
@@ -22,19 +22,19 @@ namespace System.Globalization
{
get
{
- return _sortId;
+ return m_SortId;
}
}
public SortVersion(int fullVersion, Guid sortId)
{
- _sortId = sortId;
- _nlsVersion = fullVersion;
+ m_SortId = sortId;
+ m_NlsVersion = fullVersion;
}
internal SortVersion(int nlsVersion, int effectiveId, Guid customVersion)
{
- _nlsVersion = nlsVersion;
+ m_NlsVersion = nlsVersion;
if (customVersion == Guid.Empty)
{
@@ -45,7 +45,7 @@ namespace System.Globalization
customVersion = new Guid(0, 0, 0, 0, 0, 0, 0, b1, b2, b3, b4);
}
- _sortId = customVersion;
+ m_SortId = customVersion;
}
public override bool Equals(object obj)
@@ -66,12 +66,12 @@ namespace System.Globalization
return false;
}
- return _nlsVersion == other._nlsVersion && _sortId == other._sortId;
+ return m_NlsVersion == other.m_NlsVersion && m_SortId == other.m_SortId;
}
public override int GetHashCode()
{
- return _nlsVersion * 7 | _sortId.GetHashCode();
+ return m_NlsVersion * 7 | m_SortId.GetHashCode();
}
public static bool operator ==(SortVersion left, SortVersion right)
diff --git a/src/mscorlib/src/System/Globalization/StringInfo.cs b/src/mscorlib/shared/System/Globalization/StringInfo.cs
index f1dd30561b..87d1b9f684 100644
--- a/src/mscorlib/src/System/Globalization/StringInfo.cs
+++ b/src/mscorlib/shared/System/Globalization/StringInfo.cs
@@ -19,7 +19,6 @@ using System.Runtime.Serialization;
namespace System.Globalization
{
- [Serializable]
public class StringInfo
{
[OptionalField(VersionAdded = 2)]
@@ -93,7 +92,7 @@ namespace System.Globalization
{
if (null == value)
{
- throw new ArgumentNullException("String",
+ throw new ArgumentNullException(nameof(String),
SR.ArgumentNull_String);
}
Contract.EndContractBlock();
@@ -117,13 +116,13 @@ namespace System.Globalization
}
}
- public string SubstringByTextElements(int startingTextElement)
+ public string SubstringByTextElements(int startingTextElement)
{
// If the string is empty, no sense going further.
- if (null == this.Indexes)
+ if (null == this.Indexes)
{
// Just decide which error to give depending on the param they gave us....
- if (startingTextElement < 0)
+ if (startingTextElement < 0)
{
throw new ArgumentOutOfRangeException(nameof(startingTextElement), SR.ArgumentOutOfRange_NeedPosNum);
}
@@ -135,7 +134,7 @@ namespace System.Globalization
return (SubstringByTextElements(startingTextElement, Indexes.Length - startingTextElement));
}
- public string SubstringByTextElements(int startingTextElement, int lengthInTextElements)
+ public string SubstringByTextElements(int startingTextElement, int lengthInTextElements)
{
if (startingTextElement < 0)
{
diff --git a/src/mscorlib/shared/System/Globalization/TaiwanCalendar.cs b/src/mscorlib/shared/System/Globalization/TaiwanCalendar.cs
index 2e735e0cb9..ec4188161a 100644
--- a/src/mscorlib/shared/System/Globalization/TaiwanCalendar.cs
+++ b/src/mscorlib/shared/System/Globalization/TaiwanCalendar.cs
@@ -21,7 +21,6 @@ namespace System.Globalization
** Taiwan 01/01/01 8088/12/31
============================================================================*/
- [Serializable]
public class TaiwanCalendar : Calendar
{
//
diff --git a/src/mscorlib/shared/System/Globalization/TaiwanLunisolarCalendar.cs b/src/mscorlib/shared/System/Globalization/TaiwanLunisolarCalendar.cs
index 8ba1f278e7..1e2ec62a71 100644
--- a/src/mscorlib/shared/System/Globalization/TaiwanLunisolarCalendar.cs
+++ b/src/mscorlib/shared/System/Globalization/TaiwanLunisolarCalendar.cs
@@ -15,7 +15,6 @@ namespace System.Globalization
** TaiwanLunisolar 1912/01/01 2050/13/29
*/
- [Serializable]
public class TaiwanLunisolarCalendar : EastAsianLunisolarCalendar
{
// Since
diff --git a/src/mscorlib/shared/System/Globalization/ThaiBuddhistCalendar.cs b/src/mscorlib/shared/System/Globalization/ThaiBuddhistCalendar.cs
index 9e6e30406c..e1646bfa8e 100644
--- a/src/mscorlib/shared/System/Globalization/ThaiBuddhistCalendar.cs
+++ b/src/mscorlib/shared/System/Globalization/ThaiBuddhistCalendar.cs
@@ -20,7 +20,6 @@ namespace System.Globalization
** Thai 0544/01/01 10542/12/31
============================================================================*/
- [Serializable]
public class ThaiBuddhistCalendar : Calendar
{
// Initialize our era info.
diff --git a/src/mscorlib/shared/System/Globalization/UmAlQuraCalendar.cs b/src/mscorlib/shared/System/Globalization/UmAlQuraCalendar.cs
index b7ba6d0112..c03ac23d95 100644
--- a/src/mscorlib/shared/System/Globalization/UmAlQuraCalendar.cs
+++ b/src/mscorlib/shared/System/Globalization/UmAlQuraCalendar.cs
@@ -15,7 +15,6 @@ namespace System.Globalization
** UmAlQura 1318/01/01 1500/12/30
*/
- [Serializable]
public partial class UmAlQuraCalendar : Calendar
{
internal const int MinCalendarYear = 1318;
diff --git a/src/mscorlib/shared/System/IO/DirectoryNotFoundException.cs b/src/mscorlib/shared/System/IO/DirectoryNotFoundException.cs
index 786c2106a3..de09760fcb 100644
--- a/src/mscorlib/shared/System/IO/DirectoryNotFoundException.cs
+++ b/src/mscorlib/shared/System/IO/DirectoryNotFoundException.cs
@@ -12,7 +12,6 @@ namespace System.IO
* the Win32 errorcode-as-HRESULT ERROR_PATH_NOT_FOUND (0x80070003)
* and STG_E_PATHNOTFOUND (0x80030003).
*/
- [Serializable]
public class DirectoryNotFoundException : IOException
{
public DirectoryNotFoundException()
@@ -36,6 +35,7 @@ namespace System.IO
protected DirectoryNotFoundException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
+ throw new PlatformNotSupportedException();
}
}
}
diff --git a/src/mscorlib/src/System/IO/EncodingCache.cs b/src/mscorlib/shared/System/IO/EncodingCache.cs
index 53379bc77f..53379bc77f 100644
--- a/src/mscorlib/src/System/IO/EncodingCache.cs
+++ b/src/mscorlib/shared/System/IO/EncodingCache.cs
diff --git a/src/mscorlib/shared/System/IO/EndOfStreamException.cs b/src/mscorlib/shared/System/IO/EndOfStreamException.cs
index 7c4b2b744f..68e1b2c882 100644
--- a/src/mscorlib/shared/System/IO/EndOfStreamException.cs
+++ b/src/mscorlib/shared/System/IO/EndOfStreamException.cs
@@ -6,7 +6,6 @@ using System.Runtime.Serialization;
namespace System.IO
{
- [Serializable]
public class EndOfStreamException : IOException
{
public EndOfStreamException()
@@ -30,6 +29,7 @@ namespace System.IO
protected EndOfStreamException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
+ throw new PlatformNotSupportedException();
}
}
}
diff --git a/src/mscorlib/shared/System/IO/FileAccess.cs b/src/mscorlib/shared/System/IO/FileAccess.cs
index c6e583b34a..1b70bae172 100644
--- a/src/mscorlib/shared/System/IO/FileAccess.cs
+++ b/src/mscorlib/shared/System/IO/FileAccess.cs
@@ -9,7 +9,6 @@ namespace System.IO
// Contains constants for specifying the access you want for a file.
// You can have Read, Write or ReadWrite access.
//
- [Serializable]
[Flags]
public enum FileAccess
{
diff --git a/src/mscorlib/shared/System/IO/FileLoadException.cs b/src/mscorlib/shared/System/IO/FileLoadException.cs
index b5e197c143..6fdf2d58cf 100644
--- a/src/mscorlib/shared/System/IO/FileLoadException.cs
+++ b/src/mscorlib/shared/System/IO/FileLoadException.cs
@@ -6,7 +6,6 @@ using System.Runtime.Serialization;
namespace System.IO
{
- [Serializable]
public partial class FileLoadException : IOException
{
public FileLoadException()
@@ -83,20 +82,12 @@ namespace System.IO
protected FileLoadException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
- // Base class constructor will check info != null.
-
- FileName = info.GetString("FileLoad_FileName");
- FusionLog = info.GetString("FileLoad_FusionLog");
+ throw new PlatformNotSupportedException();
}
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
- // Serialize data for our base classes. base will verify info != null.
base.GetObjectData(info, context);
-
- // Serialize data for this class
- info.AddValue("FileLoad_FileName", FileName, typeof(string));
- info.AddValue("FileLoad_FusionLog", FusionLog, typeof(string));
}
}
}
diff --git a/src/mscorlib/shared/System/IO/FileNotFoundException.cs b/src/mscorlib/shared/System/IO/FileNotFoundException.cs
index 5d86b8f635..374c976055 100644
--- a/src/mscorlib/shared/System/IO/FileNotFoundException.cs
+++ b/src/mscorlib/shared/System/IO/FileNotFoundException.cs
@@ -7,7 +7,6 @@ using System.Runtime.Serialization;
namespace System.IO
{
// Thrown when trying to access a file that doesn't exist on disk.
- [Serializable]
public partial class FileNotFoundException : IOException
{
public FileNotFoundException()
@@ -94,20 +93,12 @@ namespace System.IO
protected FileNotFoundException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
- // Base class constructor will check info != null.
-
- FileName = info.GetString("FileNotFound_FileName");
- FusionLog = info.GetString("FileNotFound_FusionLog");
+ throw new PlatformNotSupportedException();
}
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
- // Serialize data for our base classes. base will verify info != null.
base.GetObjectData(info, context);
-
- // Serialize data for this class
- info.AddValue("FileNotFound_FileName", FileName, typeof(string));
- info.AddValue("FileNotFound_FusionLog", FusionLog, typeof(string));
}
}
}
diff --git a/src/mscorlib/shared/System/IO/FileStream.Win32.cs b/src/mscorlib/shared/System/IO/FileStream.Win32.cs
index 0045ebeaf8..61cd007895 100644
--- a/src/mscorlib/shared/System/IO/FileStream.Win32.cs
+++ b/src/mscorlib/shared/System/IO/FileStream.Win32.cs
@@ -2,13 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-using System.Buffers;
-using System.Diagnostics;
-using System.Runtime.InteropServices;
-using System.Threading;
-using System.Threading.Tasks;
using Microsoft.Win32.SafeHandles;
-using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
namespace System.IO
{
@@ -38,7 +33,8 @@ namespace System.IO
flagsAndAttributes |= (Interop.Kernel32.SecurityOptions.SECURITY_SQOS_PRESENT | Interop.Kernel32.SecurityOptions.SECURITY_ANONYMOUS);
// Don't pop up a dialog for reading from an empty floppy drive
- uint oldMode = Interop.Kernel32.SetErrorMode(Interop.Kernel32.SEM_FAILCRITICALERRORS);
+ uint oldMode;
+ bool success = Interop.Kernel32.SetThreadErrorMode(Interop.Kernel32.SEM_FAILCRITICALERRORS, out oldMode);
try
{
SafeFileHandle fileHandle = Interop.Kernel32.CreateFile(_path, fAccess, share, ref secAttrs, mode, flagsAndAttributes, IntPtr.Zero);
@@ -70,7 +66,8 @@ namespace System.IO
}
finally
{
- Interop.Kernel32.SetErrorMode(oldMode);
+ if (success)
+ Interop.Kernel32.SetThreadErrorMode(oldMode, out oldMode);
}
}
}
diff --git a/src/mscorlib/shared/System/IO/FileStream.WinRT.cs b/src/mscorlib/shared/System/IO/FileStream.WinRT.cs
index 062b160b57..b9a9f8a783 100644
--- a/src/mscorlib/shared/System/IO/FileStream.WinRT.cs
+++ b/src/mscorlib/shared/System/IO/FileStream.WinRT.cs
@@ -51,28 +51,10 @@ namespace System.IO
if (errorCode == Interop.Errors.ERROR_PATH_NOT_FOUND && _path.Length == PathInternal.GetRootLength(_path))
errorCode = Interop.Errors.ERROR_ACCESS_DENIED;
- throw Win32Marshal.GetExceptionForWin32Error(errorCode, $"{_path} {options} {fAccess} {share} {mode}");
+ throw Win32Marshal.GetExceptionForWin32Error(errorCode, _path);
}
return fileHandle;
}
-
-#if PROJECTN
- // TODO: These internal methods should be removed once we start consuming updated CoreFX builds
- public static FileStream InternalOpen(string path, int bufferSize = 4096, bool useAsync = true)
- {
- return new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read, bufferSize, useAsync);
- }
-
- public static FileStream InternalCreate(string path, int bufferSize = 4096, bool useAsync = true)
- {
- return new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.Read, bufferSize, useAsync);
- }
-
- public static FileStream InternalAppend(string path, int bufferSize = 4096, bool useAsync = true)
- {
- return new FileStream(path, FileMode.Append, FileAccess.Write, FileShare.Read, bufferSize, useAsync);
- }
-#endif
}
}
diff --git a/src/mscorlib/shared/System/IO/FileStream.Windows.cs b/src/mscorlib/shared/System/IO/FileStream.Windows.cs
index 7c09ae1a1c..c036ee6a83 100644
--- a/src/mscorlib/shared/System/IO/FileStream.Windows.cs
+++ b/src/mscorlib/shared/System/IO/FileStream.Windows.cs
@@ -1599,7 +1599,7 @@ namespace System.IO
{
var awaitable = (AsyncCopyToAwaitable)ThreadPoolBoundHandle.GetNativeOverlappedState(pOVERLAP);
- Debug.Assert(awaitable._continuation != s_sentinel, "Sentinel must not have already been set as the continuation");
+ Debug.Assert(!ReferenceEquals(awaitable._continuation, s_sentinel), "Sentinel must not have already been set as the continuation");
awaitable._errorCode = errorCode;
awaitable._numBytes = numBytes;
@@ -1617,15 +1617,15 @@ namespace System.IO
}
public AsyncCopyToAwaitable GetAwaiter() => this;
- public bool IsCompleted => _continuation == s_sentinel;
+ public bool IsCompleted => ReferenceEquals(_continuation, s_sentinel);
public void GetResult() { }
public void OnCompleted(Action continuation) => UnsafeOnCompleted(continuation);
public void UnsafeOnCompleted(Action continuation)
{
- if (_continuation == s_sentinel ||
+ if (ReferenceEquals(_continuation, s_sentinel) ||
Interlocked.CompareExchange(ref _continuation, continuation, null) != null)
{
- Debug.Assert(_continuation == s_sentinel, $"Expected continuation set to s_sentinel, got ${_continuation}");
+ Debug.Assert(ReferenceEquals(_continuation, s_sentinel), $"Expected continuation set to s_sentinel, got ${_continuation}");
Task.Run(continuation);
}
}
diff --git a/src/mscorlib/shared/System/IO/Path.Unix.cs b/src/mscorlib/shared/System/IO/Path.Unix.cs
index 500c60aa8c..68c5f70036 100644
--- a/src/mscorlib/shared/System/IO/Path.Unix.cs
+++ b/src/mscorlib/shared/System/IO/Path.Unix.cs
@@ -23,7 +23,7 @@ namespace System.IO
throw new ArgumentNullException(nameof(path));
if (path.Length == 0)
- throw new ArgumentException(SR.Arg_PathIllegal);
+ throw new ArgumentException(SR.Arg_PathIllegal, nameof(path));
PathInternal.CheckInvalidPathChars(path);
@@ -193,10 +193,15 @@ namespace System.IO
return path.Length > 0 && path[0] == PathInternal.DirectorySeparatorChar;
}
+ // The resulting string is null if path is null. If the path is empty or
+ // only contains whitespace characters an ArgumentException gets thrown.
public static string GetPathRoot(string path)
{
if (path == null) return null;
- return IsPathRooted(path) ? PathInternal.DirectorySeparatorCharAsString : String.Empty;
+ if (string.IsNullOrWhiteSpace(path))
+ throw new ArgumentException(SR.Arg_PathIllegal, nameof(path));
+
+ return IsPathRooted(path) ? PathInternal.DirectorySeparatorCharAsString : String.Empty;
}
/// <summary>Gets whether the system is case-sensitive.</summary>
diff --git a/src/mscorlib/shared/System/IO/Path.Windows.cs b/src/mscorlib/shared/System/IO/Path.Windows.cs
index d6f0c628c3..1e573cd95d 100644
--- a/src/mscorlib/shared/System/IO/Path.Windows.cs
+++ b/src/mscorlib/shared/System/IO/Path.Windows.cs
@@ -136,10 +136,14 @@ namespace System.IO
// path on the current drive), "X:" (a relative path on a given drive,
// where X is the drive letter), "X:\" (an absolute path on a given drive),
// and "\\server\share" (a UNC path for a given server and share name).
- // The resulting string is null if path is null.
+ // The resulting string is null if path is null. If the path is empty or
+ // only contains whitespace characters an ArgumentException gets thrown.
public static string GetPathRoot(string path)
{
if (path == null) return null;
+ if (string.IsNullOrWhiteSpace(path))
+ throw new ArgumentException(SR.Arg_PathIllegal, nameof(path));
+
PathInternal.CheckInvalidPathChars(path);
// Need to return the normalized directory separator
diff --git a/src/mscorlib/shared/System/IO/Path.cs b/src/mscorlib/shared/System/IO/Path.cs
index b3a8783c32..9feb2873d8 100644
--- a/src/mscorlib/shared/System/IO/Path.cs
+++ b/src/mscorlib/shared/System/IO/Path.cs
@@ -76,19 +76,23 @@ namespace System.IO
// "\\server\share").
public static string GetDirectoryName(string path)
{
- if (path != null)
+ if (string.IsNullOrWhiteSpace(path))
{
- PathInternal.CheckInvalidPathChars(path);
- path = PathInternal.NormalizeDirectorySeparators(path);
- int root = PathInternal.GetRootLength(path);
+ if (path == null) return null;
+ throw new ArgumentException(SR.Arg_PathIllegal, nameof(path));
+ }
- int i = path.Length;
- if (i > root)
- {
- while (i > root && !PathInternal.IsDirectorySeparator(path[--i])) ;
- return path.Substring(0, i);
- }
+ PathInternal.CheckInvalidPathChars(path);
+ path = PathInternal.NormalizeDirectorySeparators(path);
+ int root = PathInternal.GetRootLength(path);
+
+ int i = path.Length;
+ if (i > root)
+ {
+ while (i > root && !PathInternal.IsDirectorySeparator(path[--i])) ;
+ return path.Substring(0, i);
}
+
return null;
}
diff --git a/src/mscorlib/shared/System/IO/PathInternal.Unix.cs b/src/mscorlib/shared/System/IO/PathInternal.Unix.cs
index 08dc1d0251..ac9c4e77cd 100644
--- a/src/mscorlib/shared/System/IO/PathInternal.Unix.cs
+++ b/src/mscorlib/shared/System/IO/PathInternal.Unix.cs
@@ -100,5 +100,10 @@ namespace System.IO
// As long as the path is rooted in Unix it doesn't use the current directory and therefore is fully qualified.
return !Path.IsPathRooted(path);
}
+
+ internal static string TrimEndingDirectorySeparator(string path) =>
+ path.Length > 1 && IsDirectorySeparator(path[path.Length - 1]) ? // exclude root "/"
+ path.Substring(0, path.Length - 1) :
+ path;
}
}
diff --git a/src/mscorlib/shared/System/IO/PathInternal.Windows.cs b/src/mscorlib/shared/System/IO/PathInternal.Windows.cs
index ee0dd54383..ee2d29c032 100644
--- a/src/mscorlib/shared/System/IO/PathInternal.Windows.cs
+++ b/src/mscorlib/shared/System/IO/PathInternal.Windows.cs
@@ -438,5 +438,10 @@ namespace System.IO
{
return IsDirectorySeparator(ch) || VolumeSeparatorChar == ch;
}
+
+ internal static string TrimEndingDirectorySeparator(string path) =>
+ EndsInDirectorySeparator(path) ?
+ path.Substring(0, path.Length - 1) :
+ path;
}
}
diff --git a/src/mscorlib/shared/System/IO/PathTooLongException.cs b/src/mscorlib/shared/System/IO/PathTooLongException.cs
index 613af051ca..64c8e6c7e6 100644
--- a/src/mscorlib/shared/System/IO/PathTooLongException.cs
+++ b/src/mscorlib/shared/System/IO/PathTooLongException.cs
@@ -8,7 +8,6 @@ using System.Runtime.Serialization;
namespace System.IO
{
- [Serializable]
public class PathTooLongException : IOException
{
public PathTooLongException()
@@ -32,6 +31,7 @@ namespace System.IO
protected PathTooLongException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
+ throw new PlatformNotSupportedException();
}
}
}
diff --git a/src/mscorlib/src/System/IO/PinnedBufferMemoryStream.cs b/src/mscorlib/shared/System/IO/PinnedBufferMemoryStream.cs
index 284cd927dc..c8e720b7ac 100644
--- a/src/mscorlib/src/System/IO/PinnedBufferMemoryStream.cs
+++ b/src/mscorlib/shared/System/IO/PinnedBufferMemoryStream.cs
@@ -26,9 +26,6 @@ namespace System.IO
private byte[] _array;
private GCHandle _pinningHandle;
- // The new inheritance model requires a Critical default ctor since base (UnmanagedMemoryStream) has one
- private PinnedBufferMemoryStream() : base() { }
-
internal PinnedBufferMemoryStream(byte[] array)
{
Debug.Assert(array != null, "Array can't be null");
@@ -42,7 +39,7 @@ namespace System.IO
}
_array = array;
- _pinningHandle = new GCHandle(array, GCHandleType.Pinned);
+ _pinningHandle = GCHandle.Alloc(array, GCHandleType.Pinned);
// Now the byte[] is pinned for the lifetime of this instance.
// But I also need to get a pointer to that block of memory...
fixed (byte* ptr = &_array[0])
@@ -56,20 +53,11 @@ namespace System.IO
protected override void Dispose(bool disposing)
{
- if (_isOpen)
+ if (_pinningHandle.IsAllocated)
{
_pinningHandle.Free();
- _isOpen = false;
- }
-#if _DEBUG
- // To help track down lifetime issues on checked builds, force
- //a full GC here.
- if (disposing)
- {
- GC.Collect();
- GC.WaitForPendingFinalizers();
}
-#endif
+
base.Dispose(disposing);
}
}
diff --git a/src/mscorlib/src/System/IO/UnmanagedMemoryStream.cs b/src/mscorlib/shared/System/IO/UnmanagedMemoryStream.cs
index f21fe47371..b78f50fe7b 100644
--- a/src/mscorlib/src/System/IO/UnmanagedMemoryStream.cs
+++ b/src/mscorlib/shared/System/IO/UnmanagedMemoryStream.cs
@@ -2,28 +2,13 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-/*============================================================
-**
-**
-**
-**
-** Purpose: Create a stream over unmanaged memory, mostly
-** useful for memory-mapped files.
-**
-**
-===========================================================*/
-
-using System;
-using System.Runtime;
+using System.Diagnostics;
+using System.Diagnostics.Contracts;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
-using System.Security;
using System.Threading;
-using System.Diagnostics;
-using System.Diagnostics.Contracts;
using System.Threading.Tasks;
-
namespace System.IO
{
/*
@@ -47,45 +32,14 @@ namespace System.IO
* call free, run a user-provided delegate to free the memory, etc.
* We'll suggest user write a subclass of UnmanagedMemoryStream that uses
* a SafeHandle subclass to hold onto the memory.
- * Check for problems when using this in the negative parts of a
- * process's address space. We may need to use unsigned longs internally
- * and change the overflow detection logic.
- *
- * -----SECURITY MODEL AND SILVERLIGHT-----
- * A few key notes about exposing UMS in silverlight:
- * 1. No ctors are exposed to transparent code. This version of UMS only
- * supports byte* (not SafeBuffer). Therefore, framework code can create
- * a UMS and hand it to transparent code. Transparent code can use most
- * operations on a UMS, but not operations that directly expose a
- * pointer.
- *
- * 2. Scope of "unsafe" and non-CLS compliant operations reduced: The
- * Whidbey version of this class has CLSCompliant(false) at the class
- * level and unsafe modifiers at the method level. These were reduced to
- * only where the unsafe operation is performed -- i.e. immediately
- * around the pointer manipulation. Note that this brings UMS in line
- * with recent changes in pu/clr to support SafeBuffer.
*
- * 3. Currently, the only caller that creates a UMS is ResourceManager,
- * which creates read-only UMSs, and therefore operations that can
- * change the length will throw because write isn't supported. A
- * conservative option would be to formalize the concept that _only_
- * read-only UMSs can be creates, and enforce this by making WriteX and
- * SetLength SecurityCritical. However, this is a violation of
- * security inheritance rules, so we must keep these safe. The
- * following notes make this acceptable for future use.
- * a. a race condition in WriteX that could have allowed a thread to
- * read from unzeroed memory was fixed
- * b. memory region cannot be expanded beyond _capacity; in other
- * words, a UMS creator is saying a writable UMS is safe to
- * write to anywhere in the memory range up to _capacity, specified
- * in the ctor. Even if the caller doesn't specify a capacity, then
- * length is used as the capacity.
*/
+
+ /// <summary>
+ /// Stream over a memory pointer or over a SafeBuffer
+ /// </summary>
public class UnmanagedMemoryStream : Stream
{
- private const long UnmanagedMemStreamMaxLength = Int64.MaxValue;
-
private SafeBuffer _buffer;
private unsafe byte* _mem;
private long _length;
@@ -93,11 +47,12 @@ namespace System.IO
private long _position;
private long _offset;
private FileAccess _access;
- internal bool _isOpen;
- [NonSerialized]
+ private bool _isOpen;
private Task<Int32> _lastReadTask; // The last successful task returned from ReadAsync
-
+ /// <summary>
+ /// Creates a closed stream.
+ /// </summary>
// Needed for subclasses that need to map a file, etc.
protected UnmanagedMemoryStream()
{
@@ -108,16 +63,32 @@ namespace System.IO
_isOpen = false;
}
+ /// <summary>
+ /// Creates a stream over a SafeBuffer.
+ /// </summary>
+ /// <param name="buffer"></param>
+ /// <param name="offset"></param>
+ /// <param name="length"></param>
public UnmanagedMemoryStream(SafeBuffer buffer, long offset, long length)
{
Initialize(buffer, offset, length, FileAccess.Read);
}
+ /// <summary>
+ /// Creates a stream over a SafeBuffer.
+ /// </summary>
public UnmanagedMemoryStream(SafeBuffer buffer, long offset, long length, FileAccess access)
{
Initialize(buffer, offset, length, access);
}
+ /// <summary>
+ /// Subclasses must call this method (or the other overload) to properly initialize all instance fields.
+ /// </summary>
+ /// <param name="buffer"></param>
+ /// <param name="offset"></param>
+ /// <param name="length"></param>
+ /// <param name="access"></param>
protected void Initialize(SafeBuffer buffer, long offset, long length, FileAccess access)
{
if (buffer == null)
@@ -177,18 +148,27 @@ namespace System.IO
_isOpen = true;
}
+ /// <summary>
+ /// Creates a stream over a byte*.
+ /// </summary>
[CLSCompliant(false)]
public unsafe UnmanagedMemoryStream(byte* pointer, long length)
{
Initialize(pointer, length, length, FileAccess.Read);
}
+ /// <summary>
+ /// Creates a stream over a byte*.
+ /// </summary>
[CLSCompliant(false)]
public unsafe UnmanagedMemoryStream(byte* pointer, long length, long capacity, FileAccess access)
{
Initialize(pointer, length, capacity, access);
}
+ /// <summary>
+ /// Subclasses must call this method (or the other overload) to properly initialize all instance fields.
+ /// </summary>
[CLSCompliant(false)]
protected unsafe void Initialize(byte* pointer, long length, long capacity, FileAccess access)
{
@@ -215,24 +195,37 @@ namespace System.IO
_isOpen = true;
}
+ /// <summary>
+ /// Returns true if the stream can be read; otherwise returns false.
+ /// </summary>
public override bool CanRead
{
[Pure]
get { return _isOpen && (_access & FileAccess.Read) != 0; }
}
+ /// <summary>
+ /// Returns true if the stream can seek; otherwise returns false.
+ /// </summary>
public override bool CanSeek
{
[Pure]
get { return _isOpen; }
}
+ /// <summary>
+ /// Returns true if the stream can be written to; otherwise returns false.
+ /// </summary>
public override bool CanWrite
{
[Pure]
get { return _isOpen && (_access & FileAccess.Write) != 0; }
}
+ /// <summary>
+ /// Closes the stream. The stream's memory needs to be dealt with separately.
+ /// </summary>
+ /// <param name="disposing"></param>
protected override void Dispose(bool disposing)
{
_isOpen = false;
@@ -244,11 +237,19 @@ namespace System.IO
base.Dispose(disposing);
}
+ /// <summary>
+ /// Since it's a memory stream, this method does nothing.
+ /// </summary>
public override void Flush()
{
- if (!_isOpen) __Error.StreamIsClosed();
+ if (!_isOpen) throw Error.GetStreamIsClosed();
}
+ /// <summary>
+ /// Since it's a memory stream, this method does nothing specific.
+ /// </summary>
+ /// <param name="cancellationToken"></param>
+ /// <returns></returns>
public override Task FlushAsync(CancellationToken cancellationToken)
{
if (cancellationToken.IsCancellationRequested)
@@ -265,98 +266,92 @@ namespace System.IO
}
}
-
+ /// <summary>
+ /// Number of bytes in the stream.
+ /// </summary>
public override long Length
{
get
{
- if (!_isOpen) __Error.StreamIsClosed();
+ if (!_isOpen) throw Error.GetStreamIsClosed();
return Interlocked.Read(ref _length);
}
}
+ /// <summary>
+ /// Number of bytes that can be written to the stream.
+ /// </summary>
public long Capacity
{
get
{
- if (!_isOpen) __Error.StreamIsClosed();
+ if (!_isOpen) throw Error.GetStreamIsClosed();
return _capacity;
}
}
+ /// <summary>
+ /// ReadByte will read byte at the Position in the stream
+ /// </summary>
public override long Position
{
get
{
- if (!CanSeek) __Error.StreamIsClosed();
+ if (!CanSeek) throw Error.GetStreamIsClosed();
Contract.EndContractBlock();
return Interlocked.Read(ref _position);
}
set
{
- if (value < 0)
- throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_NeedNonNegNum);
+ if (value < 0) throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_NeedNonNegNum);
+ if (!CanSeek) throw Error.GetStreamIsClosed();
Contract.EndContractBlock();
- if (!CanSeek) __Error.StreamIsClosed();
-#if !BIT64
- unsafe {
- // On 32 bit machines, ensure we don't wrap around.
- if (value > (long) Int32.MaxValue || _mem + value < _mem)
- throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_StreamLength);
- }
-#endif
Interlocked.Exchange(ref _position, value);
}
}
+ /// <summary>
+ /// Pointer to memory at the current Position in the stream.
+ /// </summary>
[CLSCompliant(false)]
public unsafe byte* PositionPointer
{
get
{
- if (_buffer != null)
- {
- throw new NotSupportedException(SR.NotSupported_UmsSafeBuffer);
- }
+ if (_buffer != null) throw new NotSupportedException(SR.NotSupported_UmsSafeBuffer);
+ if (!_isOpen) throw Error.GetStreamIsClosed();
// Use a temp to avoid a race
long pos = Interlocked.Read(ref _position);
if (pos > _capacity)
throw new IndexOutOfRangeException(SR.IndexOutOfRange_UMSPosition);
byte* ptr = _mem + pos;
- if (!_isOpen) __Error.StreamIsClosed();
return ptr;
}
set
{
- if (_buffer != null)
- throw new NotSupportedException(SR.NotSupported_UmsSafeBuffer);
- if (!_isOpen) __Error.StreamIsClosed();
+ if (_buffer != null) throw new NotSupportedException(SR.NotSupported_UmsSafeBuffer);
+ if (!_isOpen) throw Error.GetStreamIsClosed();
- // Note: subtracting pointers returns an Int64. Working around
- // to avoid hitting compiler warning CS0652 on this line.
- if (new IntPtr(value - _mem).ToInt64() > UnmanagedMemStreamMaxLength)
- throw new ArgumentOutOfRangeException("offset", SR.ArgumentOutOfRange_UnmanagedMemStreamLength);
if (value < _mem)
throw new IOException(SR.IO_SeekBeforeBegin);
+ long newPosition = (long)value - (long)_mem;
+ if (newPosition < 0)
+ throw new ArgumentOutOfRangeException("offset", SR.ArgumentOutOfRange_UnmanagedMemStreamLength);
- Interlocked.Exchange(ref _position, value - _mem);
- }
- }
-
- internal unsafe byte* Pointer
- {
- get
- {
- if (_buffer != null)
- throw new NotSupportedException(SR.NotSupported_UmsSafeBuffer);
-
- return _mem;
+ Interlocked.Exchange(ref _position, newPosition);
}
}
- public override int Read([In, Out] byte[] buffer, int offset, int count)
+ /// <summary>
+ /// Reads bytes from stream and puts them into the buffer
+ /// </summary>
+ /// <param name="buffer">Buffer to read the bytes to.</param>
+ /// <param name="offset">Starting index in the buffer.</param>
+ /// <param name="count">Maximum number of bytes to read.</param>
+ /// <returns>Number of bytes actually read.</returns>
+ public override int Read(byte[] buffer, int offset, int count)
{
if (buffer == null)
throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer);
@@ -368,8 +363,8 @@ namespace System.IO
throw new ArgumentException(SR.Argument_InvalidOffLen);
Contract.EndContractBlock(); // Keep this in sync with contract validation in ReadAsync
- if (!_isOpen) __Error.StreamIsClosed();
- if (!CanRead) __Error.ReadNotSupported();
+ if (!_isOpen) throw Error.GetStreamIsClosed();
+ if (!CanRead) throw Error.GetReadNotSupported();
// Use a local variable to avoid a race where another thread
// changes our position after we decide we can read some bytes.
@@ -418,6 +413,14 @@ namespace System.IO
return nInt;
}
+ /// <summary>
+ /// Reads bytes from stream and puts them into the buffer
+ /// </summary>
+ /// <param name="buffer">Buffer to read the bytes to.</param>
+ /// <param name="offset">Starting index in the buffer.</param>
+ /// <param name="count">Maximum number of bytes to read.</param>
+ /// <param name="cancellationToken">Token that can be used to cancel this operation.</param>
+ /// <returns>Task that can be used to access the number of bytes actually read.</returns>
public override Task<Int32> ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
{
if (buffer == null)
@@ -446,10 +449,14 @@ namespace System.IO
}
}
+ /// <summary>
+ /// Returns the byte at the stream current Position and advances the Position.
+ /// </summary>
+ /// <returns></returns>
public override int ReadByte()
{
- if (!_isOpen) __Error.StreamIsClosed();
- if (!CanRead) __Error.ReadNotSupported();
+ if (!_isOpen) throw Error.GetStreamIsClosed();
+ if (!CanRead) throw Error.GetReadNotSupported();
long pos = Interlocked.Read(ref _position); // Use a local to avoid a race condition
long len = Interlocked.Read(ref _length);
@@ -487,11 +494,15 @@ namespace System.IO
return result;
}
+ /// <summary>
+ /// Advanced the Position to specific location in the stream.
+ /// </summary>
+ /// <param name="offset">Offset from the loc parameter.</param>
+ /// <param name="loc">Origin for the offset parameter.</param>
+ /// <returns></returns>
public override long Seek(long offset, SeekOrigin loc)
{
- if (!_isOpen) __Error.StreamIsClosed();
- if (offset > UnmanagedMemStreamMaxLength)
- throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentOutOfRange_UnmanagedMemStreamLength);
+ if (!_isOpen) throw Error.GetStreamIsClosed();
switch (loc)
{
case SeekOrigin.Begin:
@@ -523,15 +534,19 @@ namespace System.IO
return finalPos;
}
+ /// <summary>
+ /// Sets the Length of the stream.
+ /// </summary>
+ /// <param name="value"></param>
public override void SetLength(long value)
{
if (value < 0)
- throw new ArgumentOutOfRangeException("length", SR.ArgumentOutOfRange_NeedNonNegNum);
+ throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
if (_buffer != null)
throw new NotSupportedException(SR.NotSupported_UmsSafeBuffer);
- if (!_isOpen) __Error.StreamIsClosed();
- if (!CanWrite) __Error.WriteNotSupported();
+ if (!_isOpen) throw Error.GetStreamIsClosed();
+ if (!CanWrite) throw Error.GetWriteNotSupported();
if (value > _capacity)
throw new IOException(SR.IO_FixedCapacity);
@@ -552,6 +567,12 @@ namespace System.IO
}
}
+ /// <summary>
+ /// Writes buffer into the stream
+ /// </summary>
+ /// <param name="buffer">Buffer that will be written.</param>
+ /// <param name="offset">Starting index in the buffer.</param>
+ /// <param name="count">Number of bytes to write.</param>
public override void Write(byte[] buffer, int offset, int count)
{
if (buffer == null)
@@ -564,8 +585,8 @@ namespace System.IO
throw new ArgumentException(SR.Argument_InvalidOffLen);
Contract.EndContractBlock(); // Keep contract validation in sync with WriteAsync(..)
- if (!_isOpen) __Error.StreamIsClosed();
- if (!CanWrite) __Error.WriteNotSupported();
+ if (!_isOpen) throw Error.GetStreamIsClosed();
+ if (!CanWrite) throw Error.GetWriteNotSupported();
long pos = Interlocked.Read(ref _position); // Use a local to avoid a race condition
long len = Interlocked.Read(ref _length);
@@ -635,6 +656,14 @@ namespace System.IO
return;
}
+ /// <summary>
+ /// Writes buffer into the stream. The operation completes synchronously.
+ /// </summary>
+ /// <param name="buffer">Buffer that will be written.</param>
+ /// <param name="offset">Starting index in the buffer.</param>
+ /// <param name="count">Number of bytes to write.</param>
+ /// <param name="cancellationToken">Token that can be used to cancel the operation.</param>
+ /// <returns>Task that can be awaited </returns>
public override Task WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
{
if (buffer == null)
@@ -658,15 +687,18 @@ namespace System.IO
catch (Exception ex)
{
Debug.Assert(!(ex is OperationCanceledException));
- return Task.FromException<Int32>(ex);
+ return Task.FromException(ex);
}
}
-
+ /// <summary>
+ /// Writes a byte to the stream and advances the current Position.
+ /// </summary>
+ /// <param name="value"></param>
public override void WriteByte(byte value)
{
- if (!_isOpen) __Error.StreamIsClosed();
- if (!CanWrite) __Error.WriteNotSupported();
+ if (!_isOpen) throw Error.GetStreamIsClosed();
+ if (!CanWrite) throw Error.GetWriteNotSupported();
long pos = Interlocked.Read(ref _position); // Use a local to avoid a race condition
long len = Interlocked.Read(ref _length);
diff --git a/src/mscorlib/src/System/IO/UnmanagedMemoryStreamWrapper.cs b/src/mscorlib/shared/System/IO/UnmanagedMemoryStreamWrapper.cs
index 86e4707dfd..d547e771d7 100644
--- a/src/mscorlib/src/System/IO/UnmanagedMemoryStreamWrapper.cs
+++ b/src/mscorlib/shared/System/IO/UnmanagedMemoryStreamWrapper.cs
@@ -34,19 +34,16 @@ namespace System.IO
public override bool CanRead
{
- [Pure]
get { return _unmanagedStream.CanRead; }
}
public override bool CanSeek
{
- [Pure]
get { return _unmanagedStream.CanSeek; }
}
public override bool CanWrite
{
- [Pure]
get { return _unmanagedStream.CanWrite; }
}
@@ -55,7 +52,7 @@ namespace System.IO
try
{
if (disposing)
- _unmanagedStream.Close();
+ _unmanagedStream.Dispose();
}
finally
{
@@ -112,7 +109,7 @@ namespace System.IO
}
}
- public override int Read([In, Out] byte[] buffer, int offset, int count)
+ public override int Read(byte[] buffer, int offset, int count)
{
return _unmanagedStream.Read(buffer, offset, count);
}
@@ -129,11 +126,8 @@ namespace System.IO
public unsafe override byte[] ToArray()
{
- if (!_unmanagedStream._isOpen) __Error.StreamIsClosed();
- if (!_unmanagedStream.CanRead) __Error.ReadNotSupported();
-
byte[] buffer = new byte[_unmanagedStream.Length];
- Buffer.Memcpy(buffer, 0, _unmanagedStream.Pointer, 0, (int)_unmanagedStream.Length);
+ _unmanagedStream.Read(buffer, 0, (int)_unmanagedStream.Length);
return buffer;
}
@@ -154,9 +148,6 @@ namespace System.IO
throw new ArgumentNullException(nameof(stream), SR.ArgumentNull_Stream);
Contract.EndContractBlock();
- if (!_unmanagedStream._isOpen) __Error.StreamIsClosed();
- if (!CanRead) __Error.ReadNotSupported();
-
byte[] buffer = ToArray();
stream.Write(buffer, 0, buffer.Length);
@@ -217,4 +208,3 @@ namespace System.IO
} // class UnmanagedMemoryStreamWrapper
} // namespace
-
diff --git a/src/mscorlib/shared/System/IndexOutOfRangeException.cs b/src/mscorlib/shared/System/IndexOutOfRangeException.cs
index 4969c2b86d..d5b24b35d5 100644
--- a/src/mscorlib/shared/System/IndexOutOfRangeException.cs
+++ b/src/mscorlib/shared/System/IndexOutOfRangeException.cs
@@ -15,7 +15,6 @@ using System.Runtime.Serialization;
namespace System
{
- [Serializable]
public sealed class IndexOutOfRangeException : SystemException
{
public IndexOutOfRangeException()
@@ -35,7 +34,5 @@ namespace System
{
HResult = __HResults.COR_E_INDEXOUTOFRANGE;
}
-
- internal IndexOutOfRangeException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}
diff --git a/src/mscorlib/shared/System/InsufficientExecutionStackException.cs b/src/mscorlib/shared/System/InsufficientExecutionStackException.cs
index b9a4a12ddd..41df3ae970 100644
--- a/src/mscorlib/shared/System/InsufficientExecutionStackException.cs
+++ b/src/mscorlib/shared/System/InsufficientExecutionStackException.cs
@@ -6,7 +6,6 @@ using System.Runtime.Serialization;
namespace System
{
- [Serializable]
public sealed class InsufficientExecutionStackException : SystemException
{
public InsufficientExecutionStackException()
@@ -26,7 +25,5 @@ namespace System
{
HResult = __HResults.COR_E_INSUFFICIENTEXECUTIONSTACK;
}
-
- internal InsufficientExecutionStackException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}
diff --git a/src/mscorlib/shared/System/InvalidCastException.cs b/src/mscorlib/shared/System/InvalidCastException.cs
index 01d92b2837..cf359ac0b5 100644
--- a/src/mscorlib/shared/System/InvalidCastException.cs
+++ b/src/mscorlib/shared/System/InvalidCastException.cs
@@ -12,7 +12,6 @@ using System.Runtime.Serialization;
namespace System
{
- [Serializable]
public class InvalidCastException : SystemException
{
public InvalidCastException()
@@ -39,6 +38,9 @@ namespace System
HResult = errorCode;
}
- protected InvalidCastException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ protected InvalidCastException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ throw new PlatformNotSupportedException();
+ }
}
}
diff --git a/src/mscorlib/shared/System/InvalidOperationException.cs b/src/mscorlib/shared/System/InvalidOperationException.cs
index 24a08c8089..ad743e05ff 100644
--- a/src/mscorlib/shared/System/InvalidOperationException.cs
+++ b/src/mscorlib/shared/System/InvalidOperationException.cs
@@ -16,7 +16,6 @@ using System.Runtime.Serialization;
namespace System
{
- [Serializable]
public class InvalidOperationException : SystemException
{
public InvalidOperationException()
@@ -37,6 +36,9 @@ namespace System
HResult = __HResults.COR_E_INVALIDOPERATION;
}
- protected InvalidOperationException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ protected InvalidOperationException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ throw new PlatformNotSupportedException();
+ }
}
}
diff --git a/src/mscorlib/shared/System/InvalidProgramException.cs b/src/mscorlib/shared/System/InvalidProgramException.cs
index 401b3a0ddb..47e7325836 100644
--- a/src/mscorlib/shared/System/InvalidProgramException.cs
+++ b/src/mscorlib/shared/System/InvalidProgramException.cs
@@ -15,7 +15,6 @@ using System.Runtime.Serialization;
namespace System
{
- [Serializable]
public sealed class InvalidProgramException : SystemException
{
public InvalidProgramException()
@@ -35,7 +34,5 @@ namespace System
{
HResult = __HResults.COR_E_INVALIDPROGRAM;
}
-
- internal InvalidProgramException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}
diff --git a/src/mscorlib/shared/System/InvalidTimeZoneException.cs b/src/mscorlib/shared/System/InvalidTimeZoneException.cs
index 8f0751c426..8b300f453d 100644
--- a/src/mscorlib/shared/System/InvalidTimeZoneException.cs
+++ b/src/mscorlib/shared/System/InvalidTimeZoneException.cs
@@ -6,7 +6,6 @@ using System.Runtime.Serialization;
namespace System
{
- [Serializable]
public class InvalidTimeZoneException : Exception
{
public InvalidTimeZoneException()
@@ -23,6 +22,9 @@ namespace System
{
}
- protected InvalidTimeZoneException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ protected InvalidTimeZoneException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ throw new PlatformNotSupportedException();
+ }
}
}
diff --git a/src/mscorlib/shared/System/Lazy.cs b/src/mscorlib/shared/System/Lazy.cs
index 55f915b65d..5d68714c7e 100644
--- a/src/mscorlib/shared/System/Lazy.cs
+++ b/src/mscorlib/shared/System/Lazy.cs
@@ -182,7 +182,6 @@ namespace System
/// using parameters to the type's constructors.
/// </para>
/// </remarks>
- [Serializable]
[DebuggerTypeProxy(typeof(System_LazyDebugView<>))]
[DebuggerDisplay("ThreadSafetyMode={Mode}, IsValueCreated={IsValueCreated}, IsValueFaulted={IsValueFaulted}, Value={ValueForDebugDisplay}")]
public class Lazy<T>
@@ -202,7 +201,7 @@ namespace System
private Func<T> _factory;
// _value eventually stores the lazily created value. It is valid when _state = null.
- private T _value;
+ private T m_value; // Do not rename (binary serialization)
/// <summary>
/// Initializes a new instance of the <see cref="T:System.Threading.Lazy{T}"/> class that
@@ -226,7 +225,7 @@ namespace System
/// </remarks>
public Lazy(T value)
{
- _value = value;
+ m_value = value;
}
/// <summary>
@@ -312,7 +311,7 @@ namespace System
private void ViaConstructor()
{
- _value = CreateViaDefaultConstructor();
+ m_value = CreateViaDefaultConstructor();
_state = null; // volatile write, must occur after setting _value
}
@@ -325,7 +324,7 @@ namespace System
throw new InvalidOperationException(SR.Lazy_Value_RecursiveCallsToValue);
_factory = null;
- _value = factory();
+ m_value = factory();
_state = null; // volatile write, must occur after setting _value
}
catch (Exception exception)
@@ -361,7 +360,7 @@ namespace System
if (previous == publicationOnly)
{
_factory = null;
- _value = possibleValue;
+ m_value = possibleValue;
_state = null; // volatile write, must occur after setting _value
}
}
@@ -469,7 +468,7 @@ namespace System
{
return default(T);
}
- return _value;
+ return m_value;
}
}
@@ -516,7 +515,7 @@ namespace System
/// from initialization delegate.
/// </remarks>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
- public T Value => _state == null ? _value : CreateValue();
+ public T Value => _state == null ? m_value : CreateValue();
}
/// <summary>A debugger view of the Lazy&lt;T&gt; to surface additional debugging properties and
diff --git a/src/mscorlib/shared/System/MarshalByRefObject.cs b/src/mscorlib/shared/System/MarshalByRefObject.cs
index 1f1739b9cb..390b728329 100644
--- a/src/mscorlib/shared/System/MarshalByRefObject.cs
+++ b/src/mscorlib/shared/System/MarshalByRefObject.cs
@@ -4,7 +4,6 @@
namespace System
{
- [Serializable]
public abstract class MarshalByRefObject
{
protected MarshalByRefObject()
diff --git a/src/mscorlib/shared/System/MemberAccessException.cs b/src/mscorlib/shared/System/MemberAccessException.cs
index 54eee67b07..abca952f19 100644
--- a/src/mscorlib/shared/System/MemberAccessException.cs
+++ b/src/mscorlib/shared/System/MemberAccessException.cs
@@ -15,7 +15,6 @@ namespace System
// The MemberAccessException is thrown when trying to access a class
// member fails.
//
- [Serializable]
public class MemberAccessException : SystemException
{
// Creates a new MemberAccessException with its message string set to
@@ -43,6 +42,9 @@ namespace System
HResult = __HResults.COR_E_MEMBERACCESS;
}
- protected MemberAccessException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ protected MemberAccessException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ throw new PlatformNotSupportedException();
+ }
}
}
diff --git a/src/mscorlib/shared/System/MethodAccessException.cs b/src/mscorlib/shared/System/MethodAccessException.cs
index 2ecbd14d6d..2c9c998c15 100644
--- a/src/mscorlib/shared/System/MethodAccessException.cs
+++ b/src/mscorlib/shared/System/MethodAccessException.cs
@@ -13,7 +13,6 @@ using System.Runtime.Serialization;
namespace System
{
- [Serializable]
public class MethodAccessException : MemberAccessException
{
public MethodAccessException()
@@ -34,6 +33,9 @@ namespace System
HResult = __HResults.COR_E_METHODACCESS;
}
- protected MethodAccessException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ protected MethodAccessException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ throw new PlatformNotSupportedException();
+ }
}
}
diff --git a/src/mscorlib/shared/System/MissingMethodException.cs b/src/mscorlib/shared/System/MissingMethodException.cs
index 07d428967b..967f434302 100644
--- a/src/mscorlib/shared/System/MissingMethodException.cs
+++ b/src/mscorlib/shared/System/MissingMethodException.cs
@@ -15,7 +15,6 @@ using System.Runtime.Serialization;
namespace System
{
- [Serializable]
public class MissingMethodException : MissingMemberException
{
public MissingMethodException()
@@ -45,6 +44,7 @@ namespace System
protected MissingMethodException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
+ throw new PlatformNotSupportedException();
}
public override string Message
diff --git a/src/mscorlib/shared/System/MulticastNotSupportedException.cs b/src/mscorlib/shared/System/MulticastNotSupportedException.cs
index 4fcaa9857d..493671e227 100644
--- a/src/mscorlib/shared/System/MulticastNotSupportedException.cs
+++ b/src/mscorlib/shared/System/MulticastNotSupportedException.cs
@@ -11,7 +11,6 @@ using System.Runtime.Serialization;
namespace System
{
- [Serializable]
public sealed class MulticastNotSupportedException : SystemException
{
public MulticastNotSupportedException()
@@ -31,7 +30,5 @@ namespace System
{
HResult = __HResults.COR_E_MULTICASTNOTSUPPORTED;
}
-
- internal MulticastNotSupportedException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}
diff --git a/src/mscorlib/shared/System/NotFiniteNumberException.cs b/src/mscorlib/shared/System/NotFiniteNumberException.cs
index 5bc8df1e28..99882b9eb2 100644
--- a/src/mscorlib/shared/System/NotFiniteNumberException.cs
+++ b/src/mscorlib/shared/System/NotFiniteNumberException.cs
@@ -6,7 +6,6 @@ using System.Runtime.Serialization;
namespace System
{
- [Serializable]
public class NotFiniteNumberException : ArithmeticException
{
private double _offendingNumber;
@@ -54,13 +53,12 @@ namespace System
protected NotFiniteNumberException(SerializationInfo info, StreamingContext context) : base(info, context)
{
- _offendingNumber = info.GetInt32("OffendingNumber");
+ throw new PlatformNotSupportedException();
}
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
base.GetObjectData(info, context);
- info.AddValue("OffendingNumber", _offendingNumber, typeof(Int32));
}
public double OffendingNumber
diff --git a/src/mscorlib/shared/System/NotImplementedException.cs b/src/mscorlib/shared/System/NotImplementedException.cs
index 4d141eac8c..ae62527fac 100644
--- a/src/mscorlib/shared/System/NotImplementedException.cs
+++ b/src/mscorlib/shared/System/NotImplementedException.cs
@@ -16,7 +16,6 @@ using System.Runtime.Serialization;
namespace System
{
- [Serializable]
public class NotImplementedException : SystemException
{
public NotImplementedException()
@@ -35,6 +34,9 @@ namespace System
HResult = __HResults.E_NOTIMPL;
}
- protected NotImplementedException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ protected NotImplementedException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ throw new PlatformNotSupportedException();
+ }
}
}
diff --git a/src/mscorlib/shared/System/NotSupportedException.cs b/src/mscorlib/shared/System/NotSupportedException.cs
index 21b2d54a46..8532e5ad2f 100644
--- a/src/mscorlib/shared/System/NotSupportedException.cs
+++ b/src/mscorlib/shared/System/NotSupportedException.cs
@@ -15,7 +15,6 @@ using System.Runtime.Serialization;
namespace System
{
- [Serializable]
public class NotSupportedException : SystemException
{
public NotSupportedException()
@@ -36,6 +35,9 @@ namespace System
HResult = __HResults.COR_E_NOTSUPPORTED;
}
- protected NotSupportedException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ protected NotSupportedException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ throw new PlatformNotSupportedException();
+ }
}
}
diff --git a/src/mscorlib/shared/System/NullReferenceException.cs b/src/mscorlib/shared/System/NullReferenceException.cs
index 0aa5c6197a..f689345654 100644
--- a/src/mscorlib/shared/System/NullReferenceException.cs
+++ b/src/mscorlib/shared/System/NullReferenceException.cs
@@ -15,7 +15,6 @@ using System.Runtime.Serialization;
namespace System
{
- [Serializable]
public class NullReferenceException : SystemException
{
public NullReferenceException()
@@ -36,6 +35,9 @@ namespace System
HResult = __HResults.COR_E_NULLREFERENCE;
}
- protected NullReferenceException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ protected NullReferenceException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ throw new PlatformNotSupportedException();
+ }
}
}
diff --git a/src/mscorlib/shared/System/ObjectDisposedException.cs b/src/mscorlib/shared/System/ObjectDisposedException.cs
index abb7c89dae..6e8e6b2d74 100644
--- a/src/mscorlib/shared/System/ObjectDisposedException.cs
+++ b/src/mscorlib/shared/System/ObjectDisposedException.cs
@@ -11,7 +11,6 @@ namespace System
/// <para> The exception that is thrown when accessing an object that was
/// disposed.</para>
/// </devdoc>
- [Serializable]
public class ObjectDisposedException : InvalidOperationException
{
private String _objectName;
@@ -42,13 +41,12 @@ namespace System
protected ObjectDisposedException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
- _objectName = info.GetString("ObjectName");
+ throw new PlatformNotSupportedException();
}
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
base.GetObjectData(info, context);
- info.AddValue("ObjectName", ObjectName, typeof(String));
}
/// <devdoc>
diff --git a/src/mscorlib/shared/System/ObsoleteAttribute.cs b/src/mscorlib/shared/System/ObsoleteAttribute.cs
index f183685998..a63db137f8 100644
--- a/src/mscorlib/shared/System/ObsoleteAttribute.cs
+++ b/src/mscorlib/shared/System/ObsoleteAttribute.cs
@@ -21,7 +21,6 @@ namespace System
// error. (this would be used if the actual implementation of the obsolete
// method's implementation had changed).
//
- [Serializable]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum |
AttributeTargets.Interface | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Delegate
, Inherited = false)]
diff --git a/src/mscorlib/src/System/OperationCanceledException.cs b/src/mscorlib/shared/System/OperationCanceledException.cs
index 826561776f..2c7654854f 100644
--- a/src/mscorlib/src/System/OperationCanceledException.cs
+++ b/src/mscorlib/shared/System/OperationCanceledException.cs
@@ -17,7 +17,6 @@ using System.Threading;
namespace System
{
- [Serializable]
public class OperationCanceledException : SystemException
{
[NonSerialized]
@@ -68,6 +67,7 @@ namespace System
protected OperationCanceledException(SerializationInfo info, StreamingContext context) : base(info, context)
{
+ throw new PlatformNotSupportedException();
}
}
}
diff --git a/src/mscorlib/shared/System/OverflowException.cs b/src/mscorlib/shared/System/OverflowException.cs
index e28c688dd6..4052e41a18 100644
--- a/src/mscorlib/shared/System/OverflowException.cs
+++ b/src/mscorlib/shared/System/OverflowException.cs
@@ -15,7 +15,6 @@ using System.Runtime.Serialization;
namespace System
{
- [Serializable]
public class OverflowException : ArithmeticException
{
public OverflowException()
@@ -36,6 +35,9 @@ namespace System
HResult = __HResults.COR_E_OVERFLOW;
}
- protected OverflowException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ protected OverflowException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ throw new PlatformNotSupportedException();
+ }
}
}
diff --git a/src/mscorlib/shared/System/PlatformNotSupportedException.cs b/src/mscorlib/shared/System/PlatformNotSupportedException.cs
index d2370b3924..f679ac9454 100644
--- a/src/mscorlib/shared/System/PlatformNotSupportedException.cs
+++ b/src/mscorlib/shared/System/PlatformNotSupportedException.cs
@@ -15,7 +15,6 @@ using System.Runtime.Serialization;
namespace System
{
- [Serializable]
public class PlatformNotSupportedException : NotSupportedException
{
public PlatformNotSupportedException()
@@ -36,6 +35,9 @@ namespace System
HResult = __HResults.COR_E_PLATFORMNOTSUPPORTED;
}
- protected PlatformNotSupportedException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ protected PlatformNotSupportedException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ throw new PlatformNotSupportedException();
+ }
}
}
diff --git a/src/mscorlib/shared/System/Random.cs b/src/mscorlib/shared/System/Random.cs
index a66a9ea423..4affed8a1a 100644
--- a/src/mscorlib/shared/System/Random.cs
+++ b/src/mscorlib/shared/System/Random.cs
@@ -18,7 +18,6 @@ using System.Diagnostics.Contracts;
namespace System
{
- [Serializable]
public class Random
{
//
diff --git a/src/mscorlib/shared/System/RankException.cs b/src/mscorlib/shared/System/RankException.cs
index 612d0f086c..15759ea75d 100644
--- a/src/mscorlib/shared/System/RankException.cs
+++ b/src/mscorlib/shared/System/RankException.cs
@@ -16,7 +16,6 @@ using System.Runtime.Serialization;
namespace System
{
- [Serializable]
public class RankException : SystemException
{
public RankException()
@@ -37,6 +36,9 @@ namespace System
HResult = __HResults.COR_E_RANK;
}
- protected RankException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ protected RankException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ throw new PlatformNotSupportedException();
+ }
}
}
diff --git a/src/mscorlib/shared/System/Reflection/AmbiguousMatchException.cs b/src/mscorlib/shared/System/Reflection/AmbiguousMatchException.cs
index 459a19cb71..a0075bbc0b 100644
--- a/src/mscorlib/shared/System/Reflection/AmbiguousMatchException.cs
+++ b/src/mscorlib/shared/System/Reflection/AmbiguousMatchException.cs
@@ -6,7 +6,6 @@ using System.Runtime.Serialization;
namespace System.Reflection
{
- [Serializable]
public sealed class AmbiguousMatchException : SystemException
{
public AmbiguousMatchException()
@@ -26,10 +25,5 @@ namespace System.Reflection
{
HResult = __HResults.COR_E_AMBIGUOUSMATCH;
}
-
- internal AmbiguousMatchException(SerializationInfo info, StreamingContext context)
- : base(info, context)
- {
- }
}
}
diff --git a/src/mscorlib/shared/System/Reflection/Assembly.cs b/src/mscorlib/shared/System/Reflection/Assembly.cs
index d35ffc7066..b965c9f7fb 100644
--- a/src/mscorlib/shared/System/Reflection/Assembly.cs
+++ b/src/mscorlib/shared/System/Reflection/Assembly.cs
@@ -125,7 +125,10 @@ namespace System.Reflection
public virtual FileStream[] GetFiles() => GetFiles(getResourceModules: false);
public virtual FileStream[] GetFiles(bool getResourceModules) { throw NotImplemented.ByDesign; }
- public virtual void GetObjectData(SerializationInfo info, StreamingContext context) { throw NotImplemented.ByDesign; }
+ public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
+ {
+ throw new PlatformNotSupportedException();
+ }
public override string ToString()
{
diff --git a/src/mscorlib/shared/System/Reflection/AssemblyNameFormatter.cs b/src/mscorlib/shared/System/Reflection/AssemblyNameFormatter.cs
new file mode 100644
index 0000000000..7c4a980079
--- /dev/null
+++ b/src/mscorlib/shared/System/Reflection/AssemblyNameFormatter.cs
@@ -0,0 +1,156 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.IO;
+using System.Text;
+using System.Globalization;
+using System.Collections.Generic;
+
+namespace System.Reflection
+{
+ internal static class AssemblyNameFormatter
+ {
+ public static string ComputeDisplayName(string name, Version version, string cultureName, byte[] pkt, AssemblyNameFlags flags, AssemblyContentType contentType)
+ {
+ const int PUBLIC_KEY_TOKEN_LEN = 8;
+
+ if (name == string.Empty)
+ throw new FileLoadException();
+
+ StringBuilder sb = new StringBuilder();
+ if (name != null)
+ {
+ sb.AppendQuoted(name);
+ }
+
+ if (version != null)
+ {
+ Version canonicalizedVersion = version.CanonicalizeVersion();
+ if (canonicalizedVersion.Major != ushort.MaxValue)
+ {
+ sb.Append(", Version=");
+ sb.Append(canonicalizedVersion.Major);
+
+ if (canonicalizedVersion.Minor != ushort.MaxValue)
+ {
+ sb.Append('.');
+ sb.Append(canonicalizedVersion.Minor);
+
+ if (canonicalizedVersion.Build != ushort.MaxValue)
+ {
+ sb.Append('.');
+ sb.Append(canonicalizedVersion.Build);
+
+ if (canonicalizedVersion.Revision != ushort.MaxValue)
+ {
+ sb.Append('.');
+ sb.Append(canonicalizedVersion.Revision);
+ }
+ }
+ }
+ }
+ }
+
+ if (cultureName != null)
+ {
+ if (cultureName == string.Empty)
+ cultureName = "neutral";
+ sb.Append(", Culture=");
+ sb.AppendQuoted(cultureName);
+ }
+
+ if (pkt != null)
+ {
+ if (pkt.Length > PUBLIC_KEY_TOKEN_LEN)
+ throw new ArgumentException();
+
+ sb.Append(", PublicKeyToken=");
+ if (pkt.Length == 0)
+ sb.Append("null");
+ else
+ {
+ foreach (byte b in pkt)
+ {
+ sb.Append(b.ToString("x2", CultureInfo.InvariantCulture));
+ }
+ }
+ }
+
+ if (0 != (flags & AssemblyNameFlags.Retargetable))
+ sb.Append(", Retargetable=Yes");
+
+ if (contentType == AssemblyContentType.WindowsRuntime)
+ sb.Append(", ContentType=WindowsRuntime");
+
+ // NOTE: By design (desktop compat) AssemblyName.FullName and ToString() do not include ProcessorArchitecture.
+
+ return sb.ToString();
+ }
+
+ private static void AppendQuoted(this StringBuilder sb, string s)
+ {
+ bool needsQuoting = false;
+ const char quoteChar = '\"';
+
+ //@todo: App-compat: You can use double or single quotes to quote a name, and Fusion (or rather the IdentityAuthority) picks one
+ // by some algorithm. Rather than guess at it, I'll just use double-quote consistently.
+ if (s != s.Trim() || s.Contains("\"") || s.Contains("\'"))
+ needsQuoting = true;
+
+ if (needsQuoting)
+ sb.Append(quoteChar);
+
+ for (int i = 0; i < s.Length; i++)
+ {
+ bool addedEscape = false;
+ foreach (KeyValuePair<char, string> kv in EscapeSequences)
+ {
+ string escapeReplacement = kv.Value;
+ if (!(s[i] == escapeReplacement[0]))
+ continue;
+ if ((s.Length - i) < escapeReplacement.Length)
+ continue;
+ string prefix = s.Substring(i, escapeReplacement.Length);
+ if (prefix == escapeReplacement)
+ {
+ sb.Append('\\');
+ sb.Append(kv.Key);
+ addedEscape = true;
+ }
+ }
+
+ if (!addedEscape)
+ sb.Append(s[i]);
+ }
+
+ if (needsQuoting)
+ sb.Append(quoteChar);
+ }
+
+ private static Version CanonicalizeVersion(this Version version)
+ {
+ ushort major = (ushort)version.Major;
+ ushort minor = (ushort)version.Minor;
+ ushort build = (ushort)version.Build;
+ ushort revision = (ushort)version.Revision;
+
+ if (major == version.Major && minor == version.Minor && build == version.Build && revision == version.Revision)
+ return version;
+
+ return new Version(major, minor, build, revision);
+ }
+
+ public static KeyValuePair<char, string>[] EscapeSequences =
+ {
+ new KeyValuePair<char, string>('\\', "\\"),
+ new KeyValuePair<char, string>(',', ","),
+ new KeyValuePair<char, string>('=', "="),
+ new KeyValuePair<char, string>('\'', "'"),
+ new KeyValuePair<char, string>('\"', "\""),
+ new KeyValuePair<char, string>('n', Environment.NewLine),
+ new KeyValuePair<char, string>('t', "\t"),
+ };
+ }
+}
+
diff --git a/src/mscorlib/shared/System/Reflection/CustomAttributeFormatException.cs b/src/mscorlib/shared/System/Reflection/CustomAttributeFormatException.cs
index 6e11540505..13766ae8d0 100644
--- a/src/mscorlib/shared/System/Reflection/CustomAttributeFormatException.cs
+++ b/src/mscorlib/shared/System/Reflection/CustomAttributeFormatException.cs
@@ -6,7 +6,6 @@ using System.Runtime.Serialization;
namespace System.Reflection
{
- [Serializable]
public class CustomAttributeFormatException : FormatException
{
public CustomAttributeFormatException()
@@ -28,6 +27,7 @@ namespace System.Reflection
protected CustomAttributeFormatException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
+ throw new PlatformNotSupportedException();
}
}
}
diff --git a/src/mscorlib/shared/System/Reflection/DefaultMemberAttribute.cs b/src/mscorlib/shared/System/Reflection/DefaultMemberAttribute.cs
index 3511433713..585fdb07cd 100644
--- a/src/mscorlib/shared/System/Reflection/DefaultMemberAttribute.cs
+++ b/src/mscorlib/shared/System/Reflection/DefaultMemberAttribute.cs
@@ -4,7 +4,6 @@
namespace System.Reflection
{
- [Serializable]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface)]
public sealed class DefaultMemberAttribute : Attribute
{
diff --git a/src/mscorlib/shared/System/Reflection/InvalidFilterCriteriaException.cs b/src/mscorlib/shared/System/Reflection/InvalidFilterCriteriaException.cs
index e3f882c409..07880a768d 100644
--- a/src/mscorlib/shared/System/Reflection/InvalidFilterCriteriaException.cs
+++ b/src/mscorlib/shared/System/Reflection/InvalidFilterCriteriaException.cs
@@ -6,7 +6,6 @@ using System.Runtime.Serialization;
namespace System.Reflection
{
- [Serializable]
public class InvalidFilterCriteriaException : ApplicationException
{
public InvalidFilterCriteriaException()
@@ -28,6 +27,7 @@ namespace System.Reflection
protected InvalidFilterCriteriaException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
+ throw new PlatformNotSupportedException();
}
}
}
diff --git a/src/mscorlib/shared/System/Reflection/MemberInfoSerializationHolder.cs b/src/mscorlib/shared/System/Reflection/MemberInfoSerializationHolder.cs
deleted file mode 100644
index dfc56667bd..0000000000
--- a/src/mscorlib/shared/System/Reflection/MemberInfoSerializationHolder.cs
+++ /dev/null
@@ -1,315 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-using System;
-using System.Runtime.Serialization;
-using System.Globalization;
-using System.Diagnostics.Contracts;
-
-namespace System.Reflection
-{
- [Serializable]
-#if CORECLR
- internal
-#else
- public // On CoreRT, this must be public because of the Reflection.Core/CoreLib divide and the need to whitelist past the ReflectionBlock.
-#endif
- class MemberInfoSerializationHolder : ISerializable, IObjectReference
- {
- #region Staitc Public Members
- public static void GetSerializationInfo(SerializationInfo info, FieldInfo f)
- {
- // Compat: Serializing ToString() since the full framework does it but the deserialization logic makes no use of it.
- GetSerializationInfo(info, f.Name, f.ReflectedType, f.ToString(), MemberTypes.Field);
- }
-
- public static void GetSerializationInfo(SerializationInfo info, EventInfo e)
- {
- GetSerializationInfo(info, e.Name, e.ReflectedType, null, MemberTypes.Event);
- }
-
- public static void GetSerializationInfo(SerializationInfo info, ConstructorInfo c)
- {
- GetSerializationInfo(info, c.Name, c.ReflectedType, c.ToString(), c.SerializationToString(), MemberTypes.Constructor, genericArguments: null);
- }
-
- public static void GetSerializationInfo(SerializationInfo info, MethodInfo m)
- {
- Type[] genericArguments = m.IsConstructedGenericMethod ? m.GetGenericArguments() : null;
- GetSerializationInfo(info, m.Name, m.ReflectedType, m.ToString(), m.SerializationToString(), MemberTypes.Method, genericArguments);
- }
-
- public static void GetSerializationInfo(SerializationInfo info, PropertyInfo p)
- {
- GetSerializationInfo(info, p.Name, p.ReflectedType, p.ToString(), p.SerializationToString(), MemberTypes.Property, genericArguments: null);
- }
- #endregion
-
- #region Private Static Members
- private static void GetSerializationInfo(SerializationInfo info, string name, Type reflectedClass, string signature, MemberTypes type)
- {
- GetSerializationInfo(info, name, reflectedClass, signature, null, type, null);
- }
-
- private static void GetSerializationInfo(
- SerializationInfo info,
- string name,
- Type reflectedClass,
- string signature,
- string signature2,
- MemberTypes type,
- Type[] genericArguments)
- {
- if (info == null)
- throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- string assemblyName = reflectedClass.Module.Assembly.FullName;
- string typeName = reflectedClass.FullName;
-
- info.SetType(typeof(MemberInfoSerializationHolder));
- info.AddValue("Name", name, typeof(string));
- info.AddValue("AssemblyName", assemblyName, typeof(string));
- info.AddValue("ClassName", typeName, typeof(string));
- info.AddValue("Signature", signature, typeof(string));
- info.AddValue("Signature2", signature2, typeof(string));
- info.AddValue("MemberType", (int)type);
- info.AddValue("GenericArguments", genericArguments, typeof(Type[]));
- }
- #endregion
-
- #region Private Data Members
- private readonly string _memberName;
- private readonly Type _reflectedType;
- // _signature stores the ToString() representation of the member which is sometimes ambiguous.
- // Mulitple overloads of the same methods or properties can identical ToString().
- // _signature2 stores the SerializationToString() representation which should be unique for each member.
- // It is only written and used by post 4.0 CLR versions.
- private readonly string _signature;
- private readonly string _signature2;
- private readonly MemberTypes _memberType;
- private readonly SerializationInfo _info;
- #endregion
-
- #region Constructor
- // Needs to be public so it can be whitelisted in Reflection.
- public MemberInfoSerializationHolder(SerializationInfo info, StreamingContext context)
- {
- if (info == null)
- throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- string assemblyName = info.GetString("AssemblyName");
- string typeName = info.GetString("ClassName");
-
- if (assemblyName == null || typeName == null)
- throw new SerializationException(SR.Serialization_InsufficientState);
-
- Assembly assem = Assembly.Load(assemblyName);
- _reflectedType = assem.GetType(typeName, true, false);
- _memberName = info.GetString("Name");
- _signature = info.GetString("Signature");
- // Only v4.0 and later generates and consumes Signature2
- _signature2 = (string)info.GetValueNoThrow("Signature2", typeof(string));
- _memberType = (MemberTypes)info.GetInt32("MemberType");
- _info = info;
- }
- #endregion
-
- #region ISerializable
- public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
- {
- throw new NotSupportedException();
- }
- #endregion
-
- #region IObjectReference
- public virtual object GetRealObject(StreamingContext context)
- {
- if (_memberName == null || _reflectedType == null || _memberType == 0)
- throw new SerializationException(SR.Serialization_InsufficientState);
-
- BindingFlags bindingFlags =
- BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic |
- BindingFlags.Static | BindingFlags.OptionalParamBinding;
-
- switch (_memberType)
- {
- #region case MemberTypes.Field:
- case MemberTypes.Field:
- {
- FieldInfo[] fields = _reflectedType.GetMember(_memberName, MemberTypes.Field, bindingFlags) as FieldInfo[];
-
- if (fields.Length == 0)
- throw new SerializationException(SR.Format(SR.Serialization_UnknownMember, _memberName));
-
- return fields[0];
- }
- #endregion
-
- #region case MemberTypes.Event:
- case MemberTypes.Event:
- {
- EventInfo[] events = _reflectedType.GetMember(_memberName, MemberTypes.Event, bindingFlags) as EventInfo[];
-
- if (events.Length == 0)
- throw new SerializationException(SR.Format(SR.Serialization_UnknownMember, _memberName));
-
- return events[0];
- }
- #endregion
-
- #region case MemberTypes.Property:
- case MemberTypes.Property:
- {
- PropertyInfo[] properties = _reflectedType.GetMember(_memberName, MemberTypes.Property, bindingFlags) as PropertyInfo[];
-
- if (properties.Length == 0)
- throw new SerializationException(SR.Format(SR.Serialization_UnknownMember, _memberName));
-
- if (properties.Length == 1)
- return properties[0];
-
- if (properties.Length > 1)
- {
- for (int i = 0; i < properties.Length; i++)
- {
- if (_signature2 != null)
- {
- if (properties[i].SerializationToString().Equals(_signature2))
- return properties[i];
- }
- else
- {
- if ((properties[i]).ToString().Equals(_signature))
- return properties[i];
- }
- }
- }
-
- throw new SerializationException(SR.Format(SR.Serialization_UnknownMember, _memberName));
- }
- #endregion
-
- #region case MemberTypes.Constructor:
- case MemberTypes.Constructor:
- {
- if (_signature == null)
- throw new SerializationException(SR.Serialization_NullSignature);
-
- ConstructorInfo[] constructors = _reflectedType.GetMember(_memberName, MemberTypes.Constructor, bindingFlags) as ConstructorInfo[];
-
- if (constructors.Length == 1)
- return constructors[0];
-
- if (constructors.Length > 1)
- {
- for (int i = 0; i < constructors.Length; i++)
- {
- if (_signature2 != null)
- {
- if (constructors[i].SerializationToString().Equals(_signature2))
- return constructors[i];
- }
- else
- {
- if (constructors[i].ToString().Equals(_signature))
- return constructors[i];
- }
- }
- }
-
- throw new SerializationException(SR.Format(SR.Serialization_UnknownMember, _memberName));
- }
- #endregion
-
- #region case MemberTypes.Method:
- case MemberTypes.Method:
- {
- MethodInfo methodInfo = null;
-
- if (_signature == null)
- throw new SerializationException(SR.Serialization_NullSignature);
-
- Type[] genericArguments = _info.GetValueNoThrow("GenericArguments", typeof(Type[])) as Type[];
-
- MethodInfo[] methods = _reflectedType.GetMember(_memberName, MemberTypes.Method, bindingFlags) as MethodInfo[];
-
- if (methods.Length == 1)
- methodInfo = methods[0];
-
- else if (methods.Length > 1)
- {
- for (int i = 0; i < methods.Length; i++)
- {
- if (_signature2 != null)
- {
- if (methods[i].SerializationToString().Equals(_signature2))
- {
- methodInfo = methods[i];
- break;
- }
- }
- else
- {
- if (methods[i].ToString().Equals(_signature))
- {
- methodInfo = methods[i];
- break;
- }
- }
-
- // Handle generic methods specially since the signature match above probably won't work (the candidate
- // method info hasn't been instantiated). If our target method is generic as well we can skip this.
- if (genericArguments != null && methods[i].IsGenericMethod)
- {
- if (methods[i].GetGenericArguments().Length == genericArguments.Length)
- {
- MethodInfo candidateMethod = methods[i].MakeGenericMethod(genericArguments);
-
- if (_signature2 != null)
- {
- if (candidateMethod.SerializationToString().Equals(_signature2))
- {
- methodInfo = candidateMethod;
- break;
- }
- }
- else
- {
- if (candidateMethod.ToString().Equals(_signature))
- {
- methodInfo = candidateMethod;
- break;
- }
- }
- }
- }
- }
- }
-
- if (methodInfo == null)
- throw new SerializationException(SR.Format(SR.Serialization_UnknownMember, _memberName));
-
- if (!methodInfo.IsGenericMethodDefinition)
- return methodInfo;
-
- if (genericArguments == null)
- return methodInfo;
-
- if (genericArguments[0] == null)
- return null;
-
- return methodInfo.MakeGenericMethod(genericArguments);
- }
- #endregion
-
- default:
- throw new ArgumentException(SR.Serialization_MemberTypeNotRecognized);
- }
- }
- #endregion
- }
-}
-
diff --git a/src/mscorlib/shared/System/Reflection/Missing.cs b/src/mscorlib/shared/System/Reflection/Missing.cs
index fa32d43ccb..46ab32fccf 100644
--- a/src/mscorlib/shared/System/Reflection/Missing.cs
+++ b/src/mscorlib/shared/System/Reflection/Missing.cs
@@ -6,7 +6,6 @@ using System.Runtime.Serialization;
namespace System.Reflection
{
- [Serializable]
public sealed class Missing : ISerializable
{
public static readonly Missing Value = new Missing();
@@ -15,10 +14,7 @@ namespace System.Reflection
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
{
- if (info == null)
- throw new ArgumentNullException(nameof(info));
-
- UnitySerializationHolder.GetUnitySerializationInfo(info, this);
+ throw new PlatformNotSupportedException();
}
}
}
diff --git a/src/mscorlib/shared/System/Reflection/Module.cs b/src/mscorlib/shared/System/Reflection/Module.cs
index 56f83c40d9..7822e9ff10 100644
--- a/src/mscorlib/shared/System/Reflection/Module.cs
+++ b/src/mscorlib/shared/System/Reflection/Module.cs
@@ -110,7 +110,10 @@ namespace System.Reflection
public Type ResolveType(int metadataToken) => ResolveType(metadataToken, null, null);
public virtual Type ResolveType(int metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) { throw NotImplemented.ByDesign; }
- public virtual void GetObjectData(SerializationInfo info, StreamingContext context) { throw NotImplemented.ByDesign; }
+ public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
+ {
+ throw new PlatformNotSupportedException();
+ }
public override bool Equals(object o) => base.Equals(o);
public override int GetHashCode() => base.GetHashCode();
diff --git a/src/mscorlib/shared/System/Reflection/ParameterInfo.cs b/src/mscorlib/shared/System/Reflection/ParameterInfo.cs
index 94bfffaa53..fd130e569b 100644
--- a/src/mscorlib/shared/System/Reflection/ParameterInfo.cs
+++ b/src/mscorlib/shared/System/Reflection/ParameterInfo.cs
@@ -54,46 +54,7 @@ namespace System.Reflection
public object GetRealObject(StreamingContext context)
{
- // Once all the serializable fields have come in we can set up the real
- // instance based on just two of them (MemberImpl and PositionImpl).
-
- if (MemberImpl == null)
- throw new SerializationException(SR.Serialization_InsufficientState);
-
- ParameterInfo[] args = null;
-
- switch (MemberImpl.MemberType)
- {
- case MemberTypes.Constructor:
- case MemberTypes.Method:
- if (PositionImpl == -1)
- {
- if (MemberImpl.MemberType == MemberTypes.Method)
- return ((MethodInfo)MemberImpl).ReturnParameter;
- else
- throw new SerializationException(SR.Serialization_BadParameterInfo);
- }
- else
- {
- args = ((MethodBase)MemberImpl).GetParametersNoCopy();
-
- if (args != null && PositionImpl < args.Length)
- return args[PositionImpl];
- else
- throw new SerializationException(SR.Serialization_BadParameterInfo);
- }
-
- case MemberTypes.Property:
- args = ((PropertyInfo)MemberImpl).GetIndexParameters();
-
- if (args != null && PositionImpl > -1 && PositionImpl < args.Length)
- return args[PositionImpl];
- else
- throw new SerializationException(SR.Serialization_BadParameterInfo);
-
- default:
- throw new SerializationException(SR.Serialization_NoParameterInfo);
- }
+ throw new PlatformNotSupportedException();
}
public override string ToString() => ParameterType.FormatTypeName() + " " + Name;
diff --git a/src/mscorlib/shared/System/Reflection/ParameterModifier.cs b/src/mscorlib/shared/System/Reflection/ParameterModifier.cs
index 18d6cf669d..640fee284a 100644
--- a/src/mscorlib/shared/System/Reflection/ParameterModifier.cs
+++ b/src/mscorlib/shared/System/Reflection/ParameterModifier.cs
@@ -4,7 +4,6 @@
namespace System.Reflection
{
- [Serializable]
public struct ParameterModifier
{
private readonly bool[] _byRef;
diff --git a/src/mscorlib/shared/System/Reflection/Pointer.cs b/src/mscorlib/shared/System/Reflection/Pointer.cs
index 13a5efff46..55376c66c0 100644
--- a/src/mscorlib/shared/System/Reflection/Pointer.cs
+++ b/src/mscorlib/shared/System/Reflection/Pointer.cs
@@ -7,7 +7,6 @@ using System.Runtime.Serialization;
namespace System.Reflection
{
- [Serializable]
[CLSCompliant(false)]
public sealed unsafe class Pointer : ISerializable
{
@@ -22,14 +21,6 @@ namespace System.Reflection
_ptrType = ptrType;
}
- private Pointer(SerializationInfo info, StreamingContext context)
- {
- _ptr = ((IntPtr)(info.GetValue("_ptr", typeof(IntPtr)))).ToPointer();
- _ptrType = (Type)info.GetValue("_ptrType", typeof(Type));
- if (!_ptrType.IsRuntimeImplemented())
- throw new SerializationException(SR.Arg_MustBeType);
- }
-
public static object Box(void* ptr, Type type)
{
if (type == null)
@@ -51,8 +42,7 @@ namespace System.Reflection
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
{
- info.AddValue("_ptr", new IntPtr(_ptr));
- info.AddValue("_ptrType", _ptrType);
+ throw new PlatformNotSupportedException();
}
internal Type GetPointerType() => _ptrType;
diff --git a/src/mscorlib/shared/System/Reflection/ReflectionTypeLoadException.cs b/src/mscorlib/shared/System/Reflection/ReflectionTypeLoadException.cs
index 772620cf84..ca0c6ab0db 100644
--- a/src/mscorlib/shared/System/Reflection/ReflectionTypeLoadException.cs
+++ b/src/mscorlib/shared/System/Reflection/ReflectionTypeLoadException.cs
@@ -6,7 +6,6 @@ using System.Runtime.Serialization;
namespace System.Reflection
{
- [Serializable]
public sealed class ReflectionTypeLoadException : SystemException, ISerializable
{
public ReflectionTypeLoadException(Type[] classes, Exception[] exceptions)
@@ -25,18 +24,9 @@ namespace System.Reflection
HResult = __HResults.COR_E_REFLECTIONTYPELOAD;
}
- internal ReflectionTypeLoadException(SerializationInfo info, StreamingContext context)
- : base(info, context)
- {
- Types = (Type[])(info.GetValue("Types", typeof(Type[])));
- LoaderExceptions = (Exception[])(info.GetValue("Exceptions", typeof(Exception[])));
- }
-
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
base.GetObjectData(info, context);
- info.AddValue("Types", Types, typeof(Type[]));
- info.AddValue("Exceptions", LoaderExceptions, typeof(Exception[]));
}
public Type[] Types { get; }
diff --git a/src/mscorlib/shared/System/Reflection/StrongNameKeyPair.cs b/src/mscorlib/shared/System/Reflection/StrongNameKeyPair.cs
index c04ddd6d1a..6efa626946 100644
--- a/src/mscorlib/shared/System/Reflection/StrongNameKeyPair.cs
+++ b/src/mscorlib/shared/System/Reflection/StrongNameKeyPair.cs
@@ -7,7 +7,6 @@ using System.Runtime.Serialization;
namespace System.Reflection
{
- [Serializable]
public class StrongNameKeyPair : IDeserializationCallback, ISerializable
{
private bool _keyPairExported;
@@ -42,10 +41,7 @@ namespace System.Reflection
protected StrongNameKeyPair(SerializationInfo info, StreamingContext context)
{
- _keyPairExported = (bool)info.GetValue("_keyPairExported", typeof(bool));
- _keyPairArray = (byte[])info.GetValue("_keyPairArray", typeof(byte[]));
- _keyPairContainer = (string)info.GetValue("_keyPairContainer", typeof(string));
- _publicKey = (byte[])info.GetValue("_publicKey", typeof(byte[]));
+ throw new PlatformNotSupportedException();
}
public StrongNameKeyPair(string keyPairContainer)
@@ -63,12 +59,12 @@ namespace System.Reflection
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
{
- info.AddValue("_keyPairExported", _keyPairExported);
- info.AddValue("_keyPairArray", _keyPairArray);
- info.AddValue("_keyPairContainer", _keyPairContainer);
- info.AddValue("_publicKey", _publicKey);
+ throw new PlatformNotSupportedException();
}
- void IDeserializationCallback.OnDeserialization(object sender) { }
+ void IDeserializationCallback.OnDeserialization(object sender)
+ {
+ throw new PlatformNotSupportedException();
+ }
}
}
diff --git a/src/mscorlib/shared/System/Reflection/TargetException.cs b/src/mscorlib/shared/System/Reflection/TargetException.cs
index 03f8730cdd..6e43f56fa4 100644
--- a/src/mscorlib/shared/System/Reflection/TargetException.cs
+++ b/src/mscorlib/shared/System/Reflection/TargetException.cs
@@ -6,7 +6,6 @@ using System.Runtime.Serialization;
namespace System.Reflection
{
- [Serializable]
public class TargetException : ApplicationException
{
public TargetException()
@@ -28,6 +27,7 @@ namespace System.Reflection
protected TargetException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
+ throw new PlatformNotSupportedException();
}
}
}
diff --git a/src/mscorlib/shared/System/Reflection/TargetInvocationException.cs b/src/mscorlib/shared/System/Reflection/TargetInvocationException.cs
index e934e5bde7..8d0bfef40d 100644
--- a/src/mscorlib/shared/System/Reflection/TargetInvocationException.cs
+++ b/src/mscorlib/shared/System/Reflection/TargetInvocationException.cs
@@ -6,7 +6,6 @@ using System.Runtime.Serialization;
namespace System.Reflection
{
- [Serializable]
public sealed class TargetInvocationException : ApplicationException
{
public TargetInvocationException(Exception inner)
@@ -20,10 +19,5 @@ namespace System.Reflection
{
HResult = __HResults.COR_E_TARGETINVOCATION;
}
-
- internal TargetInvocationException(SerializationInfo info, StreamingContext context)
- : base(info, context)
- {
- }
}
}
diff --git a/src/mscorlib/shared/System/Reflection/TargetParameterCountException.cs b/src/mscorlib/shared/System/Reflection/TargetParameterCountException.cs
index c3604548e6..e200cdb94f 100644
--- a/src/mscorlib/shared/System/Reflection/TargetParameterCountException.cs
+++ b/src/mscorlib/shared/System/Reflection/TargetParameterCountException.cs
@@ -6,7 +6,6 @@ using System.Runtime.Serialization;
namespace System.Reflection
{
- [Serializable]
public sealed class TargetParameterCountException : ApplicationException
{
public TargetParameterCountException()
@@ -26,10 +25,5 @@ namespace System.Reflection
{
HResult = __HResults.COR_E_TARGETPARAMCOUNT;
}
-
- internal TargetParameterCountException(SerializationInfo info, StreamingContext context)
- : base(info, context)
- {
- }
}
}
diff --git a/src/mscorlib/shared/System/Reflection/TypeDelegator.cs b/src/mscorlib/shared/System/Reflection/TypeDelegator.cs
index 7f928d2486..bcbff05d62 100644
--- a/src/mscorlib/shared/System/Reflection/TypeDelegator.cs
+++ b/src/mscorlib/shared/System/Reflection/TypeDelegator.cs
@@ -10,7 +10,6 @@ using CultureInfo = System.Globalization.CultureInfo;
namespace System.Reflection
{
- [Serializable]
public class TypeDelegator : TypeInfo
{
public override bool IsAssignableFrom(TypeInfo typeInfo)
@@ -100,6 +99,7 @@ namespace System.Reflection
protected override TypeAttributes GetAttributeFlagsImpl() => typeImpl.Attributes;
+ public override bool IsTypeDefinition => typeImpl.IsTypeDefinition;
public override bool IsSZArray => typeImpl.IsSZArray;
protected override bool IsArrayImpl() => typeImpl.IsArray;
diff --git a/src/mscorlib/shared/System/Resources/MissingManifestResourceException.cs b/src/mscorlib/shared/System/Resources/MissingManifestResourceException.cs
index 70f41f4d9e..ec814393d0 100644
--- a/src/mscorlib/shared/System/Resources/MissingManifestResourceException.cs
+++ b/src/mscorlib/shared/System/Resources/MissingManifestResourceException.cs
@@ -7,7 +7,6 @@ using System.Runtime.Serialization;
namespace System.Resources
{
- [Serializable]
public class MissingManifestResourceException : SystemException
{
public MissingManifestResourceException()
@@ -31,6 +30,7 @@ namespace System.Resources
protected MissingManifestResourceException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
+ throw new PlatformNotSupportedException();
}
}
}
diff --git a/src/mscorlib/shared/System/Resources/MissingSatelliteAssemblyException.cs b/src/mscorlib/shared/System/Resources/MissingSatelliteAssemblyException.cs
index b343e0cfbc..d2ddc992ac 100644
--- a/src/mscorlib/shared/System/Resources/MissingSatelliteAssemblyException.cs
+++ b/src/mscorlib/shared/System/Resources/MissingSatelliteAssemblyException.cs
@@ -20,7 +20,6 @@ using System.Runtime.Serialization;
namespace System.Resources
{
- [Serializable]
public class MissingSatelliteAssemblyException : SystemException
{
private String _cultureName;
@@ -53,6 +52,7 @@ namespace System.Resources
protected MissingSatelliteAssemblyException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
+ throw new PlatformNotSupportedException();
}
public String CultureName
diff --git a/src/mscorlib/src/System/Resources/ResourceFallbackManager.cs b/src/mscorlib/shared/System/Resources/ResourceFallbackManager.cs
index 4ad7b4c93a..8268f3208d 100644
--- a/src/mscorlib/src/System/Resources/ResourceFallbackManager.cs
+++ b/src/mscorlib/shared/System/Resources/ResourceFallbackManager.cs
@@ -30,15 +30,6 @@ namespace System.Resources
private CultureInfo m_neutralResourcesCulture;
private bool m_useParents;
- // This is a cache of the thread, process, user, and OS-preferred fallback cultures.
- // However, each thread may have a different value, and these may change during the
- // lifetime of the process. So this cache must be verified each time we use it.
- // Hence, we'll keep an array of strings for culture names & check it each time,
- // but we'll really cache an array of CultureInfo's. Using thread-local statics
- // as well to avoid differences across threads.
- [ThreadStatic]
- private static CultureInfo[] cachedOsFallbackArray;
-
internal ResourceFallbackManager(CultureInfo startingCulture, CultureInfo neutralResourcesCulture, bool useParents)
{
if (startingCulture != null)
diff --git a/src/mscorlib/src/System/Resources/RuntimeResourceSet.cs b/src/mscorlib/shared/System/Resources/RuntimeResourceSet.cs
index e9c038a498..41d7541c24 100644
--- a/src/mscorlib/src/System/Resources/RuntimeResourceSet.cs
+++ b/src/mscorlib/shared/System/Resources/RuntimeResourceSet.cs
@@ -13,18 +13,18 @@
**
===========================================================*/
+using System;
+using System.IO;
+using System.Collections;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Reflection;
+using System.Runtime.Versioning;
+using System.Diagnostics;
+using System.Diagnostics.Contracts;
+
namespace System.Resources
{
- using System;
- using System.IO;
- using System.Collections;
- using System.Collections.Generic;
- using System.Globalization;
- using System.Reflection;
- using System.Runtime.Versioning;
- using System.Diagnostics;
- using System.Diagnostics.Contracts;
-
// A RuntimeResourceSet stores all the resources defined in one
// particular CultureInfo, with some loading optimizations.
//
@@ -161,7 +161,12 @@ namespace System.Resources
// into smaller chunks, each of size sqrt(n), would be substantially better for
// resource files containing thousands of resources.
//
- internal sealed class RuntimeResourceSet : ResourceSet, IEnumerable
+#if CORECLR
+ internal
+#else
+ public // On CoreRT, this must be public because of need to whitelist past the ReflectionBlock.
+#endif
+ sealed class RuntimeResourceSet : ResourceSet, IEnumerable
{
internal const int Version = 2; // File format version number
@@ -189,31 +194,18 @@ namespace System.Resources
internal RuntimeResourceSet(String fileName) : base(false)
{
- BCLDebug.Log("RESMGRFILEFORMAT", "RuntimeResourceSet .ctor(String)");
_resCache = new Dictionary<String, ResourceLocator>(FastResourceComparer.Default);
Stream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
_defaultReader = new ResourceReader(stream, _resCache);
Reader = _defaultReader;
}
-#if LOOSELY_LINKED_RESOURCE_REFERENCE
- internal RuntimeResourceSet(Stream stream, Assembly assembly) : base(false)
- {
- BCLDebug.Log("RESMGRFILEFORMAT", "RuntimeResourceSet .ctor(Stream)");
- _resCache = new Dictionary<String, ResourceLocator>(FastResourceComparer.Default);
- _defaultReader = new ResourceReader(stream, _resCache);
- Reader = _defaultReader;
- Assembly = assembly;
- }
-#else
internal RuntimeResourceSet(Stream stream) : base(false)
{
- BCLDebug.Log("RESMGRFILEFORMAT", "RuntimeResourceSet .ctor(Stream)");
_resCache = new Dictionary<String, ResourceLocator>(FastResourceComparer.Default);
_defaultReader = new ResourceReader(stream, _resCache);
Reader = _defaultReader;
}
-#endif // LOOSELY_LINKED_RESOURCE_REFERENCE
protected override void Dispose(bool disposing)
{
@@ -305,8 +297,6 @@ namespace System.Resources
if (_defaultReader != null)
{
- BCLDebug.Log("RESMGRFILEFORMAT", "Going down fast path in RuntimeResourceSet::GetObject");
-
// Find the offset within the data section
int dataPos = -1;
if (_resCache.TryGetValue(key, out resLocation))
@@ -348,13 +338,6 @@ namespace System.Resources
if (value != null || !ignoreCase)
{
-#if LOOSELY_LINKED_RESOURCE_REFERENCE
- if (Assembly != null && (value is LooselyLinkedResourceReference)) {
- LooselyLinkedResourceReference assRef = (LooselyLinkedResourceReference) value;
- value = assRef.Resolve(Assembly);
- }
-#endif // LOOSELY_LINKED_RESOURCE_REFERENCE
-
return value; // may be null
}
} // if (_defaultReader != null)
@@ -369,9 +352,6 @@ namespace System.Resources
{
_caseInsensitiveTable = new Dictionary<String, ResourceLocator>(StringComparer.OrdinalIgnoreCase);
}
-#if _DEBUG
- BCLDebug.Perf(!ignoreCase, "Using case-insensitive lookups is bad perf-wise. Consider capitalizing " + key + " correctly in your source");
-#endif
if (_defaultReader == null)
{
@@ -450,13 +430,7 @@ namespace System.Resources
copyOfCache[key] = resLocation;
}
}
-#if LOOSELY_LINKED_RESOURCE_REFERENCE
- if (Assembly != null && value is LooselyLinkedResourceReference) {
- LooselyLinkedResourceReference assRef = (LooselyLinkedResourceReference) value;
- value = assRef.Resolve(Assembly);
- }
-#endif // LOOSELY_LINKED_RESOURCE_REFERENCE
return value;
}
}
-}
+} \ No newline at end of file
diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/AsyncStateMachineAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/AsyncStateMachineAttribute.cs
index 198ed3d0e7..66c9175ee7 100644
--- a/src/mscorlib/shared/System/Runtime/CompilerServices/AsyncStateMachineAttribute.cs
+++ b/src/mscorlib/shared/System/Runtime/CompilerServices/AsyncStateMachineAttribute.cs
@@ -4,7 +4,6 @@
namespace System.Runtime.CompilerServices
{
- [Serializable]
[AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = false)]
public sealed class AsyncStateMachineAttribute : StateMachineAttribute
{
diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/CompilationRelaxations.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/CompilationRelaxations.cs
index 4da95024c5..88e2657a6a 100644
--- a/src/mscorlib/shared/System/Runtime/CompilerServices/CompilationRelaxations.cs
+++ b/src/mscorlib/shared/System/Runtime/CompilerServices/CompilationRelaxations.cs
@@ -6,7 +6,6 @@ namespace System.Runtime.CompilerServices
{
/// IMPORTANT: Keep this in sync with corhdr.h
[Flags]
- [Serializable]
public enum CompilationRelaxations : int
{
NoStringInterning = 0x0008 // Start in 0x0008, we had other non public flags in this enum before,
diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/CompilationRelaxationsAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/CompilationRelaxationsAttribute.cs
index 1f100bd415..d6da23fdf2 100644
--- a/src/mscorlib/shared/System/Runtime/CompilerServices/CompilationRelaxationsAttribute.cs
+++ b/src/mscorlib/shared/System/Runtime/CompilerServices/CompilationRelaxationsAttribute.cs
@@ -4,7 +4,6 @@
namespace System.Runtime.CompilerServices
{
- [Serializable]
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Method)]
public class CompilationRelaxationsAttribute : Attribute
{
diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/CompilerGeneratedAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/CompilerGeneratedAttribute.cs
index 3da2a95aeb..1c05abd1fe 100644
--- a/src/mscorlib/shared/System/Runtime/CompilerServices/CompilerGeneratedAttribute.cs
+++ b/src/mscorlib/shared/System/Runtime/CompilerServices/CompilerGeneratedAttribute.cs
@@ -4,7 +4,6 @@
namespace System.Runtime.CompilerServices
{
- [Serializable]
[AttributeUsage(AttributeTargets.All, Inherited = true)]
public sealed class CompilerGeneratedAttribute : Attribute
{
diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/CompilerGlobalScopeAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/CompilerGlobalScopeAttribute.cs
index 22fa694200..752295e876 100644
--- a/src/mscorlib/shared/System/Runtime/CompilerServices/CompilerGlobalScopeAttribute.cs
+++ b/src/mscorlib/shared/System/Runtime/CompilerServices/CompilerGlobalScopeAttribute.cs
@@ -6,7 +6,6 @@ namespace System.Runtime.CompilerServices
{
// Attribute used to communicate to the VS7 debugger that a class should be treated as if it has global scope.
- [Serializable]
[AttributeUsage(AttributeTargets.Class)]
public class CompilerGlobalScopeAttribute : Attribute
{
diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/DefaultDependencyAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/DefaultDependencyAttribute.cs
index f5419d413b..4c1f489215 100644
--- a/src/mscorlib/shared/System/Runtime/CompilerServices/DefaultDependencyAttribute.cs
+++ b/src/mscorlib/shared/System/Runtime/CompilerServices/DefaultDependencyAttribute.cs
@@ -4,7 +4,6 @@
namespace System.Runtime.CompilerServices
{
- [Serializable]
[AttributeUsage(AttributeTargets.Assembly)]
public sealed class DefaultDependencyAttribute : Attribute
{
diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/DependencyAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/DependencyAttribute.cs
index 56f4242bb1..0fe07edc9e 100644
--- a/src/mscorlib/shared/System/Runtime/CompilerServices/DependencyAttribute.cs
+++ b/src/mscorlib/shared/System/Runtime/CompilerServices/DependencyAttribute.cs
@@ -4,7 +4,6 @@
namespace System.Runtime.CompilerServices
{
- [Serializable]
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
public sealed class DependencyAttribute : Attribute
{
diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/FixedAddressValueTypeAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/FixedAddressValueTypeAttribute.cs
index baf5824241..8dc6c43126 100644
--- a/src/mscorlib/shared/System/Runtime/CompilerServices/FixedAddressValueTypeAttribute.cs
+++ b/src/mscorlib/shared/System/Runtime/CompilerServices/FixedAddressValueTypeAttribute.cs
@@ -4,7 +4,6 @@
namespace System.Runtime.CompilerServices
{
- [Serializable]
[AttributeUsage(AttributeTargets.Field)]
public sealed class FixedAddressValueTypeAttribute : Attribute
{
diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/IndexerNameAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/IndexerNameAttribute.cs
index 65653a44d9..ea843b3daa 100644
--- a/src/mscorlib/shared/System/Runtime/CompilerServices/IndexerNameAttribute.cs
+++ b/src/mscorlib/shared/System/Runtime/CompilerServices/IndexerNameAttribute.cs
@@ -4,7 +4,6 @@
namespace System.Runtime.CompilerServices
{
- [Serializable]
[AttributeUsage(AttributeTargets.Property, Inherited = true)]
public sealed class IndexerNameAttribute : Attribute
{
diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/IsByRefLikeAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/IsByRefLikeAttribute.cs
new file mode 100644
index 0000000000..90e49d2a42
--- /dev/null
+++ b/src/mscorlib/shared/System/Runtime/CompilerServices/IsByRefLikeAttribute.cs
@@ -0,0 +1,21 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.ComponentModel;
+
+namespace System.Runtime.CompilerServices
+{
+ /// <summary>
+ /// Reserved to be used by the compiler for tracking metadata.
+ /// This attribute should not be used by developers in source code.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ [AttributeUsage(AttributeTargets.Struct)]
+ public sealed class IsByRefLikeAttribute : Attribute
+ {
+ public IsByRefLikeAttribute()
+ {
+ }
+ }
+}
diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/IteratorStateMachineAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/IteratorStateMachineAttribute.cs
index 5ac3918028..53afc95664 100644
--- a/src/mscorlib/shared/System/Runtime/CompilerServices/IteratorStateMachineAttribute.cs
+++ b/src/mscorlib/shared/System/Runtime/CompilerServices/IteratorStateMachineAttribute.cs
@@ -4,7 +4,6 @@
namespace System.Runtime.CompilerServices
{
- [Serializable]
[AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = false)]
public sealed class IteratorStateMachineAttribute : StateMachineAttribute
{
diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/LoadHint.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/LoadHint.cs
index ae6d9b9372..3820f8544b 100644
--- a/src/mscorlib/shared/System/Runtime/CompilerServices/LoadHint.cs
+++ b/src/mscorlib/shared/System/Runtime/CompilerServices/LoadHint.cs
@@ -4,7 +4,6 @@
namespace System.Runtime.CompilerServices
{
- [Serializable]
public enum LoadHint
{
Default = 0x0000, // No preference specified
diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/MethodCodeType.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/MethodCodeType.cs
index e82993a5de..841b666198 100644
--- a/src/mscorlib/shared/System/Runtime/CompilerServices/MethodCodeType.cs
+++ b/src/mscorlib/shared/System/Runtime/CompilerServices/MethodCodeType.cs
@@ -6,7 +6,6 @@ using System.Reflection;
namespace System.Runtime.CompilerServices
{
- [Serializable]
public enum MethodCodeType
{
IL = MethodImplAttributes.IL,
diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/ReferenceAssemblyAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/ReferenceAssemblyAttribute.cs
index 6e307e72af..f3842ec562 100644
--- a/src/mscorlib/shared/System/Runtime/CompilerServices/ReferenceAssemblyAttribute.cs
+++ b/src/mscorlib/shared/System/Runtime/CompilerServices/ReferenceAssemblyAttribute.cs
@@ -15,7 +15,6 @@
namespace System.Runtime.CompilerServices
{
- [Serializable]
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
public sealed class ReferenceAssemblyAttribute : Attribute
{
diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/RuntimeCompatibilityAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/RuntimeCompatibilityAttribute.cs
index 55dba0d113..609c560330 100644
--- a/src/mscorlib/shared/System/Runtime/CompilerServices/RuntimeCompatibilityAttribute.cs
+++ b/src/mscorlib/shared/System/Runtime/CompilerServices/RuntimeCompatibilityAttribute.cs
@@ -13,7 +13,6 @@
namespace System.Runtime.CompilerServices
{
- [Serializable]
[AttributeUsage(AttributeTargets.Assembly, Inherited = false, AllowMultiple = false)]
public sealed class RuntimeCompatibilityAttribute : Attribute
{
diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/StateMachineAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/StateMachineAttribute.cs
index 94ed5b5c74..e081d63e71 100644
--- a/src/mscorlib/shared/System/Runtime/CompilerServices/StateMachineAttribute.cs
+++ b/src/mscorlib/shared/System/Runtime/CompilerServices/StateMachineAttribute.cs
@@ -6,7 +6,6 @@ using System;
namespace System.Runtime.CompilerServices
{
- [Serializable]
[AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = false)]
public class StateMachineAttribute : Attribute
{
diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/StringFreezingAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/StringFreezingAttribute.cs
index 7772a1a263..25a8bfbc26 100644
--- a/src/mscorlib/shared/System/Runtime/CompilerServices/StringFreezingAttribute.cs
+++ b/src/mscorlib/shared/System/Runtime/CompilerServices/StringFreezingAttribute.cs
@@ -6,7 +6,6 @@ namespace System.Runtime.CompilerServices
{
// Custom attribute to indicate that strings should be frozen.
- [Serializable]
[AttributeUsage(AttributeTargets.Assembly, Inherited = false)]
public sealed class StringFreezingAttribute : Attribute
{
diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/UnsafeValueTypeAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/UnsafeValueTypeAttribute.cs
index 162676efe8..f049c89b3f 100644
--- a/src/mscorlib/shared/System/Runtime/CompilerServices/UnsafeValueTypeAttribute.cs
+++ b/src/mscorlib/shared/System/Runtime/CompilerServices/UnsafeValueTypeAttribute.cs
@@ -4,7 +4,6 @@
namespace System.Runtime.CompilerServices
{
- [Serializable]
[AttributeUsage(AttributeTargets.Struct)]
sealed public class UnsafeValueTypeAttribute : Attribute
{
diff --git a/src/mscorlib/shared/System/Runtime/ConstrainedExecution/Cer.cs b/src/mscorlib/shared/System/Runtime/ConstrainedExecution/Cer.cs
index c142ec9ecc..77ab3ea770 100644
--- a/src/mscorlib/shared/System/Runtime/ConstrainedExecution/Cer.cs
+++ b/src/mscorlib/shared/System/Runtime/ConstrainedExecution/Cer.cs
@@ -4,7 +4,6 @@
namespace System.Runtime.ConstrainedExecution
{
- [Serializable]
public enum Cer : int
{
None = 0,
diff --git a/src/mscorlib/shared/System/Runtime/ConstrainedExecution/Consistency.cs b/src/mscorlib/shared/System/Runtime/ConstrainedExecution/Consistency.cs
index 7ee8480e89..e2cc79ec35 100644
--- a/src/mscorlib/shared/System/Runtime/ConstrainedExecution/Consistency.cs
+++ b/src/mscorlib/shared/System/Runtime/ConstrainedExecution/Consistency.cs
@@ -4,7 +4,6 @@
namespace System.Runtime.ConstrainedExecution
{
- [Serializable]
public enum Consistency : int
{
MayCorruptProcess = 0,
diff --git a/src/mscorlib/shared/System/Runtime/InteropServices/ExternalException.cs b/src/mscorlib/shared/System/Runtime/InteropServices/ExternalException.cs
index d7bde79c43..81b9a46928 100644
--- a/src/mscorlib/shared/System/Runtime/InteropServices/ExternalException.cs
+++ b/src/mscorlib/shared/System/Runtime/InteropServices/ExternalException.cs
@@ -21,7 +21,6 @@ namespace System.Runtime.InteropServices
// Base exception for COM Interop errors &; Structured Exception Handler
// exceptions.
//
- [Serializable]
public class ExternalException : SystemException
{
public ExternalException()
@@ -51,6 +50,7 @@ namespace System.Runtime.InteropServices
protected ExternalException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
+ throw new PlatformNotSupportedException();
}
public virtual int ErrorCode
diff --git a/src/mscorlib/shared/System/Runtime/Serialization/SerializationException.cs b/src/mscorlib/shared/System/Runtime/Serialization/SerializationException.cs
index a359daf4f9..bfe3313659 100644
--- a/src/mscorlib/shared/System/Runtime/Serialization/SerializationException.cs
+++ b/src/mscorlib/shared/System/Runtime/Serialization/SerializationException.cs
@@ -6,7 +6,6 @@ using System.Runtime.Serialization;
namespace System.Runtime.Serialization
{
- [Serializable]
public class SerializationException : SystemException
{
private static String s_nullMessage = SR.SerializationException;
@@ -34,6 +33,7 @@ namespace System.Runtime.Serialization
protected SerializationException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
+ throw new PlatformNotSupportedException();
}
}
}
diff --git a/src/mscorlib/shared/System/Runtime/Serialization/StreamingContext.cs b/src/mscorlib/shared/System/Runtime/Serialization/StreamingContext.cs
index 1026a87d1e..4fe90cad8d 100644
--- a/src/mscorlib/shared/System/Runtime/Serialization/StreamingContext.cs
+++ b/src/mscorlib/shared/System/Runtime/Serialization/StreamingContext.cs
@@ -4,7 +4,6 @@
namespace System.Runtime.Serialization
{
- [Serializable]
public struct StreamingContext
{
private readonly object _additionalContext;
diff --git a/src/mscorlib/shared/System/Security/CryptographicException.cs b/src/mscorlib/shared/System/Security/CryptographicException.cs
index 89cb658aa9..7c4fa176f3 100644
--- a/src/mscorlib/shared/System/Security/CryptographicException.cs
+++ b/src/mscorlib/shared/System/Security/CryptographicException.cs
@@ -7,7 +7,6 @@ using System.Runtime.Serialization;
namespace System.Security.Cryptography
{
- [Serializable]
public class CryptographicException : SystemException
{
public CryptographicException()
@@ -39,6 +38,7 @@ namespace System.Security.Cryptography
protected CryptographicException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
+ throw new PlatformNotSupportedException();
}
}
}
diff --git a/src/mscorlib/shared/System/Security/SafeBSTRHandle.cs b/src/mscorlib/shared/System/Security/SafeBSTRHandle.cs
index a1164dce91..227fed3fc3 100644
--- a/src/mscorlib/shared/System/Security/SafeBSTRHandle.cs
+++ b/src/mscorlib/shared/System/Security/SafeBSTRHandle.cs
@@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+using System.Runtime;
using System.Diagnostics;
using System.Runtime.InteropServices;
@@ -25,7 +26,7 @@ namespace System.Security
override protected bool ReleaseHandle()
{
- Interop.NtDll.ZeroMemory(handle, (UIntPtr)(Interop.OleAut32.SysStringLen(handle) * sizeof(char)));
+ RuntimeImports.RhZeroMemory(handle, (UIntPtr)(Interop.OleAut32.SysStringLen(handle) * sizeof(char)));
Interop.OleAut32.SysFreeString(handle);
return true;
}
@@ -36,7 +37,7 @@ namespace System.Security
try
{
AcquirePointer(ref bufferPtr);
- Interop.NtDll.ZeroMemory((IntPtr)bufferPtr, (UIntPtr)(Interop.OleAut32.SysStringLen((IntPtr)bufferPtr) * sizeof(char)));
+ RuntimeImports.RhZeroMemory((IntPtr)bufferPtr, (UIntPtr)(Interop.OleAut32.SysStringLen((IntPtr)bufferPtr) * sizeof(char)));
}
finally
{
diff --git a/src/mscorlib/shared/System/Security/SecureString.Unix.cs b/src/mscorlib/shared/System/Security/SecureString.Unix.cs
index 0ef38e40ee..cfeebc1daf 100644
--- a/src/mscorlib/shared/System/Security/SecureString.Unix.cs
+++ b/src/mscorlib/shared/System/Security/SecureString.Unix.cs
@@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information.
using System.Diagnostics;
+using System.Runtime;
using System.Runtime.InteropServices;
using System.Text;
@@ -142,6 +143,41 @@ namespace System.Security
_buffer.Write((ulong)(index * sizeof(char)), c);
}
+ internal unsafe IntPtr MarshalToBSTR()
+ {
+ int length = _decryptedLength;
+ IntPtr ptr = IntPtr.Zero;
+ IntPtr result = IntPtr.Zero;
+ byte* bufferPtr = null;
+
+ try
+ {
+ _buffer.AcquirePointer(ref bufferPtr);
+ int resultByteLength = (length + 1) * sizeof(char);
+
+ ptr = PInvokeMarshal.AllocBSTR(length);
+
+ Buffer.MemoryCopy(bufferPtr, (byte*)ptr, resultByteLength, length * sizeof(char));
+
+ result = ptr;
+ }
+ finally
+ {
+ // If we failed for any reason, free the new buffer
+ if (result == IntPtr.Zero && ptr != IntPtr.Zero)
+ {
+ RuntimeImports.RhZeroMemory(ptr, (UIntPtr)(length * sizeof(char)));
+ PInvokeMarshal.FreeBSTR(ptr);
+ }
+
+ if (bufferPtr != null)
+ {
+ _buffer.ReleasePointer();
+ }
+ }
+ return result;
+ }
+
internal unsafe IntPtr MarshalToStringCore(bool globalAlloc, bool unicode)
{
int length = _decryptedLength;
@@ -179,7 +215,7 @@ namespace System.Security
// release the string if we had one.
if (stringPtr != IntPtr.Zero && result == IntPtr.Zero)
{
- UnmanagedBuffer.ZeroMemory((byte*)stringPtr, (ulong)(length * sizeof(char)));
+ RuntimeImports.RhZeroMemory(stringPtr, (UIntPtr)(length * sizeof(char)));
MarshalFree(stringPtr, globalAlloc);
}
@@ -241,7 +277,7 @@ namespace System.Security
try
{
AcquirePointer(ref ptr);
- ZeroMemory(ptr, ByteLength);
+ RuntimeImports.RhZeroMemory((IntPtr)ptr, (UIntPtr)ByteLength);
}
finally
{
@@ -284,12 +320,6 @@ namespace System.Security
Marshal.FreeHGlobal(handle);
return true;
}
-
- internal static unsafe void ZeroMemory(byte* ptr, ulong len)
- {
- for (ulong i = 0; i < len; i++) *ptr++ = 0;
- }
}
-
}
}
diff --git a/src/mscorlib/shared/System/Security/SecureString.Windows.cs b/src/mscorlib/shared/System/Security/SecureString.Windows.cs
index 13f75a37e9..2a80081912 100644
--- a/src/mscorlib/shared/System/Security/SecureString.Windows.cs
+++ b/src/mscorlib/shared/System/Security/SecureString.Windows.cs
@@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information.
using System.Diagnostics;
+using System.Runtime;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using Microsoft.Win32;
@@ -157,11 +158,7 @@ namespace System.Security
_buffer.AcquirePointer(ref bufferPtr);
int resultByteLength = (length + 1) * sizeof(char);
- ptr = Interop.OleAut32.SysAllocStringLen(null, length);
- if (ptr == IntPtr.Zero)
- {
- throw new OutOfMemoryException();
- }
+ ptr = PInvokeMarshal.AllocBSTR(length);
Buffer.MemoryCopy(bufferPtr, (byte*)ptr, resultByteLength, length * sizeof(char));
@@ -174,8 +171,8 @@ namespace System.Security
// If we failed for any reason, free the new buffer
if (result == IntPtr.Zero && ptr != IntPtr.Zero)
{
- Interop.NtDll.ZeroMemory(ptr, (UIntPtr)(length * sizeof(char)));
- Interop.OleAut32.SysFreeString(ptr);
+ RuntimeImports.RhZeroMemory(ptr, (UIntPtr)(length * sizeof(char)));
+ PInvokeMarshal.FreeBSTR(ptr);
}
if (bufferPtr != null)
@@ -223,7 +220,7 @@ namespace System.Security
// If we failed for any reason, free the new buffer
if (result == IntPtr.Zero && ptr != IntPtr.Zero)
{
- Interop.NtDll.ZeroMemory(ptr, (UIntPtr)(length * sizeof(char)));
+ RuntimeImports.RhZeroMemory(ptr, (UIntPtr)(length * sizeof(char)));
MarshalFree(ptr, globalAlloc);
}
diff --git a/src/mscorlib/shared/System/Security/SecurityException.cs b/src/mscorlib/shared/System/Security/SecurityException.cs
index 86e3cd4631..538f475343 100644
--- a/src/mscorlib/shared/System/Security/SecurityException.cs
+++ b/src/mscorlib/shared/System/Security/SecurityException.cs
@@ -7,7 +7,6 @@ using System.Runtime.Serialization;
namespace System.Security
{
- [Serializable]
public class SecurityException : SystemException
{
public SecurityException()
@@ -46,6 +45,7 @@ namespace System.Security
protected SecurityException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
+ throw new PlatformNotSupportedException();
}
public override string ToString() => base.ToString();
diff --git a/src/mscorlib/shared/System/Security/VerificationException.cs b/src/mscorlib/shared/System/Security/VerificationException.cs
index 9641e1aa46..ea5a75906e 100644
--- a/src/mscorlib/shared/System/Security/VerificationException.cs
+++ b/src/mscorlib/shared/System/Security/VerificationException.cs
@@ -6,7 +6,6 @@ using System.Runtime.Serialization;
namespace System.Security
{
- [Serializable]
public class VerificationException : SystemException
{
public VerificationException()
@@ -30,6 +29,7 @@ namespace System.Security
protected VerificationException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
+ throw new PlatformNotSupportedException();
}
}
}
diff --git a/src/mscorlib/shared/System/StackOverflowException.cs b/src/mscorlib/shared/System/StackOverflowException.cs
index 0a875e7373..fb0e88246c 100644
--- a/src/mscorlib/shared/System/StackOverflowException.cs
+++ b/src/mscorlib/shared/System/StackOverflowException.cs
@@ -15,7 +15,6 @@ using System.Runtime.Serialization;
namespace System
{
- [Serializable]
public sealed class StackOverflowException : SystemException
{
public StackOverflowException()
@@ -35,7 +34,5 @@ namespace System
{
HResult = __HResults.COR_E_STACKOVERFLOW;
}
-
- internal StackOverflowException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}
diff --git a/src/mscorlib/shared/System/StringComparison.cs b/src/mscorlib/shared/System/StringComparison.cs
index 8b4e2ae2fe..d5c18c8021 100644
--- a/src/mscorlib/shared/System/StringComparison.cs
+++ b/src/mscorlib/shared/System/StringComparison.cs
@@ -4,7 +4,6 @@
namespace System
{
- [Serializable]
public enum StringComparison
{
CurrentCulture = 0,
diff --git a/src/mscorlib/shared/System/SystemException.cs b/src/mscorlib/shared/System/SystemException.cs
index f4779a2cd4..d5bcde7efc 100644
--- a/src/mscorlib/shared/System/SystemException.cs
+++ b/src/mscorlib/shared/System/SystemException.cs
@@ -6,7 +6,6 @@ using System.Runtime.Serialization;
namespace System
{
- [Serializable]
public class SystemException : Exception
{
public SystemException()
@@ -27,6 +26,9 @@ namespace System
HResult = __HResults.COR_E_SYSTEM;
}
- protected SystemException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ protected SystemException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ throw new PlatformNotSupportedException();
+ }
}
}
diff --git a/src/mscorlib/shared/System/Text/ASCIIEncoding.cs b/src/mscorlib/shared/System/Text/ASCIIEncoding.cs
index e5c1194849..628ec9a3fa 100644
--- a/src/mscorlib/shared/System/Text/ASCIIEncoding.cs
+++ b/src/mscorlib/shared/System/Text/ASCIIEncoding.cs
@@ -19,11 +19,9 @@ namespace System.Text
// Note: IsAlwaysNormalized remains false because 1/2 the code points are unassigned, so they'd
// use fallbacks, and we cannot guarantee that fallbacks are normalized.
- [Serializable]
public class ASCIIEncoding : Encoding
{
// Allow for devirtualization (see https://github.com/dotnet/coreclr/pull/9230)
- [Serializable]
internal sealed class ASCIIEncodingSealed : ASCIIEncoding { }
// Used by Encoding.ASCII for lazy initialization
diff --git a/src/mscorlib/shared/System/Text/Decoder.cs b/src/mscorlib/shared/System/Text/Decoder.cs
index b2a003037b..aefe1f64bd 100644
--- a/src/mscorlib/shared/System/Text/Decoder.cs
+++ b/src/mscorlib/shared/System/Text/Decoder.cs
@@ -21,7 +21,6 @@ namespace System.Text
// class are typically obtained through calls to the GetDecoder method
// of Encoding objects.
//
- [Serializable]
public abstract class Decoder
{
internal DecoderFallback m_fallback = null;
diff --git a/src/mscorlib/shared/System/Text/Encoder.cs b/src/mscorlib/shared/System/Text/Encoder.cs
index e4e91765e1..c4b54ce75c 100644
--- a/src/mscorlib/shared/System/Text/Encoder.cs
+++ b/src/mscorlib/shared/System/Text/Encoder.cs
@@ -21,7 +21,6 @@ namespace System.Text
// class are typically obtained through calls to the GetEncoder method
// of Encoding objects.
//
- [Serializable]
public abstract class Encoder
{
internal EncoderFallback m_fallback = null;
diff --git a/src/mscorlib/shared/System/Text/EncodingInfo.cs b/src/mscorlib/shared/System/Text/EncodingInfo.cs
index 360dd7f638..99995f759b 100644
--- a/src/mscorlib/shared/System/Text/EncodingInfo.cs
+++ b/src/mscorlib/shared/System/Text/EncodingInfo.cs
@@ -7,7 +7,6 @@ using System.Text;
namespace System.Text
{
- [Serializable]
public sealed class EncodingInfo
{
private int iCodePage; // Code Page #
diff --git a/src/mscorlib/shared/System/Text/EncodingNLS.cs b/src/mscorlib/shared/System/Text/EncodingNLS.cs
index 205ae26902..835bf8fb37 100644
--- a/src/mscorlib/shared/System/Text/EncodingNLS.cs
+++ b/src/mscorlib/shared/System/Text/EncodingNLS.cs
@@ -23,7 +23,6 @@ namespace System.Text
// So if you change the wrappers in this class, you must change the wrappers in the other classes
// as well because they should have the same behavior.
- [Serializable]
internal abstract class EncodingNLS : Encoding
{
protected EncodingNLS(int codePage) : base(codePage)
diff --git a/src/mscorlib/shared/System/Text/UTF32Encoding.cs b/src/mscorlib/shared/System/Text/UTF32Encoding.cs
index e4cd6c960e..450aee2a4a 100644
--- a/src/mscorlib/shared/System/Text/UTF32Encoding.cs
+++ b/src/mscorlib/shared/System/Text/UTF32Encoding.cs
@@ -21,7 +21,6 @@ namespace System.Text
// mark is used mostly to distinguish UTF-32 text from other encodings, and doesn't
// switch the byte orderings.
- [Serializable]
public sealed class UTF32Encoding : Encoding
{
/*
@@ -1200,7 +1199,6 @@ namespace System.Text
CodePage + (_emitUTF32ByteOrderMark ? 4 : 0) + (_bigEndian ? 8 : 0);
}
- [Serializable]
private sealed class UTF32Decoder : DecoderNLS
{
// Need a place to store any extra bytes we may have picked up
diff --git a/src/mscorlib/shared/System/Text/UTF8Encoding.cs b/src/mscorlib/shared/System/Text/UTF8Encoding.cs
index 5cfa89018a..ee5c92c3a8 100644
--- a/src/mscorlib/shared/System/Text/UTF8Encoding.cs
+++ b/src/mscorlib/shared/System/Text/UTF8Encoding.cs
@@ -34,7 +34,6 @@ namespace System.Text
// used mostly to distinguish UTF-8 text from other encodings, and doesn't
// switch the byte orderings.
- [Serializable]
public class UTF8Encoding : Encoding
{
/*
@@ -53,7 +52,6 @@ namespace System.Text
private const int UTF8_CODEPAGE = 65001;
// Allow for devirtualization (see https://github.com/dotnet/coreclr/pull/9230)
- [Serializable]
internal sealed class UTF8EncodingSealed : UTF8Encoding
{
public UTF8EncodingSealed(bool encoderShouldEmitUTF8Identifier) : base(encoderShouldEmitUTF8Identifier) { }
@@ -2521,7 +2519,6 @@ namespace System.Text
UTF8_CODEPAGE + (_emitUTF8Identifier ? 1 : 0);
}
- [Serializable]
private sealed class UTF8Encoder : EncoderNLS, ISerializable
{
// We must save a high surrogate value until the next call, looking
@@ -2533,46 +2530,10 @@ namespace System.Text
// base calls reset
}
- // Constructor called by serialization, have to handle deserializing from Everett
- internal UTF8Encoder(SerializationInfo info, StreamingContext context)
- {
- // Any info?
- if (info == null) throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- // Get common info
- this.m_encoding = (Encoding)info.GetValue("encoding", typeof(Encoding));
-
- // SurrogateChar happens to mean the same thing
- this.surrogateChar = (int)info.GetValue("surrogateChar", typeof(int));
-
- try
- {
- this.m_fallback = (EncoderFallback)info.GetValue("m_fallback", typeof(EncoderFallback));
- }
- catch (SerializationException)
- {
- this.m_fallback = null;
- }
- }
-
- // ISerializable implementation, get data for this object
+ // ISerializable implementation
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
{
- // Any info?
- if (info == null) throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- // Save Whidbey data
- // Just need Everett maxCharSize (BaseCodePageEncoding) or m_maxByteSize (MLangBaseCodePageEncoding)
- info.AddValue("encoding", this.m_encoding);
- info.AddValue("surrogateChar", this.surrogateChar);
-
- info.AddValue("m_fallback", this.m_fallback);
-
- // Extra stuff for Everett that Whidbey doesn't use
- info.AddValue("storedSurrogate", this.surrogateChar > 0 ? true : false);
- info.AddValue("mustFlush", false); // Everett doesn't actually use this either, but it accidently serialized it!
+ throw new PlatformNotSupportedException();
}
public override void Reset()
@@ -2593,7 +2554,6 @@ namespace System.Text
}
}
- [Serializable]
private sealed class UTF8Decoder : DecoderNLS, ISerializable
{
// We'll need to remember the previous information. See the comments around definition
@@ -2608,44 +2568,13 @@ namespace System.Text
// Constructor called by serialization, have to handle deserializing from Everett
internal UTF8Decoder(SerializationInfo info, StreamingContext context)
{
- // Any info?
- if (info == null) throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- // Get common info
- this.m_encoding = (Encoding)info.GetValue("encoding", typeof(Encoding));
-
- try
- {
- // Get whidbey version of bits
- this.bits = (int)info.GetValue("wbits", typeof(int));
- this.m_fallback = (DecoderFallback)info.GetValue("m_fallback", typeof(DecoderFallback));
- }
- catch (SerializationException)
- {
- // Everett calls bits bits instead of wbits, so this is Everett
- this.bits = 0;
- this.m_fallback = null;
- }
+ throw new PlatformNotSupportedException();
}
// ISerializable implementation, get data for this object
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
{
- // Any info?
- if (info == null) throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- // Save new Whidbey data
- info.AddValue("encoding", this.m_encoding);
- info.AddValue("wbits", this.bits); // Special whidbey bits name
- info.AddValue("m_fallback", this.m_fallback);
-
- // Everett has extra stuff, we set it all to 0 in case this deserializes in Everett
- info.AddValue("bits", (int)0);
- info.AddValue("trailCount", (int)0);
- info.AddValue("isSurrogate", false);
- info.AddValue("byteSequence", (int)0);
+ throw new PlatformNotSupportedException();
}
public override void Reset()
diff --git a/src/mscorlib/shared/System/Text/UnicodeEncoding.cs b/src/mscorlib/shared/System/Text/UnicodeEncoding.cs
index 0e4db9aaad..846946ce94 100644
--- a/src/mscorlib/shared/System/Text/UnicodeEncoding.cs
+++ b/src/mscorlib/shared/System/Text/UnicodeEncoding.cs
@@ -14,7 +14,6 @@ using System.Diagnostics.Contracts;
namespace System.Text
{
- [Serializable]
public class UnicodeEncoding : Encoding
{
// Used by Encoding.BigEndianUnicode/Unicode for lazy initialization
@@ -1983,7 +1982,6 @@ namespace System.Text
(byteOrderMark ? 4 : 0) + (bigEndian ? 8 : 0);
}
- [Serializable]
private sealed class Decoder : System.Text.DecoderNLS, ISerializable
{
internal int lastByte = -1;
@@ -1993,47 +1991,16 @@ namespace System.Text
{
// base calls reset
}
-
- // Constructor called by serialization, have to handle deserializing from Everett
+
internal Decoder(SerializationInfo info, StreamingContext context)
{
- // Any info?
- if (info == null) throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- // Get Common Info
- this.lastByte = (int)info.GetValue("lastByte", typeof(int));
-
- try
- {
- // Try the encoding, which is only serialized in Whidbey
- this.m_encoding = (Encoding)info.GetValue("m_encoding", typeof(Encoding));
- this.lastChar = (char)info.GetValue("lastChar", typeof(char));
- this.m_fallback = (DecoderFallback)info.GetValue("m_fallback", typeof(DecoderFallback));
- }
- catch (SerializationException)
- {
- // Everett didn't serialize the UnicodeEncoding, get the default one
- bool bigEndian = (bool)info.GetValue("bigEndian", typeof(bool));
- this.m_encoding = new UnicodeEncoding(bigEndian, false);
- }
+ throw new PlatformNotSupportedException();
}
- // ISerializable implementation, get data for this object
+ // ISerializable implementation
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
{
- // Any info?
- if (info == null) throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- // Save Whidbey data
- info.AddValue("m_encoding", this.m_encoding);
- info.AddValue("m_fallback", this.m_fallback);
- info.AddValue("lastChar", this.lastChar); // Unused by everett so it'll probably get lost
- info.AddValue("lastByte", this.lastByte);
-
- // Everett Only
- info.AddValue("bigEndian", ((UnicodeEncoding)(this.m_encoding)).bigEndian);
+ throw new PlatformNotSupportedException();
}
public override void Reset()
diff --git a/src/mscorlib/shared/System/ThreadStaticAttribute.cs b/src/mscorlib/shared/System/ThreadStaticAttribute.cs
index 3755e65a7b..c12ac1c18d 100644
--- a/src/mscorlib/shared/System/ThreadStaticAttribute.cs
+++ b/src/mscorlib/shared/System/ThreadStaticAttribute.cs
@@ -17,7 +17,6 @@ using System;
namespace System
{
- [Serializable]
[AttributeUsage(AttributeTargets.Field, Inherited = false)]
public class ThreadStaticAttribute : Attribute
{
diff --git a/src/mscorlib/shared/System/Threading/AbandonedMutexException.cs b/src/mscorlib/shared/System/Threading/AbandonedMutexException.cs
index 8056a3b330..15bc5a7341 100644
--- a/src/mscorlib/shared/System/Threading/AbandonedMutexException.cs
+++ b/src/mscorlib/shared/System/Threading/AbandonedMutexException.cs
@@ -14,7 +14,6 @@ using System.Runtime.Serialization;
namespace System.Threading
{
- [Serializable]
public class AbandonedMutexException : SystemException
{
private int _mutexIndex = -1;
@@ -62,6 +61,7 @@ namespace System.Threading
protected AbandonedMutexException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
+ throw new PlatformNotSupportedException();
}
private void SetupException(int location, WaitHandle handle)
diff --git a/src/mscorlib/shared/System/Threading/ExecutionContext.cs b/src/mscorlib/shared/System/Threading/ExecutionContext.cs
index 67857e9b11..a573af3383 100644
--- a/src/mscorlib/shared/System/Threading/ExecutionContext.cs
+++ b/src/mscorlib/shared/System/Threading/ExecutionContext.cs
@@ -44,7 +44,6 @@ namespace System.Threading
}
}
- [Serializable]
public sealed class ExecutionContext : IDisposable, ISerializable
{
internal static readonly ExecutionContext Default = new ExecutionContext();
@@ -71,15 +70,7 @@ namespace System.Threading
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
- if (info == null)
- {
- throw new ArgumentNullException(nameof(info));
- }
- Contract.EndContractBlock();
- }
-
- private ExecutionContext(SerializationInfo info, StreamingContext context)
- {
+ throw new PlatformNotSupportedException();
}
public static ExecutionContext Capture()
diff --git a/src/mscorlib/shared/System/Threading/LockRecursionException.cs b/src/mscorlib/shared/System/Threading/LockRecursionException.cs
index 2f296cb14e..86e19032b3 100644
--- a/src/mscorlib/shared/System/Threading/LockRecursionException.cs
+++ b/src/mscorlib/shared/System/Threading/LockRecursionException.cs
@@ -7,7 +7,6 @@ using System.Runtime.Serialization;
namespace System.Threading
{
- [Serializable]
public class LockRecursionException : System.Exception
{
public LockRecursionException()
@@ -24,6 +23,9 @@ namespace System.Threading
{
}
- protected LockRecursionException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ protected LockRecursionException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ throw new PlatformNotSupportedException();
+ }
}
}
diff --git a/src/mscorlib/shared/System/Threading/SemaphoreFullException.cs b/src/mscorlib/shared/System/Threading/SemaphoreFullException.cs
index 19ac19d6e0..777463b60d 100644
--- a/src/mscorlib/shared/System/Threading/SemaphoreFullException.cs
+++ b/src/mscorlib/shared/System/Threading/SemaphoreFullException.cs
@@ -7,7 +7,6 @@ using System.Runtime.Serialization;
namespace System.Threading
{
- [Serializable]
public class SemaphoreFullException : SystemException
{
public SemaphoreFullException() : base(SR.Threading_SemaphoreFullException)
@@ -24,6 +23,7 @@ namespace System.Threading
protected SemaphoreFullException(SerializationInfo info, StreamingContext context) : base(info, context)
{
+ throw new PlatformNotSupportedException();
}
}
}
diff --git a/src/mscorlib/shared/System/Threading/SynchronizationLockException.cs b/src/mscorlib/shared/System/Threading/SynchronizationLockException.cs
index 120577fdcf..c64fc9ced8 100644
--- a/src/mscorlib/shared/System/Threading/SynchronizationLockException.cs
+++ b/src/mscorlib/shared/System/Threading/SynchronizationLockException.cs
@@ -16,7 +16,6 @@ using System.Runtime.Serialization;
namespace System.Threading
{
- [Serializable]
public class SynchronizationLockException : SystemException
{
public SynchronizationLockException()
@@ -39,6 +38,7 @@ namespace System.Threading
protected SynchronizationLockException(SerializationInfo info, StreamingContext context) : base(info, context)
{
+ throw new PlatformNotSupportedException();
}
}
}
diff --git a/src/mscorlib/shared/System/Threading/Tasks/TaskCanceledException.cs b/src/mscorlib/shared/System/Threading/Tasks/TaskCanceledException.cs
index d7690d4c7c..6657bcd36c 100644
--- a/src/mscorlib/shared/System/Threading/Tasks/TaskCanceledException.cs
+++ b/src/mscorlib/shared/System/Threading/Tasks/TaskCanceledException.cs
@@ -19,7 +19,6 @@ namespace System.Threading.Tasks
/// <summary>
/// Represents an exception used to communicate task cancellation.
/// </summary>
- [Serializable]
public class TaskCanceledException : OperationCanceledException
{
[NonSerialized]
@@ -71,6 +70,7 @@ namespace System.Threading.Tasks
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination. </param>
protected TaskCanceledException(SerializationInfo info, StreamingContext context) : base(info, context)
{
+ throw new PlatformNotSupportedException();
}
/// <summary>
diff --git a/src/mscorlib/shared/System/Threading/Tasks/TaskSchedulerException.cs b/src/mscorlib/shared/System/Threading/Tasks/TaskSchedulerException.cs
index 148b6300ef..2888415d0d 100644
--- a/src/mscorlib/shared/System/Threading/Tasks/TaskSchedulerException.cs
+++ b/src/mscorlib/shared/System/Threading/Tasks/TaskSchedulerException.cs
@@ -20,7 +20,6 @@ namespace System.Threading.Tasks
/// Represents an exception used to communicate an invalid operation by a
/// <see cref="T:System.Threading.Tasks.TaskScheduler"/>.
/// </summary>
- [Serializable]
public class TaskSchedulerException : Exception
{
/// <summary>
@@ -72,6 +71,7 @@ namespace System.Threading.Tasks
protected TaskSchedulerException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
+ throw new PlatformNotSupportedException();
}
}
}
diff --git a/src/mscorlib/shared/System/Threading/ThreadAbortException.cs b/src/mscorlib/shared/System/Threading/ThreadAbortException.cs
index e693e7192f..5773f2726a 100644
--- a/src/mscorlib/shared/System/Threading/ThreadAbortException.cs
+++ b/src/mscorlib/shared/System/Threading/ThreadAbortException.cs
@@ -18,7 +18,6 @@ using System.Runtime.Serialization;
namespace System.Threading
{
- [Serializable]
public sealed class ThreadAbortException : SystemException
{
private ThreadAbortException()
@@ -26,11 +25,6 @@ namespace System.Threading
HResult = __HResults.COR_E_THREADABORTED;
}
- internal ThreadAbortException(SerializationInfo info, StreamingContext context)
- : base(info, context)
- {
- }
-
public object ExceptionState => null;
}
}
diff --git a/src/mscorlib/shared/System/Threading/ThreadStartException.cs b/src/mscorlib/shared/System/Threading/ThreadStartException.cs
index 2ff77bc5fd..7a87943ed1 100644
--- a/src/mscorlib/shared/System/Threading/ThreadStartException.cs
+++ b/src/mscorlib/shared/System/Threading/ThreadStartException.cs
@@ -6,7 +6,6 @@ using System.Runtime.Serialization;
namespace System.Threading
{
- [Serializable]
public sealed class ThreadStartException : SystemException
{
internal ThreadStartException()
@@ -20,10 +19,5 @@ namespace System.Threading
{
HResult = __HResults.COR_E_THREADSTART;
}
-
- internal ThreadStartException(SerializationInfo info, StreamingContext context)
- : base(info, context)
- {
- }
}
}
diff --git a/src/mscorlib/shared/System/Threading/ThreadStateException.cs b/src/mscorlib/shared/System/Threading/ThreadStateException.cs
index 33bc8baee6..9477cb1ae4 100644
--- a/src/mscorlib/shared/System/Threading/ThreadStateException.cs
+++ b/src/mscorlib/shared/System/Threading/ThreadStateException.cs
@@ -16,7 +16,6 @@ using System.Runtime.Serialization;
namespace System.Threading
{
- [Serializable]
public class ThreadStateException : SystemException
{
public ThreadStateException()
@@ -40,6 +39,7 @@ namespace System.Threading
protected ThreadStateException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
+ throw new PlatformNotSupportedException();
}
}
}
diff --git a/src/mscorlib/shared/System/Threading/WaitHandleCannotBeOpenedException.cs b/src/mscorlib/shared/System/Threading/WaitHandleCannotBeOpenedException.cs
index e44946a669..770e70d7ab 100644
--- a/src/mscorlib/shared/System/Threading/WaitHandleCannotBeOpenedException.cs
+++ b/src/mscorlib/shared/System/Threading/WaitHandleCannotBeOpenedException.cs
@@ -6,7 +6,6 @@ using System.Runtime.Serialization;
namespace System.Threading
{
- [Serializable]
public class WaitHandleCannotBeOpenedException : ApplicationException
{
public WaitHandleCannotBeOpenedException() : base(SR.Threading_WaitHandleCannotBeOpenedException)
@@ -26,6 +25,7 @@ namespace System.Threading
protected WaitHandleCannotBeOpenedException(SerializationInfo info, StreamingContext context) : base(info, context)
{
+ throw new PlatformNotSupportedException();
}
}
}
diff --git a/src/mscorlib/shared/System/TimeZone.cs b/src/mscorlib/shared/System/TimeZone.cs
index 88e2e21864..d4059babfc 100644
--- a/src/mscorlib/shared/System/TimeZone.cs
+++ b/src/mscorlib/shared/System/TimeZone.cs
@@ -26,7 +26,6 @@ using System.Globalization;
namespace System
{
- [Serializable]
[Obsolete("System.TimeZone has been deprecated. Please investigate the use of System.TimeZoneInfo instead.")]
public abstract class TimeZone
{
diff --git a/src/mscorlib/shared/System/TimeZoneNotFoundException.cs b/src/mscorlib/shared/System/TimeZoneNotFoundException.cs
index ee21c2524f..5b7ce10268 100644
--- a/src/mscorlib/shared/System/TimeZoneNotFoundException.cs
+++ b/src/mscorlib/shared/System/TimeZoneNotFoundException.cs
@@ -6,7 +6,6 @@ using System.Runtime.Serialization;
namespace System
{
- [Serializable]
public class TimeZoneNotFoundException : Exception
{
public TimeZoneNotFoundException()
@@ -23,6 +22,9 @@ namespace System
{
}
- protected TimeZoneNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ protected TimeZoneNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ throw new PlatformNotSupportedException();
+ }
}
}
diff --git a/src/mscorlib/shared/System/TimeoutException.cs b/src/mscorlib/shared/System/TimeoutException.cs
index 32775a1c56..4ba95bc47b 100644
--- a/src/mscorlib/shared/System/TimeoutException.cs
+++ b/src/mscorlib/shared/System/TimeoutException.cs
@@ -15,7 +15,6 @@ using System.Runtime.Serialization;
namespace System
{
- [Serializable]
public class TimeoutException : SystemException
{
public TimeoutException()
@@ -36,6 +35,9 @@ namespace System
HResult = __HResults.COR_E_TIMEOUT;
}
- protected TimeoutException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ protected TimeoutException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ throw new PlatformNotSupportedException();
+ }
}
}
diff --git a/src/mscorlib/shared/System/Type.cs b/src/mscorlib/shared/System/Type.cs
index 7749c17414..2ba58918a0 100644
--- a/src/mscorlib/shared/System/Type.cs
+++ b/src/mscorlib/shared/System/Type.cs
@@ -32,6 +32,7 @@ namespace System
public override Type ReflectedType => null;
public abstract Type UnderlyingSystemType { get; }
+ public virtual bool IsTypeDefinition { get { throw NotImplemented.ByDesign; } }
public bool IsArray => IsArrayImpl();
protected abstract bool IsArrayImpl();
public bool IsByRef => IsByRefImpl();
diff --git a/src/mscorlib/shared/System/TypeAccessException.cs b/src/mscorlib/shared/System/TypeAccessException.cs
index 32afbdfeb8..302dcb1ac1 100644
--- a/src/mscorlib/shared/System/TypeAccessException.cs
+++ b/src/mscorlib/shared/System/TypeAccessException.cs
@@ -8,7 +8,6 @@ namespace System
{
// TypeAccessException derives from TypeLoadException rather than MemberAccessException because in
// pre-v4 releases of the runtime TypeLoadException was used in lieu of a TypeAccessException.
- [Serializable]
public class TypeAccessException : TypeLoadException
{
public TypeAccessException()
@@ -29,6 +28,9 @@ namespace System
HResult = __HResults.COR_E_TYPEACCESS;
}
- protected TypeAccessException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ protected TypeAccessException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ throw new PlatformNotSupportedException();
+ }
}
}
diff --git a/src/mscorlib/shared/System/TypeCode.cs b/src/mscorlib/shared/System/TypeCode.cs
index 293eb1f1aa..296198656b 100644
--- a/src/mscorlib/shared/System/TypeCode.cs
+++ b/src/mscorlib/shared/System/TypeCode.cs
@@ -23,7 +23,6 @@
namespace System
{
- [Serializable]
public enum TypeCode
{
Empty = 0, // Null reference
diff --git a/src/mscorlib/shared/System/TypeInitializationException.cs b/src/mscorlib/shared/System/TypeInitializationException.cs
index 9191028346..8d0b8a9f79 100644
--- a/src/mscorlib/shared/System/TypeInitializationException.cs
+++ b/src/mscorlib/shared/System/TypeInitializationException.cs
@@ -19,7 +19,6 @@ using System.Runtime.Serialization;
namespace System
{
- [Serializable]
public sealed class TypeInitializationException : SystemException
{
private String _typeName;
@@ -52,16 +51,9 @@ namespace System
HResult = __HResults.COR_E_TYPEINITIALIZATION;
}
- internal TypeInitializationException(SerializationInfo info, StreamingContext context)
- : base(info, context)
- {
- _typeName = info.GetString("TypeName");
- }
-
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
base.GetObjectData(info, context);
- info.AddValue("TypeName", TypeName, typeof(String));
}
public String TypeName
diff --git a/src/mscorlib/shared/System/TypeUnloadedException.cs b/src/mscorlib/shared/System/TypeUnloadedException.cs
index 33e4687772..c7ed71c9cb 100644
--- a/src/mscorlib/shared/System/TypeUnloadedException.cs
+++ b/src/mscorlib/shared/System/TypeUnloadedException.cs
@@ -6,7 +6,6 @@ using System.Runtime.Serialization;
namespace System
{
- [Serializable]
public class TypeUnloadedException : SystemException
{
public TypeUnloadedException()
@@ -26,13 +25,11 @@ namespace System
{
HResult = __HResults.COR_E_TYPEUNLOADED;
}
-
- //
- // This constructor is required for serialization;
- //
+
protected TypeUnloadedException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
+ throw new PlatformNotSupportedException();
}
}
}
diff --git a/src/mscorlib/shared/System/UnauthorizedAccessException.cs b/src/mscorlib/shared/System/UnauthorizedAccessException.cs
index 997358826f..667d576292 100644
--- a/src/mscorlib/shared/System/UnauthorizedAccessException.cs
+++ b/src/mscorlib/shared/System/UnauthorizedAccessException.cs
@@ -19,7 +19,6 @@ namespace System
{
// The UnauthorizedAccessException is thrown when access errors
// occur from IO or other OS methods.
- [Serializable]
public class UnauthorizedAccessException : SystemException
{
public UnauthorizedAccessException()
@@ -40,6 +39,9 @@ namespace System
HResult = __HResults.COR_E_UNAUTHORIZEDACCESS;
}
- protected UnauthorizedAccessException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ protected UnauthorizedAccessException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ throw new PlatformNotSupportedException();
+ }
}
}
diff --git a/src/mscorlib/shared/System/UnhandledExceptionEventArgs.cs b/src/mscorlib/shared/System/UnhandledExceptionEventArgs.cs
index d33830181c..5cde572161 100644
--- a/src/mscorlib/shared/System/UnhandledExceptionEventArgs.cs
+++ b/src/mscorlib/shared/System/UnhandledExceptionEventArgs.cs
@@ -4,7 +4,6 @@
namespace System
{
- [Serializable]
public class UnhandledExceptionEventArgs : EventArgs
{
private Object _exception;
diff --git a/src/mscorlib/shared/System/UnhandledExceptionEventHandler.cs b/src/mscorlib/shared/System/UnhandledExceptionEventHandler.cs
index b99414c189..14e31c7bbd 100644
--- a/src/mscorlib/shared/System/UnhandledExceptionEventHandler.cs
+++ b/src/mscorlib/shared/System/UnhandledExceptionEventHandler.cs
@@ -4,6 +4,5 @@
namespace System
{
- [Serializable]
public delegate void UnhandledExceptionEventHandler(Object sender, UnhandledExceptionEventArgs e);
}
diff --git a/src/mscorlib/shared/System/UnitySerializationHolder.cs b/src/mscorlib/shared/System/UnitySerializationHolder.cs
deleted file mode 100644
index f1957981d3..0000000000
--- a/src/mscorlib/shared/System/UnitySerializationHolder.cs
+++ /dev/null
@@ -1,329 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-
-using System.Runtime.Serialization;
-using System.Reflection;
-using System.Globalization;
-using System.Runtime.Versioning;
-using System.Collections.Generic;
-using System.Diagnostics.Contracts;
-
-namespace System
-{
- [Serializable]
- // Holds classes (Empty, Null, Missing) for which we guarantee that there is only ever one instance of.
-#if CORECLR
- internal
-#else
- public // On CoreRT, this must be public because of the Reflection.Core/CoreLib divide and the need to whitelist past the ReflectionBlock.
-#endif
- class UnitySerializationHolder : ISerializable, IObjectReference
- {
-#region Internal Constants
- internal const int EmptyUnity = 0x0001;
- internal const int NullUnity = 0x0002;
- internal const int MissingUnity = 0x0003;
- internal const int RuntimeTypeUnity = 0x0004;
- public const int ModuleUnity = 0x0005;
- public const int AssemblyUnity = 0x0006;
- internal const int GenericParameterTypeUnity = 0x0007;
- internal const int PartialInstantiationTypeUnity = 0x0008;
-
- internal const int Pointer = 0x0001;
- internal const int Array = 0x0002;
- internal const int SzArray = 0x0003;
- internal const int ByRef = 0x0004;
-#endregion
-
-#region Internal Static Members
- internal static void GetUnitySerializationInfo(SerializationInfo info, Missing missing)
- {
- info.SetType(typeof(UnitySerializationHolder));
- info.AddValue("UnityType", MissingUnity);
- }
-
- internal static Type AddElementTypes(SerializationInfo info, Type type)
- {
- List<int> elementTypes = new List<int>();
- while (type.HasElementType)
- {
- if (type.IsSZArray)
- {
- elementTypes.Add(SzArray);
- }
- else if (type.IsArray)
- {
- elementTypes.Add(type.GetArrayRank());
- elementTypes.Add(Array);
- }
- else if (type.IsPointer)
- {
- elementTypes.Add(Pointer);
- }
- else if (type.IsByRef)
- {
- elementTypes.Add(ByRef);
- }
-
- type = type.GetElementType();
- }
-
- info.AddValue("ElementTypes", elementTypes.ToArray(), typeof(int[]));
-
- return type;
- }
-
- internal Type MakeElementTypes(Type type)
- {
- for (int i = _elementTypes.Length - 1; i >= 0; i--)
- {
- if (_elementTypes[i] == SzArray)
- {
- type = type.MakeArrayType();
- }
- else if (_elementTypes[i] == Array)
- {
- type = type.MakeArrayType(_elementTypes[--i]);
- }
- else if ((_elementTypes[i] == Pointer))
- {
- type = type.MakePointerType();
- }
- else if ((_elementTypes[i] == ByRef))
- {
- type = type.MakeByRefType();
- }
- }
-
- return type;
- }
-
- public static void GetUnitySerializationInfo(SerializationInfo info, Type type)
- {
- Type rootElementType = type;
- while (rootElementType.HasElementType)
- {
- rootElementType = rootElementType.GetElementType();
- }
-
- if (rootElementType.IsGenericParameter)
- {
- type = AddElementTypes(info, type);
- info.SetType(typeof(UnitySerializationHolder));
- info.AddValue("UnityType", GenericParameterTypeUnity);
- info.AddValue("GenericParameterPosition", type.GenericParameterPosition);
- info.AddValue("DeclaringMethod", type.DeclaringMethod, typeof(MethodBase));
- info.AddValue("DeclaringType", type.DeclaringType, typeof(Type));
-
- return;
- }
-
- int unityType = RuntimeTypeUnity;
-
- if (!type.IsGenericTypeDefinition && type.ContainsGenericParameters)
- {
- // Partial instantiation
- unityType = PartialInstantiationTypeUnity;
- type = AddElementTypes(info, type);
- info.AddValue("GenericArguments", type.GetGenericArguments(), typeof(Type[]));
- type = type.GetGenericTypeDefinition();
- }
-
- GetUnitySerializationInfo(info, unityType, type.FullName, type.Assembly);
- }
-
- public static void GetUnitySerializationInfo(
- SerializationInfo info, int unityType, string data, Assembly assembly)
- {
- // A helper method that returns the SerializationInfo that a class utilizing
- // UnitySerializationHelper should return from a call to GetObjectData. It contains
- // the unityType (defined above) and any optional data (used only for the reflection
- // types.)
-
- info.SetType(typeof(UnitySerializationHolder));
- info.AddValue("Data", data, typeof(string));
- info.AddValue("UnityType", unityType);
-
- string assemName;
-
- if (assembly == null)
- {
- assemName = string.Empty;
- }
- else
- {
- assemName = assembly.FullName;
- }
-
- info.AddValue("AssemblyName", assemName);
- }
-#endregion
-
-#region Private Data Members
- private readonly Type[] _instantiation;
- private readonly int[] _elementTypes;
- private readonly int _genericParameterPosition;
- private readonly Type _declaringType;
- private readonly MethodBase _declaringMethod;
- private readonly string _data;
- private readonly string _assemblyName;
- private int _unityType;
-#endregion
-
-#region Constructor
- public UnitySerializationHolder(SerializationInfo info, StreamingContext context)
- {
- if (info == null)
- throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- _unityType = info.GetInt32("UnityType");
-
- if (_unityType == MissingUnity)
- return;
-
- if (_unityType == GenericParameterTypeUnity)
- {
- _declaringMethod = info.GetValue("DeclaringMethod", typeof(MethodBase)) as MethodBase;
- _declaringType = info.GetValue("DeclaringType", typeof(Type)) as Type;
- _genericParameterPosition = info.GetInt32("GenericParameterPosition");
- _elementTypes = info.GetValue("ElementTypes", typeof(int[])) as int[];
-
- return;
- }
-
- if (_unityType == PartialInstantiationTypeUnity)
- {
- _instantiation = info.GetValue("GenericArguments", typeof(Type[])) as Type[];
- _elementTypes = info.GetValue("ElementTypes", typeof(int[])) as int[];
- }
-
- _data = info.GetString("Data");
- _assemblyName = info.GetString("AssemblyName");
- }
-#endregion
-
-#region Private Methods
- private void ThrowInsufficientInformation(string field)
- {
- throw new SerializationException(
- SR.Format(SR.Serialization_InsufficientDeserializationState, field));
- }
-#endregion
-
-#region ISerializable
- public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
- {
- throw new NotSupportedException(SR.NotSupported_UnitySerHolder);
- }
-#endregion
-
-#region IObjectReference
- public virtual object GetRealObject(StreamingContext context)
- {
- // GetRealObject uses the data we have in _data and _unityType to do a lookup on the correct
- // object to return. We have specific code here to handle the different types which we support.
- // The reflection types (Assembly, Module, and Type) have to be looked up through their static
- // accessors by name.
-
- Assembly assembly;
-
- switch (_unityType)
- {
- case EmptyUnity:
- {
- return Empty.Value;
- }
-
- case NullUnity:
- {
- return DBNull.Value;
- }
-
- case MissingUnity:
- {
- return Missing.Value;
- }
-
- case PartialInstantiationTypeUnity:
- {
- _unityType = RuntimeTypeUnity;
- Type definition = GetRealObject(context) as Type;
- _unityType = PartialInstantiationTypeUnity;
-
- if (_instantiation[0] == null)
- return null;
-
- return MakeElementTypes(definition.MakeGenericType(_instantiation));
- }
-
- case GenericParameterTypeUnity:
- {
- if (_declaringMethod == null && _declaringType == null)
- ThrowInsufficientInformation("DeclaringMember");
-
- if (_declaringMethod != null)
- return _declaringMethod.GetGenericArguments()[_genericParameterPosition];
-
- return MakeElementTypes(_declaringType.GetGenericArguments()[_genericParameterPosition]);
- }
-
- case RuntimeTypeUnity:
- {
- if (_data == null || _data.Length == 0)
- ThrowInsufficientInformation("Data");
-
- if (_assemblyName == null)
- ThrowInsufficientInformation("AssemblyName");
-
- if (_assemblyName.Length == 0)
- return Type.GetType(_data, true, false);
-
- assembly = Assembly.Load(_assemblyName);
-
- Type t = assembly.GetType(_data, true, false);
-
- return t;
- }
-
- case ModuleUnity:
- {
- if (_data == null || _data.Length == 0)
- ThrowInsufficientInformation("Data");
-
- if (_assemblyName == null)
- ThrowInsufficientInformation("AssemblyName");
-
- assembly = Assembly.Load(_assemblyName);
-
- Module namedModule = assembly.GetModule(_data);
-
- if (namedModule == null)
- throw new SerializationException(
- SR.Format(SR.Serialization_UnableToFindModule, _data, _assemblyName));
-
- return namedModule;
- }
-
- case AssemblyUnity:
- {
- if (_data == null || _data.Length == 0)
- ThrowInsufficientInformation("Data");
-
- if (_assemblyName == null)
- ThrowInsufficientInformation("AssemblyName");
-
- assembly = Assembly.Load(_assemblyName);
-
- return assembly;
- }
-
- default:
- throw new ArgumentException(SR.Argument_InvalidUnity);
- }
- }
-#endregion
- }
-}
diff --git a/src/mscorlib/shared/System/Void.cs b/src/mscorlib/shared/System/Void.cs
index 5c20f634fc..5162e6ad02 100644
--- a/src/mscorlib/shared/System/Void.cs
+++ b/src/mscorlib/shared/System/Void.cs
@@ -10,7 +10,6 @@
namespace System
{
// This class represents the void return type
- [Serializable]
public struct Void
{
}
diff --git a/src/mscorlib/src/Microsoft/Win32/SafeHandles/Win32SafeHandles.cs b/src/mscorlib/src/Microsoft/Win32/SafeHandles/Win32SafeHandles.cs
deleted file mode 100644
index 8a7f591dfc..0000000000
--- a/src/mscorlib/src/Microsoft/Win32/SafeHandles/Win32SafeHandles.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-//
-// Abstract derivations of SafeHandle designed to provide the common
-// functionality supporting Win32 handles. More specifically, they describe how
-// an invalid handle looks (for instance, some handles use -1 as an invalid
-// handle value, others use 0).
-//
-// Further derivations of these classes can specialise this even further (e.g.
-// file or registry handles).
-//
-//
-
-using System;
-using System.Runtime.InteropServices;
-using System.Runtime.CompilerServices;
-using System.Runtime.ConstrainedExecution;
-
-namespace Microsoft.Win32.SafeHandles
-{
- // Class of safe handle which uses 0 or -1 as an invalid handle.
- public abstract class SafeHandleZeroOrMinusOneIsInvalid : SafeHandle
- {
- protected SafeHandleZeroOrMinusOneIsInvalid(bool ownsHandle) : base(IntPtr.Zero, ownsHandle)
- {
- }
-
- // A default constructor is needed to satisfy CoreCLR inheritence rules. It should not be called at runtime
- protected SafeHandleZeroOrMinusOneIsInvalid()
- {
- throw new NotImplementedException();
- }
-
- public override bool IsInvalid
- {
- get { return handle.IsNull() || handle == new IntPtr(-1); }
- }
- }
-
- // Class of safe handle which uses only -1 as an invalid handle.
- public abstract class SafeHandleMinusOneIsInvalid : SafeHandle
- {
- protected SafeHandleMinusOneIsInvalid(bool ownsHandle) : base(new IntPtr(-1), ownsHandle)
- {
- }
-
- // A default constructor is needed to satisfy CoreCLR inheritence rules. It should not be called at runtime
- protected SafeHandleMinusOneIsInvalid()
- {
- throw new NotImplementedException();
- }
-
- public override bool IsInvalid
- {
- get { return handle == new IntPtr(-1); }
- }
- }
-}
diff --git a/src/mscorlib/src/Microsoft/Win32/Win32Native.cs b/src/mscorlib/src/Microsoft/Win32/Win32Native.cs
index 8543bc8a99..b05445961d 100644
--- a/src/mscorlib/src/Microsoft/Win32/Win32Native.cs
+++ b/src/mscorlib/src/Microsoft/Win32/Win32Native.cs
@@ -93,7 +93,6 @@ namespace Microsoft.Win32
using System.Security;
using System.Text;
using System.Configuration.Assemblies;
- using System.Runtime.Remoting;
using System.Runtime.InteropServices;
using System.Threading;
using Microsoft.Win32.SafeHandles;
@@ -400,7 +399,6 @@ namespace Microsoft.Win32
internal int bInheritHandle = 0;
}
- [Serializable]
[StructLayout(LayoutKind.Sequential)]
internal struct WIN32_FILE_ATTRIBUTE_DATA
{
@@ -461,13 +459,11 @@ namespace Microsoft.Win32
internal const String USER32 = "user32.dll";
internal const String OLE32 = "ole32.dll";
internal const String OLEAUT32 = "oleaut32.dll";
- internal const String NTDLL = "ntdll.dll";
#else //FEATURE_PAL
internal const String KERNEL32 = "libcoreclr";
internal const String USER32 = "libcoreclr";
internal const String OLE32 = "libcoreclr";
internal const String OLEAUT32 = "libcoreclr";
- internal const String NTDLL = "libcoreclr";
#endif //FEATURE_PAL
internal const String ADVAPI32 = "advapi32.dll";
internal const String SHELL32 = "shell32.dll";
@@ -476,9 +472,6 @@ namespace Microsoft.Win32
internal const String SECUR32 = "secur32.dll";
internal const String MSCORWKS = "coreclr.dll";
- // From WinBase.h
- internal const int SEM_FAILCRITICALERRORS = 1;
-
[DllImport(KERNEL32, CharSet = CharSet.Auto, BestFitMapping = true)]
internal static extern int FormatMessage(int dwFlags, IntPtr lpSource,
int dwMessageId, int dwLanguageId, [Out]StringBuilder lpBuffer,
@@ -509,10 +502,6 @@ namespace Microsoft.Win32
[DllImport(KERNEL32, SetLastError = true)]
internal static extern IntPtr LocalFree(IntPtr handle);
- // MSDN says the length is a SIZE_T.
- [DllImport(NTDLL, EntryPoint = "RtlZeroMemory")]
- internal static extern void ZeroMemory(IntPtr address, UIntPtr length);
-
internal static bool GlobalMemoryStatusEx(ref MEMORYSTATUSEX buffer)
{
buffer.length = Marshal.SizeOf(typeof(MEMORYSTATUSEX));
@@ -733,7 +722,6 @@ namespace Microsoft.Win32
}
// Win32 Structs in N/Direct style
- [Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
[BestFitMapping(false)]
internal class WIN32_FIND_DATA
@@ -783,18 +771,6 @@ namespace Microsoft.Win32
[DllImport(KERNEL32, SetLastError = true, CharSet = CharSet.Auto, BestFitMapping = false)]
internal static extern bool SetCurrentDirectory(String path);
- [DllImport(KERNEL32, SetLastError = false, EntryPoint = "SetErrorMode", ExactSpelling = true)]
- private static extern int SetErrorMode_VistaAndOlder(int newMode);
-
- // RTM versions of Win7 and Windows Server 2008 R2
- private static readonly Version ThreadErrorModeMinOsVersion = new Version(6, 1, 7600);
-
- // this method uses the thread-safe version of SetErrorMode on Windows 7 / Windows Server 2008 R2 operating systems.
- internal static int SetErrorMode(int newMode)
- {
- return SetErrorMode_VistaAndOlder(newMode);
- }
-
internal const int LCID_SUPPORTED = 0x00000002; // supported locale ids
[DllImport(KERNEL32)]
diff --git a/src/mscorlib/src/System/AccessViolationException.cs b/src/mscorlib/src/System/AccessViolationException.cs
index 12911c1b17..23d086fb42 100644
--- a/src/mscorlib/src/System/AccessViolationException.cs
+++ b/src/mscorlib/src/System/AccessViolationException.cs
@@ -16,7 +16,6 @@ using System.Runtime.Serialization;
namespace System
{
- [Serializable]
public class AccessViolationException : SystemException
{
public AccessViolationException()
@@ -37,7 +36,10 @@ namespace System
HResult = __HResults.E_POINTER;
}
- protected AccessViolationException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ protected AccessViolationException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ throw new PlatformNotSupportedException();
+ }
#pragma warning disable 169 // Field is not used from managed.
private IntPtr _ip; // Address of faulting instruction.
diff --git a/src/mscorlib/src/System/Activator.cs b/src/mscorlib/src/System/Activator.cs
index 34c6ea5874..d11739b826 100644
--- a/src/mscorlib/src/System/Activator.cs
+++ b/src/mscorlib/src/System/Activator.cs
@@ -16,7 +16,6 @@ namespace System
{
using System;
using System.Reflection;
- using System.Runtime.Remoting;
using System.Security;
using CultureInfo = System.Globalization.CultureInfo;
using Evidence = System.Security.Policy.Evidence;
@@ -113,47 +112,6 @@ namespace System
return Activator.CreateInstance(type, false);
}
- /*
- * Create an instance using the name of type and the assembly where it exists. This allows
- * types to be created remotely without having to load the type locally.
- */
-
- [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod
- static public ObjectHandle CreateInstance(String assemblyName,
- String typeName)
- {
- StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
- return CreateInstance(assemblyName,
- typeName,
- false,
- Activator.ConstructorDefault,
- null,
- null,
- null,
- null,
- null,
- ref stackMark);
- }
-
- [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod
- static public ObjectHandle CreateInstance(String assemblyName,
- String typeName,
- Object[] activationAttributes)
-
- {
- StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
- return CreateInstance(assemblyName,
- typeName,
- false,
- Activator.ConstructorDefault,
- null,
- null,
- null,
- activationAttributes,
- null,
- ref stackMark);
- }
-
[System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod
static public Object CreateInstance(Type type, bool nonPublic)
{
@@ -185,221 +143,5 @@ namespace System
// Skip the CreateInstanceCheckThis call to avoid perf cost and to maintain compatibility with V2 (throwing the same exceptions).
return (T)rt.CreateInstanceDefaultCtor(true /*publicOnly*/, true /*skipCheckThis*/, true /*fillCache*/, ref stackMark);
}
-
- static public ObjectHandle CreateInstanceFrom(String assemblyFile,
- String typeName)
-
- {
- return CreateInstanceFrom(assemblyFile, typeName, null);
- }
-
- static public ObjectHandle CreateInstanceFrom(String assemblyFile,
- String typeName,
- Object[] activationAttributes)
-
- {
- return CreateInstanceFrom(assemblyFile,
- typeName,
- false,
- Activator.ConstructorDefault,
- null,
- null,
- null,
- activationAttributes);
- }
-
- [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod
- public static ObjectHandle CreateInstance(string assemblyName,
- string typeName,
- bool ignoreCase,
- BindingFlags bindingAttr,
- Binder binder,
- object[] args,
- CultureInfo culture,
- object[] activationAttributes)
- {
- StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
- return CreateInstance(assemblyName,
- typeName,
- ignoreCase,
- bindingAttr,
- binder,
- args,
- culture,
- activationAttributes,
- null,
- ref stackMark);
- }
-
- static internal ObjectHandle CreateInstance(String assemblyString,
- String typeName,
- bool ignoreCase,
- BindingFlags bindingAttr,
- Binder binder,
- Object[] args,
- CultureInfo culture,
- Object[] activationAttributes,
- Evidence securityInfo,
- ref StackCrawlMark stackMark)
- {
- Type type = null;
- Assembly assembly = null;
- if (assemblyString == null)
- {
- assembly = RuntimeAssembly.GetExecutingAssembly(ref stackMark);
- }
- else
- {
- RuntimeAssembly assemblyFromResolveEvent;
- AssemblyName assemblyName = RuntimeAssembly.CreateAssemblyName(assemblyString, false /*forIntrospection*/, out assemblyFromResolveEvent);
- if (assemblyFromResolveEvent != null)
- {
- // Assembly was resolved via AssemblyResolve event
- assembly = assemblyFromResolveEvent;
- }
- else if (assemblyName.ContentType == AssemblyContentType.WindowsRuntime)
- {
- // WinRT type - we have to use Type.GetType
- type = Type.GetType(typeName + ", " + assemblyString, true /*throwOnError*/, ignoreCase);
- }
- else
- {
- // Classic managed type
- assembly = RuntimeAssembly.InternalLoadAssemblyName(
- assemblyName, securityInfo, null, ref stackMark,
- true /*thrownOnFileNotFound*/, false /*forIntrospection*/);
- }
- }
-
- if (type == null)
- {
- // It's classic managed type (not WinRT type)
- Log(assembly != null, "CreateInstance:: ", "Loaded " + assembly.FullName, "Failed to Load: " + assemblyString);
- if (assembly == null) return null;
-
- type = assembly.GetType(typeName, true /*throwOnError*/, ignoreCase);
- }
-
- Object o = Activator.CreateInstance(type,
- bindingAttr,
- binder,
- args,
- culture,
- activationAttributes);
-
- Log(o != null, "CreateInstance:: ", "Created Instance of class " + typeName, "Failed to create instance of class " + typeName);
- if (o == null)
- return null;
- else
- {
- ObjectHandle Handle = new ObjectHandle(o);
- return Handle;
- }
- }
-
- public static ObjectHandle CreateInstanceFrom(string assemblyFile,
- string typeName,
- bool ignoreCase,
- BindingFlags bindingAttr,
- Binder binder,
- object[] args,
- CultureInfo culture,
- object[] activationAttributes)
- {
- return CreateInstanceFromInternal(assemblyFile,
- typeName,
- ignoreCase,
- bindingAttr,
- binder,
- args,
- culture,
- activationAttributes,
- null);
- }
-
- private static ObjectHandle CreateInstanceFromInternal(String assemblyFile,
- String typeName,
- bool ignoreCase,
- BindingFlags bindingAttr,
- Binder binder,
- Object[] args,
- CultureInfo culture,
- Object[] activationAttributes,
- Evidence securityInfo)
- {
-#pragma warning disable 618
- Assembly assembly = Assembly.LoadFrom(assemblyFile, securityInfo);
-#pragma warning restore 618
- Type t = assembly.GetType(typeName, true, ignoreCase);
-
- Object o = Activator.CreateInstance(t,
- bindingAttr,
- binder,
- args,
- culture,
- activationAttributes);
-
- Log(o != null, "CreateInstanceFrom:: ", "Created Instance of class " + typeName, "Failed to create instance of class " + typeName);
- if (o == null)
- return null;
- else
- {
- ObjectHandle Handle = new ObjectHandle(o);
- return Handle;
- }
- }
-
- public static ObjectHandle CreateComInstanceFrom(String assemblyName,
- String typeName)
- {
- return CreateComInstanceFrom(assemblyName,
- typeName,
- null,
- AssemblyHashAlgorithm.None);
- }
-
- public static ObjectHandle CreateComInstanceFrom(String assemblyName,
- String typeName,
- byte[] hashValue,
- AssemblyHashAlgorithm hashAlgorithm)
- {
- Assembly assembly = Assembly.LoadFrom(assemblyName, hashValue, hashAlgorithm);
-
- Type t = assembly.GetType(typeName, true, false);
-
- Object[] Attr = t.GetCustomAttributes(typeof(ComVisibleAttribute), false);
- if (Attr.Length > 0)
- {
- if (((ComVisibleAttribute)Attr[0]).Value == false)
- throw new TypeLoadException(SR.Argument_TypeMustBeVisibleFromCom);
- }
-
- Log(assembly != null, "CreateInstance:: ", "Loaded " + assembly.FullName, "Failed to Load: " + assemblyName);
-
- if (assembly == null) return null;
-
-
- Object o = Activator.CreateInstance(t,
- Activator.ConstructorDefault,
- null,
- null,
- null,
- null);
-
- Log(o != null, "CreateInstance:: ", "Created Instance of class " + typeName, "Failed to create instance of class " + typeName);
- if (o == null)
- return null;
- else
- {
- ObjectHandle Handle = new ObjectHandle(o);
- return Handle;
- }
- }
-
- [System.Diagnostics.Conditional("_DEBUG")]
- private static void Log(bool test, string title, string success, string failure)
- {
- }
}
}
-
diff --git a/src/mscorlib/src/System/AppDomain.cs b/src/mscorlib/src/System/AppDomain.cs
index 7d2f2ceaf8..24c6765026 100644
--- a/src/mscorlib/src/System/AppDomain.cs
+++ b/src/mscorlib/src/System/AppDomain.cs
@@ -25,7 +25,6 @@ namespace System
using System.Collections.Generic;
using System.Threading;
using System.Runtime.InteropServices;
- using System.Runtime.Remoting;
using System.Reflection.Emit;
using CultureInfo = System.Globalization.CultureInfo;
using System.IO;
@@ -37,7 +36,6 @@ namespace System
using System.Diagnostics.Contracts;
using System.Runtime.ExceptionServices;
- [Serializable]
internal delegate void AppDomainInitializer(string[] args);
internal class AppDomainInitializerInfo
@@ -258,18 +256,6 @@ namespace System
private static extern APPX_FLAGS nGetAppXFlags();
#endif
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- private static extern void GetAppDomainManagerType(AppDomainHandle domain,
- StringHandleOnStack retAssembly,
- StringHandleOnStack retType);
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- private static extern void SetAppDomainManagerType(AppDomainHandle domain,
- string assembly,
- string type);
-
[SuppressUnmanagedCodeSecurity]
[DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
private static extern void SetSecurityHomogeneousFlag(AppDomainHandle domain,
@@ -328,54 +314,6 @@ namespace System
SetupBindingPaths(trustedPlatformAssemblies, platformResourceRoots, appPaths, appNiPaths, appLocalWinMD);
}
- string domainManagerAssembly;
- string domainManagerType;
- GetAppDomainManagerType(out domainManagerAssembly, out domainManagerType);
-
- if (domainManagerAssembly != null && domainManagerType != null)
- {
- try
- {
- _domainManager = CreateInstanceAndUnwrap(domainManagerAssembly, domainManagerType) as AppDomainManager;
- }
- catch (FileNotFoundException e)
- {
- throw new TypeLoadException(SR.Argument_NoDomainManager, e);
- }
- catch (SecurityException e)
- {
- throw new TypeLoadException(SR.Argument_NoDomainManager, e);
- }
- catch (TypeLoadException e)
- {
- throw new TypeLoadException(SR.Argument_NoDomainManager, e);
- }
-
- if (_domainManager == null)
- {
- throw new TypeLoadException(SR.Argument_NoDomainManager);
- }
-
- // If this domain was not created by a managed call to CreateDomain, then the AppDomainSetup
- // will not have the correct values for the AppDomainManager set.
- FusionStore.AppDomainManagerAssembly = domainManagerAssembly;
- FusionStore.AppDomainManagerType = domainManagerType;
-
- bool notifyFusion = _domainManager.GetType() != typeof(System.AppDomainManager) && !DisableFusionUpdatesFromADManager();
-
-
-
- AppDomainSetup FusionStoreOld = null;
- if (notifyFusion)
- FusionStoreOld = new AppDomainSetup(FusionStore, true);
-
- // Initialize the AppDomainMAnager and register the instance with the native host if requested
- _domainManager.InitializeNewDomain(FusionStore);
-
- if (notifyFusion)
- SetupFusionStore(_FusionStore, FusionStoreOld); // Notify Fusion about the changes the user implementation of InitializeNewDomain may have made to the FusionStore object.
- }
-
InitializeCompatibilityFlags();
}
@@ -485,34 +423,6 @@ namespace System
}
/// <summary>
- /// Get the name of the assembly and type that act as the AppDomainManager for this domain
- /// </summary>
- internal void GetAppDomainManagerType(out string assembly, out string type)
- {
- // We can't just use our parameters because we need to ensure that the strings used for hte QCall
- // are on the stack.
- string localAssembly = null;
- string localType = null;
-
- GetAppDomainManagerType(GetNativeHandle(),
- JitHelpers.GetStringHandleOnStack(ref localAssembly),
- JitHelpers.GetStringHandleOnStack(ref localType));
-
- assembly = localAssembly;
- type = localType;
- }
-
- /// <summary>
- /// Set the assembly and type which act as the AppDomainManager for this domain
- /// </summary>
- private void SetAppDomainManagerType(string assembly, string type)
- {
- Debug.Assert(assembly != null, "assembly != null");
- Debug.Assert(type != null, "type != null");
- SetAppDomainManagerType(GetNativeHandle(), assembly, type);
- }
-
- /// <summary>
/// Called for every AppDomain (including the default domain) to initialize the security of the AppDomain)
/// </summary>
private void InitializeDomainSecurity(Evidence providedSecurityInfo,
@@ -584,23 +494,6 @@ namespace System
}
}
-
- public ObjectHandle CreateInstance(String assemblyName,
- String typeName)
-
- {
- // jit does not check for that, so we should do it ...
- if (this == null)
- throw new NullReferenceException();
-
- if (assemblyName == null)
- throw new ArgumentNullException(nameof(assemblyName));
- Contract.EndContractBlock();
-
- return Activator.CreateInstance(assemblyName,
- typeName);
- }
-
public static AppDomain CurrentDomain
{
get
@@ -646,6 +539,14 @@ namespace System
return StringBuilderCache.GetStringAndRelease(sb);
}
+ [MethodImpl(MethodImplOptions.InternalCall)]
+ private extern Assembly[] nGetAssemblies(bool forIntrospection);
+
+ internal Assembly[] GetAssemblies(bool forIntrospection)
+ {
+ return nGetAssemblies(forIntrospection);
+ }
+
// this is true when we've removed the handles etc so really can't do anything
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal extern bool IsUnloadingForcedFinalize();
@@ -664,17 +565,6 @@ namespace System
throw new ArgumentNullException(nameof(name));
Contract.EndContractBlock();
- // SetData should only be used to set values that don't already exist.
- object currentVal;
- lock (((ICollection)LocalStore).SyncRoot)
- {
- LocalStore.TryGetValue(name, out currentVal);
- }
- if (currentVal != null)
- {
- throw new InvalidOperationException(SR.InvalidOperation_SetData_OnlyOnce);
- }
-
lock (((ICollection)LocalStore).SyncRoot)
{
LocalStore[name] = data;
@@ -688,38 +578,14 @@ namespace System
throw new ArgumentNullException(nameof(name));
Contract.EndContractBlock();
- int key = AppDomainSetup.Locate(name);
- if (key == -1)
+ object data;
+ lock (((ICollection)LocalStore).SyncRoot)
{
- if (name.Equals(AppDomainSetup.LoaderOptimizationKey))
- return FusionStore.LoaderOptimization;
- else
- {
- object data;
- lock (((ICollection)LocalStore).SyncRoot)
- {
- LocalStore.TryGetValue(name, out data);
- }
- if (data == null)
- return null;
- return data;
- }
- }
- else
- {
- // Be sure to call these properties, not Value, so
- // that the appropriate permission demand will be done
- switch (key)
- {
- case (int)AppDomainSetup.LoaderInformation.ApplicationBaseValue:
- return FusionStore.ApplicationBase;
- case (int)AppDomainSetup.LoaderInformation.ApplicationNameValue:
- return FusionStore.ApplicationName;
- default:
- Debug.Assert(false, "Need to handle new LoaderInformation value in AppDomain.GetData()");
- return null;
- }
+ LocalStore.TryGetValue(name, out data);
}
+ if (data == null)
+ return null;
+ return data;
}
[Obsolete("AppDomain.GetCurrentThreadId has been deprecated because it does not provide a stable Id when managed threads are running on fibers (aka lightweight threads). To get a stable identifier for a managed thread, use the ManagedThreadId property on Thread. http://go.microsoft.com/fwlink/?linkid=14202", false)]
@@ -1150,12 +1016,6 @@ namespace System
}
#endif // FEATURE_COMINTEROP
- // set up the AppDomainManager for this domain and initialize security.
- if (adSetup.AppDomainManagerAssembly != null && adSetup.AppDomainManagerType != null)
- {
- ad.SetAppDomainManagerType(adSetup.AppDomainManagerAssembly, adSetup.AppDomainManagerType);
- }
-
ad.CreateAppDomainManager(); // could modify FusionStore's object
ad.InitializeDomainSecurity(providedSecurityInfo,
creatorsSecurityInfo,
@@ -1293,16 +1153,6 @@ namespace System
}
}
- public Object CreateInstanceAndUnwrap(String assemblyName,
- String typeName)
- {
- ObjectHandle oh = CreateInstance(assemblyName, typeName);
- if (oh == null)
- return null;
-
- return oh.Unwrap();
- } // CreateInstanceAndUnwrap
-
public Int32 Id
{
get
diff --git a/src/mscorlib/src/System/AppDomainAttributes.cs b/src/mscorlib/src/System/AppDomainAttributes.cs
index deb43eadf9..92d6d8bbb2 100644
--- a/src/mscorlib/src/System/AppDomainAttributes.cs
+++ b/src/mscorlib/src/System/AppDomainAttributes.cs
@@ -13,7 +13,6 @@
namespace System
{
- [Serializable]
internal enum LoaderOptimization
{
NotSpecified = 0,
diff --git a/src/mscorlib/src/System/AppDomainSetup.cs b/src/mscorlib/src/System/AppDomainSetup.cs
index 142b8a05f7..7714da12ab 100644
--- a/src/mscorlib/src/System/AppDomainSetup.cs
+++ b/src/mscorlib/src/System/AppDomainSetup.cs
@@ -22,10 +22,8 @@ namespace System
using System.Diagnostics.Contracts;
using System.Collections.Generic;
- [Serializable]
internal sealed class AppDomainSetup
{
- [Serializable]
internal enum LoaderInformation
{
// If you add a new value, add the corresponding property
@@ -338,18 +336,6 @@ namespace System
}
}
- static internal int Locate(String s)
- {
- if (String.IsNullOrEmpty(s))
- return -1;
-
- Debug.Assert('A' == ACTAG_APP_BASE_URL[0], "Assumption violated");
- if (s[0] == 'A' && s == ACTAG_APP_BASE_URL)
- return (int)LoaderInformation.ApplicationBaseValue;
-
- return -1;
- }
-
#if FEATURE_COMINTEROP
public bool SandboxInterop
{
diff --git a/src/mscorlib/src/System/AppDomainUnloadedException.cs b/src/mscorlib/src/System/AppDomainUnloadedException.cs
index 52cbb980af..a5e74e2b23 100644
--- a/src/mscorlib/src/System/AppDomainUnloadedException.cs
+++ b/src/mscorlib/src/System/AppDomainUnloadedException.cs
@@ -16,7 +16,6 @@ using System.Runtime.Serialization;
namespace System
{
- [Serializable]
internal class AppDomainUnloadedException : SystemException
{
public AppDomainUnloadedException()
@@ -30,6 +29,7 @@ namespace System
//
protected AppDomainUnloadedException(SerializationInfo info, StreamingContext context) : base(info, context)
{
+ throw new PlatformNotSupportedException();
}
}
}
diff --git a/src/mscorlib/src/System/Array.cs b/src/mscorlib/src/System/Array.cs
index 05c4804cc5..fcfeb94675 100644
--- a/src/mscorlib/src/System/Array.cs
+++ b/src/mscorlib/src/System/Array.cs
@@ -2415,7 +2415,6 @@ namespace System
}
}
- [Serializable]
private sealed class SZArrayEnumerator : IEnumerator, ICloneable
{
private Array _array;
@@ -2461,7 +2460,6 @@ namespace System
}
}
- [Serializable]
private sealed class ArrayEnumerator : IEnumerator, ICloneable
{
private Array array;
@@ -2723,7 +2721,6 @@ namespace System
// This is a normal generic Enumerator for SZ arrays. It doesn't have any of the "this" stuff
// that SZArrayHelper does.
//
- [Serializable]
private sealed class SZGenericArrayEnumerator<T> : IEnumerator<T>
{
private T[] _array;
diff --git a/src/mscorlib/src/System/ArraySegment.cs b/src/mscorlib/src/System/ArraySegment.cs
index a18590d5d8..664352708d 100644
--- a/src/mscorlib/src/System/ArraySegment.cs
+++ b/src/mscorlib/src/System/ArraySegment.cs
@@ -316,7 +316,6 @@ namespace System
}
}
- [Serializable]
public struct Enumerator : IEnumerator<T>
{
private readonly T[] _array;
diff --git a/src/mscorlib/src/System/BCLDebug.cs b/src/mscorlib/src/System/BCLDebug.cs
index 67f7c9a0f7..4a5f6d1891 100644
--- a/src/mscorlib/src/System/BCLDebug.cs
+++ b/src/mscorlib/src/System/BCLDebug.cs
@@ -15,7 +15,6 @@ namespace System
{
using System.IO;
using System.Text;
- using System.Runtime.Remoting;
using System.Diagnostics;
using Microsoft.Win32;
using System.Runtime.CompilerServices;
@@ -23,7 +22,6 @@ namespace System
using System.Security;
using System.Diagnostics.Contracts;
- [Serializable]
internal enum LogLevel
{
Trace = 0,
diff --git a/src/mscorlib/src/System/BadImageFormatException.CoreCLR.cs b/src/mscorlib/src/System/BadImageFormatException.CoreCLR.cs
new file mode 100644
index 0000000000..094668bde0
--- /dev/null
+++ b/src/mscorlib/src/System/BadImageFormatException.CoreCLR.cs
@@ -0,0 +1,19 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace System
+{
+ public partial class BadImageFormatException
+ {
+ // Do not delete: this is invoked from native code.
+ private BadImageFormatException(string fileName, string fusionLog, int hResult)
+ : base(null)
+ {
+ HResult = hResult;
+ _fileName = fileName;
+ _fusionLog = fusionLog;
+ SetMessageField();
+ }
+ }
+}
diff --git a/src/mscorlib/src/System/Boolean.cs b/src/mscorlib/src/System/Boolean.cs
index fe25e22920..59cab74456 100644
--- a/src/mscorlib/src/System/Boolean.cs
+++ b/src/mscorlib/src/System/Boolean.cs
@@ -26,10 +26,10 @@ namespace System
//
// Member Variables
//
- private bool m_value;
+ private bool m_value; // Do not rename (binary serialization)
- // The true value.
- //
+ // The true value.
+ //
internal const int True = 1;
// The false value.
diff --git a/src/mscorlib/src/System/Byte.cs b/src/mscorlib/src/System/Byte.cs
index 27fdcd7a64..da3b790ac6 100644
--- a/src/mscorlib/src/System/Byte.cs
+++ b/src/mscorlib/src/System/Byte.cs
@@ -28,7 +28,7 @@ namespace System
public struct Byte : IComparable, IFormattable, IConvertible
, IComparable<Byte>, IEquatable<Byte>
{
- private byte m_value;
+ private byte m_value; // Do not rename (binary serialization)
// The maximum value that a Byte may represent: 255.
public const byte MaxValue = (byte)0xFF;
diff --git a/src/mscorlib/src/System/Collections/ArrayList.cs b/src/mscorlib/src/System/Collections/ArrayList.cs
deleted file mode 100644
index cee7be726a..0000000000
--- a/src/mscorlib/src/System/Collections/ArrayList.cs
+++ /dev/null
@@ -1,626 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-**
-**
-**
-**
-** Purpose: Implements a dynamically sized List as an array,
-** and provides many convenience methods for treating
-** an array as an IList.
-**
-**
-===========================================================*/
-
-using System;
-using System.Runtime;
-using System.Security;
-using System.Diagnostics;
-using System.Runtime.CompilerServices;
-using System.Runtime.Serialization;
-using System.Diagnostics.CodeAnalysis;
-using System.Diagnostics.Contracts;
-
-namespace System.Collections
-{
- // Implements a variable-size List that uses an array of objects to store the
- // elements. A ArrayList has a capacity, which is the allocated length
- // of the internal array. As elements are added to a ArrayList, the capacity
- // of the ArrayList is automatically increased as required by reallocating the
- // internal array.
- //
- [FriendAccessAllowed]
- [DebuggerTypeProxy(typeof(System.Collections.ArrayList.ArrayListDebugView))]
- [DebuggerDisplay("Count = {Count}")]
- [Serializable]
- internal class ArrayList : IList, ICloneable
- {
- private Object[] _items;
- [ContractPublicPropertyName("Count")]
- private int _size;
- private int _version;
- [NonSerialized]
- private Object _syncRoot;
-
- private const int _defaultCapacity = 4;
- private static readonly Object[] emptyArray = Array.Empty<Object>();
-
- // Constructs a ArrayList. The list is initially empty and has a capacity
- // of zero. Upon adding the first element to the list the capacity is
- // increased to _defaultCapacity, and then increased in multiples of two as required.
- public ArrayList()
- {
- _items = emptyArray;
- }
-
- // Constructs a ArrayList with a given initial capacity. The list is
- // initially empty, but will have room for the given number of elements
- // before any reallocations are required.
- //
- public ArrayList(int capacity)
- {
- if (capacity < 0) throw new ArgumentOutOfRangeException(nameof(capacity), SR.Format(SR.ArgumentOutOfRange_MustBeNonNegNum, nameof(capacity)));
- Contract.EndContractBlock();
-
- if (capacity == 0)
- _items = emptyArray;
- else
- _items = new Object[capacity];
- }
-
- // Constructs a ArrayList, copying the contents of the given collection. The
- // size and capacity of the new list will both be equal to the size of the
- // given collection.
- //
- public ArrayList(ICollection c)
- {
- if (c == null)
- throw new ArgumentNullException(nameof(c), SR.ArgumentNull_Collection);
- Contract.EndContractBlock();
-
- int count = c.Count;
- if (count == 0)
- {
- _items = emptyArray;
- }
- else
- {
- _items = new Object[count];
- AddRange(c);
- }
- }
-
- // Gets and sets the capacity of this list. The capacity is the size of
- // the internal array used to hold items. When set, the internal
- // array of the list is reallocated to the given capacity.
- //
- public virtual int Capacity
- {
- get
- {
- Contract.Ensures(Contract.Result<int>() >= Count);
- return _items.Length;
- }
- set
- {
- if (value < _size)
- {
- throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_SmallCapacity);
- }
- Contract.Ensures(Capacity >= 0);
- Contract.EndContractBlock();
- // We don't want to update the version number when we change the capacity.
- // Some existing applications have dependency on this.
- if (value != _items.Length)
- {
- if (value > 0)
- {
- Object[] newItems = new Object[value];
- if (_size > 0)
- {
- Array.Copy(_items, 0, newItems, 0, _size);
- }
- _items = newItems;
- }
- else
- {
- _items = new Object[_defaultCapacity];
- }
- }
- }
- }
-
- // Read-only property describing how many elements are in the List.
- public virtual int Count
- {
- get
- {
- Contract.Ensures(Contract.Result<int>() >= 0);
- return _size;
- }
- }
-
- public virtual bool IsFixedSize
- {
- get { return false; }
- }
-
-
- // Is this ArrayList read-only?
- public virtual bool IsReadOnly
- {
- get { return false; }
- }
-
- // Is this ArrayList synchronized (thread-safe)?
- public virtual bool IsSynchronized
- {
- get { return false; }
- }
-
- // Synchronization root for this object.
- public virtual Object SyncRoot
- {
- get
- {
- if (_syncRoot == null)
- {
- System.Threading.Interlocked.CompareExchange<Object>(ref _syncRoot, new Object(), null);
- }
- return _syncRoot;
- }
- }
-
- // Sets or Gets the element at the given index.
- //
- public virtual Object this[int index]
- {
- get
- {
- if (index < 0 || index >= _size) throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index);
- Contract.EndContractBlock();
- return _items[index];
- }
- set
- {
- if (index < 0 || index >= _size) throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index);
- Contract.EndContractBlock();
- _items[index] = value;
- _version++;
- }
- }
-
- // Adds the given object to the end of this list. The size of the list is
- // increased by one. If required, the capacity of the list is doubled
- // before adding the new element.
- //
- public virtual int Add(Object value)
- {
- Contract.Ensures(Contract.Result<int>() >= 0);
- if (_size == _items.Length) EnsureCapacity(_size + 1);
- _items[_size] = value;
- _version++;
- return _size++;
- }
-
- // Adds the elements of the given collection to the end of this list. If
- // required, the capacity of the list is increased to twice the previous
- // capacity or the new size, whichever is larger.
- //
- public virtual void AddRange(ICollection c)
- {
- InsertRange(_size, c);
- }
-
-
- // Clears the contents of ArrayList.
- public virtual void Clear()
- {
- if (_size > 0)
- {
- Array.Clear(_items, 0, _size); // Don't need to doc this but we clear the elements so that the gc can reclaim the references.
- _size = 0;
- }
- _version++;
- }
-
- // Clones this ArrayList, doing a shallow copy. (A copy is made of all
- // Object references in the ArrayList, but the Objects pointed to
- // are not cloned).
- public virtual Object Clone()
- {
- Contract.Ensures(Contract.Result<Object>() != null);
- ArrayList la = new ArrayList(_size);
- la._size = _size;
- la._version = _version;
- Array.Copy(_items, 0, la._items, 0, _size);
- return la;
- }
-
-
- // Contains returns true if the specified element is in the ArrayList.
- // It does a linear, O(n) search. Equality is determined by calling
- // item.Equals().
- //
- public virtual bool Contains(Object item)
- {
- if (item == null)
- {
- for (int i = 0; i < _size; i++)
- if (_items[i] == null)
- return true;
- return false;
- }
- else
- {
- for (int i = 0; i < _size; i++)
- if ((_items[i] != null) && (_items[i].Equals(item)))
- return true;
- return false;
- }
- }
-
- // Copies this ArrayList into array, which must be of a
- // compatible array type.
- //
- public virtual void CopyTo(Array array, int arrayIndex)
- {
- if ((array != null) && (array.Rank != 1))
- throw new ArgumentException(SR.Arg_RankMultiDimNotSupported);
- Contract.EndContractBlock();
- // Delegate rest of error checking to Array.Copy.
- Array.Copy(_items, 0, array, arrayIndex, _size);
- }
-
- // Ensures that the capacity of this list is at least the given minimum
- // value. If the currect capacity of the list is less than min, the
- // capacity is increased to twice the current capacity or to min,
- // whichever is larger.
- private void EnsureCapacity(int min)
- {
- if (_items.Length < min)
- {
- int newCapacity = _items.Length == 0 ? _defaultCapacity : _items.Length * 2;
- // Allow the list to grow to maximum possible capacity (~2G elements) before encountering overflow.
- // Note that this check works even when _items.Length overflowed thanks to the (uint) cast
- if ((uint)newCapacity > Array.MaxArrayLength) newCapacity = Array.MaxArrayLength;
- if (newCapacity < min) newCapacity = min;
- Capacity = newCapacity;
- }
- }
-
- // Returns an enumerator for this list with the given
- // permission for removal of elements. If modifications made to the list
- // while an enumeration is in progress, the MoveNext and
- // GetObject methods of the enumerator will throw an exception.
- //
- public virtual IEnumerator GetEnumerator()
- {
- Contract.Ensures(Contract.Result<IEnumerator>() != null);
- return new ArrayListEnumeratorSimple(this);
- }
-
- // Returns the index of the first occurrence of a given value in a range of
- // this list. The list is searched forwards from beginning to end.
- // The elements of the list are compared to the given value using the
- // Object.Equals method.
- //
- // This method uses the Array.IndexOf method to perform the
- // search.
- //
- public virtual int IndexOf(Object value)
- {
- Contract.Ensures(Contract.Result<int>() < Count);
- return Array.IndexOf((Array)_items, value, 0, _size);
- }
-
- // Inserts an element into this list at a given index. The size of the list
- // is increased by one. If required, the capacity of the list is doubled
- // before inserting the new element.
- //
- public virtual void Insert(int index, Object value)
- {
- // Note that insertions at the end are legal.
- if (index < 0 || index > _size) throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_ArrayListInsert);
- //Contract.Ensures(Count == Contract.OldValue(Count) + 1);
- Contract.EndContractBlock();
-
- if (_size == _items.Length) EnsureCapacity(_size + 1);
- if (index < _size)
- {
- Array.Copy(_items, index, _items, index + 1, _size - index);
- }
- _items[index] = value;
- _size++;
- _version++;
- }
-
- // Inserts the elements of the given collection at a given index. If
- // required, the capacity of the list is increased to twice the previous
- // capacity or the new size, whichever is larger. Ranges may be added
- // to the end of the list by setting index to the ArrayList's size.
- //
- public virtual void InsertRange(int index, ICollection c)
- {
- if (c == null)
- throw new ArgumentNullException(nameof(c), SR.ArgumentNull_Collection);
- if (index < 0 || index > _size) throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index);
- //Contract.Ensures(Count == Contract.OldValue(Count) + c.Count);
- Contract.EndContractBlock();
-
- int count = c.Count;
- if (count > 0)
- {
- EnsureCapacity(_size + count);
- // shift existing items
- if (index < _size)
- {
- Array.Copy(_items, index, _items, index + count, _size - index);
- }
-
- Object[] itemsToInsert = new Object[count];
- c.CopyTo(itemsToInsert, 0);
- itemsToInsert.CopyTo(_items, index);
- _size += count;
- _version++;
- }
- }
-
- // Returns a read-only IList wrapper for the given IList.
- //
- [FriendAccessAllowed]
- public static IList ReadOnly(IList list)
- {
- if (list == null)
- throw new ArgumentNullException(nameof(list));
- Contract.Ensures(Contract.Result<IList>() != null);
- Contract.EndContractBlock();
- return new ReadOnlyList(list);
- }
-
- // Removes the element at the given index. The size of the list is
- // decreased by one.
- //
- public virtual void Remove(Object obj)
- {
- Contract.Ensures(Count >= 0);
-
- int index = IndexOf(obj);
- BCLDebug.Correctness(index >= 0 || !(obj is Int32), "You passed an Int32 to Remove that wasn't in the ArrayList." + Environment.NewLine + "Did you mean RemoveAt? int: " + obj + " Count: " + Count);
- if (index >= 0)
- RemoveAt(index);
- }
-
- // Removes the element at the given index. The size of the list is
- // decreased by one.
- //
- public virtual void RemoveAt(int index)
- {
- if (index < 0 || index >= _size) throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index);
- Contract.Ensures(Count >= 0);
- //Contract.Ensures(Count == Contract.OldValue(Count) - 1);
- Contract.EndContractBlock();
-
- _size--;
- if (index < _size)
- {
- Array.Copy(_items, index + 1, _items, index, _size - index);
- }
- _items[_size] = null;
- _version++;
- }
-
- // ToArray returns a new array of a particular type containing the contents
- // of the ArrayList. This requires copying the ArrayList and potentially
- // downcasting all elements. This copy may fail and is an O(n) operation.
- // Internally, this implementation calls Array.Copy.
- //
- public virtual Array ToArray(Type type)
- {
- if (type == null)
- throw new ArgumentNullException(nameof(type));
- Contract.Ensures(Contract.Result<Array>() != null);
- Contract.EndContractBlock();
- Array array = Array.UnsafeCreateInstance(type, _size);
- Array.Copy(_items, 0, array, 0, _size);
- return array;
- }
-
- [Serializable]
- private class ReadOnlyList : IList
- {
- private IList _list;
-
- internal ReadOnlyList(IList l)
- {
- _list = l;
- }
-
- public virtual int Count
- {
- get { return _list.Count; }
- }
-
- public virtual bool IsReadOnly
- {
- get { return true; }
- }
-
- public virtual bool IsFixedSize
- {
- get { return true; }
- }
-
- public virtual bool IsSynchronized
- {
- get { return _list.IsSynchronized; }
- }
-
- public virtual Object this[int index]
- {
- get
- {
- return _list[index];
- }
- set
- {
- throw new NotSupportedException(SR.NotSupported_ReadOnlyCollection);
- }
- }
-
- public virtual Object SyncRoot
- {
- get { return _list.SyncRoot; }
- }
-
- public virtual int Add(Object obj)
- {
- throw new NotSupportedException(SR.NotSupported_ReadOnlyCollection);
- }
-
- public virtual void Clear()
- {
- throw new NotSupportedException(SR.NotSupported_ReadOnlyCollection);
- }
-
- public virtual bool Contains(Object obj)
- {
- return _list.Contains(obj);
- }
-
- public virtual void CopyTo(Array array, int index)
- {
- _list.CopyTo(array, index);
- }
-
- public virtual IEnumerator GetEnumerator()
- {
- return _list.GetEnumerator();
- }
-
- public virtual int IndexOf(Object value)
- {
- return _list.IndexOf(value);
- }
-
- public virtual void Insert(int index, Object obj)
- {
- throw new NotSupportedException(SR.NotSupported_ReadOnlyCollection);
- }
-
- public virtual void Remove(Object value)
- {
- throw new NotSupportedException(SR.NotSupported_ReadOnlyCollection);
- }
-
- public virtual void RemoveAt(int index)
- {
- throw new NotSupportedException(SR.NotSupported_ReadOnlyCollection);
- }
- }
-
- [Serializable]
- private sealed class ArrayListEnumeratorSimple : IEnumerator, ICloneable
- {
- private ArrayList list;
- private int index;
- private int version;
- private Object currentElement;
- [NonSerialized]
- private bool isArrayList;
- // this object is used to indicate enumeration has not started or has terminated
- private static Object dummyObject = new Object();
-
- internal ArrayListEnumeratorSimple(ArrayList list)
- {
- this.list = list;
- index = -1;
- version = list._version;
- isArrayList = (list.GetType() == typeof(ArrayList));
- currentElement = dummyObject;
- }
-
- public Object Clone()
- {
- return MemberwiseClone();
- }
-
- public bool MoveNext()
- {
- if (version != list._version)
- {
- throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumFailedVersion));
- }
-
- if (isArrayList)
- { // avoid calling virtual methods if we are operating on ArrayList to improve performance
- if (index < list._size - 1)
- {
- currentElement = list._items[++index];
- return true;
- }
- else
- {
- currentElement = dummyObject;
- index = list._size;
- return false;
- }
- }
- else
- {
- if (index < list.Count - 1)
- {
- currentElement = list[++index];
- return true;
- }
- else
- {
- index = list.Count;
- currentElement = dummyObject;
- return false;
- }
- }
- }
-
- public Object Current
- {
- get
- {
- object temp = currentElement;
- if (dummyObject == temp)
- { // check if enumeration has not started or has terminated
- if (index == -1)
- {
- throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumNotStarted));
- }
- else
- {
- throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumEnded));
- }
- }
-
- return temp;
- }
- }
-
- public void Reset()
- {
- if (version != list._version)
- {
- throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumFailedVersion));
- }
-
- currentElement = dummyObject;
- index = -1;
- }
- }
-
- internal class ArrayListDebugView
- {
- private ArrayList arrayList;
- }
- }
-}
diff --git a/src/mscorlib/src/System/Collections/Comparer.cs b/src/mscorlib/src/System/Collections/Comparer.cs
index 7f4f9f0a07..76e19e77f1 100644
--- a/src/mscorlib/src/System/Collections/Comparer.cs
+++ b/src/mscorlib/src/System/Collections/Comparer.cs
@@ -20,7 +20,6 @@ using System.Diagnostics.Contracts;
namespace System.Collections
{
- [Serializable]
internal sealed class Comparer : IComparer, ISerializable
{
private CompareInfo m_compareInfo;
@@ -44,21 +43,6 @@ namespace System.Collections
m_compareInfo = culture.CompareInfo;
}
- private Comparer(SerializationInfo info, StreamingContext context)
- {
- m_compareInfo = null;
- SerializationInfoEnumerator enumerator = info.GetEnumerator();
- while (enumerator.MoveNext())
- {
- switch (enumerator.Name)
- {
- case CompareInfoName:
- m_compareInfo = (CompareInfo)info.GetValue(CompareInfoName, typeof(CompareInfo));
- break;
- }
- }
- }
-
// Compares two Objects by calling CompareTo. If a ==
// b,0 is returned. If a implements
// IComparable, a.CompareTo(b) is returned. If a
@@ -92,16 +76,7 @@ namespace System.Collections
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
- if (info == null)
- {
- throw new ArgumentNullException(nameof(info));
- }
- Contract.EndContractBlock();
-
- if (m_compareInfo != null)
- {
- info.AddValue(CompareInfoName, m_compareInfo);
- }
+ throw new PlatformNotSupportedException();
}
}
}
diff --git a/src/mscorlib/src/System/Collections/CompatibleComparer.cs b/src/mscorlib/src/System/Collections/CompatibleComparer.cs
index 1c90707184..7dcaa4e103 100644
--- a/src/mscorlib/src/System/Collections/CompatibleComparer.cs
+++ b/src/mscorlib/src/System/Collections/CompatibleComparer.cs
@@ -8,7 +8,6 @@ using System.Diagnostics.Contracts;
namespace System.Collections
{
- [Serializable]
internal class CompatibleComparer : IEqualityComparer
{
private IComparer _comparer;
diff --git a/src/mscorlib/src/System/Collections/Concurrent/ConcurrentQueue.cs b/src/mscorlib/src/System/Collections/Concurrent/ConcurrentQueue.cs
index c6211dadd3..3540cca8cf 100644
--- a/src/mscorlib/src/System/Collections/Concurrent/ConcurrentQueue.cs
+++ b/src/mscorlib/src/System/Collections/Concurrent/ConcurrentQueue.cs
@@ -20,7 +20,6 @@ namespace System.Collections.Concurrent
/// </remarks>
[DebuggerDisplay("Count = {Count}")]
[DebuggerTypeProxy(typeof(SystemCollectionsConcurrent_ProducerConsumerCollectionDebugView<>))]
- [Serializable]
internal class ConcurrentQueue<T> : IProducerConsumerCollection<T>, IReadOnlyCollection<T>
{
// This implementation provides an unbounded, multi-producer multi-consumer queue
diff --git a/src/mscorlib/src/System/Collections/EmptyReadOnlyDictionaryInternal.cs b/src/mscorlib/src/System/Collections/EmptyReadOnlyDictionaryInternal.cs
index 63e0d47c75..9841bdb4bb 100644
--- a/src/mscorlib/src/System/Collections/EmptyReadOnlyDictionaryInternal.cs
+++ b/src/mscorlib/src/System/Collections/EmptyReadOnlyDictionaryInternal.cs
@@ -18,7 +18,6 @@ using System.Diagnostics.Contracts;
namespace System.Collections
{
/// This is a simple implementation of IDictionary that is empty and readonly.
- [Serializable]
internal sealed class EmptyReadOnlyDictionaryInternal : IDictionary
{
// Note that this class must be agile with respect to AppDomains. See its usage in
diff --git a/src/mscorlib/src/System/Collections/Generic/ArraySortHelper.cs b/src/mscorlib/src/System/Collections/Generic/ArraySortHelper.cs
index e313cda0fb..e4a4acf74e 100644
--- a/src/mscorlib/src/System/Collections/Generic/ArraySortHelper.cs
+++ b/src/mscorlib/src/System/Collections/Generic/ArraySortHelper.cs
@@ -368,7 +368,6 @@ namespace System.Collections.Generic
}
}
- [Serializable()]
internal class GenericArraySortHelper<T>
: IArraySortHelper<T>
where T : IComparable<T>
diff --git a/src/mscorlib/src/System/Collections/Generic/Comparer.cs b/src/mscorlib/src/System/Collections/Generic/Comparer.cs
index a9b4b3f0dd..e163faa80f 100644
--- a/src/mscorlib/src/System/Collections/Generic/Comparer.cs
+++ b/src/mscorlib/src/System/Collections/Generic/Comparer.cs
@@ -51,7 +51,6 @@ namespace System.Collections.Generic
// reasons. Adding another base class (even one with no fields)
// means another generic instantiation, which can be costly esp.
// for value types.
-
[Serializable]
internal sealed class GenericComparer<T> : Comparer<T> where T : IComparable<T>
{
@@ -112,7 +111,6 @@ namespace System.Collections.Generic
GetType().GetHashCode();
}
- [Serializable]
internal sealed class ComparisonComparer<T> : Comparer<T>
{
private readonly Comparison<T> _comparison;
@@ -133,7 +131,6 @@ namespace System.Collections.Generic
// and have a SerializationInfo/StreamingContext ctor,
// since we want to serialize as ObjectComparer for
// back-compat reasons (see below).
-
[Serializable]
internal sealed class Int32EnumComparer<T> : Comparer<T>, ISerializable where T : struct
{
diff --git a/src/mscorlib/src/System/Collections/Generic/Dictionary.cs b/src/mscorlib/src/System/Collections/Generic/Dictionary.cs
index e360eef897..cd33428ca1 100644
--- a/src/mscorlib/src/System/Collections/Generic/Dictionary.cs
+++ b/src/mscorlib/src/System/Collections/Generic/Dictionary.cs
@@ -17,29 +17,6 @@
** thread safety. If a reader writer lock is available, then that may be used
** with a Dictionary to get the same thread safety guarantee.
**
-** Reader writer locks don't exist in silverlight, so we do the following as a
-** result of removing non-generic collections from silverlight:
-** 1. If the Hashtable was fully synchronized, then we replace it with a
-** Dictionary with full locks around reads/writes (same thread safety
-** guarantee).
-** 2. Otherwise, the Hashtable has the default MR/SW thread safety behavior,
-** so we do one of the following on a case-by-case basis:
-** a. If the race condition can be addressed by rearranging the code and using a temp
-** variable (for example, it's only populated immediately after created)
-** then we address the race condition this way and use Dictionary.
-** b. If there's concern about degrading performance with the increased
-** locking, we ifdef with FEATURE_NONGENERIC_COLLECTIONS so we can at
-** least use Hashtable in the desktop build, but Dictionary with full
-** locks in silverlight builds. Note that this is heavier locking than
-** MR/SW, but this is the only option without rewriting (or adding back)
-** the reader writer lock.
-** c. If there's no performance concern (e.g. debug-only code) we
-** consistently replace Hashtable with Dictionary plus full locks to
-** reduce complexity.
-** d. Most of serialization is dead code in silverlight. Instead of updating
-** those Hashtable occurences in serialization, we carved out references
-** to serialization such that this code doesn't need to build in
-** silverlight.
===========================================================*/
namespace System.Collections.Generic
@@ -706,22 +683,6 @@ namespace System.Collections.Generic
value = default(TValue);
return false;
}
-
- // Method similar to TryGetValue that returns the value instead of putting it in an out param.
- public TValue GetValueOrDefault(TKey key) => GetValueOrDefault(key, default(TValue));
-
- // Method similar to TryGetValue that returns the value instead of putting it in an out param. If the entry
- // doesn't exist, returns the defaultValue instead.
- public TValue GetValueOrDefault(TKey key, TValue defaultValue)
- {
- int i = FindEntry(key);
- if (i >= 0)
- {
- return entries[i].value;
- }
- return defaultValue;
- }
-
public bool TryAdd(TKey key, TValue value) => TryInsert(key, value, InsertionBehavior.None);
bool ICollection<KeyValuePair<TKey, TValue>>.IsReadOnly
@@ -947,7 +908,6 @@ namespace System.Collections.Generic
}
}
- [Serializable]
public struct Enumerator : IEnumerator<KeyValuePair<TKey, TValue>>,
IDictionaryEnumerator
{
@@ -1076,7 +1036,6 @@ namespace System.Collections.Generic
[DebuggerTypeProxy(typeof(Mscorlib_DictionaryKeyCollectionDebugView<,>))]
[DebuggerDisplay("Count = {Count}")]
- [Serializable]
public sealed class KeyCollection : ICollection<TKey>, ICollection, IReadOnlyCollection<TKey>
{
private Dictionary<TKey, TValue> dictionary;
@@ -1227,7 +1186,6 @@ namespace System.Collections.Generic
get { return ((ICollection)dictionary).SyncRoot; }
}
- [Serializable]
public struct Enumerator : IEnumerator<TKey>, System.Collections.IEnumerator
{
private Dictionary<TKey, TValue> dictionary;
@@ -1306,7 +1264,6 @@ namespace System.Collections.Generic
[DebuggerTypeProxy(typeof(Mscorlib_DictionaryValueCollectionDebugView<,>))]
[DebuggerDisplay("Count = {Count}")]
- [Serializable]
public sealed class ValueCollection : ICollection<TValue>, ICollection, IReadOnlyCollection<TValue>
{
private Dictionary<TKey, TValue> dictionary;
@@ -1455,7 +1412,6 @@ namespace System.Collections.Generic
get { return ((ICollection)dictionary).SyncRoot; }
}
- [Serializable]
public struct Enumerator : IEnumerator<TValue>, System.Collections.IEnumerator
{
private Dictionary<TKey, TValue> dictionary;
diff --git a/src/mscorlib/src/System/Collections/Generic/EqualityComparer.cs b/src/mscorlib/src/System/Collections/Generic/EqualityComparer.cs
index 0cd1bc1c12..d6b213c9d7 100644
--- a/src/mscorlib/src/System/Collections/Generic/EqualityComparer.cs
+++ b/src/mscorlib/src/System/Collections/Generic/EqualityComparer.cs
@@ -10,6 +10,7 @@ using System.Security;
using System.Globalization;
using System.Runtime;
using System.Runtime.CompilerServices;
+using System.Runtime.Serialization;
using System.Diagnostics.Contracts;
namespace System.Collections.Generic
@@ -352,7 +353,7 @@ namespace System.Collections.Generic
}
[Serializable]
- internal class EnumEqualityComparer<T> : EqualityComparer<T> where T : struct
+ internal class EnumEqualityComparer<T> : EqualityComparer<T>, ISerializable where T : struct
{
[Pure]
public override bool Equals(T x, T y)
@@ -371,6 +372,9 @@ namespace System.Collections.Generic
public EnumEqualityComparer() { }
+ // This is used by the serialization engine.
+ protected EnumEqualityComparer(SerializationInfo information, StreamingContext context) { }
+
// Equals method for the comparer itself.
public override bool Equals(Object obj) =>
obj != null && GetType() == obj.GetType();
@@ -401,6 +405,14 @@ namespace System.Collections.Generic
}
return -1;
}
+
+ public void GetObjectData(SerializationInfo info, StreamingContext context)
+ {
+ // For back-compat we need to serialize the comparers for enums with underlying types other than int as ObjectEqualityComparer
+ if (Type.GetTypeCode(Enum.GetUnderlyingType(typeof(T))) != TypeCode.Int32) {
+ info.SetType(typeof(ObjectEqualityComparer<T>));
+ }
+ }
}
[Serializable]
@@ -408,6 +420,9 @@ namespace System.Collections.Generic
{
public SByteEnumEqualityComparer() { }
+ // This is used by the serialization engine.
+ public SByteEnumEqualityComparer(SerializationInfo information, StreamingContext context) { }
+
[Pure]
public override int GetHashCode(T obj)
{
@@ -417,10 +432,13 @@ namespace System.Collections.Generic
}
[Serializable]
- internal sealed class ShortEnumEqualityComparer<T> : EnumEqualityComparer<T> where T : struct
+ internal sealed class ShortEnumEqualityComparer<T> : EnumEqualityComparer<T>, ISerializable where T : struct
{
public ShortEnumEqualityComparer() { }
+ // This is used by the serialization engine.
+ public ShortEnumEqualityComparer(SerializationInfo information, StreamingContext context) { }
+
[Pure]
public override int GetHashCode(T obj)
{
@@ -430,7 +448,7 @@ namespace System.Collections.Generic
}
[Serializable]
- internal sealed class LongEnumEqualityComparer<T> : EqualityComparer<T> where T : struct
+ internal sealed class LongEnumEqualityComparer<T> : EqualityComparer<T>, ISerializable where T : struct
{
[Pure]
public override bool Equals(T x, T y)
@@ -479,5 +497,15 @@ namespace System.Collections.Generic
}
return -1;
}
+
+ // This is used by the serialization engine.
+ public LongEnumEqualityComparer(SerializationInfo information, StreamingContext context) { }
+
+ public void GetObjectData(SerializationInfo info, StreamingContext context)
+ {
+ // The LongEnumEqualityComparer does not exist on 4.0 so we need to serialize this comparer as ObjectEqualityComparer
+ // to allow for roundtrip between 4.0 and 4.5.
+ info.SetType(typeof(ObjectEqualityComparer<T>));
+ }
}
}
diff --git a/src/mscorlib/src/System/Collections/Generic/List.cs b/src/mscorlib/src/System/Collections/Generic/List.cs
index 4e480885ef..94e794cfd2 100644
--- a/src/mscorlib/src/System/Collections/Generic/List.cs
+++ b/src/mscorlib/src/System/Collections/Generic/List.cs
@@ -1254,7 +1254,6 @@ namespace System.Collections.Generic
}
}
- [Serializable]
public struct Enumerator : IEnumerator<T>, System.Collections.IEnumerator
{
private List<T> list;
diff --git a/src/mscorlib/src/System/Collections/Hashtable.cs b/src/mscorlib/src/System/Collections/Hashtable.cs
index e2fd57ea4d..0c89632828 100644
--- a/src/mscorlib/src/System/Collections/Hashtable.cs
+++ b/src/mscorlib/src/System/Collections/Hashtable.cs
@@ -66,7 +66,6 @@ namespace System.Collections
//
[DebuggerTypeProxy(typeof(System.Collections.Hashtable.HashtableDebugView))]
[DebuggerDisplay("Count = {Count}")]
- [Serializable]
internal class Hashtable : IDictionary, ISerializable, IDeserializationCallback, ICloneable
{
/*
@@ -919,58 +918,7 @@ namespace System.Collections
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
{
- if (info == null)
- {
- throw new ArgumentNullException(nameof(info));
- }
- Contract.EndContractBlock();
- // This is imperfect - it only works well if all other writes are
- // also using our synchronized wrapper. But it's still a good idea.
- lock (SyncRoot)
- {
- // This method hasn't been fully tweaked to be safe for a concurrent writer.
- int oldVersion = version;
- info.AddValue(LoadFactorName, loadFactor);
- info.AddValue(VersionName, version);
-
- //
- // We need to maintain serialization compatibility with Everett and RTM.
- // If the comparer is null or a compatible comparer, serialize Hashtable
- // in a format that can be deserialized on Everett and RTM.
- //
-#pragma warning disable 618
- IEqualityComparer keyComparerForSerilization = _keycomparer;
-
- if (keyComparerForSerilization == null)
- {
- info.AddValue(ComparerName, null, typeof(IComparer));
- info.AddValue(HashCodeProviderName, null, typeof(IHashCodeProvider));
- }
- else if (keyComparerForSerilization is CompatibleComparer)
- {
- CompatibleComparer c = keyComparerForSerilization as CompatibleComparer;
- info.AddValue(ComparerName, c.Comparer, typeof(IComparer));
- info.AddValue(HashCodeProviderName, c.HashCodeProvider, typeof(IHashCodeProvider));
- }
- else
- {
- info.AddValue(KeyComparerName, keyComparerForSerilization, typeof(IEqualityComparer));
- }
-#pragma warning restore 618
-
- info.AddValue(HashSizeName, buckets.Length); //This is the length of the bucket array.
- Object[] serKeys = new Object[count];
- Object[] serValues = new Object[count];
- CopyKeys(serKeys, 0);
- CopyValues(serValues, 0);
- info.AddValue(KeysName, serKeys, typeof(Object[]));
- info.AddValue(ValuesName, serValues, typeof(Object[]));
-
- // Explicitly check to see if anyone changed the Hashtable while we
- // were serializing it. That's a race condition in their code.
- if (version != oldVersion)
- throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumFailedVersion));
- }
+ throw new PlatformNotSupportedException();
}
//
@@ -1073,7 +1021,6 @@ namespace System.Collections
// Implements a Collection for the keys of a hashtable. An instance of this
// class is created by the GetKeys method of a hashtable.
- [Serializable]
private class KeyCollection : ICollection
{
private Hashtable _hashtable;
@@ -1120,7 +1067,6 @@ namespace System.Collections
// Implements a Collection for the values of a hashtable. An instance of
// this class is created by the GetValues method of a hashtable.
- [Serializable]
private class ValueCollection : ICollection
{
private Hashtable _hashtable;
@@ -1166,7 +1112,6 @@ namespace System.Collections
}
// Synchronized wrapper for hashtable
- [Serializable]
private class SyncHashtable : Hashtable, IEnumerable
{
protected Hashtable _table;
@@ -1189,17 +1134,7 @@ namespace System.Collections
==============================================================================*/
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
- if (info == null)
- {
- throw new ArgumentNullException(nameof(info));
- }
- Contract.EndContractBlock();
- // Our serialization code hasn't been fully tweaked to be safe
- // for a concurrent writer.
- lock (_table.SyncRoot)
- {
- info.AddValue("ParentTable", _table, typeof(Hashtable));
- }
+ throw new PlatformNotSupportedException();
}
public override int Count
@@ -1339,7 +1274,7 @@ namespace System.Collections
==============================================================================*/
public override void OnDeserialization(Object sender)
{
- return;
+ throw new PlatformNotSupportedException();
}
}
@@ -1347,7 +1282,6 @@ namespace System.Collections
// Implements an enumerator for a hashtable. The enumerator uses the
// internal version number of the hashtabke to ensure that no modifications
// are made to the hashtable while an enumeration is in progress.
- [Serializable]
private class HashtableEnumerator : IDictionaryEnumerator, ICloneable
{
private Hashtable hashtable;
diff --git a/src/mscorlib/src/System/Collections/ObjectModel/ReadOnlyDictionary.cs b/src/mscorlib/src/System/Collections/ObjectModel/ReadOnlyDictionary.cs
index ebf86cdc58..3fd0cf8c6c 100644
--- a/src/mscorlib/src/System/Collections/ObjectModel/ReadOnlyDictionary.cs
+++ b/src/mscorlib/src/System/Collections/ObjectModel/ReadOnlyDictionary.cs
@@ -19,7 +19,6 @@ using System.Diagnostics.Contracts;
namespace System.Collections.ObjectModel
{
- [Serializable]
[DebuggerTypeProxy(typeof(Mscorlib_DictionaryDebugView<,>))]
[DebuggerDisplay("Count = {Count}")]
internal class ReadOnlyDictionary<TKey, TValue> : IDictionary<TKey, TValue>, IDictionary, IReadOnlyDictionary<TKey, TValue>
@@ -365,7 +364,6 @@ namespace System.Collections.ObjectModel
}
}
- [Serializable]
private struct DictionaryEnumerator : IDictionaryEnumerator
{
private readonly IDictionary<TKey, TValue> m_dictionary;
@@ -432,7 +430,6 @@ namespace System.Collections.ObjectModel
[DebuggerTypeProxy(typeof(Mscorlib_CollectionDebugView<>))]
[DebuggerDisplay("Count = {Count}")]
- [Serializable]
public sealed class KeyCollection : ICollection<TKey>, ICollection, IReadOnlyCollection<TKey>
{
private readonly ICollection<TKey> m_collection;
@@ -543,7 +540,6 @@ namespace System.Collections.ObjectModel
[DebuggerTypeProxy(typeof(Mscorlib_CollectionDebugView<>))]
[DebuggerDisplay("Count = {Count}")]
- [Serializable]
public sealed class ValueCollection : ICollection<TValue>, ICollection, IReadOnlyCollection<TValue>
{
private readonly ICollection<TValue> m_collection;
diff --git a/src/mscorlib/src/System/Currency.cs b/src/mscorlib/src/System/Currency.cs
index 13ec1b0c4e..4b735bbfe3 100644
--- a/src/mscorlib/src/System/Currency.cs
+++ b/src/mscorlib/src/System/Currency.cs
@@ -10,7 +10,6 @@ using System.Runtime.Versioning;
namespace System
{
- [Serializable]
internal struct Currency
{
internal long m_value;
diff --git a/src/mscorlib/src/System/Delegate.cs b/src/mscorlib/src/System/Delegate.cs
index 75ec57a003..8a9763694b 100644
--- a/src/mscorlib/src/System/Delegate.cs
+++ b/src/mscorlib/src/System/Delegate.cs
@@ -15,7 +15,6 @@ namespace System
using System.Diagnostics;
using System.Diagnostics.Contracts;
- [Serializable]
[ClassInterface(ClassInterfaceType.AutoDual)]
[System.Runtime.InteropServices.ComVisible(true)]
public abstract class Delegate : ICloneable, ISerializable
@@ -545,8 +544,9 @@ namespace System
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
{
- throw new NotSupportedException();
+ throw new PlatformNotSupportedException();
}
+
//
// internal implementation details (FCALLS and utilities)
//
diff --git a/src/mscorlib/src/System/DelegateSerializationHolder.cs b/src/mscorlib/src/System/DelegateSerializationHolder.cs
deleted file mode 100644
index d7ad827673..0000000000
--- a/src/mscorlib/src/System/DelegateSerializationHolder.cs
+++ /dev/null
@@ -1,287 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-
-using System;
-using System.Reflection;
-using System.Runtime.Remoting;
-using System.Runtime.Serialization;
-using System.Globalization;
-using System.Diagnostics.Contracts;
-
-namespace System
-{
- [Serializable]
- internal sealed class DelegateSerializationHolder : IObjectReference, ISerializable
- {
- #region Static Members
- internal static DelegateEntry GetDelegateSerializationInfo(
- SerializationInfo info, Type delegateType, Object target, MethodInfo method, int targetIndex)
- {
- // Used for MulticastDelegate
-
- if (method == null)
- throw new ArgumentNullException(nameof(method));
- Contract.EndContractBlock();
-
- Type c = delegateType.BaseType;
-
- if (c == null || (c != typeof(Delegate) && c != typeof(MulticastDelegate)))
- throw new ArgumentException(SR.Arg_MustBeDelegate, "type");
-
- if (method.DeclaringType == null)
- throw new NotSupportedException(SR.NotSupported_GlobalMethodSerialization);
-
- DelegateEntry de = new DelegateEntry(delegateType.FullName, delegateType.Module.Assembly.FullName, target,
- method.ReflectedType.Module.Assembly.FullName, method.ReflectedType.FullName, method.Name);
-
- if (info.MemberCount == 0)
- {
- info.SetType(typeof(DelegateSerializationHolder));
- info.AddValue("Delegate", de, typeof(DelegateEntry));
- }
-
- // target can be an object so it needs to be added to the info, or else a fixup is needed
- // when deserializing, and the fixup will occur too late. If it is added directly to the
- // info then the rules of deserialization will guarantee that it will be available when
- // needed
-
- if (target != null)
- {
- String targetName = "target" + targetIndex;
- info.AddValue(targetName, de.target);
- de.target = targetName;
- }
-
- // Due to a number of additions (delegate signature binding relaxation, delegates with open this or closed over the
- // first parameter and delegates over generic methods) we need to send a deal more information than previously. We can
- // get this by serializing the target MethodInfo. We still need to send the same information as before though (the
- // DelegateEntry above) for backwards compatibility. And we want to send the MethodInfo (which is serialized via an
- // ISerializable holder) as a top-level child of the info for the same reason as the target above -- we wouldn't have an
- // order of deserialization guarantee otherwise.
- String methodInfoName = "method" + targetIndex;
- info.AddValue(methodInfoName, method);
-
- return de;
- }
- #endregion
-
- #region Definitions
- [Serializable]
- internal class DelegateEntry
- {
- #region Internal Data Members
- internal String type;
- internal String assembly;
- internal Object target;
- internal String targetTypeAssembly;
- internal String targetTypeName;
- internal String methodName;
- internal DelegateEntry delegateEntry;
- #endregion
-
- #region Constructor
- internal DelegateEntry(
- String type, String assembly, Object target, String targetTypeAssembly, String targetTypeName, String methodName)
- {
- this.type = type;
- this.assembly = assembly;
- this.target = target;
- this.targetTypeAssembly = targetTypeAssembly;
- this.targetTypeName = targetTypeName;
- this.methodName = methodName;
- }
- #endregion
-
- #region Internal Members
- internal DelegateEntry Entry
- {
- get { return delegateEntry; }
- set { delegateEntry = value; }
- }
- #endregion
- }
-
- #endregion
-
- #region Private Data Members
- private DelegateEntry m_delegateEntry;
- private MethodInfo[] m_methods;
- #endregion
-
- #region Constructor
- private DelegateSerializationHolder(SerializationInfo info, StreamingContext context)
- {
- if (info == null)
- throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- bool bNewWire = true;
-
- try
- {
- m_delegateEntry = (DelegateEntry)info.GetValue("Delegate", typeof(DelegateEntry));
- }
- catch
- {
- // Old wire format
- m_delegateEntry = OldDelegateWireFormat(info, context);
- bNewWire = false;
- }
-
- if (bNewWire)
- {
- // retrieve the targets
- DelegateEntry deiter = m_delegateEntry;
- int count = 0;
- while (deiter != null)
- {
- if (deiter.target != null)
- {
- string stringTarget = deiter.target as string; //need test to pass older wire format
- if (stringTarget != null)
- deiter.target = info.GetValue(stringTarget, typeof(Object));
- }
- count++;
- deiter = deiter.delegateEntry;
- }
-
- // If the sender is as recent as us they'll have provided MethodInfos for each delegate. Look for these and pack
- // them into an ordered array if present.
- MethodInfo[] methods = new MethodInfo[count];
- int i;
- for (i = 0; i < count; i++)
- {
- String methodInfoName = "method" + i;
- methods[i] = (MethodInfo)info.GetValueNoThrow(methodInfoName, typeof(MethodInfo));
- if (methods[i] == null)
- break;
- }
-
- // If we got the info then make the array available for deserialization.
- if (i == count)
- m_methods = methods;
- }
- }
- #endregion
-
- #region Private Members
- private void ThrowInsufficientState(string field)
- {
- throw new SerializationException(
- SR.Format(SR.Serialization_InsufficientDeserializationState, field));
- }
-
- private DelegateEntry OldDelegateWireFormat(SerializationInfo info, StreamingContext context)
- {
- if (info == null)
- throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- String delegateType = info.GetString("DelegateType");
- String delegateAssembly = info.GetString("DelegateAssembly");
- Object target = info.GetValue("Target", typeof(Object));
- String targetTypeAssembly = info.GetString("TargetTypeAssembly");
- String targetTypeName = info.GetString("TargetTypeName");
- String methodName = info.GetString("MethodName");
-
- return new DelegateEntry(delegateType, delegateAssembly, target, targetTypeAssembly, targetTypeName, methodName);
- }
-
- private Delegate GetDelegate(DelegateEntry de, int index)
- {
- Delegate d;
-
- try
- {
- if (de.methodName == null || de.methodName.Length == 0)
- ThrowInsufficientState("MethodName");
-
- if (de.assembly == null || de.assembly.Length == 0)
- ThrowInsufficientState("DelegateAssembly");
-
- if (de.targetTypeName == null || de.targetTypeName.Length == 0)
- ThrowInsufficientState("TargetTypeName");
-
- // We cannot use Type.GetType directly, because of AppCompat - assembly names starting with '[' would fail to load.
- RuntimeType type = (RuntimeType)Assembly.GetType_Compat(de.assembly, de.type);
-
- // {de.targetTypeAssembly, de.targetTypeName} do not actually refer to the type of the target, but the reflected
- // type of the method. Those types may be the same when the method is on the target's type or on a type in its
- // inheritance chain, but those types may not be the same when the method is an extension method for the
- // target's type or a type in its inheritance chain.
-
- // If we received the new style delegate encoding we already have the target MethodInfo in hand.
- if (m_methods != null)
- {
- // The method info is serialized, so the target type info is redundant. The desktop framework does no
- // additional verification on the target type info.
- d = Delegate.CreateDelegateNoSecurityCheck(type, de.target, m_methods[index]);
- }
- else
- {
- if (de.target != null)
- {
- // For consistency with the desktop framework, when the method info is not serialized for a closed
- // delegate, the method is assumed to be on the target's type or in its inheritance chain. An extension
- // method would not work on this path for the above reason and also because the delegate binds to
- // instance methods only. The desktop framework does no additional verification on the target type info.
- d = Delegate.CreateDelegate(type, de.target, de.methodName);
- }
- else
- {
- RuntimeType targetType = (RuntimeType)Assembly.GetType_Compat(de.targetTypeAssembly, de.targetTypeName);
- d = Delegate.CreateDelegate(type, targetType, de.methodName);
- }
- }
- }
- catch (Exception e)
- {
- if (e is SerializationException)
- throw e;
-
- throw new SerializationException(e.Message, e);
- }
-
- return d;
- }
- #endregion
-
- #region IObjectReference
- public Object GetRealObject(StreamingContext context)
- {
- int count = 0;
- for (DelegateEntry de = m_delegateEntry; de != null; de = de.Entry)
- count++;
-
- int maxindex = count - 1;
-
- if (count == 1)
- {
- return GetDelegate(m_delegateEntry, 0);
- }
- else
- {
- object[] invocationList = new object[count];
-
- for (DelegateEntry de = m_delegateEntry; de != null; de = de.Entry)
- {
- // Be careful to match the index we pass to GetDelegate (used to look up extra information for each delegate) to
- // the order we process the entries: we're actually looking at them in reverse order.
- --count;
- invocationList[count] = GetDelegate(de, maxindex - count);
- }
- return ((MulticastDelegate)invocationList[0]).NewMulticastDelegate(invocationList, invocationList.Length);
- }
- }
- #endregion
-
- #region ISerializable
- public void GetObjectData(SerializationInfo info, StreamingContext context)
- {
- throw new NotSupportedException(SR.NotSupported_DelegateSerHolderSerial);
- }
- #endregion
- }
-}
diff --git a/src/mscorlib/src/System/Diagnostics/AssertFilter.cs b/src/mscorlib/src/System/Diagnostics/AssertFilter.cs
index 7c861de58e..39ce93ff51 100644
--- a/src/mscorlib/src/System/Diagnostics/AssertFilter.cs
+++ b/src/mscorlib/src/System/Diagnostics/AssertFilter.cs
@@ -15,7 +15,6 @@ namespace System.Diagnostics
//
// The default filter brings up a simple Win32 dialog with 3 buttons.
- [Serializable]
abstract internal class AssertFilter
{
// Called when an assert fails. This should be overridden with logic which
diff --git a/src/mscorlib/src/System/Diagnostics/AssertFilters.cs b/src/mscorlib/src/System/Diagnostics/AssertFilters.cs
index 0f34b41dba..a97e8839ae 100644
--- a/src/mscorlib/src/System/Diagnostics/AssertFilters.cs
+++ b/src/mscorlib/src/System/Diagnostics/AssertFilters.cs
@@ -16,7 +16,6 @@ using System;
namespace System.Diagnostics
{
- [Serializable]
internal enum AssertFilters
{
FailDebug = 0,
diff --git a/src/mscorlib/src/System/Diagnostics/Contracts/ContractsBCL.cs b/src/mscorlib/src/System/Diagnostics/Contracts/ContractsBCL.cs
index 09d1e6baca..d29b860bd1 100644
--- a/src/mscorlib/src/System/Diagnostics/Contracts/ContractsBCL.cs
+++ b/src/mscorlib/src/System/Diagnostics/Contracts/ContractsBCL.cs
@@ -186,7 +186,6 @@ namespace System.Diagnostics.Contracts
}
}
- [Serializable]
[SuppressMessage("Microsoft.Design", "CA1064:ExceptionsShouldBePublic")]
internal sealed class ContractException : Exception
{
@@ -218,21 +217,9 @@ namespace System.Diagnostics.Contracts
_Condition = condition;
}
- private ContractException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
- : base(info, context)
- {
- _Kind = (ContractFailureKind)info.GetInt32("Kind");
- _UserMessage = info.GetString("UserMessage");
- _Condition = info.GetString("Condition");
- }
-
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
{
base.GetObjectData(info, context);
-
- info.AddValue("Kind", _Kind);
- info.AddValue("UserMessage", _UserMessage);
- info.AddValue("Condition", _Condition);
}
}
}
diff --git a/src/mscorlib/src/System/Diagnostics/Debugger.cs b/src/mscorlib/src/System/Diagnostics/Debugger.cs
index 92df7e7f5f..cda3c4e729 100644
--- a/src/mscorlib/src/System/Diagnostics/Debugger.cs
+++ b/src/mscorlib/src/System/Diagnostics/Debugger.cs
@@ -5,101 +5,63 @@
// The Debugger class is a part of the System.Diagnostics package
// and is used for communicating with a debugger.
-using System;
-using System.IO;
-using System.Collections;
-using System.Reflection;
using System.Runtime.CompilerServices;
-using System.Security;
-using System.Runtime.Versioning;
namespace System.Diagnostics
{
- // No data, does not need to be marked with the serializable attribute
- public sealed class Debugger
+ public static class Debugger
{
- // This should have been a static class, but wasn't as of v3.5. Clearly, this is
- // broken. We'll keep this in V4 for binary compat, but marked obsolete as error
- // so migrated source code gets fixed.
- [Obsolete("Do not create instances of the Debugger class. Call the static methods directly on this type instead", true)]
- public Debugger()
- {
- // Should not have been instantiable - here for binary compatibility in V4.
- }
-
// Break causes a breakpoint to be signalled to an attached debugger. If no debugger
- // is attached, the user is asked if he wants to attach a debugger. If yes, then the
+ // is attached, the user is asked if he wants to attach a debugger. If yes, then the
// debugger is launched.
- [MethodImplAttribute(MethodImplOptions.NoInlining)]
- public static void Break()
- {
- // Causing a break is now allowed.
- BreakInternal();
- }
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ public static void Break() => BreakInternal();
- private static void BreakCanThrow()
- {
- BreakInternal();
- }
+ // The VM depends on this private method.
+ private static void BreakCanThrow() => BreakInternal();
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ [MethodImpl(MethodImplOptions.InternalCall)]
private static extern void BreakInternal();
// Launch launches & attaches a debugger to the process. If a debugger is already attached,
- // nothing happens.
+ // nothing happens.
//
- public static bool Launch()
- {
- if (Debugger.IsAttached)
- return (true);
-
- // Causing the debugger to launch is now allowed.
- return (LaunchInternal());
- }
+ public static bool Launch() => IsAttached ? true : LaunchInternal();
// This class implements code:ICustomDebuggerNotification and provides a type to be used to notify
- // the debugger that execution is about to enter a path that involves a cross-thread dependency.
- // See code:NotifyOfCrossThreadDependency for more details.
- private class CrossThreadDependencyNotification : ICustomDebuggerNotification
- {
- // constructor
- public CrossThreadDependencyNotification()
- {
- }
- }
-
- // Do not inline the slow path
- [MethodImplAttribute(MethodImplOptions.NoInlining)]
- private static void NotifyOfCrossThreadDependencySlow()
- {
- CrossThreadDependencyNotification notification = new CrossThreadDependencyNotification();
- CustomNotification(notification);
- }
-
- // Sends a notification to the debugger to indicate that execution is about to enter a path
- // involving a cross thread dependency. A debugger that has opted into this type of notification
- // can take appropriate action on receipt. For example, performing a funceval normally requires
- // freezing all threads but the one performing the funceval. If the funceval requires execution on
- // more than one thread, as might occur in remoting scenarios, the funceval will block. This
- // notification will apprise the debugger that it will need to slip a thread or abort the funceval
- // in such a situation. The notification is subject to collection after this function returns.
- //
+ // the debugger that execution is about to enter a path that involves a cross-thread dependency.
+ // See code:NotifyOfCrossThreadDependency for more details.
+ private class CrossThreadDependencyNotification : ICustomDebuggerNotification { }
+
+ // Do not inline the slow path
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ private static void NotifyOfCrossThreadDependencySlow() =>
+ CustomNotification(new CrossThreadDependencyNotification());
+
+ // Sends a notification to the debugger to indicate that execution is about to enter a path
+ // involving a cross thread dependency. A debugger that has opted into this type of notification
+ // can take appropriate action on receipt. For example, performing a funceval normally requires
+ // freezing all threads but the one performing the funceval. If the funceval requires execution on
+ // more than one thread, as might occur in remoting scenarios, the funceval will block. This
+ // notification will apprise the debugger that it will need to slip a thread or abort the funceval
+ // in such a situation. The notification is subject to collection after this function returns.
+ //
public static void NotifyOfCrossThreadDependency()
{
- if (Debugger.IsAttached)
+ if (IsAttached)
{
NotifyOfCrossThreadDependencySlow();
}
}
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ [MethodImpl(MethodImplOptions.InternalCall)]
private static extern bool LaunchInternal();
// Returns whether or not a debugger is attached to the process.
//
public static extern bool IsAttached
{
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ [MethodImpl(MethodImplOptions.InternalCall)]
get;
}
@@ -108,26 +70,26 @@ namespace System.Diagnostics
// An attached debugger can enable or disable which messages will
// actually be reported to the user through the COM+ debugger
// services API. This info is communicated to the runtime so only
- // desired events are actually reported to the debugger.
+ // desired events are actually reported to the debugger.
//
// Constant representing the default category
- public static readonly String DefaultCategory = null;
+ public static readonly string DefaultCategory = null;
// Posts a message for the attached debugger. If there is no
// debugger attached, has no effect. The debugger may or may not
- // report the message depending on its settings.
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public static extern void Log(int level, String category, String message);
+ // report the message depending on its settings.
+ [MethodImpl(MethodImplOptions.InternalCall)]
+ public static extern void Log(int level, string category, string message);
// Checks to see if an attached debugger has logging enabled
- //
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ //
+ [MethodImpl(MethodImplOptions.InternalCall)]
public static extern bool IsLogging();
// Posts a custom notification for the attached debugger. If there is no
// debugger attached, has no effect. The debugger may or may not
- // report the notification depending on its settings.
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ // report the notification depending on its settings.
+ [MethodImpl(MethodImplOptions.InternalCall)]
private static extern void CustomNotification(ICustomDebuggerNotification data);
}
}
diff --git a/src/mscorlib/src/System/Diagnostics/DebuggerAttributes.cs b/src/mscorlib/src/System/Diagnostics/DebuggerAttributes.cs
index 5e1dfd82a5..34e65bcb3e 100644
--- a/src/mscorlib/src/System/Diagnostics/DebuggerAttributes.cs
+++ b/src/mscorlib/src/System/Diagnostics/DebuggerAttributes.cs
@@ -18,21 +18,18 @@ using System.Diagnostics.Contracts;
namespace System.Diagnostics
{
- [Serializable]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)]
public sealed class DebuggerStepThroughAttribute : Attribute
{
public DebuggerStepThroughAttribute() { }
}
- [Serializable]
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Constructor, Inherited = false)]
public sealed class DebuggerHiddenAttribute : Attribute
{
public DebuggerHiddenAttribute() { }
}
- [Serializable]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Constructor | AttributeTargets.Struct, Inherited = false)]
public sealed class DebuggerNonUserCodeAttribute : Attribute
{
diff --git a/src/mscorlib/src/System/Diagnostics/EditAndContinueHelper.cs b/src/mscorlib/src/System/Diagnostics/EditAndContinueHelper.cs
index 8ad4fec082..6b8c150ab8 100644
--- a/src/mscorlib/src/System/Diagnostics/EditAndContinueHelper.cs
+++ b/src/mscorlib/src/System/Diagnostics/EditAndContinueHelper.cs
@@ -16,7 +16,6 @@ using System;
namespace System.Diagnostics
{
- [Serializable]
internal sealed class EditAndContinueHelper
{
#pragma warning disable 169
diff --git a/src/mscorlib/src/System/Diagnostics/Eventing/EventPipe.cs b/src/mscorlib/src/System/Diagnostics/Eventing/EventPipe.cs
new file mode 100644
index 0000000000..2f6fdf62ef
--- /dev/null
+++ b/src/mscorlib/src/System/Diagnostics/Eventing/EventPipe.cs
@@ -0,0 +1,175 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+using System.Collections.Generic;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Security;
+using Microsoft.Win32;
+
+namespace System.Diagnostics.Tracing
+{
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct EventPipeProviderConfiguration
+ {
+ [MarshalAs(UnmanagedType.LPWStr)]
+ private string m_providerName;
+ private UInt64 m_keywords;
+ private uint m_loggingLevel;
+
+ internal EventPipeProviderConfiguration(
+ string providerName,
+ UInt64 keywords,
+ uint loggingLevel)
+ {
+ if(string.IsNullOrEmpty(providerName))
+ {
+ throw new ArgumentNullException(nameof(providerName));
+ }
+ if(loggingLevel > 5) // 5 == Verbose, the highest value in EventPipeLoggingLevel.
+ {
+ throw new ArgumentOutOfRangeException(nameof(loggingLevel));
+ }
+ m_providerName = providerName;
+ m_keywords = keywords;
+ m_loggingLevel = loggingLevel;
+ }
+
+ internal string ProviderName
+ {
+ get { return m_providerName; }
+ }
+
+ internal UInt64 Keywords
+ {
+ get { return m_keywords; }
+ }
+
+ internal uint LoggingLevel
+ {
+ get { return m_loggingLevel; }
+ }
+ }
+
+ internal sealed class EventPipeConfiguration
+ {
+ private string m_outputFile;
+ private uint m_circularBufferSizeInMB;
+ private List<EventPipeProviderConfiguration> m_providers;
+ private TimeSpan m_minTimeBetweenSamples = TimeSpan.FromMilliseconds(1);
+
+ internal EventPipeConfiguration(
+ string outputFile,
+ uint circularBufferSizeInMB)
+ {
+ if(string.IsNullOrEmpty(outputFile))
+ {
+ throw new ArgumentNullException(nameof(outputFile));
+ }
+ if(circularBufferSizeInMB == 0)
+ {
+ throw new ArgumentOutOfRangeException(nameof(circularBufferSizeInMB));
+ }
+ m_outputFile = outputFile;
+ m_circularBufferSizeInMB = circularBufferSizeInMB;
+ m_providers = new List<EventPipeProviderConfiguration>();
+ }
+
+ internal string OutputFile
+ {
+ get { return m_outputFile; }
+ }
+
+ internal uint CircularBufferSizeInMB
+ {
+ get { return m_circularBufferSizeInMB; }
+ }
+
+ internal EventPipeProviderConfiguration[] Providers
+ {
+ get { return m_providers.ToArray(); }
+ }
+
+ internal long ProfilerSamplingRateInNanoseconds
+ {
+ // 100 nanoseconds == 1 tick.
+ get { return m_minTimeBetweenSamples.Ticks * 100; }
+ }
+
+ internal void EnableProvider(string providerName, UInt64 keywords, uint loggingLevel)
+ {
+ m_providers.Add(new EventPipeProviderConfiguration(
+ providerName,
+ keywords,
+ loggingLevel));
+ }
+
+ internal void SetProfilerSamplingRate(TimeSpan minTimeBetweenSamples)
+ {
+ if(minTimeBetweenSamples.Ticks <= 0)
+ {
+ throw new ArgumentOutOfRangeException(nameof(minTimeBetweenSamples));
+ }
+
+ m_minTimeBetweenSamples = minTimeBetweenSamples;
+ }
+ }
+
+ internal static class EventPipe
+ {
+ internal static void Enable(EventPipeConfiguration configuration)
+ {
+ if(configuration == null)
+ {
+ throw new ArgumentNullException(nameof(configuration));
+ }
+
+ EventPipeProviderConfiguration[] providers = configuration.Providers;
+
+ EventPipeInternal.Enable(
+ configuration.OutputFile,
+ configuration.CircularBufferSizeInMB,
+ configuration.ProfilerSamplingRateInNanoseconds,
+ providers,
+ providers.Length);
+ }
+
+ internal static void Disable()
+ {
+ EventPipeInternal.Disable();
+ }
+ }
+
+ internal static class EventPipeInternal
+ {
+ //
+ // These PInvokes are used by the configuration APIs to interact with EventPipe.
+ //
+ [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
+ [SuppressUnmanagedCodeSecurity]
+ internal static extern void Enable(string outputFile, uint circularBufferSizeInMB, long profilerSamplingRateInNanoseconds, EventPipeProviderConfiguration[] providers, int numProviders);
+
+ [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
+ [SuppressUnmanagedCodeSecurity]
+ internal static extern void Disable();
+
+ //
+ // These PInvokes are used by EventSource to interact with the EventPipe.
+ //
+ [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
+ [SuppressUnmanagedCodeSecurity]
+ internal static extern IntPtr CreateProvider(Guid providerID, UnsafeNativeMethods.ManifestEtw.EtwEnableCallback callbackFunc);
+
+ [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
+ [SuppressUnmanagedCodeSecurity]
+ internal static extern unsafe IntPtr DefineEvent(IntPtr provHandle, uint eventID, Int64 keywords, uint eventVersion, uint level, void *pMetadata, uint metadataLength);
+
+ [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
+ [SuppressUnmanagedCodeSecurity]
+ internal static extern void DeleteProvider(IntPtr provHandle);
+
+ [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
+ [SuppressUnmanagedCodeSecurity]
+ internal static extern unsafe void WriteEvent(IntPtr eventHandle, uint eventID, void* pData, uint length, Guid* activityId, Guid* relatedActivityId);
+ }
+}
diff --git a/src/mscorlib/src/System/Diagnostics/Eventing/EventPipeEventProvider.cs b/src/mscorlib/src/System/Diagnostics/Eventing/EventPipeEventProvider.cs
new file mode 100644
index 0000000000..d5bc4c2889
--- /dev/null
+++ b/src/mscorlib/src/System/Diagnostics/Eventing/EventPipeEventProvider.cs
@@ -0,0 +1,116 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+using System.Collections.Concurrent;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Security;
+using Microsoft.Win32;
+using System.Diagnostics;
+using System.Collections.Generic;
+
+namespace System.Diagnostics.Tracing
+{
+ internal sealed class EventPipeEventProvider : IEventProvider
+ {
+ // The EventPipeProvider handle.
+ private IntPtr m_provHandle = IntPtr.Zero;
+
+ // Register an event provider.
+ unsafe uint IEventProvider.EventRegister(
+ ref Guid providerId,
+ UnsafeNativeMethods.ManifestEtw.EtwEnableCallback enableCallback,
+ void* callbackContext,
+ ref long registrationHandle)
+ {
+ uint returnStatus = 0;
+ m_provHandle = EventPipeInternal.CreateProvider(providerId, enableCallback);
+ if(m_provHandle != IntPtr.Zero)
+ {
+ // Fixed registration handle because a new EventPipeEventProvider
+ // will be created for each new EventSource.
+ registrationHandle = 1;
+ }
+ else
+ {
+ // Unable to create the provider.
+ returnStatus = 1;
+ }
+
+ return returnStatus;
+ }
+
+ // Unregister an event provider.
+ uint IEventProvider.EventUnregister(long registrationHandle)
+ {
+ EventPipeInternal.DeleteProvider(m_provHandle);
+ return 0;
+ }
+
+ // Write an event.
+ unsafe int IEventProvider.EventWriteTransferWrapper(
+ long registrationHandle,
+ ref EventDescriptor eventDescriptor,
+ IntPtr eventHandle,
+ Guid* activityId,
+ Guid* relatedActivityId,
+ int userDataCount,
+ EventProvider.EventData* userData)
+ {
+ uint eventID = (uint)eventDescriptor.EventId;
+ if(eventID != 0 && eventHandle != IntPtr.Zero)
+ {
+ if (userDataCount == 0)
+ {
+ EventPipeInternal.WriteEvent(eventHandle, eventID, null, 0, activityId, relatedActivityId);
+ return 0;
+ }
+
+ uint length = 0;
+ for (int i = 0; i < userDataCount; i++)
+ {
+ length += userData[i].Size;
+ }
+
+ byte[] data = new byte[length];
+ fixed (byte *pData = data)
+ {
+ uint offset = 0;
+ for (int i = 0; i < userDataCount; i++)
+ {
+ byte * singleUserDataPtr = (byte *)(userData[i].Ptr);
+ uint singleUserDataSize = userData[i].Size;
+ WriteToBuffer(pData, length, ref offset, singleUserDataPtr, singleUserDataSize);
+ }
+ EventPipeInternal.WriteEvent(eventHandle, eventID, pData, length, activityId, relatedActivityId);
+ }
+ }
+ return 0;
+ }
+
+ // Get or set the per-thread activity ID.
+ int IEventProvider.EventActivityIdControl(UnsafeNativeMethods.ManifestEtw.ActivityControl ControlCode, ref Guid ActivityId)
+ {
+ return 0;
+ }
+
+ // Define an EventPipeEvent handle.
+ unsafe IntPtr IEventProvider.DefineEventHandle(uint eventID, string eventName, Int64 keywords, uint eventVersion, uint level, byte *pMetadata, uint metadataLength)
+ {
+ IntPtr eventHandlePtr = EventPipeInternal.DefineEvent(m_provHandle, eventID, keywords, eventVersion, level, pMetadata, metadataLength);
+ return eventHandlePtr;
+ }
+
+ // Copy src to buffer and modify the offset.
+ // Note: We know the buffer size ahead of time to make sure no buffer overflow.
+ private static unsafe void WriteToBuffer(byte *buffer, uint bufferLength, ref uint offset, byte *src, uint srcLength)
+ {
+ Debug.Assert(bufferLength >= (offset + srcLength));
+ for (int i = 0; i < srcLength; i++)
+ {
+ *(byte *)(buffer + offset + i) = *(byte *)(src + i);
+ }
+ offset += srcLength;
+ }
+ }
+}
diff --git a/src/mscorlib/src/System/Diagnostics/Eventing/EventSource_CoreCLR.cs b/src/mscorlib/src/System/Diagnostics/Eventing/EventSource_CoreCLR.cs
index b691dd38b9..01aac72cf6 100644
--- a/src/mscorlib/src/System/Diagnostics/Eventing/EventSource_CoreCLR.cs
+++ b/src/mscorlib/src/System/Diagnostics/Eventing/EventSource_CoreCLR.cs
@@ -11,6 +11,13 @@ namespace System.Diagnostics.Tracing
{
public partial class EventSource
{
+#if FEATURE_MANAGED_ETW && FEATURE_PERFTRACING
+ // For non-Windows, we use a thread-local variable to hold the activity ID.
+ // On Windows, ETW has it's own thread-local variable and we participate in its use.
+ [ThreadStatic]
+ private static Guid s_currentThreadActivityId;
+#endif // FEATURE_MANAGED_ETW && FEATURE_PERFTRACING
+
// ActivityID support (see also WriteEventWithRelatedActivityIdCore)
/// <summary>
/// When a thread starts work that is on behalf of 'something else' (typically another
@@ -40,9 +47,13 @@ namespace System.Diagnostics.Tracing
// We ignore errors to keep with the convention that EventSources do not throw errors.
// Note we can't access m_throwOnWrites because this is a static method.
+#if FEATURE_PERFTRACING
+ s_currentThreadActivityId = activityId;
+#elif PLATFORM_WINDOWS
if (UnsafeNativeMethods.ManifestEtw.EventActivityIdControl(
UnsafeNativeMethods.ManifestEtw.ActivityControl.EVENT_ACTIVITY_CTRL_GET_SET_ID,
ref activityId) == 0)
+#endif // FEATURE_PERFTRACING
{
#if FEATURE_ACTIVITYSAMPLING
var activityDying = s_activityDying;
@@ -86,9 +97,14 @@ namespace System.Diagnostics.Tracing
// We ignore errors to keep with the convention that EventSources do not throw errors.
// Note we can't access m_throwOnWrites because this is a static method.
+#if FEATURE_PERFTRACING
+ oldActivityThatWillContinue = s_currentThreadActivityId;
+ s_currentThreadActivityId = activityId;
+#elif PLATFORM_WINDOWS
UnsafeNativeMethods.ManifestEtw.EventActivityIdControl(
UnsafeNativeMethods.ManifestEtw.ActivityControl.EVENT_ACTIVITY_CTRL_GET_SET_ID,
ref oldActivityThatWillContinue);
+#endif // FEATURE_PERFTRACING
#endif // FEATURE_MANAGED_ETW
// We don't call the activityDying callback here because the caller has declared that
@@ -108,9 +124,13 @@ namespace System.Diagnostics.Tracing
// errors. Note we can't access m_throwOnWrites because this is a static method.
Guid retVal = new Guid();
#if FEATURE_MANAGED_ETW
+#if FEATURE_PERFTRACING
+ retVal = s_currentThreadActivityId;
+#elif PLATFORM_WINDOWS
UnsafeNativeMethods.ManifestEtw.EventActivityIdControl(
UnsafeNativeMethods.ManifestEtw.ActivityControl.EVENT_ACTIVITY_CTRL_GET_ID,
ref retVal);
+#endif // FEATURE_PERFTRACING
#endif // FEATURE_MANAGED_ETW
return retVal;
}
diff --git a/src/mscorlib/src/System/Diagnostics/LogSwitch.cs b/src/mscorlib/src/System/Diagnostics/LogSwitch.cs
index 29d6a1d4e6..d3994d48b8 100644
--- a/src/mscorlib/src/System/Diagnostics/LogSwitch.cs
+++ b/src/mscorlib/src/System/Diagnostics/LogSwitch.cs
@@ -11,7 +11,6 @@ using System.Diagnostics.CodeAnalysis;
namespace System.Diagnostics
{
- [Serializable]
internal class LogSwitch
{
// ! WARNING !
diff --git a/src/mscorlib/src/System/Diagnostics/LoggingLevels.cs b/src/mscorlib/src/System/Diagnostics/LoggingLevels.cs
index 6b5ea85ee1..22d6c95a97 100644
--- a/src/mscorlib/src/System/Diagnostics/LoggingLevels.cs
+++ b/src/mscorlib/src/System/Diagnostics/LoggingLevels.cs
@@ -21,7 +21,6 @@ namespace System.Diagnostics
// Constants representing the importance level of messages to be logged.
// This level can be used to organize messages, and also to filter which
// messages are displayed.
- [Serializable]
internal enum LoggingLevels
{
TraceLevel0 = 0,
diff --git a/src/mscorlib/src/System/Diagnostics/Stackframe.cs b/src/mscorlib/src/System/Diagnostics/Stackframe.cs
index b555a609e7..a6a7067af3 100644
--- a/src/mscorlib/src/System/Diagnostics/Stackframe.cs
+++ b/src/mscorlib/src/System/Diagnostics/Stackframe.cs
@@ -12,7 +12,6 @@ using System.Diagnostics.Contracts;
namespace System.Diagnostics
{
// There is no good reason for the methods of this class to be virtual.
- [Serializable]
public class StackFrame
{
private MethodBase method;
diff --git a/src/mscorlib/src/System/Diagnostics/Stacktrace.cs b/src/mscorlib/src/System/Diagnostics/Stacktrace.cs
index cdedb66ed8..6a138de327 100644
--- a/src/mscorlib/src/System/Diagnostics/Stacktrace.cs
+++ b/src/mscorlib/src/System/Diagnostics/Stacktrace.cs
@@ -22,7 +22,6 @@ namespace System.Diagnostics
// Modifying the order or fields of this object may require other changes
// to the unmanaged definition of the StackFrameHelper class, in
// VM\DebugDebugger.h. The binder will catch some of these layout problems.
- [Serializable]
internal class StackFrameHelper : IDisposable
{
[NonSerialized]
@@ -251,7 +250,6 @@ namespace System.Diagnostics
// In order to ensure trusted code can trust the data it gets from a
// StackTrace, we use an InheritanceDemand to prevent partially-trusted
// subclasses.
- [Serializable]
public class StackTrace
{
private StackFrame[] frames;
diff --git a/src/mscorlib/src/System/Diagnostics/SymbolStore/SymAddressKind.cs b/src/mscorlib/src/System/Diagnostics/SymbolStore/SymAddressKind.cs
index c4c1ede525..15b3c7f4f7 100644
--- a/src/mscorlib/src/System/Diagnostics/SymbolStore/SymAddressKind.cs
+++ b/src/mscorlib/src/System/Diagnostics/SymbolStore/SymAddressKind.cs
@@ -17,7 +17,6 @@ using System;
namespace System.Diagnostics.SymbolStore
{
- [Serializable]
internal enum SymAddressKind
{
// ILOffset: addr1 = IL local var or param index.
diff --git a/src/mscorlib/src/System/Diagnostics/log.cs b/src/mscorlib/src/System/Diagnostics/log.cs
index b62ea493e7..5ed3a3e502 100644
--- a/src/mscorlib/src/System/Diagnostics/log.cs
+++ b/src/mscorlib/src/System/Diagnostics/log.cs
@@ -4,7 +4,6 @@
namespace System.Diagnostics
{
- using System.Runtime.Remoting;
using System;
using System.IO;
using System.Collections;
@@ -20,7 +19,6 @@ namespace System.Diagnostics
// NOTE: These are NOT triggered when the log switch setting is changed from the
// attached debugger.
//
- [Serializable]
internal delegate void LogSwitchLevelHandler(LogSwitch ls, LoggingLevels newLevel);
diff --git a/src/mscorlib/src/System/Double.cs b/src/mscorlib/src/System/Double.cs
index f2c5cec219..30fa1a58b3 100644
--- a/src/mscorlib/src/System/Double.cs
+++ b/src/mscorlib/src/System/Double.cs
@@ -26,7 +26,7 @@ namespace System
public struct Double : IComparable, IFormattable, IConvertible
, IComparable<Double>, IEquatable<Double>
{
- internal double m_value;
+ private double m_value; // Do not rename (binary serialization)
//
// Public Constants
diff --git a/src/mscorlib/src/System/Empty.cs b/src/mscorlib/src/System/Empty.cs
index 502e8dfea7..2b585b3141 100644
--- a/src/mscorlib/src/System/Empty.cs
+++ b/src/mscorlib/src/System/Empty.cs
@@ -9,12 +9,10 @@
using System.Diagnostics.Contracts;
using System;
-using System.Runtime.Remoting;
using System.Runtime.Serialization;
namespace System
{
- [Serializable]
internal sealed class Empty : ISerializable
{
private Empty()
@@ -30,12 +28,7 @@ namespace System
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
- if (info == null)
- {
- throw new ArgumentNullException(nameof(info));
- }
- Contract.EndContractBlock();
- UnitySerializationHolder.GetUnitySerializationInfo(info, UnitySerializationHolder.EmptyUnity, null, null);
+ throw new PlatformNotSupportedException();
}
}
}
diff --git a/src/mscorlib/src/System/Environment.cs b/src/mscorlib/src/System/Environment.cs
index dddbdc242d..257deb27eb 100644
--- a/src/mscorlib/src/System/Environment.cs
+++ b/src/mscorlib/src/System/Environment.cs
@@ -77,9 +77,6 @@ namespace System
}
}
-
- private static volatile OperatingSystem m_os; // Cached OperatingSystem value
-
/*==================================TickCount===================================
**Action: Gets the number of ticks since the system was started.
**Returns: The number of ticks since the system was started.
diff --git a/src/mscorlib/src/System/Exception.cs b/src/mscorlib/src/System/Exception.cs
index 263b6b3c65..8d01b4c461 100644
--- a/src/mscorlib/src/System/Exception.cs
+++ b/src/mscorlib/src/System/Exception.cs
@@ -83,8 +83,7 @@ namespace System
_stackTraceString = info.GetString("StackTraceString");
_remoteStackTraceString = info.GetString("RemoteStackTraceString");
_remoteStackIndex = info.GetInt32("RemoteStackIndex");
-
- _exceptionMethodString = (String)(info.GetValue("ExceptionMethod", typeof(String)));
+
HResult = info.GetInt32("HResult");
_source = info.GetString("Source");
@@ -293,15 +292,8 @@ namespace System
{
return null;
}
-
- if (_exceptionMethodString != null)
- {
- _exceptionMethod = GetExceptionMethodFromString();
- }
- else
- {
- _exceptionMethod = GetExceptionMethodFromStackTrace();
- }
+
+ _exceptionMethod = GetExceptionMethodFromStackTrace();
return _exceptionMethod;
}
@@ -434,90 +426,6 @@ namespace System
return s;
}
- private String GetExceptionMethodString()
- {
- MethodBase methBase = GetTargetSiteInternal();
- if (methBase == null)
- {
- return null;
- }
- if (methBase is System.Reflection.Emit.DynamicMethod.RTDynamicMethod)
- {
- // DynamicMethods cannot be serialized
- return null;
- }
-
- // Note that the newline separator is only a separator, chosen such that
- // it won't (generally) occur in a method name. This string is used
- // only for serialization of the Exception Method.
- char separator = '\n';
- StringBuilder result = new StringBuilder();
- if (methBase is ConstructorInfo)
- {
- RuntimeConstructorInfo rci = (RuntimeConstructorInfo)methBase;
- Type t = rci.ReflectedType;
- result.Append((int)MemberTypes.Constructor);
- result.Append(separator);
- result.Append(rci.Name);
- if (t != null)
- {
- result.Append(separator);
- result.Append(t.Assembly.FullName);
- result.Append(separator);
- result.Append(t.FullName);
- }
- result.Append(separator);
- result.Append(rci.ToString());
- }
- else
- {
- Debug.Assert(methBase is MethodInfo, "[Exception.GetExceptionMethodString]methBase is MethodInfo");
- RuntimeMethodInfo rmi = (RuntimeMethodInfo)methBase;
- Type t = rmi.DeclaringType;
- result.Append((int)MemberTypes.Method);
- result.Append(separator);
- result.Append(rmi.Name);
- result.Append(separator);
- result.Append(rmi.Module.Assembly.FullName);
- result.Append(separator);
- if (t != null)
- {
- result.Append(t.FullName);
- result.Append(separator);
- }
- result.Append(rmi.ToString());
- }
-
- return result.ToString();
- }
-
- private MethodBase GetExceptionMethodFromString()
- {
- Debug.Assert(_exceptionMethodString != null, "Method string cannot be NULL!");
- String[] args = _exceptionMethodString.Split(new char[] { '\0', '\n' });
- if (args.Length != 5)
- {
- throw new SerializationException();
- }
- SerializationInfo si = new SerializationInfo(typeof(MemberInfoSerializationHolder), new FormatterConverter());
- si.AddValue("MemberType", (int)Int32.Parse(args[0], CultureInfo.InvariantCulture), typeof(Int32));
- si.AddValue("Name", args[1], typeof(String));
- si.AddValue("AssemblyName", args[2], typeof(String));
- si.AddValue("ClassName", args[3]);
- si.AddValue("Signature", args[4]);
- MethodBase result;
- StreamingContext sc = new StreamingContext(StreamingContextStates.All);
- try
- {
- result = (MethodBase)new MemberInfoSerializationHolder(si, sc).GetRealObject(sc);
- }
- catch (SerializationException)
- {
- result = null;
- }
- return result;
- }
-
protected event EventHandler<SafeSerializationEventArgs> SerializeObjectState
{
add { throw new PlatformNotSupportedException(SR.PlatformNotSupported_SecureBinarySerialization); }
@@ -559,7 +467,7 @@ namespace System
info.AddValue("StackTraceString", tempStackTraceString, typeof(String));
info.AddValue("RemoteStackTraceString", _remoteStackTraceString, typeof(String));
info.AddValue("RemoteStackIndex", _remoteStackIndex, typeof(Int32));
- info.AddValue("ExceptionMethod", GetExceptionMethodString(), typeof(String));
+ info.AddValue("ExceptionMethod", null, typeof(String));
info.AddValue("HResult", HResult);
info.AddValue("Source", _source, typeof(String));
@@ -748,7 +656,7 @@ namespace System
private String _className; //Needed for serialization.
private MethodBase _exceptionMethod; //Needed for serialization.
- private String _exceptionMethodString; //Needed for serialization.
+ private String _exceptionMethodString; //Needed for serialization.
internal String _message;
private IDictionary _data;
private Exception _innerException;
diff --git a/src/mscorlib/src/System/GC.cs b/src/mscorlib/src/System/GC.cs
index aeb0ca5196..11ae8bf32e 100644
--- a/src/mscorlib/src/System/GC.cs
+++ b/src/mscorlib/src/System/GC.cs
@@ -28,7 +28,6 @@ using System.Diagnostics.Contracts;
namespace System
{
- [Serializable]
public enum GCCollectionMode
{
Default = 0,
@@ -39,7 +38,6 @@ namespace System
// !!!!!!!!!!!!!!!!!!!!!!!
// make sure you change the def in vm\gc.h
// if you change this!
- [Serializable]
internal enum InternalGCCollectionMode
{
NonBlocking = 0x00000001,
@@ -51,7 +49,6 @@ namespace System
// !!!!!!!!!!!!!!!!!!!!!!!
// make sure you change the def in vm\gc.h
// if you change this!
- [Serializable]
public enum GCNotificationStatus
{
Succeeded = 0,
diff --git a/src/mscorlib/src/System/Globalization/BidiCategory.cs b/src/mscorlib/src/System/Globalization/BidiCategory.cs
index f37c44b385..9d767c673b 100644
--- a/src/mscorlib/src/System/Globalization/BidiCategory.cs
+++ b/src/mscorlib/src/System/Globalization/BidiCategory.cs
@@ -12,7 +12,6 @@
namespace System.Globalization
{
- [Serializable]
internal enum BidiCategory
{
LeftToRight = 0,
diff --git a/src/mscorlib/src/System/Globalization/Calendar.cs b/src/mscorlib/src/System/Globalization/Calendar.cs
index c23e1088c1..86782c1f3b 100644
--- a/src/mscorlib/src/System/Globalization/Calendar.cs
+++ b/src/mscorlib/src/System/Globalization/Calendar.cs
@@ -28,7 +28,6 @@ namespace System.Globalization
// The calculation of hour/minute/second is moved to Calendar from GregorianCalendar,
// since most of the calendars (or all?) have the same way of calcuating hour/minute/second.
- [Serializable]
public abstract partial class Calendar : ICloneable
{
// Number of 100ns (10E-7 second) ticks per time unit
diff --git a/src/mscorlib/src/System/Globalization/CalendarData.Windows.cs b/src/mscorlib/src/System/Globalization/CalendarData.Windows.cs
index 51a2727c7d..89de24d9d7 100644
--- a/src/mscorlib/src/System/Globalization/CalendarData.Windows.cs
+++ b/src/mscorlib/src/System/Globalization/CalendarData.Windows.cs
@@ -157,20 +157,9 @@ namespace System.Globalization
}
}
- GCHandle contextHandle = GCHandle.Alloc(data);
- try
- {
- // Now call the enumeration API. Work is done by our callback function
-#if CORECLR
- Interop.Kernel32.EnumCalendarInfoExEx(EnumCalendarsCallback, localeName, ENUM_ALL_CALENDARS, null, CAL_ICALINTVALUE, (IntPtr)contextHandle);
-#else
- IntPtr callback = AddrofIntrinsics.AddrOf<Func<IntPtr, uint, IntPtr, IntPtr, Interop.BOOL>>(EnumCalendarsCallback);
- Interop.Kernel32.EnumCalendarInfoExEx(callback, localeName, ENUM_ALL_CALENDARS, null, CAL_ICALINTVALUE, (IntPtr)contextHandle);
-#endif
- }
- finally
+ unsafe
{
- contextHandle.Free();
+ Interop.Kernel32.EnumCalendarInfoExEx(EnumCalendarsCallback, localeName, ENUM_ALL_CALENDARS, null, CAL_ICALINTVALUE, Unsafe.AsPointer(ref data));
}
// Copy to the output array
@@ -300,15 +289,13 @@ namespace System.Globalization
}
// EnumCalendarInfoExEx callback itself.
-#if !CORECLR
- [NativeCallable(CallingConvention = CallingConvention.StdCall)]
-#endif
- private static unsafe Interop.BOOL EnumCalendarInfoCallback(IntPtr lpCalendarInfoString, uint calendar, IntPtr pReserved, IntPtr lParam)
+ // [NativeCallable(CallingConvention = CallingConvention.StdCall)]
+ private static unsafe Interop.BOOL EnumCalendarInfoCallback(char* lpCalendarInfoString, uint calendar, IntPtr pReserved, void* lParam)
{
- EnumData context = (EnumData)((GCHandle)lParam).Target;
+ ref EnumData context = ref Unsafe.As<byte, EnumData>(ref *(byte*)lParam);
try
{
- string calendarInfo = new string((char*)lpCalendarInfoString);
+ string calendarInfo = new string(lpCalendarInfoString);
// If we had a user override, check to make sure this differs
if (context.userOverride != calendarInfo)
@@ -343,7 +330,7 @@ namespace System.Globalization
string res = CultureData.GetLocaleInfoEx(localeName, lcType);
// if it succeeded remember the override for the later callers
- if (res != "")
+ if (res != null)
{
// Remember this was the override (so we can look for duplicates later in the enum function)
context.userOverride = res;
@@ -354,20 +341,10 @@ namespace System.Globalization
}
}
- GCHandle contextHandle = GCHandle.Alloc(context);
- try
+ unsafe
{
-#if CORECLR
- Interop.Kernel32.EnumCalendarInfoExEx(EnumCalendarInfoCallback, localeName, (uint)calendar, null, calType, (IntPtr)contextHandle);
-#else
// Now call the enumeration API. Work is done by our callback function
- IntPtr callback = AddrofIntrinsics.AddrOf<Func<IntPtr, uint, IntPtr, IntPtr, Interop.BOOL>>(EnumCalendarInfoCallback);
- Interop.Kernel32.EnumCalendarInfoExEx(callback, localeName, (uint)calendar, null, calType, (IntPtr)contextHandle);
-#endif // CORECLR
- }
- finally
- {
- contextHandle.Free();
+ Interop.Kernel32.EnumCalendarInfoExEx(EnumCalendarInfoCallback, localeName, (uint)calendar, null, calType, Unsafe.AsPointer(ref context));
}
// Now we have a list of data, fail if we didn't find anything.
@@ -464,12 +441,10 @@ namespace System.Globalization
public IntList calendars; // list of calendars found so far
}
-#if !CORECLR
- [NativeCallable(CallingConvention = CallingConvention.StdCall)]
-#endif
- private static Interop.BOOL EnumCalendarsCallback(IntPtr lpCalendarInfoString, uint calendar, IntPtr reserved, IntPtr lParam)
+ // [NativeCallable(CallingConvention = CallingConvention.StdCall)]
+ private static unsafe Interop.BOOL EnumCalendarsCallback(char* lpCalendarInfoString, uint calendar, IntPtr reserved, void* lParam)
{
- EnumCalendarsData context = (EnumCalendarsData)((GCHandle)lParam).Target;
+ ref EnumCalendarsData context = ref Unsafe.As<byte, EnumCalendarsData>(ref *(byte*)lParam);
try
{
// If we had a user override, check to make sure this differs
diff --git a/src/mscorlib/src/System/Globalization/CompareInfo.Windows.cs b/src/mscorlib/src/System/Globalization/CompareInfo.Windows.cs
index d20bb9f9f3..eb4dc5613e 100644
--- a/src/mscorlib/src/System/Globalization/CompareInfo.Windows.cs
+++ b/src/mscorlib/src/System/Globalization/CompareInfo.Windows.cs
@@ -16,7 +16,7 @@ namespace System.Globalization
{
_sortName = culture.SortName;
- _name = culture._name;
+ m_name = culture._name;
_sortName = culture.SortName;
if (_invariantMode)
@@ -199,7 +199,7 @@ namespace System.Globalization
{
if (matchLengthPtr != null)
*matchLengthPtr = 0;
- return 0;
+ return startIndex;
}
if (source.Length == 0)
diff --git a/src/mscorlib/src/System/Globalization/CompareInfo.cs b/src/mscorlib/src/System/Globalization/CompareInfo.cs
index b2c2208db7..593e86415d 100644
--- a/src/mscorlib/src/System/Globalization/CompareInfo.cs
+++ b/src/mscorlib/src/System/Globalization/CompareInfo.cs
@@ -20,7 +20,6 @@ using System.Runtime.Serialization;
namespace System.Globalization
{
[Flags]
- [Serializable]
public enum CompareOptions
{
None = 0x00000000,
@@ -64,20 +63,21 @@ namespace System.Globalization
// locale, which is what SCOMPAREINFO does.
[OptionalField(VersionAdded = 2)]
- private string _name; // The name used to construct this CompareInfo
- [NonSerialized]
- private string _sortName; // The name that defines our behavior
+ private string m_name; // The name used to construct this CompareInfo. Do not rename (binary serialization)
+
+ [NonSerialized]
+ private string _sortName; // The name that defines our behavior.
[OptionalField(VersionAdded = 3)]
- private SortVersion _sortVersion;
+ private SortVersion m_sortVersion; // Do not rename (binary serialization)
// _invariantMode is defined for the perf reason as accessing the instance field is faster than access the static property GlobalizationMode.Invariant
- [NonSerialized]
+ [NonSerialized]
private readonly bool _invariantMode = GlobalizationMode.Invariant;
internal CompareInfo(CultureInfo culture)
{
- _name = culture._name;
+ m_name = culture._name;
InitSort(culture);
}
@@ -217,7 +217,7 @@ namespace System.Globalization
[OnDeserializing]
private void OnDeserializing(StreamingContext ctx)
{
- _name = null;
+ m_name = null;
}
void IDeserializationCallback.OnDeserialization(Object sender)
@@ -233,9 +233,9 @@ namespace System.Globalization
private void OnDeserialized()
{
- if (_name != null)
+ if (m_name != null)
{
- InitSort(CultureInfo.GetCultureInfo(_name));
+ InitSort(CultureInfo.GetCultureInfo(m_name));
}
}
@@ -259,10 +259,10 @@ namespace System.Globalization
{
get
{
- Debug.Assert(_name != null, "CompareInfo.Name Expected _name to be set");
- if (_name == "zh-CHT" || _name == "zh-CHS")
+ Debug.Assert(m_name != null, "CompareInfo.Name Expected _name to be set");
+ if (m_name == "zh-CHT" || m_name == "zh-CHS")
{
- return _name;
+ return m_name;
}
return _sortName;
@@ -1208,11 +1208,11 @@ namespace System.Globalization
{
get
{
- if (_sortVersion == null)
+ if (m_sortVersion == null)
{
if (_invariantMode)
{
- _sortVersion = new SortVersion(0, CultureInfo.LOCALE_INVARIANT, new Guid(0, 0, 0, 0, 0, 0, 0,
+ m_sortVersion = new SortVersion(0, CultureInfo.LOCALE_INVARIANT, new Guid(0, 0, 0, 0, 0, 0, 0,
(byte) (CultureInfo.LOCALE_INVARIANT >> 24),
(byte) ((CultureInfo.LOCALE_INVARIANT & 0x00FF0000) >> 16),
(byte) ((CultureInfo.LOCALE_INVARIANT & 0x0000FF00) >> 8),
@@ -1220,11 +1220,11 @@ namespace System.Globalization
}
else
{
- _sortVersion = GetSortVersion();
+ m_sortVersion = GetSortVersion();
}
}
- return _sortVersion;
+ return m_sortVersion;
}
}
diff --git a/src/mscorlib/src/System/Globalization/CultureData.Windows.cs b/src/mscorlib/src/System/Globalization/CultureData.Windows.cs
index 6d2678b550..c39327e9e7 100644
--- a/src/mscorlib/src/System/Globalization/CultureData.Windows.cs
+++ b/src/mscorlib/src/System/Globalization/CultureData.Windows.cs
@@ -4,6 +4,7 @@
using System.Collections.Generic;
using System.Diagnostics;
+using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
@@ -179,7 +180,7 @@ namespace System.Globalization
return new String(pBuffer);
}
- return "";
+ return null;
}
internal static unsafe int GetLocaleInfoExInt(String localeName, uint field)
@@ -195,7 +196,7 @@ namespace System.Globalization
{
Debug.Assert(!GlobalizationMode.Invariant);
- return Interop.Kernel32.GetLocaleInfoEx(lpLocaleName, lcType, (IntPtr)lpLCData, cchData);
+ return Interop.Kernel32.GetLocaleInfoEx(lpLocaleName, lcType, lpLCData, cchData);
}
private string GetLocaleInfo(LocaleStringData type)
@@ -284,19 +285,9 @@ namespace System.Globalization
context.cultureName = null;
context.regionName = regionName;
- GCHandle contextHandle = GCHandle.Alloc(context);
- try
+ unsafe
{
-#if CORECLR
- Interop.Kernel32.EnumSystemLocalesEx(EnumSystemLocalesProc, LOCALE_SPECIFICDATA | LOCALE_SUPPLEMENTAL, (IntPtr)contextHandle, IntPtr.Zero);
-#else
- IntPtr callback = AddrofIntrinsics.AddrOf<Func<IntPtr, uint, IntPtr, Interop.BOOL>>(EnumSystemLocalesProc);
- Interop.Kernel32.EnumSystemLocalesEx(callback, LOCALE_SPECIFICDATA | LOCALE_SUPPLEMENTAL, (IntPtr)contextHandle, IntPtr.Zero);
-#endif
- }
- finally
- {
- contextHandle.Free();
+ Interop.Kernel32.EnumSystemLocalesEx(EnumSystemLocalesProc, LOCALE_SPECIFICDATA | LOCALE_SUPPLEMENTAL, Unsafe.AsPointer(ref context), IntPtr.Zero);
}
if (context.cultureName != null)
@@ -543,15 +534,13 @@ namespace System.Globalization
}
// EnumSystemLocaleEx callback.
-#if !CORECLR
- [NativeCallable(CallingConvention = CallingConvention.StdCall)]
-#endif
- private static unsafe Interop.BOOL EnumSystemLocalesProc(IntPtr lpLocaleString, uint flags, IntPtr contextHandle)
+ // [NativeCallable(CallingConvention = CallingConvention.StdCall)]
+ private static unsafe Interop.BOOL EnumSystemLocalesProc(char* lpLocaleString, uint flags, void* contextHandle)
{
- EnumLocaleData context = (EnumLocaleData)((GCHandle)contextHandle).Target;
+ ref EnumLocaleData context = ref Unsafe.As<byte, EnumLocaleData>(ref *(byte*)contextHandle);
try
{
- string cultureName = new string((char*)lpLocaleString);
+ string cultureName = new string(lpLocaleString);
string regionName = GetLocaleInfoEx(cultureName, LOCALE_SISO3166CTRYNAME);
if (regionName != null && regionName.Equals(context.regionName, StringComparison.OrdinalIgnoreCase))
{
@@ -568,15 +557,13 @@ namespace System.Globalization
}
// EnumSystemLocaleEx callback.
-#if !CORECLR
- [NativeCallable(CallingConvention = CallingConvention.StdCall)]
-#endif
- private static unsafe Interop.BOOL EnumAllSystemLocalesProc(IntPtr lpLocaleString, uint flags, IntPtr contextHandle)
+ // [NativeCallable(CallingConvention = CallingConvention.StdCall)]
+ private static unsafe Interop.BOOL EnumAllSystemLocalesProc(char* lpLocaleString, uint flags, void* contextHandle)
{
- EnumData context = (EnumData)((GCHandle)contextHandle).Target;
+ ref EnumData context = ref Unsafe.As<byte, EnumData>(ref *(byte*)contextHandle);
try
{
- context.strings.Add(new string((char*)lpLocaleString));
+ context.strings.Add(new string(lpLocaleString));
return Interop.BOOL.TRUE;
}
catch (Exception)
@@ -592,16 +579,13 @@ namespace System.Globalization
}
// EnumTimeFormatsEx callback itself.
-#if !CORECLR
- [NativeCallable(CallingConvention = CallingConvention.StdCall)]
-#endif
- private static unsafe Interop.BOOL EnumTimeCallback(IntPtr lpTimeFormatString, IntPtr lParam)
+ // [NativeCallable(CallingConvention = CallingConvention.StdCall)]
+ private static unsafe Interop.BOOL EnumTimeCallback(char* lpTimeFormatString, void* lParam)
{
- EnumData context = (EnumData)((GCHandle)lParam).Target;
-
+ ref EnumData context = ref Unsafe.As<byte, EnumData>(ref *(byte*)lParam);
try
{
- context.strings.Add(new string((char*)lpTimeFormatString));
+ context.strings.Add(new string(lpTimeFormatString));
return Interop.BOOL.TRUE;
}
catch (Exception)
@@ -617,21 +601,9 @@ namespace System.Globalization
EnumData data = new EnumData();
data.strings = new StringList();
- GCHandle dataHandle = GCHandle.Alloc(data);
- try
- {
-#if CORECLR
- Interop.Kernel32.EnumTimeFormatsEx(EnumTimeCallback, localeName, (uint)dwFlags, (IntPtr)dataHandle);
-#else
- // Now call the enumeration API. Work is done by our callback function
- IntPtr callback = AddrofIntrinsics.AddrOf<Func<IntPtr, IntPtr, Interop.BOOL>>(EnumTimeCallback);
- Interop.Kernel32.EnumTimeFormatsEx(callback, localeName, (uint)dwFlags, (IntPtr)dataHandle);
-#endif
- }
- finally
- {
- dataHandle.Free();
- }
+
+ // Now call the enumeration API. Work is done by our callback function
+ Interop.Kernel32.EnumTimeFormatsEx(EnumTimeCallback, localeName, (uint)dwFlags, Unsafe.AsPointer(ref data));
if (data.strings.Count > 0)
{
@@ -757,19 +729,10 @@ namespace System.Globalization
EnumData context = new EnumData();
context.strings = new StringList();
- GCHandle contextHandle = GCHandle.Alloc(context);
- try
- {
-#if CORECLR
- Interop.Kernel32.EnumSystemLocalesEx(EnumAllSystemLocalesProc, flags, (IntPtr)contextHandle, IntPtr.Zero);
-#else
- IntPtr callback = AddrofIntrinsics.AddrOf<Func<IntPtr, uint, IntPtr, Interop.BOOL>>(EnumAllSystemLocalesProc);
- Interop.Kernel32.EnumSystemLocalesEx(callback, flags, (IntPtr)contextHandle, IntPtr.Zero);
-#endif
- }
- finally
+
+ unsafe
{
- contextHandle.Free();
+ Interop.Kernel32.EnumSystemLocalesEx(EnumAllSystemLocalesProc, flags, Unsafe.AsPointer(ref context), IntPtr.Zero);
}
CultureInfo [] cultures = new CultureInfo[context.strings.Count];
@@ -802,19 +765,10 @@ namespace System.Globalization
{
EnumData context = new EnumData();
context.strings = new StringList();
- GCHandle contextHandle = GCHandle.Alloc(context);
- try
- {
-#if CORECLR
- Interop.Kernel32.EnumSystemLocalesEx(EnumAllSystemLocalesProc, Interop.Kernel32.LOCALE_REPLACEMENT, (IntPtr)contextHandle, IntPtr.Zero);
-#else
- IntPtr callback = AddrofIntrinsics.AddrOf<Func<IntPtr, uint, IntPtr, Interop.BOOL>>(EnumAllSystemLocalesProc);
- Interop.Kernel32.EnumSystemLocalesEx(callback, Interop.Kernel32.LOCALE_REPLACEMENT, (IntPtr)contextHandle, IntPtr.Zero);
-#endif
- }
- finally
+
+ unsafe
{
- contextHandle.Free();
+ Interop.Kernel32.EnumSystemLocalesEx(EnumAllSystemLocalesProc, Interop.Kernel32.LOCALE_REPLACEMENT, Unsafe.AsPointer(ref context), IntPtr.Zero);
}
for (int i=0; i<context.strings.Count; i++)
diff --git a/src/mscorlib/src/System/Globalization/CultureInfo.cs b/src/mscorlib/src/System/Globalization/CultureInfo.cs
index 60938defac..16e2d291a1 100644
--- a/src/mscorlib/src/System/Globalization/CultureInfo.cs
+++ b/src/mscorlib/src/System/Globalization/CultureInfo.cs
@@ -44,7 +44,6 @@ namespace System.Globalization
using StringLcidDictionary = LowLevelDictionary<int, CultureInfo>;
#endif
- [Serializable]
public partial class CultureInfo : IFormatProvider, ICloneable
{
//--------------------------------------------------------------------//
diff --git a/src/mscorlib/src/System/Globalization/EncodingDataItem.Unix.cs b/src/mscorlib/src/System/Globalization/EncodingDataItem.Unix.cs
index ffb2d46a9e..ccf9993453 100644
--- a/src/mscorlib/src/System/Globalization/EncodingDataItem.Unix.cs
+++ b/src/mscorlib/src/System/Globalization/EncodingDataItem.Unix.cs
@@ -4,7 +4,6 @@
namespace System.Globalization
{
- [Serializable]
internal class CodePageDataItem
{
private readonly int _codePage;
diff --git a/src/mscorlib/src/System/Globalization/EncodingDataItem.cs b/src/mscorlib/src/System/Globalization/EncodingDataItem.cs
index b049eaf45d..00081016c3 100644
--- a/src/mscorlib/src/System/Globalization/EncodingDataItem.cs
+++ b/src/mscorlib/src/System/Globalization/EncodingDataItem.cs
@@ -3,7 +3,6 @@
// See the LICENSE file in the project root for more information.
using System.Text;
-using System.Runtime.Remoting;
using System;
using System.Security;
@@ -18,7 +17,6 @@ namespace System.Globalization
// immediately because they don't require creating an object. Creating any of the string
// names is delayed until somebody actually asks for them and the names are then cached.
- [Serializable]
internal class CodePageDataItem
{
internal int m_dataIndex;
diff --git a/src/mscorlib/src/System/Globalization/GregorianCalendar.cs b/src/mscorlib/src/System/Globalization/GregorianCalendar.cs
index 6dbf5b2786..9115b12bd0 100644
--- a/src/mscorlib/src/System/Globalization/GregorianCalendar.cs
+++ b/src/mscorlib/src/System/Globalization/GregorianCalendar.cs
@@ -13,9 +13,6 @@ namespace System.Globalization
// This calendar recognizes two era values:
// 0 CurrentEra (AD)
// 1 BeforeCurrentEra (BC)
-
- [Serializable]
-
public class GregorianCalendar : Calendar
{
/*
diff --git a/src/mscorlib/src/System/Globalization/GregorianCalendarHelper.cs b/src/mscorlib/src/System/Globalization/GregorianCalendarHelper.cs
index bdc35f0734..1367e0d0ac 100644
--- a/src/mscorlib/src/System/Globalization/GregorianCalendarHelper.cs
+++ b/src/mscorlib/src/System/Globalization/GregorianCalendarHelper.cs
@@ -10,7 +10,6 @@ using System.Threading;
namespace System.Globalization
{
// Gregorian Calendars use Era Info
- [Serializable]
internal class EraInfo
{
internal int era; // The value of the era.
@@ -55,7 +54,6 @@ namespace System.Globalization
// This calendar recognizes two era values:
// 0 CurrentEra (AD)
// 1 BeforeCurrentEra (BC)
- [Serializable]
internal class GregorianCalendarHelper
{
// 1 tick = 100ns = 10E-7 second
diff --git a/src/mscorlib/src/System/Globalization/RegionInfo.cs b/src/mscorlib/src/System/Globalization/RegionInfo.cs
index c3d5e659ca..ab52002fdc 100644
--- a/src/mscorlib/src/System/Globalization/RegionInfo.cs
+++ b/src/mscorlib/src/System/Globalization/RegionInfo.cs
@@ -20,7 +20,6 @@ using System.Runtime.Serialization;
namespace System.Globalization
{
- [Serializable]
public class RegionInfo
{
//--------------------------------------------------------------------//
diff --git a/src/mscorlib/src/System/Globalization/TextElementEnumerator.cs b/src/mscorlib/src/System/Globalization/TextElementEnumerator.cs
index 464897b03f..a875b70463 100644
--- a/src/mscorlib/src/System/Globalization/TextElementEnumerator.cs
+++ b/src/mscorlib/src/System/Globalization/TextElementEnumerator.cs
@@ -20,7 +20,6 @@ namespace System.Globalization
// This is public because GetTextElement() is public.
//
- [Serializable]
public class TextElementEnumerator : IEnumerator
{
private String _str;
diff --git a/src/mscorlib/src/System/Globalization/TextInfo.cs b/src/mscorlib/src/System/Globalization/TextInfo.cs
index fecd2b2970..dd542579d9 100644
--- a/src/mscorlib/src/System/Globalization/TextInfo.cs
+++ b/src/mscorlib/src/System/Globalization/TextInfo.cs
@@ -19,7 +19,6 @@ using System.Text;
namespace System.Globalization
{
- [Serializable]
public partial class TextInfo : ICloneable, IDeserializationCallback
{
////--------------------------------------------------------------------//
@@ -93,38 +92,9 @@ namespace System.Globalization
FinishInitialization(_textInfoName);
}
- [OnSerializing]
- private void OnSerializing(StreamingContext ctx) { }
-
- [OnDeserializing]
- private void OnDeserializing(StreamingContext ctx)
- {
- // Clear these so we can check if we've fixed them yet
- _cultureData = null;
- _cultureName = null;
- }
-
- [OnDeserialized]
- private void OnDeserialized(StreamingContext ctx)
- {
- OnDeserialized();
- }
-
void IDeserializationCallback.OnDeserialization(Object sender)
{
- OnDeserialized();
- }
-
- private void OnDeserialized()
- {
- // this method will be called twice because of the support of IDeserializationCallback
- if (_cultureData == null)
- {
- // Get the text info name belonging to that culture
- _cultureData = CultureInfo.GetCultureInfo(_cultureName)._cultureData;
- _textInfoName = _cultureData.STEXTINFO;
- FinishInitialization(_textInfoName);
- }
+ throw new PlatformNotSupportedException();
}
//
diff --git a/src/mscorlib/src/System/IO/BinaryWriter.cs b/src/mscorlib/src/System/IO/BinaryWriter.cs
index 3d9839f46e..644226fa79 100644
--- a/src/mscorlib/src/System/IO/BinaryWriter.cs
+++ b/src/mscorlib/src/System/IO/BinaryWriter.cs
@@ -27,7 +27,6 @@ namespace System.IO
// primitives to an arbitrary stream. A subclass can override methods to
// give unique encodings.
//
- [Serializable]
public class BinaryWriter : IDisposable
{
public static readonly BinaryWriter Null = new BinaryWriter();
diff --git a/src/mscorlib/src/System/IO/DriveNotFoundException.cs b/src/mscorlib/src/System/IO/DriveNotFoundException.cs
index 27b6f9015d..7e9b0c9f36 100644
--- a/src/mscorlib/src/System/IO/DriveNotFoundException.cs
+++ b/src/mscorlib/src/System/IO/DriveNotFoundException.cs
@@ -17,7 +17,6 @@ using System.Runtime.Serialization;
namespace System.IO
{
//Thrown when trying to access a drive that is not availabe.
- [Serializable]
internal class DriveNotFoundException : IOException
{
public DriveNotFoundException()
@@ -34,6 +33,7 @@ namespace System.IO
protected DriveNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context)
{
+ throw new PlatformNotSupportedException();
}
}
}
diff --git a/src/mscorlib/src/System/IO/File.cs b/src/mscorlib/src/System/IO/File.cs
index 4aba1488ec..da962f6feb 100644
--- a/src/mscorlib/src/System/IO/File.cs
+++ b/src/mscorlib/src/System/IO/File.cs
@@ -150,13 +150,16 @@ namespace System.IO
// Remove trialing slash since this can cause grief to FindFirstFile. You will get an invalid argument error
String tempPath = path.TrimEnd(new char[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar });
+#if !PLATFORM_UNIX
// For floppy drives, normally the OS will pop up a dialog saying
// there is no disk in drive A:, please insert one. We don't want that.
- // SetErrorMode will let us disable this, but we should set the error
+ // SetThreadErrorMode will let us disable this, but we should set the error
// mode back, since this may have wide-ranging effects.
- int oldMode = Win32Native.SetErrorMode(Win32Native.SEM_FAILCRITICALERRORS);
+ uint oldMode;
+ bool errorModeSuccess = Interop.Kernel32.SetThreadErrorMode(Interop.Kernel32.SEM_FAILCRITICALERRORS, out oldMode);
try
{
+#endif
bool error = false;
SafeFindHandle handle = Win32Native.FindFirstFile(tempPath, findData);
try
@@ -197,31 +200,41 @@ namespace System.IO
}
}
}
+#if !PLATFORM_UNIX
}
finally
{
- Win32Native.SetErrorMode(oldMode);
+ if (errorModeSuccess)
+ Interop.Kernel32.SetThreadErrorMode(oldMode, out oldMode);
}
+#endif
// Copy the information to data
data.PopulateFrom(findData);
}
else
{
+ bool success = false;
+
+#if !PLATFORM_UNIX
// For floppy drives, normally the OS will pop up a dialog saying
// there is no disk in drive A:, please insert one. We don't want that.
- // SetErrorMode will let us disable this, but we should set the error
+ // SetThreadErrorMode will let us disable this, but we should set the error
// mode back, since this may have wide-ranging effects.
- bool success = false;
- int oldMode = Win32Native.SetErrorMode(Win32Native.SEM_FAILCRITICALERRORS);
+ uint oldMode;
+ bool errorModeSuccess = Interop.Kernel32.SetThreadErrorMode(Interop.Kernel32.SEM_FAILCRITICALERRORS, out oldMode);
try
{
+#endif
success = Win32Native.GetFileAttributesEx(path, GetFileExInfoStandard, ref data);
+#if !PLATFORM_UNIX
}
finally
{
- Win32Native.SetErrorMode(oldMode);
+ if (errorModeSuccess)
+ Interop.Kernel32.SetThreadErrorMode(oldMode, out oldMode);
}
+#endif
if (!success)
{
diff --git a/src/mscorlib/src/System/IO/FileLoadException.CoreCLR.cs b/src/mscorlib/src/System/IO/FileLoadException.CoreCLR.cs
index f6415670e3..d4ce9a9ab9 100644
--- a/src/mscorlib/src/System/IO/FileLoadException.CoreCLR.cs
+++ b/src/mscorlib/src/System/IO/FileLoadException.CoreCLR.cs
@@ -27,7 +27,10 @@ namespace System.IO
GetFileLoadExceptionMessage(hResult, JitHelpers.GetStringHandleOnStack(ref format));
string message = null;
- GetMessageForHR(hResult, JitHelpers.GetStringHandleOnStack(ref message));
+ if (hResult == System.__HResults.COR_E_BADEXEFORMAT)
+ message = SR.Arg_BadImageFormatException;
+ else
+ GetMessageForHR(hResult, JitHelpers.GetStringHandleOnStack(ref message));
return string.Format(CultureInfo.CurrentCulture, format, fileName, message);
}
diff --git a/src/mscorlib/src/System/IO/FileSystemEnumerable.cs b/src/mscorlib/src/System/IO/FileSystemEnumerable.cs
index 0316de0f93..5e19fbed36 100644
--- a/src/mscorlib/src/System/IO/FileSystemEnumerable.cs
+++ b/src/mscorlib/src/System/IO/FileSystemEnumerable.cs
@@ -146,8 +146,10 @@ namespace System.IO
private SearchOption searchOption;
private String fullPath;
private String normalizedSearchPath;
- private int oldMode;
-
+#if !PLATFORM_UNIX
+ private int _oldMode;
+ private bool _setBackOldMode;
+#endif
internal FileSystemEnumerableIterator(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler<TSource> resultHandler, bool checkHost)
{
Contract.Requires(path != null);
@@ -156,7 +158,9 @@ namespace System.IO
Contract.Requires(searchOption == SearchOption.AllDirectories || searchOption == SearchOption.TopDirectoryOnly);
Contract.Requires(resultHandler != null);
- oldMode = Win32Native.SetErrorMode(Win32Native.SEM_FAILCRITICALERRORS);
+#if !PLATFORM_UNIX
+ _setBackOldMode = Interop.Kernel32.SetThreadErrorMode(Interop.Kernel32.SEM_FAILCRITICALERRORS, out _oldMode);
+#endif
searchStack = new List<Directory.SearchData>();
@@ -284,7 +288,14 @@ namespace System.IO
}
finally
{
- Win32Native.SetErrorMode(oldMode);
+#if !PLATFORM_UNIX
+ if (_setBackOldMode)
+ {
+ uint _ignore;
+ Interop.Kernel32.SetThreadErrorMode(_oldMode, out _ignore);
+ }
+#endif
+
base.Dispose(disposing);
}
}
diff --git a/src/mscorlib/src/System/IO/IOException.cs b/src/mscorlib/src/System/IO/IOException.cs
index 2628f7b652..65504de863 100644
--- a/src/mscorlib/src/System/IO/IOException.cs
+++ b/src/mscorlib/src/System/IO/IOException.cs
@@ -18,7 +18,6 @@ using System.Runtime.Serialization;
namespace System.IO
{
- [Serializable]
public class IOException : SystemException
{
// For debugging purposes, store the complete path in the IOException
@@ -68,6 +67,7 @@ namespace System.IO
protected IOException(SerializationInfo info, StreamingContext context) : base(info, context)
{
+ throw new PlatformNotSupportedException();
}
}
}
diff --git a/src/mscorlib/src/System/IO/MemoryStream.cs b/src/mscorlib/src/System/IO/MemoryStream.cs
index 3d5668d774..daf09d1274 100644
--- a/src/mscorlib/src/System/IO/MemoryStream.cs
+++ b/src/mscorlib/src/System/IO/MemoryStream.cs
@@ -34,7 +34,6 @@ namespace System.IO
// from an unsigned byte array, or you can create an empty one. Empty
// memory streams are resizable, while ones created with a byte array provide
// a stream "view" of the data.
- [Serializable]
public class MemoryStream : Stream
{
private byte[] _buffer; // Either allocated internally or externally.
diff --git a/src/mscorlib/src/System/IO/SearchOption.cs b/src/mscorlib/src/System/IO/SearchOption.cs
index 75909d7499..c2f7e0db6e 100644
--- a/src/mscorlib/src/System/IO/SearchOption.cs
+++ b/src/mscorlib/src/System/IO/SearchOption.cs
@@ -20,7 +20,6 @@ using System;
namespace System.IO
{
- [Serializable]
internal enum SearchOption
{
// Include only the current directory in the search operation
diff --git a/src/mscorlib/src/System/IO/Stream.cs b/src/mscorlib/src/System/IO/Stream.cs
index 65cc4ddcb9..786dfedef9 100644
--- a/src/mscorlib/src/System/IO/Stream.cs
+++ b/src/mscorlib/src/System/IO/Stream.cs
@@ -30,7 +30,6 @@ using System.Reflection;
namespace System.IO
{
- [Serializable]
public abstract class Stream : MarshalByRefObject, IDisposable
{
public static readonly Stream Null = new NullStream();
@@ -854,7 +853,6 @@ namespace System.IO
SynchronousAsyncResult.EndWrite(asyncResult);
}
- [Serializable]
private sealed class NullStream : Stream
{
internal NullStream() { }
@@ -1093,7 +1091,6 @@ namespace System.IO
// SyncStream is a wrapper around a stream that takes
// a lock for every operation making it thread safe.
- [Serializable]
internal sealed class SyncStream : Stream, IDisposable
{
private Stream _stream;
diff --git a/src/mscorlib/src/System/IO/StreamReader.cs b/src/mscorlib/src/System/IO/StreamReader.cs
index dfb928c85d..1fc72bffd1 100644
--- a/src/mscorlib/src/System/IO/StreamReader.cs
+++ b/src/mscorlib/src/System/IO/StreamReader.cs
@@ -16,7 +16,6 @@ namespace System.IO
// This is designed for character input in a particular Encoding,
// whereas the Stream class is designed for byte input and output.
//
- [Serializable]
internal class StreamReader : TextReader
{
// StreamReader.Null is threadsafe.
diff --git a/src/mscorlib/src/System/IO/TextReader.cs b/src/mscorlib/src/System/IO/TextReader.cs
index 3da68591b0..2531778d6d 100644
--- a/src/mscorlib/src/System/IO/TextReader.cs
+++ b/src/mscorlib/src/System/IO/TextReader.cs
@@ -30,7 +30,6 @@ namespace System.IO {
//
// This class is intended for character input, not bytes.
// There are methods on the Stream class for reading bytes.
- [Serializable]
internal abstract class TextReader : MarshalByRefObject, IDisposable {
public static readonly TextReader Null = new NullTextReader();
@@ -263,7 +262,6 @@ namespace System.IO {
return new SyncTextReader(reader);
}
- [Serializable]
private sealed class NullTextReader : TextReader
{
public NullTextReader(){}
@@ -280,7 +278,6 @@ namespace System.IO {
}
}
- [Serializable]
internal sealed class SyncTextReader : TextReader
{
internal TextReader _in;
diff --git a/src/mscorlib/src/System/IO/__Error.cs b/src/mscorlib/src/System/IO/__Error.cs
index 70f83261ed..1af195ef77 100644
--- a/src/mscorlib/src/System/IO/__Error.cs
+++ b/src/mscorlib/src/System/IO/__Error.cs
@@ -206,11 +206,5 @@ namespace System.IO
{
throw new NotSupportedException(SR.NotSupported_UnwritableStream);
}
-
- // From WinError.h
- internal const int ERROR_FILE_NOT_FOUND = Win32Native.ERROR_FILE_NOT_FOUND;
- internal const int ERROR_PATH_NOT_FOUND = Win32Native.ERROR_PATH_NOT_FOUND;
- internal const int ERROR_ACCESS_DENIED = Win32Native.ERROR_ACCESS_DENIED;
- internal const int ERROR_INVALID_PARAMETER = Win32Native.ERROR_INVALID_PARAMETER;
}
}
diff --git a/src/mscorlib/src/System/InsufficientMemoryException.cs b/src/mscorlib/src/System/InsufficientMemoryException.cs
index eb5e4d7430..8f7aa96ff7 100644
--- a/src/mscorlib/src/System/InsufficientMemoryException.cs
+++ b/src/mscorlib/src/System/InsufficientMemoryException.cs
@@ -22,7 +22,6 @@ using System.Runtime.Serialization;
namespace System
{
- [Serializable]
public sealed class InsufficientMemoryException : OutOfMemoryException
{
public InsufficientMemoryException()
@@ -42,9 +41,5 @@ namespace System
{
HResult = __HResults.COR_E_INSUFFICIENTMEMORY;
}
-
- private InsufficientMemoryException(SerializationInfo info, StreamingContext context) : base(info, context)
- {
- }
}
}
diff --git a/src/mscorlib/src/System/Int16.cs b/src/mscorlib/src/System/Int16.cs
index 69f71af278..aced05df6d 100644
--- a/src/mscorlib/src/System/Int16.cs
+++ b/src/mscorlib/src/System/Int16.cs
@@ -25,7 +25,7 @@ namespace System
public struct Int16 : IComparable, IFormattable, IConvertible
, IComparable<Int16>, IEquatable<Int16>
{
- internal short m_value;
+ private short m_value; // Do not rename (binary serialization)
public const short MaxValue = (short)0x7FFF;
public const short MinValue = unchecked((short)0x8000);
diff --git a/src/mscorlib/src/System/Int32.cs b/src/mscorlib/src/System/Int32.cs
index 90b70a9554..afee0e42d7 100644
--- a/src/mscorlib/src/System/Int32.cs
+++ b/src/mscorlib/src/System/Int32.cs
@@ -25,7 +25,7 @@ namespace System
public struct Int32 : IComparable, IFormattable, IConvertible
, IComparable<Int32>, IEquatable<Int32>
{
- internal int m_value;
+ private int m_value; // Do not rename (binary serialization)
public const int MaxValue = 0x7fffffff;
public const int MinValue = unchecked((int)0x80000000);
diff --git a/src/mscorlib/src/System/Int64.cs b/src/mscorlib/src/System/Int64.cs
index 3d64362e30..619bf7e5d7 100644
--- a/src/mscorlib/src/System/Int64.cs
+++ b/src/mscorlib/src/System/Int64.cs
@@ -24,7 +24,7 @@ namespace System
public struct Int64 : IComparable, IFormattable, IConvertible
, IComparable<Int64>, IEquatable<Int64>
{
- internal long m_value;
+ private long m_value; // Do not rename (binary serialization)
public const long MaxValue = 0x7fffffffffffffffL;
public const long MinValue = unchecked((long)0x8000000000000000L);
diff --git a/src/mscorlib/src/System/IntPtr.cs b/src/mscorlib/src/System/IntPtr.cs
index 28f1b1baa8..55c86e3795 100644
--- a/src/mscorlib/src/System/IntPtr.cs
+++ b/src/mscorlib/src/System/IntPtr.cs
@@ -25,7 +25,7 @@ namespace System
[Serializable]
public struct IntPtr : IEquatable<IntPtr>, ISerializable
{
- unsafe private void* m_value; // The compiler treats void* closest to uint hence explicit casts are required to preserve int behavior
+ unsafe private void* _value; // The compiler treats void* closest to uint hence explicit casts are required to preserve int behavior
public static readonly IntPtr Zero;
@@ -33,16 +33,16 @@ namespace System
[Pure]
internal unsafe bool IsNull()
{
- return (m_value == null);
+ return (_value == null);
}
[System.Runtime.Versioning.NonVersionable]
public unsafe IntPtr(int value)
{
#if BIT64
- m_value = (void*)(long)value;
+ _value = (void*)(long)value;
#else // !BIT64 (32)
- m_value = (void *)value;
+ _value = (void *)value;
#endif
}
@@ -50,9 +50,9 @@ namespace System
public unsafe IntPtr(long value)
{
#if BIT64
- m_value = (void*)value;
+ _value = (void*)value;
#else // !BIT64 (32)
- m_value = (void *)checked((int)value);
+ _value = (void *)checked((int)value);
#endif
}
@@ -60,7 +60,7 @@ namespace System
[System.Runtime.Versioning.NonVersionable]
public unsafe IntPtr(void* value)
{
- m_value = value;
+ _value = value;
}
private unsafe IntPtr(SerializationInfo info, StreamingContext context)
@@ -72,7 +72,7 @@ namespace System
throw new ArgumentException(SR.Serialization_InvalidPtrValue);
}
- m_value = (void*)l;
+ _value = (void*)l;
}
unsafe void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
@@ -83,9 +83,9 @@ namespace System
}
Contract.EndContractBlock();
#if BIT64
- info.AddValue("value", (long)(m_value));
+ info.AddValue("value", (long)(_value));
#else // !BIT64 (32)
- info.AddValue("value", (long)((int)m_value));
+ info.AddValue("value", (long)((int)_value));
#endif
}
@@ -93,23 +93,23 @@ namespace System
{
if (obj is IntPtr)
{
- return (m_value == ((IntPtr)obj).m_value);
+ return (_value == ((IntPtr)obj)._value);
}
return false;
}
unsafe bool IEquatable<IntPtr>.Equals(IntPtr other)
{
- return m_value == other.m_value;
+ return _value == other._value;
}
public unsafe override int GetHashCode()
{
#if BIT64
- long l = (long)m_value;
+ long l = (long)_value;
return (unchecked((int)l) ^ (int)(l >> 32));
#else // !BIT64 (32)
- return unchecked((int)m_value);
+ return unchecked((int)_value);
#endif
}
@@ -117,10 +117,10 @@ namespace System
public unsafe int ToInt32()
{
#if BIT64
- long l = (long)m_value;
+ long l = (long)_value;
return checked((int)l);
#else // !BIT64 (32)
- return (int)m_value;
+ return (int)_value;
#endif
}
@@ -128,18 +128,18 @@ namespace System
public unsafe long ToInt64()
{
#if BIT64
- return (long)m_value;
+ return (long)_value;
#else // !BIT64 (32)
- return (long)(int)m_value;
+ return (long)(int)_value;
#endif
}
public unsafe override String ToString()
{
#if BIT64
- return ((long)m_value).ToString(CultureInfo.InvariantCulture);
+ return ((long)_value).ToString(CultureInfo.InvariantCulture);
#else // !BIT64 (32)
- return ((int)m_value).ToString(CultureInfo.InvariantCulture);
+ return ((int)_value).ToString(CultureInfo.InvariantCulture);
#endif
}
@@ -148,9 +148,9 @@ namespace System
Contract.Ensures(Contract.Result<String>() != null);
#if BIT64
- return ((long)m_value).ToString(format, CultureInfo.InvariantCulture);
+ return ((long)_value).ToString(format, CultureInfo.InvariantCulture);
#else // !BIT64 (32)
- return ((int)m_value).ToString(format, CultureInfo.InvariantCulture);
+ return ((int)_value).ToString(format, CultureInfo.InvariantCulture);
#endif
}
@@ -178,17 +178,17 @@ namespace System
[System.Runtime.Versioning.NonVersionable]
public static unsafe explicit operator void* (IntPtr value)
{
- return value.m_value;
+ return value._value;
}
[System.Runtime.Versioning.NonVersionable]
public unsafe static explicit operator int(IntPtr value)
{
#if BIT64
- long l = (long)value.m_value;
+ long l = (long)value._value;
return checked((int)l);
#else // !BIT64 (32)
- return (int)value.m_value;
+ return (int)value._value;
#endif
}
@@ -196,22 +196,22 @@ namespace System
public unsafe static explicit operator long(IntPtr value)
{
#if BIT64
- return (long)value.m_value;
+ return (long)value._value;
#else // !BIT64 (32)
- return (long)(int)value.m_value;
+ return (long)(int)value._value;
#endif
}
[System.Runtime.Versioning.NonVersionable]
public unsafe static bool operator ==(IntPtr value1, IntPtr value2)
{
- return value1.m_value == value2.m_value;
+ return value1._value == value2._value;
}
[System.Runtime.Versioning.NonVersionable]
public unsafe static bool operator !=(IntPtr value1, IntPtr value2)
{
- return value1.m_value != value2.m_value;
+ return value1._value != value2._value;
}
[System.Runtime.Versioning.NonVersionable]
@@ -265,7 +265,7 @@ namespace System
[System.Runtime.Versioning.NonVersionable]
public unsafe void* ToPointer()
{
- return m_value;
+ return _value;
}
}
}
diff --git a/src/mscorlib/src/System/MissingFieldException.cs b/src/mscorlib/src/System/MissingFieldException.cs
index 5668f9e9b3..668d5f2a31 100644
--- a/src/mscorlib/src/System/MissingFieldException.cs
+++ b/src/mscorlib/src/System/MissingFieldException.cs
@@ -11,14 +11,12 @@
using System;
-using System.Runtime.Remoting;
using System.Runtime.Serialization;
using System.Runtime.CompilerServices;
using System.Globalization;
namespace System
{
- [Serializable]
public class MissingFieldException : MissingMemberException, ISerializable
{
public MissingFieldException()
@@ -41,6 +39,7 @@ namespace System
protected MissingFieldException(SerializationInfo info, StreamingContext context) : base(info, context)
{
+ throw new PlatformNotSupportedException();
}
public override String Message
diff --git a/src/mscorlib/src/System/MissingMemberException.cs b/src/mscorlib/src/System/MissingMemberException.cs
index 51150e113c..1fb0c55e40 100644
--- a/src/mscorlib/src/System/MissingMemberException.cs
+++ b/src/mscorlib/src/System/MissingMemberException.cs
@@ -13,7 +13,6 @@
using System;
-using System.Runtime.Remoting;
using System.Runtime.Serialization;
using System.Runtime.CompilerServices;
using System.Globalization;
@@ -22,7 +21,6 @@ using System.Diagnostics.Contracts;
namespace System
{
- [Serializable]
public class MissingMemberException : MemberAccessException, ISerializable
{
public MissingMemberException()
@@ -45,9 +43,7 @@ namespace System
protected MissingMemberException(SerializationInfo info, StreamingContext context) : base(info, context)
{
- ClassName = (String)info.GetString("MMClassName");
- MemberName = (String)info.GetString("MMMemberName");
- Signature = (byte[])info.GetValue("MMSignature", typeof(byte[]));
+ throw new PlatformNotSupportedException();
}
public override String Message
@@ -78,15 +74,7 @@ namespace System
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
- if (info == null)
- {
- throw new ArgumentNullException(nameof(info));
- }
- Contract.EndContractBlock();
base.GetObjectData(info, context);
- info.AddValue("MMClassName", ClassName, typeof(String));
- info.AddValue("MMMemberName", MemberName, typeof(String));
- info.AddValue("MMSignature", Signature, typeof(byte[]));
}
diff --git a/src/mscorlib/src/System/MulticastDelegate.cs b/src/mscorlib/src/System/MulticastDelegate.cs
index 440c9a60bc..988bf2bb60 100644
--- a/src/mscorlib/src/System/MulticastDelegate.cs
+++ b/src/mscorlib/src/System/MulticastDelegate.cs
@@ -13,7 +13,6 @@ using System.Reflection.Emit;
namespace System
{
- [Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public abstract class MulticastDelegate : Delegate
{
@@ -50,49 +49,7 @@ namespace System
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
- int targetIndex = 0;
- Object[] invocationList = _invocationList as Object[];
- if (invocationList == null)
- {
- MethodInfo method = Method;
- // A MethodInfo object can be a RuntimeMethodInfo, a RefEmit method (MethodBuilder, etc), or a DynamicMethod
- // One can only create delegates on RuntimeMethodInfo and DynamicMethod.
- // If it is not a RuntimeMethodInfo (must be a DynamicMethod) or if it is an unmanaged function pointer, throw
- if (!(method is RuntimeMethodInfo) || IsUnmanagedFunctionPtr())
- throw new SerializationException(SR.Serialization_InvalidDelegateType);
-
- // We can't deal with secure delegates either.
- if (!InvocationListLogicallyNull() && !_invocationCount.IsNull() && !_methodPtrAux.IsNull())
- throw new SerializationException(SR.Serialization_InvalidDelegateType);
-
- DelegateSerializationHolder.GetDelegateSerializationInfo(info, this.GetType(), Target, method, targetIndex);
- }
- else
- {
- DelegateSerializationHolder.DelegateEntry nextDe = null;
- int invocationCount = (int)_invocationCount;
- for (int i = invocationCount; --i >= 0;)
- {
- MulticastDelegate d = (MulticastDelegate)invocationList[i];
- MethodInfo method = d.Method;
- // If it is not a RuntimeMethodInfo (must be a DynamicMethod) or if it is an unmanaged function pointer, skip
- if (!(method is RuntimeMethodInfo) || IsUnmanagedFunctionPtr())
- continue;
-
- // We can't deal with secure delegates either.
- if (!d.InvocationListLogicallyNull() && !d._invocationCount.IsNull() && !d._methodPtrAux.IsNull())
- continue;
-
- DelegateSerializationHolder.DelegateEntry de = DelegateSerializationHolder.GetDelegateSerializationInfo(info, d.GetType(), d.Target, method, targetIndex++);
- if (nextDe != null)
- nextDe.Entry = de;
-
- nextDe = de;
- }
- // if nothing was serialized it is a delegate over a DynamicMethod, so just throw
- if (nextDe == null)
- throw new SerializationException(SR.Serialization_InvalidDelegateType);
- }
+ throw new SerializationException(SR.Serialization_DelegatesNotSupported);
}
// equals returns true IIF the delegate is not null and has the
diff --git a/src/mscorlib/src/System/Object.cs b/src/mscorlib/src/System/Object.cs
index 3c304422ac..a476557911 100644
--- a/src/mscorlib/src/System/Object.cs
+++ b/src/mscorlib/src/System/Object.cs
@@ -201,7 +201,6 @@ namespace System
// The name "__Canon" will never been seen by users but it will appear a lot in debugger stack traces
// involving generics so it is kept deliberately short as to avoid being a nuisance.
- [Serializable]
[ClassInterface(ClassInterfaceType.AutoDual)]
[System.Runtime.InteropServices.ComVisible(true)]
internal class __Canon
diff --git a/src/mscorlib/src/System/OleAutBinder.cs b/src/mscorlib/src/System/OleAutBinder.cs
index 1db61bb30e..3a9f03c5f0 100644
--- a/src/mscorlib/src/System/OleAutBinder.cs
+++ b/src/mscorlib/src/System/OleAutBinder.cs
@@ -15,7 +15,6 @@ namespace System
using CultureInfo = System.Globalization.CultureInfo;
// Made serializable in anticipation of this class eventually having state.
- [Serializable]
internal class OleAutBinder : DefaultBinder
{
// ChangeType
diff --git a/src/mscorlib/src/System/OperatingSystem.cs b/src/mscorlib/src/System/OperatingSystem.cs
deleted file mode 100644
index 5eb1253fa5..0000000000
--- a/src/mscorlib/src/System/OperatingSystem.cs
+++ /dev/null
@@ -1,154 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-**
-**
-** Purpose:
-**
-**
-===========================================================*/
-
-using System.Runtime.Serialization;
-using System.Globalization;
-using System.Runtime.InteropServices;
-using System.Diagnostics.Contracts;
-
-namespace System
-{
- [Serializable]
- internal sealed class OperatingSystem : ICloneable, ISerializable
- {
- private Version _version;
- private PlatformID _platform;
- private string _servicePack;
- private string _versionString;
-
- private OperatingSystem()
- {
- }
-
- internal OperatingSystem(PlatformID platform, Version version, string servicePack)
- {
- if (platform < PlatformID.Win32S || platform > PlatformID.MacOSX)
- {
- throw new ArgumentException(
- SR.Format(SR.Arg_EnumIllegalVal, (int)platform),
- nameof(platform));
- }
-
- if ((Object)version == null)
- throw new ArgumentNullException(nameof(version));
- Contract.EndContractBlock();
-
- _platform = platform;
- _version = (Version)version.Clone();
- _servicePack = servicePack;
- }
-
- private OperatingSystem(SerializationInfo info, StreamingContext context)
- {
- SerializationInfoEnumerator enumerator = info.GetEnumerator();
- while (enumerator.MoveNext())
- {
- switch (enumerator.Name)
- {
- case "_version":
- _version = (Version)info.GetValue("_version", typeof(Version));
- break;
- case "_platform":
- _platform = (PlatformID)info.GetValue("_platform", typeof(PlatformID));
- break;
- case "_servicePack":
- _servicePack = info.GetString("_servicePack");
- break;
- }
- }
-
- if (_version == null)
- {
- throw new SerializationException(SR.Format(SR.Serialization_MissField, "_version"));
- }
- }
-
- public void GetObjectData(SerializationInfo info, StreamingContext context)
- {
- if (info == null)
- {
- throw new ArgumentNullException(nameof(info));
- }
- Contract.EndContractBlock();
-
- info.AddValue("_version", _version);
- info.AddValue("_platform", _platform);
- info.AddValue("_servicePack", _servicePack);
- }
-
- public Version Version
- {
- get { return _version; }
- }
-
- public Object Clone()
- {
- return new OperatingSystem(_platform,
- _version, _servicePack);
- }
-
- public override String ToString()
- {
- return VersionString;
- }
-
- public String VersionString
- {
- get
- {
- if (_versionString != null)
- {
- return _versionString;
- }
-
- String os;
- switch (_platform)
- {
- case PlatformID.Win32NT:
- os = "Microsoft Windows NT ";
- break;
- case PlatformID.Win32Windows:
- if ((_version.Major > 4) ||
- ((_version.Major == 4) && (_version.Minor > 0)))
- os = "Microsoft Windows 98 ";
- else
- os = "Microsoft Windows 95 ";
- break;
- case PlatformID.Win32S:
- os = "Microsoft Win32S ";
- break;
- case PlatformID.WinCE:
- os = "Microsoft Windows CE ";
- break;
- case PlatformID.MacOSX:
- os = "Mac OS X ";
- break;
- default:
- os = "<unknown> ";
- break;
- }
-
- if (String.IsNullOrEmpty(_servicePack))
- {
- _versionString = os + _version.ToString();
- }
- else
- {
- _versionString = os + _version.ToString(3) + " " + _servicePack;
- }
-
- return _versionString;
- }
- }
- }
-}
diff --git a/src/mscorlib/src/System/OutOfMemoryException.cs b/src/mscorlib/src/System/OutOfMemoryException.cs
index 154d0f92e2..3bec542077 100644
--- a/src/mscorlib/src/System/OutOfMemoryException.cs
+++ b/src/mscorlib/src/System/OutOfMemoryException.cs
@@ -17,7 +17,6 @@ using System.Runtime.Serialization;
namespace System
{
- [Serializable]
public class OutOfMemoryException : SystemException
{
public OutOfMemoryException()
@@ -40,6 +39,7 @@ namespace System
protected OutOfMemoryException(SerializationInfo info, StreamingContext context) : base(info, context)
{
+ throw new PlatformNotSupportedException();
}
}
}
diff --git a/src/mscorlib/src/System/PlatformID.cs b/src/mscorlib/src/System/PlatformID.cs
deleted file mode 100644
index dfab2175ab..0000000000
--- a/src/mscorlib/src/System/PlatformID.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-**
-**
-** Purpose: Defines IDs for supported platforms
-**
-**
-===========================================================*/
-
-namespace System
-{
- [Serializable]
- internal enum PlatformID
- {
- Win32S = 0,
- Win32Windows = 1,
- Win32NT = 2,
- WinCE = 3,
- Unix = 4,
- Xbox = 5,
- MacOSX = 6
- }
-}
diff --git a/src/mscorlib/src/System/Reflection/Assembly.CoreCLR.cs b/src/mscorlib/src/System/Reflection/Assembly.CoreCLR.cs
index 708f79b64f..9d34b48177 100644
--- a/src/mscorlib/src/System/Reflection/Assembly.CoreCLR.cs
+++ b/src/mscorlib/src/System/Reflection/Assembly.CoreCLR.cs
@@ -15,34 +15,78 @@ namespace System.Reflection
{
public abstract partial class Assembly : ICustomAttributeProvider, ISerializable
{
+ private static volatile bool s_LoadFromResolveHandlerSetup = false;
+ private static object s_syncRootLoadFrom = new object();
+ private static List<string> s_LoadFromAssemblyList = new List<string>();
+ private static object s_syncLoadFromAssemblyList = new object();
+
+ private static Assembly LoadFromResolveHandler(object sender, ResolveEventArgs args)
+ {
+ Assembly requestingAssembly = args.RequestingAssembly;
+
+ // Requesting assembly for LoadFrom is always loaded in defaultContext - proceed only if that
+ // is the case.
+ if (AssemblyLoadContext.Default != AssemblyLoadContext.GetLoadContext(requestingAssembly))
+ return null;
+
+ // Get the path where requesting assembly lives and check if it is in the list
+ // of assemblies for which LoadFrom was invoked.
+ bool fRequestorLoadedViaLoadFrom = false;
+ string requestorPath = Path.GetFullPath(requestingAssembly.Location);
+ if (string.IsNullOrEmpty(requestorPath))
+ return null;
+
+ lock(s_syncLoadFromAssemblyList)
+ {
+ fRequestorLoadedViaLoadFrom = s_LoadFromAssemblyList.Contains(requestorPath);
+ }
+
+ // If the requestor assembly was not loaded using LoadFrom, exit.
+ if (!fRequestorLoadedViaLoadFrom)
+ return null;
+
+ // Requestor assembly was loaded using loadFrom, so look for its dependencies
+ // in the same folder as it.
+ // Form the name of the assembly using the path of the assembly that requested its load.
+ AssemblyName requestedAssemblyName = new AssemblyName(args.Name);
+ string requestedAssemblyPath = Path.Combine(Path.GetDirectoryName(requestorPath), requestedAssemblyName.Name+".dll");
+
+ // Load the dependency via LoadFrom so that it goes through the same path of being in the LoadFrom list.
+ return Assembly.LoadFrom(requestedAssemblyPath);
+ }
+
public static Assembly LoadFrom(String assemblyFile)
{
if (assemblyFile == null)
throw new ArgumentNullException(nameof(assemblyFile));
+
string fullPath = Path.GetFullPath(assemblyFile);
- return AssemblyLoadContext.Default.LoadFromAssemblyPath(fullPath);
- }
- // Evidence is protected in Assembly.Load()
- [Obsolete("This method is obsolete and will be removed in a future release of the .NET Framework. Please use an overload of LoadFrom which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
- [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod
- internal static Assembly LoadFrom(String assemblyFile,
- Evidence securityEvidence)
- {
- Contract.Ensures(Contract.Result<Assembly>() != null);
+ if (!s_LoadFromResolveHandlerSetup)
+ {
+ lock (s_syncRootLoadFrom)
+ {
+ if (!s_LoadFromResolveHandlerSetup)
+ {
+ AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(LoadFromResolveHandler);
+ s_LoadFromResolveHandlerSetup = true;
+ }
+ }
+ }
- StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
+ // Add the path to the LoadFrom path list which we will consult
+ // before handling the resolves in our handler.
+ lock(s_syncLoadFromAssemblyList)
+ {
+ if (!s_LoadFromAssemblyList.Contains(fullPath))
+ {
+ s_LoadFromAssemblyList.Add(fullPath);
+ }
+ }
- return RuntimeAssembly.InternalLoadFrom(
- assemblyFile,
- securityEvidence,
- null, // hashValue
- AssemblyHashAlgorithm.None,
- false,// forIntrospection);
- ref stackMark);
+ return AssemblyLoadContext.Default.LoadFromAssemblyPath(fullPath);
}
- [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod
public static Assembly LoadFrom(String assemblyFile,
byte[] hashValue,
AssemblyHashAlgorithm hashAlgorithm)
diff --git a/src/mscorlib/src/System/Reflection/AssemblyName.cs b/src/mscorlib/src/System/Reflection/AssemblyName.cs
index 80fdf5d162..6bfc5b7496 100644
--- a/src/mscorlib/src/System/Reflection/AssemblyName.cs
+++ b/src/mscorlib/src/System/Reflection/AssemblyName.cs
@@ -27,7 +27,6 @@ namespace System.Reflection
using System.Diagnostics.Contracts;
using System.Text;
- [Serializable]
public sealed class AssemblyName : ICloneable, ISerializable, IDeserializationCallback
{
//
@@ -279,7 +278,11 @@ namespace System.Reflection
{
get
{
- return nToString();
+ if (this.Name == null)
+ return string.Empty;
+ // Do not call GetPublicKeyToken() here - that latches the result into AssemblyName which isn't a side effect we want.
+ byte[] pkt = _PublicKeyToken ?? nGetPublicKeyToken();
+ return AssemblyNameFormatter.ComputeDisplayName(Name, Version, CultureName, pkt, Flags, ContentType);
}
}
@@ -295,68 +298,12 @@ namespace System.Reflection
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
- if (info == null)
- throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- //Allocate the serialization info and serialize our static data.
- info.AddValue("_Name", _Name);
- info.AddValue("_PublicKey", _PublicKey, typeof(byte[]));
- info.AddValue("_PublicKeyToken", _PublicKeyToken, typeof(byte[]));
-#if FEATURE_USE_LCID
- info.AddValue("_CultureInfo", (_CultureInfo == null) ? -1 : _CultureInfo.LCID);
-#endif
- info.AddValue("_CodeBase", _CodeBase);
- info.AddValue("_Version", _Version);
- info.AddValue("_HashAlgorithm", _HashAlgorithm, typeof(AssemblyHashAlgorithm));
- info.AddValue("_HashAlgorithmForControl", _HashAlgorithmForControl, typeof(AssemblyHashAlgorithm));
- info.AddValue("_StrongNameKeyPair", _StrongNameKeyPair, typeof(StrongNameKeyPair));
- info.AddValue("_VersionCompatibility", _VersionCompatibility, typeof(AssemblyVersionCompatibility));
- info.AddValue("_Flags", _Flags, typeof(AssemblyNameFlags));
- info.AddValue("_HashForControl", _HashForControl, typeof(byte[]));
+ throw new PlatformNotSupportedException();
}
public void OnDeserialization(Object sender)
{
- // Deserialization has already been performed
- if (m_siInfo == null)
- return;
-
- _Name = m_siInfo.GetString("_Name");
- _PublicKey = (byte[])m_siInfo.GetValue("_PublicKey", typeof(byte[]));
- _PublicKeyToken = (byte[])m_siInfo.GetValue("_PublicKeyToken", typeof(byte[]));
-#if FEATURE_USE_LCID
- int lcid = (int)m_siInfo.GetInt32("_CultureInfo");
- if (lcid != -1)
- _CultureInfo = new CultureInfo(lcid);
-#endif
-
- _CodeBase = m_siInfo.GetString("_CodeBase");
- _Version = (Version)m_siInfo.GetValue("_Version", typeof(Version));
- _HashAlgorithm = (AssemblyHashAlgorithm)m_siInfo.GetValue("_HashAlgorithm", typeof(AssemblyHashAlgorithm));
- _StrongNameKeyPair = (StrongNameKeyPair)m_siInfo.GetValue("_StrongNameKeyPair", typeof(StrongNameKeyPair));
- _VersionCompatibility = (AssemblyVersionCompatibility)m_siInfo.GetValue("_VersionCompatibility", typeof(AssemblyVersionCompatibility));
- _Flags = (AssemblyNameFlags)m_siInfo.GetValue("_Flags", typeof(AssemblyNameFlags));
-
- try
- {
- _HashAlgorithmForControl = (AssemblyHashAlgorithm)m_siInfo.GetValue("_HashAlgorithmForControl", typeof(AssemblyHashAlgorithm));
- _HashForControl = (byte[])m_siInfo.GetValue("_HashForControl", typeof(byte[]));
- }
- catch (SerializationException)
- { // RTM did not have these defined
- _HashAlgorithmForControl = AssemblyHashAlgorithm.None;
- _HashForControl = null;
- }
-
- m_siInfo = null;
- }
-
- // Constructs a new AssemblyName during deserialization.
- internal AssemblyName(SerializationInfo info, StreamingContext context)
- {
- //The graph is not valid until OnDeserialization() has been called.
- m_siInfo = info;
+ throw new PlatformNotSupportedException();
}
public AssemblyName(String assemblyName)
diff --git a/src/mscorlib/src/System/Reflection/CustomAttribute.cs b/src/mscorlib/src/System/Reflection/CustomAttribute.cs
index 96eb45f3e4..1cf00f17d8 100644
--- a/src/mscorlib/src/System/Reflection/CustomAttribute.cs
+++ b/src/mscorlib/src/System/Reflection/CustomAttribute.cs
@@ -20,7 +20,6 @@ using System.Diagnostics.Contracts;
namespace System.Reflection
{
- [Serializable]
public class CustomAttributeData
{
#region Public Static Members
@@ -570,7 +569,6 @@ namespace System.Reflection
#endregion
}
- [Serializable]
public struct CustomAttributeNamedArgument
{
#region Public Static Members
@@ -659,7 +657,6 @@ namespace System.Reflection
}
- [Serializable]
public struct CustomAttributeTypedArgument
{
#region Public Static Members
@@ -958,14 +955,12 @@ namespace System.Reflection
#endregion
}
- [Serializable]
internal struct CustomAttributeRecord
{
internal ConstArray blob;
internal MetadataToken tkCtor;
}
- [Serializable]
internal enum CustomAttributeEncoding : int
{
Undefined = 0,
@@ -990,7 +985,6 @@ namespace System.Reflection
Enum = 0x55
}
- [Serializable]
[StructLayout(LayoutKind.Auto)]
internal struct CustomAttributeEncodedArgument
{
@@ -1045,7 +1039,6 @@ namespace System.Reflection
#endregion
}
- [Serializable]
[StructLayout(LayoutKind.Auto)]
internal struct CustomAttributeNamedParameter
{
@@ -1077,7 +1070,6 @@ namespace System.Reflection
#endregion
}
- [Serializable]
[StructLayout(LayoutKind.Auto)]
internal struct CustomAttributeCtorParameter
{
@@ -1099,7 +1091,6 @@ namespace System.Reflection
#endregion
}
- [Serializable]
[StructLayout(LayoutKind.Auto)]
internal struct CustomAttributeType
{
@@ -2040,7 +2031,7 @@ namespace System.Reflection
count = 0;
bool all = caType == (RuntimeType)typeof(object) || caType == (RuntimeType)typeof(Attribute);
- if (!all && s_pca.GetValueOrDefault(caType) == null && !IsSecurityAttribute(caType))
+ if (!all && !s_pca.ContainsKey(caType) && !IsSecurityAttribute(caType))
return Array.Empty<Attribute>();
List<Attribute> pcas = new List<Attribute>();
@@ -2078,7 +2069,7 @@ namespace System.Reflection
internal static bool IsDefined(RuntimeType type, RuntimeType caType)
{
bool all = caType == (RuntimeType)typeof(object) || caType == (RuntimeType)typeof(Attribute);
- if (!all && s_pca.GetValueOrDefault(caType) == null && !IsSecurityAttribute(caType))
+ if (!all && !s_pca.ContainsKey(caType) && !IsSecurityAttribute(caType))
return false;
if (all || caType == (RuntimeType)typeof(SerializableAttribute))
@@ -2107,7 +2098,7 @@ namespace System.Reflection
count = 0;
bool all = caType == (RuntimeType)typeof(object) || caType == (RuntimeType)typeof(Attribute);
- if (!all && s_pca.GetValueOrDefault(caType) == null && !IsSecurityAttribute(caType))
+ if (!all && !s_pca.ContainsKey(caType) && !IsSecurityAttribute(caType))
return Array.Empty<Attribute>();
List<Attribute> pcas = new List<Attribute>();
@@ -2140,7 +2131,7 @@ namespace System.Reflection
internal static bool IsDefined(RuntimeMethodInfo method, RuntimeType caType)
{
bool all = caType == (RuntimeType)typeof(object) || caType == (RuntimeType)typeof(Attribute);
- if (!all && s_pca.GetValueOrDefault(caType) == null)
+ if (!all && !s_pca.ContainsKey(caType))
return false;
if (all || caType == (RuntimeType)typeof(DllImportAttribute))
@@ -2170,7 +2161,7 @@ namespace System.Reflection
count = 0;
bool all = caType == (RuntimeType)typeof(object) || caType == (RuntimeType)typeof(Attribute);
- if (!all && s_pca.GetValueOrDefault(caType) == null)
+ if (!all && !s_pca.ContainsKey(caType))
return null;
Attribute[] pcas = new Attribute[s_pcasCount];
@@ -2201,7 +2192,7 @@ namespace System.Reflection
internal static bool IsDefined(RuntimeParameterInfo parameter, RuntimeType caType)
{
bool all = caType == (RuntimeType)typeof(object) || caType == (RuntimeType)typeof(Attribute);
- if (!all && s_pca.GetValueOrDefault(caType) == null)
+ if (!all && !s_pca.ContainsKey(caType))
return false;
@@ -2231,7 +2222,7 @@ namespace System.Reflection
bool all = caType == (RuntimeType)typeof(object) || caType == (RuntimeType)typeof(Attribute);
- if (!all && s_pca.GetValueOrDefault(caType) == null && !IsSecurityAttribute(caType))
+ if (!all && !s_pca.ContainsKey(caType) && !IsSecurityAttribute(caType))
return Array.Empty<Attribute>();
List<Attribute> pcas = new List<Attribute>();
@@ -2283,7 +2274,7 @@ namespace System.Reflection
count = 0;
bool all = caType == (RuntimeType)typeof(object) || caType == (RuntimeType)typeof(Attribute);
- if (!all && s_pca.GetValueOrDefault(caType) == null)
+ if (!all && !s_pca.ContainsKey(caType))
return null;
Attribute[] pcas = new Attribute[s_pcasCount];
@@ -2309,7 +2300,7 @@ namespace System.Reflection
internal static bool IsDefined(RuntimeFieldInfo field, RuntimeType caType)
{
bool all = caType == (RuntimeType)typeof(object) || caType == (RuntimeType)typeof(Attribute);
- if (!all && s_pca.GetValueOrDefault(caType) == null)
+ if (!all && !s_pca.ContainsKey(caType))
return false;
if (all || caType == (RuntimeType)typeof(MarshalAsAttribute))
@@ -2334,7 +2325,7 @@ namespace System.Reflection
bool all = caType == (RuntimeType)typeof(object) || caType == (RuntimeType)typeof(Attribute);
- if (!all && s_pca.GetValueOrDefault(caType) == null && !IsSecurityAttribute(caType))
+ if (!all && !s_pca.ContainsKey(caType) && !IsSecurityAttribute(caType))
return Array.Empty<Attribute>();
List<Attribute> pcas = new List<Attribute>();
@@ -2357,7 +2348,7 @@ namespace System.Reflection
{
bool all = caType == (RuntimeType)typeof(object) || caType == (RuntimeType)typeof(Attribute);
- if (!all && s_pca.GetValueOrDefault(caType) == null)
+ if (!all && !s_pca.ContainsKey(caType))
return false;
if (all || IsSecurityAttribute(caType))
diff --git a/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilderAccess.cs b/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilderAccess.cs
index ead2fafcef..b096960406 100644
--- a/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilderAccess.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilderAccess.cs
@@ -9,7 +9,6 @@ using System;
namespace System.Reflection.Emit
{
- [Serializable]
[Flags]
public enum AssemblyBuilderAccess
{
diff --git a/src/mscorlib/src/System/Reflection/Emit/EnumBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/EnumBuilder.cs
index 55aa5c5a8f..a36882b036 100644
--- a/src/mscorlib/src/System/Reflection/Emit/EnumBuilder.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/EnumBuilder.cs
@@ -242,6 +242,8 @@ namespace System.Reflection.Emit
return m_typeBuilder.Attributes;
}
+ public override bool IsTypeDefinition => true;
+
public override bool IsSZArray => false;
protected override bool IsArrayImpl()
diff --git a/src/mscorlib/src/System/Reflection/Emit/EventToken.cs b/src/mscorlib/src/System/Reflection/Emit/EventToken.cs
index 18ec630b5f..e44dc3d0ce 100644
--- a/src/mscorlib/src/System/Reflection/Emit/EventToken.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/EventToken.cs
@@ -18,7 +18,6 @@ using System.Reflection;
namespace System.Reflection.Emit
{
- [Serializable]
public struct EventToken
{
public static readonly EventToken Empty = new EventToken();
diff --git a/src/mscorlib/src/System/Reflection/Emit/FieldToken.cs b/src/mscorlib/src/System/Reflection/Emit/FieldToken.cs
index 6c5d778d8f..c7450ca301 100644
--- a/src/mscorlib/src/System/Reflection/Emit/FieldToken.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/FieldToken.cs
@@ -22,7 +22,6 @@ namespace System.Reflection.Emit
// by the Metadata to represent the field. FieldTokens are generated by
// Module.GetFieldToken(). There are no meaningful accessors on this class,
// but it can be passed to ILGenerator which understands it's internals.
- [Serializable]
public struct FieldToken
{
public static readonly FieldToken Empty = new FieldToken();
diff --git a/src/mscorlib/src/System/Reflection/Emit/FlowControl.cs b/src/mscorlib/src/System/Reflection/Emit/FlowControl.cs
index fb8564652f..531d229a5c 100644
--- a/src/mscorlib/src/System/Reflection/Emit/FlowControl.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/FlowControl.cs
@@ -16,7 +16,6 @@ using System;
namespace System.Reflection.Emit
{
- [Serializable]
public enum FlowControl
{
Branch = 0,
diff --git a/src/mscorlib/src/System/Reflection/Emit/GenericTypeParameterBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/GenericTypeParameterBuilder.cs
index dd5ffa92a9..75e4acc903 100644
--- a/src/mscorlib/src/System/Reflection/Emit/GenericTypeParameterBuilder.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/GenericTypeParameterBuilder.cs
@@ -154,6 +154,8 @@ namespace System.Reflection.Emit
protected override TypeAttributes GetAttributeFlagsImpl() { return TypeAttributes.Public; }
+ public override bool IsTypeDefinition => false;
+
public override bool IsSZArray => false;
protected override bool IsArrayImpl() { return false; }
diff --git a/src/mscorlib/src/System/Reflection/Emit/ILGenerator.cs b/src/mscorlib/src/System/Reflection/Emit/ILGenerator.cs
index 4021410a33..fa31d66f6c 100644
--- a/src/mscorlib/src/System/Reflection/Emit/ILGenerator.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/ILGenerator.cs
@@ -1605,7 +1605,6 @@ namespace System.Reflection.Emit
* takes place.
*
***************************/
- [Serializable]
internal enum ScopeAction
{
Open = 0x0,
diff --git a/src/mscorlib/src/System/Reflection/Emit/Label.cs b/src/mscorlib/src/System/Reflection/Emit/Label.cs
index f6315a67d2..d67c0e6a19 100644
--- a/src/mscorlib/src/System/Reflection/Emit/Label.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/Label.cs
@@ -26,7 +26,6 @@ namespace System.Reflection.Emit
// is passed to the MethodWriter.
// Labels are created by using ILGenerator.CreateLabel and their position is set
// by using ILGenerator.MarkLabel.
- [Serializable]
public struct Label
{
internal int m_label;
diff --git a/src/mscorlib/src/System/Reflection/Emit/MethodToken.cs b/src/mscorlib/src/System/Reflection/Emit/MethodToken.cs
index 0905ac922a..9698b07333 100644
--- a/src/mscorlib/src/System/Reflection/Emit/MethodToken.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/MethodToken.cs
@@ -18,7 +18,6 @@ using System.Reflection;
namespace System.Reflection.Emit
{
- [Serializable]
public struct MethodToken
{
public static readonly MethodToken Empty = new MethodToken();
diff --git a/src/mscorlib/src/System/Reflection/Emit/ModuleBuilderData.cs b/src/mscorlib/src/System/Reflection/Emit/ModuleBuilderData.cs
index 4f1b8eb713..4a9b774d15 100644
--- a/src/mscorlib/src/System/Reflection/Emit/ModuleBuilderData.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/ModuleBuilderData.cs
@@ -19,7 +19,6 @@ namespace System.Reflection.Emit
// This is a package private class. This class hold all of the managed
// data member for ModuleBuilder. Note that what ever data members added to
// this class cannot be accessed from the EE.
- [Serializable]
internal class ModuleBuilderData
{
internal ModuleBuilderData(ModuleBuilder module, String strModuleName, String strFileName, int tkFile)
diff --git a/src/mscorlib/src/System/Reflection/Emit/OpcodeType.cs b/src/mscorlib/src/System/Reflection/Emit/OpcodeType.cs
index 2363d607fc..db7fa2f209 100644
--- a/src/mscorlib/src/System/Reflection/Emit/OpcodeType.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/OpcodeType.cs
@@ -17,7 +17,6 @@ using System;
namespace System.Reflection.Emit
{
- [Serializable]
public enum OpCodeType
{
[Obsolete("This API has been deprecated. http://go.microsoft.com/fwlink/?linkid=14202")]
diff --git a/src/mscorlib/src/System/Reflection/Emit/OperandType.cs b/src/mscorlib/src/System/Reflection/Emit/OperandType.cs
index 033539b999..db113b1725 100644
--- a/src/mscorlib/src/System/Reflection/Emit/OperandType.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/OperandType.cs
@@ -17,7 +17,6 @@ using System;
namespace System.Reflection.Emit
{
- [Serializable]
public enum OperandType
{
InlineBrTarget = 0,
diff --git a/src/mscorlib/src/System/Reflection/Emit/PEFileKinds.cs b/src/mscorlib/src/System/Reflection/Emit/PEFileKinds.cs
index f9246fce6d..f6606c477a 100644
--- a/src/mscorlib/src/System/Reflection/Emit/PEFileKinds.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/PEFileKinds.cs
@@ -8,7 +8,6 @@ using System;
namespace System.Reflection.Emit
{
// This Enum matchs the CorFieldAttr defined in CorHdr.h
- [Serializable]
public enum PEFileKinds
{
Dll = 0x0001,
diff --git a/src/mscorlib/src/System/Reflection/Emit/ParameterToken.cs b/src/mscorlib/src/System/Reflection/Emit/ParameterToken.cs
index 42f85af464..067bc2d010 100644
--- a/src/mscorlib/src/System/Reflection/Emit/ParameterToken.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/ParameterToken.cs
@@ -20,7 +20,6 @@ namespace System.Reflection.Emit
{
// The ParameterToken class is an opaque representation of the Token returned
// by the Metadata to represent the parameter.
- [Serializable]
public struct ParameterToken
{
public static readonly ParameterToken Empty = new ParameterToken();
diff --git a/src/mscorlib/src/System/Reflection/Emit/PropertyToken.cs b/src/mscorlib/src/System/Reflection/Emit/PropertyToken.cs
index b450b198d2..02f34881f4 100644
--- a/src/mscorlib/src/System/Reflection/Emit/PropertyToken.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/PropertyToken.cs
@@ -18,7 +18,6 @@ using System.Reflection;
namespace System.Reflection.Emit
{
- [Serializable]
public struct PropertyToken
{
public static readonly PropertyToken Empty = new PropertyToken();
diff --git a/src/mscorlib/src/System/Reflection/Emit/StackBehaviour.cs b/src/mscorlib/src/System/Reflection/Emit/StackBehaviour.cs
index afcf2ddf0a..b9054b709e 100644
--- a/src/mscorlib/src/System/Reflection/Emit/StackBehaviour.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/StackBehaviour.cs
@@ -17,7 +17,6 @@ using System;
namespace System.Reflection.Emit
{
- [Serializable]
public enum StackBehaviour
{
Pop0 = 0,
diff --git a/src/mscorlib/src/System/Reflection/Emit/StringToken.cs b/src/mscorlib/src/System/Reflection/Emit/StringToken.cs
index 1d90816fc6..cc5b734ae8 100644
--- a/src/mscorlib/src/System/Reflection/Emit/StringToken.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/StringToken.cs
@@ -18,7 +18,6 @@ using System.Reflection;
namespace System.Reflection.Emit
{
- [Serializable]
public struct StringToken
{
internal int m_string;
diff --git a/src/mscorlib/src/System/Reflection/Emit/SymbolType.cs b/src/mscorlib/src/System/Reflection/Emit/SymbolType.cs
index 16848b43dd..ca2f7d9d6e 100644
--- a/src/mscorlib/src/System/Reflection/Emit/SymbolType.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/SymbolType.cs
@@ -12,7 +12,6 @@ namespace System.Reflection.Emit
using System.Diagnostics.Contracts;
using CultureInfo = System.Globalization.CultureInfo;
- [Serializable]
internal enum TypeKind
{
IsArray = 1,
@@ -271,6 +270,9 @@ namespace System.Reflection.Emit
#endregion
#region Type Overrides
+
+ public override bool IsTypeDefinition => false;
+
public override bool IsSZArray => m_cRank <= 1 && m_isSzArray;
public override Type MakePointerType()
diff --git a/src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs
index a98af2bdcf..2f550a4e40 100644
--- a/src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs
@@ -20,7 +20,6 @@ namespace System.Reflection.Emit
using System.Diagnostics.Contracts;
- [Serializable]
public enum PackingSize
{
Unspecified = 0,
@@ -1109,6 +1108,8 @@ namespace System.Reflection.Emit
return m_iAttr;
}
+ public override bool IsTypeDefinition => true;
+
public override bool IsSZArray => false;
protected override bool IsArrayImpl()
diff --git a/src/mscorlib/src/System/Reflection/Emit/TypeBuilderInstantiation.cs b/src/mscorlib/src/System/Reflection/Emit/TypeBuilderInstantiation.cs
index 6d46362f91..64a38b0995 100644
--- a/src/mscorlib/src/System/Reflection/Emit/TypeBuilderInstantiation.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/TypeBuilderInstantiation.cs
@@ -189,6 +189,7 @@ namespace System.Reflection.Emit
public override MemberInfo[] GetMembers(BindingFlags bindingAttr) { throw new NotSupportedException(); }
protected override TypeAttributes GetAttributeFlagsImpl() { return m_type.Attributes; }
+ public override bool IsTypeDefinition => false;
public override bool IsSZArray => false;
protected override bool IsArrayImpl() { return false; }
diff --git a/src/mscorlib/src/System/Reflection/Emit/TypeToken.cs b/src/mscorlib/src/System/Reflection/Emit/TypeToken.cs
index 4f0c1b3dac..15a0816a50 100644
--- a/src/mscorlib/src/System/Reflection/Emit/TypeToken.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/TypeToken.cs
@@ -19,7 +19,6 @@ using System.Threading;
namespace System.Reflection.Emit
{
- [Serializable]
public struct TypeToken
{
public static readonly TypeToken Empty = new TypeToken();
diff --git a/src/mscorlib/src/System/Reflection/MdFieldInfo.cs b/src/mscorlib/src/System/Reflection/MdFieldInfo.cs
index 41ee4d9297..9645b7fef2 100644
--- a/src/mscorlib/src/System/Reflection/MdFieldInfo.cs
+++ b/src/mscorlib/src/System/Reflection/MdFieldInfo.cs
@@ -9,7 +9,6 @@ using RuntimeTypeCache = System.RuntimeType.RuntimeTypeCache;
namespace System.Reflection
{
- [Serializable]
internal sealed unsafe class MdFieldInfo : RuntimeFieldInfo, ISerializable
{
#region Private Data Members
diff --git a/src/mscorlib/src/System/Reflection/MdImport.cs b/src/mscorlib/src/System/Reflection/MdImport.cs
index a224a50513..9230ffa9ef 100644
--- a/src/mscorlib/src/System/Reflection/MdImport.cs
+++ b/src/mscorlib/src/System/Reflection/MdImport.cs
@@ -20,7 +20,6 @@ using System.Diagnostics.Contracts;
namespace System.Reflection
{
- [Serializable]
internal enum CorElementType : byte
{
End = 0x00,
@@ -61,7 +60,6 @@ namespace System.Reflection
Pinned = 0x45,
}
- [Serializable]
[Flags()]
internal enum MdSigCallingConvention : byte
{
@@ -85,7 +83,6 @@ namespace System.Reflection
}
- [Serializable]
[Flags()]
internal enum PInvokeAttributes
{
@@ -122,7 +119,6 @@ namespace System.Reflection
}
- [Serializable]
[Flags()]
internal enum MethodSemanticsAttributes
{
@@ -135,7 +131,6 @@ namespace System.Reflection
}
- [Serializable]
internal enum MetadataTokenType
{
Module = 0x00000000,
@@ -166,7 +161,6 @@ namespace System.Reflection
Invalid = 0x7FFFFFFF,
}
- [Serializable]
internal struct ConstArray
{
public IntPtr Signature { get { return m_constArray; } }
@@ -191,7 +185,6 @@ namespace System.Reflection
internal IntPtr m_constArray;
}
- [Serializable]
internal struct MetadataToken
{
#region Implicit Cast Operators
diff --git a/src/mscorlib/src/System/Reflection/MemberSerializationStringGenerator.cs b/src/mscorlib/src/System/Reflection/MemberSerializationStringGenerator.cs
deleted file mode 100644
index d25c746a85..0000000000
--- a/src/mscorlib/src/System/Reflection/MemberSerializationStringGenerator.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-using System;
-using System.Text;
-using System.Reflection;
-using System.Diagnostics;
-using System.Collections.Generic;
-
-namespace System
-{
- internal static class MemberSerializationStringGenerator
- {
- //
- // Generate the "Signature2" binary serialization string for PropertyInfos
- //
- // Because the string is effectively a file format for serialized Reflection objects, it must be exactly correct. If missing
- // metadata prevents generating the string, this method throws a MissingMetadata exception.
- //
- public static string SerializationToString(this PropertyInfo property) => ((RuntimePropertyInfo)property).SerializationToString();
-
- //
- // Generate the "Signature2" binary serialization string for ConstructorInfos
- //
- // Because the string is effectively a file format for serialized Reflection objects, it must be exactly correct. If missing
- // metadata prevents generating the string, this method throws a MissingMetadata exception.
- //
- public static string SerializationToString(this ConstructorInfo constructor) => ((RuntimeConstructorInfo)constructor).SerializationToString();
-
- //
- // Generate the "Signature2" binary serialization string for MethodInfos
- //
- // Because the string is effectively a file format for serialized Reflection objects, it must be exactly correct. If missing
- // metadata prevents generating the string, this method throws a MissingMetadata exception.
- //
- public static string SerializationToString(this MethodInfo method) => ((RuntimeMethodInfo)method).SerializationToString();
- }
-}
diff --git a/src/mscorlib/src/System/Reflection/RtFieldInfo.cs b/src/mscorlib/src/System/Reflection/RtFieldInfo.cs
index 20d6e6392f..ddfc56b2aa 100644
--- a/src/mscorlib/src/System/Reflection/RtFieldInfo.cs
+++ b/src/mscorlib/src/System/Reflection/RtFieldInfo.cs
@@ -11,7 +11,6 @@ using RuntimeTypeCache = System.RuntimeType.RuntimeTypeCache;
namespace System.Reflection
{
- [Serializable]
internal unsafe sealed class RtFieldInfo : RuntimeFieldInfo, IRuntimeFieldInfo
{
#region FCalls
diff --git a/src/mscorlib/src/System/Reflection/RuntimeAssembly.cs b/src/mscorlib/src/System/Reflection/RuntimeAssembly.cs
index 4632525453..6737190c1c 100644
--- a/src/mscorlib/src/System/Reflection/RuntimeAssembly.cs
+++ b/src/mscorlib/src/System/Reflection/RuntimeAssembly.cs
@@ -18,7 +18,6 @@ using System.Diagnostics.Contracts;
namespace System.Reflection
{
- [Serializable]
internal class RuntimeAssembly : Assembly
{
#if FEATURE_APPX
@@ -261,15 +260,7 @@ namespace System.Reflection
// ISerializable implementation
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
- if (info == null)
- throw new ArgumentNullException(nameof(info));
-
- Contract.EndContractBlock();
-
- UnitySerializationHolder.GetUnitySerializationInfo(info,
- UnitySerializationHolder.AssemblyUnity,
- this.FullName,
- this);
+ throw new PlatformNotSupportedException();
}
public override Module ManifestModule
@@ -320,26 +311,6 @@ namespace System.Reflection
return CustomAttributeData.GetCustomAttributesInternal(this);
}
- [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod
- internal static RuntimeAssembly InternalLoadFrom(String assemblyFile,
- Evidence securityEvidence,
- byte[] hashValue,
- AssemblyHashAlgorithm hashAlgorithm,
- bool forIntrospection,
- ref StackCrawlMark stackMark)
- {
- if (assemblyFile == null)
- throw new ArgumentNullException(nameof(assemblyFile));
-
- Contract.EndContractBlock();
-
- AssemblyName an = new AssemblyName();
- an.CodeBase = assemblyFile;
- an.SetHashControl(hashValue, hashAlgorithm);
- // The stack mark is used for MDA filtering
- return InternalLoadAssemblyName(an, securityEvidence, null, ref stackMark, true /*thrownOnFileNotFound*/, forIntrospection);
- }
-
// Wrapper function to wrap the typical use of InternalLoad.
internal static RuntimeAssembly InternalLoad(String assemblyString,
Evidence assemblySecurity,
diff --git a/src/mscorlib/src/System/Reflection/RuntimeConstructorInfo.cs b/src/mscorlib/src/System/Reflection/RuntimeConstructorInfo.cs
index 8c3b1fce98..e0fb3ec87d 100644
--- a/src/mscorlib/src/System/Reflection/RuntimeConstructorInfo.cs
+++ b/src/mscorlib/src/System/Reflection/RuntimeConstructorInfo.cs
@@ -11,7 +11,6 @@ using RuntimeTypeCache = System.RuntimeType.RuntimeTypeCache;
namespace System.Reflection
{
- [Serializable]
internal sealed class RuntimeConstructorInfo : ConstructorInfo, ISerializable, IRuntimeMethodInfo
{
#region Private Data Members
@@ -465,10 +464,7 @@ namespace System.Reflection
#region ISerializable Implementation
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
- if (info == null)
- throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
- MemberInfoSerializationHolder.GetSerializationInfo(info, this);
+ throw new PlatformNotSupportedException();
}
internal string SerializationToString()
diff --git a/src/mscorlib/src/System/Reflection/RuntimeEventInfo.cs b/src/mscorlib/src/System/Reflection/RuntimeEventInfo.cs
index 930e1820bd..9e86867b6d 100644
--- a/src/mscorlib/src/System/Reflection/RuntimeEventInfo.cs
+++ b/src/mscorlib/src/System/Reflection/RuntimeEventInfo.cs
@@ -10,7 +10,6 @@ using RuntimeTypeCache = System.RuntimeType.RuntimeTypeCache;
namespace System.Reflection
{
- [Serializable]
internal unsafe sealed class RuntimeEventInfo : EventInfo, ISerializable
{
#region Private Data Members
@@ -159,11 +158,7 @@ namespace System.Reflection
#region ISerializable
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
- if (info == null)
- throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- MemberInfoSerializationHolder.GetSerializationInfo(info, this);
+ throw new PlatformNotSupportedException();
}
#endregion
diff --git a/src/mscorlib/src/System/Reflection/RuntimeFieldInfo.cs b/src/mscorlib/src/System/Reflection/RuntimeFieldInfo.cs
index 29cc97d225..e61c0922d7 100644
--- a/src/mscorlib/src/System/Reflection/RuntimeFieldInfo.cs
+++ b/src/mscorlib/src/System/Reflection/RuntimeFieldInfo.cs
@@ -9,7 +9,6 @@ using RuntimeTypeCache = System.RuntimeType.RuntimeTypeCache;
namespace System.Reflection
{
- [Serializable]
internal abstract class RuntimeFieldInfo : FieldInfo, ISerializable
{
#region Private Data Members
@@ -125,11 +124,7 @@ namespace System.Reflection
#region ISerializable Implementation
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
- if (info == null)
- throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- MemberInfoSerializationHolder.GetSerializationInfo(info, this);
+ throw new PlatformNotSupportedException();
}
#endregion
}
diff --git a/src/mscorlib/src/System/Reflection/RuntimeMethodInfo.cs b/src/mscorlib/src/System/Reflection/RuntimeMethodInfo.cs
index b8a2341e4e..3b2a75b1b7 100644
--- a/src/mscorlib/src/System/Reflection/RuntimeMethodInfo.cs
+++ b/src/mscorlib/src/System/Reflection/RuntimeMethodInfo.cs
@@ -14,7 +14,6 @@ using RuntimeTypeCache = System.RuntimeType.RuntimeTypeCache;
namespace System.Reflection
{
- [Serializable]
internal sealed class RuntimeMethodInfo : MethodInfo, ISerializable, IRuntimeMethodInfo
{
#region Private Data Members
@@ -772,14 +771,7 @@ namespace System.Reflection
#region ISerializable Implementation
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
- if (info == null)
- throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- if (m_reflectedTypeCache.IsGlobal)
- throw new NotSupportedException(SR.NotSupported_GlobalMethodSerialization);
-
- MemberInfoSerializationHolder.GetSerializationInfo(info, this);
+ throw new PlatformNotSupportedException();
}
internal string SerializationToString()
diff --git a/src/mscorlib/src/System/Reflection/RuntimeModule.cs b/src/mscorlib/src/System/Reflection/RuntimeModule.cs
index 75809cba01..f9b733736d 100644
--- a/src/mscorlib/src/System/Reflection/RuntimeModule.cs
+++ b/src/mscorlib/src/System/Reflection/RuntimeModule.cs
@@ -12,7 +12,6 @@ using System.Diagnostics.Contracts;
namespace System.Reflection
{
- [Serializable]
internal class RuntimeModule : Module
{
internal RuntimeModule() { throw new NotSupportedException(); }
@@ -448,12 +447,7 @@ namespace System.Reflection
#region Public Virtuals
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
- if (info == null)
- {
- throw new ArgumentNullException(nameof(info));
- }
- Contract.EndContractBlock();
- UnitySerializationHolder.GetUnitySerializationInfo(info, UnitySerializationHolder.ModuleUnity, this.ScopeName, this.GetRuntimeAssembly());
+ throw new PlatformNotSupportedException();
}
public override Type GetType(String className, bool throwOnError, bool ignoreCase)
diff --git a/src/mscorlib/src/System/Reflection/RuntimeParameterInfo.cs b/src/mscorlib/src/System/Reflection/RuntimeParameterInfo.cs
index addf68e75d..d21af03649 100644
--- a/src/mscorlib/src/System/Reflection/RuntimeParameterInfo.cs
+++ b/src/mscorlib/src/System/Reflection/RuntimeParameterInfo.cs
@@ -11,7 +11,6 @@ using MdToken = System.Reflection.MetadataToken;
namespace System.Reflection
{
- [Serializable]
internal unsafe sealed class RuntimeParameterInfo : ParameterInfo, ISerializable
{
#region Static Members
@@ -164,35 +163,7 @@ namespace System.Reflection
#region VTS magic to serialize/deserialized to/from pre-Whidbey endpoints.
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
- if (info == null)
- throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- // We could be serializing for consumption by a pre-Whidbey
- // endpoint. Therefore we set up all the serialized fields to look
- // just like a v1.0/v1.1 instance.
-
- // Need to set the type to ParameterInfo so that pre-Whidbey and Whidbey code
- // can deserialize this. This is also why we cannot simply use [OnSerializing].
- info.SetType(typeof(ParameterInfo));
-
- // Use the properties intead of the fields in case the fields haven't been et
- // _importer, bExtraConstChecked, and m_cachedData don't need to be set
-
- // Now set the legacy fields that the current implementation doesn't
- // use any more. Note that _importer is a raw pointer that should
- // never have been serialized in V1. We set it to zero here; if the
- // deserializer uses it (by calling GetCustomAttributes() on this
- // instance) they'll AV, but at least it will be a well defined
- // exception and not a random AV.
-
- info.AddValue("AttrsImpl", Attributes);
- info.AddValue("ClassImpl", ParameterType);
- info.AddValue("DefaultValueImpl", DefaultValue);
- info.AddValue("MemberImpl", Member);
- info.AddValue("NameImpl", Name);
- info.AddValue("PositionImpl", Position);
- info.AddValue("_token", m_tkParamDef);
+ throw new PlatformNotSupportedException();
}
#endregion
diff --git a/src/mscorlib/src/System/Reflection/RuntimePropertyInfo.cs b/src/mscorlib/src/System/Reflection/RuntimePropertyInfo.cs
index b6a4792e4f..24f6de1e77 100644
--- a/src/mscorlib/src/System/Reflection/RuntimePropertyInfo.cs
+++ b/src/mscorlib/src/System/Reflection/RuntimePropertyInfo.cs
@@ -12,7 +12,6 @@ using RuntimeTypeCache = System.RuntimeType.RuntimeTypeCache;
namespace System.Reflection
{
- [Serializable]
internal unsafe sealed class RuntimePropertyInfo : PropertyInfo, ISerializable
{
#region Private Data Members
@@ -451,11 +450,7 @@ namespace System.Reflection
#region ISerializable Implementation
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
- if (info == null)
- throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- MemberInfoSerializationHolder.GetSerializationInfo(info, this);
+ throw new PlatformNotSupportedException();
}
internal string SerializationToString()
diff --git a/src/mscorlib/src/System/Resources/ResourceManager.cs b/src/mscorlib/src/System/Resources/ResourceManager.cs
index 993efddbfc..e3981481f7 100644
--- a/src/mscorlib/src/System/Resources/ResourceManager.cs
+++ b/src/mscorlib/src/System/Resources/ResourceManager.cs
@@ -149,7 +149,6 @@ namespace System.Resources
// is one such example.
//
- [Serializable]
public class ResourceManager
{
internal class CultureNameResourceSetPair
diff --git a/src/mscorlib/src/System/Resources/ResourceSet.cs b/src/mscorlib/src/System/Resources/ResourceSet.cs
index 8775f6411a..b4029a7e9c 100644
--- a/src/mscorlib/src/System/Resources/ResourceSet.cs
+++ b/src/mscorlib/src/System/Resources/ResourceSet.cs
@@ -13,25 +13,25 @@
**
===========================================================*/
+using System;
+using System.Collections;
+using System.IO;
+using System.Globalization;
+using System.Runtime.InteropServices;
+using System.Reflection;
+using System.Runtime.Serialization;
+using System.Runtime.Versioning;
+using System.Diagnostics.Contracts;
+using System.Collections.Generic;
+
namespace System.Resources
{
- using System;
- using System.Collections;
- using System.IO;
- using System.Globalization;
- using System.Runtime.InteropServices;
- using System.Reflection;
- using System.Runtime.Serialization;
- using System.Runtime.Versioning;
- using System.Diagnostics.Contracts;
-
// A ResourceSet stores all the resources defined in one particular CultureInfo.
//
// The method used to load resources is straightforward - this class
// enumerates over an IResourceReader, loading every name and value, and
// stores them in a hash table. Custom IResourceReaders can be used.
- //
- [Serializable]
+ //
public class ResourceSet : IDisposable, IEnumerable
{
[NonSerialized] protected IResourceReader Reader;
@@ -39,11 +39,6 @@ namespace System.Resources
private Hashtable _caseInsensitiveTable; // For case-insensitive lookups.
-#if LOOSELY_LINKED_RESOURCE_REFERENCE
- [OptionalField]
- private Assembly _assembly; // For LooselyLinkedResourceReferences
-#endif // LOOSELY_LINKED_RESOURCE_REFERENCE
-
protected ResourceSet()
{
// To not inconvenience people subclassing us, we should allocate a new
@@ -68,16 +63,6 @@ namespace System.Resources
ReadResources();
}
-#if LOOSELY_LINKED_RESOURCE_REFERENCE
- public ResourceSet(String fileName, Assembly assembly)
- {
- Reader = new ResourceReader(fileName);
- CommonInit();
- _assembly = assembly;
- ReadResources();
- }
-#endif // LOOSELY_LINKED_RESOURCE_REFERENCE
-
// Creates a ResourceSet using the system default ResourceReader
// implementation. Use this constructor to read from an open stream
// of data.
@@ -89,16 +74,6 @@ namespace System.Resources
ReadResources();
}
-#if LOOSELY_LINKED_RESOURCE_REFERENCE
- public ResourceSet(Stream stream, Assembly assembly)
- {
- Reader = new ResourceReader(stream);
- CommonInit();
- _assembly = assembly;
- ReadResources();
- }
-#endif // LOOSELY_LINKED_RESOURCE_REFERENCE
-
public ResourceSet(IResourceReader reader)
{
if (reader == null)
@@ -109,19 +84,6 @@ namespace System.Resources
ReadResources();
}
-#if LOOSELY_LINKED_RESOURCE_REFERENCE
- public ResourceSet(IResourceReader reader, Assembly assembly)
- {
- if (reader == null)
- throw new ArgumentNullException(nameof(reader));
- Contract.EndContractBlock();
- Reader = reader;
- CommonInit();
- _assembly = assembly;
- ReadResources();
- }
-#endif // LOOSELY_LINKED_RESOURCE_REFERENCE
-
private void CommonInit()
{
Table = new Hashtable();
@@ -156,15 +118,6 @@ namespace System.Resources
Dispose(true);
}
-#if LOOSELY_LINKED_RESOURCE_REFERENCE
- // Optional - used for resolving assembly manifest resource references.
- // This can safely be null.
- public Assembly Assembly {
- get { return _assembly; }
- /*protected*/ set { _assembly = value; }
- }
-#endif // LOOSELY_LINKED_RESOURCE_REFERENCE
-
// Returns the preferred IResourceReader class for this kind of ResourceSet.
// Subclasses of ResourceSet using their own Readers &; should override
// GetDefaultReader and GetDefaultWriter.
@@ -178,7 +131,8 @@ namespace System.Resources
// GetDefaultReader and GetDefaultWriter.
public virtual Type GetDefaultWriter()
{
- return Type.GetType("System.Resources.ResourceWriter, System.Resources.Writer, Version=4.0.1.0, Culture=neutral, PublicKeyToken=" + AssemblyRef.MicrosoftPublicKeyToken, throwOnError: true);
+ Assembly resourceWriterAssembly = Assembly.Load("System.Resources.Writer, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
+ return resourceWriterAssembly.GetType("System.Resources.ResourceWriter", true);
}
public virtual IDictionaryEnumerator GetEnumerator()
@@ -271,12 +225,6 @@ namespace System.Resources
while (en.MoveNext())
{
Object value = en.Value;
-#if LOOSELY_LINKED_RESOURCE_REFERENCE
- if (Assembly != null && value is LooselyLinkedResourceReference) {
- LooselyLinkedResourceReference assRef = (LooselyLinkedResourceReference) value;
- value = assRef.Resolve(Assembly);
- }
-#endif //LOOSELYLINKEDRESOURCEREFERENCE
Table.Add(en.Key, value);
}
// While technically possible to close the Reader here, don't close it
@@ -308,10 +256,6 @@ namespace System.Resources
if (caseTable == null)
{
caseTable = new Hashtable(StringComparer.OrdinalIgnoreCase);
-#if _DEBUG
- //Console.WriteLine("ResourceSet::GetObject loading up case-insensitive data");
- BCLDebug.Perf(false, "Using case-insensitive lookups is bad perf-wise. Consider capitalizing " + name + " correctly in your source");
-#endif
IDictionaryEnumerator en = copyOfTable.GetEnumerator();
while (en.MoveNext())
diff --git a/src/mscorlib/src/System/RtType.cs b/src/mscorlib/src/System/RtType.cs
index ef3ba29787..68b9f5a75b 100644
--- a/src/mscorlib/src/System/RtType.cs
+++ b/src/mscorlib/src/System/RtType.cs
@@ -23,7 +23,6 @@ using System.Runtime.Serialization;
using System.Runtime.CompilerServices;
using System.Security;
using System.Text;
-using System.Runtime.Remoting;
using MdSigCallingConvention = System.Signature.MdSigCallingConvention;
using RuntimeTypeCache = System.RuntimeType.RuntimeTypeCache;
using System.Runtime.InteropServices;
@@ -72,7 +71,6 @@ namespace System
FullName,
}
- [Serializable]
internal class RuntimeType :
System.Reflection.TypeInfo, ISerializable, ICloneable
{
@@ -1200,7 +1198,7 @@ namespace System
{
string name = eventInfo.Name;
- if (csEventInfos.GetValueOrDefault(name) != null)
+ if (csEventInfos.ContainsKey(name))
continue;
csEventInfos[name] = eventInfo;
@@ -1355,10 +1353,8 @@ namespace System
if (csPropertyInfos != null)
{
string name = propertyInfo.Name;
-
- List<RuntimePropertyInfo> cache = csPropertyInfos.GetValueOrDefault(name);
-
- if (cache == null)
+ List<RuntimePropertyInfo> cache;
+ if (!csPropertyInfos.TryGetValue(name, out cache))
{
cache = new List<RuntimePropertyInfo>(1);
csPropertyInfos[name] = cache;
@@ -3792,6 +3788,11 @@ namespace System
#endregion
#region Misc
+ public override bool IsTypeDefinition
+ {
+ get { return RuntimeTypeHandle.IsTypeDefinition(this); }
+ }
+
public override Type MakePointerType() { return new RuntimeTypeHandle(this).MakePointer(); }
public override Type MakeByRefType() { return new RuntimeTypeHandle(this).MakeByRef(); }
public override Type MakeArrayType() { return new RuntimeTypeHandle(this).MakeSZArray(); }
@@ -4444,11 +4445,7 @@ namespace System
#region ISerializable
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
- if (info == null)
- throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- UnitySerializationHolder.GetUnitySerializationInfo(info, this);
+ throw new PlatformNotSupportedException();
}
#endregion
@@ -4908,7 +4905,6 @@ namespace System
// method (RuntimeType) and an instance of this type will work around the reason to have this type in the
// first place. However given RuntimeType is not public all its methods are protected and require full trust
// to be accessed
- [Serializable]
internal class ReflectionOnlyType : RuntimeType
{
private ReflectionOnlyType() { }
diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/ConditionalWeakTable.cs b/src/mscorlib/src/System/Runtime/CompilerServices/ConditionalWeakTable.cs
index f32cc2b510..6c6f6ee472 100644
--- a/src/mscorlib/src/System/Runtime/CompilerServices/ConditionalWeakTable.cs
+++ b/src/mscorlib/src/System/Runtime/CompilerServices/ConditionalWeakTable.cs
@@ -651,16 +651,10 @@ namespace System.Runtime.CompilerServices
int bucket = hashCode & (_buckets.Length - 1);
for (int entriesIndex = Volatile.Read(ref _buckets[bucket]); entriesIndex != -1; entriesIndex = _entries[entriesIndex].Next)
{
- if (_entries[entriesIndex].HashCode == hashCode)
+ if (_entries[entriesIndex].HashCode == hashCode && _entries[entriesIndex].depHnd.GetPrimaryAndSecondary(out value) == key)
{
- object primary, secondary;
- _entries[entriesIndex].depHnd.GetPrimaryAndSecondary(out primary, out secondary);
- if (primary == key)
- {
- GC.KeepAlive(this); // ensure we don't get finalized while accessing DependentHandles.
- value = secondary;
- return entriesIndex;
- }
+ GC.KeepAlive(this); // ensure we don't get finalized while accessing DependentHandles.
+ return entriesIndex;
}
}
@@ -677,7 +671,7 @@ namespace System.Runtime.CompilerServices
if (index < _entries.Length)
{
object oKey, oValue;
- _entries[index].depHnd.GetPrimaryAndSecondary(out oKey, out oValue);
+ oKey = _entries[index].depHnd.GetPrimaryAndSecondary(out oValue);
GC.KeepAlive(this); // ensure we don't get finalized while accessing DependentHandles.
if (oKey != null)
@@ -921,8 +915,8 @@ namespace System.Runtime.CompilerServices
{
for (int entriesIndex = _buckets[bucket]; entriesIndex != -1; entriesIndex = _entries[entriesIndex].Next)
{
- object primary = null, secondary = null;
- _entries[entriesIndex].depHnd.GetPrimaryAndSecondary(out primary, out secondary);
+ object primary, secondary;
+ primary = _entries[entriesIndex].depHnd.GetPrimaryAndSecondary(out secondary);
// Now that we've secured a strong reference to the secondary, must check the primary again
// to ensure it didn't expire (otherwise, we open a race where TryGetValue misreports an
@@ -951,7 +945,7 @@ namespace System.Runtime.CompilerServices
}
object thisKey, thisValue;
- _entries[entriesIndex].depHnd.GetPrimaryAndSecondary(out thisKey, out thisValue);
+ thisKey = _entries[entriesIndex].depHnd.GetPrimaryAndSecondary(out thisValue);
if (Equals(thisKey, key))
{
GC.KeepAlive(this); // ensure we don't get finalized while accessing DependentHandles.
@@ -1069,10 +1063,8 @@ namespace System.Runtime.CompilerServices
#region Constructors
public DependentHandle(object primary, object secondary)
{
- IntPtr handle = (IntPtr)0;
- nInitialize(primary, secondary, out handle);
// no need to check for null result: nInitialize expected to throw OOM.
- _handle = handle;
+ _handle = nInitialize(primary, secondary);
}
#endregion
@@ -1084,14 +1076,12 @@ namespace System.Runtime.CompilerServices
// primary.
public object GetPrimary()
{
- object primary;
- nGetPrimary(_handle, out primary);
- return primary;
+ return nGetPrimary(_handle);
}
- public void GetPrimaryAndSecondary(out object primary, out object secondary)
+ public object GetPrimaryAndSecondary(out object secondary)
{
- nGetPrimaryAndSecondary(_handle, out primary, out secondary);
+ return nGetPrimaryAndSecondary(_handle, out secondary);
}
public void SetPrimary(object primary)
@@ -1121,13 +1111,13 @@ namespace System.Runtime.CompilerServices
#region Private Members
[MethodImpl(MethodImplOptions.InternalCall)]
- private static extern void nInitialize(object primary, object secondary, out IntPtr dependentHandle);
+ private static extern IntPtr nInitialize(object primary, object secondary);
[MethodImpl(MethodImplOptions.InternalCall)]
- private static extern void nGetPrimary(IntPtr dependentHandle, out object primary);
+ private static extern object nGetPrimary(IntPtr dependentHandle);
[MethodImpl(MethodImplOptions.InternalCall)]
- private static extern void nGetPrimaryAndSecondary(IntPtr dependentHandle, out object primary, out object secondary);
+ private static extern object nGetPrimaryAndSecondary(IntPtr dependentHandle, out object secondary);
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void nSetPrimary(IntPtr dependentHandle, object primary);
diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/CustomConstantAttribute.cs b/src/mscorlib/src/System/Runtime/CompilerServices/CustomConstantAttribute.cs
index 8f4c79cd94..7393bb2bcd 100644
--- a/src/mscorlib/src/System/Runtime/CompilerServices/CustomConstantAttribute.cs
+++ b/src/mscorlib/src/System/Runtime/CompilerServices/CustomConstantAttribute.cs
@@ -7,7 +7,6 @@ using System.Collections.Generic;
namespace System.Runtime.CompilerServices
{
- [Serializable]
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
public abstract class CustomConstantAttribute : Attribute
{
diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/DateTimeConstantAttribute.cs b/src/mscorlib/src/System/Runtime/CompilerServices/DateTimeConstantAttribute.cs
index 7aca42b627..5155d0085d 100644
--- a/src/mscorlib/src/System/Runtime/CompilerServices/DateTimeConstantAttribute.cs
+++ b/src/mscorlib/src/System/Runtime/CompilerServices/DateTimeConstantAttribute.cs
@@ -7,7 +7,6 @@ using System.Diagnostics.Contracts;
namespace System.Runtime.CompilerServices
{
- [Serializable]
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
public sealed class DateTimeConstantAttribute : CustomConstantAttribute
{
diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/DecimalConstantAttribute.cs b/src/mscorlib/src/System/Runtime/CompilerServices/DecimalConstantAttribute.cs
index 0e2b6f8418..f5fd5a21a3 100644
--- a/src/mscorlib/src/System/Runtime/CompilerServices/DecimalConstantAttribute.cs
+++ b/src/mscorlib/src/System/Runtime/CompilerServices/DecimalConstantAttribute.cs
@@ -12,7 +12,6 @@ using System.Collections.Generic;
namespace System.Runtime.CompilerServices
{
- [Serializable]
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
public sealed class DecimalConstantAttribute : Attribute
{
diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/MethodImplAttribute.cs b/src/mscorlib/src/System/Runtime/CompilerServices/MethodImplAttribute.cs
index b24018cf78..3c19ee8863 100644
--- a/src/mscorlib/src/System/Runtime/CompilerServices/MethodImplAttribute.cs
+++ b/src/mscorlib/src/System/Runtime/CompilerServices/MethodImplAttribute.cs
@@ -12,7 +12,6 @@ namespace System.Runtime.CompilerServices
// certain method properties.
// Custom attribute to specify additional method properties.
- [Serializable]
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)]
sealed public class MethodImplAttribute : Attribute
{
diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/RuntimeWrappedException.cs b/src/mscorlib/src/System/Runtime/CompilerServices/RuntimeWrappedException.cs
index c050000169..df52f301e4 100644
--- a/src/mscorlib/src/System/Runtime/CompilerServices/RuntimeWrappedException.cs
+++ b/src/mscorlib/src/System/Runtime/CompilerServices/RuntimeWrappedException.cs
@@ -13,12 +13,10 @@
using System;
using System.Runtime.Serialization;
-using System.Runtime.Remoting;
using System.Diagnostics.Contracts;
namespace System.Runtime.CompilerServices
{
- [Serializable]
public sealed class RuntimeWrappedException : Exception
{
private RuntimeWrappedException(Object thrownObject)
@@ -37,19 +35,7 @@ namespace System.Runtime.CompilerServices
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
- if (info == null)
- {
- throw new ArgumentNullException(nameof(info));
- }
- Contract.EndContractBlock();
base.GetObjectData(info, context);
- info.AddValue("WrappedException", m_wrappedException, typeof(Object));
- }
-
- internal RuntimeWrappedException(SerializationInfo info, StreamingContext context)
- : base(info, context)
- {
- m_wrappedException = info.GetValue("WrappedException", typeof(Object));
}
}
}
diff --git a/src/mscorlib/src/System/Runtime/GcSettings.cs b/src/mscorlib/src/System/Runtime/GcSettings.cs
index 993a24f986..ecb28e6034 100644
--- a/src/mscorlib/src/System/Runtime/GcSettings.cs
+++ b/src/mscorlib/src/System/Runtime/GcSettings.cs
@@ -13,14 +13,12 @@ namespace System.Runtime
// These settings are the same format as in clr\src\vm\gcpriv.h
// make sure you change that file if you change this file!
- [Serializable]
public enum GCLargeObjectHeapCompactionMode
{
Default = 1,
CompactOnce = 2
}
- [Serializable]
public enum GCLatencyMode
{
Batch = 0,
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/ArrayWithOffset.cs b/src/mscorlib/src/System/Runtime/InteropServices/ArrayWithOffset.cs
index c4beb024b1..e009db277f 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/ArrayWithOffset.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/ArrayWithOffset.cs
@@ -9,7 +9,6 @@ using System.Runtime.Versioning;
namespace System.Runtime.InteropServices
{
- [Serializable]
public struct ArrayWithOffset
{
//private ArrayWithOffset()
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/Attributes.cs b/src/mscorlib/src/System/Runtime/InteropServices/Attributes.cs
index ccba51e840..668358995b 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/Attributes.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/Attributes.cs
@@ -46,7 +46,6 @@ namespace System.Runtime.InteropServices
public int Value { get { return _val; } }
}
- [Serializable]
public enum ComInterfaceType
{
InterfaceIsDual = 0,
@@ -84,7 +83,6 @@ namespace System.Runtime.InteropServices
public Type Value { get { return _val; } }
}
- [Serializable]
public enum ClassInterfaceType
{
None = 0,
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/BStrWrapper.cs b/src/mscorlib/src/System/Runtime/InteropServices/BStrWrapper.cs
index 77c38139cd..586b03b366 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/BStrWrapper.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/BStrWrapper.cs
@@ -17,7 +17,6 @@ using System.Security;
namespace System.Runtime.InteropServices
{
- [Serializable]
public sealed class BStrWrapper
{
public BStrWrapper(String value)
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/COMException.cs b/src/mscorlib/src/System/Runtime/InteropServices/COMException.cs
index 889a74f6bc..8ee10ed349 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/COMException.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/COMException.cs
@@ -22,7 +22,6 @@ namespace System.Runtime.InteropServices
{
// Exception for COM Interop errors where we don't recognize the HResult.
//
- [Serializable]
public class COMException : ExternalException
{
public COMException()
@@ -51,6 +50,7 @@ namespace System.Runtime.InteropServices
protected COMException(SerializationInfo info, StreamingContext context) : base(info, context)
{
+ throw new PlatformNotSupportedException();
}
public override String ToString()
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/ComEventsHelper.cs b/src/mscorlib/src/System/Runtime/InteropServices/ComEventsHelper.cs
index 8198d9fd18..fe69f619fe 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/ComEventsHelper.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/ComEventsHelper.cs
@@ -99,7 +99,6 @@
// code:ComEventsMethod.Invoke
using System;
-using System.Runtime.Remoting;
namespace System.Runtime.InteropServices
{
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/ComMemberType.cs b/src/mscorlib/src/System/Runtime/InteropServices/ComMemberType.cs
index ea99781975..2de01465d3 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/ComMemberType.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/ComMemberType.cs
@@ -9,7 +9,6 @@ using System;
namespace System.Runtime.InteropServices
{
- [Serializable]
public enum ComMemberType
{
Method = 0,
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/ComTypes/ITypeComp.cs b/src/mscorlib/src/System/Runtime/InteropServices/ComTypes/ITypeComp.cs
index 967746f379..ae403d138c 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/ComTypes/ITypeComp.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/ComTypes/ITypeComp.cs
@@ -15,7 +15,6 @@ using System;
namespace System.Runtime.InteropServices.ComTypes
{
- [Serializable]
public enum DESCKIND
{
DESCKIND_NONE = 0,
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/ComTypes/ITypeInfo.cs b/src/mscorlib/src/System/Runtime/InteropServices/ComTypes/ITypeInfo.cs
index 1857fdbb35..4cd102f76e 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/ComTypes/ITypeInfo.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/ComTypes/ITypeInfo.cs
@@ -15,7 +15,6 @@ using System;
namespace System.Runtime.InteropServices.ComTypes
{
- [Serializable]
public enum TYPEKIND
{
TKIND_ENUM = 0,
@@ -29,7 +28,6 @@ namespace System.Runtime.InteropServices.ComTypes
TKIND_MAX = TKIND_UNION + 1
}
- [Serializable]
[Flags()]
public enum TYPEFLAGS : short
{
@@ -50,7 +48,6 @@ namespace System.Runtime.InteropServices.ComTypes
TYPEFLAG_FPROXY = 0x4000
}
- [Serializable]
[Flags()]
public enum IMPLTYPEFLAGS
{
@@ -106,7 +103,6 @@ namespace System.Runtime.InteropServices.ComTypes
public Int16 wFuncFlags; //WORD wFuncFlags;
}
- [Serializable]
[Flags()]
public enum IDLFLAG : short
{
@@ -125,7 +121,6 @@ namespace System.Runtime.InteropServices.ComTypes
public IDLFLAG wIDLFlags;
}
- [Serializable]
[Flags()]
public enum PARAMFLAG : short
{
@@ -173,7 +168,6 @@ namespace System.Runtime.InteropServices.ComTypes
public DESCUNION desc;
}
- [Serializable]
public enum VARKIND : int
{
VAR_PERINSTANCE = 0x0,
@@ -231,7 +225,6 @@ namespace System.Runtime.InteropServices.ComTypes
public Int32 scode;
}
- [Serializable]
public enum FUNCKIND : int
{
FUNC_VIRTUAL = 0,
@@ -241,7 +234,6 @@ namespace System.Runtime.InteropServices.ComTypes
FUNC_DISPATCH = 4
}
- [Serializable]
[Flags]
public enum INVOKEKIND : int
{
@@ -251,7 +243,6 @@ namespace System.Runtime.InteropServices.ComTypes
INVOKE_PROPERTYPUTREF = 0x8
}
- [Serializable]
public enum CALLCONV : int
{
CC_CDECL = 1,
@@ -266,7 +257,6 @@ namespace System.Runtime.InteropServices.ComTypes
CC_MAX = 9
}
- [Serializable]
[Flags()]
public enum FUNCFLAGS : short
{
@@ -285,7 +275,6 @@ namespace System.Runtime.InteropServices.ComTypes
FUNCFLAG_FIMMEDIATEBIND = 0x1000
}
- [Serializable]
[Flags()]
public enum VARFLAGS : short
{
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/ComTypes/ITypeLib.cs b/src/mscorlib/src/System/Runtime/InteropServices/ComTypes/ITypeLib.cs
index 3ed6e42d08..05a9e3f176 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/ComTypes/ITypeLib.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/ComTypes/ITypeLib.cs
@@ -15,7 +15,6 @@ using System;
namespace System.Runtime.InteropServices.ComTypes
{
- [Serializable]
public enum SYSKIND
{
SYS_WIN16 = 0,
@@ -24,7 +23,6 @@ namespace System.Runtime.InteropServices.ComTypes
SYS_WIN64 = SYS_MAC + 1
}
- [Serializable]
[Flags()]
public enum LIBFLAGS : short
{
@@ -35,7 +33,6 @@ namespace System.Runtime.InteropServices.ComTypes
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
- [Serializable]
public struct TYPELIBATTR
{
public Guid guid;
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/CurrencyWrapper.cs b/src/mscorlib/src/System/Runtime/InteropServices/CurrencyWrapper.cs
index 4b436825e8..590925aafe 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/CurrencyWrapper.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/CurrencyWrapper.cs
@@ -16,7 +16,6 @@ using System;
namespace System.Runtime.InteropServices
{
- [Serializable]
public sealed class CurrencyWrapper
{
public CurrencyWrapper(Decimal obj)
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/DispatchWrapper.cs b/src/mscorlib/src/System/Runtime/InteropServices/DispatchWrapper.cs
index 87ec4ed15e..5fb78c56ad 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/DispatchWrapper.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/DispatchWrapper.cs
@@ -17,7 +17,6 @@ using System.Security;
namespace System.Runtime.InteropServices
{
- [Serializable]
public sealed class DispatchWrapper
{
public DispatchWrapper(Object obj)
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/ErrorWrapper.cs b/src/mscorlib/src/System/Runtime/InteropServices/ErrorWrapper.cs
index 73be2c5777..34237d539a 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/ErrorWrapper.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/ErrorWrapper.cs
@@ -16,7 +16,6 @@ using System;
namespace System.Runtime.InteropServices
{
- [Serializable]
public sealed class ErrorWrapper
{
public ErrorWrapper(int errorCode)
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/GcHandle.cs b/src/mscorlib/src/System/Runtime/InteropServices/GcHandle.cs
index dcb9e24258..2ee81a9f5c 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/GcHandle.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/GcHandle.cs
@@ -18,7 +18,6 @@ namespace System.Runtime.InteropServices
// IMPORTANT: These must match the definitions in ObjectHandle.h in the EE.
// IMPORTANT: If new values are added to the enum the GCHandle::MaxHandleType
// constant must be updated.
- [Serializable]
public enum GCHandleType
{
Weak = 0,
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/ICustomQueryInterface.cs b/src/mscorlib/src/System/Runtime/InteropServices/ICustomQueryInterface.cs
index 4f4b10bbf0..f0aa35e7dd 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/ICustomQueryInterface.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/ICustomQueryInterface.cs
@@ -19,7 +19,6 @@ namespace System.Runtime.InteropServices
//====================================================================
// The enum of the return value of IQuerable.GetInterface
//====================================================================
- [Serializable]
public enum CustomQueryInterfaceResult
{
Handled = 0,
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/InvalidComObjectException.cs b/src/mscorlib/src/System/Runtime/InteropServices/InvalidComObjectException.cs
index 2fae2b6e52..bf89df94bb 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/InvalidComObjectException.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/InvalidComObjectException.cs
@@ -17,7 +17,6 @@ using System.Runtime.Serialization;
namespace System.Runtime.InteropServices
{
- [Serializable]
public class InvalidComObjectException : SystemException
{
public InvalidComObjectException()
@@ -40,6 +39,7 @@ namespace System.Runtime.InteropServices
protected InvalidComObjectException(SerializationInfo info, StreamingContext context) : base(info, context)
{
+ throw new PlatformNotSupportedException();
}
}
}
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/InvalidOleVariantTypeException.cs b/src/mscorlib/src/System/Runtime/InteropServices/InvalidOleVariantTypeException.cs
index 5154a028ad..412853920e 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/InvalidOleVariantTypeException.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/InvalidOleVariantTypeException.cs
@@ -16,7 +16,6 @@ using System.Runtime.Serialization;
namespace System.Runtime.InteropServices
{
- [Serializable]
public class InvalidOleVariantTypeException : SystemException
{
public InvalidOleVariantTypeException()
@@ -39,6 +38,7 @@ namespace System.Runtime.InteropServices
protected InvalidOleVariantTypeException(SerializationInfo info, StreamingContext context) : base(info, context)
{
+ throw new PlatformNotSupportedException();
}
}
}
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/Marshal.cs b/src/mscorlib/src/System/Runtime/InteropServices/Marshal.cs
index 6fb631121b..03750bcb8b 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/Marshal.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/Marshal.cs
@@ -15,13 +15,13 @@
namespace System.Runtime.InteropServices
{
using System;
+ using System.Runtime;
using System.Collections.Generic;
using System.Reflection;
using System.Reflection.Emit;
using System.Security;
using System.Text;
using System.Threading;
- using System.Runtime.Remoting;
using System.Runtime.CompilerServices;
using System.Globalization;
using System.Runtime.ConstrainedExecution;
@@ -31,8 +31,8 @@ namespace System.Runtime.InteropServices
using System.Diagnostics;
using System.Diagnostics.Contracts;
using System.Runtime.InteropServices.ComTypes;
+ using System.StubHelpers;
- [Serializable]
public enum CustomQueryInterfaceMode
{
Ignore = 0,
@@ -406,9 +406,9 @@ namespace System.Runtime.InteropServices
//====================================================================
// Read from memory
//====================================================================
- public static byte ReadByte([MarshalAs(UnmanagedType.AsAny), In] Object ptr, int ofs)
+ public static byte ReadByte(Object ptr, int ofs)
{
- throw new PlatformNotSupportedException(); // https://github.com/dotnet/coreclr/issues/10442
+ return ReadValueSlow(ptr, ofs, (IntPtr nativeHome, int offset) => Marshal.ReadByte(nativeHome, offset));
}
public static unsafe byte ReadByte(IntPtr ptr, int ofs)
@@ -430,9 +430,9 @@ namespace System.Runtime.InteropServices
return ReadByte(ptr, 0);
}
- public static short ReadInt16([MarshalAs(UnmanagedType.AsAny), In] Object ptr, int ofs)
+ public static short ReadInt16(Object ptr, int ofs)
{
- throw new PlatformNotSupportedException(); // https://github.com/dotnet/coreclr/issues/10442
+ return ReadValueSlow(ptr, ofs, (IntPtr nativeHome, int offset) => Marshal.ReadInt16(nativeHome, offset));
}
public static unsafe short ReadInt16(IntPtr ptr, int ofs)
@@ -467,9 +467,9 @@ namespace System.Runtime.InteropServices
return ReadInt16(ptr, 0);
}
- public static int ReadInt32([MarshalAs(UnmanagedType.AsAny), In] Object ptr, int ofs)
+ public static int ReadInt32(object ptr, int ofs)
{
- throw new PlatformNotSupportedException(); // https://github.com/dotnet/coreclr/issues/10442
+ return ReadValueSlow(ptr, ofs, (IntPtr nativeHome, int offset) => Marshal.ReadInt32(nativeHome, offset));
}
public static unsafe int ReadInt32(IntPtr ptr, int ofs)
@@ -506,7 +506,7 @@ namespace System.Runtime.InteropServices
return ReadInt32(ptr, 0);
}
- public static IntPtr ReadIntPtr([MarshalAs(UnmanagedType.AsAny), In] Object ptr, int ofs)
+ public static IntPtr ReadIntPtr(Object ptr, int ofs)
{
#if BIT64
return (IntPtr)ReadInt64(ptr, ofs);
@@ -535,7 +535,7 @@ namespace System.Runtime.InteropServices
public static long ReadInt64([MarshalAs(UnmanagedType.AsAny), In] Object ptr, int ofs)
{
- throw new PlatformNotSupportedException(); // https://github.com/dotnet/coreclr/issues/10442
+ return ReadValueSlow(ptr, ofs, (IntPtr nativeHome, int offset) => Marshal.ReadInt64(nativeHome, offset));
}
public static unsafe long ReadInt64(IntPtr ptr, int ofs)
@@ -576,6 +576,41 @@ namespace System.Runtime.InteropServices
return ReadInt64(ptr, 0);
}
+ //====================================================================
+ // Read value from marshaled object (marshaled using AsAny)
+ // It's quite slow and can return back dangling pointers
+ // It's only there for backcompact
+ // I don't think we should spend time optimizing it
+ // People should really call the IntPtr overload instead
+ //====================================================================
+ private static unsafe T ReadValueSlow<T>(object ptr, int ofs, Func<IntPtr, int, T> readValueHelper)
+ {
+ // We AV on desktop if passing NULL. So this is technically a breaking change but is an improvement
+ if (ptr == null)
+ throw new ArgumentNullException(nameof(ptr));
+
+ int dwFlags =
+ (int)AsAnyMarshaler.AsAnyFlags.In |
+ (int)AsAnyMarshaler.AsAnyFlags.IsAnsi |
+ (int)AsAnyMarshaler.AsAnyFlags.IsBestFit;
+
+ MngdNativeArrayMarshaler.MarshalerState nativeArrayMarshalerState = new MngdNativeArrayMarshaler.MarshalerState();
+ AsAnyMarshaler marshaler = new AsAnyMarshaler(new IntPtr(&nativeArrayMarshalerState));
+
+ IntPtr pNativeHome = IntPtr.Zero;
+
+ try
+ {
+ pNativeHome = marshaler.ConvertToNative(ptr, dwFlags);
+ return readValueHelper(pNativeHome, ofs);
+ }
+ finally
+ {
+ marshaler.ClearNative(pNativeHome);
+ }
+ }
+
+
//====================================================================
// Write to memory
@@ -594,9 +629,9 @@ namespace System.Runtime.InteropServices
}
}
- public static void WriteByte([MarshalAs(UnmanagedType.AsAny), In, Out] Object ptr, int ofs, byte val)
+ public static void WriteByte(Object ptr, int ofs, byte val)
{
- throw new PlatformNotSupportedException(); // https://github.com/dotnet/coreclr/issues/10442
+ WriteValueSlow(ptr, ofs, val, (IntPtr nativeHome, int offset, byte value) => Marshal.WriteByte(nativeHome, offset, value));
}
public static void WriteByte(IntPtr ptr, byte val)
@@ -629,9 +664,9 @@ namespace System.Runtime.InteropServices
}
}
- public static void WriteInt16([MarshalAs(UnmanagedType.AsAny), In, Out] Object ptr, int ofs, short val)
+ public static void WriteInt16(Object ptr, int ofs, short val)
{
- throw new PlatformNotSupportedException(); // https://github.com/dotnet/coreclr/issues/10442
+ WriteValueSlow(ptr, ofs, val, (IntPtr nativeHome, int offset, short value) => Marshal.WriteInt16(nativeHome, offset, value));
}
public static void WriteInt16(IntPtr ptr, short val)
@@ -681,9 +716,9 @@ namespace System.Runtime.InteropServices
}
}
- public static void WriteInt32([MarshalAs(UnmanagedType.AsAny), In, Out] Object ptr, int ofs, int val)
+ public static void WriteInt32(Object ptr, int ofs, int val)
{
- throw new PlatformNotSupportedException(); // https://github.com/dotnet/coreclr/issues/10442
+ WriteValueSlow(ptr, ofs, val, (IntPtr nativeHome, int offset, int value) => Marshal.WriteInt32(nativeHome, offset, value));
}
public static void WriteInt32(IntPtr ptr, int val)
@@ -700,7 +735,7 @@ namespace System.Runtime.InteropServices
#endif
}
- public static void WriteIntPtr([MarshalAs(UnmanagedType.AsAny), In, Out] Object ptr, int ofs, IntPtr val)
+ public static void WriteIntPtr(Object ptr, int ofs, IntPtr val)
{
#if BIT64
WriteInt64(ptr, ofs, (long)val);
@@ -749,9 +784,9 @@ namespace System.Runtime.InteropServices
}
}
- public static void WriteInt64([MarshalAs(UnmanagedType.AsAny), In, Out] Object ptr, int ofs, long val)
+ public static void WriteInt64(Object ptr, int ofs, long val)
{
- throw new PlatformNotSupportedException(); // https://github.com/dotnet/coreclr/issues/10442
+ WriteValueSlow(ptr, ofs, val, (IntPtr nativeHome, int offset, long value) => Marshal.WriteInt64(nativeHome, offset, value));
}
public static void WriteInt64(IntPtr ptr, long val)
@@ -759,6 +794,41 @@ namespace System.Runtime.InteropServices
WriteInt64(ptr, 0, val);
}
+ //====================================================================
+ // Write value into marshaled object (marshaled using AsAny) and
+ // propagate the value back
+ // It's quite slow and is only there for backcompact
+ // I don't think we should spend time optimizing it
+ // People should really call the IntPtr overload instead
+ //====================================================================
+ private static unsafe void WriteValueSlow<T>(object ptr, int ofs, T val, Action<IntPtr, int, T> writeValueHelper)
+ {
+ // We AV on desktop if passing NULL. So this is technically a breaking change but is an improvement
+ if (ptr == null)
+ throw new ArgumentNullException(nameof(ptr));
+
+ int dwFlags =
+ (int)AsAnyMarshaler.AsAnyFlags.In |
+ (int)AsAnyMarshaler.AsAnyFlags.Out |
+ (int)AsAnyMarshaler.AsAnyFlags.IsAnsi |
+ (int)AsAnyMarshaler.AsAnyFlags.IsBestFit;
+
+ MngdNativeArrayMarshaler.MarshalerState nativeArrayMarshalerState = new MngdNativeArrayMarshaler.MarshalerState();
+ AsAnyMarshaler marshaler = new AsAnyMarshaler(new IntPtr(&nativeArrayMarshalerState));
+
+ IntPtr pNativeHome = IntPtr.Zero;
+
+ try
+ {
+ pNativeHome = marshaler.ConvertToNative(ptr, dwFlags);
+ writeValueHelper(pNativeHome, ofs, val);
+ marshaler.ConvertToManaged(ptr, pNativeHome);
+ }
+ finally
+ {
+ marshaler.ClearNative(pNativeHome);
+ }
+ }
//====================================================================
// GetLastWin32Error
@@ -1772,11 +1842,7 @@ namespace System.Runtime.InteropServices
}
Contract.EndContractBlock();
-#if FEATURE_COMINTEROP
return s.MarshalToBSTR();
-#else
- throw new PlatformNotSupportedException(); // https://github.com/dotnet/coreclr/issues/10443
-#endif
}
public static IntPtr SecureStringToCoTaskMemAnsi(SecureString s)
@@ -1800,30 +1866,28 @@ namespace System.Runtime.InteropServices
return s.MarshalToString(globalAlloc: false, unicode: true);
}
-
-#if FEATURE_COMINTEROP
+
public static void ZeroFreeBSTR(IntPtr s)
{
- Win32Native.ZeroMemory(s, (UIntPtr)(Win32Native.SysStringLen(s) * 2));
+ RuntimeImports.RhZeroMemory(s, (UIntPtr)(Win32Native.SysStringLen(s) * 2));
FreeBSTR(s);
}
-#endif
public static void ZeroFreeCoTaskMemAnsi(IntPtr s)
{
- Win32Native.ZeroMemory(s, (UIntPtr)(Win32Native.lstrlenA(s)));
+ RuntimeImports.RhZeroMemory(s, (UIntPtr)(Win32Native.lstrlenA(s)));
FreeCoTaskMem(s);
}
public static void ZeroFreeCoTaskMemUnicode(IntPtr s)
{
- Win32Native.ZeroMemory(s, (UIntPtr)(Win32Native.lstrlenW(s) * 2));
+ RuntimeImports.RhZeroMemory(s, (UIntPtr)(Win32Native.lstrlenW(s) * 2));
FreeCoTaskMem(s);
}
unsafe public static void ZeroFreeCoTaskMemUTF8(IntPtr s)
{
- Win32Native.ZeroMemory(s, (UIntPtr)System.StubHelpers.StubHelpers.strlen((sbyte*)s));
+ RuntimeImports.RhZeroMemory(s, (UIntPtr)System.StubHelpers.StubHelpers.strlen((sbyte*)s));
FreeCoTaskMem(s);
}
@@ -1851,13 +1915,13 @@ namespace System.Runtime.InteropServices
public static void ZeroFreeGlobalAllocAnsi(IntPtr s)
{
- Win32Native.ZeroMemory(s, (UIntPtr)(Win32Native.lstrlenA(s)));
+ RuntimeImports.RhZeroMemory(s, (UIntPtr)(Win32Native.lstrlenA(s)));
FreeHGlobal(s);
}
public static void ZeroFreeGlobalAllocUnicode(IntPtr s)
{
- Win32Native.ZeroMemory(s, (UIntPtr)(Win32Native.lstrlenW(s) * 2));
+ RuntimeImports.RhZeroMemory(s, (UIntPtr)(Win32Native.lstrlenW(s) * 2));
FreeHGlobal(s);
}
}
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/MarshalDirectiveException.cs b/src/mscorlib/src/System/Runtime/InteropServices/MarshalDirectiveException.cs
index 6fe7574e26..75b291af30 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/MarshalDirectiveException.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/MarshalDirectiveException.cs
@@ -17,7 +17,6 @@ using System.Runtime.Serialization;
namespace System.Runtime.InteropServices
{
- [Serializable]
public class MarshalDirectiveException : SystemException
{
public MarshalDirectiveException()
@@ -40,6 +39,7 @@ namespace System.Runtime.InteropServices
protected MarshalDirectiveException(SerializationInfo info, StreamingContext context) : base(info, context)
{
+ throw new PlatformNotSupportedException();
}
}
}
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/NonPortable.cs b/src/mscorlib/src/System/Runtime/InteropServices/NonPortable.cs
index 7b7c5efb90..c79af8b459 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/NonPortable.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/NonPortable.cs
@@ -171,11 +171,6 @@ namespace System.Runtime.InteropServices
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
}
-
- public static void ZeroFreeBSTR(System.IntPtr s)
- {
- throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
- }
}
public class DispatchWrapper
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/PInvokeMap.cs b/src/mscorlib/src/System/Runtime/InteropServices/PInvokeMap.cs
index ed289fd14b..33f1b5f09c 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/PInvokeMap.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/PInvokeMap.cs
@@ -16,7 +16,6 @@ using System;
namespace System.Runtime.InteropServices
{
// This Enum matchs the CorPinvokeMap defined in CorHdr.h
- [Serializable]
internal enum PInvokeMap
{
NoMangle = 0x0001, // Pinvoke is to use the member name as specified.
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/PInvokeMarshal.cs b/src/mscorlib/src/System/Runtime/InteropServices/PInvokeMarshal.cs
new file mode 100644
index 0000000000..9eb60bdce7
--- /dev/null
+++ b/src/mscorlib/src/System/Runtime/InteropServices/PInvokeMarshal.cs
@@ -0,0 +1,24 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using Microsoft.Win32;
+
+namespace System.Runtime.InteropServices
+{
+ internal static class PInvokeMarshal
+ {
+ public static IntPtr AllocBSTR(int length)
+ {
+ IntPtr bstr = Win32Native.SysAllocStringLen(null, length);
+ if (bstr == IntPtr.Zero)
+ throw new OutOfMemoryException();
+ return bstr;
+ }
+
+ public static void FreeBSTR(IntPtr ptr)
+ {
+ Win32Native.SysFreeString(ptr);
+ }
+ }
+}
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/SEHException.cs b/src/mscorlib/src/System/Runtime/InteropServices/SEHException.cs
index 5595fadc43..d61e79757c 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/SEHException.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/SEHException.cs
@@ -19,7 +19,6 @@ namespace System.Runtime.InteropServices
{
// Exception for Structured Exception Handler exceptions.
//
- [Serializable]
public class SEHException : ExternalException
{
public SEHException()
@@ -42,6 +41,7 @@ namespace System.Runtime.InteropServices
protected SEHException(SerializationInfo info, StreamingContext context) : base(info, context)
{
+ throw new PlatformNotSupportedException();
}
// Exceptions can be resumable, meaning a filtered exception
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/SafeArrayRankMismatchException.cs b/src/mscorlib/src/System/Runtime/InteropServices/SafeArrayRankMismatchException.cs
index f39f1f3a41..9df858f0b1 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/SafeArrayRankMismatchException.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/SafeArrayRankMismatchException.cs
@@ -16,7 +16,6 @@ using System.Runtime.Serialization;
namespace System.Runtime.InteropServices
{
- [Serializable]
public class SafeArrayRankMismatchException : SystemException
{
public SafeArrayRankMismatchException()
@@ -39,6 +38,7 @@ namespace System.Runtime.InteropServices
protected SafeArrayRankMismatchException(SerializationInfo info, StreamingContext context) : base(info, context)
{
+ throw new PlatformNotSupportedException();
}
}
}
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/SafeArrayTypeMismatchException.cs b/src/mscorlib/src/System/Runtime/InteropServices/SafeArrayTypeMismatchException.cs
index 2283263422..4b03691e82 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/SafeArrayTypeMismatchException.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/SafeArrayTypeMismatchException.cs
@@ -17,7 +17,6 @@ using System.Runtime.Serialization;
namespace System.Runtime.InteropServices
{
- [Serializable]
public class SafeArrayTypeMismatchException : SystemException
{
public SafeArrayTypeMismatchException()
@@ -40,6 +39,7 @@ namespace System.Runtime.InteropServices
protected SafeArrayTypeMismatchException(SerializationInfo info, StreamingContext context) : base(info, context)
{
+ throw new PlatformNotSupportedException();
}
}
}
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/UnknownWrapper.cs b/src/mscorlib/src/System/Runtime/InteropServices/UnknownWrapper.cs
index c758ae1b4f..de06cbf1a8 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/UnknownWrapper.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/UnknownWrapper.cs
@@ -16,7 +16,6 @@ using System;
namespace System.Runtime.InteropServices
{
- [Serializable]
public sealed class UnknownWrapper
{
public UnknownWrapper(Object obj)
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/VariantWrapper.cs b/src/mscorlib/src/System/Runtime/InteropServices/VariantWrapper.cs
index 50689e08f8..455f0759fe 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/VariantWrapper.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/VariantWrapper.cs
@@ -16,8 +16,6 @@ using System;
namespace System.Runtime.InteropServices
{
- [Serializable]
-
public sealed class VariantWrapper
{
public VariantWrapper(Object obj)
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ConstantSplittableMap.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ConstantSplittableMap.cs
index 4549a407e0..0ed0bb3f7b 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ConstantSplittableMap.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ConstantSplittableMap.cs
@@ -21,7 +21,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime
/// </summary>
/// <typeparam name="TKey">Type of objects that act as keys.</typeparam>
/// <typeparam name="TValue">Type of objects that act as entries / values.</typeparam>
- [Serializable]
[DebuggerDisplay("Count = {Count}")]
internal sealed class ConstantSplittableMap<TKey, TValue> : IMapView<TKey, TValue>
{
@@ -169,7 +168,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime
#region IKeyValuePair Enumerator
- [Serializable]
internal struct IKeyValuePairEnumerator : IEnumerator<IKeyValuePair<TKey, TValue>>
{
private KeyValuePair<TKey, TValue>[] _array;
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryKeyCollection.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryKeyCollection.cs
index 2a34aba717..f2434ce91d 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryKeyCollection.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryKeyCollection.cs
@@ -9,7 +9,6 @@ using System.Diagnostics;
namespace System.Runtime.InteropServices.WindowsRuntime
{
- [Serializable]
[DebuggerDisplay("Count = {Count}")]
internal sealed class DictionaryKeyCollection<TKey, TValue> : ICollection<TKey>
{
@@ -83,7 +82,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime
} // public class DictionaryKeyCollection<TKey, TValue>
- [Serializable]
internal sealed class DictionaryKeyEnumerator<TKey, TValue> : IEnumerator<TKey>
{
private readonly IDictionary<TKey, TValue> dictionary;
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryValueCollection.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryValueCollection.cs
index 083b0ffcb1..6be0ddd9f0 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryValueCollection.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryValueCollection.cs
@@ -13,7 +13,6 @@ using System.Runtime.InteropServices.WindowsRuntime;
namespace System.Runtime.InteropServices.WindowsRuntime
{
- [Serializable]
[DebuggerDisplay("Count = {Count}")]
internal sealed class DictionaryValueCollection<TKey, TValue> : ICollection<TValue>
{
@@ -91,7 +90,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime
} // public class DictionaryValueCollection<TKey, TValue>
- [Serializable]
internal sealed class DictionaryValueEnumerator<TKey, TValue> : IEnumerator<TValue>
{
private readonly IDictionary<TKey, TValue> dictionary;
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IMapViewToIReadOnlyDictionaryAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IMapViewToIReadOnlyDictionaryAdapter.cs
index e06364dcae..0900012338 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IMapViewToIReadOnlyDictionaryAdapter.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IMapViewToIReadOnlyDictionaryAdapter.cs
@@ -123,7 +123,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime
}
// Note: One day we may make these return IReadOnlyCollection<T>
- [Serializable]
[DebuggerDisplay("Count = {Count}")]
internal sealed class ReadOnlyDictionaryKeyCollection<TKey, TValue> : IEnumerable<TKey>
{
@@ -178,7 +177,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime
} // public class ReadOnlyDictionaryKeyCollection<TKey, TValue>
- [Serializable]
internal sealed class ReadOnlyDictionaryKeyEnumerator<TKey, TValue> : IEnumerator<TKey>
{
private readonly IReadOnlyDictionary<TKey, TValue> dictionary;
@@ -220,7 +218,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime
} // class ReadOnlyDictionaryKeyEnumerator<TKey, TValue>
- [Serializable]
[DebuggerDisplay("Count = {Count}")]
internal sealed class ReadOnlyDictionaryValueCollection<TKey, TValue> : IEnumerable<TValue>
{
@@ -279,7 +276,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime
} // public class ReadOnlyDictionaryValueCollection<TKey, TValue>
- [Serializable]
internal sealed class ReadOnlyDictionaryValueEnumerator<TKey, TValue> : IEnumerator<TValue>
{
private readonly IReadOnlyDictionary<TKey, TValue> dictionary;
diff --git a/src/mscorlib/src/System/Runtime/Loader/AssemblyLoadContext.cs b/src/mscorlib/src/System/Runtime/Loader/AssemblyLoadContext.cs
index de8137f1ec..a7bf871a39 100644
--- a/src/mscorlib/src/System/Runtime/Loader/AssemblyLoadContext.cs
+++ b/src/mscorlib/src/System/Runtime/Loader/AssemblyLoadContext.cs
@@ -71,15 +71,9 @@ namespace System.Runtime.Loader
[SuppressUnmanagedCodeSecurity]
private static extern void LoadFromPath(IntPtr ptrNativeAssemblyLoadContext, string ilPath, string niPath, ObjectHandleOnStack retAssembly);
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- private static extern void GetLoadedAssembliesInternal(ObjectHandleOnStack assemblies);
-
public static Assembly[] GetLoadedAssemblies()
{
- Assembly[] assemblies = null;
- GetLoadedAssembliesInternal(JitHelpers.GetObjectHandleOnStack(ref assemblies));
- return assemblies;
+ return AppDomain.CurrentDomain.GetAssemblies(false);
}
// These are helpers that can be used by AssemblyLoadContext derivations.
diff --git a/src/mscorlib/src/System/Runtime/Remoting/ObjectHandle.cs b/src/mscorlib/src/System/Runtime/Remoting/ObjectHandle.cs
deleted file mode 100644
index e76882d6df..0000000000
--- a/src/mscorlib/src/System/Runtime/Remoting/ObjectHandle.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-**
-**
-** ObjectHandle wraps object references. A Handle allows a
-** marshal by value object to be returned through an
-** indirection allowing the caller to control when the
-** object is loaded into their domain.
-**
-**
-===========================================================*/
-
-using System;
-using System.Runtime.InteropServices;
-
-namespace System.Runtime.Remoting
-{
- public class ObjectHandle
- {
- private Object WrappedObject;
-
- private ObjectHandle()
- {
- }
-
- internal ObjectHandle(Object o)
- {
- WrappedObject = o;
- }
-
- internal Object Unwrap()
- {
- return WrappedObject;
- }
- }
-}
diff --git a/src/mscorlib/src/System/Runtime/RuntimeImports.cs b/src/mscorlib/src/System/Runtime/RuntimeImports.cs
index 16d41d3951..ed0c556575 100644
--- a/src/mscorlib/src/System/Runtime/RuntimeImports.cs
+++ b/src/mscorlib/src/System/Runtime/RuntimeImports.cs
@@ -8,7 +8,7 @@ using System.Runtime.InteropServices;
#if BIT64
using nuint = System.UInt64;
#else
- using nuint = System.UInt32;
+using nuint = System.UInt32;
#endif
namespace System.Runtime
@@ -26,8 +26,13 @@ namespace System.Runtime
}
}
+ internal unsafe static void RhZeroMemory(IntPtr p, UIntPtr byteLength)
+ {
+ RhZeroMemory((void*)p, (nuint)byteLength);
+ }
+
[DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- extern private unsafe static void RhZeroMemory(byte* b, nuint byteLength);
+ extern private unsafe static void RhZeroMemory(void* b, nuint byteLength);
[MethodImpl(MethodImplOptions.InternalCall)]
internal extern unsafe static void RhBulkMoveWithWriteBarrier(ref byte destination, ref byte source, nuint byteCount);
diff --git a/src/mscorlib/src/System/Runtime/Serialization/FormatterServices.cs b/src/mscorlib/src/System/Runtime/Serialization/FormatterServices.cs
index 18139324a3..b49b372b4b 100644
--- a/src/mscorlib/src/System/Runtime/Serialization/FormatterServices.cs
+++ b/src/mscorlib/src/System/Runtime/Serialization/FormatterServices.cs
@@ -17,7 +17,6 @@ using System.Reflection;
using System.Collections;
using System.Collections.Generic;
using System.Security;
-using System.Runtime.Remoting;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Threading;
diff --git a/src/mscorlib/src/System/Runtime/Serialization/SerializationInfo.cs b/src/mscorlib/src/System/Runtime/Serialization/SerializationInfo.cs
index 7fc3ce27d9..8fb54c79a7 100644
--- a/src/mscorlib/src/System/Runtime/Serialization/SerializationInfo.cs
+++ b/src/mscorlib/src/System/Runtime/Serialization/SerializationInfo.cs
@@ -15,7 +15,6 @@
using System;
using System.Collections.Generic;
using System.Reflection;
-using System.Runtime.Remoting;
using System.Globalization;
using System.Diagnostics;
using System.Diagnostics.Contracts;
diff --git a/src/mscorlib/src/System/RuntimeHandles.cs b/src/mscorlib/src/System/RuntimeHandles.cs
index ab125e741e..ceda5abfee 100644
--- a/src/mscorlib/src/System/RuntimeHandles.cs
+++ b/src/mscorlib/src/System/RuntimeHandles.cs
@@ -23,7 +23,6 @@ namespace System
using System.Diagnostics.Contracts;
using StackCrawlMark = System.Threading.StackCrawlMark;
- [Serializable]
public unsafe struct RuntimeTypeHandle : ISerializable
{
// Returns handle for interop with EE. The handle is guaranteed to be non-null.
@@ -127,6 +126,24 @@ namespace System
m_type = type;
}
+ internal static bool IsTypeDefinition(RuntimeType type)
+ {
+ CorElementType corElemType = GetCorElementType(type);
+ if (!((corElemType >= CorElementType.Void && corElemType < CorElementType.Ptr) ||
+ corElemType == CorElementType.ValueType ||
+ corElemType == CorElementType.Class ||
+ corElemType == CorElementType.TypedByRef ||
+ corElemType == CorElementType.I ||
+ corElemType == CorElementType.U ||
+ corElemType == CorElementType.Object))
+ return false;
+
+ if (HasInstantiation(type) && !IsGenericTypeDefinition(type))
+ return false;
+
+ return true;
+ }
+
internal static bool IsPrimitive(RuntimeType type)
{
CorElementType corElemType = GetCorElementType(type);
@@ -653,30 +670,9 @@ namespace System
return new MetadataImport(_GetMetadataImport(type), type);
}
- private RuntimeTypeHandle(SerializationInfo info, StreamingContext context)
- {
- if (info == null)
- throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- RuntimeType m = (RuntimeType)info.GetValue("TypeObj", typeof(RuntimeType));
-
- m_type = m;
-
- if (m_type == null)
- throw new SerializationException(SR.Serialization_InsufficientState);
- }
-
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
- if (info == null)
- throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- if (m_type == null)
- throw new SerializationException(SR.Serialization_InvalidFieldState);
-
- info.AddValue("TypeObj", m_type, typeof(RuntimeType));
+ throw new PlatformNotSupportedException();
}
}
@@ -766,7 +762,6 @@ namespace System
}
}
- [Serializable]
public unsafe struct RuntimeMethodHandle : ISerializable
{
// Returns handle for interop with EE. The handle is guaranteed to be non-null.
@@ -796,33 +791,9 @@ namespace System
}
// ISerializable interface
- private RuntimeMethodHandle(SerializationInfo info, StreamingContext context)
- {
- if (info == null)
- throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- MethodBase m = (MethodBase)info.GetValue("MethodObj", typeof(MethodBase));
-
- m_value = m.MethodHandle.m_value;
-
- if (m_value == null)
- throw new SerializationException(SR.Serialization_InsufficientState);
- }
-
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
- if (info == null)
- throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- if (m_value == null)
- throw new SerializationException(SR.Serialization_InvalidFieldState);
-
- // This is either a RuntimeMethodInfo or a RuntimeConstructorInfo
- MethodBase methodInfo = RuntimeType.GetMethodBase(m_value);
-
- info.AddValue("MethodObj", methodInfo, typeof(MethodBase));
+ throw new PlatformNotSupportedException();
}
public IntPtr Value
@@ -1149,7 +1120,6 @@ namespace System
}
}
- [Serializable]
public unsafe struct RuntimeFieldHandle : ISerializable
{
// Returns handle for interop with EE. The handle is guaranteed to be non-null.
@@ -1297,35 +1267,9 @@ namespace System
internal static extern void CheckAttributeAccess(RuntimeFieldHandle fieldHandle, RuntimeModule decoratedTarget);
// ISerializable interface
- private RuntimeFieldHandle(SerializationInfo info, StreamingContext context)
- {
- if (info == null)
- throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- FieldInfo f = (RuntimeFieldInfo)info.GetValue("FieldObj", typeof(RuntimeFieldInfo));
-
- if (f == null)
- throw new SerializationException(SR.Serialization_InsufficientState);
-
- m_ptr = f.FieldHandle.m_ptr;
-
- if (m_ptr == null)
- throw new SerializationException(SR.Serialization_InsufficientState);
- }
-
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
- if (info == null)
- throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- if (m_ptr == null)
- throw new SerializationException(SR.Serialization_InvalidFieldState);
-
- RuntimeFieldInfo fldInfo = (RuntimeFieldInfo)RuntimeType.GetFieldInfo(this.GetRuntimeFieldInfo());
-
- info.AddValue("FieldObj", fldInfo, typeof(RuntimeFieldInfo));
+ throw new PlatformNotSupportedException();
}
}
diff --git a/src/mscorlib/src/System/SByte.cs b/src/mscorlib/src/System/SByte.cs
index 2f1b2da947..9e550936fe 100644
--- a/src/mscorlib/src/System/SByte.cs
+++ b/src/mscorlib/src/System/SByte.cs
@@ -24,7 +24,7 @@ namespace System
public struct SByte : IComparable, IFormattable, IConvertible
, IComparable<SByte>, IEquatable<SByte>
{
- private sbyte m_value;
+ private sbyte m_value; // Do not rename (binary serialization)
// The maximum value that a Byte may represent: 127.
public const sbyte MaxValue = (sbyte)0x7F;
diff --git a/src/mscorlib/src/System/SharedStatics.cs b/src/mscorlib/src/System/SharedStatics.cs
index a6a04d9614..5c37f25446 100644
--- a/src/mscorlib/src/System/SharedStatics.cs
+++ b/src/mscorlib/src/System/SharedStatics.cs
@@ -12,7 +12,6 @@
=============================================================================*/
using System.Threading;
-using System.Runtime.Remoting;
using System.Security;
using System.Runtime.CompilerServices;
using System.Runtime.ConstrainedExecution;
diff --git a/src/mscorlib/src/System/Single.cs b/src/mscorlib/src/System/Single.cs
index 1c39df7d94..24e6839be6 100644
--- a/src/mscorlib/src/System/Single.cs
+++ b/src/mscorlib/src/System/Single.cs
@@ -25,7 +25,7 @@ namespace System
public struct Single : IComparable, IFormattable, IConvertible
, IComparable<Single>, IEquatable<Single>
{
- internal float m_value;
+ private float m_value; // Do not rename (binary serialization)
//
// Public constants
diff --git a/src/mscorlib/src/System/StubHelpers.cs b/src/mscorlib/src/System/StubHelpers.cs
index f584ece6fc..716fa06a41 100644
--- a/src/mscorlib/src/System/StubHelpers.cs
+++ b/src/mscorlib/src/System/StubHelpers.cs
@@ -700,6 +700,17 @@ namespace System.StubHelpers
internal static class MngdNativeArrayMarshaler
{
+ // Needs to match exactly with MngdNativeArrayMarshaler in ilmarshalers.h
+ internal struct MarshalerState
+ {
+ IntPtr m_pElementMT;
+ IntPtr m_Array;
+ int m_NativeDataValid;
+ int m_BestFitMap;
+ int m_ThrowOnUnmappableChar;
+ short m_vt;
+ }
+
[MethodImplAttribute(MethodImplOptions.InternalCall)]
static internal extern void CreateMarshaler(IntPtr pMarshalState, IntPtr pMT, int dwFlags);
@@ -949,11 +960,21 @@ namespace System.StubHelpers
// Cleanup list to be destroyed when clearing the native view (for layouts with SafeHandles).
private CleanupWorkList cleanupWorkList;
- private static bool IsIn(int dwFlags) { return ((dwFlags & 0x10000000) != 0); }
- private static bool IsOut(int dwFlags) { return ((dwFlags & 0x20000000) != 0); }
- private static bool IsAnsi(int dwFlags) { return ((dwFlags & 0x00FF0000) != 0); }
- private static bool IsThrowOn(int dwFlags) { return ((dwFlags & 0x0000FF00) != 0); }
- private static bool IsBestFit(int dwFlags) { return ((dwFlags & 0x000000FF) != 0); }
+ [Flags]
+ internal enum AsAnyFlags
+ {
+ In = 0x10000000,
+ Out = 0x20000000,
+ IsAnsi = 0x00FF0000,
+ IsThrowOn = 0x0000FF00,
+ IsBestFit = 0x000000FF
+ }
+
+ private static bool IsIn(int dwFlags) { return ((dwFlags & (int)AsAnyFlags.In) != 0); }
+ private static bool IsOut(int dwFlags) { return ((dwFlags & (int)AsAnyFlags.Out) != 0); }
+ private static bool IsAnsi(int dwFlags) { return ((dwFlags & (int)AsAnyFlags.IsAnsi) != 0); }
+ private static bool IsThrowOn(int dwFlags) { return ((dwFlags & (int)AsAnyFlags.IsThrowOn) != 0); }
+ private static bool IsBestFit(int dwFlags) { return ((dwFlags & (int)AsAnyFlags.IsBestFit) != 0); }
internal AsAnyMarshaler(IntPtr pvArrayMarshaler)
{
diff --git a/src/mscorlib/src/System/Text/DecoderBestFitFallback.cs b/src/mscorlib/src/System/Text/DecoderBestFitFallback.cs
index ad88ef4400..f70213f8d6 100644
--- a/src/mscorlib/src/System/Text/DecoderBestFitFallback.cs
+++ b/src/mscorlib/src/System/Text/DecoderBestFitFallback.cs
@@ -14,7 +14,6 @@ using System.Diagnostics.Contracts;
namespace System.Text
{
- [Serializable]
internal sealed class InternalDecoderBestFitFallback : DecoderFallback
{
// Our variables
diff --git a/src/mscorlib/src/System/Text/DecoderExceptionFallback.cs b/src/mscorlib/src/System/Text/DecoderExceptionFallback.cs
index b98ef74ed2..7a8db572d0 100644
--- a/src/mscorlib/src/System/Text/DecoderExceptionFallback.cs
+++ b/src/mscorlib/src/System/Text/DecoderExceptionFallback.cs
@@ -8,7 +8,6 @@ using System.Globalization;
namespace System.Text
{
- [Serializable]
public sealed class DecoderExceptionFallback : DecoderFallback
{
// Construction
@@ -99,7 +98,6 @@ namespace System.Text
}
// Exception for decoding unknown byte sequences.
- [Serializable]
public sealed class DecoderFallbackException : ArgumentException
{
private byte[] bytesUnknown = null;
@@ -125,6 +123,7 @@ namespace System.Text
internal DecoderFallbackException(SerializationInfo info, StreamingContext context) : base(info, context)
{
+ throw new PlatformNotSupportedException();
}
public DecoderFallbackException(
diff --git a/src/mscorlib/src/System/Text/DecoderFallback.cs b/src/mscorlib/src/System/Text/DecoderFallback.cs
index 9311cda585..2a56706b98 100644
--- a/src/mscorlib/src/System/Text/DecoderFallback.cs
+++ b/src/mscorlib/src/System/Text/DecoderFallback.cs
@@ -13,7 +13,6 @@ using System.Diagnostics.Contracts;
namespace System.Text
{
- [Serializable]
public abstract class DecoderFallback
{
internal bool bIsMicrosoftBestFitFallback = false;
diff --git a/src/mscorlib/src/System/Text/DecoderNLS.cs b/src/mscorlib/src/System/Text/DecoderNLS.cs
index 6fcfc79140..c2791e9227 100644
--- a/src/mscorlib/src/System/Text/DecoderNLS.cs
+++ b/src/mscorlib/src/System/Text/DecoderNLS.cs
@@ -21,7 +21,6 @@ namespace System.Text
// of Encoding objects.
//
- [Serializable]
internal class DecoderNLS : Decoder, ISerializable
{
// Remember our encoding
@@ -32,21 +31,10 @@ namespace System.Text
#region Serialization
- // Constructor called by serialization. called during deserialization.
- internal DecoderNLS(SerializationInfo info, StreamingContext context)
- {
- throw new NotSupportedException(
- String.Format(
- System.Globalization.CultureInfo.CurrentCulture,
- SR.NotSupported_TypeCannotDeserialized, this.GetType()));
- }
-
- // ISerializable implementation. called during serialization.
+ // ISerializable implementation.
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
{
- SerializeDecoder(info);
- info.AddValue("encoding", this.m_encoding);
- info.SetType(typeof(Encoding.DefaultDecoder));
+ throw new PlatformNotSupportedException();
}
#endregion Serialization
diff --git a/src/mscorlib/src/System/Text/DecoderReplacementFallback.cs b/src/mscorlib/src/System/Text/DecoderReplacementFallback.cs
index b27469156d..0eaca3de40 100644
--- a/src/mscorlib/src/System/Text/DecoderReplacementFallback.cs
+++ b/src/mscorlib/src/System/Text/DecoderReplacementFallback.cs
@@ -8,7 +8,6 @@ using System.Diagnostics.Contracts;
namespace System.Text
{
- [Serializable]
public sealed class DecoderReplacementFallback : DecoderFallback
{
// Our variables
diff --git a/src/mscorlib/src/System/Text/EncoderBestFitFallback.cs b/src/mscorlib/src/System/Text/EncoderBestFitFallback.cs
index eb3165526b..b007f57efe 100644
--- a/src/mscorlib/src/System/Text/EncoderBestFitFallback.cs
+++ b/src/mscorlib/src/System/Text/EncoderBestFitFallback.cs
@@ -15,7 +15,6 @@ using System.Diagnostics.Contracts;
namespace System.Text
{
- [Serializable]
internal sealed class InternalEncoderBestFitFallback : EncoderFallback
{
// Our variables
diff --git a/src/mscorlib/src/System/Text/EncoderExceptionFallback.cs b/src/mscorlib/src/System/Text/EncoderExceptionFallback.cs
index b75847d1e7..192ab78670 100644
--- a/src/mscorlib/src/System/Text/EncoderExceptionFallback.cs
+++ b/src/mscorlib/src/System/Text/EncoderExceptionFallback.cs
@@ -8,7 +8,6 @@ using System.Diagnostics.Contracts;
namespace System.Text
{
- [Serializable]
public sealed class EncoderExceptionFallback : EncoderFallback
{
// Construction
@@ -99,7 +98,6 @@ namespace System.Text
}
}
- [Serializable]
public sealed class EncoderFallbackException : ArgumentException
{
private char charUnknown;
@@ -125,10 +123,6 @@ namespace System.Text
HResult = __HResults.COR_E_ARGUMENT;
}
- internal EncoderFallbackException(SerializationInfo info, StreamingContext context) : base(info, context)
- {
- }
-
internal EncoderFallbackException(
String message, char charUnknown, int index) : base(message)
{
diff --git a/src/mscorlib/src/System/Text/EncoderFallback.cs b/src/mscorlib/src/System/Text/EncoderFallback.cs
index 410b6f5016..c3b9f47284 100644
--- a/src/mscorlib/src/System/Text/EncoderFallback.cs
+++ b/src/mscorlib/src/System/Text/EncoderFallback.cs
@@ -10,7 +10,6 @@ using System.Diagnostics.Contracts;
namespace System.Text
{
- [Serializable]
public abstract class EncoderFallback
{
// disable csharp compiler warning #0414: field assigned unused value
diff --git a/src/mscorlib/src/System/Text/EncoderNLS.cs b/src/mscorlib/src/System/Text/EncoderNLS.cs
index 99a26ca575..8a8c31ee2f 100644
--- a/src/mscorlib/src/System/Text/EncoderNLS.cs
+++ b/src/mscorlib/src/System/Text/EncoderNLS.cs
@@ -21,7 +21,6 @@ namespace System.Text
// of Encoding objects.
//
- [Serializable]
internal class EncoderNLS : Encoder, ISerializable
{
// Need a place for the last left over character, most of our encodings use this
@@ -35,22 +34,10 @@ namespace System.Text
#region Serialization
- // Constructor called by serialization. called during deserialization.
- internal EncoderNLS(SerializationInfo info, StreamingContext context)
- {
- throw new NotSupportedException(
- String.Format(
- System.Globalization.CultureInfo.CurrentCulture,
- SR.NotSupported_TypeCannotDeserialized, this.GetType()));
- }
-
- // ISerializable implementation. called during serialization.
+ // ISerializable implementation.
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
{
- SerializeEncoder(info);
- info.AddValue("encoding", this.m_encoding);
- info.AddValue("charLeftOver", this.charLeftOver);
- info.SetType(typeof(Encoding.DefaultEncoder));
+ throw new PlatformNotSupportedException();
}
#endregion Serialization
diff --git a/src/mscorlib/src/System/Text/EncoderReplacementFallback.cs b/src/mscorlib/src/System/Text/EncoderReplacementFallback.cs
index 65b807c1bd..a9ce9c10ef 100644
--- a/src/mscorlib/src/System/Text/EncoderReplacementFallback.cs
+++ b/src/mscorlib/src/System/Text/EncoderReplacementFallback.cs
@@ -9,7 +9,6 @@ using System.Diagnostics.Contracts;
namespace System.Text
{
- [Serializable]
public sealed class EncoderReplacementFallback : EncoderFallback
{
// Our variables
diff --git a/src/mscorlib/src/System/Text/Encoding.cs b/src/mscorlib/src/System/Text/Encoding.cs
index 159123495b..88eeb19d24 100644
--- a/src/mscorlib/src/System/Text/Encoding.cs
+++ b/src/mscorlib/src/System/Text/Encoding.cs
@@ -8,7 +8,6 @@ namespace System.Text
using System.Collections;
using System.Collections.Generic;
using System.Runtime;
- using System.Runtime.Remoting;
using System.Runtime.Serialization;
using System.Globalization;
using System.Security;
@@ -82,7 +81,6 @@ namespace System.Text
// generally executes faster.
//
- [Serializable]
public abstract class Encoding : ICloneable
{
// For netcore we use UTF8 as default encoding since ANSI isn't available
@@ -1409,7 +1407,6 @@ namespace System.Text
decoder.ClearMustFlush();
}
- [Serializable]
internal sealed class DefaultEncoder : Encoder, IObjectReference, ISerializable
{
private Encoding m_encoding;
@@ -1422,60 +1419,16 @@ namespace System.Text
m_encoding = encoding;
m_hasInitializedEncoding = true;
}
-
- // Constructor called by serialization, have to handle deserializing from Everett
- internal DefaultEncoder(SerializationInfo info, StreamingContext context)
- {
- if (info == null) throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- // All we have is our encoding
- m_encoding = (Encoding)info.GetValue("encoding", typeof(Encoding));
-
- try
- {
- this.m_fallback = (EncoderFallback)info.GetValue("m_fallback", typeof(EncoderFallback));
- this.charLeftOver = (Char)info.GetValue("charLeftOver", typeof(Char));
- }
- catch (SerializationException)
- {
- }
- }
-
- // Just get it from GetEncoding
+
public Object GetRealObject(StreamingContext context)
{
- // upon deserialization since the DefaultEncoder implement IObjectReference the
- // serialization code tries to do the fixup. The fixup returns another
- // IObjectReference (the DefaultEncoder) class and hence so on and on.
- // Finally the deserialization logics fails after following maximum references
- // unless we short circuit with the following
- if (m_hasInitializedEncoding)
- {
- return this;
- }
-
- Encoder encoder = m_encoding.GetEncoder();
- if (m_fallback != null)
- encoder.m_fallback = m_fallback;
- if (charLeftOver != (char)0)
- {
- EncoderNLS encoderNls = encoder as EncoderNLS;
- if (encoderNls != null)
- encoderNls.charLeftOver = charLeftOver;
- }
- return encoder;
+ throw new PlatformNotSupportedException();
}
// ISerializable implementation, get data for this object
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
{
- // Any info?
- if (info == null) throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- // All we have is our encoding
- info.AddValue("encoding", m_encoding);
+ throw new PlatformNotSupportedException();
}
// Returns the number of bytes the next call to GetBytes will
@@ -1531,7 +1484,6 @@ namespace System.Text
}
}
- [Serializable]
internal sealed class DefaultDecoder : Decoder, IObjectReference, ISerializable
{
private Encoding m_encoding;
@@ -1544,55 +1496,15 @@ namespace System.Text
m_hasInitializedEncoding = true;
}
- // Constructor called by serialization, have to handle deserializing from Everett
- internal DefaultDecoder(SerializationInfo info, StreamingContext context)
- {
- // Any info?
- if (info == null) throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- // All we have is our encoding
- m_encoding = (Encoding)info.GetValue("encoding", typeof(Encoding));
-
- try
- {
- this.m_fallback = (DecoderFallback)info.GetValue("m_fallback", typeof(DecoderFallback));
- }
- catch (SerializationException)
- {
- m_fallback = null;
- }
- }
-
- // Just get it from GetEncoding
public Object GetRealObject(StreamingContext context)
{
- // upon deserialization since the DefaultEncoder implement IObjectReference the
- // serialization code tries to do the fixup. The fixup returns another
- // IObjectReference (the DefaultEncoder) class and hence so on and on.
- // Finally the deserialization logics fails after following maximum references
- // unless we short circuit with the following
- if (m_hasInitializedEncoding)
- {
- return this;
- }
-
- Decoder decoder = m_encoding.GetDecoder();
- if (m_fallback != null)
- decoder.m_fallback = m_fallback;
-
- return decoder;
+ throw new PlatformNotSupportedException();
}
- // ISerializable implementation, get data for this object
+ // ISerializable implementation
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
{
- // Any info?
- if (info == null) throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- // All we have is our encoding
- info.AddValue("encoding", m_encoding);
+ throw new PlatformNotSupportedException();
}
// Returns the number of characters the next call to GetChars will
diff --git a/src/mscorlib/src/System/Text/Latin1Encoding.cs b/src/mscorlib/src/System/Text/Latin1Encoding.cs
index e456b8533d..3f040b29ad 100644
--- a/src/mscorlib/src/System/Text/Latin1Encoding.cs
+++ b/src/mscorlib/src/System/Text/Latin1Encoding.cs
@@ -18,7 +18,6 @@ namespace System.Text
// Latin1Encoding is a simple override to optimize the GetString version of Latin1Encoding.
// because of the best fit cases we can't do this when encoding the string, only when decoding
//
- [Serializable]
internal class Latin1Encoding : EncodingNLS, ISerializable
{
// Used by Encoding.Latin1 for lazy initialization
@@ -30,30 +29,10 @@ namespace System.Text
{
}
- // Constructor called by serialization.
- // Note: We use the base GetObjectData however
- internal Latin1Encoding(SerializationInfo info, StreamingContext context) :
- base(Encoding.ISO_8859_1)
- {
- // Set up our base, also throws if info was empty
- DeserializeEncoding(info, context);
-
- // Nothing unique to Whidbey for Latin1
- }
-
- // ISerializable implementation, serialize it as a CodePageEncoding
+ // ISerializable implementation
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
{
- // Make sure to get the base stuff too This throws if info is null
- SerializeEncoding(info, context);
- Debug.Assert(info != null, "[Latin1Encoding.GetObjectData] Expected null info to throw");
-
- // In Everett this is a CodePageEncoding, so it needs maxCharSize
- info.AddValue("CodePageEncoding+maxCharSize", 1);
-
- // And extras for Everett's wierdness
- info.AddValue("CodePageEncoding+m_codePage", this.CodePage);
- info.AddValue("CodePageEncoding+dataItem", null);
+ throw new PlatformNotSupportedException();
}
// GetByteCount
diff --git a/src/mscorlib/src/System/Text/UTF7Encoding.cs b/src/mscorlib/src/System/Text/UTF7Encoding.cs
index 372af0da37..0ac3b66889 100644
--- a/src/mscorlib/src/System/Text/UTF7Encoding.cs
+++ b/src/mscorlib/src/System/Text/UTF7Encoding.cs
@@ -13,7 +13,6 @@ using System.Diagnostics.Contracts;
namespace System.Text
{
- [Serializable]
public class UTF7Encoding : Encoding
{
private const String base64Chars =
@@ -832,7 +831,6 @@ namespace System.Text
return charCount;
}
- [Serializable]
// Of all the amazing things... This MUST be Decoder so that our com name
// for System.Text.Decoder doesn't change
private sealed class Decoder : DecoderNLS, ISerializable
@@ -849,32 +847,10 @@ namespace System.Text
// base calls reset
}
- // Constructor called by serialization, have to handle deserializing from Everett
- internal Decoder(SerializationInfo info, StreamingContext context)
- {
- // Any info?
- if (info == null) throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- // Get common info
- this.bits = (int)info.GetValue("bits", typeof(int));
- this.bitCount = (int)info.GetValue("bitCount", typeof(int));
- this.firstByte = (bool)info.GetValue("firstByte", typeof(bool));
- this.m_encoding = (Encoding)info.GetValue("encoding", typeof(Encoding));
- }
-
// ISerializable implementation, get data for this object
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
{
- // Any info?
- if (info == null) throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- // Save Whidbey data
- info.AddValue("encoding", this.m_encoding);
- info.AddValue("bits", this.bits);
- info.AddValue("bitCount", this.bitCount);
- info.AddValue("firstByte", this.firstByte);
+ throw new PlatformNotSupportedException();
}
public override void Reset()
@@ -898,7 +874,6 @@ namespace System.Text
}
}
- [Serializable]
// Of all the amazing things... This MUST be Encoder so that our com name
// for System.Text.Encoder doesn't change
private sealed class Encoder : EncoderNLS, ISerializable
@@ -913,30 +888,10 @@ namespace System.Text
// base calls reset
}
- // Constructor called by serialization, have to handle deserializing from Everett
- internal Encoder(SerializationInfo info, StreamingContext context)
- {
- // Any info?
- if (info == null) throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- // Get common info
- this.bits = (int)info.GetValue("bits", typeof(int));
- this.bitCount = (int)info.GetValue("bitCount", typeof(int));
- this.m_encoding = (Encoding)info.GetValue("encoding", typeof(Encoding));
- }
-
- // ISerializable implementation, get data for this object
+ // ISerializable implementation
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
{
- // Any info?
- if (info == null) throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- // Save Whidbey data
- info.AddValue("encoding", this.m_encoding);
- info.AddValue("bits", this.bits);
- info.AddValue("bitCount", this.bitCount);
+ throw new PlatformNotSupportedException();
}
public override void Reset()
@@ -959,7 +914,6 @@ namespace System.Text
// Preexisting UTF7 behavior for bad bytes was just to spit out the byte as the next char
// and turn off base64 mode if it was in that mode. We still exit the mode, but now we fallback.
- [Serializable]
private sealed class DecoderUTF7Fallback : DecoderFallback
{
// Construction. Default replacement fallback uses no best fit and ? replacement string
diff --git a/src/mscorlib/src/System/Threading/ClrThreadPoolBoundHandle.Unix.cs b/src/mscorlib/src/System/Threading/ClrThreadPoolBoundHandle.Unix.cs
new file mode 100644
index 0000000000..b7cdaa801c
--- /dev/null
+++ b/src/mscorlib/src/System/Threading/ClrThreadPoolBoundHandle.Unix.cs
@@ -0,0 +1,21 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Diagnostics;
+using System.Runtime.InteropServices;
+
+namespace System.Threading
+{
+ public sealed partial class ThreadPoolBoundHandle
+ {
+ private static ThreadPoolBoundHandle BindHandleCore(SafeHandle handle)
+ {
+ Debug.Assert(handle != null);
+ Debug.Assert(!handle.IsClosed);
+ Debug.Assert(!handle.IsInvalid);
+
+ throw new PlatformNotSupportedException(SR.PlatformNotSupported_OverlappedIO);
+ }
+ }
+}
diff --git a/src/mscorlib/src/System/Threading/ClrThreadPoolBoundHandle.Windows.cs b/src/mscorlib/src/System/Threading/ClrThreadPoolBoundHandle.Windows.cs
new file mode 100644
index 0000000000..21c1c5f4a4
--- /dev/null
+++ b/src/mscorlib/src/System/Threading/ClrThreadPoolBoundHandle.Windows.cs
@@ -0,0 +1,42 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Diagnostics;
+using System.Runtime.InteropServices;
+
+namespace System.Threading
+{
+ public sealed partial class ThreadPoolBoundHandle
+ {
+ private static ThreadPoolBoundHandle BindHandleCore(SafeHandle handle)
+ {
+ Debug.Assert(handle != null);
+ Debug.Assert(!handle.IsClosed);
+ Debug.Assert(!handle.IsInvalid);
+
+ try
+ {
+ // ThreadPool.BindHandle will always return true, otherwise, it throws. See the underlying FCall
+ // implementation in ThreadPoolNative::CorBindIoCompletionCallback to see the implementation.
+ bool succeeded = ThreadPool.BindHandle(handle);
+ Debug.Assert(succeeded);
+ }
+ catch (Exception ex)
+ { // BindHandle throws ApplicationException on full CLR and Exception on CoreCLR.
+ // We do not let either of these leak and convert them to ArgumentException to
+ // indicate that the specified handles are invalid.
+
+ if (ex.HResult == System.HResults.E_HANDLE) // Bad handle
+ throw new ArgumentException(SR.Argument_InvalidHandle, nameof(handle));
+
+ if (ex.HResult == System.HResults.E_INVALIDARG) // Handle already bound or sync handle
+ throw new ArgumentException(SR.Argument_AlreadyBoundOrSyncHandle, nameof(handle));
+
+ throw;
+ }
+
+ return new ThreadPoolBoundHandle(handle);
+ }
+ }
+}
diff --git a/src/mscorlib/src/System/Threading/ClrThreadPoolBoundHandle.cs b/src/mscorlib/src/System/Threading/ClrThreadPoolBoundHandle.cs
index d0cc5afbae..a4a3b980cf 100644
--- a/src/mscorlib/src/System/Threading/ClrThreadPoolBoundHandle.cs
+++ b/src/mscorlib/src/System/Threading/ClrThreadPoolBoundHandle.cs
@@ -83,28 +83,7 @@ namespace System.Threading
if (handle.IsClosed || handle.IsInvalid)
throw new ArgumentException(SR.Argument_InvalidHandle, nameof(handle));
- try
- {
- // ThreadPool.BindHandle will always return true, otherwise, it throws. See the underlying FCall
- // implementation in ThreadPoolNative::CorBindIoCompletionCallback to see the implementation.
- bool succeeded = ThreadPool.BindHandle(handle);
- Debug.Assert(succeeded);
- }
- catch (Exception ex)
- { // BindHandle throws ApplicationException on full CLR and Exception on CoreCLR.
- // We do not let either of these leak and convert them to ArgumentException to
- // indicate that the specified handles are invalid.
-
- if (ex.HResult == System.HResults.E_HANDLE) // Bad handle
- throw new ArgumentException(SR.Argument_InvalidHandle, nameof(handle));
-
- if (ex.HResult == System.HResults.E_INVALIDARG) // Handle already bound or sync handle
- throw new ArgumentException(SR.Argument_AlreadyBoundOrSyncHandle, nameof(handle));
-
- throw;
- }
-
- return new ThreadPoolBoundHandle(handle);
+ return BindHandleCore(handle);
}
/// <summary>
diff --git a/src/mscorlib/src/System/Threading/Monitor.cs b/src/mscorlib/src/System/Threading/Monitor.cs
index 3ace3335aa..0df64a5e5c 100644
--- a/src/mscorlib/src/System/Threading/Monitor.cs
+++ b/src/mscorlib/src/System/Threading/Monitor.cs
@@ -17,7 +17,6 @@
using System;
using System.Runtime;
-using System.Runtime.Remoting;
using System.Threading;
using System.Runtime.CompilerServices;
using System.Runtime.ConstrainedExecution;
diff --git a/src/mscorlib/Common/PinnableBufferCache.cs b/src/mscorlib/src/System/Threading/PinnableBufferCache.cs
index 3f7853ce59..3f7853ce59 100644
--- a/src/mscorlib/Common/PinnableBufferCache.cs
+++ b/src/mscorlib/src/System/Threading/PinnableBufferCache.cs
diff --git a/src/mscorlib/src/System/Threading/Tasks/Task.cs b/src/mscorlib/src/System/Threading/Tasks/Task.cs
index 0a9248cba8..07d126179c 100644
--- a/src/mscorlib/src/System/Threading/Tasks/Task.cs
+++ b/src/mscorlib/src/System/Threading/Tasks/Task.cs
@@ -6254,7 +6254,6 @@ namespace System.Threading.Tasks
// NOTE: These options are a subset of TaskContinuationsOptions, thus before adding a flag check it is
// not already in use.
[Flags]
- [Serializable]
public enum TaskCreationOptions
{
/// <summary>
@@ -6306,7 +6305,6 @@ namespace System.Threading.Tasks
/// Task creation flags which are only used internally.
/// </summary>
[Flags]
- [Serializable]
internal enum InternalTaskOptions
{
/// <summary> Specifies "No internal task options" </summary>
@@ -6338,7 +6336,6 @@ namespace System.Threading.Tasks
/// Specifies flags that control optional behavior for the creation and execution of continuation tasks.
/// </summary>
[Flags]
- [Serializable]
public enum TaskContinuationOptions
{
/// <summary>
diff --git a/src/mscorlib/src/System/Threading/Thread.cs b/src/mscorlib/src/System/Threading/Thread.cs
index 70a5d06f7a..fab6c9e187 100644
--- a/src/mscorlib/src/System/Threading/Thread.cs
+++ b/src/mscorlib/src/System/Threading/Thread.cs
@@ -555,7 +555,6 @@ namespace System.Threading
// declaring a local var of this enum type and passing it by ref into a function that needs to do a
// stack crawl will both prevent inlining of the calle and pass an ESP point to stack crawl to
// Declaring these in EH clauses is illegal; they must declared in the main method body
- [Serializable]
internal enum StackCrawlMark
{
LookForMe = 0,
diff --git a/src/mscorlib/src/System/Threading/ThreadInterruptedException.cs b/src/mscorlib/src/System/Threading/ThreadInterruptedException.cs
index 9122df0d3e..fb72110fdc 100644
--- a/src/mscorlib/src/System/Threading/ThreadInterruptedException.cs
+++ b/src/mscorlib/src/System/Threading/ThreadInterruptedException.cs
@@ -19,7 +19,6 @@ using System.Runtime.Serialization;
namespace System.Threading
{
- [Serializable]
public class ThreadInterruptedException : SystemException
{
public ThreadInterruptedException()
@@ -42,6 +41,7 @@ namespace System.Threading
protected ThreadInterruptedException(SerializationInfo info, StreamingContext context) : base(info, context)
{
+ throw new PlatformNotSupportedException();
}
}
}
diff --git a/src/mscorlib/src/System/Threading/Timer.cs b/src/mscorlib/src/System/Threading/Timer.cs
index 960f815d64..a5c7945864 100644
--- a/src/mscorlib/src/System/Threading/Timer.cs
+++ b/src/mscorlib/src/System/Threading/Timer.cs
@@ -265,7 +265,19 @@ namespace System.Threading
if (timer.m_period != Timeout.UnsignedInfinite)
{
timer.m_startTicks = nowTicks;
- timer.m_dueTime = timer.m_period;
+ uint elapsedForNextDueTime = elapsed - timer.m_dueTime;
+ if (elapsedForNextDueTime < timer.m_period)
+ {
+ // Discount the extra amount of time that has elapsed since the previous firing time to
+ // prevent timer ticks from drifting
+ timer.m_dueTime = timer.m_period - elapsedForNextDueTime;
+ }
+ else
+ {
+ // Enough time has elapsed to fire the timer yet again. The timer is not able to keep up
+ // with the short period, have it fire 1 ms from now to avoid spinning without a delay.
+ timer.m_dueTime = 1;
+ }
//
// This is a repeating timer; schedule it to run again.
diff --git a/src/mscorlib/src/System/Threading/WaitHandle.cs b/src/mscorlib/src/System/Threading/WaitHandle.cs
index f3412d264f..da4856ee96 100644
--- a/src/mscorlib/src/System/Threading/WaitHandle.cs
+++ b/src/mscorlib/src/System/Threading/WaitHandle.cs
@@ -15,7 +15,6 @@
namespace System.Threading
{
using System.Threading;
- using System.Runtime.Remoting;
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
diff --git a/src/mscorlib/src/System/TypeLoadException.cs b/src/mscorlib/src/System/TypeLoadException.cs
index 85e1da5920..5e748a6c58 100644
--- a/src/mscorlib/src/System/TypeLoadException.cs
+++ b/src/mscorlib/src/System/TypeLoadException.cs
@@ -13,7 +13,6 @@
using System;
using System.Globalization;
-using System.Runtime.Remoting;
using System.Runtime.Serialization;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
@@ -23,7 +22,6 @@ using System.Diagnostics.Contracts;
namespace System
{
- [Serializable]
public class TypeLoadException : SystemException, ISerializable
{
public TypeLoadException()
@@ -106,33 +104,16 @@ namespace System
protected TypeLoadException(SerializationInfo info, StreamingContext context) : base(info, context)
{
- if (info == null)
- throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- ClassName = info.GetString("TypeLoadClassName");
- AssemblyName = info.GetString("TypeLoadAssemblyName");
- MessageArg = info.GetString("TypeLoadMessageArg");
- ResourceId = info.GetInt32("TypeLoadResourceID");
+ throw new PlatformNotSupportedException();
}
[DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
[SuppressUnmanagedCodeSecurity]
private static extern void GetTypeLoadExceptionMessage(int resourceId, StringHandleOnStack retString);
- //We can rely on the serialization mechanism on Exception to handle most of our needs, but
- //we need to add a few fields of our own.
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
- if (info == null)
- throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
base.GetObjectData(info, context);
- info.AddValue("TypeLoadClassName", ClassName, typeof(String));
- info.AddValue("TypeLoadAssemblyName", AssemblyName, typeof(String));
- info.AddValue("TypeLoadMessageArg", MessageArg, typeof(String));
- info.AddValue("TypeLoadResourceID", ResourceId);
}
// If ClassName != null, GetMessage will construct on the fly using it
diff --git a/src/mscorlib/src/System/UInt16.cs b/src/mscorlib/src/System/UInt16.cs
index e4a6837ae2..c7be2e9a1f 100644
--- a/src/mscorlib/src/System/UInt16.cs
+++ b/src/mscorlib/src/System/UInt16.cs
@@ -24,7 +24,7 @@ namespace System
public struct UInt16 : IComparable, IFormattable, IConvertible
, IComparable<UInt16>, IEquatable<UInt16>
{
- private ushort m_value;
+ private ushort m_value; // Do not rename (binary serialization)
public const ushort MaxValue = (ushort)0xFFFF;
public const ushort MinValue = 0;
diff --git a/src/mscorlib/src/System/UInt32.cs b/src/mscorlib/src/System/UInt32.cs
index 7c27efef39..2731047e06 100644
--- a/src/mscorlib/src/System/UInt32.cs
+++ b/src/mscorlib/src/System/UInt32.cs
@@ -26,7 +26,7 @@ namespace System
public struct UInt32 : IComparable, IFormattable, IConvertible
, IComparable<UInt32>, IEquatable<UInt32>
{
- private uint m_value;
+ private uint m_value; // Do not rename (binary serialization)
public const uint MaxValue = (uint)0xffffffff;
public const uint MinValue = 0U;
diff --git a/src/mscorlib/src/System/UInt64.cs b/src/mscorlib/src/System/UInt64.cs
index 0b79b6a7d8..a54bb69ba4 100644
--- a/src/mscorlib/src/System/UInt64.cs
+++ b/src/mscorlib/src/System/UInt64.cs
@@ -24,7 +24,7 @@ namespace System
public struct UInt64 : IComparable, IFormattable, IConvertible
, IComparable<UInt64>, IEquatable<UInt64>
{
- private ulong m_value;
+ private ulong m_value; // Do not rename (binary serialization)
public const ulong MaxValue = (ulong)0xffffffffffffffffL;
public const ulong MinValue = 0x0;
diff --git a/src/mscorlib/src/System/UIntPtr.cs b/src/mscorlib/src/System/UIntPtr.cs
index 09b7e51e89..08e494297b 100644
--- a/src/mscorlib/src/System/UIntPtr.cs
+++ b/src/mscorlib/src/System/UIntPtr.cs
@@ -23,7 +23,7 @@ namespace System
[CLSCompliant(false)]
public struct UIntPtr : IEquatable<UIntPtr>, ISerializable
{
- unsafe private void* m_value;
+ unsafe private void* _value;
public static readonly UIntPtr Zero;
@@ -31,16 +31,16 @@ namespace System
[System.Runtime.Versioning.NonVersionable]
public unsafe UIntPtr(uint value)
{
- m_value = (void*)value;
+ _value = (void*)value;
}
[System.Runtime.Versioning.NonVersionable]
public unsafe UIntPtr(ulong value)
{
#if BIT64
- m_value = (void*)value;
+ _value = (void*)value;
#else // 32
- m_value = (void*)checked((uint)value);
+ _value = (void*)checked((uint)value);
#endif
}
@@ -48,7 +48,7 @@ namespace System
[System.Runtime.Versioning.NonVersionable]
public unsafe UIntPtr(void* value)
{
- m_value = value;
+ _value = value;
}
private unsafe UIntPtr(SerializationInfo info, StreamingContext context)
@@ -60,7 +60,7 @@ namespace System
throw new ArgumentException(SR.Serialization_InvalidPtrValue);
}
- m_value = (void*)l;
+ _value = (void*)l;
}
unsafe void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
@@ -70,30 +70,30 @@ namespace System
throw new ArgumentNullException(nameof(info));
}
Contract.EndContractBlock();
- info.AddValue("value", (ulong)m_value);
+ info.AddValue("value", (ulong)_value);
}
public unsafe override bool Equals(Object obj)
{
if (obj is UIntPtr)
{
- return (m_value == ((UIntPtr)obj).m_value);
+ return (_value == ((UIntPtr)obj)._value);
}
return false;
}
unsafe bool IEquatable<UIntPtr>.Equals(UIntPtr other)
{
- return m_value == other.m_value;
+ return _value == other._value;
}
public unsafe override int GetHashCode()
{
#if BIT64
- ulong l = (ulong)m_value;
+ ulong l = (ulong)_value;
return (unchecked((int)l) ^ (int)(l >> 32));
#else // 32
- return unchecked((int)m_value);
+ return unchecked((int)_value);
#endif
}
@@ -101,16 +101,16 @@ namespace System
public unsafe uint ToUInt32()
{
#if BIT64
- return checked((uint)m_value);
+ return checked((uint)_value);
#else // 32
- return (uint)m_value;
+ return (uint)_value;
#endif
}
[System.Runtime.Versioning.NonVersionable]
public unsafe ulong ToUInt64()
{
- return (ulong)m_value;
+ return (ulong)_value;
}
public unsafe override String ToString()
@@ -118,9 +118,9 @@ namespace System
Contract.Ensures(Contract.Result<String>() != null);
#if BIT64
- return ((ulong)m_value).ToString(CultureInfo.InvariantCulture);
+ return ((ulong)_value).ToString(CultureInfo.InvariantCulture);
#else // 32
- return ((uint)m_value).ToString(CultureInfo.InvariantCulture);
+ return ((uint)_value).ToString(CultureInfo.InvariantCulture);
#endif
}
@@ -140,16 +140,16 @@ namespace System
public unsafe static explicit operator uint(UIntPtr value)
{
#if BIT64
- return checked((uint)value.m_value);
+ return checked((uint)value._value);
#else // 32
- return (uint)value.m_value;
+ return (uint)value._value;
#endif
}
[System.Runtime.Versioning.NonVersionable]
public unsafe static explicit operator ulong(UIntPtr value)
{
- return (ulong)value.m_value;
+ return (ulong)value._value;
}
[CLSCompliant(false)]
@@ -163,21 +163,21 @@ namespace System
[System.Runtime.Versioning.NonVersionable]
public static unsafe explicit operator void* (UIntPtr value)
{
- return value.m_value;
+ return value._value;
}
[System.Runtime.Versioning.NonVersionable]
public unsafe static bool operator ==(UIntPtr value1, UIntPtr value2)
{
- return value1.m_value == value2.m_value;
+ return value1._value == value2._value;
}
[System.Runtime.Versioning.NonVersionable]
public unsafe static bool operator !=(UIntPtr value1, UIntPtr value2)
{
- return value1.m_value != value2.m_value;
+ return value1._value != value2._value;
}
[System.Runtime.Versioning.NonVersionable]
@@ -229,7 +229,7 @@ namespace System
[System.Runtime.Versioning.NonVersionable]
public unsafe void* ToPointer()
{
- return m_value;
+ return _value;
}
}
}
diff --git a/src/mscorlib/src/System/Variant.cs b/src/mscorlib/src/System/Variant.cs
index cae5bdade4..b468ab2f98 100644
--- a/src/mscorlib/src/System/Variant.cs
+++ b/src/mscorlib/src/System/Variant.cs
@@ -23,7 +23,6 @@ using System.Diagnostics.Contracts;
namespace System
{
- [Serializable]
[StructLayout(LayoutKind.Sequential)]
internal struct Variant
{
diff --git a/src/mscorlib/src/System/__HResults.cs b/src/mscorlib/src/System/__HResults.cs
index e4183f637a..0592d814ef 100644
--- a/src/mscorlib/src/System/__HResults.cs
+++ b/src/mscorlib/src/System/__HResults.cs
@@ -44,6 +44,7 @@ namespace System
internal const int COR_E_ARITHMETIC = unchecked((int)0x80070216);
internal const int COR_E_ARRAYTYPEMISMATCH = unchecked((int)0x80131503);
internal const int COR_E_BADIMAGEFORMAT = unchecked((int)0x8007000B);
+ internal const int COR_E_BADEXEFORMAT = unchecked((int)0x800700C1);
internal const int COR_E_TYPEUNLOADED = unchecked((int)0x80131013);
internal const int COR_E_CANNOTUNLOADAPPDOMAIN = unchecked((int)0x80131015);
internal const int COR_E_COMEMULATE = unchecked((int)0x80131535);
diff --git a/src/pal/inc/pal.h b/src/pal/inc/pal.h
index 35c9a51f43..0f470d9668 100644
--- a/src/pal/inc/pal.h
+++ b/src/pal/inc/pal.h
@@ -2853,6 +2853,14 @@ PAL_GetSymbolModuleBase(void *symbol);
PALIMPORT
LPVOID
PALAPI
+PAL_VirtualReserveFromExecutableMemoryAllocatorWithinRange(
+ IN LPCVOID lpBeginAddress,
+ IN LPCVOID lpEndAddress,
+ IN SIZE_T dwSize);
+
+PALIMPORT
+LPVOID
+PALAPI
VirtualAlloc(
IN LPVOID lpAddress,
IN SIZE_T dwSize,
diff --git a/src/pal/prebuilt/idl/corprof_i.cpp b/src/pal/prebuilt/idl/corprof_i.cpp
index 3758da041c..090f84452c 100644
--- a/src/pal/prebuilt/idl/corprof_i.cpp
+++ b/src/pal/prebuilt/idl/corprof_i.cpp
@@ -7,7 +7,7 @@
/* link this file in with the server and any clients */
- /* File created by MIDL compiler version 8.00.0603 */
+ /* File created by MIDL compiler version 8.01.0622 */
/* @@MIDL_FILE_HEADING( ) */
#pragma warning( disable: 4049 ) /* more than 64k source lines */
@@ -55,9 +55,9 @@ typedef IID CLSID;
#endif // CLSID_DEFINED
#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
- const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
+ EXTERN_C __declspec(selectany) const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
-#endif !_MIDL_USE_GUIDDEF_
+#endif // !_MIDL_USE_GUIDDEF_
MIDL_DEFINE_GUID(IID, IID_ICorProfilerCallback,0x176FBED1,0xA55C,0x4796,0x98,0xCA,0xA9,0xDA,0x0E,0xF8,0x83,0xE7);
@@ -83,6 +83,9 @@ MIDL_DEFINE_GUID(IID, IID_ICorProfilerCallback7,0xF76A2DBA,0x1D52,0x4539,0x86,0x
MIDL_DEFINE_GUID(IID, IID_ICorProfilerCallback8,0x5BED9B15,0xC079,0x4D47,0xBF,0xE2,0x21,0x5A,0x14,0x0C,0x07,0xE0);
+MIDL_DEFINE_GUID(IID, IID_ICorProfilerCallback9,0x27583EC3,0xC8F5,0x482F,0x80,0x52,0x19,0x4B,0x8C,0xE4,0x70,0x5A);
+
+
MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo,0x28B5557D,0x3F3F,0x48b4,0x90,0xB2,0x5F,0x9E,0xEA,0x2F,0x6C,0x48);
diff --git a/src/pal/prebuilt/inc/corprof.h b/src/pal/prebuilt/inc/corprof.h
index 6778fb526f..befa45a942 100644
--- a/src/pal/prebuilt/inc/corprof.h
+++ b/src/pal/prebuilt/inc/corprof.h
@@ -5,7 +5,7 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
- /* File created by MIDL compiler version 8.01.0620 */
+ /* File created by MIDL compiler version 8.01.0622 */
/* @@MIDL_FILE_HEADING( ) */
#pragma warning( disable: 4049 ) /* more than 64k source lines */
@@ -93,6 +93,13 @@ typedef interface ICorProfilerCallback8 ICorProfilerCallback8;
#endif /* __ICorProfilerCallback8_FWD_DEFINED__ */
+#ifndef __ICorProfilerCallback9_FWD_DEFINED__
+#define __ICorProfilerCallback9_FWD_DEFINED__
+typedef interface ICorProfilerCallback9 ICorProfilerCallback9;
+
+#endif /* __ICorProfilerCallback9_FWD_DEFINED__ */
+
+
#ifndef __ICorProfilerInfo_FWD_DEFINED__
#define __ICorProfilerInfo_FWD_DEFINED__
typedef interface ICorProfilerInfo ICorProfilerInfo;
@@ -506,8 +513,9 @@ enum __MIDL___MIDL_itf_corprof_0000_0000_0006
COR_PRF_HIGH_MONITOR_NONE = 0,
COR_PRF_HIGH_ADD_ASSEMBLY_REFERENCES = 0x1,
COR_PRF_HIGH_IN_MEMORY_SYMBOLS_UPDATED = 0x2,
+ COR_PRF_HIGH_MONITOR_DYNAMIC_FUNCTION_UNLOADS = 0x4,
COR_PRF_HIGH_REQUIRE_PROFILE_IMAGE = 0,
- COR_PRF_HIGH_ALLOWABLE_AFTER_ATTACH = COR_PRF_HIGH_IN_MEMORY_SYMBOLS_UPDATED,
+ COR_PRF_HIGH_ALLOWABLE_AFTER_ATTACH = ( COR_PRF_HIGH_IN_MEMORY_SYMBOLS_UPDATED | COR_PRF_HIGH_MONITOR_DYNAMIC_FUNCTION_UNLOADS ) ,
COR_PRF_HIGH_MONITOR_IMMUTABLE = 0
} COR_PRF_HIGH_MONITOR;
@@ -6611,11 +6619,795 @@ EXTERN_C const IID IID_ICorProfilerCallback8;
#endif /* __ICorProfilerCallback8_INTERFACE_DEFINED__ */
-/* interface __MIDL_itf_corprof_0000_0008 */
+#ifndef __ICorProfilerCallback9_INTERFACE_DEFINED__
+#define __ICorProfilerCallback9_INTERFACE_DEFINED__
+
+/* interface ICorProfilerCallback9 */
+/* [local][unique][uuid][object] */
+
+
+EXTERN_C const IID IID_ICorProfilerCallback9;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("27583EC3-C8F5-482F-8052-194B8CE4705A")
+ ICorProfilerCallback9 : public ICorProfilerCallback8
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE DynamicMethodUnloaded(
+ /* [in] */ FunctionID functionId) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ICorProfilerCallback9Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ICorProfilerCallback9 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ICorProfilerCallback9 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *Initialize )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ IUnknown *pICorProfilerInfoUnk);
+
+ HRESULT ( STDMETHODCALLTYPE *Shutdown )(
+ ICorProfilerCallback9 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *AppDomainCreationStarted )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ AppDomainID appDomainId);
+
+ HRESULT ( STDMETHODCALLTYPE *AppDomainCreationFinished )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ AppDomainID appDomainId,
+ /* [in] */ HRESULT hrStatus);
+
+ HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownStarted )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ AppDomainID appDomainId);
+
+ HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownFinished )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ AppDomainID appDomainId,
+ /* [in] */ HRESULT hrStatus);
+
+ HRESULT ( STDMETHODCALLTYPE *AssemblyLoadStarted )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ AssemblyID assemblyId);
+
+ HRESULT ( STDMETHODCALLTYPE *AssemblyLoadFinished )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ AssemblyID assemblyId,
+ /* [in] */ HRESULT hrStatus);
+
+ HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadStarted )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ AssemblyID assemblyId);
+
+ HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadFinished )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ AssemblyID assemblyId,
+ /* [in] */ HRESULT hrStatus);
+
+ HRESULT ( STDMETHODCALLTYPE *ModuleLoadStarted )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ ModuleID moduleId);
+
+ HRESULT ( STDMETHODCALLTYPE *ModuleLoadFinished )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ ModuleID moduleId,
+ /* [in] */ HRESULT hrStatus);
+
+ HRESULT ( STDMETHODCALLTYPE *ModuleUnloadStarted )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ ModuleID moduleId);
+
+ HRESULT ( STDMETHODCALLTYPE *ModuleUnloadFinished )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ ModuleID moduleId,
+ /* [in] */ HRESULT hrStatus);
+
+ HRESULT ( STDMETHODCALLTYPE *ModuleAttachedToAssembly )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ ModuleID moduleId,
+ /* [in] */ AssemblyID AssemblyId);
+
+ HRESULT ( STDMETHODCALLTYPE *ClassLoadStarted )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ ClassID classId);
+
+ HRESULT ( STDMETHODCALLTYPE *ClassLoadFinished )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ ClassID classId,
+ /* [in] */ HRESULT hrStatus);
+
+ HRESULT ( STDMETHODCALLTYPE *ClassUnloadStarted )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ ClassID classId);
+
+ HRESULT ( STDMETHODCALLTYPE *ClassUnloadFinished )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ ClassID classId,
+ /* [in] */ HRESULT hrStatus);
+
+ HRESULT ( STDMETHODCALLTYPE *FunctionUnloadStarted )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ FunctionID functionId);
+
+ HRESULT ( STDMETHODCALLTYPE *JITCompilationStarted )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ FunctionID functionId,
+ /* [in] */ BOOL fIsSafeToBlock);
+
+ HRESULT ( STDMETHODCALLTYPE *JITCompilationFinished )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ FunctionID functionId,
+ /* [in] */ HRESULT hrStatus,
+ /* [in] */ BOOL fIsSafeToBlock);
+
+ HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchStarted )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ FunctionID functionId,
+ /* [out] */ BOOL *pbUseCachedFunction);
+
+ HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchFinished )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ FunctionID functionId,
+ /* [in] */ COR_PRF_JIT_CACHE result);
+
+ HRESULT ( STDMETHODCALLTYPE *JITFunctionPitched )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ FunctionID functionId);
+
+ HRESULT ( STDMETHODCALLTYPE *JITInlining )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ FunctionID callerId,
+ /* [in] */ FunctionID calleeId,
+ /* [out] */ BOOL *pfShouldInline);
+
+ HRESULT ( STDMETHODCALLTYPE *ThreadCreated )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ ThreadID threadId);
+
+ HRESULT ( STDMETHODCALLTYPE *ThreadDestroyed )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ ThreadID threadId);
+
+ HRESULT ( STDMETHODCALLTYPE *ThreadAssignedToOSThread )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ ThreadID managedThreadId,
+ /* [in] */ DWORD osThreadId);
+
+ HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationStarted )(
+ ICorProfilerCallback9 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *RemotingClientSendingMessage )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ GUID *pCookie,
+ /* [in] */ BOOL fIsAsync);
+
+ HRESULT ( STDMETHODCALLTYPE *RemotingClientReceivingReply )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ GUID *pCookie,
+ /* [in] */ BOOL fIsAsync);
+
+ HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationFinished )(
+ ICorProfilerCallback9 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *RemotingServerReceivingMessage )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ GUID *pCookie,
+ /* [in] */ BOOL fIsAsync);
+
+ HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationStarted )(
+ ICorProfilerCallback9 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationReturned )(
+ ICorProfilerCallback9 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *RemotingServerSendingReply )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ GUID *pCookie,
+ /* [in] */ BOOL fIsAsync);
+
+ HRESULT ( STDMETHODCALLTYPE *UnmanagedToManagedTransition )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ FunctionID functionId,
+ /* [in] */ COR_PRF_TRANSITION_REASON reason);
+
+ HRESULT ( STDMETHODCALLTYPE *ManagedToUnmanagedTransition )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ FunctionID functionId,
+ /* [in] */ COR_PRF_TRANSITION_REASON reason);
+
+ HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendStarted )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ COR_PRF_SUSPEND_REASON suspendReason);
+
+ HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendFinished )(
+ ICorProfilerCallback9 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendAborted )(
+ ICorProfilerCallback9 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *RuntimeResumeStarted )(
+ ICorProfilerCallback9 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *RuntimeResumeFinished )(
+ ICorProfilerCallback9 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *RuntimeThreadSuspended )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ ThreadID threadId);
+
+ HRESULT ( STDMETHODCALLTYPE *RuntimeThreadResumed )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ ThreadID threadId);
+
+ HRESULT ( STDMETHODCALLTYPE *MovedReferences )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ ULONG cMovedObjectIDRanges,
+ /* [size_is][in] */ ObjectID oldObjectIDRangeStart[ ],
+ /* [size_is][in] */ ObjectID newObjectIDRangeStart[ ],
+ /* [size_is][in] */ ULONG cObjectIDRangeLength[ ]);
+
+ HRESULT ( STDMETHODCALLTYPE *ObjectAllocated )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ ObjectID objectId,
+ /* [in] */ ClassID classId);
+
+ HRESULT ( STDMETHODCALLTYPE *ObjectsAllocatedByClass )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ ULONG cClassCount,
+ /* [size_is][in] */ ClassID classIds[ ],
+ /* [size_is][in] */ ULONG cObjects[ ]);
+
+ HRESULT ( STDMETHODCALLTYPE *ObjectReferences )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ ObjectID objectId,
+ /* [in] */ ClassID classId,
+ /* [in] */ ULONG cObjectRefs,
+ /* [size_is][in] */ ObjectID objectRefIds[ ]);
+
+ HRESULT ( STDMETHODCALLTYPE *RootReferences )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ ULONG cRootRefs,
+ /* [size_is][in] */ ObjectID rootRefIds[ ]);
+
+ HRESULT ( STDMETHODCALLTYPE *ExceptionThrown )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ ObjectID thrownObjectId);
+
+ HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionEnter )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ FunctionID functionId);
+
+ HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionLeave )(
+ ICorProfilerCallback9 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterEnter )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ FunctionID functionId);
+
+ HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterLeave )(
+ ICorProfilerCallback9 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *ExceptionSearchCatcherFound )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ FunctionID functionId);
+
+ HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerEnter )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ UINT_PTR __unused);
+
+ HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerLeave )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ UINT_PTR __unused);
+
+ HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionEnter )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ FunctionID functionId);
+
+ HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionLeave )(
+ ICorProfilerCallback9 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyEnter )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ FunctionID functionId);
+
+ HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyLeave )(
+ ICorProfilerCallback9 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherEnter )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ FunctionID functionId,
+ /* [in] */ ObjectID objectId);
+
+ HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherLeave )(
+ ICorProfilerCallback9 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *COMClassicVTableCreated )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ ClassID wrappedClassId,
+ /* [in] */ REFGUID implementedIID,
+ /* [in] */ void *pVTable,
+ /* [in] */ ULONG cSlots);
+
+ HRESULT ( STDMETHODCALLTYPE *COMClassicVTableDestroyed )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ ClassID wrappedClassId,
+ /* [in] */ REFGUID implementedIID,
+ /* [in] */ void *pVTable);
+
+ HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherFound )(
+ ICorProfilerCallback9 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherExecute )(
+ ICorProfilerCallback9 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *ThreadNameChanged )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ ThreadID threadId,
+ /* [in] */ ULONG cchName,
+ /* [annotation][in] */
+ _In_reads_opt_(cchName) WCHAR name[ ]);
+
+ HRESULT ( STDMETHODCALLTYPE *GarbageCollectionStarted )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ int cGenerations,
+ /* [size_is][in] */ BOOL generationCollected[ ],
+ /* [in] */ COR_PRF_GC_REASON reason);
+
+ HRESULT ( STDMETHODCALLTYPE *SurvivingReferences )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ ULONG cSurvivingObjectIDRanges,
+ /* [size_is][in] */ ObjectID objectIDRangeStart[ ],
+ /* [size_is][in] */ ULONG cObjectIDRangeLength[ ]);
+
+ HRESULT ( STDMETHODCALLTYPE *GarbageCollectionFinished )(
+ ICorProfilerCallback9 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *FinalizeableObjectQueued )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ DWORD finalizerFlags,
+ /* [in] */ ObjectID objectID);
+
+ HRESULT ( STDMETHODCALLTYPE *RootReferences2 )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ ULONG cRootRefs,
+ /* [size_is][in] */ ObjectID rootRefIds[ ],
+ /* [size_is][in] */ COR_PRF_GC_ROOT_KIND rootKinds[ ],
+ /* [size_is][in] */ COR_PRF_GC_ROOT_FLAGS rootFlags[ ],
+ /* [size_is][in] */ UINT_PTR rootIds[ ]);
+
+ HRESULT ( STDMETHODCALLTYPE *HandleCreated )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ GCHandleID handleId,
+ /* [in] */ ObjectID initialObjectId);
+
+ HRESULT ( STDMETHODCALLTYPE *HandleDestroyed )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ GCHandleID handleId);
+
+ HRESULT ( STDMETHODCALLTYPE *InitializeForAttach )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ IUnknown *pCorProfilerInfoUnk,
+ /* [in] */ void *pvClientData,
+ /* [in] */ UINT cbClientData);
+
+ HRESULT ( STDMETHODCALLTYPE *ProfilerAttachComplete )(
+ ICorProfilerCallback9 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *ProfilerDetachSucceeded )(
+ ICorProfilerCallback9 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *ReJITCompilationStarted )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ FunctionID functionId,
+ /* [in] */ ReJITID rejitId,
+ /* [in] */ BOOL fIsSafeToBlock);
+
+ HRESULT ( STDMETHODCALLTYPE *GetReJITParameters )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ ModuleID moduleId,
+ /* [in] */ mdMethodDef methodId,
+ /* [in] */ ICorProfilerFunctionControl *pFunctionControl);
+
+ HRESULT ( STDMETHODCALLTYPE *ReJITCompilationFinished )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ FunctionID functionId,
+ /* [in] */ ReJITID rejitId,
+ /* [in] */ HRESULT hrStatus,
+ /* [in] */ BOOL fIsSafeToBlock);
+
+ HRESULT ( STDMETHODCALLTYPE *ReJITError )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ ModuleID moduleId,
+ /* [in] */ mdMethodDef methodId,
+ /* [in] */ FunctionID functionId,
+ /* [in] */ HRESULT hrStatus);
+
+ HRESULT ( STDMETHODCALLTYPE *MovedReferences2 )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ ULONG cMovedObjectIDRanges,
+ /* [size_is][in] */ ObjectID oldObjectIDRangeStart[ ],
+ /* [size_is][in] */ ObjectID newObjectIDRangeStart[ ],
+ /* [size_is][in] */ SIZE_T cObjectIDRangeLength[ ]);
+
+ HRESULT ( STDMETHODCALLTYPE *SurvivingReferences2 )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ ULONG cSurvivingObjectIDRanges,
+ /* [size_is][in] */ ObjectID objectIDRangeStart[ ],
+ /* [size_is][in] */ SIZE_T cObjectIDRangeLength[ ]);
+
+ HRESULT ( STDMETHODCALLTYPE *ConditionalWeakTableElementReferences )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ ULONG cRootRefs,
+ /* [size_is][in] */ ObjectID keyRefIds[ ],
+ /* [size_is][in] */ ObjectID valueRefIds[ ],
+ /* [size_is][in] */ GCHandleID rootIds[ ]);
+
+ HRESULT ( STDMETHODCALLTYPE *GetAssemblyReferences )(
+ ICorProfilerCallback9 * This,
+ /* [string][in] */ const WCHAR *wszAssemblyPath,
+ /* [in] */ ICorProfilerAssemblyReferenceProvider *pAsmRefProvider);
+
+ HRESULT ( STDMETHODCALLTYPE *ModuleInMemorySymbolsUpdated )(
+ ICorProfilerCallback9 * This,
+ ModuleID moduleId);
+
+ HRESULT ( STDMETHODCALLTYPE *DynamicMethodJITCompilationStarted )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ FunctionID functionId,
+ /* [in] */ BOOL fIsSafeToBlock,
+ /* [in] */ LPCBYTE pILHeader,
+ /* [in] */ ULONG cbILHeader);
+
+ HRESULT ( STDMETHODCALLTYPE *DynamicMethodJITCompilationFinished )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ FunctionID functionId,
+ /* [in] */ HRESULT hrStatus,
+ /* [in] */ BOOL fIsSafeToBlock);
+
+ HRESULT ( STDMETHODCALLTYPE *DynamicMethodUnloaded )(
+ ICorProfilerCallback9 * This,
+ /* [in] */ FunctionID functionId);
+
+ END_INTERFACE
+ } ICorProfilerCallback9Vtbl;
+
+ interface ICorProfilerCallback9
+ {
+ CONST_VTBL struct ICorProfilerCallback9Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ICorProfilerCallback9_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ICorProfilerCallback9_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ICorProfilerCallback9_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ICorProfilerCallback9_Initialize(This,pICorProfilerInfoUnk) \
+ ( (This)->lpVtbl -> Initialize(This,pICorProfilerInfoUnk) )
+
+#define ICorProfilerCallback9_Shutdown(This) \
+ ( (This)->lpVtbl -> Shutdown(This) )
+
+#define ICorProfilerCallback9_AppDomainCreationStarted(This,appDomainId) \
+ ( (This)->lpVtbl -> AppDomainCreationStarted(This,appDomainId) )
+
+#define ICorProfilerCallback9_AppDomainCreationFinished(This,appDomainId,hrStatus) \
+ ( (This)->lpVtbl -> AppDomainCreationFinished(This,appDomainId,hrStatus) )
+
+#define ICorProfilerCallback9_AppDomainShutdownStarted(This,appDomainId) \
+ ( (This)->lpVtbl -> AppDomainShutdownStarted(This,appDomainId) )
+
+#define ICorProfilerCallback9_AppDomainShutdownFinished(This,appDomainId,hrStatus) \
+ ( (This)->lpVtbl -> AppDomainShutdownFinished(This,appDomainId,hrStatus) )
+
+#define ICorProfilerCallback9_AssemblyLoadStarted(This,assemblyId) \
+ ( (This)->lpVtbl -> AssemblyLoadStarted(This,assemblyId) )
+
+#define ICorProfilerCallback9_AssemblyLoadFinished(This,assemblyId,hrStatus) \
+ ( (This)->lpVtbl -> AssemblyLoadFinished(This,assemblyId,hrStatus) )
+
+#define ICorProfilerCallback9_AssemblyUnloadStarted(This,assemblyId) \
+ ( (This)->lpVtbl -> AssemblyUnloadStarted(This,assemblyId) )
+
+#define ICorProfilerCallback9_AssemblyUnloadFinished(This,assemblyId,hrStatus) \
+ ( (This)->lpVtbl -> AssemblyUnloadFinished(This,assemblyId,hrStatus) )
+
+#define ICorProfilerCallback9_ModuleLoadStarted(This,moduleId) \
+ ( (This)->lpVtbl -> ModuleLoadStarted(This,moduleId) )
+
+#define ICorProfilerCallback9_ModuleLoadFinished(This,moduleId,hrStatus) \
+ ( (This)->lpVtbl -> ModuleLoadFinished(This,moduleId,hrStatus) )
+
+#define ICorProfilerCallback9_ModuleUnloadStarted(This,moduleId) \
+ ( (This)->lpVtbl -> ModuleUnloadStarted(This,moduleId) )
+
+#define ICorProfilerCallback9_ModuleUnloadFinished(This,moduleId,hrStatus) \
+ ( (This)->lpVtbl -> ModuleUnloadFinished(This,moduleId,hrStatus) )
+
+#define ICorProfilerCallback9_ModuleAttachedToAssembly(This,moduleId,AssemblyId) \
+ ( (This)->lpVtbl -> ModuleAttachedToAssembly(This,moduleId,AssemblyId) )
+
+#define ICorProfilerCallback9_ClassLoadStarted(This,classId) \
+ ( (This)->lpVtbl -> ClassLoadStarted(This,classId) )
+
+#define ICorProfilerCallback9_ClassLoadFinished(This,classId,hrStatus) \
+ ( (This)->lpVtbl -> ClassLoadFinished(This,classId,hrStatus) )
+
+#define ICorProfilerCallback9_ClassUnloadStarted(This,classId) \
+ ( (This)->lpVtbl -> ClassUnloadStarted(This,classId) )
+
+#define ICorProfilerCallback9_ClassUnloadFinished(This,classId,hrStatus) \
+ ( (This)->lpVtbl -> ClassUnloadFinished(This,classId,hrStatus) )
+
+#define ICorProfilerCallback9_FunctionUnloadStarted(This,functionId) \
+ ( (This)->lpVtbl -> FunctionUnloadStarted(This,functionId) )
+
+#define ICorProfilerCallback9_JITCompilationStarted(This,functionId,fIsSafeToBlock) \
+ ( (This)->lpVtbl -> JITCompilationStarted(This,functionId,fIsSafeToBlock) )
+
+#define ICorProfilerCallback9_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \
+ ( (This)->lpVtbl -> JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) )
+
+#define ICorProfilerCallback9_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) \
+ ( (This)->lpVtbl -> JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) )
+
+#define ICorProfilerCallback9_JITCachedFunctionSearchFinished(This,functionId,result) \
+ ( (This)->lpVtbl -> JITCachedFunctionSearchFinished(This,functionId,result) )
+
+#define ICorProfilerCallback9_JITFunctionPitched(This,functionId) \
+ ( (This)->lpVtbl -> JITFunctionPitched(This,functionId) )
+
+#define ICorProfilerCallback9_JITInlining(This,callerId,calleeId,pfShouldInline) \
+ ( (This)->lpVtbl -> JITInlining(This,callerId,calleeId,pfShouldInline) )
+
+#define ICorProfilerCallback9_ThreadCreated(This,threadId) \
+ ( (This)->lpVtbl -> ThreadCreated(This,threadId) )
+
+#define ICorProfilerCallback9_ThreadDestroyed(This,threadId) \
+ ( (This)->lpVtbl -> ThreadDestroyed(This,threadId) )
+
+#define ICorProfilerCallback9_ThreadAssignedToOSThread(This,managedThreadId,osThreadId) \
+ ( (This)->lpVtbl -> ThreadAssignedToOSThread(This,managedThreadId,osThreadId) )
+
+#define ICorProfilerCallback9_RemotingClientInvocationStarted(This) \
+ ( (This)->lpVtbl -> RemotingClientInvocationStarted(This) )
+
+#define ICorProfilerCallback9_RemotingClientSendingMessage(This,pCookie,fIsAsync) \
+ ( (This)->lpVtbl -> RemotingClientSendingMessage(This,pCookie,fIsAsync) )
+
+#define ICorProfilerCallback9_RemotingClientReceivingReply(This,pCookie,fIsAsync) \
+ ( (This)->lpVtbl -> RemotingClientReceivingReply(This,pCookie,fIsAsync) )
+
+#define ICorProfilerCallback9_RemotingClientInvocationFinished(This) \
+ ( (This)->lpVtbl -> RemotingClientInvocationFinished(This) )
+
+#define ICorProfilerCallback9_RemotingServerReceivingMessage(This,pCookie,fIsAsync) \
+ ( (This)->lpVtbl -> RemotingServerReceivingMessage(This,pCookie,fIsAsync) )
+
+#define ICorProfilerCallback9_RemotingServerInvocationStarted(This) \
+ ( (This)->lpVtbl -> RemotingServerInvocationStarted(This) )
+
+#define ICorProfilerCallback9_RemotingServerInvocationReturned(This) \
+ ( (This)->lpVtbl -> RemotingServerInvocationReturned(This) )
+
+#define ICorProfilerCallback9_RemotingServerSendingReply(This,pCookie,fIsAsync) \
+ ( (This)->lpVtbl -> RemotingServerSendingReply(This,pCookie,fIsAsync) )
+
+#define ICorProfilerCallback9_UnmanagedToManagedTransition(This,functionId,reason) \
+ ( (This)->lpVtbl -> UnmanagedToManagedTransition(This,functionId,reason) )
+
+#define ICorProfilerCallback9_ManagedToUnmanagedTransition(This,functionId,reason) \
+ ( (This)->lpVtbl -> ManagedToUnmanagedTransition(This,functionId,reason) )
+
+#define ICorProfilerCallback9_RuntimeSuspendStarted(This,suspendReason) \
+ ( (This)->lpVtbl -> RuntimeSuspendStarted(This,suspendReason) )
+
+#define ICorProfilerCallback9_RuntimeSuspendFinished(This) \
+ ( (This)->lpVtbl -> RuntimeSuspendFinished(This) )
+
+#define ICorProfilerCallback9_RuntimeSuspendAborted(This) \
+ ( (This)->lpVtbl -> RuntimeSuspendAborted(This) )
+
+#define ICorProfilerCallback9_RuntimeResumeStarted(This) \
+ ( (This)->lpVtbl -> RuntimeResumeStarted(This) )
+
+#define ICorProfilerCallback9_RuntimeResumeFinished(This) \
+ ( (This)->lpVtbl -> RuntimeResumeFinished(This) )
+
+#define ICorProfilerCallback9_RuntimeThreadSuspended(This,threadId) \
+ ( (This)->lpVtbl -> RuntimeThreadSuspended(This,threadId) )
+
+#define ICorProfilerCallback9_RuntimeThreadResumed(This,threadId) \
+ ( (This)->lpVtbl -> RuntimeThreadResumed(This,threadId) )
+
+#define ICorProfilerCallback9_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \
+ ( (This)->lpVtbl -> MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) )
+
+#define ICorProfilerCallback9_ObjectAllocated(This,objectId,classId) \
+ ( (This)->lpVtbl -> ObjectAllocated(This,objectId,classId) )
+
+#define ICorProfilerCallback9_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) \
+ ( (This)->lpVtbl -> ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) )
+
+#define ICorProfilerCallback9_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) \
+ ( (This)->lpVtbl -> ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) )
+
+#define ICorProfilerCallback9_RootReferences(This,cRootRefs,rootRefIds) \
+ ( (This)->lpVtbl -> RootReferences(This,cRootRefs,rootRefIds) )
+
+#define ICorProfilerCallback9_ExceptionThrown(This,thrownObjectId) \
+ ( (This)->lpVtbl -> ExceptionThrown(This,thrownObjectId) )
+
+#define ICorProfilerCallback9_ExceptionSearchFunctionEnter(This,functionId) \
+ ( (This)->lpVtbl -> ExceptionSearchFunctionEnter(This,functionId) )
+
+#define ICorProfilerCallback9_ExceptionSearchFunctionLeave(This) \
+ ( (This)->lpVtbl -> ExceptionSearchFunctionLeave(This) )
+
+#define ICorProfilerCallback9_ExceptionSearchFilterEnter(This,functionId) \
+ ( (This)->lpVtbl -> ExceptionSearchFilterEnter(This,functionId) )
+
+#define ICorProfilerCallback9_ExceptionSearchFilterLeave(This) \
+ ( (This)->lpVtbl -> ExceptionSearchFilterLeave(This) )
+
+#define ICorProfilerCallback9_ExceptionSearchCatcherFound(This,functionId) \
+ ( (This)->lpVtbl -> ExceptionSearchCatcherFound(This,functionId) )
+
+#define ICorProfilerCallback9_ExceptionOSHandlerEnter(This,__unused) \
+ ( (This)->lpVtbl -> ExceptionOSHandlerEnter(This,__unused) )
+
+#define ICorProfilerCallback9_ExceptionOSHandlerLeave(This,__unused) \
+ ( (This)->lpVtbl -> ExceptionOSHandlerLeave(This,__unused) )
+
+#define ICorProfilerCallback9_ExceptionUnwindFunctionEnter(This,functionId) \
+ ( (This)->lpVtbl -> ExceptionUnwindFunctionEnter(This,functionId) )
+
+#define ICorProfilerCallback9_ExceptionUnwindFunctionLeave(This) \
+ ( (This)->lpVtbl -> ExceptionUnwindFunctionLeave(This) )
+
+#define ICorProfilerCallback9_ExceptionUnwindFinallyEnter(This,functionId) \
+ ( (This)->lpVtbl -> ExceptionUnwindFinallyEnter(This,functionId) )
+
+#define ICorProfilerCallback9_ExceptionUnwindFinallyLeave(This) \
+ ( (This)->lpVtbl -> ExceptionUnwindFinallyLeave(This) )
+
+#define ICorProfilerCallback9_ExceptionCatcherEnter(This,functionId,objectId) \
+ ( (This)->lpVtbl -> ExceptionCatcherEnter(This,functionId,objectId) )
+
+#define ICorProfilerCallback9_ExceptionCatcherLeave(This) \
+ ( (This)->lpVtbl -> ExceptionCatcherLeave(This) )
+
+#define ICorProfilerCallback9_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) \
+ ( (This)->lpVtbl -> COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) )
+
+#define ICorProfilerCallback9_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) \
+ ( (This)->lpVtbl -> COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) )
+
+#define ICorProfilerCallback9_ExceptionCLRCatcherFound(This) \
+ ( (This)->lpVtbl -> ExceptionCLRCatcherFound(This) )
+
+#define ICorProfilerCallback9_ExceptionCLRCatcherExecute(This) \
+ ( (This)->lpVtbl -> ExceptionCLRCatcherExecute(This) )
+
+
+#define ICorProfilerCallback9_ThreadNameChanged(This,threadId,cchName,name) \
+ ( (This)->lpVtbl -> ThreadNameChanged(This,threadId,cchName,name) )
+
+#define ICorProfilerCallback9_GarbageCollectionStarted(This,cGenerations,generationCollected,reason) \
+ ( (This)->lpVtbl -> GarbageCollectionStarted(This,cGenerations,generationCollected,reason) )
+
+#define ICorProfilerCallback9_SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \
+ ( (This)->lpVtbl -> SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) )
+
+#define ICorProfilerCallback9_GarbageCollectionFinished(This) \
+ ( (This)->lpVtbl -> GarbageCollectionFinished(This) )
+
+#define ICorProfilerCallback9_FinalizeableObjectQueued(This,finalizerFlags,objectID) \
+ ( (This)->lpVtbl -> FinalizeableObjectQueued(This,finalizerFlags,objectID) )
+
+#define ICorProfilerCallback9_RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) \
+ ( (This)->lpVtbl -> RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) )
+
+#define ICorProfilerCallback9_HandleCreated(This,handleId,initialObjectId) \
+ ( (This)->lpVtbl -> HandleCreated(This,handleId,initialObjectId) )
+
+#define ICorProfilerCallback9_HandleDestroyed(This,handleId) \
+ ( (This)->lpVtbl -> HandleDestroyed(This,handleId) )
+
+
+#define ICorProfilerCallback9_InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) \
+ ( (This)->lpVtbl -> InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) )
+
+#define ICorProfilerCallback9_ProfilerAttachComplete(This) \
+ ( (This)->lpVtbl -> ProfilerAttachComplete(This) )
+
+#define ICorProfilerCallback9_ProfilerDetachSucceeded(This) \
+ ( (This)->lpVtbl -> ProfilerDetachSucceeded(This) )
+
+
+#define ICorProfilerCallback9_ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) \
+ ( (This)->lpVtbl -> ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) )
+
+#define ICorProfilerCallback9_GetReJITParameters(This,moduleId,methodId,pFunctionControl) \
+ ( (This)->lpVtbl -> GetReJITParameters(This,moduleId,methodId,pFunctionControl) )
+
+#define ICorProfilerCallback9_ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) \
+ ( (This)->lpVtbl -> ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) )
+
+#define ICorProfilerCallback9_ReJITError(This,moduleId,methodId,functionId,hrStatus) \
+ ( (This)->lpVtbl -> ReJITError(This,moduleId,methodId,functionId,hrStatus) )
+
+#define ICorProfilerCallback9_MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \
+ ( (This)->lpVtbl -> MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) )
+
+#define ICorProfilerCallback9_SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \
+ ( (This)->lpVtbl -> SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) )
+
+
+#define ICorProfilerCallback9_ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds) \
+ ( (This)->lpVtbl -> ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds) )
+
+
+#define ICorProfilerCallback9_GetAssemblyReferences(This,wszAssemblyPath,pAsmRefProvider) \
+ ( (This)->lpVtbl -> GetAssemblyReferences(This,wszAssemblyPath,pAsmRefProvider) )
+
+
+#define ICorProfilerCallback9_ModuleInMemorySymbolsUpdated(This,moduleId) \
+ ( (This)->lpVtbl -> ModuleInMemorySymbolsUpdated(This,moduleId) )
+
+
+#define ICorProfilerCallback9_DynamicMethodJITCompilationStarted(This,functionId,fIsSafeToBlock,pILHeader,cbILHeader) \
+ ( (This)->lpVtbl -> DynamicMethodJITCompilationStarted(This,functionId,fIsSafeToBlock,pILHeader,cbILHeader) )
+
+#define ICorProfilerCallback9_DynamicMethodJITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \
+ ( (This)->lpVtbl -> DynamicMethodJITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) )
+
+
+#define ICorProfilerCallback9_DynamicMethodUnloaded(This,functionId) \
+ ( (This)->lpVtbl -> DynamicMethodUnloaded(This,functionId) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ICorProfilerCallback9_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_corprof_0000_0009 */
/* [local] */
typedef /* [public] */
-enum __MIDL___MIDL_itf_corprof_0000_0008_0001
+enum __MIDL___MIDL_itf_corprof_0000_0009_0001
{
COR_PRF_CODEGEN_DISABLE_INLINING = 0x1,
COR_PRF_CODEGEN_DISABLE_ALL_OPTIMIZATIONS = 0x2
@@ -6623,8 +7415,8 @@ enum __MIDL___MIDL_itf_corprof_0000_0008_0001
-extern RPC_IF_HANDLE __MIDL_itf_corprof_0000_0008_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_corprof_0000_0008_v0_0_s_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_corprof_0000_0009_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_corprof_0000_0009_v0_0_s_ifspec;
#ifndef __ICorProfilerInfo_INTERFACE_DEFINED__
#define __ICorProfilerInfo_INTERFACE_DEFINED__
diff --git a/src/pal/src/CMakeLists.txt b/src/pal/src/CMakeLists.txt
index 145c2c9ed9..b8a9fe9e46 100644
--- a/src/pal/src/CMakeLists.txt
+++ b/src/pal/src/CMakeLists.txt
@@ -93,10 +93,10 @@ elseif(PAL_CMAKE_PLATFORM_ARCH_I386)
set(PAL_ARCH_SOURCES_DIR i386)
endif()
-if(CMAKE_SYSTEM_NAME STREQUAL Linux AND NOT CLR_CMAKE_PLATFORM_ALPINE_LINUX)
+if(PAL_CMAKE_PLATFORM_ARCH_AMD64 AND CMAKE_SYSTEM_NAME STREQUAL Linux AND NOT CLR_CMAKE_PLATFORM_ALPINE_LINUX)
# Currently the _xstate is not available on Alpine Linux
add_definitions(-DXSTATE_SUPPORTED)
-endif(CMAKE_SYSTEM_NAME STREQUAL Linux AND NOT CLR_CMAKE_PLATFORM_ALPINE_LINUX)
+endif(PAL_CMAKE_PLATFORM_ARCH_AMD64 AND CMAKE_SYSTEM_NAME STREQUAL Linux AND NOT CLR_CMAKE_PLATFORM_ALPINE_LINUX)
if(CLR_CMAKE_PLATFORM_ALPINE_LINUX)
# Setting RLIMIT_NOFILE breaks debugging of coreclr on Alpine Linux for some reason
diff --git a/src/pal/src/config.h.in b/src/pal/src/config.h.in
index 7f37f42222..03513a1264 100644
--- a/src/pal/src/config.h.in
+++ b/src/pal/src/config.h.in
@@ -61,11 +61,14 @@
#cmakedefine01 HAS_SYSV_SEMAPHORES
#cmakedefine01 HAS_PTHREAD_MUTEXES
#cmakedefine01 HAVE_TTRACE
+#cmakedefine01 HAVE_PIPE2
#cmakedefine01 HAVE_SCHED_GETAFFINITY
#cmakedefine HAVE_UNW_GET_SAVE_LOC
#cmakedefine HAVE_UNW_GET_ACCESSORS
#cmakedefine01 HAVE_XSWDEV
#cmakedefine01 HAVE_XSW_USAGE
+#cmakedefine01 HAVE_PUBLIC_XSTATE_STRUCT
+#cmakedefine01 HAVE_PR_SET_PTRACER
#cmakedefine01 HAVE_STAT_TIMESPEC
#cmakedefine01 HAVE_STAT_NSEC
diff --git a/src/pal/src/configure.cmake b/src/pal/src/configure.cmake
index b5b98d5b2d..2f17f6b08c 100644
--- a/src/pal/src/configure.cmake
+++ b/src/pal/src/configure.cmake
@@ -99,6 +99,7 @@ check_function_exists(directio HAVE_DIRECTIO)
check_function_exists(semget HAS_SYSV_SEMAPHORES)
check_function_exists(pthread_mutex_init HAS_PTHREAD_MUTEXES)
check_function_exists(ttrace HAVE_TTRACE)
+check_function_exists(pipe2 HAVE_PIPE2)
set(CMAKE_REQUIRED_LIBRARIES unwind unwind-generic)
check_cxx_source_compiles("
#include <libunwind.h>
@@ -1022,6 +1023,25 @@ int main(int argc, char **argv)
return 0;
}" HAVE_XSW_USAGE)
+check_cxx_source_compiles("
+#include <signal.h>
+
+int main(int argc, char **argv)
+{
+ struct _xstate xstate;
+ struct _fpx_sw_bytes bytes;
+ return 0;
+}" HAVE_PUBLIC_XSTATE_STRUCT)
+
+check_cxx_source_compiles("
+#include <sys/prctl.h>
+
+int main(int argc, char **argv)
+{
+ int flag = (int)PR_SET_PTRACER;
+ return 0;
+}" HAVE_PR_SET_PTRACER)
+
set(CMAKE_REQUIRED_LIBRARIES pthread)
check_cxx_source_compiles("
#include <errno.h>
diff --git a/src/pal/src/file/file.cpp b/src/pal/src/file/file.cpp
index a4ad20db32..feec65531c 100644
--- a/src/pal/src/file/file.cpp
+++ b/src/pal/src/file/file.cpp
@@ -4056,14 +4056,14 @@ CorUnix::InternalCreatePipe(
/* enable close-on-exec for both pipes; if one gets passed to CreateProcess
it will be "uncloseonexeced" in order to be inherited */
- if(-1 == fcntl(readWritePipeDes[0],F_SETFD,1))
+ if(-1 == fcntl(readWritePipeDes[0],F_SETFD,FD_CLOEXEC))
{
ASSERT("can't set close-on-exec flag; fcntl() failed. errno is %d "
"(%s)\n", errno, strerror(errno));
palError = ERROR_INTERNAL_ERROR;
goto InternalCreatePipeExit;
}
- if(-1 == fcntl(readWritePipeDes[1],F_SETFD,1))
+ if(-1 == fcntl(readWritePipeDes[1],F_SETFD,FD_CLOEXEC))
{
ASSERT("can't set close-on-exec flag; fcntl() failed. errno is %d "
"(%s)\n", errno, strerror(errno));
@@ -4564,7 +4564,7 @@ static HANDLE init_std_handle(HANDLE * pStd, FILE *stream)
/* duplicate the FILE *, so that we can fclose() in FILECloseHandle without
closing the original */
- new_fd = dup(fileno(stream));
+ new_fd = fcntl(fileno(stream), F_DUPFD_CLOEXEC, 0); // dup, but with CLOEXEC
if(-1 == new_fd)
{
ERROR("dup() failed; errno is %d (%s)\n", errno, strerror(errno));
diff --git a/src/pal/src/include/pal/context.h b/src/pal/src/include/pal/context.h
index db6d69579a..2c86a03d69 100644
--- a/src/pal/src/include/pal/context.h
+++ b/src/pal/src/include/pal/context.h
@@ -39,6 +39,16 @@ typedef ucontext_t native_context_t;
#else // HAVE_UCONTEXT_T
#error Native context type is not known on this platform!
#endif // HAVE_UCONTEXT_T
+
+#if defined(XSTATE_SUPPORTED) && !HAVE_PUBLIC_XSTATE_STRUCT
+namespace asm_sigcontext
+{
+#include <asm/sigcontext.h>
+};
+using asm_sigcontext::_fpx_sw_bytes;
+using asm_sigcontext::_xstate;
+#endif // defined(XSTATE_SUPPORTED) && !HAVE_PUBLIC_XSTATE_STRUCT
+
#else // !HAVE_MACH_EXCEPTIONS
#include <mach/kern_return.h>
#include <mach/mach_port.h>
diff --git a/src/pal/src/include/pal/virtual.h b/src/pal/src/include/pal/virtual.h
index 31d225fc04..36eaf81e3a 100644
--- a/src/pal/src/include/pal/virtual.h
+++ b/src/pal/src/include/pal/virtual.h
@@ -60,7 +60,7 @@ enum VIRTUAL_CONSTANTS
VIRTUAL_PAGE_SIZE = 0x1000,
VIRTUAL_PAGE_MASK = VIRTUAL_PAGE_SIZE - 1,
- BOUNDARY_64K = 0xffff
+ VIRTUAL_64KB = 0x10000
};
/*++
@@ -130,11 +130,22 @@ public:
AllocateMemory
This function attempts to allocate the requested amount of memory from its reserved virtual
- address space. The function will return NULL if the allocation request cannot
+ address space. The function will return null if the allocation request cannot
be satisfied by the memory that is currently available in the allocator.
--*/
void* AllocateMemory(SIZE_T allocationSize);
+ /*++
+ Function:
+ AllocateMemory
+
+ This function attempts to allocate the requested amount of memory from its reserved virtual
+ address space, if memory is available within the specified range. The function will return
+ null if the allocation request cannot satisfied by the memory that is currently available in
+ the allocator.
+ --*/
+ void *AllocateMemoryWithinRange(const void *beginAddress, const void *endAddress, SIZE_T allocationSize);
+
private:
/*++
Function:
@@ -160,12 +171,13 @@ private:
// that can be used to calculate an approximate location of the memory that
// is in 2GB range from the coreclr library. In addition, having precise size of libcoreclr
// is not necessary for the calculations.
- const int32_t CoreClrLibrarySize = 100 * 1024 * 1024;
+ static const int32_t CoreClrLibrarySize = 100 * 1024 * 1024;
// This constant represent the max size of the virtual memory that this allocator
// will try to reserve during initialization. We want all JIT-ed code and the
// entire libcoreclr to be located in a 2GB range.
- const int32_t MaxExecutableMemorySize = 0x7FFF0000 - CoreClrLibrarySize;
+ static const int32_t MaxExecutableMemorySize = 0x7FFF0000;
+ static const int32_t MaxExecutableMemorySizeNearCoreClr = MaxExecutableMemorySize - CoreClrLibrarySize;
// Start address of the reserved virtual address space
void* m_startAddress;
diff --git a/src/pal/src/map/map.cpp b/src/pal/src/map/map.cpp
index 5fdb6fda38..b8ffc84db4 100644
--- a/src/pal/src/map/map.cpp
+++ b/src/pal/src/map/map.cpp
@@ -246,7 +246,7 @@ FileMappingInitializationRoutine(
pProcessLocalData->UnixFd = InternalOpen(
pImmutableData->szFileName,
- MAPProtectionToFileOpenFlags(pImmutableData->flProtect)
+ MAPProtectionToFileOpenFlags(pImmutableData->flProtect) | O_CLOEXEC
);
if (-1 == pProcessLocalData->UnixFd)
@@ -510,7 +510,7 @@ CorUnix::InternalCreateFileMapping(
#if HAVE_MMAP_DEV_ZERO
- UnixFd = InternalOpen(pImmutableData->szFileName, O_RDWR);
+ UnixFd = InternalOpen(pImmutableData->szFileName, O_RDWR | O_CLOEXEC);
if ( -1 == UnixFd )
{
ERROR( "Unable to open the file.\n");
@@ -587,7 +587,7 @@ CorUnix::InternalCreateFileMapping(
// information, though...
//
- UnixFd = dup(pFileLocalData->unix_fd);
+ UnixFd = fcntl(pFileLocalData->unix_fd, F_DUPFD_CLOEXEC, 0); // dup, but with CLOEXEC
if (-1 == UnixFd)
{
ERROR( "Unable to duplicate the Unix file descriptor!\n" );
@@ -2440,20 +2440,21 @@ void * MAPMapPEFile(HANDLE hFile)
// We're going to start adding mappings to the mapping list, so take the critical section
InternalEnterCriticalSection(pThread, &mapping_critsec);
-#if !defined(_AMD64_)
- loadedBase = mmap((void*)preferredBase, virtualSize, PROT_NONE, MAP_ANON|MAP_PRIVATE, -1, 0);
-#else // defined(_AMD64_)
+#ifdef BIT64
// First try to reserve virtual memory using ExecutableAllcator. This allows all PE images to be
// near each other and close to the coreclr library which also allows the runtime to generate
- // more efficient code (by avoiding usage of jump stubs).
- loadedBase = ReserveMemoryFromExecutableAllocator(pThread, ALIGN_UP(virtualSize, GetVirtualPageSize()));
+ // more efficient code (by avoiding usage of jump stubs). Alignment to a 64 KB granularity should
+ // not be necessary (alignment to page size should be sufficient), but see
+ // ExecutableMemoryAllocator::AllocateMemory() for the reason why it is done.
+ loadedBase = ReserveMemoryFromExecutableAllocator(pThread, ALIGN_UP(virtualSize, VIRTUAL_64KB));
+#endif // BIT64
+
if (loadedBase == NULL)
{
// MAC64 requires we pass MAP_SHARED (or MAP_PRIVATE) flags - otherwise, the call is failed.
// Refer to mmap documentation at http://www.manpagez.com/man/2/mmap/ for details.
- loadedBase = mmap((void*)preferredBase, virtualSize, PROT_NONE, MAP_ANON|MAP_PRIVATE, -1, 0);
+ loadedBase = mmap(NULL, virtualSize, PROT_NONE, MAP_ANON|MAP_PRIVATE, -1, 0);
}
-#endif // !defined(_AMD64_)
if (MAP_FAILED == loadedBase)
{
diff --git a/src/pal/src/map/virtual.cpp b/src/pal/src/map/virtual.cpp
index 7e00843b7a..41bd37c9b4 100644
--- a/src/pal/src/map/virtual.cpp
+++ b/src/pal/src/map/virtual.cpp
@@ -18,15 +18,19 @@ Abstract:
--*/
+#include "pal/dbgmsg.h"
+
+SET_DEFAULT_DEBUG_CHANNEL(VIRTUAL); // some headers have code with asserts, so do this first
+
#include "pal/thread.hpp"
#include "pal/cs.hpp"
#include "pal/malloc.hpp"
#include "pal/file.hpp"
#include "pal/seh.hpp"
-#include "pal/dbgmsg.h"
#include "pal/virtual.h"
#include "pal/map.h"
#include "pal/init.h"
+#include "pal/utils.h"
#include "common.h"
#include <sys/types.h>
@@ -43,8 +47,6 @@ Abstract:
using namespace CorUnix;
-SET_DEFAULT_DEBUG_CHANNEL(VIRTUAL);
-
CRITICAL_SECTION virtual_critsec;
// The first node in our list of allocated blocks.
@@ -93,6 +95,7 @@ namespace VirtualMemoryLogging
Decommit = 0x40,
Release = 0x50,
Reset = 0x60,
+ ReserveFromExecutableMemoryAllocatorWithinRange = 0x70
};
// Indicates that the attempted operation has failed
@@ -884,8 +887,13 @@ static LPVOID VIRTUALReserveMemory(
// First, figure out where we're trying to reserve the memory and
// how much we need. On most systems, requests to mmap must be
- // page-aligned and at multiples of the page size.
- StartBoundary = (UINT_PTR)lpAddress & ~BOUNDARY_64K;
+ // page-aligned and at multiples of the page size. Unlike on Windows, on
+ // Unix, the allocation granularity is the page size, so the memory size to
+ // reserve is not aligned to 64 KB. Nor should the start boundary need to
+ // to be aligned down to 64 KB, but it is expected that there are other
+ // components that rely on this alignment when providing a specific address
+ // (note that mmap itself does not make any such guarantees).
+ StartBoundary = (UINT_PTR)ALIGN_DOWN(lpAddress, VIRTUAL_64KB);
/* Add the sizes, and round down to the nearest page boundary. */
MemSize = ( ((UINT_PTR)lpAddress + dwSize + VIRTUAL_PAGE_MASK) & ~VIRTUAL_PAGE_MASK ) -
StartBoundary;
@@ -894,7 +902,14 @@ static LPVOID VIRTUALReserveMemory(
// try to get memory from the executable memory allocator to satisfy the request.
if (((flAllocationType & MEM_RESERVE_EXECUTABLE) != 0) && (lpAddress == NULL))
{
- pRetVal = g_executableMemoryAllocator.AllocateMemory(MemSize);
+ // Alignment to a 64 KB granularity should not be necessary (alignment to page size should be sufficient), but see
+ // ExecutableMemoryAllocator::AllocateMemory() for the reason why it is done
+ SIZE_T reservationSize = ALIGN_UP(MemSize, VIRTUAL_64KB);
+ pRetVal = g_executableMemoryAllocator.AllocateMemory(reservationSize);
+ if (pRetVal != nullptr)
+ {
+ MemSize = reservationSize;
+ }
}
if (pRetVal == NULL)
@@ -1227,6 +1242,72 @@ done:
/*++
Function:
+ PAL_VirtualReserveFromExecutableMemoryAllocatorWithinRange
+
+ This function attempts to allocate the requested amount of memory in the specified address range, from the executable memory
+ allocator. If unable to do so, the function returns nullptr and does not set the last error.
+
+ lpBeginAddress - Inclusive beginning of range
+ lpEndAddress - Exclusive end of range
+ dwSize - Number of bytes to allocate
+--*/
+LPVOID
+PALAPI
+PAL_VirtualReserveFromExecutableMemoryAllocatorWithinRange(
+ IN LPCVOID lpBeginAddress,
+ IN LPCVOID lpEndAddress,
+ IN SIZE_T dwSize)
+{
+#ifdef BIT64
+ PERF_ENTRY(PAL_VirtualReserveFromExecutableMemoryAllocatorWithinRange);
+ ENTRY(
+ "PAL_VirtualReserveFromExecutableMemoryAllocatorWithinRange(lpBeginAddress = %p, lpEndAddress = %p, dwSize = %Iu)\n",
+ lpBeginAddress,
+ lpEndAddress,
+ dwSize);
+
+ _ASSERTE(lpBeginAddress <= lpEndAddress);
+
+ // Alignment to a 64 KB granularity should not be necessary (alignment to page size should be sufficient), but see
+ // ExecutableMemoryAllocator::AllocateMemory() for the reason why it is done
+ SIZE_T reservationSize = ALIGN_UP(dwSize, VIRTUAL_64KB);
+
+ CPalThread *currentThread = InternalGetCurrentThread();
+ InternalEnterCriticalSection(currentThread, &virtual_critsec);
+
+ void *address = g_executableMemoryAllocator.AllocateMemoryWithinRange(lpBeginAddress, lpEndAddress, reservationSize);
+ if (address != nullptr)
+ {
+ _ASSERTE(IS_ALIGNED(address, VIRTUAL_PAGE_SIZE));
+ if (!VIRTUALStoreAllocationInfo((UINT_PTR)address, reservationSize, MEM_RESERVE | MEM_RESERVE_EXECUTABLE, PAGE_NOACCESS))
+ {
+ ASSERT("Unable to store the structure in the list.\n");
+ munmap(address, reservationSize);
+ address = nullptr;
+ }
+ }
+
+ LogVaOperation(
+ VirtualMemoryLogging::VirtualOperation::ReserveFromExecutableMemoryAllocatorWithinRange,
+ nullptr,
+ dwSize,
+ MEM_RESERVE | MEM_RESERVE_EXECUTABLE,
+ PAGE_NOACCESS,
+ address,
+ TRUE);
+
+ InternalLeaveCriticalSection(currentThread, &virtual_critsec);
+
+ LOGEXIT("PAL_VirtualReserveFromExecutableMemoryAllocatorWithinRange returning %p\n", address);
+ PERF_EXIT(PAL_VirtualReserveFromExecutableMemoryAllocatorWithinRange);
+ return address;
+#else // !BIT64
+ return nullptr;
+#endif // BIT64
+}
+
+/*++
+Function:
VirtualAlloc
Note:
@@ -1982,11 +2063,15 @@ Function :
--*/
void* ReserveMemoryFromExecutableAllocator(CPalThread* pThread, SIZE_T allocationSize)
{
+#ifdef BIT64
InternalEnterCriticalSection(pThread, &virtual_critsec);
void* mem = g_executableMemoryAllocator.AllocateMemory(allocationSize);
InternalLeaveCriticalSection(pThread, &virtual_critsec);
return mem;
+#else // !BIT64
+ return nullptr;
+#endif // BIT64
}
/*++
@@ -2024,14 +2109,14 @@ Function:
void ExecutableMemoryAllocator::TryReserveInitialMemory()
{
CPalThread* pthrCurrent = InternalGetCurrentThread();
- int32_t sizeOfAllocation = MaxExecutableMemorySize;
- int32_t startAddressIncrement;
- UINT_PTR startAddress;
+ int32_t sizeOfAllocation = MaxExecutableMemorySizeNearCoreClr;
+ int32_t preferredStartAddressIncrement;
+ UINT_PTR preferredStartAddress;
UINT_PTR coreclrLoadAddress;
const int32_t MemoryProbingIncrement = 128 * 1024 * 1024;
// Try to find and reserve an available region of virtual memory that is located
- // within 2GB range (defined by the MaxExecutableMemorySize constant) from the
+ // within 2GB range (defined by the MaxExecutableMemorySizeNearCoreClr constant) from the
// location of the coreclr library.
// Potentially, as a possible future improvement, we can get precise information
// about available memory ranges by parsing data from '/proc/self/maps'.
@@ -2045,40 +2130,69 @@ void ExecutableMemoryAllocator::TryReserveInitialMemory()
// (thus avoiding reserving memory below 4GB; besides some operating systems do not allow that).
// If libcoreclr is loaded at high addresses then try to reserve memory below its location.
coreclrLoadAddress = (UINT_PTR)PAL_GetSymbolModuleBase((void*)VirtualAlloc);
- if ((coreclrLoadAddress < 0xFFFFFFFF) || ((coreclrLoadAddress - MaxExecutableMemorySize) < 0xFFFFFFFF))
+ if ((coreclrLoadAddress < 0xFFFFFFFF) || ((coreclrLoadAddress - MaxExecutableMemorySizeNearCoreClr) < 0xFFFFFFFF))
{
// Try to allocate above the location of libcoreclr
- startAddress = coreclrLoadAddress + CoreClrLibrarySize;
- startAddressIncrement = MemoryProbingIncrement;
+ preferredStartAddress = coreclrLoadAddress + CoreClrLibrarySize;
+ preferredStartAddressIncrement = MemoryProbingIncrement;
}
else
{
// Try to allocate below the location of libcoreclr
- startAddress = coreclrLoadAddress - MaxExecutableMemorySize;
- startAddressIncrement = 0;
+ preferredStartAddress = coreclrLoadAddress - MaxExecutableMemorySizeNearCoreClr;
+ preferredStartAddressIncrement = 0;
}
// Do actual memory reservation.
do
{
- m_startAddress = ReserveVirtualMemory(pthrCurrent, (void*)startAddress, sizeOfAllocation);
- if (m_startAddress != NULL)
+ m_startAddress = ReserveVirtualMemory(pthrCurrent, (void*)preferredStartAddress, sizeOfAllocation);
+ if (m_startAddress != nullptr)
{
- // Memory has been successfully reserved.
- m_totalSizeOfReservedMemory = sizeOfAllocation;
-
- // Randomize the location at which we start allocating from the reserved memory range.
- int32_t randomOffset = GenerateRandomStartOffset();
- m_nextFreeAddress = (void*)(((UINT_PTR)m_startAddress) + randomOffset);
- m_remainingReservedMemory = sizeOfAllocation - randomOffset;
break;
}
// Try to allocate a smaller region
sizeOfAllocation -= MemoryProbingIncrement;
- startAddress += startAddressIncrement;
+ preferredStartAddress += preferredStartAddressIncrement;
} while (sizeOfAllocation >= MemoryProbingIncrement);
+
+ if (m_startAddress == nullptr)
+ {
+ // We were not able to reserve any memory near libcoreclr. Try to reserve approximately 2 GB of address space somewhere
+ // anyway:
+ // - This sets aside address space that can be used for executable code, such that jumps/calls between such code may
+ // continue to use short relative addresses instead of long absolute addresses that would currently require jump
+ // stubs.
+ // - The inability to allocate memory in a specific range for jump stubs is an unrecoverable problem. This reservation
+ // would mitigate such issues that can become prevalent depending on which security features are enabled and to what
+ // extent, such as in particular, PaX's RANDMMAP:
+ // - https://en.wikibooks.org/wiki/Grsecurity/Appendix/Grsecurity_and_PaX_Configuration_Options
+ // - Jump stubs for executable code residing in this region can request memory from this allocator
+ // - Native images can be loaded into this address space, including any jump stubs that are required for its helper
+ // table. This satisfies the vast majority of practical cases where the total amount of loaded native image memory
+ // does not exceed approximately 2 GB.
+ // - The code heap allocator for the JIT can allocate from this address space. Beyond this reservation, one can use
+ // the COMPlus_CodeHeapReserveForJumpStubs environment variable to reserve space for jump stubs.
+ sizeOfAllocation = MaxExecutableMemorySize;
+ m_startAddress = ReserveVirtualMemory(pthrCurrent, nullptr, sizeOfAllocation);
+ if (m_startAddress == nullptr)
+ {
+ return;
+ }
+ }
+
+ // Memory has been successfully reserved.
+ m_totalSizeOfReservedMemory = sizeOfAllocation;
+
+ // Randomize the location at which we start allocating from the reserved memory range. Alignment to a 64 KB granularity
+ // should not be necessary, but see AllocateMemory() for the reason why it is done.
+ int32_t randomOffset = GenerateRandomStartOffset();
+ m_nextFreeAddress = ALIGN_UP((void*)(((UINT_PTR)m_startAddress) + randomOffset), VIRTUAL_64KB);
+ _ASSERTE(sizeOfAllocation >= (UINT_PTR)m_nextFreeAddress - (UINT_PTR)m_startAddress);
+ m_remainingReservedMemory =
+ ALIGN_DOWN(sizeOfAllocation - ((UINT_PTR)m_nextFreeAddress - (UINT_PTR)m_startAddress), VIRTUAL_64KB);
}
/*++
@@ -2086,7 +2200,7 @@ Function:
ExecutableMemoryAllocator::AllocateMemory
This function attempts to allocate the requested amount of memory from its reserved virtual
- address space. The function will return NULL if the allocation request cannot
+ address space. The function will return null if the allocation request cannot
be satisfied by the memory that is currently available in the allocator.
Note: This function MUST be called with the virtual_critsec lock held.
@@ -2094,10 +2208,15 @@ Function:
--*/
void* ExecutableMemoryAllocator::AllocateMemory(SIZE_T allocationSize)
{
- void* allocatedMemory = NULL;
+#ifdef BIT64
+ void* allocatedMemory = nullptr;
- // Allocation size must be in multiples of the virtual page size.
- _ASSERTE((allocationSize & VIRTUAL_PAGE_MASK) == 0);
+ // Alignment to a 64 KB granularity should not be necessary (alignment to page size should be sufficient), but
+ // VIRTUALReserveMemory() aligns down the specified address to a 64 KB granularity, and as long as that is necessary, the
+ // reservation size here must be aligned to a 64 KB granularity to guarantee that all returned addresses are also aligned to
+ // a 64 KB granularity. Otherwise, attempting to reserve memory starting from an unaligned address returned by this function
+ // would fail in VIRTUALReserveMemory.
+ _ASSERTE(IS_ALIGNED(allocationSize, VIRTUAL_64KB));
// The code below assumes that the caller owns the virtual_critsec lock.
// So the calculations are not done in thread-safe manner.
@@ -2106,10 +2225,60 @@ void* ExecutableMemoryAllocator::AllocateMemory(SIZE_T allocationSize)
allocatedMemory = m_nextFreeAddress;
m_nextFreeAddress = (void*)(((UINT_PTR)m_nextFreeAddress) + allocationSize);
m_remainingReservedMemory -= allocationSize;
-
}
return allocatedMemory;
+#else // !BIT64
+ return nullptr;
+#endif // BIT64
+}
+
+/*++
+Function:
+ AllocateMemory
+
+ This function attempts to allocate the requested amount of memory from its reserved virtual
+ address space, if memory is available within the specified range. The function will return
+ null if the allocation request cannot satisfied by the memory that is currently available in
+ the allocator.
+
+ Note: This function MUST be called with the virtual_critsec lock held.
+--*/
+void *ExecutableMemoryAllocator::AllocateMemoryWithinRange(const void *beginAddress, const void *endAddress, SIZE_T allocationSize)
+{
+#ifdef BIT64
+ _ASSERTE(beginAddress <= endAddress);
+
+ // Alignment to a 64 KB granularity should not be necessary (alignment to page size should be sufficient), but see
+ // AllocateMemory() for the reason why it is necessary
+ _ASSERTE(IS_ALIGNED(allocationSize, VIRTUAL_64KB));
+
+ // The code below assumes that the caller owns the virtual_critsec lock.
+ // So the calculations are not done in thread-safe manner.
+
+ if (allocationSize == 0 || allocationSize > m_remainingReservedMemory)
+ {
+ return nullptr;
+ }
+
+ void *address = m_nextFreeAddress;
+ if (address < beginAddress)
+ {
+ return nullptr;
+ }
+
+ void *nextFreeAddress = (void *)((UINT_PTR)address + allocationSize);
+ if (nextFreeAddress > endAddress)
+ {
+ return nullptr;
+ }
+
+ m_nextFreeAddress = nextFreeAddress;
+ m_remainingReservedMemory -= allocationSize;
+ return address;
+#else // !BIT64
+ return nullptr;
+#endif // BIT64
}
/*++
diff --git a/src/pal/src/synchmgr/synchmanager.cpp b/src/pal/src/synchmgr/synchmanager.cpp
index d836a177bb..73b5644dbd 100644
--- a/src/pal/src/synchmgr/synchmanager.cpp
+++ b/src/pal/src/synchmgr/synchmanager.cpp
@@ -3525,12 +3525,22 @@ namespace CorUnix
}
#else // !CORECLR
int rgiPipe[] = { -1, -1 };
- if (pipe(rgiPipe) == -1)
+ int pipeRv =
+#if HAVE_PIPE2
+ pipe2(rgiPipe, O_CLOEXEC);
+#else
+ pipe(rgiPipe);
+#endif // HAVE_PIPE2
+ if (pipeRv == -1)
{
ERROR("Unable to create the process pipe\n");
fRet = false;
goto CPP_exit;
}
+#if !HAVE_PIPE2
+ fcntl(rgiPipe[0], F_SETFD, FD_CLOEXEC); // make pipe non-inheritable, if possible
+ fcntl(rgiPipe[1], F_SETFD, FD_CLOEXEC);
+#endif // !HAVE_PIPE2
#endif // !CORECLR
#if HAVE_KQUEUE && !HAVE_BROKEN_FIFO_KEVENT
diff --git a/src/pal/src/thread/process.cpp b/src/pal/src/thread/process.cpp
index 2a93d3c57d..6db9bf6f51 100644
--- a/src/pal/src/thread/process.cpp
+++ b/src/pal/src/thread/process.cpp
@@ -2981,7 +2981,7 @@ PROCAbort()
// Do any shutdown cleanup before aborting or creating a core dump
PROCNotifyProcessShutdown();
-#if HAVE_PRCTL_H
+#if HAVE_PRCTL_H && HAVE_PR_SET_PTRACER
// If enabled, launch the create minidump utility and wait until it completes
if (g_argvCreateDump[0] != nullptr)
{
@@ -3018,7 +3018,7 @@ PROCAbort()
}
}
}
-#endif // HAVE_PRCTL_H
+#endif // HAVE_PRCTL_H && HAVE_PR_SET_PTRACER
// Abort the process after waiting for the core dump to complete
abort();
}
diff --git a/src/pal/src/thread/threadsusp.cpp b/src/pal/src/thread/threadsusp.cpp
index c7787bef68..f8a435c022 100644
--- a/src/pal/src/thread/threadsusp.cpp
+++ b/src/pal/src/thread/threadsusp.cpp
@@ -74,11 +74,21 @@ CThreadSuspensionInfo::InternalSuspendNewThreadFromData(
ReleaseSuspensionLock(pThread);
int pipe_descs[2];
- if (pipe(pipe_descs) == -1)
+ int pipeRv =
+#if HAVE_PIPE2
+ pipe2(pipe_descs, O_CLOEXEC);
+#else
+ pipe(pipe_descs);
+#endif // HAVE_PIPE2
+ if (pipeRv == -1)
{
ERROR("pipe() failed! error is %d (%s)\n", errno, strerror(errno));
return ERROR_NOT_ENOUGH_MEMORY;
}
+#if !HAVE_PIPE2
+ fcntl(pipe_descs[0], F_SETFD, FD_CLOEXEC); // make pipe non-inheritable, if possible
+ fcntl(pipe_descs[1], F_SETFD, FD_CLOEXEC);
+#endif // !HAVE_PIPE2
// [0] is the read end of the pipe, and [1] is the write end.
pThread->suspensionInfo.SetBlockingPipe(pipe_descs[1]);
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test1/MapViewOfFile.cpp b/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test1/MapViewOfFile.cpp
index 6177e0decf..6bfb73f0e8 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test1/MapViewOfFile.cpp
+++ b/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test1/MapViewOfFile.cpp
@@ -14,13 +14,26 @@
**============================================================*/
#include <palsuite.h>
#define MAPPINGSIZE 8192
+
+// This test is special - it doesn't work when the file is created on a tmpfs, like the /tmp folder
+// that is the default location for running PAL tests. The reason is that on such filesystem,
+// it is not possible to create file with FILE_FLAG_NO_BUFFERING.
+// So we explicitly use the /var/tmp that cannot be on tmpfs, since it it persistent over reboots.
+
+#ifndef __ANDROID__
+#define TEMP_DIRECTORY_PATH "/var/tmp/"
+#else
+// On Android, "/var/tmp/" doesn't exist; temporary files should go to /data/local/tmp/
+#define TEMP_DIRECTORY_PATH "/data/local/tmp/"
+#endif
+
int __cdecl main(int argc, char *argv[])
{
HANDLE hFile = INVALID_HANDLE_VALUE;
LPSTR buf = NULL;
CHAR ch[MAPPINGSIZE];
- CHAR lpFileName[] = "test.tmp";
+ CHAR lpFilePath[MAX_PATH];
DWORD dwBytesWritten = 0;
DWORD dwInitialSize = 0;
DWORD dwFinalSize = 0;
@@ -36,9 +49,11 @@ int __cdecl main(int argc, char *argv[])
return FAIL;
}
+ GetTempFileName(TEMP_DIRECTORY_PATH, "tst", 0, lpFilePath);
+
/* Create a file handle with CreateFile.
*/
- hFile = CreateFile( lpFileName,
+ hFile = CreateFile( lpFilePath,
GENERIC_WRITE|GENERIC_READ,
FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL,
@@ -49,7 +64,7 @@ int __cdecl main(int argc, char *argv[])
if (hFile == INVALID_HANDLE_VALUE)
{
Fail( "ERROR: %u :unable to create file \"%s\".\n",
- GetLastError(), lpFileName);
+ GetLastError(), lpFilePath);
}
/* Get the initial size of file, for latter tests.
@@ -58,7 +73,7 @@ int __cdecl main(int argc, char *argv[])
if ( INVALID_FILE_SIZE == dwInitialSize )
{
Fail("ERROR:%u: The created file \"%s\" has an invalid "
- "file size.\n",GetLastError(),lpFileName);
+ "file size.\n",GetLastError(),lpFilePath);
}
/*
@@ -220,6 +235,9 @@ int __cdecl main(int argc, char *argv[])
}
VirtualFree( buf, 0, MEM_RELEASE );
+
+ DeleteFile(lpFilePath);
+
PAL_Terminate();
return PASS;
}
diff --git a/src/pal/tests/palsuite/paltestlist.txt b/src/pal/tests/palsuite/paltestlist.txt
index f0dfe3f9ea..1e580cd596 100644
--- a/src/pal/tests/palsuite/paltestlist.txt
+++ b/src/pal/tests/palsuite/paltestlist.txt
@@ -473,6 +473,7 @@ filemapping_memmgt/LocalFree/test1/paltest_localfree_test1
filemapping_memmgt/LocalFree/test2/paltest_localfree_test2
filemapping_memmgt/LockFile/test2/paltest_lockfile_test2
filemapping_memmgt/LockFile/test7/paltest_lockfile_test7
+filemapping_memmgt/MapViewOfFile/test1/paltest_mapviewoffile_test1
filemapping_memmgt/MapViewOfFile/test2/paltest_mapviewoffile_test2
filemapping_memmgt/MapViewOfFile/test3/paltest_mapviewoffile_test3
filemapping_memmgt/MapViewOfFile/test4/paltest_mapviewoffile_test4
diff --git a/src/pal/tools/gen-buildsys-clang.sh b/src/pal/tools/gen-buildsys-clang.sh
index 762a1996b9..944187786f 100755
--- a/src/pal/tools/gen-buildsys-clang.sh
+++ b/src/pal/tools/gen-buildsys-clang.sh
@@ -155,7 +155,7 @@ if [ "$build_arch" == "armel" ]; then
cmake_extra_defines="$cmake_extra_defines -DARM_SOFTFP=1"
fi
-clang_version=$(echo $CC | awk -F- '{ print $NF }')
+clang_version=$( $CC --version | head -1 | sed 's/[^0-9]*\([0-9]*\.[0-9]*\).*/\1/' )
# Use O1 option when the clang version is smaller than 3.9
# Otherwise use O3 option in release build
if [[ ( ${clang_version%.*} -eq 3 && ${clang_version#*.} -lt 9 ) &&
diff --git a/src/scripts/genEventPipe.py b/src/scripts/genEventPipe.py
new file mode 100644
index 0000000000..a00511d95d
--- /dev/null
+++ b/src/scripts/genEventPipe.py
@@ -0,0 +1,495 @@
+from __future__ import print_function
+from genXplatEventing import *
+from genXplatLttng import *
+import os
+import xml.dom.minidom as DOM
+
+stdprolog = """// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/******************************************************************
+
+DO NOT MODIFY. AUTOGENERATED FILE.
+This file is generated using the logic from <root>/src/scripts/genEventPipe.py
+
+******************************************************************/
+"""
+
+stdprolog_cmake = """#
+#
+#******************************************************************
+
+#DO NOT MODIFY. AUTOGENERATED FILE.
+#This file is generated using the logic from <root>/src/scripts/genEventPipe.py
+
+#******************************************************************
+"""
+
+
+def generateClrEventPipeWriteEventsImpl(
+ providerName, eventNodes, allTemplates, exclusionListFile):
+ providerPrettyName = providerName.replace("Windows-", '')
+ providerPrettyName = providerPrettyName.replace("Microsoft-", '')
+ providerPrettyName = providerPrettyName.replace('-', '_')
+ WriteEventImpl = []
+
+ # EventPipeEvent declaration
+ for eventNode in eventNodes:
+ eventName = eventNode.getAttribute('symbol')
+ WriteEventImpl.append(
+ "EventPipeEvent *EventPipeEvent" +
+ eventName +
+ " = nullptr;\n")
+
+ for eventNode in eventNodes:
+ eventName = eventNode.getAttribute('symbol')
+ templateName = eventNode.getAttribute('template')
+
+ # generate EventPipeEventEnabled function
+ eventEnabledImpl = """bool EventPipeEventEnabled%s()
+{
+ return EventPipeEvent%s->IsEnabled();
+}
+
+""" % (eventName, eventName)
+ WriteEventImpl.append(eventEnabledImpl)
+
+ # generate EventPipeWriteEvent function
+ fnptype = []
+ linefnptype = []
+ fnptype.append("extern \"C\" ULONG EventPipeWriteEvent")
+ fnptype.append(eventName)
+ fnptype.append("(\n")
+
+ if templateName:
+ template = allTemplates[templateName]
+ else:
+ template = None
+
+ if template:
+ fnSig = template.signature
+ for paramName in fnSig.paramlist:
+ fnparam = fnSig.getParam(paramName)
+ wintypeName = fnparam.winType
+ typewName = palDataTypeMapping[wintypeName]
+ winCount = fnparam.count
+ countw = palDataTypeMapping[winCount]
+
+ if paramName in template.structs:
+ linefnptype.append(
+ "%sint %s_ElementSize,\n" %
+ (lindent, paramName))
+
+ linefnptype.append(lindent)
+ linefnptype.append(typewName)
+ if countw != " ":
+ linefnptype.append(countw)
+
+ linefnptype.append(" ")
+ linefnptype.append(fnparam.name)
+ linefnptype.append(",\n")
+
+ if len(linefnptype) > 0:
+ del linefnptype[-1]
+
+ fnptype.extend(linefnptype)
+ fnptype.append(")\n{\n")
+ checking = """ if (!EventPipeEventEnabled%s())
+ return ERROR_SUCCESS;
+""" % (eventName)
+
+ fnptype.append(checking)
+
+ WriteEventImpl.extend(fnptype)
+
+ if template:
+ body = generateWriteEventBody(template, providerName, eventName)
+ WriteEventImpl.append(body)
+ else:
+ WriteEventImpl.append(
+ " EventPipe::WriteEvent(*EventPipeEvent" +
+ eventName +
+ ", nullptr, 0);\n")
+
+ WriteEventImpl.append("\n return ERROR_SUCCESS;\n}\n\n")
+
+ # EventPipeProvider and EventPipeEvent initialization
+ WriteEventImpl.append(
+ "extern \"C\" void Init" +
+ providerPrettyName +
+ "()\n{\n")
+ WriteEventImpl.append(
+ " EventPipeProvider" +
+ providerPrettyName +
+ " = EventPipe::CreateProvider(" +
+ providerPrettyName +
+ "GUID);\n")
+ for eventNode in eventNodes:
+ eventName = eventNode.getAttribute('symbol')
+ templateName = eventNode.getAttribute('template')
+ eventKeywords = eventNode.getAttribute('keywords')
+ eventKeywordsMask = generateEventKeywords(eventKeywords)
+ eventValue = eventNode.getAttribute('value')
+ eventVersion = eventNode.getAttribute('version')
+ eventLevel = eventNode.getAttribute('level')
+ eventLevel = eventLevel.replace("win:", "EventPipeEventLevel::")
+ exclusionInfo = parseExclusionList(exclusionListFile)
+ taskName = eventNode.getAttribute('task')
+
+ initEvent = """ EventPipeEvent%s = EventPipeProvider%s->AddEvent(%s,%s,%s,%s);
+""" % (eventName, providerPrettyName, eventValue, eventKeywordsMask, eventVersion, eventLevel)
+
+ WriteEventImpl.append(initEvent)
+ WriteEventImpl.append("}")
+
+ return ''.join(WriteEventImpl)
+
+
+def generateWriteEventBody(template, providerName, eventName):
+ header = """
+ char stackBuffer[%s];
+ char *buffer = stackBuffer;
+ unsigned int offset = 0;
+ unsigned int size = %s;
+ bool fixedBuffer = true;
+
+ bool success = true;
+""" % (template.estimated_size, template.estimated_size)
+
+ fnSig = template.signature
+ pack_list = []
+ for paramName in fnSig.paramlist:
+ parameter = fnSig.getParam(paramName)
+
+ if paramName in template.structs:
+ size = "(int)%s_ElementSize * (int)%s" % (
+ paramName, parameter.prop)
+ if template.name in specialCaseSizes and paramName in specialCaseSizes[template.name]:
+ size = "(int)(%s)" % specialCaseSizes[template.name][paramName]
+ pack_list.append(
+ " success &= WriteToBuffer((const BYTE *)%s, %s, buffer, offset, size, fixedBuffer);" %
+ (paramName, size))
+ elif paramName in template.arrays:
+ size = "sizeof(%s) * (int)%s" % (
+ lttngDataTypeMapping[parameter.winType],
+ parameter.prop)
+ if template.name in specialCaseSizes and paramName in specialCaseSizes[template.name]:
+ size = "(int)(%s)" % specialCaseSizes[template.name][paramName]
+ pack_list.append(
+ " success &= WriteToBuffer((const BYTE *)%s, %s, buffer, offset, size, fixedBuffer);" %
+ (paramName, size))
+ elif parameter.winType == "win:GUID":
+ pack_list.append(
+ " success &= WriteToBuffer(*%s, buffer, offset, size, fixedBuffer);" %
+ (parameter.name,))
+ else:
+ pack_list.append(
+ " success &= WriteToBuffer(%s, buffer, offset, size, fixedBuffer);" %
+ (parameter.name,))
+
+ code = "\n".join(pack_list) + "\n\n"
+
+ checking = """ if (!success)
+ {
+ if (!fixedBuffer)
+ delete[] buffer;
+ return ERROR_WRITE_FAULT;
+ }\n\n"""
+
+ body = " EventPipe::WriteEvent(*EventPipeEvent" + \
+ eventName + ", (BYTE *)buffer, size);\n"
+
+ footer = """
+ if (!fixedBuffer)
+ delete[] buffer;
+"""
+
+ return header + code + checking + body + footer
+
+providerGUIDMap = {}
+providerGUIDMap[
+ "{e13c0d23-ccbc-4e12-931b-d9cc2eee27e4}"] = "{0xe13c0d23,0xccbc,0x4e12,{0x93,0x1b,0xd9,0xcc,0x2e,0xee,0x27,0xe4}}"
+providerGUIDMap[
+ "{A669021C-C450-4609-A035-5AF59AF4DF18}"] = "{0xA669021C,0xC450,0x4609,{0xA0,0x35,0x5A,0xF5,0x9A,0xF4,0xDF,0x18}}"
+providerGUIDMap[
+ "{CC2BCBBA-16B6-4cf3-8990-D74C2E8AF500}"] = "{0xCC2BCBBA,0x16B6,0x4cf3,{0x89,0x90,0xD7,0x4C,0x2E,0x8A,0xF5,0x00}}"
+providerGUIDMap[
+ "{763FD754-7086-4dfe-95EB-C01A46FAF4CA}"] = "{0x763FD754,0x7086,0x4dfe,{0x95,0xEB,0xC0,0x1A,0x46,0xFA,0xF4,0xCA}}"
+
+
+def generateGUID(tmpGUID):
+ return providerGUIDMap[tmpGUID]
+
+keywordMap = {}
+
+
+def generateEventKeywords(eventKeywords):
+ mask = 0
+ # split keywords if there are multiple
+ allKeywords = eventKeywords.split()
+
+ for singleKeyword in allKeywords:
+ mask = mask | keywordMap[singleKeyword]
+
+ return mask
+
+
+def generateEventPipeCmakeFile(etwmanifest, eventpipe_directory):
+ tree = DOM.parse(etwmanifest)
+
+ with open(eventpipe_directory + "CMakeLists.txt", 'w') as topCmake:
+ topCmake.write(stdprolog_cmake + "\n")
+ topCmake.write("""cmake_minimum_required(VERSION 2.8.12.2)
+
+ project(eventpipe)
+
+ set(CMAKE_INCLUDE_CURRENT_DIR ON)
+ include_directories(${CLR_DIR}/src/vm)
+
+ add_library(eventpipe
+ STATIC\n""")
+
+ for providerNode in tree.getElementsByTagName('provider'):
+ providerName = providerNode.getAttribute('name')
+ providerName = providerName.replace("Windows-", '')
+ providerName = providerName.replace("Microsoft-", '')
+
+ providerName_File = providerName.replace('-', '')
+ providerName_File = providerName_File.lower()
+
+ topCmake.write(' "%s.cpp"\n' % (providerName_File))
+ topCmake.write(' "eventpipehelpers.cpp"\n')
+ topCmake.write(""" )
+
+ # Install the static eventpipe library
+ install(TARGETS eventpipe DESTINATION lib)
+ """)
+
+ topCmake.close()
+
+
+def generateEventPipeHelperFile(etwmanifest, eventpipe_directory):
+ with open(eventpipe_directory + "eventpipehelpers.cpp", 'w') as helper:
+ helper.write(stdprolog)
+ helper.write("""
+#include "stdlib.h"
+
+bool ResizeBuffer(char *&buffer, unsigned int& size, unsigned int currLen, unsigned int newSize, bool &fixedBuffer)
+{
+ newSize *= 1.5;
+ _ASSERTE(newSize > size); // check for overflow
+
+ if (newSize < 32)
+ newSize = 32;
+
+ char *newBuffer = new char[newSize];
+
+ memcpy(newBuffer, buffer, currLen);
+
+ if (!fixedBuffer)
+ delete[] buffer;
+
+ buffer = newBuffer;
+ size = newSize;
+ fixedBuffer = false;
+
+ return true;
+}
+
+bool WriteToBuffer(const BYTE *src, unsigned int len, char *&buffer, unsigned int& offset, unsigned int& size, bool &fixedBuffer)
+{
+ if(!src) return true;
+ if (offset + len > size)
+ {
+ if (!ResizeBuffer(buffer, size, offset, size + len, fixedBuffer))
+ return false;
+ }
+
+ memcpy(buffer + offset, src, len);
+ offset += len;
+ return true;
+}
+
+bool WriteToBuffer(PCWSTR str, char *&buffer, unsigned int& offset, unsigned int& size, bool &fixedBuffer)
+{
+ if(!str) return true;
+ unsigned int byteCount = (PAL_wcslen(str) + 1) * sizeof(*str);
+
+ if (offset + byteCount > size)
+ {
+ if (!ResizeBuffer(buffer, size, offset, size + byteCount, fixedBuffer))
+ return false;
+ }
+
+ memcpy(buffer + offset, str, byteCount);
+ offset += byteCount;
+ return true;
+}
+
+bool WriteToBuffer(const char *str, char *&buffer, unsigned int& offset, unsigned int& size, bool &fixedBuffer)
+{
+ if(!str) return true;
+ unsigned int len = strlen(str) + 1;
+ if (offset + len > size)
+ {
+ if (!ResizeBuffer(buffer, size, offset, size + len, fixedBuffer))
+ return false;
+ }
+
+ memcpy(buffer + offset, str, len);
+ offset += len;
+ return true;
+}
+
+""")
+
+ tree = DOM.parse(etwmanifest)
+
+ for providerNode in tree.getElementsByTagName('provider'):
+ providerName = providerNode.getAttribute('name')
+ providerPrettyName = providerName.replace("Windows-", '')
+ providerPrettyName = providerPrettyName.replace("Microsoft-", '')
+ providerPrettyName = providerPrettyName.replace('-', '_')
+ helper.write(
+ "extern \"C\" void Init" +
+ providerPrettyName +
+ "();\n\n")
+
+ helper.write("extern \"C\" void InitProvidersAndEvents()\n{\n")
+ for providerNode in tree.getElementsByTagName('provider'):
+ providerName = providerNode.getAttribute('name')
+ providerPrettyName = providerName.replace("Windows-", '')
+ providerPrettyName = providerPrettyName.replace("Microsoft-", '')
+ providerPrettyName = providerPrettyName.replace('-', '_')
+ helper.write(" Init" + providerPrettyName + "();\n")
+ helper.write("}")
+
+ helper.close()
+
+
+def generateEventPipeImplFiles(
+ etwmanifest, eventpipe_directory, exclusionListFile):
+ tree = DOM.parse(etwmanifest)
+ coreclrRoot = os.getcwd()
+ for providerNode in tree.getElementsByTagName('provider'):
+ providerGUID = providerNode.getAttribute('guid')
+ providerGUID = generateGUID(providerGUID)
+ providerName = providerNode.getAttribute('name')
+
+ providerPrettyName = providerName.replace("Windows-", '')
+ providerPrettyName = providerPrettyName.replace("Microsoft-", '')
+ providerName_File = providerPrettyName.replace('-', '')
+ providerName_File = providerName_File.lower()
+ providerPrettyName = providerPrettyName.replace('-', '_')
+ eventpipefile = eventpipe_directory + providerName_File + ".cpp"
+ eventpipeImpl = open(eventpipefile, 'w')
+ eventpipeImpl.write(stdprolog)
+
+ header = """
+#include \"%s/src/vm/common.h\"
+#include \"%s/src/vm/eventpipeprovider.h\"
+#include \"%s/src/vm/eventpipeevent.h\"
+#include \"%s/src/vm/eventpipe.h\"
+
+bool ResizeBuffer(char *&buffer, unsigned int& size, unsigned int currLen, unsigned int newSize, bool &fixedBuffer);
+bool WriteToBuffer(PCWSTR str, char *&buffer, unsigned int& offset, unsigned int& size, bool &fixedBuffer);
+bool WriteToBuffer(const char *str, char *&buffer, unsigned int& offset, unsigned int& size, bool &fixedBuffer);
+bool WriteToBuffer(const BYTE *src, unsigned int len, char *&buffer, unsigned int& offset, unsigned int& size, bool &fixedBuffer);
+
+template <typename T>
+bool WriteToBuffer(const T &value, char *&buffer, unsigned int& offset, unsigned int& size, bool &fixedBuffer)
+{
+ if (sizeof(T) + offset > size)
+ {
+ if (!ResizeBuffer(buffer, size, offset, size + sizeof(T), fixedBuffer))
+ return false;
+ }
+
+ *(T *)(buffer + offset) = value;
+ offset += sizeof(T);
+ return true;
+}
+
+""" % (coreclrRoot, coreclrRoot, coreclrRoot, coreclrRoot)
+
+ eventpipeImpl.write(header)
+ eventpipeImpl.write(
+ "GUID const " +
+ providerPrettyName +
+ "GUID = " +
+ providerGUID +
+ ";\n")
+ eventpipeImpl.write(
+ "EventPipeProvider *EventPipeProvider" +
+ providerPrettyName +
+ " = nullptr;\n")
+ templateNodes = providerNode.getElementsByTagName('template')
+ allTemplates = parseTemplateNodes(templateNodes)
+ eventNodes = providerNode.getElementsByTagName('event')
+ eventpipeImpl.write(
+ generateClrEventPipeWriteEventsImpl(
+ providerName,
+ eventNodes,
+ allTemplates,
+ exclusionListFile) + "\n")
+ eventpipeImpl.close()
+
+
+def generateEventPipeFiles(
+ etwmanifest, eventpipe_directory, exclusionListFile):
+ eventpipe_directory = eventpipe_directory + "/"
+ tree = DOM.parse(etwmanifest)
+
+ if not os.path.exists(eventpipe_directory):
+ os.makedirs(eventpipe_directory)
+
+ # generate Cmake file
+ generateEventPipeCmakeFile(etwmanifest, eventpipe_directory)
+
+ # generate helper file
+ generateEventPipeHelperFile(etwmanifest, eventpipe_directory)
+
+ # generate all keywords
+ for keywordNode in tree.getElementsByTagName('keyword'):
+ keywordName = keywordNode.getAttribute('name')
+ keywordMask = keywordNode.getAttribute('mask')
+ keywordMap[keywordName] = int(keywordMask, 0)
+
+ # generate .cpp file for each provider
+ generateEventPipeImplFiles(
+ etwmanifest,
+ eventpipe_directory,
+ exclusionListFile)
+
+import argparse
+import sys
+
+
+def main(argv):
+
+ # parse the command line
+ parser = argparse.ArgumentParser(
+ description="Generates the Code required to instrument eventpipe logging mechanism")
+
+ required = parser.add_argument_group('required arguments')
+ required.add_argument('--man', type=str, required=True,
+ help='full path to manifest containig the description of events')
+ required.add_argument('--intermediate', type=str, required=True,
+ help='full path to eventprovider intermediate directory')
+ required.add_argument('--exc', type=str, required=True,
+ help='full path to exclusion list')
+ args, unknown = parser.parse_known_args(argv)
+ if unknown:
+ print('Unknown argument(s): ', ', '.join(unknown))
+ return const.UnknownArguments
+
+ sClrEtwAllMan = args.man
+ intermediate = args.intermediate
+ exclusionListFile = args.exc
+
+ generateEventPipeFiles(sClrEtwAllMan, intermediate, exclusionListFile)
+
+if __name__ == '__main__':
+ return_code = main(sys.argv[1:])
+ sys.exit(return_code)
diff --git a/src/scripts/genXplatEventing.py b/src/scripts/genXplatEventing.py
index 6c6498d3de..6968d293e9 100644
--- a/src/scripts/genXplatEventing.py
+++ b/src/scripts/genXplatEventing.py
@@ -39,7 +39,7 @@ stdprolog_cmake="""
#******************************************************************
"""
-lindent = " ";
+lindent = " ";
palDataTypeMapping ={
#constructed types
"win:null" :" ",
@@ -282,18 +282,17 @@ def generateClrallEvents(eventNodes,allTemplates):
#generate EventEnabled
clrallEvents.append("inline BOOL EventEnabled")
clrallEvents.append(eventName)
- clrallEvents.append("() {return XplatEventLogger::IsEventLoggingEnabled() && EventXplatEnabled")
- clrallEvents.append(eventName+"();}\n\n")
+ clrallEvents.append("() {return ")
+ clrallEvents.append("EventPipeEventEnabled" + eventName + "() || ")
+ clrallEvents.append("(XplatEventLogger::IsEventLoggingEnabled() && EventXplatEnabled")
+ clrallEvents.append(eventName+"());}\n\n")
#generate FireEtw functions
fnptype = []
fnbody = []
fnptype.append("inline ULONG FireEtw")
fnptype.append(eventName)
fnptype.append("(\n")
- fnbody.append(lindent)
- fnbody.append("if (!EventEnabled")
- fnbody.append(eventName)
- fnbody.append("()) {return ERROR_SUCCESS;}\n")
+
line = []
fnptypeline = []
@@ -339,11 +338,22 @@ def generateClrallEvents(eventNodes,allTemplates):
fnptype.extend(fnptypeline)
fnptype.append("\n)\n{\n")
fnbody.append(lindent)
- fnbody.append("return FireEtXplat")
+ fnbody.append("ULONG status = EventPipeWriteEvent" + eventName + "(" + ''.join(line) + ");\n")
+ fnbody.append(lindent)
+ fnbody.append("if(XplatEventLogger::IsEventLoggingEnabled())\n")
+ fnbody.append(lindent)
+ fnbody.append("{\n")
+ fnbody.append(lindent)
+ fnbody.append(lindent)
+ fnbody.append("status &= FireEtXplat")
fnbody.append(eventName)
fnbody.append("(")
fnbody.extend(line)
fnbody.append(");\n")
+ fnbody.append(lindent)
+ fnbody.append("}\n")
+ fnbody.append(lindent)
+ fnbody.append("return status;\n")
fnbody.append("}\n\n")
clrallEvents.extend(fnptype)
@@ -400,6 +410,57 @@ def generateClrXplatEvents(eventNodes, allTemplates):
return ''.join(clrallEvents)
+def generateClrEventPipeWriteEvents(eventNodes, allTemplates):
+ clrallEvents = []
+ for eventNode in eventNodes:
+ eventName = eventNode.getAttribute('symbol')
+ templateName = eventNode.getAttribute('template')
+
+ #generate EventPipeEventEnabled and EventPipeWriteEvent functions
+ eventenabled = []
+ writeevent = []
+ fnptypeline = []
+
+ eventenabled.append("extern \"C\" bool EventPipeEventEnabled")
+ eventenabled.append(eventName)
+ eventenabled.append("();\n")
+
+ writeevent.append("extern \"C\" ULONG EventPipeWriteEvent")
+ writeevent.append(eventName)
+ writeevent.append("(\n")
+
+ if templateName:
+ template = allTemplates[templateName]
+ fnSig = template.signature
+
+ for params in fnSig.paramlist:
+ fnparam = fnSig.getParam(params)
+ wintypeName = fnparam.winType
+ typewName = palDataTypeMapping[wintypeName]
+ winCount = fnparam.count
+ countw = palDataTypeMapping[winCount]
+
+ if params in template.structs:
+ fnptypeline.append("%sint %s_ElementSize,\n" % (lindent, params))
+
+ fnptypeline.append(lindent)
+ fnptypeline.append(typewName)
+ fnptypeline.append(countw)
+ fnptypeline.append(" ")
+ fnptypeline.append(fnparam.name)
+ fnptypeline.append(",\n")
+
+ #remove trailing commas
+ if len(fnptypeline) > 0:
+ del fnptypeline[-1]
+
+ writeevent.extend(fnptypeline)
+ writeevent.append("\n);\n")
+ clrallEvents.extend(eventenabled)
+ clrallEvents.extend(writeevent)
+
+ return ''.join(clrallEvents)
+
#generates the dummy header file which is used by the VM as entry point to the logging Functions
def generateclrEtwDummy(eventNodes,allTemplates):
clretmEvents = []
@@ -670,15 +731,19 @@ def generatePlformIndependentFiles(sClrEtwAllMan,incDir,etmDummyFile):
clrallevents = incDir + "/clretwallmain.h"
clrxplatevents = incDir + "/clrxplatevents.h"
+ clreventpipewriteevents = incDir + "/clreventpipewriteevents.h"
Clrallevents = open(clrallevents,'w')
Clrxplatevents = open(clrxplatevents,'w')
+ Clreventpipewriteevents = open(clreventpipewriteevents,'w')
Clrallevents.write(stdprolog + "\n")
Clrxplatevents.write(stdprolog + "\n")
+ Clreventpipewriteevents.write(stdprolog + "\n")
- Clrallevents.write("\n#include \"clrxplatevents.h\"\n\n")
-
+ Clrallevents.write("\n#include \"clrxplatevents.h\"\n")
+ Clrallevents.write("#include \"clreventpipewriteevents.h\"\n\n")
+
for providerNode in tree.getElementsByTagName('provider'):
templateNodes = providerNode.getElementsByTagName('template')
allTemplates = parseTemplateNodes(templateNodes)
@@ -689,8 +754,12 @@ def generatePlformIndependentFiles(sClrEtwAllMan,incDir,etmDummyFile):
#pal: create clrallevents.h
Clrxplatevents.write(generateClrXplatEvents(eventNodes, allTemplates) + "\n")
+ #eventpipe: create clreventpipewriteevents.h
+ Clreventpipewriteevents.write(generateClrEventPipeWriteEvents(eventNodes, allTemplates) + "\n")
+
Clrxplatevents.close()
Clrallevents.close()
+ Clreventpipewriteevents.close()
class EventExclusions:
def __init__(self):
diff --git a/src/scripts/genXplatLttng.py b/src/scripts/genXplatLttng.py
index bacf034868..fae0e120da 100644
--- a/src/scripts/genXplatLttng.py
+++ b/src/scripts/genXplatLttng.py
@@ -593,7 +593,8 @@ bool ResizeBuffer(char *&buffer, int& size, int currLen, int newSize, bool &fixe
bool WriteToBuffer(const BYTE *src, int len, char *&buffer, int& offset, int& size, bool &fixedBuffer)
{
- if (offset + len)
+ if (!src) return true;
+ if (offset + len > size)
{
if (!ResizeBuffer(buffer, size, offset, size + len, fixedBuffer))
return false;
@@ -606,9 +607,10 @@ bool WriteToBuffer(const BYTE *src, int len, char *&buffer, int& offset, int& si
bool WriteToBuffer(PCWSTR str, char *&buffer, int& offset, int& size, bool &fixedBuffer)
{
+ if (!str) return true;
int byteCount = (PAL_wcslen(str) + 1) * sizeof(*str);
- if (offset + byteCount)
+ if (offset + byteCount > size)
{
if (!ResizeBuffer(buffer, size, offset, size + byteCount, fixedBuffer))
return false;
@@ -621,8 +623,9 @@ bool WriteToBuffer(PCWSTR str, char *&buffer, int& offset, int& size, bool &fixe
bool WriteToBuffer(const char *str, char *&buffer, int& offset, int& size, bool &fixedBuffer)
{
+ if (!str) return true;
int len = strlen(str) + 1;
- if (offset + len)
+ if (offset + len > size)
{
if (!ResizeBuffer(buffer, size, offset, size + len, fixedBuffer))
return false;
@@ -762,4 +765,4 @@ def main(argv):
if __name__ == '__main__':
return_code = main(sys.argv[1:])
- sys.exit(return_code) \ No newline at end of file
+ sys.exit(return_code)
diff --git a/src/sign.builds b/src/sign.builds
index a8652b3ff4..831fe668c7 100644
--- a/src/sign.builds
+++ b/src/sign.builds
@@ -1,48 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="SignFiles" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-
- <!-- must set the default before importing targets -->
- <PropertyGroup>
- <SignType Condition="'$(SignType)' == ''">test</SignType>
- <StrongNameSig>Silverlight</StrongNameSig>
- </PropertyGroup>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\dir.props"/>
<Import Project="..\dir.targets" />
- <!-- OutDir is used by the MicroBuild signing target -->
<PropertyGroup>
+ <!-- The SignFiles target needs OutDir to be defined -->
<OutDir>$(BinDir)</OutDir>
</PropertyGroup>
<UsingTask AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll" TaskName="ReadSigningRequired" />
- <!-- apply the default signing certificates (defined in sign.targets) -->
- <ItemDefinitionGroup>
- <FilesToSign>
- <Authenticode>$(AuthenticodeSig)</Authenticode>
- <StrongName>$(StrongNameSig)</StrongName>
- </FilesToSign>
- </ItemDefinitionGroup>
-
- <!-- gather the list of binaries to sign with the default certificates -->
<ItemGroup>
- <FilesToSign Include="$(BinDir)*.dll" Exclude="$(BinDir)*.ni.dll" />
- <FilesToSign Include="$(BinDir)*.exe" />
+ <WindowsNativeLocation Include="$(BinDir)*.dll" />
+ <WindowsNativeLocation Include="$(BinDir)*.exe" />
</ItemGroup>
- <!--
- for some reason the signing task incorrectly attemps to strong-name sign
- native images which causes the signing step to fail for obvious reasons.
- -->
- <ItemGroup>
- <FilesToSign Include="$(BinDir)*.ni.dll">
- <StrongName>None</StrongName>
- </FilesToSign>
- </ItemGroup>
+ <Target Name="GenerateSignForWindowsNative">
+ <!--
+ Managed assemblies should already have a requires_signing file dropped so only generate
+ a requires_signing file for ones that don't exist which should leave just native assembies
+ -->
+ <WriteSigningRequired AuthenticodeSig="$(AuthenticodeSig)"
+ MarkerFile="%(WindowsNativeLocation.Identity).requires_signing"
+ Condition="!Exists('%(WindowsNativeLocation.Identity).requires_signing')" />
+ </Target>
<!-- populates item group FilesToSign with the list of files to sign -->
- <Target Name="GetFilesToSignItems" BeforeTargets="SignFiles">
+ <Target Name="GetFilesToSignItems"
+ DependsOnTargets="GenerateSignForWindowsNative">
<!-- read all of the marker files and populate the FilesToSign item group -->
<ItemGroup>
<SignMarkerFile Include="$(OutDir)**\*.requires_signing" />
@@ -50,10 +36,15 @@
<ReadSigningRequired MarkerFiles="@(SignMarkerFile)">
<Output TaskParameter="SigningMetadata" ItemName="FilesToSign" />
</ReadSigningRequired>
+
+ <Message Importance="High" Text="Attempting to sign %(FilesToSign.Identity) with authenticode='%(FilesToSign.Authenticode)' and strongname='%(FilesToSign.StrongName)'" />
+
</Target>
- <!-- now that signing is done clean up any marker files -->
- <Target Name="CleanUpMarkerFiles" AfterTargets="SignFiles">
+ <Target Name="Build"
+ Condition="'$(SkipSigning)' != 'true' and '$(SignType)' != 'oss'"
+ DependsOnTargets="GetFilesToSignItems;SignFiles">
+
<!-- now that the files have been signed delete the marker files -->
<Delete Files="@(SignMarkerFile)" />
</Target>
diff --git a/src/syncAzure.proj b/src/syncAzure.proj
index a5bb4958a9..aeea48de9a 100644
--- a/src/syncAzure.proj
+++ b/src/syncAzure.proj
@@ -7,6 +7,7 @@
<ContainerName Condition="'$(__Container)' == '' and '$(ContainerNamePrefix)' != '' and '$(BuildNumberMajor)' != '' and '$(BuildNumberMinor)' != ''">$(ContainerNamePrefix)-$(BuildNumberMajor)-$(BuildNumberMinor)</ContainerName>
<ContainerName Condition="'$(__Container)' != ''">$(__Container)</ContainerName>
<ContainerName>$(ContainerName.Replace(".","-"))</ContainerName>
+ <BlobNamePrefix>$(__BlobNamePrefix)</BlobNamePrefix>
<DownloadDirectory Condition="'$(PublishTestNativeBins)' != 'true'">$(PackagesDir)AzureTransfer</DownloadDirectory>
<DownloadDirectory Condition="'$(PublishTestNativeBins)' == 'true'">$(PackagesDir)TestNativeBins\$(RuntimeId)</DownloadDirectory>
</PropertyGroup>
diff --git a/src/tools/crossgen/crossgen.cpp b/src/tools/crossgen/crossgen.cpp
index 43e667bd25..954f4a46a8 100644
--- a/src/tools/crossgen/crossgen.cpp
+++ b/src/tools/crossgen/crossgen.cpp
@@ -311,35 +311,16 @@ void PopulateTPAList(SString path, LPCWSTR pwszMask, SString &refTPAList, bool f
bool fAddDelimiter = (refTPAList.GetCount() > 0)?true:false;
bool fAddFileToTPAList = true;
LPCWSTR pwszFilename = folderEnumerator.GetFileName();
- if (fCompilingMscorlib)
+
+ // No NIs are supported when creating NI images (other than NI of System.Private.CoreLib.dll).
+ if (!fCreatePDB)
{
- // When compiling CoreLib, no ".ni.dll" should be on the TPAList.
+ // Only CoreLib's ni.dll should be in the TPAList for the compilation of non-mscorlib assemblies.
if (StringEndsWith((LPWSTR)pwszFilename, W(".ni.dll")))
{
fAddFileToTPAList = false;
}
}
- else
- {
- // When creating PDBs, we must ensure that .ni.dlls are in the TPAList
- if (!fCreatePDB)
- {
- // Only CoreLib's ni.dll should be in the TPAList for the compilation of non-mscorlib assemblies.
- if (StringEndsWith((LPWSTR)pwszFilename, W(".ni.dll")))
- {
- if (!StringEndsWith((LPWSTR)pwszFilename, CoreLibName_NI_W))
- {
- fAddFileToTPAList = false;
- }
- }
- }
-
- // Ensure that CoreLib's IL version is also not on the TPAlist for this case.
- if (StringEndsWith((LPWSTR)pwszFilename, CoreLibName_IL_W))
- {
- fAddFileToTPAList = false;
- }
- }
if (fAddFileToTPAList)
{
diff --git a/src/utilcode/util.cpp b/src/utilcode/util.cpp
index a8786def92..b7fca3ed9b 100644
--- a/src/utilcode/util.cpp
+++ b/src/utilcode/util.cpp
@@ -573,7 +573,9 @@ static DWORD ShouldInjectFaultInRange()
// Reserves free memory within the range [pMinAddr..pMaxAddr] using
// ClrVirtualQuery to find free memory and ClrVirtualAlloc to reserve it.
//
-// This method only supports the flAllocationType of MEM_RESERVE
+// This method only supports the flAllocationType of MEM_RESERVE, and expects that the memory
+// is being reserved for the purpose of eventually storing executable code.
+//
// Callers also should set dwSize to a multiple of sysInfo.dwAllocationGranularity (64k).
// That way they can reserve a large region and commit smaller sized pages
// from that region until it fills up.
@@ -603,6 +605,11 @@ BYTE * ClrVirtualAllocWithinRange(const BYTE *pMinAddr,
static unsigned countOfCalls = 0; // We log the number of tims we call this method
countOfCalls++; // increment the call counter
+ if (dwSize == 0)
+ {
+ return nullptr;
+ }
+
//
// First lets normalize the pMinAddr and pMaxAddr values
//
@@ -618,18 +625,26 @@ BYTE * ClrVirtualAllocWithinRange(const BYTE *pMinAddr,
pMaxAddr = (BYTE *) TOP_MEMORY;
}
+ // If pMaxAddr is not greater than pMinAddr we can not make an allocation
+ if (pMaxAddr <= pMinAddr)
+ {
+ return nullptr;
+ }
+
// If pMinAddr is BOT_MEMORY and pMaxAddr is TOP_MEMORY
// then we can call ClrVirtualAlloc instead
if ((pMinAddr == (BYTE *) BOT_MEMORY) && (pMaxAddr == (BYTE *) TOP_MEMORY))
{
- return (BYTE*) ClrVirtualAlloc(NULL, dwSize, flAllocationType, flProtect);
+ return (BYTE*) ClrVirtualAlloc(nullptr, dwSize, flAllocationType, flProtect);
}
- // If pMaxAddr is not greater than pMinAddr we can not make an allocation
- if (dwSize == 0 || pMaxAddr <= pMinAddr)
+#ifdef FEATURE_PAL
+ pResult = (BYTE *)PAL_VirtualReserveFromExecutableMemoryAllocatorWithinRange(pMinAddr, pMaxAddr, dwSize);
+ if (pResult != nullptr)
{
- return NULL;
+ return pResult;
}
+#endif // FEATURE_PAL
// We will do one scan from [pMinAddr .. pMaxAddr]
// First align the tryAddr up to next 64k base address.
diff --git a/src/vm/CMakeLists.txt b/src/vm/CMakeLists.txt
index da1aa8fe62..c610d3c7a8 100644
--- a/src/vm/CMakeLists.txt
+++ b/src/vm/CMakeLists.txt
@@ -155,7 +155,6 @@ set(VM_SOURCES_WKS
comthreadpool.cpp
comutilnative.cpp
comwaithandle.cpp
- coverage.cpp
customattribute.cpp
custommarshalerinfo.cpp
dllimportcallback.cpp
@@ -165,8 +164,16 @@ set(VM_SOURCES_WKS
eepolicy.cpp
eetoprofinterfaceimpl.cpp
eventpipe.cpp
+ eventpipeconfiguration.cpp
+ eventpipeevent.cpp
+ eventpipeeventinstance.cpp
+ eventpipefile.cpp
eventpipejsonfile.cpp
+ eventpipeprovider.cpp
+ eventpipebuffer.cpp
+ eventpipebuffermanager.cpp
eventstore.cpp
+ fastserializer.cpp
fcall.cpp
fieldmarshaler.cpp
finalizerthread.cpp
@@ -482,3 +489,7 @@ convert_to_absolute_path(VM_SOURCES_DAC ${VM_SOURCES_DAC})
add_subdirectory(dac)
add_subdirectory(wks)
+
+if(CLR_CMAKE_PLATFORM_LINUX)
+ add_subdirectory($ENV{__IntermediatesDir}/Generated/eventpipe ${CMAKE_CURRENT_BINARY_DIR}/eventpipe)
+endif(CLR_CMAKE_PLATFORM_LINUX)
diff --git a/src/vm/arm/asmhelpers.S b/src/vm/arm/asmhelpers.S
index 04d7527180..36933f5ea6 100644
--- a/src/vm/arm/asmhelpers.S
+++ b/src/vm/arm/asmhelpers.S
@@ -509,6 +509,24 @@ LOCAL_LABEL(UM2MThunk_WrapperHelper_ArgumentsSetup):
NESTED_END ThePreStub, _TEXT
// ------------------------------------------------------------------
+ NESTED_ENTRY ThePreStubCompactARM, _TEXT, NoHandler
+
+ // r12 - address of compact entry point + PC_REG_RELATIVE_OFFSET
+
+ PROLOG_WITH_TRANSITION_BLOCK
+
+ mov r0, r12
+
+ bl C_FUNC(PreStubGetMethodDescForCompactEntryPoint)
+
+ mov r12, r0 // pMethodDesc
+
+ EPILOG_WITH_TRANSITION_BLOCK_TAILCALL
+
+ b C_FUNC(ThePreStub)
+
+ NESTED_END ThePreStubCompactARM, _TEXT
+// ------------------------------------------------------------------
// This method does nothing. It's just a fixed function for the debugger to put a breakpoint on.
LEAF_ENTRY ThePreStubPatch, _TEXT
nop
diff --git a/src/vm/arm/asmhelpers.asm b/src/vm/arm/asmhelpers.asm
index 542bdc65cc..e5fd41a513 100644
--- a/src/vm/arm/asmhelpers.asm
+++ b/src/vm/arm/asmhelpers.asm
@@ -24,6 +24,7 @@
IMPORT UMThunkStubRareDisableWorker
IMPORT UM2MDoADCallBack
IMPORT PreStubWorker
+ IMPORT PreStubGetMethodDescForCompactEntryPoint
IMPORT NDirectImportWorker
IMPORT ObjIsInstanceOfNoGC
IMPORT ArrayStoreCheck
@@ -571,6 +572,26 @@ UM2MThunk_WrapperHelper_ArgumentsSetup
NESTED_END
; ------------------------------------------------------------------
+
+ NESTED_ENTRY ThePreStubCompactARM
+
+ ; r12 - address of compact entry point + PC_REG_RELATIVE_OFFSET
+
+ PROLOG_WITH_TRANSITION_BLOCK
+
+ mov r0, r12
+
+ bl PreStubGetMethodDescForCompactEntryPoint
+
+ mov r12, r0 ; pMethodDesc
+
+ EPILOG_WITH_TRANSITION_BLOCK_TAILCALL
+
+ b ThePreStub
+
+ NESTED_END
+
+; ------------------------------------------------------------------
; This method does nothing. It's just a fixed function for the debugger to put a breakpoint on.
LEAF_ENTRY ThePreStubPatch
nop
diff --git a/src/vm/arm/cgencpu.h b/src/vm/arm/cgencpu.h
index 34af8187b2..181d5f10eb 100644
--- a/src/vm/arm/cgencpu.h
+++ b/src/vm/arm/cgencpu.h
@@ -57,7 +57,7 @@ EXTERN_C void checkStack(void);
#define JUMP_ALLOCATE_SIZE 8 // # bytes to allocate for a jump instruction
#define BACK_TO_BACK_JUMP_ALLOCATE_SIZE 8 // # bytes to allocate for a back to back jump instruction
-//#define HAS_COMPACT_ENTRYPOINTS 1
+#define HAS_COMPACT_ENTRYPOINTS 1
#define HAS_NDIRECT_IMPORT_PRECODE 1
@@ -90,6 +90,12 @@ EXTERN_C void setFPReturn(int fpSize, INT64 retVal);
// this is the offset by which it should be decremented to arrive at the callsite.
#define STACKWALK_CONTROLPC_ADJUST_OFFSET 2
+// Max offset for unconditional thumb branch
+#define MAX_OFFSET_UNCONDITIONAL_BRANCH_THUMB 2048
+
+// Offset of pc register
+#define PC_REG_RELATIVE_OFFSET 4
+
//=======================================================================
// IMPORTANT: This value is used to figure out how much to allocate
// for a fixed array of FieldMarshaler's. That means it must be at least
@@ -236,6 +242,53 @@ void emitCOMStubCall (ComCallMethodDesc *pCOMMethod, PCODE target);
#endif // FEATURE_COMINTEROP
//------------------------------------------------------------------------
+inline void emitUnconditionalBranchThumb(LPBYTE pBuffer, int16_t offset)
+{
+ LIMITED_METHOD_CONTRACT;
+
+ uint16_t *pInstr = (uint16_t *) pBuffer;
+
+ // offset from -2KB to +2KB
+ _ASSERTE (offset >= - MAX_OFFSET_UNCONDITIONAL_BRANCH_THUMB && offset < MAX_OFFSET_UNCONDITIONAL_BRANCH_THUMB);
+
+ if (offset >= 0)
+ {
+ offset = offset >> 1;
+ }
+ else
+ {
+ offset = ((MAX_OFFSET_UNCONDITIONAL_BRANCH_THUMB + offset) >> 1) | 0x400;
+ }
+
+ *pInstr = 0xE000 | offset;
+}
+
+//------------------------------------------------------------------------
+inline int16_t decodeUnconditionalBranchThumb(LPBYTE pBuffer)
+{
+ LIMITED_METHOD_CONTRACT;
+
+ uint16_t *pInstr = (uint16_t *) pBuffer;
+
+ int16_t offset = (~0xE000) & (*pInstr);
+
+ if ((offset & 0x400) == 0)
+ {
+ offset = offset << 1;
+ }
+ else
+ {
+ offset = (~0x400) & offset;
+ offset = (offset << 1) - MAX_OFFSET_UNCONDITIONAL_BRANCH_THUMB;
+ }
+
+ // offset from -2KB to +2KB
+ _ASSERTE (offset >= - MAX_OFFSET_UNCONDITIONAL_BRANCH_THUMB && offset < MAX_OFFSET_UNCONDITIONAL_BRANCH_THUMB);
+
+ return offset;
+}
+
+//------------------------------------------------------------------------
inline void emitJump(LPBYTE pBuffer, LPVOID target)
{
LIMITED_METHOD_CONTRACT;
diff --git a/src/vm/arm/stubs.cpp b/src/vm/arm/stubs.cpp
index f1ba278ada..3088761f0b 100644
--- a/src/vm/arm/stubs.cpp
+++ b/src/vm/arm/stubs.cpp
@@ -1333,6 +1333,13 @@ BOOL DoesSlotCallPrestub(PCODE pCode)
{
PTR_WORD pInstr = dac_cast<PTR_WORD>(PCODEToPINSTR(pCode));
+#ifdef HAS_COMPACT_ENTRYPOINTS
+ if (MethodDescChunk::GetMethodDescFromCompactEntryPoint(pCode, TRUE) != NULL)
+ {
+ return TRUE;
+ }
+#endif // HAS_COMPACT_ENTRYPOINTS
+
// FixupPrecode
if (pInstr[0] == 0x46fc && // // mov r12, pc
pInstr[1] == 0xf8df &&
diff --git a/src/vm/arm64/asmhelpers.S b/src/vm/arm64/asmhelpers.S
index 15b8057ed6..79e398937a 100644
--- a/src/vm/arm64/asmhelpers.S
+++ b/src/vm/arm64/asmhelpers.S
@@ -217,6 +217,7 @@ LEAF_END ThePreStubPatch, _TEXT
// x13 : incremented by 8
// x14 : incremented by 8
// x15 : trashed
+// x17 : trashed (ip1) if FEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP
//
WRITE_BARRIER_ENTRY JIT_ByRefWriteBarrier
@@ -236,6 +237,7 @@ WRITE_BARRIER_END JIT_ByRefWriteBarrier
// x12 : trashed
// x14 : incremented by 8
// x15 : trashed
+// x17 : trashed (ip1) if FEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP
//
WRITE_BARRIER_ENTRY JIT_CheckedWriteBarrier
PREPARE_EXTERNAL_VAR g_lowest_address, x12
@@ -262,6 +264,7 @@ WRITE_BARRIER_END JIT_CheckedWriteBarrier
// x12 : trashed
// x14 : incremented by 8
// x15 : trashed
+// x17 : trashed (ip1) if FEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP
//
WRITE_BARRIER_ENTRY JIT_WriteBarrier
dmb ST
@@ -310,6 +313,21 @@ LOCAL_LABEL(shadowupdateend):
ldp x12, x13, [sp],#16
#endif
+#ifdef FEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP
+ // Update the write watch table if necessary
+ PREPARE_EXTERNAL_VAR g_sw_ww_enabled_for_gc_heap, x12
+ ldrb w12, [x12]
+ cbz x12, LOCAL_LABEL(CheckCardTable)
+ PREPARE_EXTERNAL_VAR g_sw_ww_table, x12
+ ldr x12, [x12]
+ add x12, x12, x14, lsr #0xc // SoftwareWriteWatch::AddressToTableByteIndexShift
+ ldrb w17, [x12]
+ cbnz x17, LOCAL_LABEL(CheckCardTable)
+ mov w17, #0xFF
+ strb w17, [x12]
+#endif
+
+LOCAL_LABEL(CheckCardTable):
// Branch to Exit if the reference is not in the Gen0 heap
//
PREPARE_EXTERNAL_VAR g_ephemeral_low, x12
@@ -333,6 +351,21 @@ LOCAL_LABEL(shadowupdateend):
LOCAL_LABEL(UpdateCardTable):
mov x12, 0xFF
strb w12, [x15]
+
+#ifdef FEATURE_MANUALLY_MANAGED_CARD_BUNDLES
+ // Check if we need to update the card table
+ PREPARE_EXTERNAL_VAR g_card_bundle_table, x12
+ ldr x12, [x12]
+ add x15, x12, x14, lsr #21
+ ldrb w12, [x15]
+ cmp x12, 0xFF
+ beq LOCAL_LABEL(Exit)
+
+LOCAL_LABEL(UpdateCardBundle):
+ mov x12, 0xFF
+ strb w12, [x15]
+#endif
+
LOCAL_LABEL(Exit):
add x14, x14, 8
ret lr
diff --git a/src/vm/arm64/crthelpers.S b/src/vm/arm64/crthelpers.S
index 36eb4ee7a3..c8b108ca8f 100644
--- a/src/vm/arm64/crthelpers.S
+++ b/src/vm/arm64/crthelpers.S
@@ -18,62 +18,109 @@
//
//void JIT_MemSet(void *dst, int val, SIZE_T count)
//
-// uintptr_t valEx = (unsigned char)val;
+// uint64_t valEx = (unsigned char)val;
// valEx = valEx | valEx << 8;
// valEx = valEx | valEx << 16;
// valEx = valEx | valEx << 32;
//
+// size_t dc_zva_size = 4ULL << DCZID_EL0.BS;
+//
+// uint64_t use_dc_zva = (val == 0) && !DCZID_EL0.p ? count / (2 * dc_zva_size) : 0; // ~Minimum size (assumes worst case alignment)
+//
// // If not aligned then make it 8-byte aligned
-// if(((uintptr_t)dst&0x7) != 0)
+// if(((uint64_t)dst&0xf) != 0)
// {
-// if(((uintptr_t)dst&0x3) == 0)
+// // Calculate alignment we can do without exceeding count
+// // Use math to avoid introducing more unpredictable branches
+// // Due to inherent mod in lsr, ~7 is used instead of ~0 to handle count == 0
+// // Note logic will fail is count >= (1 << 61). But this exceeds max physical memory for arm64
+// uint8_t align = (dst & 0x7) & (~uint64_t(7) >> (countLeadingZeros(count) mod 64))
+//
+// if(align&0x1)
// {
-// *(UINT*)dst = (UINT)valEx;
-// dst = (UINT*)dst + 1;
+// *(unit8_t*)dst = (unit8_t)valEx;
+// dst = (unit8_t*)dst + 1;
+// count-=1;
+// }
+//
+// if(align&0x2)
+// {
+// *(unit16_t*)dst = (unit16_t)valEx;
+// dst = (unit16_t*)dst + 1;
+// count-=2;
+// }
+//
+// if(align&0x4)
+// {
+// *(unit32_t*)dst = (unit32_t)valEx;
+// dst = (unit32_t*)dst + 1;
// count-=4;
// }
-// else if(((uintptr_t)dst&0x1) == 0)
+// }
+//
+// if(use_dc_zva)
+// {
+// // If not aligned then make it aligned to dc_zva_size
+// if(dst&0x8)
+// {
+// *(uint64_t*)dst = (uint64_t)valEx;
+// dst = (uint64_t*)dst + 1;
+// count-=8;
+// }
+//
+// while(dst & (dc_zva_size - 1))
// {
-// while(count > 0 && ((uintptr_t)dst&0x7) != 0)
-// {
-// *(short*)dst = (short)valEx;
-// dst = (short*)dst + 1;
-// count-=2;
-// }
+// *(uint64_t*)dst = valEx;
+// dst = (uint64_t*)dst + 1;
+// *(uint64_t*)dst = valEx;
+// dst = (uint64_t*)dst + 1;
+// count-=16;
// }
-// else
+//
+// count -= dc_zva_size;
+//
+// while(count >= 0)
// {
-// while(count > 0 && ((uintptr_t)dst&0x7) != 0)
-// {
-// *(char*)dst = (char)valEx;
-// dst = (char*)dst + 1;
-// count--;
-// }
+// dc_zva(dst);
+// dst = (uint8_t*)dst + dc_zva_size;
+// count-=dc_zva_size;
// }
+//
+// count += dc_zva_size;
// }
//
-// while(count >= 8)
+// count-=16;
+//
+// while(count >= 0)
// {
-// *(uintptr_t*)dst = valEx;
-// dst = (uintptr_t*)dst + 1;
-// count-=8;
+// *(uint64_t*)dst = valEx;
+// dst = (uint64_t*)dst + 1;
+// *(uint64_t*)dst = valEx;
+// dst = (uint64_t*)dst + 1;
+// count-=16;
+// }
+//
+// if(count & 8)
+// {
+// *(uint64_t*)dst = valEx;
+// dst = (uint64_t*)dst + 1;
// }
//
// if(count & 4)
// {
-// *(UINT*)dst = (UINT)valEx;
-// dst = (UINT*)dst + 1;
+// *(uint32_t*)dst = (uint32_t)valEx;
+// dst = (uint32_t*)dst + 1;
// }
//
// if(count & 2)
// {
-// *(short*)dst = (short)valEx;
-// dst = (short*)dst + 1;
+// *(uint16_t*)dst = (uint16_t)valEx;
+// dst = (uint16_t*)dst + 1;
// }
//
// if(count & 1)
// {
-// *(char*)dst = (char)valEx;
+// *(uint8_t*)dst = (uint8_t)valEx;
// }
//
//
@@ -85,68 +132,89 @@
// as C++ method.
LEAF_ENTRY JIT_MemSet, _TEXT
- uxtb w8,w1
- sxtw x8,w8
- orr x8,x8,x8, lsl #8
- orr x8,x8,x8, lsl #0x10
- orr x9,x8,x8, lsl #0x20
- and x8,x0,#7
- cbz x8,LOCAL_LABEL(JIT_MemSet_0x7c)
- and x8,x0,#3
- cbnz x8,LOCAL_LABEL(JIT_MemSet_0x38)
- str w9,[x0]
- add x0,x0,#4
- mov x8,#-4
- add x2,x2,x8
- b LOCAL_LABEL(JIT_MemSet_0x7c)
-LOCAL_LABEL(JIT_MemSet_0x38):
- cbz x2,LOCAL_LABEL(JIT_MemSet_0x7c)
- tbnz x0,#0,LOCAL_LABEL(JIT_MemSet_0x60)
-LOCAL_LABEL(JIT_MemSet_0x40):
- and x8,x0,#7
- cbz x8,LOCAL_LABEL(JIT_MemSet_0x7c)
- strh w9,[x0]
- add x0,x0,#2
- mov x8,#-2
- add x2,x2,x8
- cbnz x2,LOCAL_LABEL(JIT_MemSet_0x40)
- b LOCAL_LABEL(JIT_MemSet_0x7c)
-LOCAL_LABEL(JIT_MemSet_0x60):
- and x8,x0,#7
- cbz x8,LOCAL_LABEL(JIT_MemSet_0x7c)
- strb w9,[x0]
- add x0,x0,#1
- mov x8,#-1
- add x2,x2,x8
- cbnz x2,LOCAL_LABEL(JIT_MemSet_0x60)
-LOCAL_LABEL(JIT_MemSet_0x7c):
- cmp x2,#8
- blo LOCAL_LABEL(JIT_MemSet_0xb8)
- lsr x8,x2,#3
- mov x11,x8
- mov x10,x0
- add x8,x10,x11, lsl #3
+ ands w8, w1, #0xff
+ mrs x3, DCZID_EL0 // x3 = DCZID_EL0
+ mov x6, #4
+ lsr x11, x2, #3 // x11 = count >> 3
+
+ orr w8, w8, w8, lsl #8
+ and x5, x3, #0xf // x5 = dczid_el0.bs
+ csel x11, x11, xzr, eq // x11 = (val == 0) ? count >> 3 : 0
+ tst x3, (1 << 4)
+
+ orr w8, w8, w8, lsl #0x10
+ csel x11, x11, xzr, eq // x11 = (val == 0) && !DCZID_EL0.p ? count >> 3 : 0
+ ands x3, x0, #7 // x3 = dst & 7
+ lsl x9, x6, x5 // x9 = size
+
+ orr x8, x8, x8, lsl #0x20
+ lsr x11, x11, x5 // x11 = (val == 0) && !DCZID_EL0.p ? count >> (3 + DCZID_EL0.bs) : 0
+ sub x10, x9, #1 // x10 = mask
+
+ b.eq LOCAL_LABEL(JIT_MemSet_0x80)
+
+ movn x4, #7
+ clz x5, x2
+ lsr x4, x4, x5
+ and x3, x3, x4
+
+ tbz x3, #0, LOCAL_LABEL(JIT_MemSet_0x2c)
+ strb w8, [x0], #1
+ sub x2, x2, #1
+LOCAL_LABEL(JIT_MemSet_0x2c):
+ tbz x3, #1, LOCAL_LABEL(JIT_MemSet_0x5c)
+ strh w8, [x0], #2
+ sub x2, x2, #2
+LOCAL_LABEL(JIT_MemSet_0x5c):
+ tbz x3, #2, LOCAL_LABEL(JIT_MemSet_0x80)
+ str w8, [x0], #4
+ sub x2, x2, #4
+LOCAL_LABEL(JIT_MemSet_0x80):
+ cbz x11, LOCAL_LABEL(JIT_MemSet_0x9c)
+ tbz x0, #3, LOCAL_LABEL(JIT_MemSet_0x84)
+ str x8, [x0], #8
+ sub x2, x2, #8
+
+ b LOCAL_LABEL(JIT_MemSet_0x85)
+LOCAL_LABEL(JIT_MemSet_0x84):
+ stp x8, x8, [x0], #16
+ sub x2, x2, #16
+LOCAL_LABEL(JIT_MemSet_0x85):
+ tst x0, x10
+ b.ne LOCAL_LABEL(JIT_MemSet_0x84)
+
+ b LOCAL_LABEL(JIT_MemSet_0x8a)
+LOCAL_LABEL(JIT_MemSet_0x88):
+ dc zva, x0
+ add x0, x0, x9
+LOCAL_LABEL(JIT_MemSet_0x8a):
+ subs x2, x2, x9
+ b.ge LOCAL_LABEL(JIT_MemSet_0x88)
+
+LOCAL_LABEL(JIT_MemSet_0x8c):
+ add x2, x2, x9
+
LOCAL_LABEL(JIT_MemSet_0x9c):
- cmp x10,x8
- beq LOCAL_LABEL(JIT_MemSet_0xac)
- str x9,[x10],#8
- b LOCAL_LABEL(JIT_MemSet_0x9c)
-LOCAL_LABEL(JIT_MemSet_0xac):
- mov x8,#-8
- madd x2,x11,x8,x2
- add x0,x0,x11, lsl #3
-LOCAL_LABEL(JIT_MemSet_0xb8):
- tbz x2,#2,LOCAL_LABEL(JIT_MemSet_0xc4)
- str w9,[x0]
- add x0,x0,#4
-LOCAL_LABEL(JIT_MemSet_0xc4):
- tbz x2,#1,LOCAL_LABEL(JIT_MemSet_0xd0)
- strh w9,[x0]
- add x0,x0,#2
-LOCAL_LABEL(JIT_MemSet_0xd0):
- tbz x2,#0,LOCAL_LABEL(JIT_MemSet_0xd8)
- strb w9,[x0]
-LOCAL_LABEL(JIT_MemSet_0xd8):
+ b LOCAL_LABEL(JIT_MemSet_0xa8)
+LOCAL_LABEL(JIT_MemSet_0xa0):
+ stp x8, x8, [x0], #16
+LOCAL_LABEL(JIT_MemSet_0xa8):
+ subs x2, x2, #16
+ b.ge LOCAL_LABEL(JIT_MemSet_0xa0)
+
+LOCAL_LABEL(JIT_MemSet_0xb0):
+ tbz x2, #3, LOCAL_LABEL(JIT_MemSet_0xb4)
+ str x8, [x0], #8
+LOCAL_LABEL(JIT_MemSet_0xb4):
+ tbz x2, #2, LOCAL_LABEL(JIT_MemSet_0xc8)
+ str w8, [x0], #4
+LOCAL_LABEL(JIT_MemSet_0xc8):
+ tbz x2, #1, LOCAL_LABEL(JIT_MemSet_0xdc)
+ strh w8, [x0], #2
+LOCAL_LABEL(JIT_MemSet_0xdc):
+ tbz x2, #0, LOCAL_LABEL(JIT_MemSet_0xe8)
+ strb w8, [x0]
+LOCAL_LABEL(JIT_MemSet_0xe8):
ret lr
LEAF_END_MARKED JIT_MemSet, _TEXT
@@ -157,60 +225,74 @@ LEAF_END_MARKED JIT_MemSet, _TEXT
// // If not aligned then make it 8-byte aligned
// if(((uintptr_t)dst&0x7) != 0)
// {
-// if(((uintptr_t)dst&0x3) == 0)
+// // Calculate alignment we can do without exceeding count
+// // Use math to avoid introducing more unpredictable branches
+// // Due to inherent mod in lsr, ~7 is used instead of ~0 to handle count == 0
+// // Note logic will fail is count >= (1 << 61). But this exceeds max physical memory for arm64
+// uint8_t align = (dst & 0x7) & (~uint64_t(7) >> (countLeadingZeros(count) mod 64))
+//
+// if(align&0x1)
// {
-// *(UINT*)dst = *(UINT*)src;
-// dst = (UINT*)dst + 1;
-// src = (UINT*)src + 1;
-// count-=4;
+// *(unit8_t*)dst = *(unit8_t*)src;
+// dst = (unit8_t*)dst + 1;
+// src = (unit8_t*)src + 1;
+// count-=1;
// }
-// else if(((uintptr_t)dst&0x1) == 0)
+//
+// if(align&0x2)
// {
-// while(count > 0 && ((uintptr_t)dst&0x7) != 0)
-// {
-// *(short*)dst = *(short*)src;
-// dst = (short*)dst + 1;
-// src = (short*)src + 1;
-// count-=2;
-// }
+// *(unit16_t*)dst = *(unit16_t*)src;
+// dst = (unit16_t*)dst + 1;
+// src = (unit16_t*)src + 1;
+// count-=2;
// }
-// else
+//
+// if(align&0x4)
// {
-// while(count > 0 && ((uintptr_t)dst&0x7) != 0)
-// {
-// *(char*)dst = *(char*)src;
-// dst = (char*)dst + 1;
-// src = (char*)src + 1;
-// count--;
-// }
+// *(unit32_t*)dst = *(unit32_t*)src;
+// dst = (unit32_t*)dst + 1;
+// src = (unit32_t*)src + 1;
+// count-=4;
// }
// }
//
-// while(count >= 8)
+// count-=16;
+//
+// while(count >= 0)
+// {
+// *(unit64_t*)dst = *(unit64_t*)src;
+// dst = (unit64_t*)dst + 1;
+// src = (unit64_t*)src + 1;
+// *(unit64_t*)dst = *(unit64_t*)src;
+// dst = (unit64_t*)dst + 1;
+// src = (unit64_t*)src + 1;
+// count-=16;
+// }
+//
+// if(count & 8)
// {
-// *(uintptr_t*)dst = *(uintptr_t*)src;
-// dst = (uintptr_t*)dst + 1;
-// src = (uintptr_t*)src + 1;
-// count-=8;
+// *(unit64_t*)dst = *(unit64_t*)src;
+// dst = (unit64_t*)dst + 1;
+// src = (unit64_t*)src + 1;
// }
//
// if(count & 4)
// {
-// *(UINT*)dst = *(UINT*)src;
-// dst = (UINT*)dst + 1;
-// src = (UINT*)src + 1;
+// *(unit32_t*)dst = *(unit32_t*)src;
+// dst = (unit32_t*)dst + 1;
+// src = (unit32_t*)src + 1;
// }
//
// if(count & 2)
// {
-// *(short*)dst = *(short*)src;
-// dst = (short*)dst + 1;
-// src = (short*)src + 1;
+// *(unit16_t*)dst = *(unit16_t*)src;
+// dst = (unit16_t*)dst + 1;
+// src = (unit16_t*)src + 1;
// }
//
// if(count & 1)
// {
-// *(char*)dst = *(char*)src;
+// *(unit8_t*)dst = *(unit8_t*)src;
// }
//
//
@@ -218,69 +300,49 @@ LEAF_END_MARKED JIT_MemSet, _TEXT
// Assembly code corresponding to above C++ method.
// See comments above for JIT_MemSet method
LEAF_ENTRY JIT_MemCpy, _TEXT
- and x8,x0,#7
- cbz x8,LOCAL_LABEL(JIT_MemCpy_0x80)
- and x8,x0,#3
- cbnz x8,LOCAL_LABEL(JIT_MemCpy_0x2c)
- ldr w8,[x1]
- str w8,[x0]
- add x0,x0,#4
- add x1,x1,#4
- mov x8,#-4
- add x2,x2,x8
- b LOCAL_LABEL(JIT_MemCpy_0x80)
+ ands x3, x0, #7
+ movn x4, #7
+ clz x5, x2
+ b.eq LOCAL_LABEL(JIT_MemCpy_0xa8)
+ lsr x4, x4, x5
+ and x3, x3, x4
+ tbz x3, #0, LOCAL_LABEL(JIT_MemCpy_0x2c)
+ ldrsb w8, [x1], #1
+ strb w8, [x0], #1
+ sub x2, x2, #1
LOCAL_LABEL(JIT_MemCpy_0x2c):
- cbz x2,LOCAL_LABEL(JIT_MemCpy_0x80)
- tbnz x0,#0,LOCAL_LABEL(JIT_MemCpy_0x5c)
-LOCAL_LABEL(JIT_MemCpy_0x34):
- and x8,x0,#7
- cbz x8,LOCAL_LABEL(JIT_MemCpy_0x80)
- ldrsh w8,[x1]
- strh w8,[x0]
- add x0,x0,#2
- add x1,x1,#2
- mov x8,#-2
- add x2,x2,x8
- cbnz x2,LOCAL_LABEL(JIT_MemCpy_0x34)
- b LOCAL_LABEL(JIT_MemCpy_0x80)
+ tbz x3, #1, LOCAL_LABEL(JIT_MemCpy_0x5c)
+ ldrsh w8, [x1], #2
+ strh w8, [x0], #2
+ sub x2, x2, #2
LOCAL_LABEL(JIT_MemCpy_0x5c):
- and x8,x0,#7
- cbz x8,LOCAL_LABEL(JIT_MemCpy_0x80)
- ldrsb w8,[x1]
- strb w8,[x0]
- add x0,x0,#1
- add x1,x1,#1
- mov x8,#-1
- add x2,x2,x8
- cbnz x2,LOCAL_LABEL(JIT_MemCpy_0x5c)
-LOCAL_LABEL(JIT_MemCpy_0x80):
- cmp x2,#8
- blo LOCAL_LABEL(JIT_MemCpy_0xb4)
- lsr x9,x2,#3
- mov x8,#-8
- madd x2,x9,x8,x2
+ tbz x3, #2, LOCAL_LABEL(JIT_MemCpy_0xa8)
+ ldr w8, [x1], #4
+ str w8, [x0], #4
+ sub x2, x2, #4
+ b LOCAL_LABEL(JIT_MemCpy_0xa8)
LOCAL_LABEL(JIT_MemCpy_0xa0):
- ldr x8,[x1],#8
- str x8,[x0],#8
- mov x8,#-1
- add x9,x9,x8
- cbnz x9,LOCAL_LABEL(JIT_MemCpy_0xa0)
+ ldp x8, x9, [x1], #16
+ stp x8, x9, [x0], #16
+LOCAL_LABEL(JIT_MemCpy_0xa8):
+ subs x2, x2, #16
+ b.ge LOCAL_LABEL(JIT_MemCpy_0xa0)
+LOCAL_LABEL(JIT_MemCpy_0xb0):
+ tbz x2, #3, LOCAL_LABEL(JIT_MemCpy_0xb4)
+ ldr x8, [x1], #8
+ str x8, [x0], #8
LOCAL_LABEL(JIT_MemCpy_0xb4):
- tbz x2,#2,LOCAL_LABEL(JIT_MemCpy_0xc8)
- ldr w8,[x1]
- str w8,[x0]
- add x0,x0,#4
- add x1,x1,#4
+ tbz x2, #2, LOCAL_LABEL(JIT_MemCpy_0xc8)
+ ldr w8, [x1], #4
+ str w8, [x0], #4
LOCAL_LABEL(JIT_MemCpy_0xc8):
- tbz x2,#1,LOCAL_LABEL(JIT_MemCpy_0xdc)
- ldrsh w8,[x1]
- strh w8,[x0]
- add x0,x0,#2
- add x1,x1,#2
+ tbz x2, #1, LOCAL_LABEL(JIT_MemCpy_0xdc)
+ ldrsh w8, [x1], #2
+ strh w8, [x0], #2
LOCAL_LABEL(JIT_MemCpy_0xdc):
- tbz x2,#0,LOCAL_LABEL(JIT_MemCpy_0xe8)
- ldrsb w8,[x1]
- strb w8,[x0]
+ tbz x2, #0, LOCAL_LABEL(JIT_MemCpy_0xe8)
+ ldrsb w8, [x1]
+ strb w8, [x0]
LOCAL_LABEL(JIT_MemCpy_0xe8):
ret lr
LEAF_END_MARKED JIT_MemCpy, _TEXT
diff --git a/src/vm/arm64/stubs.cpp b/src/vm/arm64/stubs.cpp
index 0c7eb4dfba..40d274959f 100644
--- a/src/vm/arm64/stubs.cpp
+++ b/src/vm/arm64/stubs.cpp
@@ -1317,6 +1317,19 @@ void StompWriteBarrierResize(bool isRuntimeSuspended, bool bReqUpperBoundsCheck)
return;
}
+#ifdef FEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP
+void SwitchToWriteWatchBarrier(bool isRuntimeSuspended)
+{
+ return;
+}
+
+void SwitchToNonWriteWatchBarrier(bool isRuntimeSuspended)
+{
+ return;
+}
+#endif // FEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP
+
+
#ifdef DACCESS_COMPILE
BOOL GetAnyThunkTarget (T_CONTEXT *pctx, TADDR *pTarget, TADDR *pTargetMethodDesc)
{
diff --git a/src/vm/assemblyname.cpp b/src/vm/assemblyname.cpp
index 90e2a467e1..6c8367e506 100644
--- a/src/vm/assemblyname.cpp
+++ b/src/vm/assemblyname.cpp
@@ -57,20 +57,11 @@ FCIMPL1(Object*, AssemblyNameNative::GetFileInformation, StringObject* filenameU
SString sFileName(gc.filename->GetBuffer());
PEImageHolder pImage = PEImage::OpenImage(sFileName, MDInternalImport_NoCache);
- EX_TRY
- {
- // Allow AssemblyLoadContext.GetAssemblyName for native images on CoreCLR
- if (pImage->HasNTHeaders() && pImage->HasCorHeader() && pImage->HasNativeHeader())
- pImage->VerifyIsNIAssembly();
- else
- pImage->VerifyIsAssembly();
- }
- EX_CATCH
- {
- Exception *ex = GET_EXCEPTION();
- EEFileLoadException::Throw(sFileName,ex->GetHR(),ex);
- }
- EX_END_CATCH_UNREACHABLE;
+ // Allow AssemblyLoadContext.GetAssemblyName for native images on CoreCLR
+ if (pImage->HasNTHeaders() && pImage->HasCorHeader() && pImage->HasNativeHeader())
+ pImage->VerifyIsNIAssembly();
+ else
+ pImage->VerifyIsAssembly();
SString sUrl = sFileName;
PEAssembly::PathToUrl(sUrl);
diff --git a/src/vm/assemblynative.cpp b/src/vm/assemblynative.cpp
index b9079ec06a..e9bcc2366b 100644
--- a/src/vm/assemblynative.cpp
+++ b/src/vm/assemblynative.cpp
@@ -326,110 +326,6 @@ Assembly* AssemblyNative::LoadFromBuffer(BOOL fForIntrospection, const BYTE* pAs
return pAssembly;
}
-FCIMPL6(Object*, AssemblyNative::LoadImage, U1Array* PEByteArrayUNSAFE,
- U1Array* SymByteArrayUNSAFE, Object* securityUNSAFE,
- StackCrawlMark* stackMark, CLR_BOOL fForIntrospection, SecurityContextSource securityContextSource)
-{
- FCALL_CONTRACT;
-
- struct _gc
- {
- U1ARRAYREF PEByteArray;
- U1ARRAYREF SymByteArray;
- OBJECTREF security;
- OBJECTREF Throwable;
- OBJECTREF refRetVal;
- } gc;
-
- gc.PEByteArray = (U1ARRAYREF) PEByteArrayUNSAFE;
- gc.SymByteArray = (U1ARRAYREF) SymByteArrayUNSAFE;
- gc.security = (OBJECTREF) securityUNSAFE;
- gc.Throwable = NULL;
- gc.refRetVal = NULL;
-
- HELPER_METHOD_FRAME_BEGIN_RET_PROTECT(gc);
-
-
- if (gc.PEByteArray == NULL)
- COMPlusThrow(kArgumentNullException, W("ArgumentNull_Array"));
-
- NewArrayHolder<BYTE> pbSyms;
- DWORD cbSyms = 0;
-
-#ifdef DEBUGGING_SUPPORTED
- // If we were given symbols, save a copy of them.
- // the debugger, load them now).
- if (gc.SymByteArray != NULL)
- {
- Security::CopyByteArrayToEncoding(&gc.SymByteArray,
- &pbSyms, &cbSyms);
-
- }
-#endif // DEBUGGING_SUPPORTED
-
- Assembly* pAssembly = NULL;
- // Pin byte array for loading
- {
- Wrapper<OBJECTHANDLE, DoNothing, DestroyPinningHandle> handle(
- GetAppDomain()->CreatePinningHandle(gc.PEByteArray));
-
- const BYTE *pbImage = gc.PEByteArray->GetDirectConstPointerToNonObjectElements();
- DWORD cbImage = gc.PEByteArray->GetNumComponents();
- pAssembly = LoadFromBuffer(fForIntrospection, pbImage, cbImage, pbSyms, cbSyms, stackMark, OBJECTREFToObject(gc.security), securityContextSource);
- }
-
-
- if (pAssembly != NULL)
- gc.refRetVal = pAssembly->GetExposedObject();
-
- HELPER_METHOD_FRAME_END();
-
- return OBJECTREFToObject(gc.refRetVal);
-}
-FCIMPLEND
-
-FCIMPL2(Object*, AssemblyNative::LoadFile, StringObject* pathUNSAFE, Object* securityUNSAFE)
-{
- FCALL_CONTRACT;
-
- struct _gc {
- OBJECTREF refRetVal;
- OBJECTREF refSecurity;
- STRINGREF strPath;
- } gc;
-
- gc.refRetVal = NULL;
- gc.refSecurity = ObjectToOBJECTREF(securityUNSAFE);
- gc.strPath = ObjectToSTRINGREF(pathUNSAFE);
-
- HELPER_METHOD_FRAME_BEGIN_RET_PROTECT(gc);
-
- if(CorHost2::IsLoadFromBlocked())
- COMPlusThrow(kFileLoadException, FUSION_E_LOADFROM_BLOCKED);
-
- if (pathUNSAFE == NULL)
- COMPlusThrow(kArgumentNullException, W("ArgumentNull_Path"));
-
- StackSString path;
- gc.strPath->GetSString(path);
-
- Assembly *pAssembly = AssemblySpec::LoadAssembly(path);
-
- LOG((LF_CLASSLOADER,
- LL_INFO100,
- "\tLoaded assembly from a file\n"));
-
-
- if (pAssembly != NULL)
- gc.refRetVal = (ASSEMBLYREF) pAssembly->GetExposedObject();
-
- HELPER_METHOD_FRAME_END();
-
- return OBJECTREFToObject(gc.refRetVal);
-}
-FCIMPLEND
-
-
/* static */
Assembly* AssemblyNative::LoadFromPEImage(ICLRPrivBinder* pBinderContext, PEImage *pILImage, PEImage *pNIImage)
{
@@ -536,42 +432,6 @@ Assembly* AssemblyNative::LoadFromPEImage(ICLRPrivBinder* pBinderContext, PEImag
RETURN pLoadedAssembly;
}
-/* static */
-void QCALLTYPE AssemblyNative::GetLoadedAssembliesInternal(QCall::ObjectHandleOnStack assemblies)
-{
- QCALL_CONTRACT;
-
- BEGIN_QCALL;
-
- MethodTable * pAssemblyClass = MscorlibBinder::GetClass(CLASS__ASSEMBLY);
-
- PTR_AppDomain pCurDomain = GetAppDomain();
-
- SetSHash<PTR_DomainAssembly> assemblySet;
- pCurDomain->GetCacheAssemblyList(assemblySet);
- size_t nArrayElems = assemblySet.GetCount();
- PTRARRAYREF AsmArray = NULL;
-
- GCX_COOP();
-
- GCPROTECT_BEGIN(AsmArray);
- AsmArray = (PTRARRAYREF) AllocateObjectArray( (DWORD)nArrayElems, pAssemblyClass);
- for(auto it = assemblySet.Begin(); it != assemblySet.End(); it++)
- {
- PTR_DomainAssembly assem = *it;
- OBJECTREF o = (OBJECTREF)assem->GetExposedAssemblyObject();
- _ASSERTE(o != NULL);
- _ASSERTE(nArrayElems > 0);
- AsmArray->SetAt(--nArrayElems, o);
- }
-
- assemblies.Set(AsmArray);
-
- GCPROTECT_END();
-
- END_QCALL;
-}
-
/* static */
void QCALLTYPE AssemblyNative::LoadFromPath(INT_PTR ptrNativeAssemblyLoadContext, LPCWSTR pwzILPath, LPCWSTR pwzNIPath, QCall::ObjectHandleOnStack retLoadedAssembly)
{
diff --git a/src/vm/assemblynative.hpp b/src/vm/assemblynative.hpp
index ece8100e95..71e8b51181 100644
--- a/src/vm/assemblynative.hpp
+++ b/src/vm/assemblynative.hpp
@@ -46,10 +46,6 @@ public:
static
void QCALLTYPE GetExecutingAssembly(QCall::StackCrawlMarkHandle stackMark, QCall::ObjectHandleOnStack retAssembly);
- static FCDECL2(Object*, LoadFile, StringObject* pathUNSAFE,
- Object* securityUNSAFE);
- static FCDECL6(Object*, LoadImage, U1Array* PEByteArrayUNSAFE, U1Array* SymByteArrayUNSAFE, Object* securityUNSAFE, StackCrawlMark* stackMark, CLR_BOOL fForIntrospection, SecurityContextSource securityContextSource);
-
static FCDECL10(Object*, Load, AssemblyNameBaseObject* assemblyNameUNSAFE,
StringObject* codeBaseUNSAFE,
Object* securityUNSAFE,
@@ -61,9 +57,6 @@ public:
CLR_BOOL fSuppressSecurityChecks,
INT_PTR ptrLoadContextBinder);
- static FCDECL1(FC_BOOL_RET, IsFrameworkAssembly, AssemblyNameBaseObject* refAssemblyNameUNSAFE);
- static FCDECL1(FC_BOOL_RET, IsNewPortableAssembly, AssemblyNameBaseObject* refAssemblyNameUNSAFE);
-
//
// instance FCALLs
//
@@ -208,7 +201,6 @@ public:
static BOOL QCALLTYPE OverrideDefaultAssemblyLoadContextForCurrentDomain(INT_PTR ptrNativeAssemblyLoadContext);
static BOOL QCALLTYPE CanUseAppPathAssemblyLoadContextInCurrentDomain();
static void QCALLTYPE LoadFromPath(INT_PTR ptrNativeAssemblyLoadContext, LPCWSTR pwzILPath, LPCWSTR pwzNIPath, QCall::ObjectHandleOnStack retLoadedAssembly);
- static void QCALLTYPE GetLoadedAssembliesInternal(QCall::ObjectHandleOnStack assemblies);
static INT_PTR QCALLTYPE InternalLoadUnmanagedDllFromPath(LPCWSTR unmanagedLibraryPath);
static void QCALLTYPE LoadFromStream(INT_PTR ptrNativeAssemblyLoadContext, INT_PTR ptrAssemblyArray, INT32 cbAssemblyArrayLength, INT_PTR ptrSymbolArray, INT32 cbSymbolArrayLength, QCall::ObjectHandleOnStack retLoadedAssembly);
static Assembly* LoadFromPEImage(ICLRPrivBinder* pBinderContext, PEImage *pILImage, PEImage *pNIImage);
diff --git a/src/vm/assemblyspec.cpp b/src/vm/assemblyspec.cpp
index e278c002fc..e5952c24d2 100644
--- a/src/vm/assemblyspec.cpp
+++ b/src/vm/assemblyspec.cpp
@@ -785,15 +785,6 @@ ICLRPrivBinder* AssemblySpec::GetBindingContextFromParentAssembly(AppDomain *pDo
// ICLRPrivAssembly implements ICLRPrivBinder and thus, "is a" binder in a manner of semantics.
pParentAssemblyBinder = pParentPEAssembly->GetBindingContext();
- if (pParentAssemblyBinder == NULL)
- {
- if (pParentPEAssembly->IsDynamic())
- {
- // If the parent assembly is dynamically generated, then use its fallback load context
- // as the binder.
- pParentAssemblyBinder = pParentPEAssembly->GetFallbackLoadContextBinder();
- }
- }
}
if (GetPreferFallbackLoadContextBinder())
@@ -811,13 +802,12 @@ ICLRPrivBinder* AssemblySpec::GetBindingContextFromParentAssembly(AppDomain *pDo
//
// 1) Domain Neutral assembly
// 2) Entrypoint assembly
- // 3) RefEmitted assembly
- // 4) AssemblyLoadContext.LoadFromAssemblyName
+ // 3) AssemblyLoadContext.LoadFromAssemblyName
//
// For (1) and (2), we will need to bind against the DefaultContext binder (aka TPA Binder). This happens
// below if we do not find the parent assembly binder.
//
- // For (3) and (4), fetch the fallback load context binder reference.
+ // For (3), fetch the fallback load context binder reference.
pParentAssemblyBinder = GetFallbackLoadContextBinderForRequestingAssembly();
}
diff --git a/src/vm/ceeload.cpp b/src/vm/ceeload.cpp
index 5de7114eb1..6a1eb62959 100644
--- a/src/vm/ceeload.cpp
+++ b/src/vm/ceeload.cpp
@@ -9550,7 +9550,7 @@ void Module::Arrange(DataImage *image)
else if (TypeFromToken(token) == mdtFieldDef)
{
FieldDesc *pFD = LookupFieldDef(token);
- if (pFD && pFD->IsILOnlyRVAField())
+ if (pFD && pFD->IsRVA())
{
if (entry->flags & (1 << RVAFieldData))
{
@@ -12770,6 +12770,11 @@ void Module::LogTokenAccess(mdToken token, SectionFormat format, ULONG flagnum)
if (!m_nativeImageProfiling)
return;
+ if (flagnum >= CORBBTPROF_TOKEN_MAX_NUM_FLAGS)
+ {
+ return;
+ }
+
mdToken rid = RidFromToken(token);
CorTokenType tkType = (CorTokenType) TypeFromToken(token);
SectionFormat tkKind = (SectionFormat) (tkType >> 24);
@@ -12798,8 +12803,9 @@ void Module::LogTokenAccess(mdToken token, SectionFormat format, ULONG flagnum)
else if (tkKind == (SectionFormat) (ibcMethodSpec >> 24))
tkKind = IbcMethodSpecSection;
+ _ASSERTE(tkKind >= 0);
_ASSERTE(tkKind < SectionFormatCount);
- if (tkKind >= SectionFormatCount)
+ if (tkKind < 0 || tkKind >= SectionFormatCount)
{
return;
}
diff --git a/src/vm/ceemain.cpp b/src/vm/ceemain.cpp
index 9cce46d2f0..c03c40134b 100644
--- a/src/vm/ceemain.cpp
+++ b/src/vm/ceemain.cpp
@@ -693,6 +693,11 @@ void EEStartupHelper(COINITIEE fFlags)
InitThreadManager();
STRESS_LOG0(LF_STARTUP, LL_ALWAYS, "Returned successfully from InitThreadManager");
+#ifdef FEATURE_PERFTRACING
+ // Initialize the event pipe.
+ EventPipe::Initialize();
+#endif // FEATURE_PERFTRACING
+
#ifdef FEATURE_EVENT_TRACE
// Initialize event tracing early so we can trace CLR startup time events.
InitializeEventTracing();
@@ -1036,8 +1041,7 @@ void EEStartupHelper(COINITIEE fFlags)
#endif
#ifdef FEATURE_PERFTRACING
- // Initialize the event pipe and start it if requested.
- EventPipe::Initialize();
+ // Start the event pipe if requested.
EventPipe::EnableOnStartup();
#endif // FEATURE_PERFTRACING
@@ -1576,6 +1580,11 @@ void STDMETHODCALLTYPE EEShutDownHelper(BOOL fIsDllUnloading)
ETW::EnumerationLog::ProcessShutdown();
}
+#ifdef FEATURE_PERFTRACING
+ // Shutdown the event pipe.
+ EventPipe::Shutdown();
+#endif // FEATURE_PERFTRACING
+
#if defined(FEATURE_COMINTEROP)
// Get the current thread.
Thread * pThisThread = GetThread();
@@ -1708,11 +1717,6 @@ void STDMETHODCALLTYPE EEShutDownHelper(BOOL fIsDllUnloading)
PerfMap::Destroy();
#endif
-#ifdef FEATURE_PERFTRACING
- // Shutdown the event pipe.
- EventPipe::Shutdown();
-#endif // FEATURE_PERFTRACING
-
#ifdef FEATURE_PREJIT
{
// If we're doing basic block profiling, we need to write the log files to disk.
diff --git a/src/vm/class.h b/src/vm/class.h
index 6c74377012..e3ec0ba166 100644
--- a/src/vm/class.h
+++ b/src/vm/class.h
@@ -2502,6 +2502,17 @@ inline PCODE GetPreStubEntryPoint()
return GetEEFuncEntryPoint(ThePreStub);
}
+#if defined(HAS_COMPACT_ENTRYPOINTS) && defined(_TARGET_ARM_)
+
+EXTERN_C void STDCALL ThePreStubCompactARM();
+
+inline PCODE GetPreStubCompactARMEntryPoint()
+{
+ return GetEEFuncEntryPoint(ThePreStubCompactARM);
+}
+
+#endif // defined(HAS_COMPACT_ENTRYPOINTS) && defined(_TARGET_ARM_)
+
PCODE TheUMThunkPreStub();
PCODE TheVarargNDirectStub(BOOL hasRetBuffArg);
diff --git a/src/vm/clrex.cpp b/src/vm/clrex.cpp
index 1c1501e54d..ba040b7e81 100644
--- a/src/vm/clrex.cpp
+++ b/src/vm/clrex.cpp
@@ -2002,18 +2002,7 @@ void DECLSPEC_NORETURN EEFileLoadException::Throw(LPCWSTR path, HRESULT hr, Exce
if (hr == E_OUTOFMEMORY)
COMPlusThrowOM();
-#ifndef CROSSGEN_COMPILE
- // Remove path - location must be hidden for security purposes
-
- LPCWSTR pStart = wcsrchr(path, '\\');
- if (pStart != NULL)
- pStart++;
- else
- pStart = path;
-#else
- LPCWSTR pStart = path;
-#endif
- EX_THROW_WITH_INNER(EEFileLoadException, (StackSString(pStart), hr), pInnerException);
+ EX_THROW_WITH_INNER(EEFileLoadException, (StackSString(path), hr), pInnerException);
}
/* static */
diff --git a/src/vm/codeman.cpp b/src/vm/codeman.cpp
index a30e70e7fa..d934b824f6 100644
--- a/src/vm/codeman.cpp
+++ b/src/vm/codeman.cpp
@@ -1219,7 +1219,6 @@ EEJitManager::EEJitManager()
#if defined(_TARGET_X86_) || defined(_TARGET_AMD64_)
m_JITCompilerOther = NULL;
#endif
- m_fLegacyJitUsed = FALSE;
#ifdef ALLOW_SXS_JIT
m_alternateJit = NULL;
@@ -1371,8 +1370,8 @@ void EEJitManager::SetCpuInfo()
enum JIT_LOAD_JIT_ID
{
JIT_LOAD_MAIN = 500, // The "main" JIT. Normally, this is named "clrjit.dll". Start at a number that is somewhat uncommon (i.e., not zero or 1) to help distinguish from garbage, in process dumps.
- JIT_LOAD_LEGACY, // The "legacy" JIT. Normally, this is named "compatjit.dll". This applies to AMD64 on Windows desktop, or x86 on Windows .NET Core.
- JIT_LOAD_ALTJIT // An "altjit". By default, named "protojit.dll". Used both internally, as well as externally for JIT CTP builds.
+ // 501 is JIT_LOAD_LEGACY on some platforms; please do not reuse this value.
+ JIT_LOAD_ALTJIT = 502 // An "altjit". By default, named "protojit.dll". Used both internally, as well as externally for JIT CTP builds.
};
enum JIT_LOAD_STATUS
@@ -1628,80 +1627,6 @@ BOOL EEJitManager::LoadJIT()
// Set as a courtesy to code:CorCompileGetRuntimeDll
s_ngenCompilerDll = m_JITCompiler;
-
-#if defined(_TARGET_X86_)
- // If COMPlus_UseLegacyJit=1, then we fall back to compatjit.dll.
- //
- // This fallback mechanism was introduced for Visual Studio "14" Preview, when JIT64 (the legacy JIT) was replaced with
- // RyuJIT. It was desired to provide a fallback mechanism in case comptibility problems (or other bugs)
- // were discovered by customers. Setting this COMPLUS variable to 1 does not affect NGEN: existing NGEN images continue
- // to be used, and all subsequent NGEN compilations continue to use the new JIT.
- //
- // If this is a compilation process, then we don't allow specifying a fallback JIT. This is a case where, when NGEN'ing,
- // we sometimes need to JIT some things (such as when we are NGEN'ing mscorlib). In that case, we want to use exactly
- // the same JIT as NGEN uses. And NGEN doesn't follow the COMPlus_UseLegacyJit=1 switch -- it always uses clrjit.dll.
- //
- // Note that we always load and initialize the default JIT. This is to handle cases where obfuscators rely on
- // LoadLibrary("clrjit.dll") returning the module handle of the JIT, and then they call GetProcAddress("getJit") to get
- // the EE-JIT interface. They also do this without also calling sxsJitStartup()!
- //
- // In addition, for reasons related to servicing, we only use RyuJIT when the registry value UseRyuJIT (type DWORD), under
- // key HKLM\SOFTWARE\Microsoft\.NETFramework, is set to 1. Otherwise, we fall back to JIT64. Note that if this value
- // is set, we also must use JIT64 for all NGEN compilations as well.
- //
- // See the document "RyuJIT Compatibility Fallback Specification.docx" for details.
- //
- // For .NET Core 1.2, RyuJIT for x86 is the primary jit (clrjit.dll) and JIT32 for x86 is the fallback, legacy JIT (compatjit.dll).
- // Thus, the COMPlus_useLegacyJit=1 mechanism has been enabled for x86 CoreCLR. This scenario does not have the UseRyuJIT
- // registry key, nor the AppX binder mode.
-
- bool fUseRyuJit = true;
-
- if ((!IsCompilationProcess() || !fUseRyuJit) && // Use RyuJIT for all NGEN, unless we're falling back to JIT64 for everything.
- (newJitCompiler != nullptr)) // the main JIT must successfully load before we try loading the fallback JIT
- {
- BOOL fUsingCompatJit = FALSE;
-
- if (!fUseRyuJit)
- {
- fUsingCompatJit = TRUE;
- }
-
- if (!fUsingCompatJit)
- {
- DWORD useLegacyJit = Configuration::GetKnobBooleanValue(W("System.JIT.UseWindowsX86CoreLegacyJit"), CLRConfig::EXTERNAL_UseWindowsX86CoreLegacyJit);
- if (useLegacyJit == 1)
- {
- fUsingCompatJit = TRUE;
- }
- }
-
-
- if (fUsingCompatJit)
- {
- // Now, load the compat jit and initialize it.
-
- LPCWSTR pwzJitName = MAKEDLLNAME_W(W("compatjit"));
-
- // Note: if the compatjit fails to load, we ignore it, and continue to use the main JIT for
- // everything. You can imagine a policy where if the user requests the compatjit, and we fail
- // to load it, that we fail noisily. We don't do that currently.
- ICorJitCompiler* fallbackICorJitCompiler;
- g_JitLoadData.jld_id = JIT_LOAD_LEGACY;
- LoadAndInitializeJIT(pwzJitName, &m_JITCompilerOther, &fallbackICorJitCompiler, &g_JitLoadData);
- if (fallbackICorJitCompiler != nullptr)
- {
- // Tell the main JIT to fall back to the "fallback" JIT compiler, in case some
- // obfuscator tries to directly call the main JIT's getJit() function.
- newJitCompiler->setRealJit(fallbackICorJitCompiler);
-
- // Now, the compat JIT will be used.
- m_fLegacyJitUsed = TRUE;
- }
- }
- }
-#endif // (defined(_TARGET_AMD64_) && !defined(CROSSGEN_COMPILE)) || (defined(_TARGET_X86_) )
-
#endif // !FEATURE_MERGE_JIT_AND_ENGINE
#ifdef ALLOW_SXS_JIT
diff --git a/src/vm/codeman.h b/src/vm/codeman.h
index 9d7ed4d62f..cca5f5e2d2 100644
--- a/src/vm/codeman.h
+++ b/src/vm/codeman.h
@@ -1201,12 +1201,6 @@ public:
HINSTANCE m_JITCompilerOther; // Stores the handle of the legacy JIT, if one is loaded.
#endif
- // TRUE if the legacy/compat JIT was loaded successfully and will be used.
- // This is available in all builds so if COMPlus_RequireLegacyJit=1 is set in a test,
- // the test will fail in any build where the legacy JIT is not loaded, even if legacy
- // fallback is not available in that build. This prevents unexpected silent successes.
- BOOL m_fLegacyJitUsed;
-
#ifdef ALLOW_SXS_JIT
//put these at the end so that we don't mess up the offsets in the DAC.
ICorJitCompiler * m_alternateJit;
diff --git a/src/vm/comdependenthandle.cpp b/src/vm/comdependenthandle.cpp
index 6535a804ae..4763e4833a 100644
--- a/src/vm/comdependenthandle.cpp
+++ b/src/vm/comdependenthandle.cpp
@@ -17,22 +17,22 @@
-FCIMPL3(VOID, DependentHandle::nInitialize, Object *_primary, Object *_secondary, OBJECTHANDLE *outHandle)
+FCIMPL2(OBJECTHANDLE, DependentHandle::nInitialize, Object *_primary, Object *_secondary)
{
FCALL_CONTRACT;
- _ASSERTE(outHandle != NULL && *outHandle == NULL); // Multiple initializations disallowed
-
OBJECTREF primary(_primary);
OBJECTREF secondary(_secondary);
+ OBJECTHANDLE result = NULL;
- HELPER_METHOD_FRAME_BEGIN_NOPOLL();
+ HELPER_METHOD_FRAME_BEGIN_RET_NOPOLL();
// Create the handle.
- *outHandle = GetAppDomain()->CreateDependentHandle(primary, secondary);
+ result = GetAppDomain()->CreateDependentHandle(primary, secondary);
HELPER_METHOD_FRAME_END_POLL();
+ return result;
}
FCIMPLEND
@@ -55,22 +55,28 @@ FCIMPLEND
-FCIMPL2(VOID, DependentHandle::nGetPrimary, OBJECTHANDLE handle, Object **outPrimary)
+FCIMPL1(Object*, DependentHandle::nGetPrimary, OBJECTHANDLE handle)
{
FCALL_CONTRACT;
- _ASSERTE(handle != NULL && outPrimary != NULL);
- *outPrimary = OBJECTREFToObject(ObjectFromHandle(handle));
+ FCUnique(0x54);
+ _ASSERTE(handle != NULL);
+ return OBJECTREFToObject(ObjectFromHandle(handle));
}
FCIMPLEND
-FCIMPL3(VOID, DependentHandle::nGetPrimaryAndSecondary, OBJECTHANDLE handle, Object **outPrimary, Object **outSecondary)
+FCIMPL2(Object*, DependentHandle::nGetPrimaryAndSecondary, OBJECTHANDLE handle, Object **outSecondary)
{
FCALL_CONTRACT;
- _ASSERTE(handle != NULL && outPrimary != NULL && outSecondary != NULL);
- *outPrimary = OBJECTREFToObject(ObjectFromHandle(handle));
- *outSecondary = OBJECTREFToObject(GetDependentHandleSecondary(handle));
+ _ASSERTE(handle != NULL && outSecondary != NULL);
+
+ OBJECTREF primary = ObjectFromHandle(handle);
+
+ // Secondary is tracked only if primary is non-null
+ *outSecondary = (primary != NULL) ? OBJECTREFToObject(GetDependentHandleSecondary(handle)) : NULL;
+
+ return OBJECTREFToObject(primary);
}
FCIMPLEND
diff --git a/src/vm/comdependenthandle.h b/src/vm/comdependenthandle.h
index 7192a4bbc3..edc9a6b30f 100644
--- a/src/vm/comdependenthandle.h
+++ b/src/vm/comdependenthandle.h
@@ -41,12 +41,12 @@
class DependentHandle
{
public:
- static FCDECL3(VOID, nInitialize, Object *primary, Object *secondary, OBJECTHANDLE *outHandle);
- static FCDECL2(VOID, nGetPrimary, OBJECTHANDLE handle, Object **outPrimary);
- static FCDECL3(VOID, nGetPrimaryAndSecondary, OBJECTHANDLE handle, Object **outPrimary, Object **outSecondary);
- static FCDECL1(VOID, nFree, OBJECTHANDLE handle);
- static FCDECL2(VOID, nSetPrimary, OBJECTHANDLE handle, Object *primary);
- static FCDECL2(VOID, nSetSecondary, OBJECTHANDLE handle, Object *secondary);
+ static FCDECL2(OBJECTHANDLE, nInitialize, Object *primary, Object *secondary);
+ static FCDECL1(Object *, nGetPrimary, OBJECTHANDLE handle);
+ static FCDECL2(Object *, nGetPrimaryAndSecondary, OBJECTHANDLE handle, Object **outSecondary);
+ static FCDECL1(VOID, nFree, OBJECTHANDLE handle);
+ static FCDECL2(VOID, nSetPrimary, OBJECTHANDLE handle, Object *primary);
+ static FCDECL2(VOID, nSetSecondary, OBJECTHANDLE handle, Object *secondary);
};
#endif
diff --git a/src/vm/compile.cpp b/src/vm/compile.cpp
index 91615851c7..9727430398 100644
--- a/src/vm/compile.cpp
+++ b/src/vm/compile.cpp
@@ -652,22 +652,6 @@ HRESULT CEECompileInfo::SetCompilationTarget(CORINFO_ASSEMBLY_HANDLE assembl
}
}
-#ifdef FEATURE_READYTORUN_COMPILER
- if (IsReadyToRunCompilation() && !pModule->IsILOnly())
- {
- GetSvcLogger()->Printf(LogLevel_Error, W("Error: /readytorun not supported for mixed mode assemblies\n"));
- return E_FAIL;
- }
-#endif
-
-#ifdef FEATURE_READYTORUN_COMPILER
- if (IsReadyToRunCompilation() && !pModule->IsILOnly())
- {
- GetSvcLogger()->Printf(LogLevel_Error, W("Error: /readytorun not supported for mixed mode assemblies\n"));
- return E_FAIL;
- }
-#endif
-
return S_OK;
}
@@ -1723,6 +1707,12 @@ mdToken CEECompileInfo::TryEncodeMethodAsToken(
if (!pReferencingModule->IsInCurrentVersionBubble())
return mdTokenNil;
+ // If this is a MemberRef with TypeSpec, we might come to here because we resolved the method
+ // into a non-generic base class in the same version bubble. However, since we don't have the
+ // proper type context during ExternalMethodFixupWorker, we can't really encode using token
+ if (pResolvedToken->pTypeSpec != NULL)
+ return mdTokenNil;
+
unsigned methodToken = pResolvedToken->token;
switch (TypeFromToken(methodToken))
@@ -6803,7 +6793,7 @@ void CEEPreloader::GetRVAFieldData(mdFieldDef fd, PVOID * ppData, DWORD * pcbSiz
if (pFD == NULL)
ThrowHR(COR_E_TYPELOAD);
- _ASSERTE(pFD->IsILOnlyRVAField());
+ _ASSERTE(pFD->IsRVA());
UINT size = pFD->LoadSize();
diff --git a/src/vm/coreassemblyspec.cpp b/src/vm/coreassemblyspec.cpp
index 7cb1f56315..1d3567e769 100644
--- a/src/vm/coreassemblyspec.cpp
+++ b/src/vm/coreassemblyspec.cpp
@@ -275,8 +275,32 @@ STDAPI BinderAcquirePEImage(LPCWSTR wszAssemblyPath,
STDAPI BinderHasNativeHeader(PEImage *pPEImage, BOOL* result)
{
- *result = pPEImage->HasNativeHeader();
- return S_OK;
+ HRESULT hr = S_OK;
+
+ _ASSERTE(pPEImage != NULL);
+ _ASSERTE(result != NULL);
+
+ EX_TRY
+ {
+ *result = pPEImage->HasNativeHeader();
+ }
+ EX_CATCH_HRESULT(hr);
+
+ if (FAILED(hr))
+ {
+ *result = false;
+
+#if defined(FEATURE_PAL)
+ // PAL_LOADLoadPEFile may fail while loading IL masquerading as NI.
+ // This will result in a ThrowHR(E_FAIL). Suppress the error.
+ if(hr == E_FAIL)
+ {
+ hr = S_OK;
+ }
+#endif // defined(FEATURE_PAL)
+ }
+
+ return hr;
}
STDAPI BinderAcquireImport(PEImage *pPEImage,
diff --git a/src/vm/corhost.cpp b/src/vm/corhost.cpp
index fd27a7a4e7..3f53de2acb 100644
--- a/src/vm/corhost.cpp
+++ b/src/vm/corhost.cpp
@@ -2570,7 +2570,7 @@ HRESULT CCLRErrorReportingManager::BucketParamsCache::SetAt(BucketParameterIndex
{
LIMITED_METHOD_CONTRACT;
- if (index >= InvalidBucketParamIndex)
+ if (index < 0 || index >= InvalidBucketParamIndex)
{
_ASSERTE(!"bad bucket parameter index");
return E_INVALIDARG;
diff --git a/src/vm/coverage.cpp b/src/vm/coverage.cpp
deleted file mode 100644
index 2a5e5ffdfb..0000000000
--- a/src/vm/coverage.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-
-#include "common.h"
-
-#include "coverage.h"
-
-
-//
-// This is part of the runtime test teams Code Coverge Tools. Due to the special nature of MSCORLIB.dll
-// We have to work around several issues (Like the initilization of the Secutiry Manager) to be able to get
-// Code coverage on mscorlib.dll
-//
-
-FCIMPL1(unsigned __int64, COMCoverage::nativeCoverBlock, INT32 id)
-{
- FCALL_CONTRACT;
-
- unsigned __int64 retVal = 0;
- HELPER_METHOD_FRAME_BEGIN_RET_0();
-
- HMODULE ilcovnat = 0;
- if (id == 1)
- {
- ilcovnat = CLRLoadLibrary(W("Ilcovnat.dll"));
-
- if (ilcovnat)
- {
- retVal = (unsigned __int64)GetProcAddress(ilcovnat, "CoverBlockNative");
- }
- }
- else if (id == 2)
- {
- ilcovnat = CLRLoadLibrary(W("coverage.dll"));
-
- if (ilcovnat)
- {
- retVal = (unsigned __int64)GetProcAddress(ilcovnat, "CoverageRegisterBinaryWithStruct");
- }
- }
- else if (id == 3)
- {
- ilcovnat = CLRLoadLibrary(W("Ilcovnat.dll"));
- if (ilcovnat)
- {
- retVal = (unsigned __int64)GetProcAddress(ilcovnat, "CoverMonRegisterMscorlib");
- }
- }
-
- HELPER_METHOD_FRAME_END();
- return retVal;
-}
-FCIMPLEND
diff --git a/src/vm/coverage.h b/src/vm/coverage.h
deleted file mode 100644
index 9be2cc1c1e..0000000000
--- a/src/vm/coverage.h
+++ /dev/null
@@ -1,19 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-
-#ifndef _COVERAGE_H_
-#define _COVERAGE_H_
-
-// Please see coverage.cpp for info on this file
-class COMCoverage
-{
-public:
- //typedef struct
- //{
- // DECLARE_ECALL_I4_ARG(INT32, id);
- //} _CoverageArgs;
- static FCDECL1(unsigned __int64, nativeCoverBlock, INT32 id);
-};
-#endif // _COVERAGE_H_
diff --git a/src/vm/dllimport.cpp b/src/vm/dllimport.cpp
index 3abe9cbf46..b58ac56b29 100644
--- a/src/vm/dllimport.cpp
+++ b/src/vm/dllimport.cpp
@@ -5938,19 +5938,7 @@ HMODULE NDirect::LoadLibraryModuleViaHost(NDirectMethodDesc * pMD, AppDomain* pD
// The Binding Context can be null or an overridden TPA context
if (pBindingContext == NULL)
{
- pBindingContext = nullptr;
-
- // If the assembly does not have a binder associated with it explicitly, then check if it is
- // a dynamic assembly, or not, since they can have a fallback load context associated with them.
- if (pManifestFile->IsDynamic())
- {
- pBindingContext = pManifestFile->GetFallbackLoadContextBinder();
- }
- }
-
- // If we do not have any binder associated, then return to the default resolution mechanism.
- if (pBindingContext == nullptr)
- {
+ // If we do not have any binder associated, then return to the default resolution mechanism.
return NULL;
}
diff --git a/src/vm/dwreport.cpp b/src/vm/dwreport.cpp
index b95c59ff8d..57d67e7c22 100644
--- a/src/vm/dwreport.cpp
+++ b/src/vm/dwreport.cpp
@@ -1526,30 +1526,28 @@ BOOL RunWatson(
return false;
}
+ {
+ BOOL ret = WszCreateProcess(watsonAppName,
+ watsonCommandLine,
+ NULL,
+ NULL,
+ TRUE,
+ NULL,
+ NULL,
+ NULL,
+ &startupInfo,
+ &processInformation);
+
+ if (FALSE == ret)
{
- BOOL ret = WszCreateProcess(watsonAppName,
- watsonCommandLine,
- NULL,
- NULL,
- TRUE,
- NULL,
- NULL,
- NULL,
- &startupInfo,
- &processInformation);
-
- if (FALSE == ret)
- {
- //
- // Watson failed to start up.
- //
- // This can happen if e.g. Watson wasn't installed on the machine.
- //
- return E_FAIL;
-
- }
-
+ //
+ // Watson failed to start up.
+ //
+ // This can happen if e.g. Watson wasn't installed on the machine.
+ //
+ return FALSE;
}
+ }
diff --git a/src/vm/ecalllist.h b/src/vm/ecalllist.h
index 5c3e5f82ba..39056a9198 100644
--- a/src/vm/ecalllist.h
+++ b/src/vm/ecalllist.h
@@ -519,6 +519,7 @@ FCFuncStart(gAppDomainFuncs)
#if FEATURE_COMINTEROP
FCFuncElement("nSetDisableInterfaceCache", AppDomainNative::SetDisableInterfaceCache)
#endif // FEATURE_COMINTEROP
+ FCFuncElement("nGetAssemblies", AppDomainNative::GetAssemblies)
FCFuncElement("nCreateContext", AppDomainNative::CreateContext)
FCFuncElement("GetId", AppDomainNative::GetId)
FCFuncElement("GetOrInternString", AppDomainNative::GetOrInternString)
@@ -593,7 +594,6 @@ FCFuncStart(gAssemblyFuncs)
QCFuncElement("GetVersion", AssemblyNative::GetVersion)
FCFuncElement("FCallIsDynamic", AssemblyNative::IsDynamic)
FCFuncElement("_nLoad", AssemblyNative::Load)
- FCFuncElement("nLoadImage", AssemblyNative::LoadImage)
QCFuncElement("GetType", AssemblyNative::GetType)
QCFuncElement("GetManifestResourceInfo", AssemblyNative::GetManifestResourceInfo)
QCFuncElement("GetModules", AssemblyNative::GetModules)
@@ -617,7 +617,6 @@ FCFuncEnd()
FCFuncStart(gAssemblyLoadContextFuncs)
QCFuncElement("InitializeAssemblyLoadContext", AssemblyNative::InitializeAssemblyLoadContext)
QCFuncElement("LoadFromPath", AssemblyNative::LoadFromPath)
- QCFuncElement("GetLoadedAssembliesInternal", AssemblyNative::GetLoadedAssembliesInternal)
QCFuncElement("InternalLoadUnmanagedDllFromPath", AssemblyNative::InternalLoadUnmanagedDllFromPath)
QCFuncElement("CanUseAppPathAssemblyLoadContextInCurrentDomain", AssemblyNative::CanUseAppPathAssemblyLoadContextInCurrentDomain)
QCFuncElement("LoadFromStream", AssemblyNative::LoadFromStream)
@@ -1237,10 +1236,6 @@ FCFuncStart(gStubHelperFuncs)
#endif //FEATURE_STUBS_AS_IL
FCFuncEnd()
-FCFuncStart(gCoverageFuncs)
- FCUnreferenced FCFuncElement("nativeCoverBlock", COMCoverage::nativeCoverBlock)
-FCFuncEnd()
-
FCFuncStart(gGCHandleFuncs)
FCFuncElement("InternalAlloc", MarshalNative::GCHandleInternalAlloc)
FCFuncElement("InternalFree", MarshalNative::GCHandleInternalFree)
@@ -1276,6 +1271,17 @@ FCFuncStart(gEventLogger)
FCFuncEnd()
#endif // defined(FEATURE_EVENTSOURCE_XPLAT)
+#ifdef FEATURE_PERFTRACING
+FCFuncStart(gEventPipeInternalFuncs)
+ QCFuncElement("Enable", EventPipeInternal::Enable)
+ QCFuncElement("Disable", EventPipeInternal::Disable)
+ QCFuncElement("CreateProvider", EventPipeInternal::CreateProvider)
+ QCFuncElement("DefineEvent", EventPipeInternal::DefineEvent)
+ QCFuncElement("DeleteProvider", EventPipeInternal::DeleteProvider)
+ QCFuncElement("WriteEvent", EventPipeInternal::WriteEvent)
+FCFuncEnd()
+#endif // FEATURE_PERFTRACING
+
#ifdef FEATURE_COMINTEROP
FCFuncStart(gRuntimeClassFuncs)
FCFuncElement("GetRedirectedGetHashCodeMD", ComObject::GetRedirectedGetHashCodeMD)
@@ -1379,6 +1385,9 @@ FCClassElement("Environment", "System", gEnvironmentFuncs)
#ifdef FEATURE_COMINTEROP
FCClassElement("EventArgsMarshaler", "System.StubHelpers", gEventArgsMarshalerFuncs)
#endif // FEATURE_COMINTEROP
+#if defined(FEATURE_PERFTRACING)
+FCClassElement("EventPipeInternal", "System.Diagnostics.Tracing", gEventPipeInternalFuncs)
+#endif // FEATURE_PERFTRACING
FCClassElement("Exception", "System", gExceptionFuncs)
FCClassElement("FileLoadException", "System.IO", gFileLoadExceptionFuncs)
FCClassElement("FormatterServices", "System.Runtime.Serialization", gSerializationFuncs)
@@ -1388,12 +1397,7 @@ FCClassElement("GCHandle", "System.Runtime.InteropServices", gGCHandleFuncs)
FCClassElement("IEnumerable", "System.Collections", gStdMngIEnumerableFuncs)
FCClassElement("IEnumerator", "System.Collections", gStdMngIEnumeratorFuncs)
FCClassElement("IExpando", "System.Runtime.InteropServices.Expando", gStdMngIExpandoFuncs)
-#endif // FEATURE_COMINTEROP
-FCClassElement("ILCover", "System.Coverage", gCoverageFuncs)
-#ifdef FEATURE_COMINTEROP
FCClassElement("IReflect", "System.Reflection", gStdMngIReflectFuncs)
-#endif
-#ifdef FEATURE_COMINTEROP
FCClassElement("InterfaceMarshaler", "System.StubHelpers", gInterfaceMarshalerFuncs)
#endif
FCClassElement("Interlocked", "System.Threading", gInterlockedFuncs)
diff --git a/src/vm/eeconfig.cpp b/src/vm/eeconfig.cpp
index 812d1df671..81f3957951 100644
--- a/src/vm/eeconfig.cpp
+++ b/src/vm/eeconfig.cpp
@@ -327,10 +327,6 @@ HRESULT EEConfig::Init()
iRequireZaps = REQUIRE_ZAPS_NONE;
-#ifdef _TARGET_AMD64_
- pDisableNativeImageLoadList = NULL;
-#endif
-
// new loader behavior switches
m_fDeveloperInstallation = false;
@@ -489,11 +485,6 @@ HRESULT EEConfig::Cleanup()
delete pForbidZapsExcludeList;
#endif
-#ifdef _TARGET_AMD64_
- if (pDisableNativeImageLoadList)
- delete pDisableNativeImageLoadList;
-#endif
-
#ifdef FEATURE_COMINTEROP
if (pszLogCCWRefCountChange)
delete [] pszLogCCWRefCountChange;
@@ -996,16 +987,6 @@ HRESULT EEConfig::sync()
}
#endif
-#ifdef _TARGET_AMD64_
- if (!IsCompilationProcess())
- {
- NewArrayHolder<WCHAR> wszDisableNativeImageLoadList;
- IfFailRet(CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_DisableNativeImageLoadList, &wszDisableNativeImageLoadList));
- if (wszDisableNativeImageLoadList)
- pDisableNativeImageLoadList = new AssemblyNamesList(wszDisableNativeImageLoadList);
- }
-#endif
-
#ifdef FEATURE_LOADER_OPTIMIZATION
dwSharePolicy = GetConfigDWORD_DontUse_(CLRConfig::EXTERNAL_LoaderOptimization, dwSharePolicy);
#endif
@@ -1455,18 +1436,6 @@ bool EEConfig::ExcludeReadyToRun(LPCUTF8 assemblyName) const
return false;
}
-#ifdef _TARGET_AMD64_
-bool EEConfig::DisableNativeImageLoad(LPCUTF8 assemblyName) const
-{
- LIMITED_METHOD_CONTRACT;
-
- if (pDisableNativeImageLoadList != NULL && pDisableNativeImageLoadList->IsInList(assemblyName))
- return true;
-
- return false;
-}
-#endif
-
/**************************************************************/
#ifdef _DEBUG
/**************************************************************/
diff --git a/src/vm/eeconfig.h b/src/vm/eeconfig.h
index e97385e3da..ae23f74755 100644
--- a/src/vm/eeconfig.h
+++ b/src/vm/eeconfig.h
@@ -758,11 +758,6 @@ public:
bool ForbidZap(LPCUTF8 assemblyName) const;
#endif
bool ExcludeReadyToRun(LPCUTF8 assemblyName) const;
-
-#ifdef _TARGET_AMD64_
- bool DisableNativeImageLoad(LPCUTF8 assemblyName) const;
- bool IsDisableNativeImageLoadListNonEmpty() const { LIMITED_METHOD_CONTRACT; return (pDisableNativeImageLoadList != NULL); }
-#endif
LPCWSTR ZapSet() const { LIMITED_METHOD_CONTRACT; return pZapSet; }
@@ -1122,16 +1117,6 @@ private: //----------------------------------------------------------------
AssemblyNamesList * pForbidZapsExcludeList;
#endif
-#ifdef _TARGET_AMD64_
- // Assemblies for which we will not load a native image. This is from the COMPlus_DisableNativeImageLoadList
- // variable / reg key. It performs the same function as the config file key "<disableNativeImageLoad>" (except
- // that is it just a list of assembly names, which the config file key can specify full assembly identities).
- // This was added to support COMPlus_UseLegacyJit, to support the rollout of RyuJIT to replace JIT64, where
- // the user can cause the CLR to fall back to JIT64 for JITting but not for NGEN. This allows the user to
- // force JITting for a specified list of NGEN assemblies.
- AssemblyNamesList * pDisableNativeImageLoadList;
-#endif
-
LPCWSTR pZapSet;
bool fNgenBindOptimizeNonGac;
diff --git a/src/vm/eepolicy.cpp b/src/vm/eepolicy.cpp
index be5fa00ee5..6bd389f579 100644
--- a/src/vm/eepolicy.cpp
+++ b/src/vm/eepolicy.cpp
@@ -1105,6 +1105,98 @@ void EEPolicy::HandleExitProcess(ShutdownCompleteAction sca)
HandleExitProcessHelper(action, 0, sca);
}
+StackWalkAction LogCallstackForLogCallback(
+ CrawlFrame *pCF, //
+ VOID* pData // Caller's private data
+)
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_TRIGGERS;
+ SO_INTOLERANT;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ SmallStackSString *pWordAt = ((SmallStackSString*)pData);
+
+ MethodDesc *pMD = pCF->GetFunction();
+ _ASSERTE(pMD != NULL);
+
+ StackSString str;
+ str = *pWordAt;
+
+ TypeString::AppendMethodInternal(str, pMD, TypeString::FormatNamespace|TypeString::FormatFullInst|TypeString::FormatSignature);
+ PrintToStdErrW(str.GetUnicode());
+ PrintToStdErrA("\n");
+
+ return SWA_CONTINUE;
+}
+
+//---------------------------------------------------------------------------------------
+//
+// A worker to save managed stack trace.
+//
+// Arguments:
+// reporter - EventReporter object for EventLog
+//
+// Return Value:
+// None
+//
+inline void LogCallstackForLogWorker()
+{
+ Thread* pThread = GetThread();
+ _ASSERTE (pThread);
+
+ SmallStackSString WordAt;
+
+ if (!WordAt.LoadResource(CCompRC::Optional, IDS_ER_WORDAT))
+ {
+ WordAt.Set(W(" at"));
+ }
+ else
+ {
+ WordAt.Insert(WordAt.Begin(), W(" "));
+ }
+ WordAt += W(" ");
+
+ pThread->StackWalkFrames(&LogCallstackForLogCallback, &WordAt, QUICKUNWIND | FUNCTIONSONLY);
+}
+
+//---------------------------------------------------------------------------------------
+//
+// Generate an EventLog entry for unhandled exception.
+//
+// Arguments:
+// pExceptionInfo - Exception information
+//
+// Return Value:
+// None
+//
+inline void DoLogForFailFastException(LPCWSTR pszMessage, PEXCEPTION_POINTERS pExceptionInfo)
+{
+ WRAPPER_NO_CONTRACT;
+
+ Thread *pThread = GetThread();
+ EX_TRY
+ {
+ PrintToStdErrA("FailFast: ");
+ PrintToStdErrW((WCHAR*)pszMessage);
+ PrintToStdErrA("\n");
+
+ if (pThread)
+ {
+ PrintToStdErrA("\n");
+ LogCallstackForLogWorker();
+ }
+ }
+ EX_CATCH
+ {
+ }
+ EX_END_CATCH(SwallowAllExceptions)
+}
+
//
// Log an error to the event log if possible, then throw up a dialog box.
//
@@ -1117,6 +1209,12 @@ void EEPolicy::LogFatalError(UINT exitCode, UINT_PTR address, LPCWSTR pszMessage
_ASSERTE(pExceptionInfo != NULL);
+ // Log FailFast exception to StdErr
+ if (exitCode == (UINT)COR_E_FAILFAST)
+ {
+ DoLogForFailFastException(pszMessage, pExceptionInfo);
+ }
+
if(ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_Context, FailFast))
{
// Fire an ETW FailFast event
diff --git a/src/vm/eetoprofinterfaceimpl.cpp b/src/vm/eetoprofinterfaceimpl.cpp
index ca35717bec..75f4a02af2 100644
--- a/src/vm/eetoprofinterfaceimpl.cpp
+++ b/src/vm/eetoprofinterfaceimpl.cpp
@@ -415,6 +415,7 @@ EEToProfInterfaceImpl::EEToProfInterfaceImpl() :
m_pCallback6(NULL),
m_pCallback7(NULL),
m_pCallback8(NULL),
+ m_pCallback9(NULL),
m_hmodProfilerDLL(NULL),
m_fLoadedViaAttach(FALSE),
m_pProfToEE(NULL),
@@ -665,21 +666,25 @@ HRESULT EEToProfInterfaceImpl::CreateProfiler(
m_hmodProfilerDLL = hmodProfilerDLL.Extract();
hmodProfilerDLL = NULL;
- // The profiler may optionally support ICorProfilerCallback3,4,5,6,7,8. Let's check.
+ // The profiler may optionally support ICorProfilerCallback3,4,5,6,7,8,9. Let's check.
- ReleaseHolder<ICorProfilerCallback8> pCallback8;
+ ReleaseHolder<ICorProfilerCallback9> pCallback9;
hr = m_pCallback2->QueryInterface(
- IID_ICorProfilerCallback8,
- (LPVOID *)&pCallback8);
- if (SUCCEEDED(hr) && (pCallback8 != NULL))
+ IID_ICorProfilerCallback9,
+ (LPVOID *)&pCallback9);
+ if (SUCCEEDED(hr) && (pCallback9 != NULL))
{
// Nifty. Transfer ownership to this class
- _ASSERTE(m_pCallback8 == NULL);
- m_pCallback8 = pCallback8.Extract();
- pCallback8 = NULL;
+ _ASSERTE(m_pCallback9 == NULL);
+ m_pCallback9 = pCallback9.Extract();
+ pCallback9 = NULL;
- // And while we're at it, we must now also have an ICorProfilerCallback3,4,5,6,7
+ // And while we're at it, we must now also have an ICorProfilerCallback3,4,5,6,7,8
// due to inheritance relationship of the interfaces
+ _ASSERTE(m_pCallback8 == NULL);
+ m_pCallback8 = static_cast<ICorProfilerCallback8 *>(m_pCallback9);
+ m_pCallback8->AddRef();
+
_ASSERTE(m_pCallback7 == NULL);
m_pCallback7 = static_cast<ICorProfilerCallback7 *>(m_pCallback8);
m_pCallback7->AddRef();
@@ -701,6 +706,44 @@ HRESULT EEToProfInterfaceImpl::CreateProfiler(
m_pCallback3->AddRef();
}
+ if (m_pCallback8 == NULL)
+ {
+ ReleaseHolder<ICorProfilerCallback8> pCallback8;
+ hr = m_pCallback2->QueryInterface(
+ IID_ICorProfilerCallback8,
+ (LPVOID *)&pCallback8);
+ if (SUCCEEDED(hr) && (pCallback8 != NULL))
+ {
+ // Nifty. Transfer ownership to this class
+ _ASSERTE(m_pCallback8 == NULL);
+ m_pCallback8 = pCallback8.Extract();
+ pCallback8 = NULL;
+
+ // And while we're at it, we must now also have an ICorProfilerCallback3,4,5,6,7
+ // due to inheritance relationship of the interfaces
+
+ _ASSERTE(m_pCallback7 == NULL);
+ m_pCallback7 = static_cast<ICorProfilerCallback7 *>(m_pCallback8);
+ m_pCallback7->AddRef();
+
+ _ASSERTE(m_pCallback6 == NULL);
+ m_pCallback6 = static_cast<ICorProfilerCallback6 *>(m_pCallback7);
+ m_pCallback6->AddRef();
+
+ _ASSERTE(m_pCallback5 == NULL);
+ m_pCallback5 = static_cast<ICorProfilerCallback5 *>(m_pCallback6);
+ m_pCallback5->AddRef();
+
+ _ASSERTE(m_pCallback4 == NULL);
+ m_pCallback4 = static_cast<ICorProfilerCallback4 *>(m_pCallback5);
+ m_pCallback4->AddRef();
+
+ _ASSERTE(m_pCallback3 == NULL);
+ m_pCallback3 = static_cast<ICorProfilerCallback3 *>(m_pCallback4);
+ m_pCallback3->AddRef();
+ }
+ }
+
if (m_pCallback7 == NULL)
{
ReleaseHolder<ICorProfilerCallback7> pCallback7;
@@ -3218,6 +3261,38 @@ HRESULT EEToProfInterfaceImpl::JITCompilationStarted(FunctionID functionId,
}
}
+HRESULT EEToProfInterfaceImpl::DynamicMethodUnloaded(FunctionID functionId)
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_TRIGGERS;
+ MODE_COOPERATIVE; // RuntimeMethodHandle::Destroy (the caller) moves from QCALL to GCX_COOP
+ CAN_TAKE_LOCK;
+ SO_TOLERANT;
+ }
+ CONTRACTL_END;
+
+ CLR_TO_PROFILER_ENTRYPOINT((LF_CORPROF,
+ LL_INFO1000,
+ "**PROF: DynamicMethodUnloaded 0x%p.\n",
+ functionId));
+
+ _ASSERTE(functionId);
+
+ if (m_pCallback9 == NULL)
+ {
+ return S_OK;
+ }
+
+ {
+ // All callbacks are really NOTHROW, but that's enforced partially by the profiler,
+ // whose try/catch blocks aren't visible to the contract system
+ PERMANENT_CONTRACT_VIOLATION(ThrowsViolation, ReasonProfilerCallout);
+ return m_pCallback9->DynamicMethodUnloaded(functionId);
+ }
+}
+
HRESULT EEToProfInterfaceImpl::DynamicMethodJITCompilationFinished(FunctionID functionId,
HRESULT hrStatus,
BOOL fIsSafeToBlock)
diff --git a/src/vm/eetoprofinterfaceimpl.h b/src/vm/eetoprofinterfaceimpl.h
index 76797fcc26..63d1cadfbb 100644
--- a/src/vm/eetoprofinterfaceimpl.h
+++ b/src/vm/eetoprofinterfaceimpl.h
@@ -181,7 +181,10 @@ public:
FunctionID functionId,
HRESULT hrStatus,
BOOL fIsSafeToBlock);
-
+
+ HRESULT DynamicMethodUnloaded(
+ FunctionID functionId);
+
HRESULT JITCachedFunctionSearchStarted(
/* [in] */ FunctionID functionId,
/* [out] */ BOOL * pbUseCachedFunction);
@@ -541,7 +544,7 @@ private:
// Pointer to the profiler's implementation of the callback interface(s).
// Profilers MUST support ICorProfilerCallback2.
- // Profilers MAY optionally support ICorProfilerCallback3,4,5,6,7,8
+ // Profilers MAY optionally support ICorProfilerCallback3,4,5,6,7,8,9
ICorProfilerCallback2 * m_pCallback2;
ICorProfilerCallback3 * m_pCallback3;
ICorProfilerCallback4 * m_pCallback4;
@@ -549,6 +552,8 @@ private:
ICorProfilerCallback6 * m_pCallback6;
ICorProfilerCallback7 * m_pCallback7;
ICorProfilerCallback8 * m_pCallback8;
+ ICorProfilerCallback9 * m_pCallback9;
+
HMODULE m_hmodProfilerDLL;
BOOL m_fLoadedViaAttach;
diff --git a/src/vm/eventpipe.cpp b/src/vm/eventpipe.cpp
index 98d382ea17..e041615efc 100644
--- a/src/vm/eventpipe.cpp
+++ b/src/vm/eventpipe.cpp
@@ -4,21 +4,58 @@
#include "common.h"
#include "eventpipe.h"
+#include "eventpipebuffermanager.h"
+#include "eventpipeconfiguration.h"
+#include "eventpipeevent.h"
+#include "eventpipefile.h"
+#include "eventpipeprovider.h"
#include "eventpipejsonfile.h"
#include "sampleprofiler.h"
-CrstStatic EventPipe::s_initCrst;
+#ifdef FEATURE_PAL
+#include "pal.h"
+#endif // FEATURE_PAL
+
+#ifdef FEATURE_PERFTRACING
+
+CrstStatic EventPipe::s_configCrst;
bool EventPipe::s_tracingInitialized = false;
-bool EventPipe::s_tracingEnabled = false;
+EventPipeConfiguration* EventPipe::s_pConfig = NULL;
+EventPipeBufferManager* EventPipe::s_pBufferManager = NULL;
+EventPipeFile* EventPipe::s_pFile = NULL;
+#ifdef _DEBUG
+EventPipeFile* EventPipe::s_pSyncFile = NULL;
EventPipeJsonFile* EventPipe::s_pJsonFile = NULL;
+#endif // _DEBUG
+
+#ifdef FEATURE_PAL
+// This function is auto-generated from /src/scripts/genEventPipe.py
+extern "C" void InitProvidersAndEvents();
+#endif
+
+#ifdef FEATURE_PAL
+// This function is auto-generated from /src/scripts/genEventPipe.py
+extern "C" void InitProvidersAndEvents();
+#endif
void EventPipe::Initialize()
{
STANDARD_VM_CONTRACT;
- s_tracingInitialized = s_initCrst.InitNoThrow(
+ s_tracingInitialized = s_configCrst.InitNoThrow(
CrstEventPipe,
- (CrstFlags)(CRST_TAKEN_DURING_SHUTDOWN));
+ (CrstFlags)(CRST_REENTRANCY | CRST_TAKEN_DURING_SHUTDOWN));
+
+ s_pConfig = new EventPipeConfiguration();
+ s_pConfig->Initialize();
+
+ s_pBufferManager = new EventPipeBufferManager();
+
+#ifdef FEATURE_PAL
+ // This calls into auto-generated code to initialize the runtime providers
+ // and events so that the EventPipe configuration lock isn't taken at runtime
+ InitProvidersAndEvents();
+#endif
}
void EventPipe::EnableOnStartup()
@@ -32,9 +69,15 @@ void EventPipe::EnableOnStartup()
CONTRACTL_END;
// Test COMPLUS variable to enable tracing at start-up.
- if(CLRConfig::GetConfigValue(CLRConfig::INTERNAL_PerformanceTracing) != 0)
+ if((CLRConfig::GetConfigValue(CLRConfig::INTERNAL_PerformanceTracing) & 1) == 1)
{
- Enable();
+ SString outputPath;
+ outputPath.Printf("Process-%d.netperf", GetCurrentProcessId());
+ Enable(
+ outputPath.GetUnicode(),
+ 1024 /* 1 GB circular buffer */,
+ NULL /* pProviders */,
+ 0 /* numProviders */);
}
}
@@ -49,9 +92,24 @@ void EventPipe::Shutdown()
CONTRACTL_END;
Disable();
+
+ if(s_pConfig != NULL)
+ {
+ delete(s_pConfig);
+ s_pConfig = NULL;
+ }
+ if(s_pBufferManager != NULL)
+ {
+ delete(s_pBufferManager);
+ s_pBufferManager = NULL;
+ }
}
-void EventPipe::Enable()
+void EventPipe::Enable(
+ LPCWSTR strOutputPath,
+ uint circularBufferSizeInMB,
+ EventPipeProviderConfiguration *pProviders,
+ int numProviders)
{
CONTRACTL
{
@@ -61,22 +119,38 @@ void EventPipe::Enable()
}
CONTRACTL_END;
- if(!s_tracingInitialized)
+ // If tracing is not initialized or is already enabled, bail here.
+ if(!s_tracingInitialized || s_pConfig->Enabled())
{
return;
}
- // Take the lock and enable tracing.
- CrstHolder _crst(&s_initCrst);
- s_tracingEnabled = true;
- if(CLRConfig::GetConfigValue(CLRConfig::INTERNAL_PerformanceTracing) == 2)
+ // Take the lock before enabling tracing.
+ CrstHolder _crst(GetLock());
+
+ // Create the event pipe file.
+ SString eventPipeFileOutputPath(strOutputPath);
+ s_pFile = new EventPipeFile(eventPipeFileOutputPath);
+
+#ifdef _DEBUG
+ if((CLRConfig::GetConfigValue(CLRConfig::INTERNAL_PerformanceTracing) & 2) == 2)
{
- // File placed in current working directory.
+ // Create a synchronous file.
+ SString eventPipeSyncFileOutputPath;
+ eventPipeSyncFileOutputPath.Printf("Process-%d.sync.netperf", GetCurrentProcessId());
+ s_pSyncFile = new EventPipeFile(eventPipeSyncFileOutputPath);
+
+ // Create a JSON file.
SString outputFilePath;
outputFilePath.Printf("Process-%d.PerfView.json", GetCurrentProcessId());
s_pJsonFile = new EventPipeJsonFile(outputFilePath);
}
+#endif // _DEBUG
+ // Enable tracing.
+ s_pConfig->Enable(circularBufferSizeInMB, pProviders, numProviders);
+
+ // Enable the sample profiler
SampleProfiler::Enable();
}
@@ -90,76 +164,246 @@ void EventPipe::Disable()
}
CONTRACTL_END;
- CrstHolder _crst(&s_initCrst);
- s_tracingEnabled = false;
- SampleProfiler::Disable();
+ // Don't block GC during clean-up.
+ GCX_PREEMP();
+
+ // Take the lock before disabling tracing.
+ CrstHolder _crst(GetLock());
+
+ if(s_pConfig->Enabled())
+ {
+ // Disable the profiler.
+ SampleProfiler::Disable();
+
+ // Disable tracing.
+ s_pConfig->Disable();
+
+ // Flush all write buffers to make sure that all threads see the change.
+ FlushProcessWriteBuffers();
+
+ // Write to the file.
+ LARGE_INTEGER disableTimeStamp;
+ QueryPerformanceCounter(&disableTimeStamp);
+ s_pBufferManager->WriteAllBuffersToFile(s_pFile, disableTimeStamp);
+
+ // Before closing the file, do rundown.
+ s_pConfig->EnableRundown();
+
+ // Ask the runtime to emit rundown events.
+ if(g_fEEStarted && !g_fEEShutDown)
+ {
+ ETW::EnumerationLog::EndRundown();
+ }
+
+ // Disable the event pipe now that rundown is complete.
+ s_pConfig->Disable();
+
+ if(s_pFile != NULL)
+ {
+ delete(s_pFile);
+ s_pFile = NULL;
+ }
+#ifdef _DEBUG
+ if(s_pSyncFile != NULL)
+ {
+ delete(s_pSyncFile);
+ s_pSyncFile = NULL;
+ }
+ if(s_pJsonFile != NULL)
+ {
+ delete(s_pJsonFile);
+ s_pJsonFile = NULL;
+ }
+#endif // _DEBUG
+
+ // De-allocate buffers.
+ s_pBufferManager->DeAllocateBuffers();
+
+ // Delete deferred providers.
+ // Providers can't be deleted during tracing because they may be needed when serializing the file.
+ s_pConfig->DeleteDeferredProviders();
+ }
+}
- if(s_pJsonFile != NULL)
+bool EventPipe::Enabled()
+{
+ LIMITED_METHOD_CONTRACT;
+
+ bool enabled = false;
+ if(s_pConfig != NULL)
{
- delete(s_pJsonFile);
- s_pJsonFile = NULL;
+ enabled = s_pConfig->Enabled();
}
+
+ return enabled;
}
-bool EventPipe::EventEnabled(GUID& providerID, INT64 keyword)
+EventPipeProvider* EventPipe::CreateProvider(const GUID &providerID, EventPipeCallback pCallbackFunction, void *pCallbackData)
{
CONTRACTL
{
- NOTHROW;
- GC_NOTRIGGER;
+ THROWS;
+ GC_TRIGGERS;
MODE_ANY;
}
CONTRACTL_END;
- // TODO: Implement filtering.
- return false;
+ return new EventPipeProvider(providerID, pCallbackFunction, pCallbackData);
}
-void EventPipe::WriteEvent(GUID& providerID, INT64 eventID, BYTE *pData, size_t length, bool sampleStack)
+void EventPipe::DeleteProvider(EventPipeProvider *pProvider)
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_TRIGGERS;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ // Take the lock to make sure that we don't have a race
+ // between disabling tracing and deleting a provider
+ // where we hold a provider after tracing has been disabled.
+ CrstHolder _crst(GetLock());
+
+ if(pProvider != NULL)
+ {
+ if(Enabled())
+ {
+ // Save the provider until the end of the tracing session.
+ pProvider->SetDeleteDeferred();
+ }
+ else
+ {
+ // Delete the provider now.
+ // NOTE: This will remove it from all of the EventPipe data structures.
+ delete(pProvider);
+ }
+ }
+}
+
+void EventPipe::WriteEvent(EventPipeEvent &event, BYTE *pData, unsigned int length, LPCGUID pActivityId, LPCGUID pRelatedActivityId)
{
CONTRACTL
{
NOTHROW;
GC_NOTRIGGER;
MODE_ANY;
+ PRECONDITION(s_pBufferManager != NULL);
}
CONTRACTL_END;
- StackContents stackContents;
- bool stackWalkSucceeded;
+ // Exit early if the event is not enabled.
+ if(!event.IsEnabled())
+ {
+ return;
+ }
- if(sampleStack)
+ // Get the current thread;
+ Thread *pThread = GetThread();
+ if(pThread == NULL)
{
- stackWalkSucceeded = WalkManagedStackForCurrentThread(stackContents);
+ // We can't write an event without the thread object.
+ return;
}
- // TODO: Write the event.
+ if(!s_pConfig->RundownEnabled() && s_pBufferManager != NULL)
+ {
+ if(!s_pBufferManager->WriteEvent(pThread, event, pData, length, pActivityId, pRelatedActivityId))
+ {
+ // This is used in DEBUG to make sure that we don't log an event synchronously that we didn't log to the buffer.
+ return;
+ }
+ }
+ else if(s_pConfig->RundownEnabled())
+ {
+ // Write synchronously to the file.
+ // We're under lock and blocking the disabling thread.
+ EventPipeEventInstance instance(
+ event,
+ pThread->GetOSThreadId(),
+ pData,
+ length,
+ pActivityId,
+ pRelatedActivityId);
+
+ if(s_pFile != NULL)
+ {
+ s_pFile->WriteEvent(instance);
+ }
+ }
+
+#ifdef _DEBUG
+ {
+ GCX_PREEMP();
+
+ // Create an instance of the event for the synchronous path.
+ EventPipeEventInstance instance(
+ event,
+ pThread->GetOSThreadId(),
+ pData,
+ length,
+ pActivityId,
+ pRelatedActivityId);
+
+ // Write to the EventPipeFile if it exists.
+ if(s_pSyncFile != NULL)
+ {
+ s_pSyncFile->WriteEvent(instance);
+ }
+
+ // Write to the EventPipeJsonFile if it exists.
+ if(s_pJsonFile != NULL)
+ {
+ s_pJsonFile->WriteEvent(instance);
+ }
+ }
+#endif // _DEBUG
}
-void EventPipe::WriteSampleProfileEvent(Thread *pThread, StackContents &stackContents)
+void EventPipe::WriteSampleProfileEvent(Thread *pSamplingThread, EventPipeEvent *pEvent, Thread *pTargetThread, StackContents &stackContents, BYTE *pData, unsigned int length)
{
CONTRACTL
{
NOTHROW;
GC_TRIGGERS;
MODE_PREEMPTIVE;
- PRECONDITION(pThread != NULL);
}
CONTRACTL_END;
- EX_TRY
+ // Write the event to the thread's buffer.
+ if(s_pBufferManager != NULL)
{
- if(s_pJsonFile != NULL)
+ // Specify the sampling thread as the "current thread", so that we select the right buffer.
+ // Specify the target thread so that the event gets properly attributed.
+ if(!s_pBufferManager->WriteEvent(pSamplingThread, *pEvent, pData, length, NULL /* pActivityId */, NULL /* pRelatedActivityId */, pTargetThread, &stackContents))
{
- CommonEventFields eventFields;
- QueryPerformanceCounter(&eventFields.TimeStamp);
- eventFields.ThreadID = pThread->GetOSThreadId();
+ // This is used in DEBUG to make sure that we don't log an event synchronously that we didn't log to the buffer.
+ return;
+ }
+ }
+
+#ifdef _DEBUG
+ {
+ GCX_PREEMP();
+
+ // Create an instance for the synchronous path.
+ SampleProfilerEventInstance instance(*pEvent, pTargetThread, pData, length);
+ stackContents.CopyTo(instance.GetStack());
- static SString message(W("THREAD_TIME"));
- s_pJsonFile->WriteEvent(eventFields, message, stackContents);
+ // Write to the EventPipeFile.
+ if(s_pSyncFile != NULL)
+ {
+ s_pSyncFile->WriteEvent(instance);
+ }
+
+ // Write to the EventPipeJsonFile if it exists.
+ if(s_pJsonFile != NULL)
+ {
+ s_pJsonFile->WriteEvent(instance);
}
}
- EX_CATCH{} EX_END_CATCH(SwallowAllExceptions);
+#endif // _DEBUG
}
bool EventPipe::WalkManagedStackForCurrentThread(StackContents &stackContents)
@@ -173,8 +417,12 @@ bool EventPipe::WalkManagedStackForCurrentThread(StackContents &stackContents)
CONTRACTL_END;
Thread *pThread = GetThread();
- _ASSERTE(pThread != NULL);
- return WalkManagedStackForThread(pThread, stackContents);
+ if(pThread != NULL)
+ {
+ return WalkManagedStackForThread(pThread, stackContents);
+ }
+
+ return false;
}
bool EventPipe::WalkManagedStackForThread(Thread *pThread, StackContents &stackContents)
@@ -232,3 +480,119 @@ StackWalkAction EventPipe::StackWalkCallback(CrawlFrame *pCf, StackContents *pDa
// Continue the stack walk.
return SWA_CONTINUE;
}
+
+EventPipeConfiguration* EventPipe::GetConfiguration()
+{
+ LIMITED_METHOD_CONTRACT;
+
+ return s_pConfig;
+}
+
+CrstStatic* EventPipe::GetLock()
+{
+ LIMITED_METHOD_CONTRACT;
+
+ return &s_configCrst;
+}
+
+void QCALLTYPE EventPipeInternal::Enable(
+ __in_z LPCWSTR outputFile,
+ unsigned int circularBufferSizeInMB,
+ long profilerSamplingRateInNanoseconds,
+ EventPipeProviderConfiguration *pProviders,
+ int numProviders)
+{
+ QCALL_CONTRACT;
+
+ BEGIN_QCALL;
+ SampleProfiler::SetSamplingRate(profilerSamplingRateInNanoseconds);
+ EventPipe::Enable(outputFile, circularBufferSizeInMB, pProviders, numProviders);
+ END_QCALL;
+}
+
+void QCALLTYPE EventPipeInternal::Disable()
+{
+ QCALL_CONTRACT;
+
+ BEGIN_QCALL;
+ EventPipe::Disable();
+ END_QCALL;
+}
+
+INT_PTR QCALLTYPE EventPipeInternal::CreateProvider(
+ GUID providerID,
+ EventPipeCallback pCallbackFunc)
+{
+ QCALL_CONTRACT;
+
+ EventPipeProvider *pProvider = NULL;
+
+ BEGIN_QCALL;
+
+ pProvider = EventPipe::CreateProvider(providerID, pCallbackFunc, NULL);
+
+ END_QCALL;
+
+ return reinterpret_cast<INT_PTR>(pProvider);
+}
+
+INT_PTR QCALLTYPE EventPipeInternal::DefineEvent(
+ INT_PTR provHandle,
+ unsigned int eventID,
+ __int64 keywords,
+ unsigned int eventVersion,
+ unsigned int level,
+ void *pMetadata,
+ unsigned int metadataLength)
+{
+ QCALL_CONTRACT;
+
+ EventPipeEvent *pEvent = NULL;
+
+ BEGIN_QCALL;
+
+ _ASSERTE(provHandle != NULL);
+ _ASSERTE(pMetadata != NULL);
+ EventPipeProvider *pProvider = reinterpret_cast<EventPipeProvider *>(provHandle);
+ pEvent = pProvider->AddEvent(eventID, keywords, eventVersion, (EventPipeEventLevel)level, (BYTE *)pMetadata, metadataLength);
+ _ASSERTE(pEvent != NULL);
+
+ END_QCALL;
+
+ return reinterpret_cast<INT_PTR>(pEvent);
+}
+
+void QCALLTYPE EventPipeInternal::DeleteProvider(
+ INT_PTR provHandle)
+{
+ QCALL_CONTRACT;
+ BEGIN_QCALL;
+
+ if(provHandle != NULL)
+ {
+ EventPipeProvider *pProvider = reinterpret_cast<EventPipeProvider*>(provHandle);
+ EventPipe::DeleteProvider(pProvider);
+ }
+
+ END_QCALL;
+}
+
+void QCALLTYPE EventPipeInternal::WriteEvent(
+ INT_PTR eventHandle,
+ unsigned int eventID,
+ void *pData,
+ unsigned int length,
+ LPCGUID pActivityId,
+ LPCGUID pRelatedActivityId)
+{
+ QCALL_CONTRACT;
+ BEGIN_QCALL;
+
+ _ASSERTE(eventHandle != NULL);
+ EventPipeEvent *pEvent = reinterpret_cast<EventPipeEvent *>(eventHandle);
+ EventPipe::WriteEvent(*pEvent, (BYTE *)pData, length, pActivityId, pRelatedActivityId);
+
+ END_QCALL;
+}
+
+#endif // FEATURE_PERFTRACING
diff --git a/src/vm/eventpipe.h b/src/vm/eventpipe.h
index 2978412325..a69e1ba840 100644
--- a/src/vm/eventpipe.h
+++ b/src/vm/eventpipe.h
@@ -5,19 +5,29 @@
#ifndef __EVENTPIPE_H__
#define __EVENTPIPE_H__
-#include "common.h"
+#ifdef FEATURE_PERFTRACING
+class CrstStatic;
+class EventPipeConfiguration;
+class EventPipeEvent;
+class EventPipeFile;
class EventPipeJsonFile;
-
-// The data fields common to every event.
-struct CommonEventFields
-{
- // Timestamp generated by QueryPerformanceCounter.
- LARGE_INTEGER TimeStamp;
-
- // Thread ID.
- DWORD ThreadID;
-};
+class EventPipeBuffer;
+class EventPipeBufferManager;
+class EventPipeProvider;
+class MethodDesc;
+class SampleProfilerEventInstance;
+struct EventPipeProviderConfiguration;
+
+// Define the event pipe callback to match the ETW callback signature.
+typedef void (*EventPipeCallback)(
+ LPCGUID SourceID,
+ ULONG IsEnabled,
+ UCHAR Level,
+ ULONGLONG MatchAnyKeywords,
+ ULONGLONG MatchAllKeywords,
+ void *FilterData,
+ void *CallbackContext);
class StackContents
{
@@ -29,9 +39,11 @@ private:
// Top of stack is at index 0.
UINT_PTR m_stackFrames[MAX_STACK_DEPTH];
+#ifdef _DEBUG
// Parallel array of MethodDesc pointers.
// Used for debug-only stack printing.
MethodDesc* m_methods[MAX_STACK_DEPTH];
+#endif // _DEBUG
// The next available slot in StackFrames.
unsigned int m_nextAvailableFrame;
@@ -45,6 +57,18 @@ public:
Reset();
}
+ void CopyTo(StackContents *pDest)
+ {
+ LIMITED_METHOD_CONTRACT;
+ _ASSERTE(pDest != NULL);
+
+ memcpy_s(pDest->m_stackFrames, MAX_STACK_DEPTH * sizeof(UINT_PTR), m_stackFrames, sizeof(UINT_PTR) * m_nextAvailableFrame);
+#ifdef _DEBUG
+ memcpy_s(pDest->m_methods, MAX_STACK_DEPTH * sizeof(MethodDesc*), m_methods, sizeof(MethodDesc*) * m_nextAvailableFrame);
+#endif
+ pDest->m_nextAvailableFrame = m_nextAvailableFrame;
+ }
+
void Reset()
{
LIMITED_METHOD_CONTRACT;
@@ -79,6 +103,7 @@ public:
return m_stackFrames[frameIndex];
}
+#ifdef _DEBUG
MethodDesc* GetMethod(unsigned int frameIndex)
{
LIMITED_METHOD_CONTRACT;
@@ -91,6 +116,7 @@ public:
return m_methods[frameIndex];
}
+#endif // _DEBUG
void Append(UINT_PTR controlPC, MethodDesc *pMethod)
{
@@ -99,14 +125,37 @@ public:
if(m_nextAvailableFrame < MAX_STACK_DEPTH)
{
m_stackFrames[m_nextAvailableFrame] = controlPC;
+#ifdef _DEBUG
m_methods[m_nextAvailableFrame] = pMethod;
+#endif
m_nextAvailableFrame++;
}
}
+
+ BYTE* GetPointer() const
+ {
+ LIMITED_METHOD_CONTRACT;
+
+ return (BYTE*)m_stackFrames;
+ }
+
+ unsigned int GetSize() const
+ {
+ LIMITED_METHOD_CONTRACT;
+
+ return (m_nextAvailableFrame * sizeof(UINT_PTR));
+ }
};
class EventPipe
{
+ // Declare friends.
+ friend class EventPipeConfiguration;
+ friend class EventPipeFile;
+ friend class EventPipeProvider;
+ friend class EventPipeBufferManager;
+ friend class SampleProfiler;
+
public:
// Initialize the event pipe.
@@ -119,20 +168,30 @@ class EventPipe
static void EnableOnStartup();
// Enable tracing via the event pipe.
- static void Enable();
+ static void Enable(
+ LPCWSTR strOutputPath,
+ uint circularBufferSizeInMB,
+ EventPipeProviderConfiguration *pProviders,
+ int numProviders);
// Disable tracing via the event pipe.
static void Disable();
- // Determine whether or not the specified provider/keyword combination is enabled.
- static bool EventEnabled(GUID& providerID, INT64 keyword);
+ // Specifies whether or not the event pipe is enabled.
+ static bool Enabled();
+
+ // Create a provider.
+ static EventPipeProvider* CreateProvider(const GUID &providerID, EventPipeCallback pCallbackFunction = NULL, void *pCallbackData = NULL);
- // Write out an event. The event is identified by the providerID/eventID pair.
+ // Delete a provider.
+ static void DeleteProvider(EventPipeProvider *pProvider);
+
+ // Write out an event.
// Data is written as a serialized blob matching the ETW serialization conventions.
- static void WriteEvent(GUID& providerID, INT64 eventID, BYTE *pData, size_t length, bool sampleStack);
+ static void WriteEvent(EventPipeEvent &event, BYTE *pData, unsigned int length, LPCGUID pActivityId = NULL, LPCGUID pRelatedActivityId = NULL);
- // Write out a sample profile event with the specified stack.
- static void WriteSampleProfileEvent(Thread *pThread, StackContents &stackContents);
+ // Write out a sample profile event.
+ static void WriteSampleProfileEvent(Thread *pSamplingThread, EventPipeEvent *pEvent, Thread *pTargetThread, StackContents &stackContents, BYTE *pData = NULL, unsigned int length = 0);
// Get the managed call stack for the current thread.
static bool WalkManagedStackForCurrentThread(StackContents &stackContents);
@@ -145,10 +204,111 @@ class EventPipe
// Callback function for the stack walker. For each frame walked, this callback is invoked.
static StackWalkAction StackWalkCallback(CrawlFrame *pCf, StackContents *pData);
- static CrstStatic s_initCrst;
+ // Get the configuration object.
+ // This is called directly by the EventPipeProvider constructor to register the new provider.
+ static EventPipeConfiguration* GetConfiguration();
+
+ // Get the event pipe configuration lock.
+ static CrstStatic* GetLock();
+
+ static CrstStatic s_configCrst;
static bool s_tracingInitialized;
- static bool s_tracingEnabled;
+ static EventPipeConfiguration *s_pConfig;
+ static EventPipeBufferManager *s_pBufferManager;
+ static EventPipeFile *s_pFile;
+#ifdef _DEBUG
+ static EventPipeFile *s_pSyncFile;
static EventPipeJsonFile *s_pJsonFile;
+#endif // _DEBUG
};
+struct EventPipeProviderConfiguration
+{
+
+private:
+
+ LPCWSTR m_pProviderName;
+ UINT64 m_keywords;
+ unsigned int m_loggingLevel;
+
+public:
+
+ EventPipeProviderConfiguration()
+ {
+ LIMITED_METHOD_CONTRACT;
+ m_pProviderName = NULL;
+ m_keywords = NULL;
+ m_loggingLevel = 0;
+ }
+
+ EventPipeProviderConfiguration(
+ LPCWSTR pProviderName,
+ UINT64 keywords,
+ unsigned int loggingLevel)
+ {
+ LIMITED_METHOD_CONTRACT;
+ m_pProviderName = pProviderName;
+ m_keywords = keywords;
+ m_loggingLevel = loggingLevel;
+ }
+
+ LPCWSTR GetProviderName() const
+ {
+ LIMITED_METHOD_CONTRACT;
+ return m_pProviderName;
+ }
+
+ UINT64 GetKeywords() const
+ {
+ LIMITED_METHOD_CONTRACT;
+ return m_keywords;
+ }
+
+ unsigned int GetLevel() const
+ {
+ LIMITED_METHOD_CONTRACT;
+ return m_loggingLevel;
+ }
+};
+
+class EventPipeInternal
+{
+
+public:
+
+ static void QCALLTYPE Enable(
+ __in_z LPCWSTR outputFile,
+ unsigned int circularBufferSizeInMB,
+ long profilerSamplingRateInNanoseconds,
+ EventPipeProviderConfiguration *pProviders,
+ int numProviders);
+
+ static void QCALLTYPE Disable();
+
+ static INT_PTR QCALLTYPE CreateProvider(
+ GUID providerID,
+ EventPipeCallback pCallbackFunc);
+
+ static INT_PTR QCALLTYPE DefineEvent(
+ INT_PTR provHandle,
+ unsigned int eventID,
+ __int64 keywords,
+ unsigned int eventVersion,
+ unsigned int level,
+ void *pMetadata,
+ unsigned int metadataLength);
+
+ static void QCALLTYPE DeleteProvider(
+ INT_PTR provHandle);
+
+ static void QCALLTYPE WriteEvent(
+ INT_PTR eventHandle,
+ unsigned int eventID,
+ void *pData,
+ unsigned int length,
+ LPCGUID pActivityId, LPCGUID pRelatedActivityId);
+};
+
+#endif // FEATURE_PERFTRACING
+
#endif // __EVENTPIPE_H__
diff --git a/src/vm/eventpipebuffer.cpp b/src/vm/eventpipebuffer.cpp
new file mode 100644
index 0000000000..00652c9fac
--- /dev/null
+++ b/src/vm/eventpipebuffer.cpp
@@ -0,0 +1,281 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+
+#include "common.h"
+#include "eventpipeeventinstance.h"
+#include "eventpipebuffer.h"
+
+#ifdef FEATURE_PERFTRACING
+
+EventPipeBuffer::EventPipeBuffer(unsigned int bufferSize)
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ m_pBuffer = new BYTE[bufferSize];
+ memset(m_pBuffer, 0, bufferSize);
+ m_pCurrent = m_pBuffer;
+ m_pLimit = m_pBuffer + bufferSize;
+
+ m_mostRecentTimeStamp.QuadPart = 0;
+ m_pLastPoppedEvent = NULL;
+ m_pPrevBuffer = NULL;
+ m_pNextBuffer = NULL;
+}
+
+EventPipeBuffer::~EventPipeBuffer()
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ if(m_pBuffer != NULL)
+ {
+ delete[] m_pBuffer;
+ }
+}
+
+bool EventPipeBuffer::WriteEvent(Thread *pThread, EventPipeEvent &event, BYTE *pData, unsigned int dataLength, LPCGUID pActivityId, LPCGUID pRelatedActivityId, StackContents *pStack)
+{
+ CONTRACTL
+ {
+ NOTHROW;
+ GC_TRIGGERS;
+ MODE_ANY;
+ PRECONDITION(pThread != NULL);
+ }
+ CONTRACTL_END;
+
+ // Calculate the size of the event.
+ unsigned int eventSize = sizeof(EventPipeEventInstance) + dataLength;
+
+ // Make sure we have enough space to write the event.
+ if(m_pCurrent + eventSize >= m_pLimit)
+ {
+ return false;
+ }
+
+ // Calculate the location of the data payload.
+ BYTE *pDataDest = m_pCurrent + sizeof(EventPipeEventInstance);
+
+ bool success = true;
+ EX_TRY
+ {
+ // Placement-new the EventPipeEventInstance.
+ EventPipeEventInstance *pInstance = new (m_pCurrent) EventPipeEventInstance(
+ event,
+ pThread->GetOSThreadId(),
+ pDataDest,
+ dataLength,
+ pActivityId,
+ pRelatedActivityId);
+
+ // Copy the stack if a separate stack trace was provided.
+ if(pStack != NULL)
+ {
+ StackContents *pInstanceStack = pInstance->GetStack();
+ pStack->CopyTo(pInstanceStack);
+ }
+
+ // Write the event payload data to the buffer.
+ if(dataLength > 0)
+ {
+ memcpy(pDataDest, pData, dataLength);
+ }
+
+ // Save the most recent event timestamp.
+ m_mostRecentTimeStamp = pInstance->GetTimeStamp();
+
+ }
+ EX_CATCH
+ {
+ // If a failure occurs, bail out and don't advance the pointer.
+ success = false;
+ }
+ EX_END_CATCH(SwallowAllExceptions);
+
+ if(success)
+ {
+ // Advance the current pointer past the event.
+ m_pCurrent += eventSize;
+ }
+
+ return success;
+}
+
+LARGE_INTEGER EventPipeBuffer::GetMostRecentTimeStamp() const
+{
+ LIMITED_METHOD_CONTRACT;
+
+ return m_mostRecentTimeStamp;
+}
+
+void EventPipeBuffer::Clear()
+{
+ CONTRACTL
+ {
+ NOTHROW;
+ GC_TRIGGERS;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ memset(m_pBuffer, 0, (size_t)(m_pLimit - m_pBuffer));
+ m_pCurrent = m_pBuffer;
+ m_mostRecentTimeStamp.QuadPart = 0;
+ m_pLastPoppedEvent = NULL;
+}
+
+EventPipeEventInstance* EventPipeBuffer::GetNext(EventPipeEventInstance *pEvent, LARGE_INTEGER beforeTimeStamp)
+{
+ CONTRACTL
+ {
+ NOTHROW;
+ GC_TRIGGERS;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ EventPipeEventInstance *pNextInstance = NULL;
+ // If input is NULL, return the first event if there is one.
+ if(pEvent == NULL)
+ {
+ // If this buffer contains an event, select it.
+ if(m_pCurrent > m_pBuffer)
+ {
+ pNextInstance = (EventPipeEventInstance*)m_pBuffer;
+ }
+ else
+ {
+ return NULL;
+ }
+ }
+ else
+ {
+ // Confirm that pEvent is within the used range of the buffer.
+ if(((BYTE*)pEvent < m_pBuffer) || ((BYTE*)pEvent >= m_pCurrent))
+ {
+ _ASSERT(!"Input pointer is out of range.");
+ return NULL;
+ }
+
+ // We have a pointer within the bounds of the buffer.
+ // Find the next event by skipping the current event with it's data payload immediately after the instance.
+ pNextInstance = (EventPipeEventInstance *)(pEvent->GetData() + pEvent->GetLength());
+
+ // Check to see if we've reached the end of the written portion of the buffer.
+ if((BYTE*)pNextInstance >= m_pCurrent)
+ {
+ return NULL;
+ }
+ }
+
+ // Ensure that the timestamp is valid. The buffer is zero'd before use, so a zero timestamp is invalid.
+ LARGE_INTEGER nextTimeStamp = pNextInstance->GetTimeStamp();
+ if(nextTimeStamp.QuadPart == 0)
+ {
+ return NULL;
+ }
+
+ // Ensure that the timestamp is earlier than the beforeTimeStamp.
+ if(nextTimeStamp.QuadPart >= beforeTimeStamp.QuadPart)
+ {
+ return NULL;
+ }
+
+ return pNextInstance;
+}
+
+EventPipeEventInstance* EventPipeBuffer::PeekNext(LARGE_INTEGER beforeTimeStamp)
+{
+ CONTRACTL
+ {
+ NOTHROW;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ // Get the next event using the last popped event as a marker.
+ return GetNext(m_pLastPoppedEvent, beforeTimeStamp);
+}
+
+EventPipeEventInstance* EventPipeBuffer::PopNext(LARGE_INTEGER beforeTimeStamp)
+{
+ CONTRACTL
+ {
+ NOTHROW;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ // Get the next event using the last popped event as a marker.
+ EventPipeEventInstance *pNext = PeekNext(beforeTimeStamp);
+ if(pNext != NULL)
+ {
+ m_pLastPoppedEvent = pNext;
+ }
+
+ return pNext;
+}
+
+#ifdef _DEBUG
+bool EventPipeBuffer::EnsureConsistency()
+{
+ CONTRACTL
+ {
+ NOTHROW;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ // Check to see if the buffer is empty.
+ if(m_pBuffer == m_pCurrent)
+ {
+ // Make sure that the buffer size is greater than zero.
+ _ASSERTE(m_pBuffer != m_pLimit);
+ }
+
+ // Validate the contents of the filled portion of the buffer.
+ BYTE *ptr = m_pBuffer;
+ while(ptr < m_pCurrent)
+ {
+ // Validate the event.
+ EventPipeEventInstance *pInstance = (EventPipeEventInstance*)ptr;
+ _ASSERTE(pInstance->EnsureConsistency());
+
+ // Validate that payload and length match.
+ _ASSERTE((pInstance->GetData() != NULL && pInstance->GetLength() > 0) || (pInstance->GetData() != NULL && pInstance->GetLength() == 0));
+
+ // Skip the event.
+ ptr += sizeof(*pInstance) + pInstance->GetLength();
+ }
+
+ // When we're done walking the filled portion of the buffer,
+ // ptr should be the same as m_pCurrent.
+ _ASSERTE(ptr == m_pCurrent);
+
+ // Walk the rest of the buffer, making sure it is properly zeroed.
+ while(ptr < m_pLimit)
+ {
+ _ASSERTE(*ptr++ == 0);
+ }
+
+ return true;
+}
+#endif // _DEBUG
+
+#endif // FEATURE_PERFTRACING
diff --git a/src/vm/eventpipebuffer.h b/src/vm/eventpipebuffer.h
new file mode 100644
index 0000000000..f279a2865c
--- /dev/null
+++ b/src/vm/eventpipebuffer.h
@@ -0,0 +1,109 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+#ifndef __EVENTPIPE_BUFFER_H__
+#define __EVENTPIPE_BUFFER_H__
+
+#ifdef FEATURE_PERFTRACING
+
+#include "eventpipeevent.h"
+#include "eventpipeeventinstance.h"
+
+class EventPipeBuffer
+{
+
+ friend class EventPipeBufferList;
+ friend class EventPipeBufferManager;
+
+private:
+
+ // A pointer to the actual buffer.
+ BYTE *m_pBuffer;
+
+ // The current write pointer.
+ BYTE *m_pCurrent;
+
+ // The max write pointer (end of the buffer).
+ BYTE *m_pLimit;
+
+ // The timestamp of the most recent event in the buffer.
+ LARGE_INTEGER m_mostRecentTimeStamp;
+
+ // Used by PopNext as input to GetNext.
+ // If NULL, no events have been popped.
+ // The event will still remain in the buffer after it is popped, but PopNext will not return it again.
+ EventPipeEventInstance *m_pLastPoppedEvent;
+
+ // Each buffer will become part of a per-thread linked list of buffers.
+ // The linked list is invasive, thus we declare the pointers here.
+ EventPipeBuffer *m_pPrevBuffer;
+ EventPipeBuffer *m_pNextBuffer;
+
+ unsigned int GetSize() const
+ {
+ LIMITED_METHOD_CONTRACT;
+ return (unsigned int)(m_pLimit - m_pBuffer);
+ }
+
+ EventPipeBuffer* GetPrevious() const
+ {
+ LIMITED_METHOD_CONTRACT;
+ return m_pPrevBuffer;
+ }
+
+ EventPipeBuffer* GetNext() const
+ {
+ LIMITED_METHOD_CONTRACT;
+ return m_pNextBuffer;
+ }
+
+ void SetPrevious(EventPipeBuffer *pBuffer)
+ {
+ LIMITED_METHOD_CONTRACT;
+ m_pPrevBuffer = pBuffer;
+ }
+
+ void SetNext(EventPipeBuffer *pBuffer)
+ {
+ LIMITED_METHOD_CONTRACT;
+ m_pNextBuffer = pBuffer;
+ }
+
+public:
+
+ EventPipeBuffer(unsigned int bufferSize);
+ ~EventPipeBuffer();
+
+ // Write an event to the buffer.
+ // An optional stack trace can be provided for sample profiler events.
+ // Otherwise, if a stack trace is needed, one will be automatically collected.
+ // Returns:
+ // - true: The write succeeded.
+ // - false: The write failed. In this case, the buffer should be considered full.
+ bool WriteEvent(Thread *pThread, EventPipeEvent &event, BYTE *pData, unsigned int dataLength, LPCGUID pActivityId, LPCGUID pRelatedActivityId, StackContents *pStack = NULL);
+
+ // Get the timestamp of the most recent event in the buffer.
+ LARGE_INTEGER GetMostRecentTimeStamp() const;
+
+ // Clear the buffer.
+ void Clear();
+
+ // Get the next event from the buffer as long as it is before the specified timestamp.
+ // Input of NULL gets the first event.
+ EventPipeEventInstance* GetNext(EventPipeEventInstance *pEvent, LARGE_INTEGER beforeTimeStamp);
+
+ // Get the next event from the buffer, but don't mark it read.
+ EventPipeEventInstance* PeekNext(LARGE_INTEGER beforeTimeStamp);
+
+ // Get the next event from the buffer and mark it as read.
+ EventPipeEventInstance* PopNext(LARGE_INTEGER beforeTimeStamp);
+
+#ifdef _DEBUG
+ bool EnsureConsistency();
+#endif // _DEBUG
+};
+
+#endif // FEATURE_PERFTRACING
+
+#endif // __EVENTPIPE_BUFFER_H__
diff --git a/src/vm/eventpipebuffermanager.cpp b/src/vm/eventpipebuffermanager.cpp
new file mode 100644
index 0000000000..86a3e03c59
--- /dev/null
+++ b/src/vm/eventpipebuffermanager.cpp
@@ -0,0 +1,808 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+#include "common.h"
+#include "eventpipeconfiguration.h"
+#include "eventpipebuffer.h"
+#include "eventpipebuffermanager.h"
+
+#ifdef FEATURE_PERFTRACING
+
+EventPipeBufferManager::EventPipeBufferManager()
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ m_pPerThreadBufferList = new SList<SListElem<EventPipeBufferList*>>();
+ m_sizeOfAllBuffers = 0;
+ m_lock.Init(LOCK_TYPE_DEFAULT);
+
+#ifdef _DEBUG
+ m_numBuffersAllocated = 0;
+ m_numBuffersStolen = 0;
+ m_numBuffersLeaked = 0;
+ m_numEventsStored = 0;
+ m_numEventsWritten = 0;
+#endif // _DEBUG
+}
+
+EventPipeBuffer* EventPipeBufferManager::AllocateBufferForThread(Thread *pThread, unsigned int requestSize)
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ PRECONDITION(pThread != NULL);
+ PRECONDITION(requestSize > 0);
+ }
+ CONTRACTL_END;
+
+ // Allocating a buffer requires us to take the lock.
+ SpinLockHolder _slh(&m_lock);
+
+ // Determine if the requesting thread has at least one buffer.
+ // If not, we guarantee that each thread gets at least one (to prevent thrashing when the circular buffer size is too small).
+ bool allocateNewBuffer = false;
+ EventPipeBufferList *pThreadBufferList = pThread->GetEventPipeBufferList();
+ if(pThreadBufferList == NULL)
+ {
+ pThreadBufferList = new EventPipeBufferList(this);
+ m_pPerThreadBufferList->InsertTail(new SListElem<EventPipeBufferList*>(pThreadBufferList));
+ pThread->SetEventPipeBufferList(pThreadBufferList);
+ allocateNewBuffer = true;
+ }
+
+ // Determine if policy allows us to allocate another buffer, or if we need to steal one
+ // from another thread.
+ if(!allocateNewBuffer)
+ {
+ EventPipeConfiguration *pConfig = EventPipe::GetConfiguration();
+ if(pConfig == NULL)
+ {
+ return NULL;
+ }
+
+ size_t circularBufferSizeInBytes = pConfig->GetCircularBufferSize();
+ if(m_sizeOfAllBuffers < circularBufferSizeInBytes)
+ {
+ // We don't worry about the fact that a new buffer could put us over the circular buffer size.
+ // This is OK, and we won't do it again if we actually go over.
+ allocateNewBuffer = true;
+ }
+ }
+
+ EventPipeBuffer *pNewBuffer = NULL;
+ if(!allocateNewBuffer)
+ {
+ // We can't allocate a new buffer.
+ // Find the oldest buffer, zero it, and re-purpose it for this thread.
+
+ // Find the thread that contains the oldest stealable buffer, and get its list of buffers.
+ EventPipeBufferList *pListToStealFrom = FindThreadToStealFrom();
+ if(pListToStealFrom != NULL)
+ {
+ // Assert that the buffer we're stealing is not the only buffer in the list.
+ // This invariant is enforced by FindThreadToStealFrom.
+ _ASSERTE((pListToStealFrom->GetHead() != NULL) && (pListToStealFrom->GetHead()->GetNext() != NULL));
+
+ // Remove the oldest buffer from the list.
+ pNewBuffer = pListToStealFrom->GetAndRemoveHead();
+
+ // De-allocate the buffer. We do this because buffers are variable sized
+ // based on how much volume is coming from the thread.
+ DeAllocateBuffer(pNewBuffer);
+ pNewBuffer = NULL;
+
+ // Set that we want to allocate a new buffer.
+ allocateNewBuffer = true;
+
+#ifdef _DEBUG
+ m_numBuffersStolen++;
+#endif // _DEBUG
+
+ }
+ else
+ {
+ // This only happens when # of threads == # of buffers.
+ // We'll allocate one more buffer, and then this won't happen again.
+ allocateNewBuffer = true;
+ }
+ }
+
+ if(allocateNewBuffer)
+ {
+ // Pick a buffer size by multiplying the base buffer size by the number of buffers already allocated for this thread.
+ unsigned int sizeMultiplier = pThreadBufferList->GetCount() + 1;
+
+ // Pick the base buffer size based. Debug builds have a smaller size to stress the allocate/steal path more.
+ unsigned int baseBufferSize =
+#ifdef _DEBUG
+ 5 * 1024; // 5K
+#else
+ 100 * 1024; // 100K
+#endif
+ unsigned int bufferSize = baseBufferSize * sizeMultiplier;
+
+ // Make sure that buffer size >= request size so that the buffer size does not
+ // determine the max event size.
+ if(bufferSize < requestSize)
+ {
+ bufferSize = requestSize;
+ }
+
+ pNewBuffer = new EventPipeBuffer(bufferSize);
+ m_sizeOfAllBuffers += bufferSize;
+#ifdef _DEBUG
+ m_numBuffersAllocated++;
+#endif // _DEBUG
+ }
+
+ // Set the buffer on the thread.
+ if(pNewBuffer != NULL)
+ {
+ pThreadBufferList->InsertTail(pNewBuffer);
+ return pNewBuffer;
+ }
+
+ return NULL;
+}
+
+EventPipeBufferList* EventPipeBufferManager::FindThreadToStealFrom()
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ PRECONDITION(m_lock.OwnedByCurrentThread());
+ }
+ CONTRACTL_END;
+
+ // Find the thread buffer list containing the buffer whose most recent event is the oldest as long as the buffer is not
+ // the current buffer for the thread (e.g. it's next pointer is non-NULL).
+ // This means that the thread must also have multiple buffers, so that we don't steal its only buffer.
+ EventPipeBufferList *pOldestContainingList = NULL;
+
+ SListElem<EventPipeBufferList*> *pElem = m_pPerThreadBufferList->GetHead();
+ while(pElem != NULL)
+ {
+ EventPipeBufferList *pCandidate = pElem->GetValue();
+
+ // The current candidate has more than one buffer (otherwise it is disqualified).
+ if(pCandidate->GetHead()->GetNext() != NULL)
+ {
+ // If we haven't seen any candidates, this one automatically becomes the oldest candidate.
+ if(pOldestContainingList == NULL)
+ {
+ pOldestContainingList = pCandidate;
+ }
+ // Otherwise, to replace the existing candidate, this candidate must have an older timestamp in its oldest buffer.
+ else if((pOldestContainingList->GetHead()->GetMostRecentTimeStamp().QuadPart) >
+ (pCandidate->GetHead()->GetMostRecentTimeStamp().QuadPart))
+ {
+ pOldestContainingList = pCandidate;
+ }
+ }
+
+ pElem = m_pPerThreadBufferList->GetNext(pElem);
+ }
+
+ return pOldestContainingList;
+}
+
+void EventPipeBufferManager::DeAllocateBuffer(EventPipeBuffer *pBuffer)
+{
+ CONTRACTL
+ {
+ NOTHROW;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ if(pBuffer != NULL)
+ {
+ m_sizeOfAllBuffers -= pBuffer->GetSize();
+ delete(pBuffer);
+#ifdef _DEBUG
+ m_numBuffersAllocated--;
+#endif // _DEBUG
+ }
+}
+
+bool EventPipeBufferManager::WriteEvent(Thread *pThread, EventPipeEvent &event, BYTE *pData, unsigned int length, LPCGUID pActivityId, LPCGUID pRelatedActivityId, Thread *pEventThread, StackContents *pStack)
+{
+ CONTRACTL
+ {
+ NOTHROW;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ // The input thread must match the current thread because no lock is taken on the buffer.
+ PRECONDITION(pThread == GetThread());
+ }
+ CONTRACTL_END;
+
+ _ASSERTE(pThread == GetThread());
+
+ // Check to see an event thread was specified. If not, then use the current thread.
+ if(pEventThread == NULL)
+ {
+ pEventThread = pThread;
+ }
+
+ // Before we pick a buffer, make sure the event is enabled.
+ if(!event.IsEnabled())
+ {
+ return false;
+ }
+
+ // The event is still enabled. Mark that the thread is now writing an event.
+ pThread->SetEventWriteInProgress(true);
+
+ // Check one more time to make sure that the event is still enabled.
+ // We do this because we might be trying to disable tracing and free buffers, so we
+ // must make sure that the event is enabled after we mark that we're writing to avoid
+ // races with the destructing thread.
+ if(!event.IsEnabled())
+ {
+ return false;
+ }
+
+ // See if the thread already has a buffer to try.
+ bool allocNewBuffer = false;
+ EventPipeBuffer *pBuffer = NULL;
+ EventPipeBufferList *pThreadBufferList = pThread->GetEventPipeBufferList();
+ if(pThreadBufferList == NULL)
+ {
+ allocNewBuffer = true;
+ }
+ else
+ {
+ // The thread already has a buffer list. Select the newest buffer and attempt to write into it.
+ pBuffer = pThreadBufferList->GetTail();
+ if(pBuffer == NULL)
+ {
+ // This should never happen. If the buffer list exists, it must contain at least one entry.
+ _ASSERT(!"Thread buffer list with zero entries encountered.");
+ return false;
+ }
+ else
+ {
+ // Attempt to write the event to the buffer. If this fails, we should allocate a new buffer.
+ allocNewBuffer = !pBuffer->WriteEvent(pEventThread, event, pData, length, pActivityId, pRelatedActivityId, pStack);
+ }
+ }
+
+ // Check to see if we need to allocate a new buffer, and if so, do it here.
+ if(allocNewBuffer)
+ {
+ // We previously switched to preemptive mode here, however, this is not safe and can cause deadlocks.
+ // When a GC is started, and background threads are created (for the first BGC), a thread creation event is fired.
+ // When control gets here the buffer is allocated, but then the thread hangs waiting for the GC to complete
+ // (it was marked as started before creating threads) so that it can switch back to cooperative mode.
+ // However, the GC is waiting on this call to return so that it can make forward progress. Thus it is not safe
+ // to switch to preemptive mode here.
+
+ unsigned int requestSize = sizeof(EventPipeEventInstance) + length;
+ pBuffer = AllocateBufferForThread(pThread, requestSize);
+ }
+
+ // Try to write the event after we allocated (or stole) a buffer.
+ // This is the first time if the thread had no buffers before the call to this function.
+ // This is the second time if this thread did have one or more buffers, but they were full.
+ if(allocNewBuffer && pBuffer != NULL)
+ {
+ allocNewBuffer = !pBuffer->WriteEvent(pEventThread, event, pData, length, pActivityId, pRelatedActivityId, pStack);
+ }
+
+ // Mark that the thread is no longer writing an event.
+ pThread->SetEventWriteInProgress(false);
+
+#ifdef _DEBUG
+ if(!allocNewBuffer)
+ {
+ InterlockedIncrement(&m_numEventsStored);
+ }
+#endif // _DEBUG
+ return !allocNewBuffer;
+}
+
+void EventPipeBufferManager::WriteAllBuffersToFile(EventPipeFile *pFile, LARGE_INTEGER stopTimeStamp)
+{
+ CONTRACTL
+ {
+ NOTHROW;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ PRECONDITION(pFile != NULL);
+ }
+ CONTRACTL_END;
+
+ // TODO: Better version of merge sort.
+ // 1. Iterate through all of the threads, adding each buffer to a temporary list.
+ // 2. While iterating, get the lowest most recent timestamp. This is the timestamp that we want to process up to.
+ // 3. Process up to the lowest most recent timestamp for the set of buffers.
+ // 4. When we get NULLs from each of the buffers on PopNext(), we're done.
+ // 5. While iterating if PopNext() == NULL && Empty() == NULL, remove the buffer from the list. It's empty.
+ // 6. While iterating, grab the next lowest most recent timestamp.
+ // 7. Walk through the list again and look for any buffers that have a lower most recent timestamp than the next most recent timestamp.
+ // 8. If we find one, add it to the list and select its most recent timestamp as the lowest.
+ // 9. Process again (go to 3).
+ // 10. Continue until there are no more buffers to process.
+
+ // Take the lock before walking the buffer list.
+ SpinLockHolder _slh(&m_lock);
+
+ // Naively walk the circular buffer, writing the event stream in timestamp order.
+ while(true)
+ {
+ EventPipeEventInstance *pOldestInstance = NULL;
+ EventPipeBuffer *pOldestContainingBuffer = NULL;
+ EventPipeBufferList *pOldestContainingList = NULL;
+ SListElem<EventPipeBufferList*> *pElem = m_pPerThreadBufferList->GetHead();
+ while(pElem != NULL)
+ {
+ EventPipeBufferList *pBufferList = pElem->GetValue();
+
+ // Peek the next event out of the list.
+ EventPipeBuffer *pContainingBuffer = NULL;
+ EventPipeEventInstance *pNext = pBufferList->PeekNextEvent(stopTimeStamp, &pContainingBuffer);
+ if(pNext != NULL)
+ {
+ // If it's the oldest event we've seen, then save it.
+ if((pOldestInstance == NULL) ||
+ (pOldestInstance->GetTimeStamp().QuadPart > pNext->GetTimeStamp().QuadPart))
+ {
+ pOldestInstance = pNext;
+ pOldestContainingBuffer = pContainingBuffer;
+ pOldestContainingList = pBufferList;
+ }
+ }
+
+ pElem = m_pPerThreadBufferList->GetNext(pElem);
+ }
+
+ if(pOldestInstance == NULL)
+ {
+ // We're done. There are no more events.
+ break;
+ }
+
+ // Write the oldest event.
+ pFile->WriteEvent(*pOldestInstance);
+#ifdef _DEBUG
+ m_numEventsWritten++;
+#endif // _DEBUG
+
+ // Pop the event from the buffer.
+ pOldestContainingList->PopNextEvent(stopTimeStamp);
+ }
+}
+
+void EventPipeBufferManager::DeAllocateBuffers()
+{
+ CONTRACTL
+ {
+ NOTHROW;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ _ASSERTE(EnsureConsistency());
+
+ // Take the thread store lock because we're going to iterate through the thread list.
+ {
+ ThreadStoreLockHolder tsl;
+
+ // Take the buffer manager manipulation lock.
+ SpinLockHolder _slh(&m_lock);
+
+ Thread *pThread = NULL;
+ while ((pThread = ThreadStore::GetThreadList(pThread)) != NULL)
+ {
+ // Get the thread's buffer list.
+ EventPipeBufferList *pBufferList = pThread->GetEventPipeBufferList();
+ if(pBufferList != NULL)
+ {
+ // Attempt to free the buffer list.
+ // If the thread is using its buffer list skip it.
+ // This means we will leak a single buffer, but if tracing is re-enabled, that buffer can be used again.
+ if(!pThread->GetEventWriteInProgress())
+ {
+ EventPipeBuffer *pBuffer = pBufferList->GetAndRemoveHead();
+ while(pBuffer != NULL)
+ {
+ DeAllocateBuffer(pBuffer);
+ pBuffer = pBufferList->GetAndRemoveHead();
+ }
+
+ // Remove the list entry from the per thread buffer list.
+ SListElem<EventPipeBufferList*> *pElem = m_pPerThreadBufferList->GetHead();
+ while(pElem != NULL)
+ {
+ EventPipeBufferList* pEntry = pElem->GetValue();
+ if(pEntry == pBufferList)
+ {
+ pElem = m_pPerThreadBufferList->FindAndRemove(pElem);
+
+ // In DEBUG, make sure that the element was found and removed.
+ _ASSERTE(pElem != NULL);
+ }
+ pElem = m_pPerThreadBufferList->GetNext(pElem);
+ }
+
+ // Remove the list reference from the thread.
+ pThread->SetEventPipeBufferList(NULL);
+
+ // Now that all of the list elements have been freed, free the list itself.
+ delete(pBufferList);
+ pBufferList = NULL;
+ }
+#ifdef _DEBUG
+ else
+ {
+ // We can't deallocate the buffers.
+ m_numBuffersLeaked += pBufferList->GetCount();
+ }
+#endif // _DEBUG
+ }
+ }
+ }
+
+ // Now that we've walked through all of the threads, let's see if there are any other buffers
+ // that belonged to threads that died during tracing. We can free these now.
+
+ // Take the buffer manager manipulation lock
+ SpinLockHolder _slh(&m_lock);
+
+ SListElem<EventPipeBufferList*> *pElem = m_pPerThreadBufferList->GetHead();
+ while(pElem != NULL)
+ {
+ // Get the list and determine if we can free it.
+ EventPipeBufferList *pBufferList = pElem->GetValue();
+ if(!pBufferList->OwnedByThread())
+ {
+ // Iterate over all nodes in the list and de-allocate them.
+ EventPipeBuffer *pBuffer = pBufferList->GetAndRemoveHead();
+ while(pBuffer != NULL)
+ {
+ DeAllocateBuffer(pBuffer);
+ pBuffer = pBufferList->GetAndRemoveHead();
+ }
+
+ // Remove the buffer list from the per-thread buffer list.
+ pElem = m_pPerThreadBufferList->FindAndRemove(pElem);
+ _ASSERTE(pElem != NULL);
+
+ // Now that all of the list elements have been freed, free the list itself.
+ delete(pBufferList);
+ pBufferList = NULL;
+ }
+
+ pElem = m_pPerThreadBufferList->GetNext(pElem);
+ }
+}
+
+#ifdef _DEBUG
+bool EventPipeBufferManager::EnsureConsistency()
+{
+ LIMITED_METHOD_CONTRACT;
+
+ SListElem<EventPipeBufferList*> *pElem = m_pPerThreadBufferList->GetHead();
+ while(pElem != NULL)
+ {
+ EventPipeBufferList *pBufferList = pElem->GetValue();
+
+ _ASSERTE(pBufferList->EnsureConsistency());
+
+ pElem = m_pPerThreadBufferList->GetNext(pElem);
+ }
+
+ return true;
+}
+#endif // _DEBUG
+
+EventPipeBufferList::EventPipeBufferList(EventPipeBufferManager *pManager)
+{
+ LIMITED_METHOD_CONTRACT;
+
+ m_pManager = pManager;
+ m_pHeadBuffer = NULL;
+ m_pTailBuffer = NULL;
+ m_bufferCount = 0;
+ m_pReadBuffer = NULL;
+ m_ownedByThread = true;
+
+#ifdef _DEBUG
+ m_pCreatingThread = GetThread();
+#endif // _DEBUG
+}
+
+EventPipeBuffer* EventPipeBufferList::GetHead()
+{
+ LIMITED_METHOD_CONTRACT;
+
+ return m_pHeadBuffer;
+}
+
+EventPipeBuffer* EventPipeBufferList::GetTail()
+{
+ LIMITED_METHOD_CONTRACT;
+
+ return m_pTailBuffer;
+}
+
+void EventPipeBufferList::InsertTail(EventPipeBuffer *pBuffer)
+{
+ CONTRACTL
+ {
+ NOTHROW;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ PRECONDITION(pBuffer != NULL);
+ }
+ CONTRACTL_END;
+
+ _ASSERTE(EnsureConsistency());
+
+ // Ensure that the input buffer didn't come from another list that was improperly cleaned up.
+ _ASSERTE((pBuffer->GetNext() == NULL) && (pBuffer->GetPrevious() == NULL));
+
+ // First node in the list.
+ if(m_pTailBuffer == NULL)
+ {
+ m_pHeadBuffer = m_pTailBuffer = pBuffer;
+ }
+ else
+ {
+ // Set links between the old and new tail nodes.
+ m_pTailBuffer->SetNext(pBuffer);
+ pBuffer->SetPrevious(m_pTailBuffer);
+
+ // Set the new tail node.
+ m_pTailBuffer = pBuffer;
+ }
+
+ m_bufferCount++;
+
+ _ASSERTE(EnsureConsistency());
+}
+
+EventPipeBuffer* EventPipeBufferList::GetAndRemoveHead()
+{
+ CONTRACTL
+ {
+ NOTHROW;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ _ASSERTE(EnsureConsistency());
+
+ EventPipeBuffer *pRetBuffer = NULL;
+ if(m_pHeadBuffer != NULL)
+ {
+ // Save the head node.
+ pRetBuffer = m_pHeadBuffer;
+
+ // Set the new head node.
+ m_pHeadBuffer = m_pHeadBuffer->GetNext();
+
+ // Update the head node's previous pointer.
+ if(m_pHeadBuffer != NULL)
+ {
+ m_pHeadBuffer->SetPrevious(NULL);
+ }
+ else
+ {
+ // We just removed the last buffer from the list.
+ // Make sure both head and tail pointers are NULL.
+ m_pTailBuffer = NULL;
+ }
+
+ // Clear the next pointer of the old head node.
+ pRetBuffer->SetNext(NULL);
+
+ // Ensure that the old head node has no dangling references.
+ _ASSERTE((pRetBuffer->GetNext() == NULL) && (pRetBuffer->GetPrevious() == NULL));
+
+ // Decrement the count of buffers in the list.
+ m_bufferCount--;
+ }
+
+ _ASSERTE(EnsureConsistency());
+
+ return pRetBuffer;
+}
+
+unsigned int EventPipeBufferList::GetCount() const
+{
+ LIMITED_METHOD_CONTRACT;
+
+ return m_bufferCount;
+}
+
+EventPipeEventInstance* EventPipeBufferList::PeekNextEvent(LARGE_INTEGER beforeTimeStamp, EventPipeBuffer **pContainingBuffer)
+{
+ CONTRACTL
+ {
+ NOTHROW;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ // Get the current read buffer.
+ // If it's not set, start with the head buffer.
+ if(m_pReadBuffer == NULL)
+ {
+ m_pReadBuffer = m_pHeadBuffer;
+ }
+
+ // If the read buffer is still NULL, then this list contains no buffers.
+ if(m_pReadBuffer == NULL)
+ {
+ return NULL;
+ }
+
+ // Get the next event in the buffer.
+ EventPipeEventInstance *pNext = m_pReadBuffer->PeekNext(beforeTimeStamp);
+
+ // If the next event is NULL, then go to the next buffer.
+ if(pNext == NULL)
+ {
+ m_pReadBuffer = m_pReadBuffer->GetNext();
+ if(m_pReadBuffer != NULL)
+ {
+ pNext = m_pReadBuffer->PeekNext(beforeTimeStamp);
+ }
+ }
+
+ // Set the containing buffer.
+ if(pNext != NULL && pContainingBuffer != NULL)
+ {
+ *pContainingBuffer = m_pReadBuffer;
+ }
+
+ // Make sure pContainingBuffer is properly set.
+ _ASSERTE((pNext == NULL) || (pNext != NULL && pContainingBuffer == NULL) || (pNext != NULL && *pContainingBuffer == m_pReadBuffer));
+ return pNext;
+}
+
+EventPipeEventInstance* EventPipeBufferList::PopNextEvent(LARGE_INTEGER beforeTimeStamp)
+{
+ CONTRACTL
+ {
+ NOTHROW;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ // Get the next event.
+ EventPipeBuffer *pContainingBuffer = NULL;
+ EventPipeEventInstance *pNext = PeekNextEvent(beforeTimeStamp, &pContainingBuffer);
+
+ // If the event is non-NULL, pop it.
+ if(pNext != NULL && pContainingBuffer != NULL)
+ {
+ pContainingBuffer->PopNext(beforeTimeStamp);
+
+ // If the buffer is not the last buffer in the list and it has been drained, de-allocate it.
+ if((pContainingBuffer->GetNext() != NULL) && (pContainingBuffer->PeekNext(beforeTimeStamp) == NULL))
+ {
+ // This buffer must be the head node of the list.
+ _ASSERTE(pContainingBuffer->GetPrevious() == NULL);
+ EventPipeBuffer *pRemoved = GetAndRemoveHead();
+ _ASSERTE(pRemoved == pContainingBuffer);
+
+ // De-allocate the buffer.
+ m_pManager->DeAllocateBuffer(pRemoved);
+
+ // Reset the read buffer so that it becomes the head node on next peek or pop operation.
+ m_pReadBuffer = NULL;
+ }
+ }
+
+ return pNext;
+}
+
+bool EventPipeBufferList::OwnedByThread()
+{
+ LIMITED_METHOD_CONTRACT;
+ return m_ownedByThread;
+}
+
+void EventPipeBufferList::SetOwnedByThread(bool value)
+{
+ LIMITED_METHOD_CONTRACT;
+ m_ownedByThread = value;
+}
+
+#ifdef _DEBUG
+Thread* EventPipeBufferList::GetThread()
+{
+ LIMITED_METHOD_CONTRACT;
+
+ return m_pCreatingThread;
+}
+
+bool EventPipeBufferList::EnsureConsistency()
+{
+ CONTRACTL
+ {
+ NOTHROW;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ // Either the head and tail nodes are both NULL or both are non-NULL.
+ _ASSERTE((m_pHeadBuffer == NULL && m_pTailBuffer == NULL) || (m_pHeadBuffer != NULL && m_pTailBuffer != NULL));
+
+ // If the list is NULL, check the count and return.
+ if(m_pHeadBuffer == NULL)
+ {
+ _ASSERTE(m_bufferCount == 0);
+ return true;
+ }
+
+ // If the list is non-NULL, walk the list forward until we get to the end.
+ unsigned int nodeCount = (m_pHeadBuffer != NULL) ? 1 : 0;
+ EventPipeBuffer *pIter = m_pHeadBuffer;
+ while(pIter->GetNext() != NULL)
+ {
+ pIter = pIter->GetNext();
+ nodeCount++;
+
+ // Check for consistency of the buffer itself.
+ // NOTE: We can't check the last buffer because the owning thread could
+ // be writing to it, which could result in false asserts.
+ if(pIter->GetNext() != NULL)
+ {
+ _ASSERTE(pIter->EnsureConsistency());
+ }
+
+ // Check for cycles.
+ _ASSERTE(nodeCount <= m_bufferCount);
+ }
+
+ // When we're done with the walk, pIter must point to the tail node.
+ _ASSERTE(pIter == m_pTailBuffer);
+
+ // Node count must equal the buffer count.
+ _ASSERTE(nodeCount == m_bufferCount);
+
+ // Now, walk the list in reverse.
+ pIter = m_pTailBuffer;
+ nodeCount = (m_pTailBuffer != NULL) ? 1 : 0;
+ while(pIter->GetPrevious() != NULL)
+ {
+ pIter = pIter->GetPrevious();
+ nodeCount++;
+
+ // Check for cycles.
+ _ASSERTE(nodeCount <= m_bufferCount);
+ }
+
+ // When we're done with the reverse walk, pIter must point to the head node.
+ _ASSERTE(pIter == m_pHeadBuffer);
+
+ // Node count must equal the buffer count.
+ _ASSERTE(nodeCount == m_bufferCount);
+
+ // We're done.
+ return true;
+}
+#endif // _DEBUG
+
+#endif // FEATURE_PERFTRACING
diff --git a/src/vm/eventpipebuffermanager.h b/src/vm/eventpipebuffermanager.h
new file mode 100644
index 0000000000..a53721b7b8
--- /dev/null
+++ b/src/vm/eventpipebuffermanager.h
@@ -0,0 +1,161 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+#ifndef __EVENTPIPE_BUFFERMANAGER_H__
+#define __EVENTPIPE_BUFFERMANAGER_H__
+
+#ifdef FEATURE_PERFTRACING
+
+#include "eventpipefile.h"
+#include "eventpipebuffer.h"
+#include "spinlock.h"
+
+class EventPipeBufferList;
+
+class EventPipeBufferManager
+{
+
+ // Declare friends.
+ friend class EventPipeBufferList;
+
+private:
+
+ // A list of linked-lists of buffer objects.
+ // Each entry in this list represents a set of buffers owned by a single thread.
+ // The actual Thread object has a pointer to the object contained in this list. This ensures that
+ // each thread can access its own list, while at the same time, ensuring that when
+ // a thread is destroyed, we keep the buffers around without having to perform any
+ // migration or book-keeping.
+ SList<SListElem<EventPipeBufferList*>> *m_pPerThreadBufferList;
+
+ // The total allocation size of buffers under management.
+ size_t m_sizeOfAllBuffers;
+
+ // Lock to protect access to the per-thread buffer list and total allocation size.
+ SpinLock m_lock;
+
+#ifdef _DEBUG
+ // For debugging purposes.
+ unsigned int m_numBuffersAllocated;
+ unsigned int m_numBuffersStolen;
+ unsigned int m_numBuffersLeaked;
+ Volatile<LONG> m_numEventsStored;
+ LONG m_numEventsWritten;
+#endif // _DEBUG
+
+ // Allocate a new buffer for the specified thread.
+ // This function will store the buffer in the thread's buffer list for future use and also return it here.
+ // A NULL return value means that a buffer could not be allocated.
+ EventPipeBuffer* AllocateBufferForThread(Thread *pThread, unsigned int requestSize);
+
+ // Add a buffer to the thread buffer list.
+ void AddBufferToThreadBufferList(EventPipeBufferList *pThreadBuffers, EventPipeBuffer *pBuffer);
+
+ // Find the thread that owns the oldest buffer that is eligible to be stolen.
+ EventPipeBufferList* FindThreadToStealFrom();
+
+ // De-allocates the input buffer.
+ void DeAllocateBuffer(EventPipeBuffer *pBuffer);
+
+public:
+
+ EventPipeBufferManager();
+
+ // Write an event to the input thread's current event buffer.
+ // An optional eventThread can be provided for sample profiler events.
+ // This is because the thread that writes the events is not the same as the "event thread".
+ // An optional stack trace can be provided for sample profiler events.
+ // Otherwise, if a stack trace is needed, one will be automatically collected.
+ bool WriteEvent(Thread *pThread, EventPipeEvent &event, BYTE *pData, unsigned int length, LPCGUID pActivityId, LPCGUID pRelatedActivityId, Thread *pEventThread = NULL, StackContents *pStack = NULL);
+
+ // Write the contents of the managed buffers to the specified file.
+ // The stopTimeStamp is used to determine when tracing was stopped to ensure that we
+ // skip any events that might be partially written due to races when tracing is stopped.
+ void WriteAllBuffersToFile(EventPipeFile *pFile, LARGE_INTEGER stopTimeStamp);
+
+ // Attempt to de-allocate resources as best we can. It is possible for some buffers to leak because
+ // threads can be in the middle of a write operation and get blocked, and we may not get an opportunity
+ // to free their buffer for a very long time.
+ void DeAllocateBuffers();
+
+#ifdef _DEBUG
+ bool EnsureConsistency();
+#endif // _DEBUG
+};
+
+// Represents a list of buffers associated with a specific thread.
+class EventPipeBufferList
+{
+private:
+
+ // The buffer manager that owns this list.
+ EventPipeBufferManager *m_pManager;
+
+ // Buffers are stored in an intrusive linked-list from oldest to newest.
+ // Head is the oldest buffer. Tail is the newest (and currently used) buffer.
+ EventPipeBuffer *m_pHeadBuffer;
+ EventPipeBuffer *m_pTailBuffer;
+
+ // The number of buffers in the list.
+ unsigned int m_bufferCount;
+
+ // The current read buffer (used when processing events on tracing stop).
+ EventPipeBuffer *m_pReadBuffer;
+
+ // True if this thread is owned by a thread.
+ // If it is false, then this buffer can be de-allocated after it is drained.
+ Volatile<bool> m_ownedByThread;
+
+#ifdef _DEBUG
+ // For diagnostics, keep the thread pointer.
+ Thread *m_pCreatingThread;
+#endif // _DEBUG
+
+public:
+
+ EventPipeBufferList(EventPipeBufferManager *pManager);
+
+ // Get the head node of the list.
+ EventPipeBuffer* GetHead();
+
+ // Get the tail node of the list.
+ EventPipeBuffer* GetTail();
+
+ // Insert a new buffer at the tail of the list.
+ void InsertTail(EventPipeBuffer *pBuffer);
+
+ // Remove the head node of the list.
+ EventPipeBuffer* GetAndRemoveHead();
+
+ // Get the count of buffers in the list.
+ unsigned int GetCount() const;
+
+ // Get the next event as long as it is before the specified timestamp.
+ EventPipeEventInstance* PeekNextEvent(LARGE_INTEGER beforeTimeStamp, EventPipeBuffer **pContainingBuffer);
+
+ // Get the next event as long as it is before the specified timestamp, and also mark it as read.
+ EventPipeEventInstance* PopNextEvent(LARGE_INTEGER beforeTimeStamp);
+
+ // True if a thread owns this list.
+ bool OwnedByThread();
+
+ // Set whether or not this list is owned by a thread.
+ // If it is not owned by a thread, then it can be de-allocated
+ // after the buffer is drained.
+ // The default value is true.
+ void SetOwnedByThread(bool value);
+
+#ifdef _DEBUG
+ // Get the thread associated with this list.
+ Thread* GetThread();
+
+ // Validate the consistency of the list.
+ // This function will assert if the list is in an inconsistent state.
+ bool EnsureConsistency();
+#endif // _DEBUG
+};
+
+#endif // FEATURE_PERFTRACING
+
+#endif // __EVENTPIPE_BUFFERMANAGER_H__
diff --git a/src/vm/eventpipeconfiguration.cpp b/src/vm/eventpipeconfiguration.cpp
new file mode 100644
index 0000000000..42f9daf528
--- /dev/null
+++ b/src/vm/eventpipeconfiguration.cpp
@@ -0,0 +1,594 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+#include "common.h"
+#include "eventpipe.h"
+#include "eventpipeconfiguration.h"
+#include "eventpipeeventinstance.h"
+#include "eventpipeprovider.h"
+
+#ifdef FEATURE_PERFTRACING
+
+// {5291C09C-2660-4D6A-83A3-C383FD020DEC}
+const GUID EventPipeConfiguration::s_configurationProviderID =
+ { 0x5291c09c, 0x2660, 0x4d6a, { 0x83, 0xa3, 0xc3, 0x83, 0xfd, 0x2, 0xd, 0xec } };
+
+EventPipeConfiguration::EventPipeConfiguration()
+{
+ STANDARD_VM_CONTRACT;
+
+ m_enabled = false;
+ m_rundownEnabled = false;
+ m_circularBufferSizeInBytes = 1024 * 1024 * 1000; // Default to 1000MB.
+ m_pEnabledProviderList = NULL;
+ m_pProviderList = new SList<SListElem<EventPipeProvider*>>();
+}
+
+EventPipeConfiguration::~EventPipeConfiguration()
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_TRIGGERS;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ if(m_pEnabledProviderList != NULL)
+ {
+ delete(m_pEnabledProviderList);
+ m_pEnabledProviderList = NULL;
+ }
+
+ if(m_pProviderList != NULL)
+ {
+ delete(m_pProviderList);
+ m_pProviderList = NULL;
+ }
+}
+
+void EventPipeConfiguration::Initialize()
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ // Create the configuration provider.
+ m_pConfigProvider = EventPipe::CreateProvider(s_configurationProviderID);
+
+ // Create the metadata event.
+ m_pMetadataEvent = m_pConfigProvider->AddEvent(
+ 0, /* eventID */
+ 0, /* keywords */
+ 0, /* eventVersion */
+ EventPipeEventLevel::LogAlways,
+ false); /* needStack */
+}
+
+bool EventPipeConfiguration::RegisterProvider(EventPipeProvider &provider)
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ // Take the lock before manipulating the provider list.
+ CrstHolder _crst(EventPipe::GetLock());
+
+ // See if we've already registered this provider.
+ EventPipeProvider *pExistingProvider = GetProviderNoLock(provider.GetProviderID());
+ if(pExistingProvider != NULL)
+ {
+ return false;
+ }
+
+ // The provider has not been registered, so register it.
+ m_pProviderList->InsertTail(new SListElem<EventPipeProvider*>(&provider));
+
+ // Set the provider configuration and enable it if we know anything about the provider before it is registered.
+ if(m_pEnabledProviderList != NULL)
+ {
+ EventPipeEnabledProvider *pEnabledProvider = m_pEnabledProviderList->GetEnabledProvider(&provider);
+ if(pEnabledProvider != NULL)
+ {
+ provider.SetConfiguration(
+ true /* providerEnabled */,
+ pEnabledProvider->GetKeywords(),
+ pEnabledProvider->GetLevel());
+ }
+ }
+
+ return true;
+}
+
+bool EventPipeConfiguration::UnregisterProvider(EventPipeProvider &provider)
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ // Take the lock before manipulating the provider list.
+ CrstHolder _crst(EventPipe::GetLock());
+
+ // Find the provider.
+ SListElem<EventPipeProvider*> *pElem = m_pProviderList->GetHead();
+ while(pElem != NULL)
+ {
+ if(pElem->GetValue() == &provider)
+ {
+ break;
+ }
+
+ pElem = m_pProviderList->GetNext(pElem);
+ }
+
+ // If we found the provider, remove it.
+ if(pElem != NULL)
+ {
+ if(m_pProviderList->FindAndRemove(pElem) != NULL)
+ {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+EventPipeProvider* EventPipeConfiguration::GetProvider(const GUID &providerID)
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ // Take the lock before touching the provider list to ensure no one tries to
+ // modify the list.
+ CrstHolder _crst(EventPipe::GetLock());
+
+ return GetProviderNoLock(providerID);
+}
+
+EventPipeProvider* EventPipeConfiguration::GetProviderNoLock(const GUID &providerID)
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ PRECONDITION(EventPipe::GetLock()->OwnedByCurrentThread());
+ }
+ CONTRACTL_END;
+
+ SListElem<EventPipeProvider*> *pElem = m_pProviderList->GetHead();
+ while(pElem != NULL)
+ {
+ EventPipeProvider *pProvider = pElem->GetValue();
+ if(pProvider->GetProviderID() == providerID)
+ {
+ return pProvider;
+ }
+
+ pElem = m_pProviderList->GetNext(pElem);
+ }
+
+ return NULL;
+}
+
+size_t EventPipeConfiguration::GetCircularBufferSize() const
+{
+ LIMITED_METHOD_CONTRACT;
+
+ return m_circularBufferSizeInBytes;
+}
+
+void EventPipeConfiguration::SetCircularBufferSize(size_t circularBufferSize)
+{
+ LIMITED_METHOD_CONTRACT;
+
+ if(!m_enabled)
+ {
+ m_circularBufferSizeInBytes = circularBufferSize;
+ }
+}
+
+void EventPipeConfiguration::Enable(
+ uint circularBufferSizeInMB,
+ EventPipeProviderConfiguration *pProviders,
+ int numProviders)
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ // Lock must be held by EventPipe::Enable.
+ PRECONDITION(EventPipe::GetLock()->OwnedByCurrentThread());
+ }
+ CONTRACTL_END;
+
+ m_circularBufferSizeInBytes = circularBufferSizeInMB * 1024 * 1024;
+ m_pEnabledProviderList = new EventPipeEnabledProviderList(pProviders, static_cast<unsigned int>(numProviders));
+ m_enabled = true;
+
+ SListElem<EventPipeProvider*> *pElem = m_pProviderList->GetHead();
+ while(pElem != NULL)
+ {
+ EventPipeProvider *pProvider = pElem->GetValue();
+
+ // Enable the provider if it has been configured.
+ EventPipeEnabledProvider *pEnabledProvider = m_pEnabledProviderList->GetEnabledProvider(pProvider);
+ if(pEnabledProvider != NULL)
+ {
+ pProvider->SetConfiguration(
+ true /* providerEnabled */,
+ pEnabledProvider->GetKeywords(),
+ pEnabledProvider->GetLevel());
+ }
+
+ pElem = m_pProviderList->GetNext(pElem);
+ }
+
+}
+
+void EventPipeConfiguration::Disable()
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ // Lock must be held by EventPipe::Disable.
+ PRECONDITION(EventPipe::GetLock()->OwnedByCurrentThread());
+ }
+ CONTRACTL_END;
+
+ SListElem<EventPipeProvider*> *pElem = m_pProviderList->GetHead();
+ while(pElem != NULL)
+ {
+ EventPipeProvider *pProvider = pElem->GetValue();
+ pProvider->SetConfiguration(false /* providerEnabled */, 0 /* keywords */, EventPipeEventLevel::Critical /* level */);
+
+ pElem = m_pProviderList->GetNext(pElem);
+ }
+
+ m_enabled = false;
+ m_rundownEnabled = false;
+
+ // Free the enabled providers list.
+ if(m_pEnabledProviderList != NULL)
+ {
+ delete(m_pEnabledProviderList);
+ m_pEnabledProviderList = NULL;
+ }
+}
+
+bool EventPipeConfiguration::Enabled() const
+{
+ LIMITED_METHOD_CONTRACT;
+ return m_enabled;
+}
+
+bool EventPipeConfiguration::RundownEnabled() const
+{
+ LIMITED_METHOD_CONTRACT;
+ return m_rundownEnabled;
+}
+
+void EventPipeConfiguration::EnableRundown()
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ // Lock must be held by EventPipe::Disable.
+ PRECONDITION(EventPipe::GetLock()->OwnedByCurrentThread());
+ }
+ CONTRACTL_END;
+
+ // Build the rundown configuration.
+ _ASSERTE(m_pEnabledProviderList == NULL);
+ const unsigned int numRundownProviders = 2;
+ EventPipeProviderConfiguration rundownProviders[numRundownProviders];
+ rundownProviders[0] = EventPipeProviderConfiguration(W("e13c0d23-ccbc-4e12-931b-d9cc2eee27e4"), 0x80020138, static_cast<unsigned int>(EventPipeEventLevel::Verbose)); // Public provider.
+ rundownProviders[1] = EventPipeProviderConfiguration(W("a669021c-c450-4609-a035-5af59af4df18"), 0x80020138, static_cast<unsigned int>(EventPipeEventLevel::Verbose)); // Rundown provider.
+
+ // Enable rundown.
+ m_rundownEnabled = true;
+
+ // Enable tracing. The circular buffer size doesn't matter because we're going to write all events synchronously during rundown.
+ Enable(1 /* circularBufferSizeInMB */, rundownProviders, numRundownProviders);
+}
+
+EventPipeEventInstance* EventPipeConfiguration::BuildEventMetadataEvent(EventPipeEventInstance &sourceInstance)
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ // The payload of the event should contain:
+ // - GUID ProviderID.
+ // - unsigned int EventID.
+ // - unsigned int EventVersion.
+ // - Optional event description payload.
+
+ // Calculate the size of the event.
+ EventPipeEvent &sourceEvent = *sourceInstance.GetEvent();
+ const GUID &providerID = sourceEvent.GetProvider()->GetProviderID();
+ unsigned int eventID = sourceEvent.GetEventID();
+ unsigned int eventVersion = sourceEvent.GetEventVersion();
+ BYTE *pPayloadData = sourceEvent.GetMetadata();
+ unsigned int payloadLength = sourceEvent.GetMetadataLength();
+ unsigned int instancePayloadSize = sizeof(providerID) + sizeof(eventID) + sizeof(eventVersion) + sizeof(payloadLength) + payloadLength;
+
+ // Allocate the payload.
+ BYTE *pInstancePayload = new BYTE[instancePayloadSize];
+
+ // Fill the buffer with the payload.
+ BYTE *currentPtr = pInstancePayload;
+
+ // Write the provider ID.
+ memcpy(currentPtr, (BYTE*)&providerID, sizeof(providerID));
+ currentPtr += sizeof(providerID);
+
+ // Write the event ID.
+ memcpy(currentPtr, &eventID, sizeof(eventID));
+ currentPtr += sizeof(eventID);
+
+ // Write the event version.
+ memcpy(currentPtr, &eventVersion, sizeof(eventVersion));
+ currentPtr += sizeof(eventVersion);
+
+ // Write the size of the metadata.
+ memcpy(currentPtr, &payloadLength, sizeof(payloadLength));
+ currentPtr += sizeof(payloadLength);
+
+ // Write the incoming payload data.
+ memcpy(currentPtr, pPayloadData, payloadLength);
+
+ // Construct the event instance.
+ EventPipeEventInstance *pInstance = new EventPipeEventInstance(
+ *m_pMetadataEvent,
+ GetCurrentThreadId(),
+ pInstancePayload,
+ instancePayloadSize,
+ NULL /* pActivityId */,
+ NULL /* pRelatedActivityId */);
+
+ // Set the timestamp to match the source event, because the metadata event
+ // will be emitted right before the source event.
+ pInstance->SetTimeStamp(sourceInstance.GetTimeStamp());
+
+ return pInstance;
+}
+
+void EventPipeConfiguration::DeleteDeferredProviders()
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_TRIGGERS;
+ MODE_ANY;
+ // Lock must be held by EventPipe::Disable.
+ PRECONDITION(EventPipe::GetLock()->OwnedByCurrentThread());
+
+ }
+ CONTRACTL_END;
+
+ SListElem<EventPipeProvider*> *pElem = m_pProviderList->GetHead();
+ while(pElem != NULL)
+ {
+ EventPipeProvider *pProvider = pElem->GetValue();
+ if(pProvider->GetDeleteDeferred())
+ {
+ // The act of deleting the provider unregisters it and removes it from the list.
+ delete(pProvider);
+ }
+
+ pElem = m_pProviderList->GetNext(pElem);
+ }
+}
+
+EventPipeEnabledProviderList::EventPipeEnabledProviderList(
+ EventPipeProviderConfiguration *pConfigs,
+ unsigned int numConfigs)
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ m_pProviders = NULL;
+ m_pCatchAllProvider = NULL;
+ m_numProviders = 0;
+
+ // Test COMPLUS variable to enable tracing at start-up.
+ // If tracing is enabled at start-up create the catch-all provider and always return it.
+ if((CLRConfig::GetConfigValue(CLRConfig::INTERNAL_PerformanceTracing) & 1) == 1)
+ {
+ m_pCatchAllProvider = new EventPipeEnabledProvider();
+ m_pCatchAllProvider->Set(NULL, 0xFFFFFFFFFFFFFFFF, EventPipeEventLevel::Verbose);
+ return;
+ }
+
+ m_pCatchAllProvider = NULL;
+ m_numProviders = numConfigs;
+ if(m_numProviders == 0)
+ {
+ return;
+ }
+
+ m_pProviders = new EventPipeEnabledProvider[m_numProviders];
+ for(int i=0; i<m_numProviders; i++)
+ {
+ m_pProviders[i].Set(
+ pConfigs[i].GetProviderName(),
+ pConfigs[i].GetKeywords(),
+ (EventPipeEventLevel)pConfigs[i].GetLevel());
+ }
+}
+
+EventPipeEnabledProviderList::~EventPipeEnabledProviderList()
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ if(m_pProviders != NULL)
+ {
+ delete[] m_pProviders;
+ m_pProviders = NULL;
+ }
+ if(m_pCatchAllProvider != NULL)
+ {
+ delete(m_pCatchAllProvider);
+ m_pCatchAllProvider = NULL;
+ }
+}
+
+EventPipeEnabledProvider* EventPipeEnabledProviderList::GetEnabledProvider(
+ EventPipeProvider *pProvider)
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ // If tracing was enabled on start-up, all events should be on (this is a diagnostic config).
+ if(m_pCatchAllProvider != NULL)
+ {
+ return m_pCatchAllProvider;
+ }
+
+ if(m_pProviders == NULL)
+ {
+ return NULL;
+ }
+
+ // TEMPORARY: Convert the provider GUID to a string.
+ const unsigned int guidSize = 39;
+ WCHAR wszProviderID[guidSize];
+ if(!StringFromGUID2(pProvider->GetProviderID(), wszProviderID, guidSize))
+ {
+ wszProviderID[0] = '\0';
+ }
+
+ // Strip off the {}.
+ SString providerNameStr(&wszProviderID[1], guidSize-3);
+ LPCWSTR providerName = providerNameStr.GetUnicode();
+
+ EventPipeEnabledProvider *pEnabledProvider = NULL;
+ for(int i=0; i<m_numProviders; i++)
+ {
+ EventPipeEnabledProvider *pCandidate = &m_pProviders[i];
+ if(pCandidate != NULL)
+ {
+ if(wcscmp(providerName, pCandidate->GetProviderName()) == 0)
+ {
+ pEnabledProvider = pCandidate;
+ break;
+ }
+ }
+ }
+
+ return pEnabledProvider;
+}
+
+EventPipeEnabledProvider::EventPipeEnabledProvider()
+{
+ LIMITED_METHOD_CONTRACT;
+ m_pProviderName = NULL;
+ m_keywords = 0;
+}
+
+EventPipeEnabledProvider::~EventPipeEnabledProvider()
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ if(m_pProviderName != NULL)
+ {
+ delete[] m_pProviderName;
+ m_pProviderName = NULL;
+ }
+}
+
+void EventPipeEnabledProvider::Set(LPCWSTR providerName, UINT64 keywords, EventPipeEventLevel loggingLevel)
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ if(m_pProviderName != NULL)
+ {
+ delete(m_pProviderName);
+ m_pProviderName = NULL;
+ }
+
+ if(providerName != NULL)
+ {
+ unsigned int bufSize = wcslen(providerName) + 1;
+ m_pProviderName = new WCHAR[bufSize];
+ wcscpy_s(m_pProviderName, bufSize, providerName);
+ }
+ m_keywords = keywords;
+ m_loggingLevel = loggingLevel;
+}
+
+LPCWSTR EventPipeEnabledProvider::GetProviderName() const
+{
+ LIMITED_METHOD_CONTRACT;
+ return m_pProviderName;
+}
+
+UINT64 EventPipeEnabledProvider::GetKeywords() const
+{
+ LIMITED_METHOD_CONTRACT;
+ return m_keywords;
+}
+
+EventPipeEventLevel EventPipeEnabledProvider::GetLevel() const
+{
+ LIMITED_METHOD_CONTRACT;
+ return m_loggingLevel;
+}
+
+#endif // FEATURE_PERFTRACING
diff --git a/src/vm/eventpipeconfiguration.h b/src/vm/eventpipeconfiguration.h
new file mode 100644
index 0000000000..de8e79d2f3
--- /dev/null
+++ b/src/vm/eventpipeconfiguration.h
@@ -0,0 +1,164 @@
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+#ifndef __EVENTPIPE_CONFIGURATION_H__
+#define __EVENTPIPE_CONFIGURATION_H__
+
+#ifdef FEATURE_PERFTRACING
+
+#include "slist.h"
+
+class EventPipeEnabledProvider;
+class EventPipeEnabledProviderList;
+class EventPipeEvent;
+class EventPipeEventInstance;
+class EventPipeProvider;
+struct EventPipeProviderConfiguration;
+
+enum class EventPipeEventLevel
+{
+ LogAlways,
+ Critical,
+ Error,
+ Warning,
+ Informational,
+ Verbose
+};
+
+class EventPipeConfiguration
+{
+public:
+
+ EventPipeConfiguration();
+ ~EventPipeConfiguration();
+
+ // Perform initialization that cannot be performed in the constructor.
+ void Initialize();
+
+ // Register a provider.
+ bool RegisterProvider(EventPipeProvider &provider);
+
+ // Unregister a provider.
+ bool UnregisterProvider(EventPipeProvider &provider);
+
+ // Get the provider with the specified provider ID if it exists.
+ EventPipeProvider* GetProvider(const GUID &providerID);
+
+ // Get the configured size of the circular buffer.
+ size_t GetCircularBufferSize() const;
+
+ // Set the configured size of the circular buffer.
+ void SetCircularBufferSize(size_t circularBufferSize);
+
+ // Enable the event pipe.
+ void Enable(
+ uint circularBufferSizeInMB,
+ EventPipeProviderConfiguration *pProviders,
+ int numProviders);
+
+ // Disable the event pipe.
+ void Disable();
+
+ // Get the status of the event pipe.
+ bool Enabled() const;
+
+ // Determine if rundown is enabled.
+ bool RundownEnabled() const;
+
+ // Enable the well-defined symbolic rundown configuration.
+ void EnableRundown();
+
+ // Get the event used to write metadata to the event stream.
+ EventPipeEventInstance* BuildEventMetadataEvent(EventPipeEventInstance &sourceInstance);
+
+ // Delete deferred providers.
+ void DeleteDeferredProviders();
+
+private:
+
+ // Get the provider without taking the lock.
+ EventPipeProvider* GetProviderNoLock(const GUID &providerID);
+
+ // Determines whether or not the event pipe is enabled.
+ Volatile<bool> m_enabled;
+
+ // The configured size of the circular buffer.
+ size_t m_circularBufferSizeInBytes;
+
+ // EventPipeConfiguration only supports a single session.
+ // This is the set of configurations for each enabled provider.
+ EventPipeEnabledProviderList *m_pEnabledProviderList;
+
+ // The list of event pipe providers.
+ SList<SListElem<EventPipeProvider*>> *m_pProviderList;
+
+ // The provider used to write configuration events to the event stream.
+ EventPipeProvider *m_pConfigProvider;
+
+ // The event used to write event information to the event stream.
+ EventPipeEvent *m_pMetadataEvent;
+
+ // The provider ID for the configuration event pipe provider.
+ // This provider is used to emit configuration events.
+ static const GUID s_configurationProviderID;
+
+ // True if rundown is enabled.
+ Volatile<bool> m_rundownEnabled;
+};
+
+class EventPipeEnabledProviderList
+{
+
+private:
+
+ // The number of providers in the list.
+ unsigned int m_numProviders;
+
+ // The list of providers.
+ EventPipeEnabledProvider *m_pProviders;
+
+ // A catch-all provider used when tracing is enabled at start-up
+ // under (COMPlus_PerformanceTracing & 1) == 1.
+ EventPipeEnabledProvider *m_pCatchAllProvider;
+
+public:
+
+ // Create a new list based on the input.
+ EventPipeEnabledProviderList(EventPipeProviderConfiguration *pConfigs, unsigned int numConfigs);
+ ~EventPipeEnabledProviderList();
+
+ // Get the enabled provider for the specified provider.
+ // Return NULL if one doesn't exist.
+ EventPipeEnabledProvider* GetEnabledProvider(EventPipeProvider *pProvider);
+};
+
+class EventPipeEnabledProvider
+{
+private:
+
+ // The provider name.
+ WCHAR *m_pProviderName;
+
+ // The enabled keywords.
+ UINT64 m_keywords;
+
+ // The loging level.
+ EventPipeEventLevel m_loggingLevel;
+
+public:
+
+ EventPipeEnabledProvider();
+ ~EventPipeEnabledProvider();
+
+ void Set(LPCWSTR providerName, UINT64 keywords, EventPipeEventLevel loggingLevel);
+
+ LPCWSTR GetProviderName() const;
+
+ UINT64 GetKeywords() const;
+
+ EventPipeEventLevel GetLevel() const;
+};
+
+#endif // FEATURE_PERFTRACING
+
+#endif // __EVENTPIPE_CONFIGURATION_H__
diff --git a/src/vm/eventpipeevent.cpp b/src/vm/eventpipeevent.cpp
new file mode 100644
index 0000000000..abf942b253
--- /dev/null
+++ b/src/vm/eventpipeevent.cpp
@@ -0,0 +1,120 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+#include "common.h"
+#include "eventpipeevent.h"
+#include "eventpipeprovider.h"
+
+#ifdef FEATURE_PERFTRACING
+
+EventPipeEvent::EventPipeEvent(EventPipeProvider &provider, INT64 keywords, unsigned int eventID, unsigned int eventVersion, EventPipeEventLevel level, bool needStack, BYTE *pMetadata, unsigned int metadataLength)
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ m_pProvider = &provider;
+ m_keywords = keywords;
+ m_eventID = eventID;
+ m_eventVersion = eventVersion;
+ m_level = level;
+ m_needStack = needStack;
+ m_enabled = false;
+ if (pMetadata != NULL)
+ {
+ m_pMetadata = new BYTE[metadataLength];
+ memcpy(m_pMetadata, pMetadata, metadataLength);
+ m_metadataLength = metadataLength;
+ }
+ else
+ {
+ m_pMetadata = NULL;
+ m_metadataLength = 0;
+ }
+}
+
+EventPipeEvent::~EventPipeEvent()
+{
+ if (m_pMetadata != NULL)
+ {
+ delete[] m_pMetadata;
+ m_pMetadata = NULL;
+ }
+}
+
+EventPipeProvider* EventPipeEvent::GetProvider() const
+{
+ LIMITED_METHOD_CONTRACT;
+
+ return m_pProvider;
+}
+
+INT64 EventPipeEvent::GetKeywords() const
+{
+ LIMITED_METHOD_CONTRACT;
+
+ return m_keywords;
+}
+
+unsigned int EventPipeEvent::GetEventID() const
+{
+ LIMITED_METHOD_CONTRACT;
+
+ return m_eventID;
+}
+
+unsigned int EventPipeEvent::GetEventVersion() const
+{
+ LIMITED_METHOD_CONTRACT;
+
+ return m_eventVersion;
+}
+
+EventPipeEventLevel EventPipeEvent::GetLevel() const
+{
+ LIMITED_METHOD_CONTRACT;
+
+ return m_level;
+}
+
+bool EventPipeEvent::NeedStack() const
+{
+ LIMITED_METHOD_CONTRACT;
+
+ return m_needStack;
+}
+
+bool EventPipeEvent::IsEnabled() const
+{
+ LIMITED_METHOD_CONTRACT;
+
+ return m_enabled;
+}
+
+BYTE *EventPipeEvent::GetMetadata() const
+{
+ LIMITED_METHOD_CONTRACT;
+
+ return m_pMetadata;
+}
+
+unsigned int EventPipeEvent::GetMetadataLength() const
+{
+ LIMITED_METHOD_CONTRACT;
+
+ return m_metadataLength;
+}
+
+void EventPipeEvent::RefreshState()
+{
+ LIMITED_METHOD_CONTRACT;
+
+ m_enabled = m_pProvider->EventEnabled(m_keywords, m_level);
+}
+
+#endif // FEATURE_PERFTRACING
diff --git a/src/vm/eventpipeevent.h b/src/vm/eventpipeevent.h
new file mode 100644
index 0000000000..c91c4bac8e
--- /dev/null
+++ b/src/vm/eventpipeevent.h
@@ -0,0 +1,87 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+#ifndef __EVENTPIPE_EVENT_H__
+#define __EVENTPIPE_EVENT_H__
+
+#ifdef FEATURE_PERFTRACING
+
+#include "eventpipeprovider.h"
+
+class EventPipeEvent
+{
+ // Declare friends.
+ friend class EventPipeProvider;
+
+private:
+
+ // The provider that contains the event.
+ EventPipeProvider *m_pProvider;
+
+ // Bit vector containing the keywords that enable the event.
+ INT64 m_keywords;
+
+ // The ID (within the provider) of the event.
+ unsigned int m_eventID;
+
+ // The version of the event.
+ unsigned int m_eventVersion;
+
+ // The verbosity of the event.
+ EventPipeEventLevel m_level;
+
+ // True if a call stack should be captured when writing the event.
+ bool m_needStack;
+
+ // True if the event is current enabled.
+ Volatile<bool> m_enabled;
+
+ // Metadata
+ BYTE *m_pMetadata;
+
+ // Metadata length;
+ unsigned int m_metadataLength;
+
+ // Refreshes the runtime state for this event.
+ // Called by EventPipeProvider when the provider configuration changes.
+ void RefreshState();
+
+ // Only EventPipeProvider can create events.
+ // The provider is responsible for allocating and freeing events.
+ EventPipeEvent(EventPipeProvider &provider, INT64 keywords, unsigned int eventID, unsigned int eventVersion, EventPipeEventLevel level, bool needStack, BYTE *pMetadata = NULL, unsigned int metadataLength = 0);
+
+ public:
+ ~EventPipeEvent();
+
+ // Get the provider associated with this event.
+ EventPipeProvider* GetProvider() const;
+
+ // Get the keywords that enable the event.
+ INT64 GetKeywords() const;
+
+ // Get the ID (within the provider) of the event.
+ unsigned int GetEventID() const;
+
+ // Get the version of the event.
+ unsigned int GetEventVersion() const;
+
+ // Get the verbosity of the event.
+ EventPipeEventLevel GetLevel() const;
+
+ // True if a call stack should be captured when writing the event.
+ bool NeedStack() const;
+
+ // True if the event is currently enabled.
+ bool IsEnabled() const;
+
+ // Get metadata
+ BYTE *GetMetadata() const;
+
+ // Get metadata length
+ unsigned int GetMetadataLength() const;
+};
+
+#endif // FEATURE_PERFTRACING
+
+#endif // __EVENTPIPE_EVENT_H__
diff --git a/src/vm/eventpipeeventinstance.cpp b/src/vm/eventpipeeventinstance.cpp
new file mode 100644
index 0000000000..afde2c0547
--- /dev/null
+++ b/src/vm/eventpipeeventinstance.cpp
@@ -0,0 +1,238 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+#include "common.h"
+#include "eventpipeeventinstance.h"
+#include "eventpipejsonfile.h"
+#include "fastserializer.h"
+#include "sampleprofiler.h"
+
+#ifdef FEATURE_PERFTRACING
+
+EventPipeEventInstance::EventPipeEventInstance(
+ EventPipeEvent &event,
+ DWORD threadID,
+ BYTE *pData,
+ unsigned int length,
+ LPCGUID pActivityId,
+ LPCGUID pRelatedActivityId)
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_TRIGGERS;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+#ifdef _DEBUG
+ m_debugEventStart = 0xDEADBEEF;
+ m_debugEventEnd = 0xCAFEBABE;
+#endif // _DEBUG
+ m_pEvent = &event;
+ m_threadID = threadID;
+ if(pActivityId != NULL)
+ {
+ m_activityId = *pActivityId;
+ }
+ else
+ {
+ m_activityId = {0};
+ }
+ if(pRelatedActivityId != NULL)
+ {
+ m_relatedActivityId = *pRelatedActivityId;
+ }
+ else
+ {
+ m_relatedActivityId = {0};
+ }
+
+ m_pData = pData;
+ m_dataLength = length;
+ QueryPerformanceCounter(&m_timeStamp);
+
+ if(event.NeedStack())
+ {
+ EventPipe::WalkManagedStackForCurrentThread(m_stackContents);
+ }
+
+#ifdef _DEBUG
+ EnsureConsistency();
+#endif // _DEBUG
+}
+
+StackContents* EventPipeEventInstance::GetStack()
+{
+ LIMITED_METHOD_CONTRACT;
+
+ return &m_stackContents;
+}
+
+EventPipeEvent* EventPipeEventInstance::GetEvent() const
+{
+ LIMITED_METHOD_CONTRACT;
+
+ return m_pEvent;
+}
+
+LARGE_INTEGER EventPipeEventInstance::GetTimeStamp() const
+{
+ LIMITED_METHOD_CONTRACT;
+
+ return m_timeStamp;
+}
+
+BYTE* EventPipeEventInstance::GetData() const
+{
+ LIMITED_METHOD_CONTRACT;
+
+ return m_pData;
+}
+
+unsigned int EventPipeEventInstance::GetLength() const
+{
+ LIMITED_METHOD_CONTRACT;
+
+ return m_dataLength;
+}
+
+void EventPipeEventInstance::FastSerialize(FastSerializer *pSerializer, StreamLabel metadataLabel)
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_TRIGGERS;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+#ifdef EVENTPIPE_EVENT_MARKER
+ // Useful for diagnosing serialization bugs.
+ const unsigned int value = 0xDEADBEEF;
+ pSerializer->WriteBuffer((BYTE*)&value, sizeof(value));
+#endif
+
+ // Calculate the size of the total payload so that it can be written to the file.
+ unsigned int payloadLength =
+ sizeof(metadataLabel) +
+ sizeof(m_threadID) + // Thread ID
+ sizeof(m_timeStamp) + // TimeStamp
+ sizeof(m_activityId) + // Activity ID
+ sizeof(m_relatedActivityId) + // Related Activity ID
+ sizeof(m_dataLength) + // Data payload length
+ m_dataLength + // Event payload data
+ sizeof(unsigned int) + // Prepended stack payload size in bytes
+ m_stackContents.GetSize(); // Stack payload size
+
+ // Write the size of the event to the file.
+ pSerializer->WriteBuffer((BYTE*)&payloadLength, sizeof(payloadLength));
+
+ // Write the metadata label.
+ pSerializer->WriteBuffer((BYTE*)&metadataLabel, sizeof(metadataLabel));
+
+ // Write the thread ID.
+ pSerializer->WriteBuffer((BYTE*)&m_threadID, sizeof(m_threadID));
+
+ // Write the timestamp.
+ pSerializer->WriteBuffer((BYTE*)&m_timeStamp, sizeof(m_timeStamp));
+
+ // Write the activity id.
+ pSerializer->WriteBuffer((BYTE*)&m_activityId, sizeof(m_activityId));
+
+ // Write the related activity id.
+ pSerializer->WriteBuffer((BYTE*)&m_relatedActivityId, sizeof(m_relatedActivityId));
+
+ // Write the data payload size.
+ pSerializer->WriteBuffer((BYTE*)&m_dataLength, sizeof(m_dataLength));
+
+ // Write the event data payload.
+ if(m_dataLength > 0)
+ {
+ pSerializer->WriteBuffer(m_pData, m_dataLength);
+ }
+
+ // Write the size of the stack in bytes.
+ unsigned int stackSize = m_stackContents.GetSize();
+ pSerializer->WriteBuffer((BYTE*)&stackSize, sizeof(stackSize));
+
+ // Write the stack if present.
+ if(stackSize > 0)
+ {
+ pSerializer->WriteBuffer(m_stackContents.GetPointer(), stackSize);
+ }
+}
+
+#ifdef _DEBUG
+void EventPipeEventInstance::SerializeToJsonFile(EventPipeJsonFile *pFile)
+{
+ CONTRACTL
+ {
+ NOTHROW;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ if(pFile == NULL)
+ {
+ return;
+ }
+
+ EX_TRY
+ {
+ const unsigned int guidSize = 39;
+ WCHAR wszProviderID[guidSize];
+ if(!StringFromGUID2(m_pEvent->GetProvider()->GetProviderID(), wszProviderID, guidSize))
+ {
+ wszProviderID[0] = '\0';
+ }
+
+ // Strip off the {}.
+ StackScratchBuffer scratch;
+ SString guidStr(&wszProviderID[1], guidSize-3);
+
+ SString message;
+ message.Printf("Provider=%s/EventID=%d/Version=%d", guidStr.GetANSI(scratch), m_pEvent->GetEventID(), m_pEvent->GetEventVersion());
+ pFile->WriteEvent(m_timeStamp, m_threadID, message, m_stackContents);
+ }
+ EX_CATCH{} EX_END_CATCH(SwallowAllExceptions);
+}
+#endif
+
+void EventPipeEventInstance::SetTimeStamp(LARGE_INTEGER timeStamp)
+{
+ LIMITED_METHOD_CONTRACT;
+
+ m_timeStamp = timeStamp;
+}
+
+#ifdef _DEBUG
+bool EventPipeEventInstance::EnsureConsistency()
+{
+ CONTRACTL
+ {
+ NOTHROW;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ // Validate event start.
+ _ASSERTE(m_debugEventStart == 0xDEADBEEF);
+
+ // Validate event end.
+ _ASSERTE(m_debugEventEnd == 0xCAFEBABE);
+
+ return true;
+}
+#endif // _DEBUG
+
+SampleProfilerEventInstance::SampleProfilerEventInstance(EventPipeEvent &event, Thread *pThread, BYTE *pData, unsigned int length)
+ :EventPipeEventInstance(event, pThread->GetOSThreadId(), pData, length, NULL /* pActivityId */, NULL /* pRelatedActivityId */)
+{
+ LIMITED_METHOD_CONTRACT;
+}
+
+#endif // FEATURE_PERFTRACING
diff --git a/src/vm/eventpipeeventinstance.h b/src/vm/eventpipeeventinstance.h
new file mode 100644
index 0000000000..4fcf95c73e
--- /dev/null
+++ b/src/vm/eventpipeeventinstance.h
@@ -0,0 +1,90 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+#ifndef __EVENTPIPE_EVENTINSTANCE_H__
+#define __EVENTPIPE_EVENTINSTANCE_H__
+
+#ifdef FEATURE_PERFTRACING
+
+#include "eventpipe.h"
+#include "eventpipeevent.h"
+#include "fastserializableobject.h"
+#include "fastserializer.h"
+
+class EventPipeEventInstance
+{
+ // Declare friends.
+ friend EventPipeConfiguration;
+
+public:
+
+ EventPipeEventInstance(EventPipeEvent &event, DWORD threadID, BYTE *pData, unsigned int length, LPCGUID pActivityId, LPCGUID pRelatedActivityId);
+
+ // Get the event associated with this instance.
+ EventPipeEvent* GetEvent() const;
+
+ // Get the stack contents object to either read or write to it.
+ StackContents* GetStack();
+
+ // Get the timestamp.
+ LARGE_INTEGER GetTimeStamp() const;
+
+ // Get a pointer to the data payload.
+ BYTE* GetData() const;
+
+ // Get the length of the data.
+ unsigned int GetLength() const;
+
+ // Serialize this object using FastSerialization.
+ void FastSerialize(FastSerializer *pSerializer, StreamLabel metadataLabel);
+
+#ifdef _DEBUG
+ // Serialize this event to the JSON file.
+ void SerializeToJsonFile(EventPipeJsonFile *pFile);
+
+ bool EnsureConsistency();
+#endif // _DEBUG
+
+protected:
+
+#ifdef _DEBUG
+ unsigned int m_debugEventStart;
+#endif // _DEBUG
+
+ EventPipeEvent *m_pEvent;
+ DWORD m_threadID;
+ LARGE_INTEGER m_timeStamp;
+ GUID m_activityId;
+ GUID m_relatedActivityId;
+
+ BYTE *m_pData;
+ unsigned int m_dataLength;
+ StackContents m_stackContents;
+
+#ifdef _DEBUG
+ unsigned int m_debugEventEnd;
+#endif // _DEBUG
+
+private:
+
+ // This is used for metadata events by EventPipeConfiguration because
+ // the metadata event is created after the first instance of the event
+ // but must be inserted into the file before the first instance of the event.
+ void SetTimeStamp(LARGE_INTEGER timeStamp);
+};
+
+// A specific type of event instance for use by the SampleProfiler.
+// This is needed because the SampleProfiler knows how to walk stacks belonging
+// to threads other than the current thread.
+class SampleProfilerEventInstance : public EventPipeEventInstance
+{
+
+public:
+
+ SampleProfilerEventInstance(EventPipeEvent &event, Thread *pThread, BYTE *pData, unsigned int length);
+};
+
+#endif // FEATURE_PERFTRACING
+
+#endif // __EVENTPIPE_EVENTINSTANCE_H__
diff --git a/src/vm/eventpipefile.cpp b/src/vm/eventpipefile.cpp
new file mode 100644
index 0000000000..f574814586
--- /dev/null
+++ b/src/vm/eventpipefile.cpp
@@ -0,0 +1,164 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+#include "common.h"
+#include "eventpipebuffer.h"
+#include "eventpipeconfiguration.h"
+#include "eventpipefile.h"
+
+#ifdef FEATURE_PERFTRACING
+
+EventPipeFile::EventPipeFile(
+ SString &outputFilePath
+#ifdef _DEBUG
+ ,
+ bool lockOnWrite
+#endif // _DEBUG
+)
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_TRIGGERS;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ m_pSerializer = new FastSerializer(outputFilePath, *this);
+ m_serializationLock.Init(LOCK_TYPE_DEFAULT);
+ m_pMetadataLabels = new MapSHashWithRemove<EventPipeEvent*, StreamLabel>();
+
+#ifdef _DEBUG
+ m_lockOnWrite = lockOnWrite;
+#endif // _DEBUG
+
+ // File start time information.
+ GetSystemTime(&m_fileOpenSystemTime);
+ QueryPerformanceCounter(&m_fileOpenTimeStamp);
+ QueryPerformanceFrequency(&m_timeStampFrequency);
+
+ // Write a forward reference to the beginning of the event stream.
+ // This also allows readers to know where the event stream ends and skip it if needed.
+ m_beginEventsForwardReferenceIndex = m_pSerializer->AllocateForwardReference();
+ m_pSerializer->WriteForwardReference(m_beginEventsForwardReferenceIndex);
+
+ // Write the header information into the file.
+
+ // Write the current date and time.
+ m_pSerializer->WriteBuffer((BYTE*)&m_fileOpenSystemTime, sizeof(m_fileOpenSystemTime));
+
+ // Write FileOpenTimeStamp
+ m_pSerializer->WriteBuffer((BYTE*)&m_fileOpenTimeStamp, sizeof(m_fileOpenTimeStamp));
+
+ // Write ClockFrequency
+ m_pSerializer->WriteBuffer((BYTE*)&m_timeStampFrequency, sizeof(m_timeStampFrequency));
+}
+
+EventPipeFile::~EventPipeFile()
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_TRIGGERS;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ // Mark the end of the event stream.
+ StreamLabel currentLabel = m_pSerializer->GetStreamLabel();
+
+ // Define the event start forward reference.
+ m_pSerializer->DefineForwardReference(m_beginEventsForwardReferenceIndex, currentLabel);
+
+ // Close the serializer.
+ if(m_pSerializer != NULL)
+ {
+ delete(m_pSerializer);
+ m_pSerializer = NULL;
+ }
+}
+
+void EventPipeFile::WriteEvent(EventPipeEventInstance &instance)
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_TRIGGERS;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+#ifdef _DEBUG
+ if(m_lockOnWrite)
+ {
+ // Take the serialization lock.
+ // This is used for synchronous file writes.
+ // The circular buffer path only writes from one thread.
+ SpinLockHolder _slh(&m_serializationLock);
+ }
+#endif // _DEBUG
+
+ // Check to see if we've seen this event type before.
+ // If not, then write the event metadata to the event stream first.
+ StreamLabel metadataLabel = GetMetadataLabel(*instance.GetEvent());
+ if(metadataLabel == 0)
+ {
+ EventPipeEventInstance* pMetadataInstance = EventPipe::GetConfiguration()->BuildEventMetadataEvent(instance);
+
+ metadataLabel = m_pSerializer->GetStreamLabel();
+ pMetadataInstance->FastSerialize(m_pSerializer, (StreamLabel)0); // 0 breaks recursion and represents the metadata event.
+
+ SaveMetadataLabel(*instance.GetEvent(), metadataLabel);
+
+ delete[] (pMetadataInstance->GetData());
+ delete (pMetadataInstance);
+ }
+
+ // Write the event to the stream.
+ instance.FastSerialize(m_pSerializer, metadataLabel);
+}
+
+StreamLabel EventPipeFile::GetMetadataLabel(EventPipeEvent &event)
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_TRIGGERS;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ StreamLabel outLabel;
+ if(m_pMetadataLabels->Lookup(&event, &outLabel))
+ {
+ _ASSERTE(outLabel != 0);
+ return outLabel;
+ }
+
+ return 0;
+}
+
+void EventPipeFile::SaveMetadataLabel(EventPipeEvent &event, StreamLabel label)
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_TRIGGERS;
+ MODE_ANY;
+ PRECONDITION(label > 0);
+ }
+ CONTRACTL_END;
+
+ // If a pre-existing metadata label exists, remove it.
+ StreamLabel outLabel;
+ if(m_pMetadataLabels->Lookup(&event, &outLabel))
+ {
+ m_pMetadataLabels->Remove(&event);
+ }
+
+ // Add the metadata label.
+ m_pMetadataLabels->Add(&event, label);
+}
+
+#endif // FEATURE_PERFTRACING
diff --git a/src/vm/eventpipefile.h b/src/vm/eventpipefile.h
new file mode 100644
index 0000000000..2f6853545d
--- /dev/null
+++ b/src/vm/eventpipefile.h
@@ -0,0 +1,85 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+
+#ifndef __EVENTPIPE_FILE_H__
+#define __EVENTPIPE_FILE_H__
+
+#ifdef FEATURE_PERFTRACING
+
+#include "eventpipe.h"
+#include "eventpipeeventinstance.h"
+#include "fastserializableobject.h"
+#include "fastserializer.h"
+
+class EventPipeFile : public FastSerializableObject
+{
+ public:
+
+ EventPipeFile(SString &outputFilePath
+#ifdef _DEBUG
+ ,
+ bool lockOnWrite = false
+#endif // _DEBUG
+ );
+ ~EventPipeFile();
+
+ // Write an event to the file.
+ void WriteEvent(EventPipeEventInstance &instance);
+
+ // Serialize this object.
+ // Not supported - this is the entry object for the trace,
+ // which means that the contents hasn't yet been created.
+ void FastSerialize(FastSerializer *pSerializer)
+ {
+ LIMITED_METHOD_CONTRACT;
+ _ASSERTE(!"This function should never be called!");
+ }
+
+ // Get the type name of this object.
+ const char* GetTypeName()
+ {
+ LIMITED_METHOD_CONTRACT;
+ return "Microsoft.DotNet.Runtime.EventPipeFile";
+ }
+
+ private:
+
+ // Get the metadata address in the file for an event.
+ // The return value can be written into the file as a back-pointer to the event metadata.
+ StreamLabel GetMetadataLabel(EventPipeEvent &event);
+
+ // Save the metadata address in the file for an event.
+ void SaveMetadataLabel(EventPipeEvent &event, StreamLabel label);
+
+ // The object responsible for serialization.
+ FastSerializer *m_pSerializer;
+
+ // The system time when the file was opened.
+ SYSTEMTIME m_fileOpenSystemTime;
+
+ // The timestamp when the file was opened. Used for calculating file-relative timestamps.
+ LARGE_INTEGER m_fileOpenTimeStamp;
+
+ // The frequency of the timestamps used for this file.
+ LARGE_INTEGER m_timeStampFrequency;
+
+ // The forward reference index that marks the beginning of the event stream.
+ unsigned int m_beginEventsForwardReferenceIndex;
+
+ // The serialization which is responsible for making sure only a single event
+ // or block of events gets written to the file at once.
+ SpinLock m_serializationLock;
+
+ // Hashtable of metadata labels.
+ MapSHashWithRemove<EventPipeEvent*, StreamLabel> *m_pMetadataLabels;
+
+#ifdef _DEBUG
+ bool m_lockOnWrite;
+#endif // _DEBUG
+};
+
+#endif // FEATURE_PERFTRACING
+
+#endif // __EVENTPIPE_FILE_H__
diff --git a/src/vm/eventpipejsonfile.cpp b/src/vm/eventpipejsonfile.cpp
index 6353c917e7..f76959053c 100644
--- a/src/vm/eventpipejsonfile.cpp
+++ b/src/vm/eventpipejsonfile.cpp
@@ -5,6 +5,9 @@
#include "common.h"
#include "eventpipejsonfile.h"
+#ifdef _DEBUG
+#ifdef FEATURE_PERFTRACING
+
EventPipeJsonFile::EventPipeJsonFile(SString &outFilePath)
{
CONTRACTL
@@ -15,6 +18,7 @@ EventPipeJsonFile::EventPipeJsonFile(SString &outFilePath)
}
CONTRACTL_END;
+ m_writeErrorEncountered = false;
m_pFileStream = new CFileStream();
if(FAILED(m_pFileStream->OpenForWrite(outFilePath)))
{
@@ -52,7 +56,14 @@ EventPipeJsonFile::~EventPipeJsonFile()
}
}
-void EventPipeJsonFile::WriteEvent(CommonEventFields &commonFields, SString &message, StackContents &stackContents)
+void EventPipeJsonFile::WriteEvent(EventPipeEventInstance &instance)
+{
+ STANDARD_VM_CONTRACT;
+
+ instance.SerializeToJsonFile(this);
+}
+
+void EventPipeJsonFile::WriteEvent(LARGE_INTEGER timeStamp, DWORD threadID, SString &message, StackContents &stackContents)
{
STANDARD_VM_CONTRACT;
@@ -67,16 +78,16 @@ void EventPipeJsonFile::WriteEvent(CommonEventFields &commonFields, SString &mes
// Convert the timestamp from a QPC value to a trace-relative timestamp.
double millisecondsSinceTraceStart = 0.0;
- if(commonFields.TimeStamp.QuadPart != m_fileOpenTimeStamp.QuadPart)
+ if(timeStamp.QuadPart != m_fileOpenTimeStamp.QuadPart)
{
LARGE_INTEGER elapsedNanoseconds;
- elapsedNanoseconds.QuadPart = commonFields.TimeStamp.QuadPart - m_fileOpenTimeStamp.QuadPart;
+ elapsedNanoseconds.QuadPart = timeStamp.QuadPart - m_fileOpenTimeStamp.QuadPart;
millisecondsSinceTraceStart = elapsedNanoseconds.QuadPart / 1000000.0;
}
StackScratchBuffer scratch;
SString threadFrame;
- threadFrame.Printf("Thread (%d)", commonFields.ThreadID);
+ threadFrame.Printf("Thread (%d)", threadID);
SString event;
event.Printf("{\"Time\" : \"%f\", \"Metric\" : \"1\",\n\"Stack\": [\n\"%s\",\n%s\"%s\"]},", millisecondsSinceTraceStart, message.GetANSI(scratch), strCallStack.GetANSI(scratch), threadFrame.GetANSI(scratch));
Write(event);
@@ -129,3 +140,6 @@ void EventPipeJsonFile::FormatCallStack(StackContents &stackContents, SString &r
resultStr.Append(frameStr);
}
}
+
+#endif // _DEBUG
+#endif // FEATURE_PERFTRACING
diff --git a/src/vm/eventpipejsonfile.h b/src/vm/eventpipejsonfile.h
index b6e42def68..7686db7752 100644
--- a/src/vm/eventpipejsonfile.h
+++ b/src/vm/eventpipejsonfile.h
@@ -6,8 +6,12 @@
#ifndef __EVENTPIPE_JSONFILE_H__
#define __EVENTPIPE_JSONFILE_H__
+#ifdef _DEBUG
+#ifdef FEATURE_PERFTRACING
+
#include "common.h"
#include "eventpipe.h"
+#include "eventpipeeventinstance.h"
#include "fstream.h"
class EventPipeJsonFile
@@ -16,8 +20,11 @@ class EventPipeJsonFile
EventPipeJsonFile(SString &outFilePath);
~EventPipeJsonFile();
+ // Write an event instance.
+ void WriteEvent(EventPipeEventInstance &instance);
+
// Write an event with the specified message and stack.
- void WriteEvent(CommonEventFields &commonFields, SString &message, StackContents &stackContents);
+ void WriteEvent(LARGE_INTEGER timeStamp, DWORD threadID, SString &message, StackContents &stackContents);
private:
@@ -37,4 +44,7 @@ class EventPipeJsonFile
LARGE_INTEGER m_fileOpenTimeStamp;
};
+#endif // FEATURE_PERFTRACING
+#endif // _DEBUG
+
#endif // __EVENTPIPE_JSONFILE_H__
diff --git a/src/vm/eventpipeprovider.cpp b/src/vm/eventpipeprovider.cpp
new file mode 100644
index 0000000000..896f9b2650
--- /dev/null
+++ b/src/vm/eventpipeprovider.cpp
@@ -0,0 +1,244 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+#include "common.h"
+#include "eventpipe.h"
+#include "eventpipeconfiguration.h"
+#include "eventpipeevent.h"
+#include "eventpipeprovider.h"
+
+#ifdef FEATURE_PERFTRACING
+
+EventPipeProvider::EventPipeProvider(const GUID &providerID, EventPipeCallback pCallbackFunction, void *pCallbackData)
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ m_providerID = providerID;
+ m_enabled = false;
+ m_keywords = 0;
+ m_providerLevel = EventPipeEventLevel::Critical;
+ m_pEventList = new SList<SListElem<EventPipeEvent*>>();
+ m_pCallbackFunction = pCallbackFunction;
+ m_pCallbackData = pCallbackData;
+ m_pConfig = EventPipe::GetConfiguration();
+ _ASSERTE(m_pConfig != NULL);
+
+ // Register the provider.
+ m_pConfig->RegisterProvider(*this);
+}
+
+EventPipeProvider::~EventPipeProvider()
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ // Unregister the provider.
+ // This call is re-entrant.
+ // NOTE: We don't use the cached event pipe configuration pointer
+ // in case this runs during shutdown and the configuration has already
+ // been freed.
+ EventPipeConfiguration* pConfig = EventPipe::GetConfiguration();
+ _ASSERTE(pConfig != NULL);
+ pConfig->UnregisterProvider(*this);
+
+ // Free all of the events.
+ if(m_pEventList != NULL)
+ {
+ // Take the lock before manipulating the list.
+ CrstHolder _crst(EventPipe::GetLock());
+
+ SListElem<EventPipeEvent*> *pElem = m_pEventList->GetHead();
+ while(pElem != NULL)
+ {
+ EventPipeEvent *pEvent = pElem->GetValue();
+ delete pEvent;
+
+ pElem = m_pEventList->GetNext(pElem);
+ }
+
+ delete m_pEventList;
+ m_pEventList = NULL;
+ }
+}
+
+const GUID& EventPipeProvider::GetProviderID() const
+{
+ LIMITED_METHOD_CONTRACT;
+
+ return m_providerID;
+}
+
+bool EventPipeProvider::Enabled() const
+{
+ LIMITED_METHOD_CONTRACT;
+
+ return (m_pConfig->Enabled() && m_enabled);
+}
+
+bool EventPipeProvider::EventEnabled(INT64 keywords) const
+{
+ LIMITED_METHOD_CONTRACT;
+
+ // The event is enabled if:
+ // - The provider is enabled.
+ // - The event keywords are unspecified in the manifest (== 0) or when masked with the enabled config are != 0.
+ return (Enabled() && ((keywords == 0) || ((m_keywords & keywords) != 0)));
+}
+
+bool EventPipeProvider::EventEnabled(INT64 keywords, EventPipeEventLevel eventLevel) const
+{
+ LIMITED_METHOD_CONTRACT;
+
+ // The event is enabled if:
+ // - The provider is enabled.
+ // - The event keywords are unspecified in the manifest (== 0) or when masked with the enabled config are != 0.
+ // - The event level is LogAlways or the provider's verbosity level is set to greater than the event's verbosity level in the manifest.
+ return (EventEnabled(keywords) &&
+ ((eventLevel == EventPipeEventLevel::LogAlways) || (m_providerLevel >= eventLevel)));
+}
+
+void EventPipeProvider::SetConfiguration(bool providerEnabled, INT64 keywords, EventPipeEventLevel providerLevel)
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ PRECONDITION(EventPipe::GetLock()->OwnedByCurrentThread());
+ }
+ CONTRACTL_END;
+
+ m_enabled = providerEnabled;
+ m_keywords = keywords;
+ m_providerLevel = providerLevel;
+
+ RefreshAllEvents();
+ InvokeCallback();
+}
+
+EventPipeEvent* EventPipeProvider::AddEvent(unsigned int eventID, INT64 keywords, unsigned int eventVersion, EventPipeEventLevel level, BYTE *pMetadata, unsigned int metadataLength)
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ return AddEvent(eventID, keywords, eventVersion, level, true /* needStack */, pMetadata, metadataLength);
+}
+
+EventPipeEvent* EventPipeProvider::AddEvent(unsigned int eventID, INT64 keywords, unsigned int eventVersion, EventPipeEventLevel level, bool needStack, BYTE *pMetadata, unsigned int metadataLength)
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ // Create the event.
+ EventPipeEvent *pEvent = new EventPipeEvent(
+ *this,
+ keywords,
+ eventID,
+ eventVersion,
+ level,
+ needStack,
+ pMetadata,
+ metadataLength);
+
+ // Add it to the list of events.
+ AddEvent(*pEvent);
+ return pEvent;
+}
+
+void EventPipeProvider::AddEvent(EventPipeEvent &event)
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ // Take the config lock before inserting a new event.
+ CrstHolder _crst(EventPipe::GetLock());
+
+ m_pEventList->InsertTail(new SListElem<EventPipeEvent*>(&event));
+ event.RefreshState();
+}
+
+void EventPipeProvider::InvokeCallback()
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ PRECONDITION(EventPipe::GetLock()->OwnedByCurrentThread());
+ }
+ CONTRACTL_END;
+
+ if(m_pCallbackFunction != NULL && !g_fEEShutDown)
+ {
+ (*m_pCallbackFunction)(
+ &m_providerID,
+ m_enabled,
+ (UCHAR) m_providerLevel,
+ m_keywords,
+ 0 /* matchAllKeywords */,
+ NULL /* FilterData */,
+ m_pCallbackData /* CallbackContext */);
+ }
+}
+
+bool EventPipeProvider::GetDeleteDeferred() const
+{
+ LIMITED_METHOD_CONTRACT;
+ return m_deleteDeferred;
+}
+
+void EventPipeProvider::SetDeleteDeferred()
+{
+ LIMITED_METHOD_CONTRACT;
+ m_deleteDeferred = true;
+}
+
+void EventPipeProvider::RefreshAllEvents()
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ PRECONDITION(EventPipe::GetLock()->OwnedByCurrentThread());
+ }
+ CONTRACTL_END;
+
+ SListElem<EventPipeEvent*> *pElem = m_pEventList->GetHead();
+ while(pElem != NULL)
+ {
+ EventPipeEvent *pEvent = pElem->GetValue();
+ pEvent->RefreshState();
+
+ pElem = m_pEventList->GetNext(pElem);
+ }
+}
+
+#endif // FEATURE_PERFTRACING
diff --git a/src/vm/eventpipeprovider.h b/src/vm/eventpipeprovider.h
new file mode 100644
index 0000000000..d2c459ef32
--- /dev/null
+++ b/src/vm/eventpipeprovider.h
@@ -0,0 +1,117 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+#ifndef __EVENTPIPE_PROVIDER_H__
+#define __EVENTPIPE_PROVIDER_H__
+
+#ifdef FEATURE_PERFTRACING
+
+#include "eventpipe.h"
+#include "eventpipeconfiguration.h"
+#include "slist.h"
+
+class EventPipeEvent;
+
+// Define the event pipe callback to match the ETW callback signature.
+typedef void (*EventPipeCallback)(
+ LPCGUID SourceID,
+ ULONG IsEnabled,
+ UCHAR Level,
+ ULONGLONG MatchAnyKeywords,
+ ULONGLONG MatchAllKeywords,
+ void *FilterData,
+ void *CallbackContext);
+
+class EventPipeProvider
+{
+ // Declare friends.
+ friend class EventPipe;
+ friend class EventPipeConfiguration;
+ friend class SampleProfiler;
+
+private:
+ // The GUID of the provider.
+ GUID m_providerID;
+
+ // True if the provider is enabled.
+ bool m_enabled;
+
+ // Bit vector containing the currently enabled keywords.
+ INT64 m_keywords;
+
+ // The current verbosity of the provider.
+ EventPipeEventLevel m_providerLevel;
+
+ // List of every event currently associated with the provider.
+ // New events can be added on-the-fly.
+ SList<SListElem<EventPipeEvent*>> *m_pEventList;
+
+ // The optional provider callback.
+ EventPipeCallback m_pCallbackFunction;
+
+ // The optional provider callback data pointer.
+ void *m_pCallbackData;
+
+ // The configuration object.
+ EventPipeConfiguration *m_pConfig;
+
+ // True if the provider has been deleted, but that deletion
+ // has been deferred until tracing is stopped.
+ bool m_deleteDeferred;
+
+ // Private constructor because all providers are created through EventPipe::CreateProvider.
+ EventPipeProvider(const GUID &providerID, EventPipeCallback pCallbackFunction = NULL, void *pCallbackData = NULL);
+
+public:
+
+ ~EventPipeProvider();
+
+ // Get the provider ID.
+ const GUID& GetProviderID() const;
+
+ // Determine if the provider is enabled.
+ bool Enabled() const;
+
+ // Determine if the specified keywords are enabled.
+ bool EventEnabled(INT64 keywords) const;
+
+ // Determine if the specified keywords and level match the configuration.
+ bool EventEnabled(INT64 keywords, EventPipeEventLevel eventLevel) const;
+
+ // Create a new event.
+ EventPipeEvent* AddEvent(unsigned int eventID, INT64 keywords, unsigned int eventVersion, EventPipeEventLevel level, BYTE *pMetadata = NULL, unsigned int metadataLength = 0);
+
+ private:
+
+ // Create a new event, but allow needStack to be specified.
+ // In general, we want stack walking to be controlled by the consumer and not the producer of events.
+ // However, there are a couple of cases that we know we don't want to do a stackwalk that would affect performance significantly:
+ // 1. Sample profiler events: The sample profiler already does a stack walk of the target thread. Doing one of the sampler thread is a waste.
+ // 2. Metadata events: These aren't as painful but because we have to keep this functionality around, might as well use it.
+ EventPipeEvent* AddEvent(unsigned int eventID, INT64 keywords, unsigned int eventVersion, EventPipeEventLevel level, bool needStack, BYTE *pMetadata = NULL, unsigned int metadataLength = 0);
+
+ // Add an event to the provider.
+ void AddEvent(EventPipeEvent &event);
+
+ // Set the provider configuration (enable and disable sets of events).
+ // This is called by EventPipeConfiguration.
+ void SetConfiguration(bool providerEnabled, INT64 keywords, EventPipeEventLevel providerLevel);
+
+ // Refresh the runtime state of all events.
+ void RefreshAllEvents();
+
+ // Invoke the provider callback.
+ void InvokeCallback();
+
+ // Specifies whether or not the provider was deleted, but that deletion
+ // was deferred until after tracing is stopped.
+ bool GetDeleteDeferred() const;
+
+ // Defer deletion of the provider.
+ void SetDeleteDeferred();
+};
+
+#endif // FEATURE_PERFTRACING
+
+#endif // __EVENTPIPE_PROVIDER_H__
diff --git a/src/vm/eventtrace.cpp b/src/vm/eventtrace.cpp
index 1eb89385a6..84ce711c1f 100644
--- a/src/vm/eventtrace.cpp
+++ b/src/vm/eventtrace.cpp
@@ -197,7 +197,10 @@ BOOL IsRundownNgenKeywordEnabledAndNotSuppressed()
{
LIMITED_METHOD_CONTRACT;
- return
+ return
+#ifdef FEATURE_PERFTRACING
+ EventPipeHelper::Enabled() ||
+#endif // FEATURE_PERFTRACING
(
ETW_TRACING_CATEGORY_ENABLED(
MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_Context,
@@ -4465,10 +4468,10 @@ extern "C"
#ifdef _TARGET_AMD64_
// We only do this on amd64 (NOT ARM, because ARM uses frame based stack crawling)
- // If we have turned on the JIT keyword to the VERBOSE setting (needed to get JIT names) then
+ // If we have turned on the JIT keyword to the INFORMATION setting (needed to get JIT names) then
// we assume that we also want good stack traces so we need to publish unwind information so
// ETW can get at it
- if(bIsPublicTraceHandle && ETW_CATEGORY_ENABLED((*context), TRACE_LEVEL_VERBOSE, CLR_RUNDOWNJIT_KEYWORD))
+ if(bIsPublicTraceHandle && ETW_CATEGORY_ENABLED((*context), TRACE_LEVEL_INFORMATION, CLR_RUNDOWNJIT_KEYWORD))
UnwindInfoTable::PublishUnwindInfo(g_fEEStarted != FALSE);
#endif
@@ -6760,9 +6763,9 @@ VOID ETW::MethodLog::SendHelperEvent(ULONGLONG ullHelperStartAddress, ULONG ulHe
ulHelperSize,
0,
methodFlags,
- NULL,
+ NULL,
pHelperName,
- NULL,
+ NULL,
GetClrInstanceId());
}
}
@@ -7385,3 +7388,12 @@ VOID ETW::EnumerationLog::EnumerationHelper(Module *moduleFilter, BaseDomain *do
}
#endif // !FEATURE_REDHAWK
+
+#ifdef FEATURE_PERFTRACING
+#include "eventpipe.h"
+bool EventPipeHelper::Enabled()
+{
+ LIMITED_METHOD_CONTRACT;
+ return EventPipe::Enabled();
+}
+#endif // FEATURE_PERFTRACING
diff --git a/src/vm/exceptionhandling.cpp b/src/vm/exceptionhandling.cpp
index 7030ef5e91..abea194b92 100644
--- a/src/vm/exceptionhandling.cpp
+++ b/src/vm/exceptionhandling.cpp
@@ -25,11 +25,15 @@
#define VSD_STUB_CAN_THROW_AV
#endif // _TARGET_ARM_ || _TARGET_X86_
+#if defined(_TARGET_ARM_) || defined(_TARGET_ARM64_)
+// ARM/ARM64 uses Caller-SP to locate PSPSym in the funclet frame.
+#define USE_CALLER_SP_IN_FUNCLET
+#endif // _TARGET_ARM_ || _TARGET_ARM64_
+
#if defined(_TARGET_ARM_) || defined(_TARGET_ARM64_) || defined(_TARGET_X86_)
#define ADJUST_PC_UNWOUND_TO_CALL
#define STACK_RANGE_BOUNDS_ARE_CALLER_SP
#define USE_FUNCLET_CALL_HELPER
-#define USE_CALLER_SP_IN_FUNCLET
// For ARM/ARM64, EstablisherFrame is Caller-SP (SP just before executing call instruction).
// This has been confirmed by AaronGi from the kernel team for Windows.
//
diff --git a/src/vm/fastserializableobject.h b/src/vm/fastserializableobject.h
new file mode 100644
index 0000000000..cbfcfc9f0e
--- /dev/null
+++ b/src/vm/fastserializableobject.h
@@ -0,0 +1,32 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+#ifndef __FASTSERIALIZABLE_OBJECT_H__
+#define __FASTSERIALIZABLE_OBJECT_H__
+
+#ifdef FEATURE_PERFTRACING
+
+class FastSerializer;
+
+class FastSerializableObject
+{
+
+public:
+
+ // Virtual destructor to ensure that derived class destructors get called.
+ virtual ~FastSerializableObject()
+ {
+ LIMITED_METHOD_CONTRACT;
+ }
+
+ // Serialize the object using the specified serializer.
+ virtual void FastSerialize(FastSerializer *pSerializer) = 0;
+
+ // Get the type name for the current object.
+ virtual const char* GetTypeName() = 0;
+};
+
+#endif // FEATURE_PERFTRACING
+
+#endif // _FASTSERIALIZABLE_OBJECT_H__
diff --git a/src/vm/fastserializer.cpp b/src/vm/fastserializer.cpp
new file mode 100644
index 0000000000..7f9b4e20a6
--- /dev/null
+++ b/src/vm/fastserializer.cpp
@@ -0,0 +1,337 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+#include "common.h"
+#include "fastserializer.h"
+
+#ifdef FEATURE_PERFTRACING
+
+FastSerializer::FastSerializer(SString &outputFilePath, FastSerializableObject &object)
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_TRIGGERS;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ m_writeErrorEncountered = false;
+ m_pEntryObject = &object;
+ m_currentPos = 0;
+ m_nextForwardReference = 0;
+ m_pFileStream = new CFileStream();
+ if(FAILED(m_pFileStream->OpenForWrite(outputFilePath)))
+ {
+ delete(m_pFileStream);
+ m_pFileStream = NULL;
+ return;
+ }
+
+ // Write the file header.
+ WriteFileHeader();
+
+ // Write the entry object.
+ WriteEntryObject();
+}
+
+FastSerializer::~FastSerializer()
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_TRIGGERS;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ // Write the end of the entry object.
+ WriteTag(FastSerializerTags::EndObject);
+
+ // Write forward reference table.
+ StreamLabel forwardReferenceLabel = WriteForwardReferenceTable();
+
+ // Write trailer.
+ WriteTrailer(forwardReferenceLabel);
+
+ if(m_pFileStream != NULL)
+ {
+ delete(m_pFileStream);
+ m_pFileStream = NULL;
+ }
+}
+
+StreamLabel FastSerializer::GetStreamLabel() const
+{
+ LIMITED_METHOD_CONTRACT;
+
+ return (StreamLabel)m_currentPos;
+}
+
+void FastSerializer::WriteObject(FastSerializableObject *pObject)
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_TRIGGERS;
+ MODE_ANY;
+ PRECONDITION(pObject != NULL);
+ }
+ CONTRACTL_END;
+
+ // Write a BeginObject tag.
+ WriteTag(FastSerializerTags::BeginObject);
+
+ // Write object begin tag.
+ WriteSerializationType(pObject);
+
+ // Ask the object to serialize itself using the current serializer.
+ pObject->FastSerialize(this);
+
+ // Write object end tag.
+ WriteTag(FastSerializerTags::EndObject);
+}
+
+void FastSerializer::WriteBuffer(BYTE *pBuffer, unsigned int length)
+{
+ CONTRACTL
+ {
+ NOTHROW;
+ GC_TRIGGERS;
+ MODE_PREEMPTIVE;
+ PRECONDITION(pBuffer != NULL);
+ PRECONDITION(length > 0);
+ }
+ CONTRACTL_END;
+
+ if(m_writeErrorEncountered || m_pFileStream == NULL)
+ {
+ return;
+ }
+
+ EX_TRY
+ {
+ ULONG outCount;
+ m_pFileStream->Write(pBuffer, length, &outCount);
+
+#ifdef _DEBUG
+ size_t prevPos = m_currentPos;
+#endif
+ m_currentPos += outCount;
+#ifdef _DEBUG
+ _ASSERTE(prevPos < m_currentPos);
+#endif
+
+ if (length != outCount)
+ {
+ // This will cause us to stop writing to the file.
+ // The file will still remain open until shutdown so that we don't have to take a lock at this level when we touch the file stream.
+ m_writeErrorEncountered = true;
+ }
+ }
+ EX_CATCH
+ {
+ m_writeErrorEncountered = true;
+ }
+ EX_END_CATCH(SwallowAllExceptions);
+}
+
+void FastSerializer::WriteEntryObject()
+{
+ CONTRACTL
+ {
+ NOTHROW;
+ GC_TRIGGERS;
+ MODE_PREEMPTIVE;
+ }
+ CONTRACTL_END;
+
+ // Write begin entry object tag.
+ WriteTag(FastSerializerTags::BeginObject);
+
+ // Write the type information for the entry object.
+ WriteSerializationType(m_pEntryObject);
+
+ // The object is now initialized. Fields or other objects can now be written.
+}
+
+unsigned int FastSerializer::AllocateForwardReference()
+{
+ CONTRACTL
+ {
+ NOTHROW;
+ GC_TRIGGERS;
+ MODE_PREEMPTIVE;
+ PRECONDITION(m_nextForwardReference < MaxForwardReferences);
+ }
+ CONTRACTL_END;
+
+ // TODO: Handle failure.
+
+ // Save the index.
+ int index = m_nextForwardReference;
+
+ // Allocate the forward reference and zero-fill it so that the reader
+ // will know if it was not properly defined.
+ m_forwardReferences[m_nextForwardReference++] = 0;
+
+ return index;
+}
+
+void FastSerializer::DefineForwardReference(unsigned int index, StreamLabel value)
+{
+ CONTRACTL
+ {
+ NOTHROW;
+ GC_TRIGGERS;
+ MODE_PREEMPTIVE;
+ PRECONDITION(index < MaxForwardReferences-1);
+ }
+ CONTRACTL_END;
+
+ m_forwardReferences[index] = value;
+}
+
+void FastSerializer::WriteForwardReference(unsigned int index)
+{
+ CONTRACTL
+ {
+ NOTHROW;
+ GC_TRIGGERS;
+ MODE_PREEMPTIVE;
+ PRECONDITION(index < MaxForwardReferences-1);
+ }
+ CONTRACTL_END;
+
+ WriteBuffer((BYTE*)&index, sizeof(index));
+}
+
+void FastSerializer::WriteSerializationType(FastSerializableObject *pObject)
+{
+ CONTRACTL
+ {
+ NOTHROW;
+ GC_TRIGGERS;
+ MODE_PREEMPTIVE;
+ PRECONDITION(pObject != NULL);
+ }
+ CONTRACTL_END;
+
+ // Write the BeginObject tag.
+ WriteTag(FastSerializerTags::BeginObject);
+
+ // Write a NullReferenceTag, which implies that the following fields belong to SerializationType.
+ WriteTag(FastSerializerTags::NullReference);
+
+ // Write the SerializationType version fields.
+ int serializationType[2];
+ serializationType[0] = 1; // Object Version.
+ serializationType[1] = 0; // Minimum Reader Version.
+ WriteBuffer((BYTE*) &serializationType, sizeof(serializationType));
+
+ // Write the SerializationType TypeName field.
+ const char *strTypeName = pObject->GetTypeName();
+ unsigned int length = (unsigned int)strlen(strTypeName);
+ WriteString(strTypeName, length);
+
+ // Write the EndObject tag.
+ WriteTag(FastSerializerTags::EndObject);
+}
+
+
+void FastSerializer::WriteTag(FastSerializerTags tag, BYTE *payload, unsigned int payloadLength)
+{
+ CONTRACTL
+ {
+ NOTHROW;
+ GC_TRIGGERS;
+ MODE_PREEMPTIVE;
+ }
+ CONTRACTL_END;
+
+ WriteBuffer((BYTE *)&tag, sizeof(tag));
+ if(payload != NULL)
+ {
+ _ASSERTE(payloadLength > 0);
+ WriteBuffer(payload, payloadLength);
+ }
+}
+
+
+void FastSerializer::WriteFileHeader()
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_TRIGGERS;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ const char *strSignature = "!FastSerialization.1";
+ unsigned int length = (unsigned int)strlen(strSignature);
+ WriteString(strSignature, length);
+}
+
+void FastSerializer::WriteString(const char *strContents, unsigned int length)
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_TRIGGERS;
+ MODE_PREEMPTIVE;
+ }
+ CONTRACTL_END;
+
+ // Write the string length .
+ WriteBuffer((BYTE*) &length, sizeof(length));
+
+ // Write the string contents.
+ WriteBuffer((BYTE*) strContents, length);
+}
+
+StreamLabel FastSerializer::WriteForwardReferenceTable()
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_TRIGGERS;
+ MODE_PREEMPTIVE;
+ }
+ CONTRACTL_END;
+
+ // Save the position of the start of the forward references table.
+ StreamLabel current = GetStreamLabel();
+
+ // Write the count of allocated references.
+ WriteBuffer((BYTE*) &m_nextForwardReference, sizeof(m_nextForwardReference));
+
+ // Write each of the allocated references.
+ WriteBuffer((BYTE*) m_forwardReferences, sizeof(StreamLabel) * m_nextForwardReference);
+
+ return current;
+}
+
+void FastSerializer::WriteTrailer(StreamLabel forwardReferencesTableStart)
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_TRIGGERS;
+ MODE_PREEMPTIVE;
+ }
+ CONTRACTL_END;
+
+ // Get the current location to mark the beginning of the trailer.
+ StreamLabel current = GetStreamLabel();
+
+ // Write the trailer, which contains the start of the forward references table.
+ WriteBuffer((BYTE*) &forwardReferencesTableStart, sizeof(forwardReferencesTableStart));
+
+ // Write the location of the trailer. This is the final piece of data written to the file,
+ // so that it can be easily found by a reader that can seek to the end of the file.
+ WriteBuffer((BYTE*) &current, sizeof(current));
+}
+
+#endif // FEATURE_PERFTRACING
diff --git a/src/vm/fastserializer.h b/src/vm/fastserializer.h
new file mode 100644
index 0000000000..5fd2cfd4a5
--- /dev/null
+++ b/src/vm/fastserializer.h
@@ -0,0 +1,74 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+#ifndef __FASTSERIALIZER_H__
+#define __FASTSERIALIZER_H__
+
+#ifdef FEATURE_PERFTRACING
+
+#include "fastserializableobject.h"
+#include "fstream.h"
+
+class FastSerializer;
+
+typedef unsigned int StreamLabel;
+
+enum class FastSerializerTags : BYTE
+{
+ Error, // To improve debugabilty, 0 is an illegal tag.
+ NullReference, // Tag for a null object forwardReference.
+ ObjectReference, // Followed by StreamLabel
+ ForwardReference, // Followed by an index (32-bit integer) into the Forward forwardReference array and a Type object
+ BeginObject, // Followed by Type object, object data, tagged EndObject
+ BeginPrivateObject, // Like beginObject, but not placed in interning table on deserialiation
+ EndObject, // Placed after an object to mark its end.
+ ForwardDefinition, // Followed by a forward forwardReference index and an object definition (BeginObject)
+ Byte,
+ Int16,
+ Int32,
+ Int64,
+ SkipRegion,
+ String,
+ Limit, // Just past the last valid tag, used for asserts.
+};
+
+class FastSerializer
+{
+public:
+
+ FastSerializer(SString &outputFilePath, FastSerializableObject &object);
+ ~FastSerializer();
+
+ StreamLabel GetStreamLabel() const;
+
+ void WriteObject(FastSerializableObject *pObject);
+ void WriteBuffer(BYTE *pBuffer, unsigned int length);
+ void WriteTag(FastSerializerTags tag, BYTE *payload = NULL, unsigned int payloadLength = 0);
+ void WriteString(const char *strContents, unsigned int length);
+
+ unsigned int AllocateForwardReference();
+ void DefineForwardReference(unsigned int index, StreamLabel value);
+ void WriteForwardReference(unsigned int index);
+
+private:
+
+ void WriteEntryObject();
+ void WriteSerializationType(FastSerializableObject *pObject);
+ void WriteFileHeader();
+ StreamLabel WriteForwardReferenceTable();
+ void WriteTrailer(StreamLabel forwardReferencesTableStart);
+
+ CFileStream *m_pFileStream;
+ bool m_writeErrorEncountered;
+ FastSerializableObject *m_pEntryObject;
+ size_t m_currentPos;
+
+ static const unsigned int MaxForwardReferences = 100;
+ StreamLabel m_forwardReferences[MaxForwardReferences];
+ unsigned int m_nextForwardReference;
+};
+
+#endif // FEATURE_PERFTRACING
+
+#endif // __FASTSERIALIZER_H__
diff --git a/src/vm/field.cpp b/src/vm/field.cpp
index 9cdb16f6b9..defccd7269 100644
--- a/src/vm/field.cpp
+++ b/src/vm/field.cpp
@@ -738,7 +738,7 @@ void FieldDesc::SaveContents(DataImage *image)
// image.
//
- if (IsILOnlyRVAField())
+ if (IsRVA())
{
//
// Move the RVA data into the prejit image.
@@ -888,12 +888,15 @@ TypeHandle FieldDesc::GetExactFieldType(TypeHandle owner)
GetSig(&pSig, &cSig);
SigPointer sig(pSig, cSig);
+ ULONG callConv;
+ IfFailThrow(sig.GetCallingConv(&callConv));
+ _ASSERTE(callConv == IMAGE_CEE_CS_CALLCONV_FIELD);
+
// Get the generics information
SigTypeContext sigTypeContext(GetExactClassInstantiation(owner), Instantiation());
- TypeHandle thApproxFieldType = GetApproxFieldTypeHandleThrowing();
// Load the exact type
- RETURN (sig.GetTypeHandleThrowing(thApproxFieldType.GetModule(), &sigTypeContext));
+ RETURN (sig.GetTypeHandleThrowing(GetModule(), &sigTypeContext));
}
}
diff --git a/src/vm/field.h b/src/vm/field.h
index 8e762eb4e4..030a0aad86 100644
--- a/src/vm/field.h
+++ b/src/vm/field.h
@@ -274,12 +274,6 @@ public:
: dwOffset;
}
- BOOL IsILOnlyRVAField()
- {
- WRAPPER_NO_CONTRACT;
- return (IsRVA() && GetModule()->GetFile()->IsILOnly());
- }
-
DWORD IsStatic() const
{
LIMITED_METHOD_DAC_CONTRACT;
diff --git a/src/vm/i386/cgenx86.cpp b/src/vm/i386/cgenx86.cpp
index 14909b93e5..0a276c0ff9 100644
--- a/src/vm/i386/cgenx86.cpp
+++ b/src/vm/i386/cgenx86.cpp
@@ -1302,30 +1302,6 @@ extern "C" VOID STDCALL StubRareDisableTHROWWorker(Thread *pThread)
pThread->HandleThreadAbort();
}
-#ifndef FEATURE_PAL
-// Note that this logic is copied below, in PopSEHRecords
-__declspec(naked)
-VOID __cdecl PopSEHRecords(LPVOID pTargetSP)
-{
- // No CONTRACT possible on naked functions
- STATIC_CONTRACT_NOTHROW;
- STATIC_CONTRACT_GC_NOTRIGGER;
-
- __asm{
- mov ecx, [esp+4] ;; ecx <- pTargetSP
- mov eax, fs:[0] ;; get current SEH record
- poploop:
- cmp eax, ecx
- jge done
- mov eax, [eax] ;; get next SEH record
- jmp poploop
- done:
- mov fs:[0], eax
- retn
- }
-}
-#endif // FEATURE_PAL
-
//////////////////////////////////////////////////////////////////////////////
//
// JITInterface
diff --git a/src/vm/i386/excepcpu.h b/src/vm/i386/excepcpu.h
index d70c6620a1..a97128b9fc 100644
--- a/src/vm/i386/excepcpu.h
+++ b/src/vm/i386/excepcpu.h
@@ -97,10 +97,6 @@ EXTERN_C LPVOID STDCALL COMPlusEndCatch(LPVOID ebp, DWORD ebx, DWORD edi, DWORD
PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrame(CONTEXT * pContext);
#ifdef WIN64EXCEPTIONS
PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrame(T_DISPATCHER_CONTEXT * pDispatcherContext);
-
-class FaultingExceptionFrame;
-
-FaultingExceptionFrame *GetFrameFromRedirectedStubStackFrame (DISPATCHER_CONTEXT *pDispatcherContext);
#endif // WIN64EXCEPTIONS
// Determine the address of the instruction that made the current call.
diff --git a/src/vm/i386/excepx86.cpp b/src/vm/i386/excepx86.cpp
index 8c65db75a7..cf01147341 100644
--- a/src/vm/i386/excepx86.cpp
+++ b/src/vm/i386/excepx86.cpp
@@ -370,7 +370,6 @@ CPFH_AdjustContextForThreadSuspensionRace(CONTEXT *pContext, Thread *pThread)
{
WRAPPER_NO_CONTRACT;
-#ifndef FEATURE_PAL
PCODE f_IP = GetIP(pContext);
if (Thread::IsAddrOfRedirectFunc((PVOID)f_IP)) {
@@ -427,9 +426,6 @@ CPFH_AdjustContextForThreadSuspensionRace(CONTEXT *pContext, Thread *pThread)
SetIP(pContext, GetIP(pThread->m_OSContext) - 1);
STRESS_LOG1(LF_EH, LL_INFO100, "CPFH_AdjustContextForThreadSuspensionRace: Case 4 setting IP = %x\n", pContext->Eip);
}
-#else
- PORTABILITY_ASSERT("CPFH_AdjustContextForThreadSuspensionRace");
-#endif
}
#endif // FEATURE_HIJACK
@@ -1147,7 +1143,6 @@ CPFH_RealFirstPassHandler( // ExceptionContinueSearch, etc.
pExInfo->m_pExceptionPointers = &exceptionPointers;
-#ifndef FEATURE_PAL
if (bRethrownException || bNestedException)
{
_ASSERTE(pExInfo->m_pPrevNestedInfo != NULL);
@@ -1156,7 +1151,6 @@ CPFH_RealFirstPassHandler( // ExceptionContinueSearch, etc.
SetStateForWatsonBucketing(bRethrownException, pExInfo->GetPreviousExceptionTracker()->GetThrowableAsHandle());
END_SO_INTOLERANT_CODE;
}
-#endif
#ifdef DEBUGGING_SUPPORTED
//
@@ -1971,17 +1965,10 @@ PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrame(CONTEXT * pContext)
}
#if !defined(DACCESS_COMPILE)
-#ifdef FEATURE_PAL
-static PEXCEPTION_REGISTRATION_RECORD CurrentSEHRecord = EXCEPTION_CHAIN_END;
-#endif
-
PEXCEPTION_REGISTRATION_RECORD GetCurrentSEHRecord()
{
WRAPPER_NO_CONTRACT;
-#ifdef FEATURE_PAL
- LPVOID fs0 = CurrentSEHRecord;
-#else // FEATURE_PAL
LPVOID fs0 = (LPVOID)__readfsdword(0);
#if 0 // This walk is too expensive considering we hit it every time we a CONTRACT(NOTHROW)
@@ -2013,24 +2000,18 @@ PEXCEPTION_REGISTRATION_RECORD GetCurrentSEHRecord()
}
#endif
#endif // 0
-#endif // FEATURE_PAL
return (EXCEPTION_REGISTRATION_RECORD*) fs0;
}
PEXCEPTION_REGISTRATION_RECORD GetFirstCOMPlusSEHRecord(Thread *pThread) {
WRAPPER_NO_CONTRACT;
-#ifndef FEATURE_PAL
EXCEPTION_REGISTRATION_RECORD *pEHR = *(pThread->GetExceptionListPtr());
if (pEHR == EXCEPTION_CHAIN_END || IsUnmanagedToManagedSEHHandler(pEHR)) {
return pEHR;
} else {
return GetNextCOMPlusSEHRecord(pEHR);
}
-#else // FEATURE_PAL
- PORTABILITY_ASSERT("GetFirstCOMPlusSEHRecord");
- return NULL;
-#endif // FEATURE_PAL
}
@@ -2056,13 +2037,30 @@ PEXCEPTION_REGISTRATION_RECORD GetPrevSEHRecord(EXCEPTION_REGISTRATION_RECORD *n
VOID SetCurrentSEHRecord(EXCEPTION_REGISTRATION_RECORD *pSEH)
{
WRAPPER_NO_CONTRACT;
-#ifndef FEATURE_PAL
*GetThread()->GetExceptionListPtr() = pSEH;
-#else // FEATURE_PAL
- _ASSERTE("NYI");
-#endif // FEATURE_PAL
}
+// Note that this logic is copied below, in PopSEHRecords
+__declspec(naked)
+VOID __cdecl PopSEHRecords(LPVOID pTargetSP)
+{
+ // No CONTRACT possible on naked functions
+ STATIC_CONTRACT_NOTHROW;
+ STATIC_CONTRACT_GC_NOTRIGGER;
+
+ __asm{
+ mov ecx, [esp+4] ;; ecx <- pTargetSP
+ mov eax, fs:[0] ;; get current SEH record
+ poploop:
+ cmp eax, ecx
+ jge done
+ mov eax, [eax] ;; get next SEH record
+ jmp poploop
+ done:
+ mov fs:[0], eax
+ retn
+ }
+}
//
// Unwind pExinfo, pops FS:[0] handlers until the interception context SP, and
@@ -2097,7 +2095,6 @@ BOOL PopNestedExceptionRecords(LPVOID pTargetSP, BOOL bCheckForUnknownHandlers)
STATIC_CONTRACT_GC_NOTRIGGER;
STATIC_CONTRACT_SO_TOLERANT;
-#ifndef FEATURE_PAL
PEXCEPTION_REGISTRATION_RECORD pEHR = GetCurrentSEHRecord();
while ((LPVOID)pEHR < pTargetSP)
@@ -2153,10 +2150,6 @@ BOOL PopNestedExceptionRecords(LPVOID pTargetSP, BOOL bCheckForUnknownHandlers)
SetCurrentSEHRecord(pEHR);
}
return FALSE;
-#else // FEATURE_PAL
- PORTABILITY_ASSERT("PopNestedExceptionRecords");
- return FALSE;
-#endif // FEATURE_PAL
}
//
@@ -2261,7 +2254,6 @@ int COMPlusThrowCallbackHelper(IJitManager *pJitManager,
int iFilt = 0;
-#ifndef FEATURE_PAL
EX_TRY
{
GCPROTECT_BEGIN (throwable);
@@ -2290,10 +2282,6 @@ int COMPlusThrowCallbackHelper(IJitManager *pJitManager,
EX_END_CATCH(SwallowAllExceptions)
return iFilt;
-#else // FEATURE_PAL
- PORTABILITY_ASSERT("COMPlusThrowCallbackHelper");
- return EXCEPTION_CONTINUE_SEARCH;
-#endif // FEATURE_PAL
}
//******************************************************************************
diff --git a/src/vm/i386/gmsx86.cpp b/src/vm/i386/gmsx86.cpp
index 2852b924ab..64ac4a38ba 100644
--- a/src/vm/i386/gmsx86.cpp
+++ b/src/vm/i386/gmsx86.cpp
@@ -894,6 +894,8 @@ void LazyMachState::unwindLazyState(LazyMachState* baseState,
case 0x01: // ADD mod/rm
case 0x03:
+ case 0x11: // ADC mod/rm
+ case 0x13:
case 0x29: // SUB mod/rm
case 0x2B:
datasize = 0;
diff --git a/src/vm/i386/unixstubs.cpp b/src/vm/i386/unixstubs.cpp
index 8441b0794e..a9b1094b03 100644
--- a/src/vm/i386/unixstubs.cpp
+++ b/src/vm/i386/unixstubs.cpp
@@ -56,9 +56,3 @@ PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrame(T_DISPATCHER_CONTEXT * pDispa
PORTABILITY_ASSERT("GetCONTEXTFromRedirectedStubStackFrame");
return NULL;
}
-
-FaultingExceptionFrame *GetFrameFromRedirectedStubStackFrame(DISPATCHER_CONTEXT *pDispatcherContext)
-{
- PORTABILITY_ASSERT("GetFrameFromRedirectedStubStackFrame");
- return NULL;
-}
diff --git a/src/vm/jitinterface.cpp b/src/vm/jitinterface.cpp
index 5ef7700896..f7617ad306 100644
--- a/src/vm/jitinterface.cpp
+++ b/src/vm/jitinterface.cpp
@@ -360,7 +360,7 @@ CorInfoType CEEInfo::asCorInfoType(CorElementType eeType,
_ASSERTE((CorInfoType) map[ELEMENT_TYPE_PTR] == CORINFO_TYPE_PTR);
_ASSERTE((CorInfoType) map[ELEMENT_TYPE_TYPEDBYREF] == CORINFO_TYPE_REFANY);
- CorInfoType res = (eeType < ELEMENT_TYPE_MAX) ? ((CorInfoType) map[eeType]) : CORINFO_TYPE_UNDEF;
+ CorInfoType res = ((unsigned)eeType < ELEMENT_TYPE_MAX) ? ((CorInfoType) map[(unsigned)eeType]) : CORINFO_TYPE_UNDEF;
if (clsRet)
*clsRet = CORINFO_CLASS_HANDLE(typeHndUpdated.AsPtr());
@@ -1439,11 +1439,6 @@ static CORINFO_FIELD_ACCESSOR getFieldIntrinsic(FieldDesc * field)
{
return CORINFO_FIELD_INTRINSIC_ZERO;
}
- else
- if (MscorlibBinder::GetField(FIELD__BITCONVERTER__ISLITTLEENDIAN) == field)
- {
- return CORINFO_FIELD_INTRINSIC_ISLITTLEENDIAN;
- }
return (CORINFO_FIELD_ACCESSOR)-1;
}
@@ -12614,13 +12609,6 @@ PCODE UnsafeJitFunction(MethodDesc* ftn, COR_ILMETHOD_DECODER* ILHeader, CORJIT_
EEPOLICY_HANDLE_FATAL_ERROR_WITH_MESSAGE(COR_E_EXECUTIONENGINE, W("Failed to load JIT compiler"));
#endif // ALLOW_SXS_JIT
}
-
- // If no compatjit wasn't used, but the user (normally a test case) requires that one is used, then fail.
- // This is analogous to ZapRequire.
- if (!jitMgr->m_fLegacyJitUsed && (CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_RequireLegacyJit) == 1))
- {
- EEPOLICY_HANDLE_FATAL_ERROR_WITH_MESSAGE(COR_E_EXECUTIONENGINE, W("Failed to use legacy JIT compiler with RequireLegacyJit set"));
- }
#endif // CROSSGEN_COMPILE
#ifdef _DEBUG
diff --git a/src/vm/method.cpp b/src/vm/method.cpp
index 77a6a0d37f..34ae6d9489 100644
--- a/src/vm/method.cpp
+++ b/src/vm/method.cpp
@@ -4571,6 +4571,35 @@ c_CentralJumpCode = {
};
#include <poppack.h>
+#elif defined(_TARGET_ARM_)
+
+#include <pshpack1.h>
+struct CentralJumpCode {
+ BYTE m_ldrPC[4];
+ BYTE m_short[2];
+ MethodDescChunk *m_pChunk;
+ PCODE m_target;
+
+ inline void Setup(PCODE target, MethodDescChunk *pChunk) {
+ WRAPPER_NO_CONTRACT;
+
+ m_target = target;
+ m_pChunk = pChunk;
+ }
+
+ inline BOOL CheckTarget(TADDR target) {
+ WRAPPER_NO_CONTRACT;
+ return ((TADDR)m_target == target);
+ }
+}
+c_CentralJumpCode = {
+ { 0xDF, 0xF8, 0x08, 0xF0 }, // ldr pc, =pTarget
+ { 0x00, 0x00 }, // short offset for alignment
+ 0, // pChunk
+ 0 // pTarget
+};
+#include <poppack.h>
+
#else
#error Unsupported platform
#endif
@@ -4580,10 +4609,92 @@ typedef DPTR(struct CentralJumpCode) PTR_CentralJumpCode;
static_assert_no_msg((TEP_CENTRAL_JUMP_SIZE & 1) == 0);
#define TEP_ENTRY_SIZE 4
+
+#ifdef _TARGET_ARM_
+
+#define TEP_HALF_ENTRY_SIZE (TEP_ENTRY_SIZE / 2)
+
+// Compact entry point on arm consists of two thumb instructions:
+// mov r12, pc
+// b CentralJumpCode
+
+// First instruction 0x46fc
+#define TEP_ENTRY_INSTR1_BYTE1 0xFC
+#define TEP_ENTRY_INSTR1_BYTE2 0x46
+
+// Mask for unconditional branch opcode
+#define TEP_ENTRY_INSTR2_MASK1 0xE0
+
+// Mask for opcode
+#define TEP_ENTRY_INSTR2_MASK2 0xF8
+
+// Bit used for ARM to identify compact entry points
+#define COMPACT_ENTRY_ARM_CODE 0x2
+
+/* static */ int MethodDescChunk::GetCompactEntryPointMaxCount ()
+{
+ LIMITED_METHOD_DAC_CONTRACT;
+
+ return MAX_OFFSET_UNCONDITIONAL_BRANCH_THUMB / TEP_ENTRY_SIZE;
+}
+
+// Get offset from the start of current compact entry point to the CentralJumpCode
+static uint16_t DecodeOffsetFromBranchToCentralJump (uint16_t instr)
+{
+ int16_t offset = decodeUnconditionalBranchThumb ((LPBYTE) &instr);
+
+ offset += PC_REG_RELATIVE_OFFSET + TEP_HALF_ENTRY_SIZE;
+
+ _ASSERTE (offset >= TEP_ENTRY_SIZE && (offset % TEP_ENTRY_SIZE == 0));
+
+ return (uint16_t) offset;
+}
+
+#ifndef DACCESS_COMPILE
+
+// Encode branch instruction to central jump for current compact entry point
+static uint16_t EncodeBranchToCentralJump (int16_t offset)
+{
+ _ASSERTE (offset >= 0 && (offset % TEP_ENTRY_SIZE == 0));
+
+ offset += TEP_HALF_ENTRY_SIZE - PC_REG_RELATIVE_OFFSET;
+
+ uint16_t instr;
+ emitUnconditionalBranchThumb ((LPBYTE) &instr, offset);
+
+ return instr;
+}
+
+#endif // DACCESS_COMPILE
+
+#else // _TARGET_ARM_
+
#define TEP_MAX_BEFORE_INDEX (1 + (127 / TEP_ENTRY_SIZE))
#define TEP_MAX_BLOCK_INDEX (TEP_MAX_BEFORE_INDEX + (128 - TEP_CENTRAL_JUMP_SIZE) / TEP_ENTRY_SIZE)
#define TEP_FULL_BLOCK_SIZE (TEP_MAX_BLOCK_INDEX * TEP_ENTRY_SIZE + TEP_CENTRAL_JUMP_SIZE)
+#endif // _TARGET_ARM_
+
+BOOL MethodDescChunk::IsCompactEntryPointAtAddress(PCODE addr)
+{
+ LIMITED_METHOD_DAC_CONTRACT;
+
+#if defined(_TARGET_X86_) || defined(_TARGET_AMD64_)
+
+ // Compact entrypoints start at odd addresses
+ return (addr & 1) != 0;
+
+#elif defined(_TARGET_ARM_)
+
+ // Compact entrypoints start at odd addresses (thumb) with second bit set to 1
+ uint8_t compactEntryPointMask = THUMB_CODE | COMPACT_ENTRY_ARM_CODE;
+ return (addr & compactEntryPointMask) == compactEntryPointMask;
+
+#else
+ #error Unsupported platform
+#endif
+}
+
//*******************************************************************************
/* static */ MethodDesc* MethodDescChunk::GetMethodDescFromCompactEntryPoint(PCODE addr, BOOL fSpeculative /*=FALSE*/)
{
@@ -4597,18 +4708,39 @@ static_assert_no_msg((TEP_CENTRAL_JUMP_SIZE & 1) == 0);
// Always do consistency check in debug
if (fSpeculative INDEBUG(|| TRUE))
{
+#ifdef _TARGET_ARM_
+ if (!IsCompactEntryPointAtAddress(addr))
+#else // _TARGET_ARM_
if ((addr & 3) != 1 ||
*PTR_BYTE(addr) != X86_INSTR_MOV_AL ||
*PTR_BYTE(addr+2) != X86_INSTR_JMP_REL8)
+#endif // _TARGET_ARM_
{
if (fSpeculative) return NULL;
_ASSERTE(!"Unexpected code in temporary entrypoint");
}
}
+#ifdef _TARGET_ARM_
+
+ // On ARM compact entry points are thumb
+ _ASSERTE ((addr & THUMB_CODE) != 0);
+ addr = addr - THUMB_CODE;
+
+ // Get offset for CentralJumpCode from current compact entry point
+ PTR_UINT16 pBranchInstr = (PTR_UINT16(addr)) + 1;
+ uint16_t offset = DecodeOffsetFromBranchToCentralJump (*pBranchInstr);
+
+ TADDR centralJump = addr + offset;
+ int index = (centralJump - addr - TEP_ENTRY_SIZE) / TEP_ENTRY_SIZE;
+
+#else // _TARGET_ARM_
+
int index = *PTR_BYTE(addr+1);
TADDR centralJump = addr + 4 + *PTR_SBYTE(addr+3);
+#endif // _TARGET_ARM_
+
CentralJumpCode* pCentralJumpCode = PTR_CentralJumpCode(centralJump);
// Always do consistency check in debug
@@ -4625,10 +4757,42 @@ static_assert_no_msg((TEP_CENTRAL_JUMP_SIZE & 1) == 0);
}
}
+#ifdef _TARGET_ARM_
+
+ _ASSERTE_IMPL(pCentralJumpCode->CheckTarget(GetPreStubCompactARMEntryPoint()));
+
+#else // _TARGET_ARM_
+
_ASSERTE_IMPL(pCentralJumpCode->CheckTarget(GetPreStubEntryPoint()));
+
+#endif // _TARGET_ARM_
}
+#ifdef _TARGET_ARM_
+ // Go through all MethodDesc in MethodDescChunk and find the one with the required index
+ PTR_MethodDescChunk pChunk = *((DPTR(PTR_MethodDescChunk))(centralJump + offsetof(CentralJumpCode, m_pChunk)));
+ TADDR pMD = PTR_HOST_TO_TADDR (pChunk->GetFirstMethodDesc ());
+
+ _ASSERTE (index >= 0 && index < ((int) pChunk->GetCount ()));
+
+ index = ((int) pChunk->GetCount ()) - 1 - index;
+
+ SIZE_T totalSize = 0;
+ int curIndex = 0;
+
+ while (index != curIndex)
+ {
+ SIZE_T sizeCur = (PTR_MethodDesc (pMD))->SizeOf ();
+ totalSize += sizeCur;
+
+ pMD += sizeCur;
+ ++curIndex;
+ }
+
+ return PTR_MethodDesc (pMD);
+#else // _TARGET_ARM_
return PTR_MethodDesc((TADDR)pCentralJumpCode->m_pBaseMD + index * MethodDesc::ALIGNMENT);
+#endif // _TARGET_ARM_
}
//*******************************************************************************
@@ -4636,11 +4800,19 @@ SIZE_T MethodDescChunk::SizeOfCompactEntryPoints(int count)
{
LIMITED_METHOD_DAC_CONTRACT;
+#ifdef _TARGET_ARM_
+
+ return COMPACT_ENTRY_ARM_CODE + count * TEP_ENTRY_SIZE + TEP_CENTRAL_JUMP_SIZE;
+
+#else // _TARGET_ARM_
+
int fullBlocks = count / TEP_MAX_BLOCK_INDEX;
int remainder = count % TEP_MAX_BLOCK_INDEX;
return 1 + (fullBlocks * TEP_FULL_BLOCK_SIZE) +
(remainder * TEP_ENTRY_SIZE) + ((remainder != 0) ? TEP_CENTRAL_JUMP_SIZE : 0);
+
+#endif // _TARGET_ARM_
}
#ifndef DACCESS_COMPILE
@@ -4657,16 +4829,37 @@ TADDR MethodDescChunk::AllocateCompactEntryPoints(LoaderAllocator *pLoaderAlloca
TADDR temporaryEntryPoints = (TADDR)pamTracker->Track(pLoaderAllocator->GetPrecodeHeap()->AllocAlignedMem(size, sizeof(TADDR)));
+#ifdef _TARGET_ARM_
+ BYTE* p = (BYTE*)temporaryEntryPoints + COMPACT_ENTRY_ARM_CODE;
+ int relOffset = count * TEP_ENTRY_SIZE - TEP_ENTRY_SIZE; // relative offset for the short jump
+
+ _ASSERTE (relOffset < MAX_OFFSET_UNCONDITIONAL_BRANCH_THUMB);
+#else // _TARGET_ARM_
// make the temporary entrypoints unaligned, so they are easy to identify
BYTE* p = (BYTE*)temporaryEntryPoints + 1;
+ int indexInBlock = TEP_MAX_BLOCK_INDEX; // recompute relOffset in first iteration
+ int relOffset = 0; // relative offset for the short jump
+#endif // _TARGET_ARM_
- int indexInBlock = TEP_MAX_BLOCK_INDEX; // recompute relOffset in first iteration
- int relOffset = 0; // relative offset for the short jump
MethodDesc * pBaseMD = 0; // index of the start of the block
MethodDesc * pMD = GetFirstMethodDesc();
for (int index = 0; index < count; index++)
{
+#ifdef _TARGET_ARM_
+
+ uint8_t *pMovInstrByte1 = (uint8_t *)p;
+ uint8_t *pMovInstrByte2 = (uint8_t *)p+1;
+ uint16_t *pBranchInstr = ((uint16_t *)p)+1;
+
+ *pMovInstrByte1 = TEP_ENTRY_INSTR1_BYTE1;
+ *pMovInstrByte2 = TEP_ENTRY_INSTR1_BYTE2;
+ *pBranchInstr = EncodeBranchToCentralJump ((int16_t) relOffset);
+
+ p += TEP_ENTRY_SIZE;
+
+#else // _TARGET_ARM_
+
if (indexInBlock == TEP_MAX_BLOCK_INDEX)
{
relOffset = (min(count - index, TEP_MAX_BEFORE_INDEX) - 1) * TEP_ENTRY_SIZE;
@@ -4698,14 +4891,28 @@ TADDR MethodDescChunk::AllocateCompactEntryPoints(LoaderAllocator *pLoaderAlloca
relOffset -= TEP_CENTRAL_JUMP_SIZE;
}
- relOffset -= TEP_ENTRY_SIZE;
indexInBlock++;
+#endif // _TARGET_ARM_
+
+ relOffset -= TEP_ENTRY_SIZE;
pMD = (MethodDesc *)((BYTE *)pMD + pMD->SizeOf());
}
+#ifdef _TARGET_ARM_
+
+ CentralJumpCode* pCode = (CentralJumpCode*)p;
+ memcpy(pCode, &c_CentralJumpCode, TEP_CENTRAL_JUMP_SIZE);
+ pCode->Setup (GetPreStubCompactARMEntryPoint(), this);
+
+ _ASSERTE(p + TEP_CENTRAL_JUMP_SIZE == (BYTE*)temporaryEntryPoints + size);
+
+#else // _TARGET_ARM_
+
_ASSERTE(p == (BYTE*)temporaryEntryPoints + size);
+#endif // _TARGET_ARM_
+
ClrFlushInstructionCache((LPVOID)temporaryEntryPoints, size);
SetHasCompactEntryPoints();
@@ -4725,11 +4932,19 @@ PCODE MethodDescChunk::GetTemporaryEntryPoint(int index)
#ifdef HAS_COMPACT_ENTRYPOINTS
if (HasCompactEntryPoints())
{
+#ifdef _TARGET_ARM_
+
+ return GetTemporaryEntryPoints() + COMPACT_ENTRY_ARM_CODE + THUMB_CODE + index * TEP_ENTRY_SIZE;
+
+#else // _TARGET_ARM_
+
int fullBlocks = index / TEP_MAX_BLOCK_INDEX;
int remainder = index % TEP_MAX_BLOCK_INDEX;
return GetTemporaryEntryPoints() + 1 + (fullBlocks * TEP_FULL_BLOCK_SIZE) +
(remainder * TEP_ENTRY_SIZE) + ((remainder >= TEP_MAX_BEFORE_INDEX) ? TEP_CENTRAL_JUMP_SIZE : 0);
+
+#endif // _TARGET_ARM_
}
#endif // HAS_COMPACT_ENTRYPOINTS
diff --git a/src/vm/method.hpp b/src/vm/method.hpp
index 9545da2248..3354e5799a 100644
--- a/src/vm/method.hpp
+++ b/src/vm/method.hpp
@@ -2031,23 +2031,18 @@ public:
// direct call to direct jump.
//
// We use (1) for x86 and (2) for 64-bit to get the best performance on each platform.
- //
+ // For ARM (1) is used.
TADDR AllocateCompactEntryPoints(LoaderAllocator *pLoaderAllocator, AllocMemTracker *pamTracker);
static MethodDesc* GetMethodDescFromCompactEntryPoint(PCODE addr, BOOL fSpeculative = FALSE);
static SIZE_T SizeOfCompactEntryPoints(int count);
- static BOOL IsCompactEntryPointAtAddress(PCODE addr)
- {
-#if defined(_TARGET_X86_) || defined(_TARGET_AMD64_)
- // Compact entrypoints start at odd addresses
- LIMITED_METHOD_DAC_CONTRACT;
- return (addr & 1) != 0;
-#else
- #error Unsupported platform
-#endif
- }
+ static BOOL IsCompactEntryPointAtAddress(PCODE addr);
+
+#ifdef _TARGET_ARM_
+ static int GetCompactEntryPointMaxCount ();
+#endif // _TARGET_ARM_
#endif // HAS_COMPACT_ENTRYPOINTS
FORCEINLINE PTR_MethodTable GetMethodTable()
diff --git a/src/vm/methodtable.h b/src/vm/methodtable.h
index df60fca09d..2ce9f2a883 100644
--- a/src/vm/methodtable.h
+++ b/src/vm/methodtable.h
@@ -663,7 +663,7 @@ SystemVClassificationType CorInfoType2UnixAmd64Classification(CorElementType eeT
_ASSERTE((SystemVClassificationType)toSystemVAmd64ClassificationTypeMap[ELEMENT_TYPE_TYPEDBYREF] == SystemVClassificationTypeTypedReference);
_ASSERTE((SystemVClassificationType)toSystemVAmd64ClassificationTypeMap[ELEMENT_TYPE_BYREF] == SystemVClassificationTypeIntegerByRef);
- return (((int)eeType) < ELEMENT_TYPE_MAX) ? (toSystemVAmd64ClassificationTypeMap[eeType]) : SystemVClassificationTypeUnknown;
+ return (((unsigned)eeType) < ELEMENT_TYPE_MAX) ? (toSystemVAmd64ClassificationTypeMap[(unsigned)eeType]) : SystemVClassificationTypeUnknown;
};
#define SYSTEMV_EIGHT_BYTE_SIZE_IN_BYTES 8 // Size of an eightbyte in bytes.
diff --git a/src/vm/mscorlib.cpp b/src/vm/mscorlib.cpp
index 5deaaefa90..3e2d478bbf 100644
--- a/src/vm/mscorlib.cpp
+++ b/src/vm/mscorlib.cpp
@@ -72,8 +72,6 @@
#include "mdaassistants.h"
#endif
-#include "coverage.h"
-
#ifdef FEATURE_COMINTEROP
#include "variant.h"
#include "oavariant.h"
@@ -95,6 +93,7 @@
#if defined(FEATURE_EVENTSOURCE_XPLAT)
#include "nativeeventsource.h"
+#include "eventpipe.h"
#endif //defined(FEATURE_EVENTSOURCE_XPLAT)
#endif // CROSSGEN_MSCORLIB
diff --git a/src/vm/mscorlib.h b/src/vm/mscorlib.h
index 87927f687d..338ba1efda 100644
--- a/src/vm/mscorlib.h
+++ b/src/vm/mscorlib.h
@@ -146,12 +146,6 @@ DEFINE_CLASS(ARRAY, System, Array)
DEFINE_PROPERTY(ARRAY, LENGTH, Length, Int)
DEFINE_METHOD(ARRAY, GET_DATA_PTR_OFFSET_INTERNAL, GetDataPtrOffsetInternal, IM_RetInt)
-#ifdef FEATURE_NONGENERIC_COLLECTIONS
-DEFINE_CLASS(ARRAY_LIST, Collections, ArrayList)
-DEFINE_METHOD(ARRAY_LIST, CTOR, .ctor, IM_RetVoid)
-DEFINE_METHOD(ARRAY_LIST, ADD, Add, IM_Obj_RetInt)
-#endif // FEATURE_NONGENERIC_COLLECTIONS
-
DEFINE_CLASS(ARRAY_WITH_OFFSET, Interop, ArrayWithOffset)
DEFINE_FIELD(ARRAY_WITH_OFFSET, M_ARRAY, m_array)
DEFINE_FIELD(ARRAY_WITH_OFFSET, M_OFFSET, m_offset)
diff --git a/src/vm/pefile.cpp b/src/vm/pefile.cpp
index 16c66b516d..c7870e6366 100644
--- a/src/vm/pefile.cpp
+++ b/src/vm/pefile.cpp
@@ -2849,12 +2849,22 @@ PTR_ICLRPrivBinder PEFile::GetBindingContext()
PTR_ICLRPrivBinder pBindingContext = NULL;
- // Mscorlib is always bound in context of the TPA Binder. However, since it gets loaded and published
- // during EEStartup *before* TPAbinder is initialized, we dont have a binding context to publish against.
+ // CoreLibrary is always bound in context of the TPA Binder. However, since it gets loaded and published
+ // during EEStartup *before* DefaultContext Binder (aka TPAbinder) is initialized, we dont have a binding context to publish against.
// Thus, we will always return NULL for its binding context.
if (!IsSystem())
{
pBindingContext = dac_cast<PTR_ICLRPrivBinder>(GetHostAssembly());
+ if (!pBindingContext)
+ {
+ // If we do not have any binding context, check if we are dealing with
+ // a dynamically emitted assembly and if so, use its fallback load context
+ // binder reference.
+ if (IsDynamic())
+ {
+ pBindingContext = GetFallbackLoadContextBinder();
+ }
+ }
}
return pBindingContext;
diff --git a/src/vm/pefile.h b/src/vm/pefile.h
index b7c7bd3e7c..2856083123 100644
--- a/src/vm/pefile.h
+++ b/src/vm/pefile.h
@@ -631,7 +631,7 @@ protected:
// To enable this, we maintain a concept of "Fallback LoadContext", which will be set to the Binder of the
// assembly that created the dynamic assembly. If the creator assembly is dynamic itself, then its fallback
// load context would be propagated to the assembly being dynamically generated.
- ICLRPrivBinder *m_pFallbackLoadContextBinder;
+ PTR_ICLRPrivBinder m_pFallbackLoadContextBinder;
protected:
@@ -657,13 +657,13 @@ public:
bool CanUseWithBindingCache()
{ LIMITED_METHOD_CONTRACT; return !HasHostAssembly(); }
- void SetFallbackLoadContextBinder(ICLRPrivBinder *pFallbackLoadContextBinder)
+ void SetFallbackLoadContextBinder(PTR_ICLRPrivBinder pFallbackLoadContextBinder)
{
LIMITED_METHOD_CONTRACT;
m_pFallbackLoadContextBinder = pFallbackLoadContextBinder;
}
- ICLRPrivBinder *GetFallbackLoadContextBinder()
+ PTR_ICLRPrivBinder GetFallbackLoadContextBinder()
{
LIMITED_METHOD_CONTRACT;
diff --git a/src/vm/peimage.cpp b/src/vm/peimage.cpp
index 39b71ff62f..3367ef93c4 100644
--- a/src/vm/peimage.cpp
+++ b/src/vm/peimage.cpp
@@ -1189,7 +1189,13 @@ HANDLE PEImage::GetFileHandle()
}
if (m_hFile == INVALID_HANDLE_VALUE)
+ {
+#if !defined(DACCESS_COMPILE)
+ EEFileLoadException::Throw(m_path, HRESULT_FROM_WIN32(GetLastError()));
+#else // defined(DACCESS_COMPILE)
ThrowLastError();
+#endif // !defined(DACCESS_COMPILE)
+ }
return m_hFile;
}
diff --git a/src/vm/peimagelayout.cpp b/src/vm/peimagelayout.cpp
index 24166817bb..34ba4d8215 100644
--- a/src/vm/peimagelayout.cpp
+++ b/src/vm/peimagelayout.cpp
@@ -392,10 +392,21 @@ MappedImageLayout::MappedImageLayout(HANDLE hFile, PEImage* pOwner)
{
#ifndef CROSSGEN_COMPILE
+ // Capture last error as it may get reset below.
+
+ DWORD dwLastError = GetLastError();
// There is no reflection-only load on CoreCLR and so we can always throw an error here.
// It is important on Windows Phone. All assemblies that we load must have SEC_IMAGE set
// so that the OS can perform signature verification.
- ThrowLastError();
+ if (pOwner->IsFile())
+ {
+ EEFileLoadException::Throw(pOwner->GetPathForErrorMessages(), HRESULT_FROM_WIN32(dwLastError));
+ }
+ else
+ {
+ // Throw generic exception.
+ ThrowWin32(dwLastError);
+ }
#endif // CROSSGEN_COMPILE
diff --git a/src/vm/precode.cpp b/src/vm/precode.cpp
index 9707b2756b..1daf6e32b8 100644
--- a/src/vm/precode.cpp
+++ b/src/vm/precode.cpp
@@ -525,6 +525,16 @@ TADDR Precode::AllocateTemporaryEntryPoints(MethodDescChunk * pChunk,
// Note that these are just best guesses to save memory. If we guessed wrong,
// we will allocate a new exact type of precode in GetOrCreatePrecode.
BOOL fForcedPrecode = pFirstMD->RequiresStableEntryPoint(count > 1);
+
+#ifdef _TARGET_ARM_
+ if (pFirstMD->RequiresMethodDescCallingConvention(count > 1)
+ || count >= MethodDescChunk::GetCompactEntryPointMaxCount ())
+ {
+ // We do not pass method desc on scratch register
+ fForcedPrecode = TRUE;
+ }
+#endif // _TARGET_ARM_
+
if (!fForcedPrecode && (totalSize > MethodDescChunk::SizeOfCompactEntryPoints(count)))
return NULL;
#endif
diff --git a/src/vm/precode.h b/src/vm/precode.h
index 7dd4cd22f0..8947192482 100644
--- a/src/vm/precode.h
+++ b/src/vm/precode.h
@@ -170,6 +170,11 @@ public:
align = 8;
#endif // _TARGET_X86_ && HAS_FIXUP_PRECODE
+#if defined(_TARGET_ARM_) && defined(HAS_COMPACT_ENTRYPOINTS)
+ // Precodes have to be aligned to allow fast compact entry points check
+ _ASSERTE (align >= sizeof(void*));
+#endif // _TARGET_ARM_ && HAS_COMPACT_ENTRYPOINTS
+
return align;
}
diff --git a/src/vm/prestub.cpp b/src/vm/prestub.cpp
index 67639e99b2..fccec51bb3 100644
--- a/src/vm/prestub.cpp
+++ b/src/vm/prestub.cpp
@@ -55,6 +55,13 @@
#ifndef DACCESS_COMPILE
EXTERN_C void STDCALL ThePreStub();
+
+#if defined(HAS_COMPACT_ENTRYPOINTS) && defined (_TARGET_ARM_)
+
+EXTERN_C void STDCALL ThePreStubCompactARM();
+
+#endif // defined(HAS_COMPACT_ENTRYPOINTS) && defined (_TARGET_ARM_)
+
EXTERN_C void STDCALL ThePreStubPatch();
//==========================================================================
@@ -1002,6 +1009,21 @@ Stub * MakeInstantiatingStubWorker(MethodDesc *pMD)
}
#endif // defined(FEATURE_SHARE_GENERIC_CODE)
+#if defined (HAS_COMPACT_ENTRYPOINTS) && defined (_TARGET_ARM_)
+
+extern "C" MethodDesc * STDCALL PreStubGetMethodDescForCompactEntryPoint (PCODE pCode)
+{
+ _ASSERTE (pCode >= PC_REG_RELATIVE_OFFSET);
+
+ pCode = (PCODE) (pCode - PC_REG_RELATIVE_OFFSET + THUMB_CODE);
+
+ _ASSERTE (MethodDescChunk::IsCompactEntryPointAtAddress (pCode));
+
+ return MethodDescChunk::GetMethodDescFromCompactEntryPoint(pCode, FALSE);
+}
+
+#endif // defined (HAS_COMPACT_ENTRYPOINTS) && defined (_TARGET_ARM_)
+
//=============================================================================
// This function generates the real code for a method and installs it into
// the methoddesc. Usually ***BUT NOT ALWAYS***, this function runs only once
diff --git a/src/vm/runtimehandles.cpp b/src/vm/runtimehandles.cpp
index 4ff6512a52..7e08dadc10 100644
--- a/src/vm/runtimehandles.cpp
+++ b/src/vm/runtimehandles.cpp
@@ -2615,6 +2615,10 @@ void QCALLTYPE RuntimeMethodHandle::Destroy(MethodDesc * pMethod)
// Fire Unload Dynamic Method Event here
ETW::MethodLog::DynamicMethodDestroyed(pMethod);
+ BEGIN_PIN_PROFILER(CORProfilerIsMonitoringDynamicFunctionUnloads());
+ g_profControlBlock.pProfInterface->DynamicMethodUnloaded((FunctionID)pMethod);
+ END_PIN_PROFILER();
+
pDynamicMethodDesc->Destroy();
END_QCALL;
diff --git a/src/vm/sampleprofiler.cpp b/src/vm/sampleprofiler.cpp
index 004b3c68b0..e4721577ae 100644
--- a/src/vm/sampleprofiler.cpp
+++ b/src/vm/sampleprofiler.cpp
@@ -3,18 +3,24 @@
// See the LICENSE file in the project root for more information.
#include "common.h"
+#include "eventpipebuffermanager.h"
+#include "eventpipeeventinstance.h"
#include "sampleprofiler.h"
#include "hosting.h"
#include "threadsuspend.h"
+#ifdef FEATURE_PERFTRACING
+
Volatile<BOOL> SampleProfiler::s_profilingEnabled = false;
Thread* SampleProfiler::s_pSamplingThread = NULL;
+const GUID SampleProfiler::s_providerID = {0x3c530d44,0x97ae,0x513a,{0x1e,0x6d,0x78,0x3e,0x8f,0x8e,0x03,0xa9}}; // {3c530d44-97ae-513a-1e6d-783e8f8e03a9}
+EventPipeProvider* SampleProfiler::s_pEventPipeProvider = NULL;
+EventPipeEvent* SampleProfiler::s_pThreadTimeEvent = NULL;
+BYTE* SampleProfiler::s_pPayloadExternal = NULL;
+BYTE* SampleProfiler::s_pPayloadManaged = NULL;
CLREventStatic SampleProfiler::s_threadShutdownEvent;
-#ifdef FEATURE_PAL
long SampleProfiler::s_samplingRateInNs = 1000000; // 1ms
-#endif
-// Synchronization of multiple callers occurs in EventPipe::Enable.
void SampleProfiler::Enable()
{
CONTRACTL
@@ -23,9 +29,31 @@ void SampleProfiler::Enable()
GC_TRIGGERS;
MODE_ANY;
PRECONDITION(s_pSamplingThread == NULL);
+ // Synchronization of multiple callers occurs in EventPipe::Enable.
+ PRECONDITION(EventPipe::GetLock()->OwnedByCurrentThread());
}
CONTRACTL_END;
+ if(s_pEventPipeProvider == NULL)
+ {
+ s_pEventPipeProvider = EventPipe::CreateProvider(s_providerID);
+ s_pThreadTimeEvent = s_pEventPipeProvider->AddEvent(
+ 0, /* eventID */
+ 0, /* keywords */
+ 0, /* eventVersion */
+ EventPipeEventLevel::Informational,
+ false /* NeedStack */);
+ }
+
+ if(s_pPayloadExternal == NULL)
+ {
+ s_pPayloadExternal = new BYTE[sizeof(unsigned int)];
+ *((unsigned int *)s_pPayloadExternal) = static_cast<unsigned int>(SampleProfilerSampleType::External);
+
+ s_pPayloadManaged = new BYTE[sizeof(unsigned int)];
+ *((unsigned int *)s_pPayloadManaged) = static_cast<unsigned int>(SampleProfilerSampleType::Managed);
+ }
+
s_profilingEnabled = true;
s_pSamplingThread = SetupUnstartedThread();
if(s_pSamplingThread->CreateNewThread(0, ThreadProc, NULL))
@@ -40,7 +68,6 @@ void SampleProfiler::Enable()
}
}
-// Synchronization of multiple callers occurs in EventPipe::Disable.
void SampleProfiler::Disable()
{
CONTRACTL
@@ -48,6 +75,8 @@ void SampleProfiler::Disable()
THROWS;
GC_TRIGGERS;
MODE_ANY;
+ // Synchronization of multiple callers occurs in EventPipe::Disable.
+ PRECONDITION(EventPipe::GetLock()->OwnedByCurrentThread());
}
CONTRACTL_END;
@@ -68,6 +97,12 @@ void SampleProfiler::Disable()
s_threadShutdownEvent.Wait(0, FALSE /* bAlertable */);
}
+void SampleProfiler::SetSamplingRate(long nanoseconds)
+{
+ LIMITED_METHOD_CONTRACT;
+ s_samplingRateInNs = nanoseconds;
+}
+
DWORD WINAPI SampleProfiler::ThreadProc(void *args)
{
CONTRACTL
@@ -91,11 +126,7 @@ DWORD WINAPI SampleProfiler::ThreadProc(void *args)
if(ThreadSuspend::SysIsSuspendInProgress() || (ThreadSuspend::GetSuspensionThread() != 0))
{
// Skip the current sample.
-#ifdef FEATURE_PAL
PAL_nanosleep(s_samplingRateInNs);
-#else
- ClrSleepEx(1, FALSE);
-#endif
continue;
}
@@ -109,15 +140,11 @@ DWORD WINAPI SampleProfiler::ThreadProc(void *args)
ThreadSuspend::RestartEE(FALSE /* bFinishedGC */, TRUE /* SuspendSucceeded */);
// Wait until it's time to sample again.
-#ifdef FEATURE_PAL
PAL_nanosleep(s_samplingRateInNs);
-#else
- ClrSleepEx(1, FALSE);
-#endif
}
}
- // Destroy the sampling thread when done running.
+ // Destroy the sampling thread when it is done running.
DestroyThread(s_pSamplingThread);
s_pSamplingThread = NULL;
@@ -139,17 +166,33 @@ void SampleProfiler::WalkManagedThreads()
}
CONTRACTL_END;
- Thread *pThread = NULL;
- StackContents stackContents;
+ Thread *pTargetThread = NULL;
// Iterate over all managed threads.
// Assumes that the ThreadStoreLock is held because we've suspended all threads.
- while ((pThread = ThreadStore::GetThreadList(pThread)) != NULL)
+ while ((pTargetThread = ThreadStore::GetThreadList(pTargetThread)) != NULL)
{
+ StackContents stackContents;
+
// Walk the stack and write it out as an event.
- if(EventPipe::WalkManagedStackForThread(pThread, stackContents) && !stackContents.IsEmpty())
+ if(EventPipe::WalkManagedStackForThread(pTargetThread, stackContents) && !stackContents.IsEmpty())
{
- EventPipe::WriteSampleProfileEvent(pThread, stackContents);
+ // Set the payload. If the GC mode on suspension > 0, then the thread was in cooperative mode.
+ // Even though there are some cases where this is not managed code, we assume it is managed code here.
+ // If the GC mode on suspension == 0 then the thread was in preemptive mode, which we qualify as external here.
+ BYTE *pPayload = s_pPayloadExternal;
+ if(pTargetThread->GetGCModeOnSuspension())
+ {
+ pPayload = s_pPayloadManaged;
+ }
+
+ // Write the sample.
+ EventPipe::WriteSampleProfileEvent(s_pSamplingThread, s_pThreadTimeEvent, pTargetThread, stackContents, pPayload, c_payloadSize);
}
+
+ // Reset the GC mode.
+ pTargetThread->ClearGCModeOnSuspension();
}
}
+
+#endif // FEATURE_PERFTRACING
diff --git a/src/vm/sampleprofiler.h b/src/vm/sampleprofiler.h
index 2c7466f4c9..02eb6b39cd 100644
--- a/src/vm/sampleprofiler.h
+++ b/src/vm/sampleprofiler.h
@@ -5,11 +5,25 @@
#ifndef __SAMPLEPROFILER_H__
#define __SAMPLEPROFILER_H__
+#ifdef FEATURE_PERFTRACING
+
#include "common.h"
#include "eventpipe.h"
+enum class SampleProfilerSampleType
+{
+ Error = 0,
+ External = 1,
+ Managed = 2
+};
+
class SampleProfiler
{
+
+ // Declare friends.
+ friend class EventPipe;
+ friend class SampleProfilerEventInstance;
+
public:
// Enable profiling.
@@ -18,13 +32,16 @@ class SampleProfiler
// Disable profiling.
static void Disable();
+ // Set the sampling rate.
+ static void SetSamplingRate(long nanoseconds);
+
private:
// Iterate through all managed threads and walk all stacks.
static void WalkManagedThreads();
// Profiling thread proc. Invoked on a new thread when profiling is enabled.
- static DWORD WINAPI SampleProfiler::ThreadProc(void *args);
+ static DWORD WINAPI ThreadProc(void *args);
// True when profiling is enabled.
static Volatile<BOOL> s_profilingEnabled;
@@ -32,13 +49,25 @@ class SampleProfiler
// The sampling thread.
static Thread *s_pSamplingThread;
+ // The provider and event emitted by the profiler.
+ static const GUID s_providerID;
+ static EventPipeProvider *s_pEventPipeProvider;
+ static EventPipeEvent *s_pThreadTimeEvent;
+
+ // Event payloads.
+ // External represents a sample in external or native code.
+ // Managed represents a sample in managed code.
+ static BYTE *s_pPayloadExternal;
+ static BYTE *s_pPayloadManaged;
+ static const unsigned int c_payloadSize = sizeof(unsigned int);
+
// Thread shutdown event for synchronization between Disable() and the sampling thread.
static CLREventStatic s_threadShutdownEvent;
-#ifdef FEATURE_PAL
// The sampling rate.
static long s_samplingRateInNs;
-#endif
};
+#endif // FEATURE_PERFTRACING
+
#endif // __SAMPLEPROFILER_H__
diff --git a/src/vm/threads.cpp b/src/vm/threads.cpp
index c36232ecb5..df8916c1f9 100644
--- a/src/vm/threads.cpp
+++ b/src/vm/threads.cpp
@@ -54,6 +54,10 @@
#include "olecontexthelpers.h"
#endif // FEATURE_COMINTEROP_APARTMENT_SUPPORT
+#ifdef FEATURE_PERFTRACING
+#include "eventpipebuffermanager.h"
+#endif // FEATURE_PERFTRACING
+
SPTR_IMPL(ThreadStore, ThreadStore, s_pThreadStore);
@@ -988,6 +992,16 @@ void DestroyThread(Thread *th)
th->SetThreadState(Thread::TS_ReportDead);
th->OnThreadTerminate(FALSE);
}
+
+#ifdef FEATURE_PERFTRACING
+ // Before the thread dies, mark its buffers as no longer owned
+ // so that they can be cleaned up after the thread dies.
+ EventPipeBufferList *pBufferList = th->GetEventPipeBufferList();
+ if(pBufferList != NULL)
+ {
+ pBufferList->SetOwnedByThread(false);
+ }
+#endif // FEATURE_PERFTRACING
}
//-------------------------------------------------------------------------
@@ -1084,6 +1098,16 @@ HRESULT Thread::DetachThread(BOOL fDLLThreadDetach)
m_pClrDebugState = NULL;
#endif //ENABLE_CONTRACTS_DATA
+#ifdef FEATURE_PERFTRACING
+ // Before the thread dies, mark its buffers as no longer owned
+ // so that they can be cleaned up after the thread dies.
+ EventPipeBufferList *pBufferList = m_pEventPipeBufferList.Load();
+ if(pBufferList != NULL)
+ {
+ pBufferList->SetOwnedByThread(false);
+ }
+#endif // FEATURE_PERFTRACING
+
FastInterlockOr((ULONG*)&m_State, (int) (Thread::TS_Detached | Thread::TS_ReportDead));
// Do not touch Thread object any more. It may be destroyed.
@@ -2008,6 +2032,11 @@ Thread::Thread()
#endif
m_pAllLoggedTypes = NULL;
+
+#ifdef FEATURE_PERFTRACING
+ m_pEventPipeBufferList = NULL;
+ m_eventWriteInProgress = false;
+#endif // FEATURE_PERFTRACING
m_HijackReturnKind = RT_Illegal;
}
diff --git a/src/vm/threads.h b/src/vm/threads.h
index 34fca24c4f..74b239d776 100644
--- a/src/vm/threads.h
+++ b/src/vm/threads.h
@@ -185,6 +185,10 @@ typedef DPTR(PTR_ThreadLocalBlock) PTR_PTR_ThreadLocalBlock;
#include "interoputil.h"
#include "eventtrace.h"
+#ifdef FEATURE_PERFTRACING
+class EventPipeBufferList;
+#endif // FEATURE_PERFTRACING
+
#ifdef CROSSGEN_COMPILE
#include "asmconstants.h"
@@ -5334,6 +5338,61 @@ public:
m_pAllLoggedTypes = pAllLoggedTypes;
}
+#ifdef FEATURE_PERFTRACING
+private:
+ // The object that contains the list write buffers used by this thread.
+ Volatile<EventPipeBufferList*> m_pEventPipeBufferList;
+
+ // Whether or not the thread is currently writing an event.
+ Volatile<bool> m_eventWriteInProgress;
+
+ // SampleProfiler thread state. This is set on suspension and cleared before restart.
+ // True if the thread was in cooperative mode. False if it was in preemptive when the suspension started.
+ Volatile<ULONG> m_gcModeOnSuspension;
+
+public:
+ EventPipeBufferList* GetEventPipeBufferList()
+ {
+ LIMITED_METHOD_CONTRACT;
+ return m_pEventPipeBufferList;
+ }
+
+ void SetEventPipeBufferList(EventPipeBufferList *pList)
+ {
+ LIMITED_METHOD_CONTRACT;
+ m_pEventPipeBufferList = pList;
+ }
+
+ bool GetEventWriteInProgress() const
+ {
+ LIMITED_METHOD_CONTRACT;
+ return m_eventWriteInProgress;
+ }
+
+ void SetEventWriteInProgress(bool value)
+ {
+ LIMITED_METHOD_CONTRACT;
+ m_eventWriteInProgress = value;
+ }
+
+ bool GetGCModeOnSuspension()
+ {
+ LIMITED_METHOD_CONTRACT;
+ return m_gcModeOnSuspension;
+ }
+
+ void SaveGCModeOnSuspension()
+ {
+ LIMITED_METHOD_CONTRACT;
+ m_gcModeOnSuspension = m_fPreemptiveGCDisabled;
+ }
+
+ void ClearGCModeOnSuspension()
+ {
+ m_gcModeOnSuspension = 0;
+ }
+#endif // FEATURE_PERFTRACING
+
#ifdef FEATURE_HIJACK
private:
diff --git a/src/vm/threadsuspend.cpp b/src/vm/threadsuspend.cpp
index 65495940ed..36eb9f3698 100644
--- a/src/vm/threadsuspend.cpp
+++ b/src/vm/threadsuspend.cpp
@@ -7514,6 +7514,11 @@ void HandleGCSuspensionForInterruptedThread(CONTEXT *interruptedContext)
if (pThread->PreemptiveGCDisabled() != TRUE)
return;
+#ifdef FEATURE_PERFTRACING
+ // Mark that the thread is currently in managed code.
+ pThread->SaveGCModeOnSuspension();
+#endif // FEATURE_PERFTRACING
+
PCODE ip = GetIP(interruptedContext);
// This function can only be called when the interrupted thread is in
diff --git a/src/vm/tieredcompilation.cpp b/src/vm/tieredcompilation.cpp
index 2032e66f1b..acc26b90a5 100644
--- a/src/vm/tieredcompilation.cpp
+++ b/src/vm/tieredcompilation.cpp
@@ -337,7 +337,11 @@ void TieredCompilationManager::InstallMethodCode(MethodDesc* pMethod, PCODE pCod
_ASSERTE(!pMethod->IsNativeCodeStableAfterInit());
PCODE pExistingCode = pMethod->GetNativeCode();
+#ifdef FEATURE_INTERPRETER
+ if (!pMethod->SetNativeCodeInterlocked(pCode, pExistingCode, TRUE))
+#else
if (!pMethod->SetNativeCodeInterlocked(pCode, pExistingCode))
+#endif
{
//We aren't there yet, but when the feature is finished we shouldn't be racing against any other code mutator and there would be no
//reason for this to fail
diff --git a/src/vm/typedesc.cpp b/src/vm/typedesc.cpp
index d05cb558bc..06170cb2c1 100644
--- a/src/vm/typedesc.cpp
+++ b/src/vm/typedesc.cpp
@@ -441,15 +441,17 @@ BOOL TypeDesc::CanCastTo(TypeHandle toType, TypeHandlePairList *pVisited)
// then we must be trying to cast to a class or interface type.
if (!toType.IsTypeDesc())
{
- MethodTable *pMT = GetMethodTable();
- if (pMT == 0) {
- // I don't have an underlying method table, therefore I'm
- // a variable type, pointer type, function pointer type
+ if (!IsArray())
+ {
+ // I am a variable type, pointer type, function pointer type
// etc. I am not an object or value type. Therefore
// I can't be cast to an object or value type.
return FALSE;
}
+ MethodTable *pMT = GetMethodTable();
+ _ASSERTE(pMT != 0);
+
// This does the right thing if 'type' == System.Array or System.Object, System.Clonable ...
if (pMT->CanCastToClassOrInterface(toType.AsMethodTable(), pVisited) != 0)
{
@@ -609,15 +611,17 @@ TypeHandle::CastResult TypeDesc::CanCastToNoGC(TypeHandle toType)
// then we must be trying to cast to a class or interface type.
if (!toType.IsTypeDesc())
{
- MethodTable *pMT = GetMethodTable();
- if (pMT == 0) {
- // I don't have an underlying method table, therefore I'm
- // a variable type, pointer type, function pointer type
+ if (!IsArray())
+ {
+ // I am a variable type, pointer type, function pointer type
// etc. I am not an object or value type. Therefore
// I can't be cast to an object or value type.
return TypeHandle::CannotCast;
}
+ MethodTable *pMT = GetMethodTable();
+ _ASSERTE(pMT != 0);
+
// This does the right thing if 'type' == System.Array or System.Object, System.Clonable ...
return pMT->CanCastToClassOrInterfaceNoGC(toType.AsMethodTable());
}
diff --git a/src/vm/win32threadpool.cpp b/src/vm/win32threadpool.cpp
index bc84762b06..a79656e745 100644
--- a/src/vm/win32threadpool.cpp
+++ b/src/vm/win32threadpool.cpp
@@ -4755,15 +4755,30 @@ DWORD ThreadpoolMgr::FireTimers()
timerInfo,
QUEUE_ONLY /* TimerInfo take care of deleting*/);
- timerInfo->FiringTime = currentTime+timerInfo->Period;
+ if (timerInfo->Period != 0 && timerInfo->Period != (ULONG)-1)
+ {
+ ULONG nextFiringTime = timerInfo->FiringTime + timerInfo->Period;
+ DWORD firingInterval;
+ if (TimeExpired(timerInfo->FiringTime, currentTime, nextFiringTime))
+ {
+ // Enough time has elapsed to fire the timer yet again. The timer is not able to keep up with the short
+ // period, have it fire 1 ms from now to avoid spinning without a delay.
+ timerInfo->FiringTime = currentTime + 1;
+ firingInterval = 1;
+ }
+ else
+ {
+ timerInfo->FiringTime = nextFiringTime;
+ firingInterval = TimeInterval(nextFiringTime, currentTime);
+ }
- if ((timerInfo->Period != 0) && (timerInfo->Period != (ULONG) -1) && (nextFiringInterval > timerInfo->Period))
- nextFiringInterval = timerInfo->Period;
+ if (firingInterval < nextFiringInterval)
+ nextFiringInterval = firingInterval;
+ }
}
-
else
{
- DWORD firingInterval = TimeInterval(timerInfo->FiringTime,currentTime);
+ DWORD firingInterval = TimeInterval(timerInfo->FiringTime, currentTime);
if (firingInterval < nextFiringInterval)
nextFiringInterval = firingInterval;
}
diff --git a/src/zap/zapheaders.cpp b/src/zap/zapheaders.cpp
index acec36bf2a..8960798981 100644
--- a/src/zap/zapheaders.cpp
+++ b/src/zap/zapheaders.cpp
@@ -325,7 +325,7 @@ ZapPEExports::ZapPEExports(LPCWSTR dllPath)
DWORD ZapPEExports::GetSize()
{
- return DWORD(sizeof(IMAGE_EXPORT_DIRECTORY) + wcslen(m_dllFileName) + 1);
+ return DWORD(sizeof(IMAGE_EXPORT_DIRECTORY) + wcslen(m_dllFileName) * sizeof(BYTE) + 1);
}
void ZapPEExports::Save(ZapWriter * pZapWriter)
diff --git a/src/zap/zapimage.cpp b/src/zap/zapimage.cpp
index 27b46520be..61cf099898 100644
--- a/src/zap/zapimage.cpp
+++ b/src/zap/zapimage.cpp
@@ -2620,6 +2620,12 @@ HRESULT ZapImage::parseProfileData()
READ(entry,CORBBTPROF_SECTION_TABLE_ENTRY);
SectionFormat format = sectionHeader->Entries[i].FormatID;
+ _ASSERTE(format >= 0);
+ if (format < 0)
+ {
+ continue;
+ }
+
if (convertFromV1)
{
if (format < LastTokenFlagSection)
diff --git a/src/zap/zapinfo.cpp b/src/zap/zapinfo.cpp
index af0c41c4e4..40d14ae51c 100644
--- a/src/zap/zapinfo.cpp
+++ b/src/zap/zapinfo.cpp
@@ -2656,41 +2656,6 @@ void ZapInfo::getModuleNativeEntryPointRange(void** pStart, void** pEnd)
// Initialize outparams to default range of (0,0).
*pStart = 0;
*pEnd = 0;
-
- // If this is ILONLY, there are no native entry points.
- if (m_pImage->m_ModuleDecoder.IsILOnly())
- {
- return;
- }
-
- rvaStart = rvaEnd = 0;
-
- // Walk the section table looking for a section named .nep.
-
- IMAGE_SECTION_HEADER *section = m_pImage->m_ModuleDecoder.FindFirstSection();
- IMAGE_SECTION_HEADER *sectionEnd = section + m_pImage->m_ModuleDecoder.GetNumberOfSections();
- while (section < sectionEnd)
- {
- if (strncmp((const char *)(section->Name), ".nep", IMAGE_SIZEOF_SHORT_NAME) == 0)
- {
- rvaStart = VAL32(section->VirtualAddress);
- rvaEnd = rvaStart + VAL32(section->Misc.VirtualSize);
- if (rvaStart < rvaEnd)
- {
- // RVA will be fixed up to the actual address at runtime
- CORCOMPILE_EE_INFO_TABLE * pEEInfoTable = (CORCOMPILE_EE_INFO_TABLE *)m_pImage->m_pEEInfoTable->GetData();
- pEEInfoTable->nativeEntryPointStart = (BYTE*)((ULONG_PTR)rvaStart);
- pEEInfoTable->nativeEntryPointEnd = (BYTE*)((ULONG_PTR)rvaEnd);
-
- *pStart = m_pImage->GetInnerPtr(m_pImage->m_pEEInfoTable,
- offsetof(CORCOMPILE_EE_INFO_TABLE, nativeEntryPointStart));
- *pEnd = m_pImage->GetInnerPtr(m_pImage->m_pEEInfoTable,
- offsetof(CORCOMPILE_EE_INFO_TABLE, nativeEntryPointEnd));
- }
- break;
- }
- section++;
- }
}
DWORD ZapInfo::getExpectedTargetArchitecture()
@@ -3195,10 +3160,6 @@ void * ZapInfo::getArrayInitializationData(CORINFO_FIELD_HANDLE field, DWORD siz
if (m_pEEJitInfo->getClassModule(m_pEEJitInfo->getFieldClass(field)) != m_pImage->m_hModule)
return NULL;
- // FieldDesc::SaveContents() does not save the RVA blob for IJW modules.
- if (!m_pImage->m_ModuleDecoder.IsILOnly())
- return NULL;
-
void * arrayData = m_pEEJitInfo->getArrayInitializationData(field, size);
if (!arrayData)
return NULL;
diff --git a/sync.cmd b/sync.cmd
index f63315559d..218fb9de8e 100644
--- a/sync.cmd
+++ b/sync.cmd
@@ -26,6 +26,8 @@ echo -BuildMajor
echo -BuildMinor
echo To download from a specific container, specify:
echo -Container="container name"
+echo To download blobs starting with a specific prefix, specify:
+echo -BlobNamePrefix="Blob name prefix"
echo -n - Downloads test native binaries from the specified container
echo The following properties are required:
echo -AzureAccount="Account name"
diff --git a/tests/arm64/Tests.lst b/tests/arm64/Tests.lst
index 53801cb072..6e963c1b87 100644
--- a/tests/arm64/Tests.lst
+++ b/tests/arm64/Tests.lst
@@ -689,7 +689,7 @@ RelativePath=baseservices\exceptions\regressions\Dev11\147911\test147911\test147
WorkingDir=baseservices\exceptions\regressions\Dev11\147911\test147911
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;EXCLUDED
+Categories=EXPECTED_FAIL;EXCLUDED;RVA_STATIC
HostStyle=0
[dynamicmethodliveness.cmd_86]
@@ -865,7 +865,7 @@ RelativePath=baseservices\exceptions\regressions\V1\SEH\VJ\UnmanagedToManaged\Un
WorkingDir=baseservices\exceptions\regressions\V1\SEH\VJ\UnmanagedToManaged
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL
+Categories=EXPECTED_FAIL;EXCLUDED;RVA_STATIC
HostStyle=0
[UserException.cmd_108]
@@ -26241,7 +26241,7 @@ RelativePath=GC\Stress\Framework\ReliabilityFramework\ReliabilityFramework.cmd
WorkingDir=GC\Stress\Framework\ReliabilityFramework
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_PASS
+Categories=EXPECTED_FAIL;11534
HostStyle=0
[csgen.1.cmd_3473]
@@ -59193,7 +59193,7 @@ RelativePath=JIT\Methodical\tailcall_v4\smallFrame\smallFrame.cmd
WorkingDir=JIT\Methodical\tailcall_v4\smallFrame
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;9462;EXPECTED_FAIL;6881
+Categories=Pri0;JIT;9462;EXPECTED_FAIL;6881;EXCLUDED;ILLEGAL_IL_TAILCALL_POP_RET
HostStyle=0
[tailcall_AV.cmd_7668]
@@ -61457,7 +61457,7 @@ RelativePath=JIT\opt\perf\doublealign\Locals\Locals.cmd
WorkingDir=JIT\opt\perf\doublealign\Locals
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;EXPECTED_FAIL;8418
+Categories=Pri0;EXPECTED_PASS
HostStyle=0
[objects.cmd_7953]
@@ -62041,7 +62041,7 @@ RelativePath=JIT\Performance\CodeQuality\Roslyn\CscBench\CscBench.cmd
WorkingDir=JIT\Performance\CodeQuality\Roslyn\CscBench
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;LONG_RUNNING;EXPECTED_PASS
+Categories=Pri0;LONG_RUNNING;EXPECTED_FAIL;11533
HostStyle=0
[SciMark.cmd_8027]
@@ -75873,7 +75873,7 @@ RelativePath=managed\Compilation\Compilation\Compilation.cmd
WorkingDir=managed\Compilation\Compilation
Expected=0
MaxAllowedDurationSeconds=800
-Categories=RT;Pri0;LONG_RUNNING;NATIVE_INTEROP;EXPECTED_FAIL;10108
+Categories=RT;Pri0;LONG_RUNNING;NATIVE_INTEROP;EXPECTED_FAIL;11533
HostStyle=0
[generics.cmd_9787]
@@ -75881,7 +75881,7 @@ RelativePath=readytorun\generics\generics.cmd
WorkingDir=readytorun\generics
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_PASS
+Categories=EXPECTED_FAIL;11534
HostStyle=0
[callgenericctor.cmd_9788]
@@ -75889,7 +75889,7 @@ RelativePath=readytorun\genericsload\callgenericctor\callgenericctor.cmd
WorkingDir=readytorun\genericsload\callgenericctor
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_PASS
+Categories=EXPECTED_FAIL;11534
HostStyle=0
[usegenericfield.cmd_9789]
@@ -75897,7 +75897,7 @@ RelativePath=readytorun\genericsload\usegenericfield\usegenericfield.cmd
WorkingDir=readytorun\genericsload\usegenericfield
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_PASS
+Categories=EXPECTED_FAIL;11534
HostStyle=0
[mainv1.cmd_9790]
@@ -75905,7 +75905,7 @@ RelativePath=readytorun\mainv1\mainv1.cmd
WorkingDir=readytorun\mainv1
Expected=0
MaxAllowedDurationSeconds=600
-Categories=UNSTABLE;EXPECTED_PASS
+Categories=UNSTABLE;EXPECTED_FAIL;11534
HostStyle=0
[mainv2.cmd_9791]
@@ -75913,7 +75913,7 @@ RelativePath=readytorun\mainv2\mainv2.cmd
WorkingDir=readytorun\mainv2
Expected=0
MaxAllowedDurationSeconds=600
-Categories=UNSTABLE;EXPECTED_PASS
+Categories=UNSTABLE;EXPECTED_FAIL;11534
HostStyle=0
[Dev10_629953.cmd_9792]
@@ -76513,7 +76513,7 @@ RelativePath=JIT\Regression\VS-ia64-JIT\V2.0-Beta2\b410474\b410474\b410474.cmd
WorkingDir=JIT\Regression\VS-ia64-JIT\V2.0-Beta2\b410474\b410474
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;2451;NEW
+Categories=EXPECTED_FAIL;2451;EXCLUDED;RVA_STATIC
HostStyle=0
[Generated1156.cmd_9867]
@@ -76665,7 +76665,7 @@ RelativePath=JIT\Regression\CLR-x86-EJIT\v1-m10\b07847\b07847\b07847.cmd
WorkingDir=JIT\Regression\CLR-x86-EJIT\v1-m10\b07847\b07847
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;2441;NEW
+Categories=EXPECTED_FAIL;2441;EXCLUDED;RVA_STATIC
HostStyle=0
[Generated554.cmd_9886]
@@ -76681,7 +76681,7 @@ RelativePath=JIT\jit64\mcc\interop\mcc_i60\mcc_i60.cmd
WorkingDir=JIT\jit64\mcc\interop\mcc_i60
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated1394.cmd_9888]
@@ -77105,7 +77105,7 @@ RelativePath=GC\Regressions\dev10bugs\536168\536168\536168.cmd
WorkingDir=GC\Regressions\dev10bugs\536168\536168
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;3392;LONG_RUNNING;NEW
+Categories=EXPECTED_FAIL;11534;LONG_RUNNING;NEW
HostStyle=0
[Generated1498.cmd_9941]
@@ -77289,7 +77289,7 @@ RelativePath=JIT\Directed\rvastatics\rvastatic2\rvastatic2.cmd
WorkingDir=JIT\Directed\rvastatics\rvastatic2
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;2451;NEW
+Categories=EXPECTED_FAIL;2451;EXCLUDED;RVA_STATIC
HostStyle=0
[Generated748.cmd_9964]
@@ -77569,7 +77569,7 @@ RelativePath=JIT\Regression\CLR-x86-JIT\V2.0-Beta2\b409748\b409748\b409748.cmd
WorkingDir=JIT\Regression\CLR-x86-JIT\V2.0-Beta2\b409748\b409748
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated1366.cmd_9999]
@@ -77889,7 +77889,7 @@ RelativePath=JIT\Regression\CLR-x86-JIT\V1-M09.5-PDC\b32374\b32374\b32374.cmd
WorkingDir=JIT\Regression\CLR-x86-JIT\V1-M09.5-PDC\b32374\b32374
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[BestFitMapping.cmd_10039]
@@ -78049,7 +78049,7 @@ RelativePath=JIT\Directed\coverage\importer\Desktop\nonrefsdarr_il_d\nonrefsdarr
WorkingDir=JIT\Directed\coverage\importer\Desktop\nonrefsdarr_il_d
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;4851;NEW
+Categories=EXPECTED_FAIL;4851;EXCLUDED;VERIFY
HostStyle=0
[Generated987.cmd_10060]
@@ -78161,7 +78161,7 @@ RelativePath=JIT\Methodical\refany\_il_relseq\_il_relseq.cmd
WorkingDir=JIT\Methodical\refany\_il_relseq
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated1476.cmd_10074]
@@ -78313,7 +78313,7 @@ RelativePath=JIT\opt\Tailcall\TailcallVerifyWithPrefix\TailcallVerifyWithPrefix.
WorkingDir=JIT\opt\Tailcall\TailcallVerifyWithPrefix
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;EXCLUDED;ILLEGAL_IL_TAILCALL_POP_RET
HostStyle=0
[Generated611.cmd_10093]
@@ -78337,7 +78337,7 @@ RelativePath=JIT\Directed\PREFIX\unaligned\2\arglist\arglist.cmd
WorkingDir=JIT\Directed\PREFIX\unaligned\2\arglist
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated404.cmd_10096]
@@ -78433,7 +78433,7 @@ RelativePath=JIT\Regression\CLR-x86-JIT\V1.2-Beta1\b102637\b102637\b102637.cmd
WorkingDir=JIT\Regression\CLR-x86-JIT\V1.2-Beta1\b102637\b102637
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;2451;NEW
+Categories=EXPECTED_FAIL;2451;EXCLUDED;RVA_STATIC
HostStyle=0
[ExecuteCodeWithGuaranteedCleanup.cmd_10108]
@@ -78577,7 +78577,7 @@ RelativePath=JIT\jit64\mcc\interop\mcc_i32\mcc_i32.cmd
WorkingDir=JIT\jit64\mcc\interop\mcc_i32
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated778.cmd_10126]
@@ -78801,7 +78801,7 @@ RelativePath=JIT\Regression\CLR-x86-JIT\V1-M09.5-PDC\b28901\b28901\b28901.cmd
WorkingDir=JIT\Regression\CLR-x86-JIT\V1-M09.5-PDC\b28901\b28901
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated659.cmd_10154]
@@ -78841,7 +78841,7 @@ RelativePath=JIT\jit64\mcc\interop\mcc_i10\mcc_i10.cmd
WorkingDir=JIT\jit64\mcc\interop\mcc_i10
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[overlap.cmd_10159]
@@ -78849,7 +78849,7 @@ RelativePath=JIT\Directed\RVAInit\overlap\overlap.cmd
WorkingDir=JIT\Directed\RVAInit\overlap
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;2451;NEW
+Categories=EXPECTED_FAIL;2451;EXCLUDED;RVA_STATIC
HostStyle=0
[b30838.cmd_10160]
@@ -78857,7 +78857,7 @@ RelativePath=JIT\Regression\CLR-x86-JIT\V1-M09.5-PDC\b30838\b30838\b30838.cmd
WorkingDir=JIT\Regression\CLR-x86-JIT\V1-M09.5-PDC\b30838\b30838
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated1430.cmd_10161]
@@ -78889,7 +78889,7 @@ RelativePath=JIT\Directed\tls\mutualrecurthd-tls\mutualrecurthd-tls.cmd
WorkingDir=JIT\Directed\tls\mutualrecurthd-tls
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;2441;NEW
+Categories=EXPECTED_FAIL;2441;EXCLUDED;TLS
HostStyle=0
[Generated461.cmd_10165]
@@ -78961,7 +78961,7 @@ RelativePath=JIT\Directed\PREFIX\volatile\1\arglist\arglist.cmd
WorkingDir=JIT\Directed\PREFIX\volatile\1\arglist
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated995.cmd_10174]
@@ -79073,7 +79073,7 @@ RelativePath=JIT\Directed\intrinsic\interlocked\rva_rvastatic1\rva_rvastatic1.cm
WorkingDir=JIT\Directed\intrinsic\interlocked\rva_rvastatic1
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;2451;NEW
+Categories=EXPECTED_FAIL;2451;EXCLUDED;RVA_STATIC
HostStyle=0
[Generated1145.cmd_10188]
@@ -79281,7 +79281,7 @@ RelativePath=JIT\Regression\JitBlue\DevDiv_359736\DevDiv_359736_ro\DevDiv_359736
WorkingDir=JIT\Regression\JitBlue\DevDiv_359736\DevDiv_359736_ro
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;10111;NEW
+Categories=EXPECTED_FAIL;8648;NEW
HostStyle=0
[Generated1104.cmd_10214]
@@ -79689,7 +79689,7 @@ RelativePath=JIT\Methodical\tailcall\_il_dbgpointer_i\_il_dbgpointer_i.cmd
WorkingDir=JIT\Methodical\tailcall\_il_dbgpointer_i
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;2451;NEW
+Categories=EXPECTED_FAIL;2451;EXCLUDED;RVA_STATIC
HostStyle=0
[Generated376.cmd_10266]
@@ -79753,7 +79753,7 @@ RelativePath=JIT\Regression\CLR-x86-JIT\V1.2-M01\b03689\b03689\b03689.cmd
WorkingDir=JIT\Regression\CLR-x86-JIT\V1.2-M01\b03689\b03689
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;2441;NEW
+Categories=EXPECTED_FAIL;2441;EXCLUDED;TLS
HostStyle=0
[FixedAddressValueType.cmd_10274]
@@ -80057,7 +80057,7 @@ RelativePath=JIT\Regression\CLR-x86-JIT\V1-M09.5-PDC\b26324\b26324a\b26324a.cmd
WorkingDir=JIT\Regression\CLR-x86-JIT\V1-M09.5-PDC\b26324\b26324a
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated563.cmd_10312]
@@ -80137,7 +80137,7 @@ RelativePath=JIT\jit64\mcc\interop\mcc_i72\mcc_i72.cmd
WorkingDir=JIT\jit64\mcc\interop\mcc_i72
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated277.cmd_10322]
@@ -80433,7 +80433,7 @@ RelativePath=JIT\Directed\coverage\importer\Desktop\bleref_il_r\bleref_il_r.cmd
WorkingDir=JIT\Directed\coverage\importer\Desktop\bleref_il_r
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;4851NEW
+Categories=EXPECTED_FAIL;4851;EXCLUDED;VERIFY
HostStyle=0
[Generated1391.cmd_10359]
@@ -80489,7 +80489,7 @@ RelativePath=JIT\Methodical\cctor\misc\global_il_d\global_il_d.cmd
WorkingDir=JIT\Methodical\cctor\misc\global_il_d
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;10109;NEW
+Categories=EXPECTED_FAIL;2451;EXCLUDED;RVA_STATIC
HostStyle=0
[Generated229.cmd_10367]
@@ -80521,7 +80521,7 @@ RelativePath=JIT\jit64\mcc\interop\mcc_i51\mcc_i51.cmd
WorkingDir=JIT\jit64\mcc\interop\mcc_i51
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated1179.cmd_10371]
@@ -80609,7 +80609,7 @@ RelativePath=JIT\Directed\PREFIX\unaligned\1\arglist\arglist.cmd
WorkingDir=JIT\Directed\PREFIX\unaligned\1\arglist
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated413.cmd_10382]
@@ -80809,7 +80809,7 @@ RelativePath=JIT\jit64\localloc\verify\verify01_small\verify01_small.cmd
WorkingDir=JIT\jit64\localloc\verify\verify01_small
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;8156;NEW
+Categories=EXPECTED_FAIL;4581;EXCLUDED;VERIFY
HostStyle=0
[Generated962.cmd_10407]
@@ -80905,7 +80905,7 @@ RelativePath=JIT\Methodical\eh\deadcode\badcodeafterfinally_d\badcodeafterfinall
WorkingDir=JIT\Methodical\eh\deadcode\badcodeafterfinally_d
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;2444;NEW
+Categories=EXPECTED_FAIL;2444;EXCLUDED
HostStyle=0
[Generated1238.cmd_10419]
@@ -81065,7 +81065,7 @@ RelativePath=JIT\Regression\CLR-x86-JIT\V1-M11-Beta1\b49644\b49644\b49644.cmd
WorkingDir=JIT\Regression\CLR-x86-JIT\V1-M11-Beta1\b49644\b49644
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;2451;NEW
+Categories=EXPECTED_FAIL;2451;EXCLUDED;RVA_STATIC
HostStyle=0
[global_il_r.cmd_10439]
@@ -81073,7 +81073,7 @@ RelativePath=JIT\Methodical\cctor\misc\global_il_r\global_il_r.cmd
WorkingDir=JIT\Methodical\cctor\misc\global_il_r
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;10109;NEW
+Categories=EXPECTED_FAIL;2451;EXCLUDED;RVA_STATIC
HostStyle=0
[dev10_865840.cmd_10440]
@@ -81081,7 +81081,7 @@ RelativePath=JIT\Regression\Dev11\dev10_865840\dev10_865840\dev10_865840.cmd
WorkingDir=JIT\Regression\Dev11\dev10_865840\dev10_865840
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;2445;NEW
+Categories=EXPECTED_FAIL;2445;EXCLUDED
HostStyle=0
[Generated728.cmd_10441]
@@ -81201,7 +81201,7 @@ RelativePath=JIT\jit64\mcc\interop\mcc_i82\mcc_i82.cmd
WorkingDir=JIT\jit64\mcc\interop\mcc_i82
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated1333.cmd_10456]
@@ -81257,7 +81257,7 @@ RelativePath=JIT\Directed\rvastatics\rvastatic4\rvastatic4.cmd
WorkingDir=JIT\Directed\rvastatics\rvastatic4
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;2451;NEW
+Categories=EXPECTED_FAIL;2451;EXCLUDED;RVA_STATIC
HostStyle=0
[Generated944.cmd_10463]
@@ -81297,7 +81297,7 @@ RelativePath=JIT\Regression\CLR-x86-JIT\V1-M09.5-PDC\b16423\b16423\b16423.cmd
WorkingDir=JIT\Regression\CLR-x86-JIT\V1-M09.5-PDC\b16423\b16423
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[DevDiv_279829.cmd_10468]
@@ -81337,7 +81337,7 @@ RelativePath=JIT\Regression\CLR-x86-EJIT\V1-M12-Beta2\b26323\b26323\b26323.cmd
WorkingDir=JIT\Regression\CLR-x86-EJIT\V1-M12-Beta2\b26323\b26323
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[smalloom.cmd_10473]
@@ -81473,7 +81473,7 @@ RelativePath=JIT\Methodical\xxobj\operand\_il_rellocalloc\_il_rellocalloc.cmd
WorkingDir=JIT\Methodical\xxobj\operand\_il_rellocalloc
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;2444;NEW
+Categories=EXPECTED_FAIL;2444;EXCLUDED
HostStyle=0
[Generated1025.cmd_10490]
@@ -81513,7 +81513,7 @@ RelativePath=JIT\Regression\CLR-x86-JIT\V1-M12-Beta2\b37646\b37646\b37646.cmd
WorkingDir=JIT\Regression\CLR-x86-JIT\V1-M12-Beta2\b37646\b37646
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated1223.cmd_10495]
@@ -81545,7 +81545,7 @@ RelativePath=JIT\Methodical\tailcall\_il_dbgpointer\_il_dbgpointer.cmd
WorkingDir=JIT\Methodical\tailcall\_il_dbgpointer
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;2451;NEW
+Categories=EXPECTED_FAIL;2451;EXCLUDED;RVA_STATIC
HostStyle=0
[Generated910.cmd_10499]
@@ -81569,7 +81569,7 @@ RelativePath=JIT\jit64\mcc\interop\mcc_i52\mcc_i52.cmd
WorkingDir=JIT\jit64\mcc\interop\mcc_i52
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated1380.cmd_10502]
@@ -81721,7 +81721,7 @@ RelativePath=JIT\jit64\localloc\verify\verify01_large\verify01_large.cmd
WorkingDir=JIT\jit64\localloc\verify\verify01_large
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;4851;NEW
+Categories=EXPECTED_FAIL;4851;EXCLUDED;VERIFY
HostStyle=0
[Generated202.cmd_10522]
@@ -81945,7 +81945,7 @@ RelativePath=JIT\Regression\CLR-x86-JIT\V1-M12-Beta2\b31746\b31746\b31746.cmd
WorkingDir=JIT\Regression\CLR-x86-JIT\V1-M12-Beta2\b31746\b31746
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated158.cmd_10550]
@@ -82305,7 +82305,7 @@ RelativePath=JIT\Methodical\Coverage\arglist_pos\arglist_pos.cmd
WorkingDir=JIT\Methodical\Coverage\arglist_pos
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[mcc_i03.cmd_10596]
@@ -82313,7 +82313,7 @@ RelativePath=JIT\jit64\mcc\interop\mcc_i03\mcc_i03.cmd
WorkingDir=JIT\jit64\mcc\interop\mcc_i03
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated126.cmd_10597]
@@ -82465,7 +82465,7 @@ RelativePath=JIT\Directed\rvastatics\rvastatic3\rvastatic3.cmd
WorkingDir=JIT\Directed\rvastatics\rvastatic3
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;2451;NEW
+Categories=EXPECTED_FAIL;2451;EXCLUDED;RVA_STATIC
HostStyle=0
[Generated1268.cmd_10616]
@@ -82705,7 +82705,7 @@ RelativePath=JIT\Methodical\tailcall\_il_relpointer\_il_relpointer.cmd
WorkingDir=JIT\Methodical\tailcall\_il_relpointer
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;2451;NEW
+Categories=EXPECTED_FAIL;2451;EXCLUDED;RVA_STATIC
HostStyle=0
[Generated1472.cmd_10646]
@@ -82929,7 +82929,7 @@ RelativePath=JIT\jit64\mcc\interop\mcc_i01\mcc_i01.cmd
WorkingDir=JIT\jit64\mcc\interop\mcc_i01
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated1017.cmd_10674]
@@ -83081,7 +83081,7 @@ RelativePath=JIT\jit64\mcc\interop\mcc_i70\mcc_i70.cmd
WorkingDir=JIT\jit64\mcc\interop\mcc_i70
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated335.cmd_10693]
@@ -83369,7 +83369,7 @@ RelativePath=JIT\jit64\regress\ndpw\21220\b21220\b21220.cmd
WorkingDir=JIT\jit64\regress\ndpw\21220\b21220
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;4851;NEW
+Categories=EXPECTED_FAIL;4851;EXCLUDED;VERIFY
HostStyle=0
[Generated1054.cmd_10730]
@@ -83889,7 +83889,7 @@ RelativePath=JIT\jit64\mcc\interop\mcc_i53\mcc_i53.cmd
WorkingDir=JIT\jit64\mcc\interop\mcc_i53
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[b37598.cmd_10795]
@@ -83897,7 +83897,7 @@ RelativePath=JIT\Regression\CLR-x86-JIT\V1-M11-Beta1\b37598\b37598\b37598.cmd
WorkingDir=JIT\Regression\CLR-x86-JIT\V1-M11-Beta1\b37598\b37598
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated647.cmd_10796]
@@ -83985,7 +83985,7 @@ RelativePath=JIT\jit64\mcc\interop\mcc_i71\mcc_i71.cmd
WorkingDir=JIT\jit64\mcc\interop\mcc_i71
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated790.cmd_10807]
@@ -84065,7 +84065,7 @@ RelativePath=JIT\Directed\coverage\importer\Desktop\bleref_il_d\bleref_il_d.cmd
WorkingDir=JIT\Directed\coverage\importer\Desktop\bleref_il_d
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;4851;NEW
+Categories=EXPECTED_FAIL;4851;EXCLUDED;VERIFY
HostStyle=0
[Generated113.cmd_10817]
@@ -84137,7 +84137,7 @@ RelativePath=JIT\Directed\RVAInit\extended\extended.cmd
WorkingDir=JIT\Directed\RVAInit\extended
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;2451;NEW
+Categories=EXPECTED_FAIL;2451;EXCLUDED;RVA_STATIC
HostStyle=0
[Generated255.cmd_10826]
@@ -84297,7 +84297,7 @@ RelativePath=JIT\Regression\CLR-x86-JIT\V1-M11-Beta1\b46867\b46867\b46867.cmd
WorkingDir=JIT\Regression\CLR-x86-JIT\V1-M11-Beta1\b46867\b46867
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated635.cmd_10847]
@@ -84449,7 +84449,7 @@ RelativePath=JIT\Directed\coverage\importer\Desktop\ldelemnullarr1_il_d\ldelemnu
WorkingDir=JIT\Directed\coverage\importer\Desktop\ldelemnullarr1_il_d
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;4851;NEW
+Categories=EXPECTED_FAIL;4851;EXCLUDED;VERIFY
HostStyle=0
[Generated1080.cmd_10866]
@@ -84481,7 +84481,7 @@ RelativePath=JIT\Regression\CLR-x86-JIT\V1-M13-RTM\b91248\b91248\b91248.cmd
WorkingDir=JIT\Regression\CLR-x86-JIT\V1-M13-RTM\b91248\b91248
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated42.cmd_10870]
@@ -84497,7 +84497,7 @@ RelativePath=JIT\jit64\mcc\interop\mcc_i33\mcc_i33.cmd
WorkingDir=JIT\jit64\mcc\interop\mcc_i33
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated830.cmd_10872]
@@ -84681,7 +84681,7 @@ RelativePath=JIT\jit64\mcc\interop\mcc_i63\mcc_i63.cmd
WorkingDir=JIT\jit64\mcc\interop\mcc_i63
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated582.cmd_10895]
@@ -84713,7 +84713,7 @@ RelativePath=JIT\jit64\mcc\interop\mcc_i02\mcc_i02.cmd
WorkingDir=JIT\jit64\mcc\interop\mcc_i02
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated1004.cmd_10900]
@@ -84897,7 +84897,7 @@ RelativePath=JIT\jit64\mcc\interop\mcc_i00\mcc_i00.cmd
WorkingDir=JIT\jit64\mcc\interop\mcc_i00
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated1389.cmd_10923]
@@ -85049,7 +85049,7 @@ RelativePath=JIT\Regression\CLR-x86-JIT\V1-M11-Beta1\b36472\b36472\b36472.cmd
WorkingDir=JIT\Regression\CLR-x86-JIT\V1-M11-Beta1\b36472\b36472
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[mcc_i31.cmd_10942]
@@ -85057,7 +85057,7 @@ RelativePath=JIT\jit64\mcc\interop\mcc_i31\mcc_i31.cmd
WorkingDir=JIT\jit64\mcc\interop\mcc_i31
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated572.cmd_10943]
@@ -85137,7 +85137,7 @@ RelativePath=JIT\jit64\gc\misc\funclet\funclet.cmd
WorkingDir=JIT\jit64\gc\misc\funclet
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated671.cmd_10953]
@@ -85153,7 +85153,7 @@ RelativePath=JIT\Directed\coverage\importer\Desktop\ldelemnullarr1_il_r\ldelemnu
WorkingDir=JIT\Directed\coverage\importer\Desktop\ldelemnullarr1_il_r
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;4851;NEW
+Categories=EXPECTED_FAIL;4851;EXCLUDED;VERIFY
HostStyle=0
[Generated1228.cmd_10956]
@@ -85337,7 +85337,7 @@ RelativePath=JIT\Regression\JitBlue\DevDiv_359736\DevDiv_359736_do\DevDiv_359736
WorkingDir=JIT\Regression\JitBlue\DevDiv_359736\DevDiv_359736_do
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;10111;NEW
+Categories=EXPECTED_FAIL;8648;NEW
HostStyle=0
[nonrefsdarr_il_r.cmd_10979]
@@ -85345,7 +85345,7 @@ RelativePath=JIT\Directed\coverage\importer\Desktop\nonrefsdarr_il_r\nonrefsdarr
WorkingDir=JIT\Directed\coverage\importer\Desktop\nonrefsdarr_il_r
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;4851;NEW
+Categories=EXPECTED_FAIL;4851;EXCLUDED;VERIFY
HostStyle=0
[Generated107.cmd_10980]
@@ -85433,7 +85433,7 @@ RelativePath=JIT\Regression\CLR-x86-JIT\V1-M09.5-PDC\b26324\b26324b\b26324b.cmd
WorkingDir=JIT\Regression\CLR-x86-JIT\V1-M09.5-PDC\b26324\b26324b
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[b41391.cmd_10992]
@@ -85441,7 +85441,7 @@ RelativePath=JIT\Regression\CLR-x86-JIT\V1-M11-Beta1\b41391\b41391\b41391.cmd
WorkingDir=JIT\Regression\CLR-x86-JIT\V1-M11-Beta1\b41391\b41391
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated814.cmd_10993]
@@ -85545,7 +85545,7 @@ RelativePath=JIT\Regression\CLR-x86-JIT\V1.2-M01\b08046\b08046\b08046.cmd
WorkingDir=JIT\Regression\CLR-x86-JIT\V1.2-M01\b08046\b08046
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;8156;NEW
+Categories=EXPECTED_FAIL;4849;EXCLUDED
HostStyle=0
[Generated1045.cmd_11006]
@@ -85913,7 +85913,7 @@ RelativePath=JIT\jit64\mcc\interop\mcc_i81\mcc_i81.cmd
WorkingDir=JIT\jit64\mcc\interop\mcc_i81
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated273.cmd_11052]
@@ -85969,7 +85969,7 @@ RelativePath=JIT\Regression\CLR-x86-JIT\V1-M12-Beta2\b31745\b31745\b31745.cmd
WorkingDir=JIT\Regression\CLR-x86-JIT\V1-M12-Beta2\b31745\b31745
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated463.cmd_11059]
@@ -86009,7 +86009,7 @@ RelativePath=JIT\jit64\mcc\interop\mcc_i73\mcc_i73.cmd
WorkingDir=JIT\jit64\mcc\interop\mcc_i73
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated1198.cmd_11064]
@@ -86073,7 +86073,7 @@ RelativePath=JIT\Regression\CLR-x86-JIT\V1-M09.5-PDC\b30864\b30864\b30864.cmd
WorkingDir=JIT\Regression\CLR-x86-JIT\V1-M09.5-PDC\b30864\b30864
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated738.cmd_11072]
@@ -86257,7 +86257,7 @@ RelativePath=JIT\Methodical\eh\deadcode\badcodeafterfinally_r\badcodeafterfinall
WorkingDir=JIT\Methodical\eh\deadcode\badcodeafterfinally_r
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;2444;NEW
+Categories=EXPECTED_FAIL;2444;EXCLUDED
HostStyle=0
[Generated180.cmd_11095]
@@ -86321,7 +86321,7 @@ RelativePath=JIT\Directed\tls\test-tls\test-tls.cmd
WorkingDir=JIT\Directed\tls\test-tls
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;2441;NEW
+Categories=EXPECTED_FAIL;2441;EXCLUDED;TLS
HostStyle=0
[Generated1227.cmd_11103]
@@ -86481,7 +86481,7 @@ RelativePath=JIT\jit64\mcc\interop\mcc_i11\mcc_i11.cmd
WorkingDir=JIT\jit64\mcc\interop\mcc_i11
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated715.cmd_11124]
@@ -86633,7 +86633,7 @@ RelativePath=JIT\Regression\CLR-x86-JIT\V1-M12-Beta2\b41852\b41852\b41852.cmd
WorkingDir=JIT\Regression\CLR-x86-JIT\V1-M12-Beta2\b41852\b41852
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated78.cmd_11143]
@@ -86905,7 +86905,7 @@ RelativePath=JIT\Directed\PREFIX\unaligned\4\arglist\arglist.cmd
WorkingDir=JIT\Directed\PREFIX\unaligned\4\arglist
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated1384.cmd_11177]
@@ -86929,7 +86929,7 @@ RelativePath=JIT\Regression\CLR-x86-JIT\V1-M11-Beta1\b35784\b35784\b35784.cmd
WorkingDir=JIT\Regression\CLR-x86-JIT\V1-M11-Beta1\b35784\b35784
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated445.cmd_11180]
@@ -87353,7 +87353,7 @@ RelativePath=JIT\superpmi\superpmicollect\superpmicollect.cmd
WorkingDir=JIT\superpmi\superpmicollect
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;NEW
+Categories=EXPECTED_FAIL;EXCLUDED;REQUIRES_SOURCES
HostStyle=0
[Generated483.cmd_11233]
@@ -87409,7 +87409,7 @@ RelativePath=JIT\Directed\intrinsic\interlocked\rva_rvastatic2\rva_rvastatic2.cm
WorkingDir=JIT\Directed\intrinsic\interlocked\rva_rvastatic2
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;2451;NEW
+Categories=EXPECTED_FAIL;2451;EXCLUDED;RVA_STATIC
HostStyle=0
[Generated993.cmd_11240]
@@ -87553,7 +87553,7 @@ RelativePath=JIT\Methodical\tailcall\_il_relpointer_i\_il_relpointer_i.cmd
WorkingDir=JIT\Methodical\tailcall\_il_relpointer_i
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;2451;NEW
+Categories=EXPECTED_FAIL;2451;EXCLUDED;RVA_STATIC
HostStyle=0
[Generated955.cmd_11258]
@@ -87713,7 +87713,7 @@ RelativePath=JIT\Directed\rvastatics\rvastatic1\rvastatic1.cmd
WorkingDir=JIT\Directed\rvastatics\rvastatic1
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;2451;NEW
+Categories=EXPECTED_FAIL;2451;EXCLUDED;RVA_STATIC
HostStyle=0
[Generated708.cmd_11278]
@@ -87793,7 +87793,7 @@ RelativePath=JIT\Methodical\refany\_il_dbgseq\_il_dbgseq.cmd
WorkingDir=JIT\Methodical\refany\_il_dbgseq
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[mcc_i61.cmd_11288]
@@ -87801,7 +87801,7 @@ RelativePath=JIT\jit64\mcc\interop\mcc_i61\mcc_i61.cmd
WorkingDir=JIT\jit64\mcc\interop\mcc_i61
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated1500.cmd_11289]
@@ -87849,7 +87849,7 @@ RelativePath=JIT\jit64\mcc\interop\mcc_i13\mcc_i13.cmd
WorkingDir=JIT\jit64\mcc\interop\mcc_i13
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated568.cmd_11295]
@@ -88169,7 +88169,7 @@ RelativePath=JIT\jit64\mcc\interop\mcc_i83\mcc_i83.cmd
WorkingDir=JIT\jit64\mcc\interop\mcc_i83
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated858.cmd_11335]
@@ -88337,7 +88337,7 @@ RelativePath=JIT\jit64\mcc\interop\mcc_i30\mcc_i30.cmd
WorkingDir=JIT\jit64\mcc\interop\mcc_i30
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated597.cmd_11356]
@@ -88505,7 +88505,7 @@ RelativePath=JIT\jit64\localloc\verify\verify01_dynamic\verify01_dynamic.cmd
WorkingDir=JIT\jit64\localloc\verify\verify01_dynamic
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;4851;NEW
+Categories=EXPECTED_FAIL;4851;EXCLUDED;VERIFY
HostStyle=0
[Generated1094.cmd_11377]
@@ -88697,7 +88697,7 @@ RelativePath=JIT\jit64\mcc\interop\mcc_i62\mcc_i62.cmd
WorkingDir=JIT\jit64\mcc\interop\mcc_i62
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated1398.cmd_11401]
@@ -88713,7 +88713,7 @@ RelativePath=JIT\Methodical\xxobj\operand\_il_dbglocalloc\_il_dbglocalloc.cmd
WorkingDir=JIT\Methodical\xxobj\operand\_il_dbglocalloc
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;2444;NEW
+Categories=EXPECTED_FAIL;2444;EXCLUDED
HostStyle=0
[mcc_i50.cmd_11403]
@@ -88721,7 +88721,7 @@ RelativePath=JIT\jit64\mcc\interop\mcc_i50\mcc_i50.cmd
WorkingDir=JIT\jit64\mcc\interop\mcc_i50
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated341.cmd_11404]
@@ -89145,7 +89145,7 @@ RelativePath=JIT\Directed\rvastatics\rvastatic5\rvastatic5.cmd
WorkingDir=JIT\Directed\rvastatics\rvastatic5
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;2451;NEW
+Categories=EXPECTED_FAIL;2451;EXCLUDED;RVA_STATIC
HostStyle=0
[pinvoke-bug.cmd_11457]
@@ -89321,7 +89321,7 @@ RelativePath=JIT\Directed\pinvoke\preemptive_cooperative\preemptive_cooperative.
WorkingDir=JIT\Directed\pinvoke\preemptive_cooperative
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_PASS;NEW;R2R_FAIL;10069;2434
+Categories=EXPECTED_PASS;NEW;R2R_FAIL;EXCLUDED;2434;KERNEL_32_DEPENDENCY
HostStyle=0
[Generated1089.cmd_11479]
@@ -89433,7 +89433,7 @@ RelativePath=JIT\Directed\intrinsic\interlocked\rva_rvastatic4\rva_rvastatic4.cm
WorkingDir=JIT\Directed\intrinsic\interlocked\rva_rvastatic4
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;2451;NEW
+Categories=EXPECTED_FAIL;2451;EXCLUDED;RVA_STATIC
HostStyle=0
[Generated249.cmd_11493]
@@ -89505,7 +89505,7 @@ RelativePath=JIT\Directed\intrinsic\interlocked\rva_rvastatic3\rva_rvastatic3.cm
WorkingDir=JIT\Directed\intrinsic\interlocked\rva_rvastatic3
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;2451;NEW
+Categories=EXPECTED_FAIL;2451;EXCLUDED;RVA_STATIC
HostStyle=0
[Generated968.cmd_11502]
@@ -89593,7 +89593,7 @@ RelativePath=JIT\Regression\CLR-x86-JIT\V1-M13-RTM\b88793\b88793\b88793.cmd
WorkingDir=JIT\Regression\CLR-x86-JIT\V1-M13-RTM\b88793\b88793
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated58.cmd_11513]
@@ -89649,7 +89649,7 @@ RelativePath=JIT\jit64\mcc\interop\mcc_i12\mcc_i12.cmd
WorkingDir=JIT\jit64\mcc\interop\mcc_i12
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated1282.cmd_11520]
@@ -89849,7 +89849,7 @@ RelativePath=JIT\jit64\mcc\interop\mcc_i80\mcc_i80.cmd
WorkingDir=JIT\jit64\mcc\interop\mcc_i80
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9462;NEW
+Categories=EXPECTED_FAIL;9462;EXCLUDED;VARARG
HostStyle=0
[Generated652.cmd_11546]
@@ -90257,7 +90257,7 @@ RelativePath=JIT\CheckProjects\CheckProjects\CheckProjects.cmd
WorkingDir=JIT\CheckProjects\CheckProjects
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;10635;NEW
+Categories=EXPECTED_FAIL;10635;EXCLUDED;REQUIRES_SOURCES
HostStyle=0
[ArrayMD1.cmd_11597]
diff --git a/tests/build.proj b/tests/build.proj
index 518d59ca69..ff2d96bada 100644
--- a/tests/build.proj
+++ b/tests/build.proj
@@ -20,6 +20,19 @@
</TraversalBuildDependsOn>
</PropertyGroup>
+ <ItemGroup>
+ <RestoreProjects Include="$(MSBuildThisFileDirectory)scripts\scripts.csproj" />
+ <RestoreProjects Include="$(MSBuildThisFileDirectory)src\Common\build_against_pkg_dependencies\build_against_pkg_dependencies.csproj" />
+ <RestoreProjects Include="$(MSBuildThisFileDirectory)src\Common\targeting_pack_ref\targeting_pack_ref.csproj" />
+ <RestoreProjects Include="$(MSBuildThisFileDirectory)src\Common\test_dependencies\test_dependencies.csproj" />
+ <RestoreProjects Include="$(MSBuildThisFileDirectory)src\Common\test_runtime\test_runtime.csproj" />
+ <RestoreProjects Include="$(MSBuildThisFileDirectory)src\JIT\config\benchmark+roslyn\benchmark+roslyn.csproj" />
+ <RestoreProjects Include="$(MSBuildThisFileDirectory)src\JIT\config\benchmark+serialize\benchmark+serialize.csproj" />
+ <RestoreProjects Include="$(MSBuildThisFileDirectory)src\JIT\config\benchmark\benchmark.csproj" />
+ <RestoreProjects Include="$(MSBuildThisFileDirectory)src\performance\performance.csproj" />
+ <RestoreProjects Include="$(MSBuildThisFileDirectory)src\TestWrappersConfig\TestWrappersConfig.csproj" />
+ </ItemGroup>
+
<Target Name="BuildTargetingPack" AfterTargets="BatchRestorePackages">
<Message Text="Building Targeting Pack" Importance="High" />
<MSBuild Projects="$(MSBuildThisFileDirectory)\src\Common\external\external.depproj" />
@@ -28,32 +41,19 @@
<Target Name="BatchRestorePackages" DependsOnTargets="VerifyDependencies">
<Message Importance="High" Text="[$([System.DateTime]::Now.ToString('HH:mm:ss.ff'))] Restoring all packages..." />
- <!-- restore all project.jsons in one pass for perf & to avoid concurrency problems -->
- <Exec Command="$(DnuRestoreCommand) $(DnuRestoreDirs)"
- StandardOutputImportance="Low" />
-
+ <!-- restore all csproj's with PackageReferences in one pass -->
+ <MSBuild Projects="build.proj"
+ Properties="RestoreProj=%(RestoreProjects.Identity)"
+ Targets="RestorePackage" />
+
<Message Importance="High" Text="[$([System.DateTime]::Now.ToString('HH:mm:ss.ff'))] Restoring all packages...Done." />
</Target>
- <!-- Task from buildtools that validates dependencies contained in project.json files. -->
- <UsingTask TaskName="ValidateProjectDependencyVersions" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll" />
-
- <!-- Tasks from buildtools for easy project.json dependency updates -->
- <UsingTask TaskName="UpdatePackageDependencyVersion" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll" />
-
- <!-- Create a collection of all project.json files for dependency updates. -->
- <ItemGroup>
- <ProjectJsonFiles Include="$(SourceDir)**\project.json" />
- <ProjectJsonFiles Include="$(ProjectDir)scripts\**\project.json" />
- </ItemGroup>
-
- <Target Name="UpdatePackageDependencyVersion">
- <UpdatePackageDependencyVersion ProjectJsons="@(ProjectJsonFiles)"
- PackageId="$(PackageId)"
- OldVersion="$(OldVersion)"
- NewVersion="$(NewVersion)" />
+ <Target Name="RestorePackage">
+ <Exec Command="$(DotnetRestoreCommand) $(RestoreProj) $(PackageVersionArg)"
+ StandardOutputImportance="Low" />
</Target>
<!-- Override RestorePackages from dir.traversal.targets and do a batch restore -->
<Target Name="RestorePackages" DependsOnTargets="BatchRestorePackages" />
-</Project>
+</Project> \ No newline at end of file
diff --git a/tests/dir.props b/tests/dir.props
index 3a9b043b09..96c3b2a6d9 100644
--- a/tests/dir.props
+++ b/tests/dir.props
@@ -1,5 +1,4 @@
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-
<!--
$(OS) is set to Unix/Windows_NT. This comes from an environment variable on Windows and MSBuild on Unix.
-->
@@ -36,7 +35,7 @@
<!-- Common properties -->
<PropertyGroup>
<RootBinDir>$(__RootBinDir)\</RootBinDir>
- <RootBinDir Condition="'$(__RootBinDir)'==''">$(ProjectDir)bin\</RootBinDir>
+ <RootBinDir Condition="'$(__RootBinDir)'==''">$(ProjectDir)..\bin\</RootBinDir>
</PropertyGroup>
<!-- Default Test platform to deploy the netstandard compiled tests to -->
@@ -59,56 +58,36 @@
<TargetingPackPath Condition="'$(BaseTargetingPackPath)' == ''">$(RootBinDir)TargetingPack\</TargetingPackPath>
</PropertyGroup>
- <Import Condition="Exists('$(ToolsDir)BuildVersion.targets')" Project="$(ToolsDir)BuildVersion.targets" />
+ <!-- Import Build tools common props file where repo-independent properties are found -->
+ <Import Condition="Exists('$(ToolsDir)Build.Common.props')" Project="$(ToolsDir)Build.Common.props" />
<!-- Provides properties for dependency versions and configures dependency verification/auto-upgrade. -->
<Import Project="$(ProjectDir)..\dependencies.props" />
- <!-- Common nuget properties -->
- <PropertyGroup>
- <NuGetToolPath Condition="'$(NuGetToolPath)'==''">$(PackagesDir)NuGet.exe</NuGetToolPath>
- <NuGetConfigFile Condition="'$(NuGetConfigFile)'==''">$(SourceDir)NuGet.Config</NuGetConfigFile>
- <NuGetConfigCommandLine>-ConfigFile "$(NuGetConfigFile)"</NuGetConfigCommandLine>
-
- <NugetRestoreCommand>"$(NuGetToolPath)"</NugetRestoreCommand>
- <NugetRestoreCommand>$(NugetRestoreCommand) install</NugetRestoreCommand>
- <!-- Trim off the last slash so that nuget doesn't get confused and say there are illegal characters on
- the path. -->
- <NugetRestoreCommand>$(NugetRestoreCommand) -OutputDirectory "$(PackagesDir.TrimEnd('\\'))"</NugetRestoreCommand>
- <NugetRestoreCommand>$(NugetRestoreCommand) $(NuGetConfigCommandLine)</NugetRestoreCommand>
- <NugetRestoreCommand>$(NugetRestoreCommand) -Verbosity detailed</NugetRestoreCommand>
- <NugetRestoreCommand Condition="'$(OsEnvironment)'=='Unix'">mono $(NuGetRestoreCommand)</NugetRestoreCommand>
- </PropertyGroup>
-
- <!-- list of nuget package sources passed to dnu -->
<ItemGroup>
<!-- Need to escape double forward slash (%2F) or MSBuild will normalize to one slash on Unix. -->
- <DnuSourceList Include="https:%2F%2Fdotnet.myget.org/F/dotnet-corefxlab/api/v3/index.json" />
- <DnuSourceList Include="https:%2F%2Fdotnet.myget.org/F/dotnet-core/api/v3/index.json" />
- <DnuSourceList Include="https:%2F%2Fapi.nuget.org/v3/index.json" />
+ <DotnetSourceList Include="$(PackagesDir)AzureTransfer\$(__BuildType)\pkg\" Condition="'$(OverwriteCoreClrPackageVersion)' == 'true'" />
+ <DotnetSourceList Include="https:%2F%2Fdotnet.myget.org/F/dotnet-corefxlab/api/v3/index.json" />
+ <DotnetSourceList Include="https:%2F%2Fdotnet.myget.org/F/dotnet-core/api/v3/index.json" />
+ <DotnetSourceList Include="https:%2F%2Fapi.nuget.org/v3/index.json" />
</ItemGroup>
-
-
- <!-- list of directories to perform batch restore -->
- <ItemGroup>
- <DnuRestoreDir Include="&quot;$(MSBuildProjectDirectory)\src&quot;" />
- </ItemGroup>
<PropertyGroup Condition="'$(BuildAllProjects)'=='true'">
<!-- When we do a traversal build we get all packages up front, don't restore them again -->
<RestorePackages>false</RestorePackages>
</PropertyGroup>
-
+
<PropertyGroup>
- <DotnetToolCommand Condition="'$(DotnetToolCommand)'=='' and '$(OsEnvironment)'!='Unix'">$(DotnetCliPath)dotnet.exe</DotnetToolCommand>
- <DotnetToolCommand Condition="'$(DotnetToolCommand)'=='' and '$(OsEnvironment)'=='Unix'">$(DotnetCliPath)dotnet</DotnetToolCommand>
+ <BuildVersionFile>$(BaseIntermediateOutputPath)BuildVersion-$(OfficialBuildId).props</BuildVersionFile>
+ </PropertyGroup>
- <DnuRestoreSource>@(DnuSourceList -> '--source %(Identity)', ' ')</DnuRestoreSource>
- <DnuRestoreDirs>@(DnuRestoreDir -> '%(Identity)', ' ')</DnuRestoreDirs>
+ <!-- If we want to overwrite the desired CoreCLR package version, we need to get the new version from the generated props file in bin/obj -->
+ <Import Condition="'$(OverwriteCoreClrPackageVersion)' == 'true'" Project="$(BuildVersionFile)" />
- <DnuRestoreCommand>$(DnuRestoreCommand) "$(DotnetToolCommand)"</DnuRestoreCommand>
- <DnuRestoreCommand>$(DnuRestoreCommand) restore</DnuRestoreCommand>
- <DnuRestoreCommand>$(DnuRestoreCommand) --packages "$(PackagesDir.TrimEnd('/\'.ToCharArray()))" $(DnuRestoreSource)</DnuRestoreCommand>
+ <PropertyGroup Condition="'$(OverwriteCoreClrPackageVersion)' == 'true'">
+ <VersionToRestore Condition="'$(StableVersion)' != ''">$(StableVersion)</VersionToRestore>
+ <VersionToRestore Condition="'$(VersionToRestore)' == ''">$(PackageVersion)-$(PreReleaseLabel)-$(BuildNumberMajor)-$(BuildNumberMinor)</VersionToRestore>
+ <PackageVersionArg>/p:CoreClrPackageVersion=$(VersionToRestore)</PackageVersionArg>
</PropertyGroup>
<!-- Which tests shall we build? Default: Priority 0 tests.
diff --git a/tests/helixperftasks.targets b/tests/helixperftasks.targets
index 62da5e4c32..d578360092 100644
--- a/tests/helixperftasks.targets
+++ b/tests/helixperftasks.targets
@@ -52,12 +52,8 @@
<Output TaskParameter="PerfTestAssemblies" ItemName="CoreCLRPerfTest" />
</GetPerfTestAssemblies>
- <ItemGroup>
- <DnuSourceList Include="$(CORE_ROOT)\.nuget\pkg" />
- </ItemGroup>
-
<!-- Restore the runtime dependencies -->
- <Exec Command="$(DnuRestoreCommand) &quot;$(TestRuntimeProjectJson)&quot;"
+ <Exec Command="$(DotnetRestoreCommand) &quot;$(TestRuntimeProjectJson)&quot;"
StandardOutputImportance="Low"
CustomErrorRegularExpression="^Unable to resolve .*"
IgnoreExitCode="true"
diff --git a/tests/helixprep.proj b/tests/helixprep.proj
index 22c5935ce1..2d08e91b13 100644
--- a/tests/helixprep.proj
+++ b/tests/helixprep.proj
@@ -74,7 +74,7 @@
Condition="'$(TargetsWindows)' == 'true' ">
<PropertyGroup>
- <CmdCrossgenVar Condition="'$(Crossgen)' == 'true'">set RunCrossGen=true</CrossgenVar>
+ <CmdCrossgenVar Condition="'$(Crossgen)' == 'true'">set RunCrossGen=true</CmdCrossgenVar>
<WrapperCmdContents>
<![CDATA[
@ECHO OFF
@@ -129,7 +129,7 @@ EXIT /B %ERRORLEVEL%
<WrapperShContents Condition="'$(Crossgen)' == 'true'">$(WrapperShContents) do%0a</WrapperShContents>
<WrapperShContents Condition="'$(Crossgen)' == 'true'">$(WrapperShContents) filename=%24{fileToPrecompile}%0a</WrapperShContents>
<WrapperShContents Condition="'$(Crossgen)' == 'true'">$(WrapperShContents) echo Precompiling %24filename%0a</WrapperShContents>
- <WrapperShContents Condition="'$(Crossgen)' == 'true'">$(WrapperShContents) %24overlayDir/crossgen /Platform_Assemblies_Paths %24overlayDir %24filename 1> %24filename.stdout 2>%24filename.stderr%0a</WrapperShContents>
+ <WrapperShContents Condition="'$(Crossgen)' == 'true'">$(WrapperShContents) %24overlayDir/crossgen /Platform_Assemblies_Paths %24overlayDir /in %24filename /out %24overlayDir/temp.ni.dll 1> %24filename.stdout 2>%24filename.stderr%0a</WrapperShContents>
<WrapperShContents Condition="'$(Crossgen)' == 'true'">$(WrapperShContents) exitCode=%24%3F%0a</WrapperShContents>
<WrapperShContents Condition="'$(Crossgen)' == 'true'">$(WrapperShContents) if [ %24exitCode != 0 ]%3B then%0a</WrapperShContents>
<WrapperShContents Condition="'$(Crossgen)' == 'true'">$(WrapperShContents) if grep -q -e '(COR_E_ASSEMBLYEXPECTED)' %24filename.stderr%3B then%0a</WrapperShContents>
@@ -137,7 +137,10 @@ EXIT /B %ERRORLEVEL%
<WrapperShContents Condition="'$(Crossgen)' == 'true'">$(WrapperShContents) else%0a</WrapperShContents>
<WrapperShContents Condition="'$(Crossgen)' == 'true'">$(WrapperShContents) echo Unable to precompile %24filename.%0a</WrapperShContents>
<WrapperShContents Condition="'$(Crossgen)' == 'true'">$(WrapperShContents) fi%0a</WrapperShContents>
- <WrapperShContents Condition="'$(Crossgen)' == 'true'">$(WrapperShContents) fi%0a</WrapperShContents>
+ <WrapperShContents Condition="'$(Crossgen)' == 'true'">$(WrapperShContents) else%0a</WrapperShContents>
+ <WrapperShContents Condition="'$(Crossgen)' == 'true'">$(WrapperShContents) rm %24filename%0a</WrapperShContents>
+ <WrapperShContents Condition="'$(Crossgen)' == 'true'">$(WrapperShContents) mv %24overlayDir/temp.ni.dll %24filename%0a</WrapperShContents>
+ <WrapperShContents Condition="'$(Crossgen)' == 'true'">$(WrapperShContents) fi%0a</WrapperShContents>
<WrapperShContents Condition="'$(Crossgen)' == 'true'">$(WrapperShContents) rm %24filename.stdout%0a</WrapperShContents>
<WrapperShContents Condition="'$(Crossgen)' == 'true'">$(WrapperShContents) rm %24filename.stderr%0a</WrapperShContents>
<WrapperShContents Condition="'$(Crossgen)' == 'true'">$(WrapperShContents) done%0a</WrapperShContents>
diff --git a/tests/issues.targets b/tests/issues.targets
index 0592888bb3..df8fc554d8 100644
--- a/tests/issues.targets
+++ b/tests/issues.targets
@@ -1,9 +1,6 @@
<?xml version="1.0" ?>
<Project DefaultTargets = "GetListOfTestCmds" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Condition="'$(XunitTestBinBase)' != ''">
- <ExcludeList Include="$(XunitTestBinBase)\GC\Scenarios\DoublinkList\doublinkgen\*">
- <Issue>6574</Issue>
- </ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)\GC\Coverage\271010\*">
<Issue>3392</Issue>
</ExcludeList>
@@ -43,9 +40,6 @@
<ExcludeList Include="$(XunitTestBinBase)\GC\Scenarios\muldimjagary\muldimjagary\*">
<Issue>3392</Issue>
</ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\GC\Scenarios\DoublinkList\dlstack\*">
- <Issue>6553</Issue>
- </ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\coverage\importer\Desktop\ldelemnullarr1_il_d\ldelemnullarr1_il_d.cmd">
<Issue>4851</Issue>
</ExcludeList>
@@ -121,22 +115,22 @@
<ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\VS-ia64-JIT\V2.0-Beta2\b410474\b410474\b410474.cmd">
<Issue>2451</Issue>
</ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\coverage\importer\Desktop\bleref_il_d\bleref_il_d.cmd">
+ <ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\coverage\importer\Desktop\bleref_il_d\bleref_il_d.cmd">
<Issue>4851</Issue>
</ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\coverage\importer\Desktop\bleref_il_r\bleref_il_r.cmd">
+ <ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\coverage\importer\Desktop\bleref_il_r\bleref_il_r.cmd">
<Issue>4851</Issue>
</ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\localloc\verify\verify01_dynamic\verify01_dynamic.cmd">
+ <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\localloc\verify\verify01_dynamic\verify01_dynamic.cmd">
<Issue>4851</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\localloc\verify\verify01_large\verify01_large.cmd">
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\localloc\verify\verify01_large\verify01_large.cmd">
<Issue>4851</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\localloc\verify\verify01_small\verify01_small.cmd">
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\localloc\verify\verify01_small\verify01_small.cmd">
<Issue>4851</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\regress\ndpw\21220\b21220\b21220.cmd">
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\regress\ndpw\21220\b21220\b21220.cmd">
<Issue>4851</Issue>
</ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\pinvoke\preemptive_cooperative\preemptive_cooperative.cmd">
@@ -169,6 +163,9 @@
<ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\Dev11\dev10_865840\dev10_865840\dev10_865840.cmd">
<Issue>2445</Issue>
</ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\JitBlue\GitHub_11408\GitHub_11408\GitHub_11408.cmd">
+ <Issue>11408</Issue>
+ </ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)\Loader\classloader\TypeGeneratorTests\TypeGeneratorTest612\Generated612\*">
<Issue>6707</Issue>
</ExcludeList>
@@ -187,12 +184,6 @@
<ExcludeList Include="$(XunitTestBinBase)\Loader\classloader\TypeGeneratorTests\TypeGeneratorTest683\Generated683\*">
<Issue>6707</Issue>
</ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\tailcall_v4\smallFrame\smallFrame.cmd">
- <Issue>9880</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)JIT\opt\Tailcall\TailcallVerifyWithPrefix\TailcallVerifyWithPrefix.cmd">
- <Issue>9880</Issue>
- </ExcludeList>
</ItemGroup>
<!-- The following are x86 failures -->
@@ -217,7 +208,10 @@
<Issue>7163, fails on both legacy backend and RyuJIT</Issue>
</ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\JitBlue\DevDiv_255294\DevDiv_255294\DevDiv_255294.cmd">
- <Issue>The test is too large for x86 and causes OutOfMemory exception.</Issue>
+ <Issue>11469, The test causes OutOfMemory exception in crossgen mode.</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\JitBlue\DevDiv_278523\DevDiv_278523\DevDiv_278523.cmd">
+ <Issue>11476, fails on both jit32 and RyuJit x86</Issue>
</ExcludeList>
</ItemGroup>
@@ -1139,9 +1133,6 @@
<ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\Dev11\dev10_865840\dev10_865840\dev10_865840.cmd">
<Issue>needs triage</Issue>
</ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\JITBlue\DevDiv_255294\DevDiv_255294\DevDiv_255294.cmd">
- <Issue>11142</Issue>
- </ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\VS-ia64-JIT\V1.2-Beta1\b302509\b302509\b302509.cmd">
<Issue>needs triage</Issue>
</ExcludeList>
diff --git a/tests/override.targets b/tests/override.targets
index a01163225f..0e7f82bf77 100644
--- a/tests/override.targets
+++ b/tests/override.targets
@@ -3,13 +3,13 @@
Overrides for all other targets (including build tools) can go in this file.
-->
- <!-- Contains overrides for the nuget reference resolution. The regular nuget reference resolution will not
+ <!-- Contains overrides for the nuget reference resolution. The regular nuget reference resolution will not
copy references local, which we need in order to correctly execute the xunit project -->
<Import Project="xunitwrapper.targets" Condition="'$(IsXunitWrapperProject)'=='true'" />
<!-- Override the AddDesignTimeFacadeReferences target to add the ability to reference System.Private.CoreLib.
Some tests use functionality not available in the portable reference assemblies.
- For portability reasons it's generally a good idea to reference the facades instead of the
+ For portability reasons it's generally a good idea to reference the facades instead of the
raw implementation assemblies. However, these tests are useful. -->
<Target Name="AddDesignTimeFacadeReferences"
Condition="'$(ReferenceSystemPrivateCoreLib)' == 'true'"
@@ -21,4 +21,13 @@
<ReferencePath Include="$(ProjectDir)\..\bin\Product\$(BuildOS).$(BuildArch).$(BuildType)\System.Private.CoreLib.dll" />
</ItemGroup>
</Target>
+
+ <PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
+ <!--
+ Allow this project to setup the default target frameworks. Note this depends on the targeting packs that VS
+ installs to resolve mscorlib and System. That should be fixed in the future.
+ -->
+ <_TargetFrameworkDirectories></_TargetFrameworkDirectories>
+ <_FullFrameworkReferenceAssemblyPaths></_FullFrameworkReferenceAssemblyPaths>
+ </PropertyGroup>
</Project>
diff --git a/tests/x86/legacyjit_x86_testenv.cmd b/tests/protononjit_testenv.cmd
index 41da4cf63d..bba0b6738c 100644
--- a/tests/x86/legacyjit_x86_testenv.cmd
+++ b/tests/protononjit_testenv.cmd
@@ -1,12 +1,12 @@
@REM -------------------------------------------------------------------------
@REM
-@REM This script provides x86 LEGACY_BACKEND JIT test environment settings
+@REM This script provides test environment settings for prototype/cross-targeting JITs.
@REM
@REM -------------------------------------------------------------------------
set COMPLUS_AltJit=*
set COMPLUS_AltJitNgen=*
-set COMPLUS_AltJitName=legacyjit.dll
+set COMPLUS_AltJitName=protononjit.dll
set COMPLUS_NoGuiOnAssert=1
set COMPLUS_AltJitAssertOnNYI=1
diff --git a/tests/publishdependency.targets b/tests/publishdependency.targets
index 6d1c6bdc78..8cae729776 100644
--- a/tests/publishdependency.targets
+++ b/tests/publishdependency.targets
@@ -18,20 +18,20 @@
</PropertyGroup>
<ItemGroup>
- <CoreRootProjectLockJsonFiles Include="$(SourceDir)Common\test_runtime\project.lock.json"/>
- <CoreRootProjectLockJsonFiles Include="$(SourceDir)Common\test_dependencies\project.lock.json"/>
+ <CoreRootProjectLockJsonFiles Include="$(SourceDir)Common\test_runtime\obj\project.assets.json"/>
+ <CoreRootProjectLockJsonFiles Include="$(SourceDir)Common\test_dependencies\obj\project.assets.json"/>
</ItemGroup>
<ItemGroup>
- <RefProjectLockJsonFiles Include="$(SourceDir)Common\targeting_pack_ref\project.lock.json"/>
+ <RefProjectLockJsonFiles Include="$(SourceDir)Common\targeting_pack_ref\obj\project.assets.json"/>
</ItemGroup>
<ItemGroup>
- <ProductProjectLockJsonFiles Include="$(SourceDir)Common\build_against_pkg_dependencies\project.lock.json"/>
+ <ProductProjectLockJsonFiles Include="$(SourceDir)Common\build_against_pkg_dependencies\obj\project.assets.json"/>
</ItemGroup>
<ItemGroup>
- <CrossGenFiles Include="..\packages\runtime.$(TargetRid).Microsoft.NETCore.Runtime.CoreCLR\$(CoreClrPackageVersion)\tools\crossgen*"/>
+ <CrossGenFiles Include="..\packages\runtime.$(TargetRid).Microsoft.NETCore.Runtime.CoreCLR\$(DesiredPackageVersionArg)\tools\crossgen*"/>
</ItemGroup>
<PropertyGroup>
@@ -43,10 +43,6 @@
Inputs="@(CoreRootProjectLockJsonFiles)"
Outputs="$(CORE_ROOT)\*.*">
- <MSBuild Projects="$(SourceDir)Common\test_runtime\test_runtime.csproj"/>
-
- <MSBuild Projects="$(SourceDir)Common\test_dependencies\test_dependencies.csproj"/>
-
<!-- This will use the overridden PrereleaseResolveNuGetPackageAssets, which outputs copy local items
for the xunit wrapper projects -->
<PrereleaseResolveNuGetPackageAssets AllowFallbackOnTargetSelection="false"
@@ -89,8 +85,6 @@
Inputs="@(RefProjectLockJsonFiles)"
Outputs="$(RefDestination)\*.*">
- <MSBuild Projects="$(SourceDir)Common\targeting_pack_ref\targeting_pack_ref.csproj"/>
-
<!-- This will use the overridden PrereleaseResolveNuGetPackageAssets, which outputs copy local items
for the xunit wrapper projects -->
<PrereleaseResolveNuGetPackageAssets AllowFallbackOnTargetSelection="true"
@@ -121,8 +115,6 @@
Inputs="@(ProductProjectLockJsonFiles)"
Outputs="$(ProductDestination)\*.*">
- <MSBuild Projects="$(SourceDir)Common\build_against_pkg_dependencies\build_against_pkg_dependencies.csproj"/>
-
<!-- This will use the overridden PrereleaseResolveNuGetPackageAssets, which outputs copy local items
for the xunit wrapper projects -->
<PrereleaseResolveNuGetPackageAssets AllowFallbackOnTargetSelection="true"
diff --git a/tests/runtest.cmd b/tests/runtest.cmd
index dcff1bd2ee..d500c53289 100644
--- a/tests/runtest.cmd
+++ b/tests/runtest.cmd
@@ -44,6 +44,7 @@ set __LongGCTests=
set __GCSimulatorTests=
set __AgainstPackages=
set __JitDisasm=
+set __IlasmRoundTrip=
set __CollectDumps=
:Arg_Loop
@@ -59,6 +60,7 @@ if /i "%1" == "-help" goto Usage
if /i "%1" == "x64" (set __BuildArch=x64&set __MSBuildBuildArch=x64&shift&goto Arg_Loop)
if /i "%1" == "x86" (set __BuildArch=x86&set __MSBuildBuildArch=x86&shift&goto Arg_Loop)
if /i "%1" == "arm" (set __BuildArch=arm&set __MSBuildBuildArch=arm&shift&goto Arg_Loop)
+if /i "%1" == "arm64" (set __BuildArch=arm64&set __MSBuildBuildArch=arm64&shift&goto Arg_Loop)
if /i "%1" == "debug" (set __BuildType=Debug&shift&goto Arg_Loop)
if /i "%1" == "release" (set __BuildType=Release&shift&goto Arg_Loop)
@@ -78,6 +80,7 @@ if /i "%1" == "jitstressregs" (set COMPlus_JitStressRegs=%2&shift&shift&
if /i "%1" == "jitminopts" (set COMPlus_JITMinOpts=1&shift&shift&goto Arg_Loop)
if /i "%1" == "jitforcerelocs" (set COMPlus_ForceRelocs=1&shift&shift&goto Arg_Loop)
if /i "%1" == "jitdisasm" (set __JitDisasm=1&shift&goto Arg_Loop)
+if /i "%1" == "ilasmroundtrip" (set __IlasmRoundTrip=1&shift&goto Arg_Loop)
if /i "%1" == "GenerateLayoutOnly" (set __GenerateLayoutOnly=1&shift&goto Arg_Loop)
if /i "%1" == "PerfTests" (set __PerfTests=true&shift&goto Arg_Loop)
if /i "%1" == "runcrossgentests" (set RunCrossGen=true&shift&goto Arg_Loop)
@@ -199,6 +202,8 @@ call :PrecompileFX
:SkipPrecompileFX
if defined __GenerateLayoutOnly (
+ REM Delete the unecessary mscorlib.ni file.
+ del %CORE_ROOT%\mscorlib.ni.dll
exit /b 0
)
@@ -233,6 +238,7 @@ if "%__CollectDumps%"=="true" (
echo %__MsgPrefix%CORE_ROOT that will be used is: %CORE_ROOT%
echo %__MsgPrefix%Starting the test run ...
+REM Delete the unecessary mscorlib.ni file.
del %CORE_ROOT%\mscorlib.ni.dll
set __BuildLogRootName=TestRunResults
@@ -406,6 +412,11 @@ if defined __JitDisasm (
set RunningJitDisasm=1
)
+if defined __IlasmRoundTrip (
+ echo Running Ilasm round trip
+ set RunningIlasmRoundTrip=1
+)
+
set __BuildLogRootName=Tests_GenerateRuntimeLayout
call :msbuild "%__ProjectFilesDir%\runtest.proj" /p:GenerateRuntimeLayout=true
if errorlevel 1 (
@@ -438,6 +449,7 @@ echo jitstressregs n - Runs the tests with COMPlus_JitStressRegs=n
echo jitminopts - Runs the tests with COMPlus_JITMinOpts=1
echo jitforcerelocs - Runs the tests with COMPlus_ForceRelocs=1
echo jitdisasm - Runs jit-dasm on the tests
+echo ilasmroundtrip - Runs ilasm round trip on the tests
echo gcstresslevel n - Runs the tests with COMPlus_GCStress=n
echo 0: None 1: GC on all allocs and 'easy' places
echo 2: GC on transitions to preemptive GC 4: GC on every allowable JITed instr
diff --git a/tests/runtest.proj b/tests/runtest.proj
index 9ebe5c00b6..e4b3664f31 100644
--- a/tests/runtest.proj
+++ b/tests/runtest.proj
@@ -80,14 +80,13 @@ $(_XunitEpilog)
<OutputType>Library</OutputType>
<TargetFrameworkIdentifier Condition ="'$(BuildTestsAgainstPackages)' != 'true'">.NETFramework</TargetFrameworkIdentifier>
<TargetFrameworkVersion Condition ="'$(BuildTestsAgainstPackages)' != 'true'">v4.5</TargetFrameworkVersion>
+ <NugetTargetMonikerShort Condition ="'$(BuildTestsAgainstPackages)' != 'true'">net45</NugetTargetMonikerShort>
<IsXunitWrapperProject>true</IsXunitWrapperProject>
<SkipSigning>true</SkipSigning>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="%24(SolutionDir) == '' Or %24(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<CLRTestKind>BuildOnly</CLRTestKind>
<IsTestProject>true</IsTestProject>
- <ProjectJson Condition="'$(BuildTestsAgainstPackages)' != 'true'">%24(TestWrappersPackagesConfigFileDirectory)project.json</ProjectJson>
- <ProjectLockJson Condition="'$(BuildTestsAgainstPackages)' != 'true'">%24(TestWrappersPackagesConfigFileDirectory)project.lock.json</ProjectLockJson>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '%24(Configuration)|%24(Platform)' == 'Debug|AnyCPU' ">
@@ -118,7 +117,8 @@ $(_XunitEpilog)
</ItemGroup>
<Import Project="$(SourceDir)dir.targets" />
<PropertyGroup>
- <OutDir>$(XunitTestBinBase)\$(CategoryWithSlash)\</OutDir>
+ <OutDir>$(XunitTestBinBase)\$(CategoryWithSlash)\</OutDir>
+ <ProjectAssetsFile Condition="'$(BuildTestsAgainstPackages)' != 'true'">%24(TestWrappersPackagesConfigFileDirectory)obj/project.assets.json</ProjectAssetsFile>
</PropertyGroup>
</Project>
]]>
@@ -318,7 +318,16 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\","").
<ItemGroup>
<AllRunnableTestPaths Include="$(XunitTestBinBase)\**\*.cmd" />
</ItemGroup>
- </Target>
+ </Target>
+
+ <!-- If we want to overwrite the desired CoreCLR package version, we need to get the new version from the generated props file in bin/obj -->
+ <Import Condition="'$(OverwriteCoreClrPackageVersion)' == 'true'" Project="$(BuildVersionFile)" />
+
+ <PropertyGroup Condition="'$(OverwriteCoreClrPackageVersion)' == 'true'">
+ <VersionToRestore Condition="'$(StableVersion)' != ''">$(StableVersion)</VersionToRestore>
+ <VersionToRestore Condition="'$(VersionToRestore)' == ''">$(PackageVersion)-$(PreReleaseLabel)-$(BuildNumberMajor)-$(BuildNumberMinor)</VersionToRestore>
+ <DesiredPackageVersionArg>$(VersionToRestore)</DesiredPackageVersionArg>
+ </PropertyGroup>
<Import Project="tests.targets" />
<Import Project="publishdependency.targets" />
@@ -326,6 +335,7 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\","").
<PropertyGroup>
<TargetRid Condition="'$(RuntimeId)' != ''">$(RuntimeId)</TargetRid>
<TargetRid Condition="'$(RuntimeId)' == ''">$(TestNugetRuntimeId)</TargetRid>
+ <DesiredPackageVersionArg Condition="'$(DesiredPackageVersionArg)' == ''">$(CoreClrPackageVersion)</DesiredPackageVersionArg>
</PropertyGroup>
<Target Name="CreateTestOverlay">
diff --git a/tests/runtest.sh b/tests/runtest.sh
index e0458133da..439bbb66e6 100755
--- a/tests/runtest.sh
+++ b/tests/runtest.sh
@@ -51,6 +51,7 @@ function print_usage {
echo ' --jitforcerelocs : Runs the tests with COMPlus_ForceRelocs=1'
echo ' --jitdisasm : Runs jit-dasm on the tests'
echo ' --gcstresslevel=<n> : Runs the tests with COMPlus_GCStress=n'
+ echo ' --ilasmroundtrip : Runs ilasm round trip on the tests'
echo ' 0: None 1: GC on all allocs and '"'easy'"' places'
echo ' 2: GC on transitions to preemptive GC 4: GC on every allowable JITed instr'
echo ' 8: GC on every allowable NGEN instr 16: GC only on a unique stack trace'
@@ -406,7 +407,7 @@ function precompile_overlay_assemblies {
$overlayDir/crossgen /Platform_Assemblies_Paths $overlayDir $filename 1> $filename.stdout 2>$filename.stderr
local exitCode=$?
if [[ $exitCode != 0 ]]; then
- if grep -q -e '(COR_E_ASSEMBLYEXPECTED)' $filename.stderr; then
+ if grep -q -e '0x80131018' $filename.stderr; then
printf "\n\t$filename is not a managed assembly.\n\n"
else
echo Unable to precompile $filename.
@@ -975,6 +976,7 @@ illinker=
verbose=0
doCrossgen=0
jitdisasm=0
+ilasmroundtrip=
for i in "$@"
do
@@ -1008,6 +1010,9 @@ do
--jitdisasm)
jitdisasm=1
;;
+ --ilasmroundtrip)
+ ((ilasmroundtrip = 1))
+ ;;
--testRootDir=*)
testRootDir=${i#*=}
;;
@@ -1139,6 +1144,11 @@ if [[ ! "$jitdisasm" -eq 0 ]]; then
export RunningJitDisasm=1
fi
+if [ ! -z "$ilasmroundtrip" ]; then
+ echo "Running Ilasm round trip"
+ export RunningIlasmRoundTrip=1
+fi
+
# If this is a coverage run, make sure the appropriate args have been passed
if [ "$CoreClrCoverage" == "ON" ]
then
@@ -1192,18 +1202,6 @@ else
load_failing_tests
fi
-# Other architectures are not supported yet.
-if [ "$ARCH" == "x64" ]
-then
- scriptPath=$(dirname $0)
- ${scriptPath}/setup-runtime-dependencies.sh --outputDir=$coreOverlayDir
-else
- if [ "$ARCH" != "arm64" ]
- then
- echo "Skip preparing for GC stress test. Dependent package is not supported on this architecture."
- fi
-fi
-
export __TestEnv=$testEnv
cd "$testRootDir"
diff --git a/tests/scripts/arm32_ci_script.sh b/tests/scripts/arm32_ci_script.sh
index 209ab39869..98f35066d4 100755
--- a/tests/scripts/arm32_ci_script.sh
+++ b/tests/scripts/arm32_ci_script.sh
@@ -265,7 +265,9 @@ function cross_build_coreclr_with_docker {
# For armel Tizen, we are going to construct RootFS on the fly.
case $__linuxCodeName in
tizen)
- __dockerImage=" t2wish/dotnetcore:ubuntu1404_cross_prereqs_v4"
+ __dockerImage=" hqueue/dotnetcore:ubuntu1404_cross_prereqs_v4-tizen_rootfs"
+ __skipRootFS=1
+ __dockerEnvironmentVariables+=" -e ROOTFS_DIR=/crossrootfs/armel.tizen.build"
__runtimeOS="tizen.4.0.0"
;;
*)
@@ -381,7 +383,9 @@ function run_tests_using_docker {
elif [ "$__buildArch" == "armel" ]; then
case $__linuxCodeName in
tizen)
- __dockerImage=" t2wish/dotnetcore:ubuntu1404_cross_prereqs_v3"
+ __dockerImage=" hqueue/dotnetcore:ubuntu1404_cross_prereqs_v4-tizen_rootfs"
+ __skipRootFS=1
+ __dockerEnvironmentVariables=" -e ROOTFS_DIR=/crossrootfs/armel.tizen.test"
;;
*)
exit_with_error "ERROR: $__linuxCodeName is not a supported linux name for $__buildArch" false
diff --git a/tests/scripts/arm32_ci_test.sh b/tests/scripts/arm32_ci_test.sh
index 2f0b03150b..3fb36e12ec 100755
--- a/tests/scripts/arm32_ci_test.sh
+++ b/tests/scripts/arm32_ci_test.sh
@@ -81,25 +81,11 @@ else
fi
if [ "$__abi" == "armel" ]; then
- # TODO: Make use of a single Tizen rootfs for build and test
-
- # TODO-cleanup: the latest docker image already has mic installed.
- # Prepare Tizen (armel) environment
- #echo "deb http://download.tizen.org/tools/latest-release/Ubuntu_14.04 /" >> /etc/apt/sources.list
- #apt-get update
- #apt-get -y -qq --force-yes install mic
-
+ # Prepare armel emulation environment
pushd ${CORECLR_DIR}/cross/armel/tizen
- mic --non-interactive create fs --pack-to=tizen.tar.gz tizen-dotnet.ks
- if [ -d ${__ROOTFS_DIR} ]; then
- mv ${__ROOTFS_DIR} ${__ROOTFS_DIR}_build
- fi
- mkdir -p ${__ROOTFS_DIR}
- tar -zxf mic-output/tizen.tar.gz -C ${__ROOTFS_DIR}
apt-get update
apt-get -y -qq --force-yes --reinstall install qemu binfmt-support qemu-user-static
__qemuARM=$(which qemu-arm-static)
- cp $__qemuARM ${CORECLR_DIR}/cross/rootfs/armel/usr/bin/
cp $__qemuARM ${__ROOTFS_DIR}/usr/bin/
popd
fi
diff --git a/tests/scripts/arm64_post_build.py b/tests/scripts/arm64_post_build.py
index 4ed8032fc2..62818c433b 100644
--- a/tests/scripts/arm64_post_build.py
+++ b/tests/scripts/arm64_post_build.py
@@ -34,8 +34,7 @@ from collections import defaultdict
g_arm64ci_path = os.path.join(os.environ["USERPROFILE"], "bin")
g_dotnet_url = "https://go.microsoft.com/fwlink/?LinkID=831469"
-g_test_url = "https://clrjit.blob.core.windows.net/arm64ci/CoreCLR-Pri1Testing.zip"
-g_x64_client_url = "https://clrjit.blob.core.windows.net/arm64ci/x64_client.zip"
+g_x64_client_url = "https://clrjit.blob.core.windows.net/arm64ci/x64_client_live_tests.zip"
################################################################################
# Argument Parser
@@ -88,6 +87,34 @@ def copy_core_root(core_root):
except OSError as error:
log("Core Root not copied. Error: %s" % error)
+ sys.exit(1)
+
+ return new_location
+
+def copy_tests(test_location):
+ """ Copy the test directory to the current dir as "tests"
+ Args:
+ test_location (str): location of the tests directory
+ Returns:
+ copy_location (str): name of the location, for now hardcoded to tests
+ : for backcompat in the old system
+ """
+
+ new_location = "tests"
+
+ # Delete used instances.
+ if os.path.isdir(new_location):
+ try:
+ shutil.rmtree(new_location)
+ except:
+ assert not os.path.isdir(new_location)
+
+ try:
+ shutil.copytree(test_location, new_location)
+
+ except OSError as error:
+ log("Test location not copied. Error: %s" % error)
+ sys.exit(1)
return new_location
@@ -249,15 +276,28 @@ def validate_args(args):
def main(args):
global g_arm64ci_path
- global g_test_url
repo_root, arch, build_type, scenario, key_location, force_update = validate_args(args)
+ cwd = os.getcwd()
+ os.chdir(repo_root)
+
+ runtest_location = os.path.join(repo_root, "tests", "runtest.cmd")
+ args = [runtest_location, "GenerateLayoutOnly", arch, build_type]
+ subprocess.check_call(args)
+
+ os.chdir(cwd)
+
core_root = os.path.join(repo_root,
"bin",
"Product",
"Windows_NT.%s.%s" % (arch, build_type))
+ test_location = os.path.join(repo_root,
+ "bin",
+ "tests",
+ "Windows_NT.%s.%s" % (arch, build_type))
+
cli_location = setup_cli(force_update=force_update)
add_item_to_path(cli_location)
@@ -269,6 +309,9 @@ def main(args):
core_root = copy_core_root(core_root)
log("Copied core_root to %s." % core_root)
+ test_location = copy_tests(test_location)
+ log("Copied test location to %s." % test_location)
+
# Make sure the lst file is copied into the core_root
lst_file = os.path.join(repo_root, "tests", arch, "Tests.lst")
shutil.copy2(lst_file, core_root)
@@ -280,7 +323,7 @@ def main(args):
build_type,
scenario,
core_root,
- g_test_url]
+ test_location]
log(" ".join(args))
proc = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
diff --git a/tests/scripts/optdata/bootstrap.py b/tests/scripts/optdata/bootstrap.py
index 1cf55fa70c..8dcecca779 100755
--- a/tests/scripts/optdata/bootstrap.py
+++ b/tests/scripts/optdata/bootstrap.py
@@ -7,12 +7,12 @@
"""
import argparse
-import json
import os
from os import path
import shutil
import subprocess
import sys
+import xml.etree.ElementTree as ET
# Display the docstring if the user passes -h|--help
argparse.ArgumentParser(description=__doc__).parse_args()
@@ -24,8 +24,8 @@ NUGET_SRC_DIR = path.join(REPO_ROOT, 'src', '.nuget')
assert path.exists(NUGET_SRC_DIR), \
"Expected %s to exist; please check whether REPO_ROOT is really %s" % (NUGET_SRC_DIR, REPO_ROOT)
-ORIGIN_FILE = path.join(SCRIPT_ROOT, 'project.json')
-TARGET_FILE = path.join(NUGET_SRC_DIR, 'optdata', 'project.json')
+ORIGIN_FILE = path.join(SCRIPT_ROOT, 'optdata.csproj')
+TARGET_FILE = path.join(NUGET_SRC_DIR, 'optdata', 'optdata.csproj')
ARCH_LIST = ['x64', 'x86']
TOOL_LIST = ['IBC', 'PGO']
@@ -40,9 +40,12 @@ def get_buildos():
def get_optdata_version(tool):
"""Returns the version string specified in project.json for the given tool."""
- package_name = 'optimization.%s.CoreCLR' % (tool)
- with open(ORIGIN_FILE) as json_file:
- return json.load(json_file)['dependencies'][package_name]
+ element_name = {
+ 'IBC': 'IbcDataPackageVersion',
+ 'PGO': 'PgoDataPackageVersion',
+ }[tool]
+ root = ET.parse(ORIGIN_FILE)
+ return root.findtext('./PropertyGroup/{}'.format(element_name))
def get_optdata_dir(tool, arch):
"""Returns an absolute path to the directory that should contain optdata given a tool,arch"""
diff --git a/tests/scripts/optdata/optdata.csproj b/tests/scripts/optdata/optdata.csproj
new file mode 100644
index 0000000000..ac7360643f
--- /dev/null
+++ b/tests/scripts/optdata/optdata.csproj
@@ -0,0 +1,29 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+
+ <PropertyGroup>
+ <TargetFramework>netstandard</TargetFramework>
+ <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
+ <RuntimeIdentifiers>win7-x64;win7-x86;linux-x64</RuntimeIdentifiers>
+ </PropertyGroup>
+
+ <PropertyGroup>
+ <PgoDataPackageVersion>99.99.99-test</PgoDataPackageVersion>
+ <IbcDataPackageVersion>99.99.99-test</IbcDataPackageVersion>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <PackageReference Include="optimization.PGO.CoreCLR" Version="$(PgoDataPackageVersion)" Condition="'$(PgoDataPackageVersion)'!=''" />
+ <PackageReference Include="optimization.IBC.CoreCLR" Version="$(IbcDataPackageVersion)" Condition="'$(IbcDataPackageVersion)'!=''" />
+ </ItemGroup>
+
+ <Target Name="DumpPgoDataPackageVersion">
+ <Message Importance="high" Text="$(PgoDataPackageVersion)" />
+ </Target>
+
+ <Target Name="DumpIbcDataPackageVersion">
+ <Message Importance="high" Text="$(IbcDataPackageVersion)" />
+ </Target>
+
+</Project>
diff --git a/tests/scripts/optdata/project.json b/tests/scripts/optdata/project.json
deleted file mode 100644
index ae8f9463c4..0000000000
--- a/tests/scripts/optdata/project.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "dependencies": {
- "optimization.IBC.CoreCLR": "99.99.99-test",
- "optimization.PGO.CoreCLR": "99.99.99-test"
- },
- "frameworks": {
- "netstandard": {}
- },
- "runtimes": {
- "win7-x64": {}
- }
-}
diff --git a/tests/scripts/project.json b/tests/scripts/project.json
index b3c3a15f62..394cd2f922 100644
--- a/tests/scripts/project.json
+++ b/tests/scripts/project.json
@@ -15,4 +15,4 @@
]
}
}
-}
+} \ No newline at end of file
diff --git a/tests/scripts/run-gc-reliability-framework.cmd b/tests/scripts/run-gc-reliability-framework.cmd
new file mode 100644
index 0000000000..f9a6ae277d
--- /dev/null
+++ b/tests/scripts/run-gc-reliability-framework.cmd
@@ -0,0 +1,10 @@
+@rem Licensed to the .NET Foundation under one or more agreements.
+@rem The .NET Foundation licenses this file to you under the MIT license.
+@rem See the LICENSE file in the project root for more information.
+
+@echo off
+
+set CORE_ROOT=%CD%\bin\tests\Windows_NT.%1.%2\Tests\Core_Root
+set FRAMEWORK_DIR=%CD%\bin\tests\Windows_NT.%1.%2\GC\Stress\Framework\ReliabilityFramework
+powershell "%CORE_ROOT%\CoreRun.exe %FRAMEWORK_DIR%\ReliabilityFramework.exe %FRAMEWORK_DIR%\testmix_gc.config | tee stdout.txt"
+
diff --git a/tests/scripts/run-gc-reliability-framework.sh b/tests/scripts/run-gc-reliability-framework.sh
new file mode 100755
index 0000000000..d1c200ef02
--- /dev/null
+++ b/tests/scripts/run-gc-reliability-framework.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+export CORE_ROOT=`pwd`/bin/tests/Windows_NT.$1.$2/Tests/coreoverlay
+FRAMEWORK_DIR=`pwd`/bin/tests/Windows_NT.$1.$2/GC/Stress/Framework/ReliabilityFramework
+$CORE_ROOT/corerun $FRAMEWORK_DIR/ReliabilityFramework.exe $FRAMEWORK_DIR/testmix_gc.config | tee stdout.txt
+
diff --git a/tests/scripts/run-throughput-perf.py b/tests/scripts/run-throughput-perf.py
index ee6e4a3c58..cc1e151b41 100644
--- a/tests/scripts/run-throughput-perf.py
+++ b/tests/scripts/run-throughput-perf.py
@@ -53,7 +53,6 @@ jit_list = {
'Windows_NT': {
'x64': 'clrjit.dll',
'x86': 'clrjit.dll',
- 'x86jit32': 'compatjit.dll'
},
'Linux': {
'x64': 'libclrjit.so'
@@ -126,7 +125,7 @@ def validate_args(args):
if not helper(arg):
raise Exception('Argument: %s is not valid.' % (arg))
- valid_archs = {'Windows_NT': ['x86', 'x64', 'x86jit32'], 'Linux': ['x64']}
+ valid_archs = {'Windows_NT': ['x86', 'x64'], 'Linux': ['x64']}
valid_build_types = ['Release']
valid_run_types = ['rolling', 'private']
valid_os = ['Windows_NT', 'Ubuntu14.04']
@@ -281,9 +280,6 @@ def main(args):
architecture, operating_system, os_group, build_type, run_type, clr_root, assembly_root, benchview_path = validate_args(args)
arch = architecture
- if architecture == 'x86jit32':
- arch = 'x86'
-
current_dir = os.getcwd()
jit = jit_list[os_group][architecture]
crossgen = 'crossgen'
diff --git a/tests/scripts/run-xunit-perf.cmd b/tests/scripts/run-xunit-perf.cmd
index 7895b3f16e..e223a3bda9 100644
--- a/tests/scripts/run-xunit-perf.cmd
+++ b/tests/scripts/run-xunit-perf.cmd
@@ -5,7 +5,7 @@
@echo off
@if defined _echo echo on
-setlocal
+setlocal ENABLEDELAYEDEXPANSION
set ERRORLEVEL=
set BENCHVIEW_RUN_TYPE=local
set CORECLR_REPO=%CD%
@@ -15,17 +15,27 @@ setlocal
set TEST_CONFIG=Release
set IS_SCENARIO_TEST=
set USAGE_DISPLAYED=
+ set SHOULD_UPLOAD_TO_BENCHVIEW=
+ set BENCHVIEW_PATH=
+ set COLLECTION_FLAGS=stopwatch
+ set ETW_COLLECTION=Off
+ set STABILITY_PREFIX=
+ set BENCHVIEW_GROUP=CoreCLR
+ set HAS_WARMUP_RUN=--drop-first-value
+ set BETTER=desc
call :parse_command_line_arguments %*
if defined USAGE_DISPLAYED exit /b %ERRORLEVEL%
- call :set_test_architecture || exit /b 1
- call :verify_core_overlay || exit /b 1
- call :set_perf_run_log || exit /b 1
- call :setup_sandbox || exit /b 1
+ call :set_test_architecture || exit /b 1
+ call :set_collection_config || exit /b 1
+ call :verify_benchview_tools || exit /b 1
+ call :verify_core_overlay || exit /b 1
+ call :set_perf_run_log || exit /b 1
+ call :setup_sandbox || exit /b 1
- call :run_cmd "%CORECLR_REPO%\Tools\dotnetcli\dotnet.exe" restore "%CORECLR_REPO%\tests\src\Common\PerfHarness\project.json" || exit /b 1
- call :run_cmd "%CORECLR_REPO%\Tools\dotnetcli\dotnet.exe" publish "%CORECLR_REPO%\tests\src\Common\PerfHarness\project.json" -c Release -o "%CORECLR_REPO%\sandbox" || exit /b 1
+ call :run_cmd "%CORECLR_REPO%\Tools\dotnetcli\dotnet.exe" restore "%CORECLR_REPO%\tests\src\Common\PerfHarness\PerfHarness.csproj" || exit /b 1
+ call :run_cmd "%CORECLR_REPO%\Tools\dotnetcli\dotnet.exe" publish "%CORECLR_REPO%\tests\src\Common\PerfHarness\PerfHarness.csproj" -c Release -o "%CORECLR_REPO%\sandbox" || exit /b 1
rem TODO: Remove the version of the package to copy. e.g.) if multiple version exist, then error out?
call :run_cmd xcopy /sy "%CORECLR_REPO%\packages\Microsoft.Diagnostics.Tracing.TraceEvent\1.0.3-alpha-experimental\lib\native"\* . >> %RUNLOG% || exit /b 1
@@ -34,7 +44,6 @@ setlocal
rem find and stage the tests
set /A "LV_FAILURES=0"
for /R %CORECLR_PERF% %%T in (*.%TEST_FILE_EXT%) do (
- rem Skip known failures
call :run_benchmark %%T || (
set /A "LV_FAILURES+=1"
)
@@ -60,17 +69,13 @@ rem ****************************************************************************
setlocal
set BENCHNAME=%~n1
set BENCHDIR=%~p1
- set PERFOUT=perf-%BENCHNAME%
- set XMLOUT=%PERFOUT%.xml
rem copy benchmark and any input files
- call :run_cmd xcopy /s %~1 . >> %RUNLOG% || exit /b 1
+ call :run_cmd xcopy /sy %~1 . >> %RUNLOG% || exit /b 1
if exist "%BENCHDIR%*.txt" (
- call :run_cmd xcopy /s %BENCHDIR%*.txt . >> %RUNLOG% || exit /b 1
+ call :run_cmd xcopy /sy %BENCHDIR%*.txt . >> %RUNLOG% || exit /b 1
)
- set CORE_ROOT=%CORECLR_REPO%\sandbox
-
rem setup additional environment variables
if DEFINED TEST_ENV (
if EXIST "%TEST_ENV%" (
@@ -78,13 +83,26 @@ setlocal
)
)
- set BENCHNAME_LOG_FILE_NAME=%BENCHNAME%.log
+ echo/
+ echo/ ----------
+ echo/ Running %BENCHNAME%
+ echo/ ----------
+
+ rem CORE_ROOT environment variable is used by some benchmarks such as Roslyn / CscBench.
+ set CORE_ROOT=%CORECLR_REPO%\sandbox
+
+ set LV_RUNID=Perf-%ETW_COLLECTION%
+ set BENCHNAME_LOG_FILE_NAME=%LV_RUNID%-%BENCHNAME%.log
+ set LV_CMD=
if defined IS_SCENARIO_TEST (
- call :run_cmd corerun.exe "%CORECLR_REPO%\sandbox\%BENCHNAME%.%TEST_FILE_EXT%" --perf:runid Perf 1>"%BENCHNAME_LOG_FILE_NAME%" 2>&1
+ set "LV_CMD=corerun.exe "%CORECLR_REPO%\sandbox\%BENCHNAME%.%TEST_FILE_EXT%" --perf:runid "%LV_RUNID%""
) else (
- call :run_cmd corerun.exe PerfHarness.dll "%CORECLR_REPO%\sandbox\%BENCHNAME%.%TEST_FILE_EXT%" --perf:runid Perf 1>"%BENCHNAME_LOG_FILE_NAME%" 2>&1
+ set "LV_CMD=%STABILITY_PREFIX% corerun.exe PerfHarness.dll "%CORECLR_REPO%\sandbox\%BENCHNAME%.%TEST_FILE_EXT%" --perf:runid "%LV_RUNID%" --perf:collect %COLLECTION_FLAGS%"
)
+ call :print_to_console $ !LV_CMD!
+ call :run_cmd !LV_CMD! 1>"%BENCHNAME_LOG_FILE_NAME%" 2>&1
+
IF %ERRORLEVEL% NEQ 0 (
call :print_error corerun.exe exited with %ERRORLEVEL% code.
if exist "%BENCHNAME_LOG_FILE_NAME%" type "%BENCHNAME_LOG_FILE_NAME%"
@@ -92,15 +110,16 @@ setlocal
)
rem optionally generate results for benchview
- if not [%BENCHVIEW_PATH%] == [] (
+ if exist "%BENCHVIEW_PATH%" (
call :generate_results_for_benchview || exit /b 1
- ) else (
- type "%XMLOUT%" | findstr /i /c:"test name"
)
rem Save off the results to the root directory for recovery later in Jenkins
- call :run_cmd xcopy "Perf-%BENCHNAME%*.xml" "%CORECLR_REPO%\" || exit /b 1
- call :run_cmd xcopy "Perf-%BENCHNAME%*.etl" "%CORECLR_REPO%\" || exit /b 1
+ for %%e in (xml etl log) do (
+ IF EXIST ".\%LV_RUNID%-%BENCHNAME%.%%e" (
+ call :run_cmd xcopy /vy ".\%LV_RUNID%-%BENCHNAME%.%%e" .. || exit /b 1
+ )
+ )
exit /b 0
@@ -114,23 +133,51 @@ rem ****************************************************************************
shift
goto :parse_command_line_arguments
)
+ IF /I [%~1] == [-stabilityPrefix] (
+ set STABILITY_PREFIX=%~2
+ shift
+ shift
+ goto :parse_command_line_arguments
+ )
IF /I [%~1] == [-scenarioTest] (
set IS_SCENARIO_TEST=1
shift
goto :parse_command_line_arguments
)
+ IF /I [%~1] == [-uploadtobenchview] (
+ set SHOULD_UPLOAD_TO_BENCHVIEW=1
+ shift
+ goto :parse_command_line_arguments
+ )
+ IF /I [%~1] == [-nowarmup] (
+ set HAS_WARMUP_RUN=
+ shift
+ goto :parse_command_line_arguments
+ )
+ IF /I [%~1] == [-better] (
+ set BETTER=%~2
+ shift
+ shift
+ goto :parse_command_line_arguments
+ )
IF /I [%~1] == [-runtype] (
set BENCHVIEW_RUN_TYPE=%~2
shift
shift
goto :parse_command_line_arguments
)
+ IF /I [%~1] == [-collectionflags] (
+ set COLLECTION_FLAGS=%~2
+ shift
+ shift
+ goto :parse_command_line_arguments
+ )
IF /I [%~1] == [-library] (
set TEST_FILE_EXT=dll
shift
goto :parse_command_line_arguments
)
- IF /I [%~1] == [-uploadtobenchview] (
+ IF /I [%~1] == [-generatebenchviewdata] (
set BENCHVIEW_PATH=%~2
shift
shift
@@ -154,7 +201,12 @@ rem ****************************************************************************
shift
goto :parse_command_line_arguments
)
-
+ IF /I [%~1] == [-group] (
+ set BENCHVIEW_GROUP=%~2
+ shift
+ shift
+ goto :parse_command_line_arguments
+ )
if /I [%~1] == [-?] (
call :USAGE
exit /b 0
@@ -173,10 +225,18 @@ rem ****************************************************************************
rem ****************************************************************************
rem Sets the test architecture.
rem ****************************************************************************
- IF /I [%TEST_ARCHITECTURE%] == [x86jit32] (
- set TEST_ARCH=x86
- ) ELSE (
- set TEST_ARCH=%TEST_ARCHITECTURE%
+ set TEST_ARCH=%TEST_ARCHITECTURE%
+ exit /b 0
+
+:verify_benchview_tools
+rem ****************************************************************************
+rem Verifies that the path to the benchview tools is correct.
+rem ****************************************************************************
+ if defined BENCHVIEW_PATH (
+ if not exist "%BENCHVIEW_PATH%" (
+ call :print_error BenchView path: "%BENCHVIEW_PATH%" was specified, but it does not exist.
+ exit /b 1
+ )
)
exit /b 0
@@ -191,6 +251,18 @@ rem ****************************************************************************
)
exit /b 0
+:set_collection_config
+rem ****************************************************************************
+rem Set's the config based on the providers used for collection
+rem ****************************************************************************
+ if /I [%COLLECTION_FLAGS%] == [stopwatch] (
+ set ETW_COLLECTION=Off
+ ) else (
+ set ETW_COLLECTION=On
+ )
+ exit /b 0
+
+
:set_perf_run_log
rem ****************************************************************************
rem Sets the script's output log file.
@@ -207,7 +279,7 @@ rem ****************************************************************************
rem Creates the sandbox folder used by the script to copy binaries locally,
rem and execute benchmarks.
rem ****************************************************************************
- if exist sandbox rd /s /q sandbox
+ if exist sandbox rmdir /s /q sandbox
if exist sandbox call :print_error Failed to remove the sandbox folder& exit /b 1
if not exist sandbox mkdir sandbox
if not exist sandbox call :print_error Failed to create the sandbox folder& exit /b 1
@@ -224,15 +296,19 @@ rem ****************************************************************************
set LV_MEASUREMENT_ARGS=
set LV_MEASUREMENT_ARGS=%LV_MEASUREMENT_ARGS% %BENCHVIEW_MEASUREMENT_PARSER%
- set LV_MEASUREMENT_ARGS=%LV_MEASUREMENT_ARGS% "Perf-%BENCHNAME%.xml"
- set LV_MEASUREMENT_ARGS=%LV_MEASUREMENT_ARGS% --better desc
- set LV_MEASUREMENT_ARGS=%LV_MEASUREMENT_ARGS% --drop-first-value
+ set LV_MEASUREMENT_ARGS=%LV_MEASUREMENT_ARGS% --better %BETTER%
+ set LV_MEASUREMENT_ARGS=%LV_MEASUREMENT_ARGS% %HAS_WARMUP_RUN%
set LV_MEASUREMENT_ARGS=%LV_MEASUREMENT_ARGS% --append
- call :run_cmd py.exe "%BENCHVIEW_PATH%\measurement.py" %LV_MEASUREMENT_ARGS%
- IF %ERRORLEVEL% NEQ 0 (
- call :print_error Failed to generate BenchView measurement data.
- exit /b 1
+
+ for /f %%f in ('dir /b Perf-*%BENCHNAME%.xml 2^>nul') do (
+ call :run_cmd py.exe "%BENCHVIEW_PATH%\measurement.py" %LV_MEASUREMENT_ARGS% %%f
+
+ IF !ERRORLEVEL! NEQ 0 (
+ call :print_error Failed to generate BenchView measurement data.
+ exit /b 1
+ )
)
+
endlocal& exit /b %ERRORLEVEL%
:upload_to_benchview
@@ -244,23 +320,28 @@ setlocal
set LV_SUBMISSION_ARGS=%LV_SUBMISSION_ARGS% --build ..\build.json
set LV_SUBMISSION_ARGS=%LV_SUBMISSION_ARGS% --machine-data ..\machinedata.json
set LV_SUBMISSION_ARGS=%LV_SUBMISSION_ARGS% --metadata ..\submission-metadata.json
- set LV_SUBMISSION_ARGS=%LV_SUBMISSION_ARGS% --group "CoreCLR"
+ set LV_SUBMISSION_ARGS=%LV_SUBMISSION_ARGS% --group "%BENCHVIEW_GROUP%"
set LV_SUBMISSION_ARGS=%LV_SUBMISSION_ARGS% --type "%BENCHVIEW_RUN_TYPE%"
set LV_SUBMISSION_ARGS=%LV_SUBMISSION_ARGS% --config-name "%TEST_CONFIG%"
set LV_SUBMISSION_ARGS=%LV_SUBMISSION_ARGS% --config Configuration "%TEST_CONFIG%"
set LV_SUBMISSION_ARGS=%LV_SUBMISSION_ARGS% --config OS "Windows_NT"
+ set LV_SUBMISSION_ARGS=%LV_SUBMISSION_ARGS% --config Profile "%ETW_COLLECTION%"
set LV_SUBMISSION_ARGS=%LV_SUBMISSION_ARGS% --arch "%TEST_ARCHITECTURE%"
set LV_SUBMISSION_ARGS=%LV_SUBMISSION_ARGS% --machinepool "PerfSnake"
+
call :run_cmd py.exe "%BENCHVIEW_PATH%\submission.py" measurement.json %LV_SUBMISSION_ARGS%
+
IF %ERRORLEVEL% NEQ 0 (
call :print_error Creating BenchView submission data failed.
exit /b 1
)
- call :run_cmd py.exe "%BENCHVIEW_PATH%\upload.py" submission.json --container coreclr
- IF %ERRORLEVEL% NEQ 0 (
- call :print_error Uploading to BenchView failed.
- exit /b 1
+ if defined SHOULD_UPLOAD_TO_BENCHVIEW (
+ call :run_cmd py.exe "%BENCHVIEW_PATH%\upload.py" submission.json --container coreclr
+ IF !ERRORLEVEL! NEQ 0 (
+ call :print_error Uploading to BenchView failed.
+ exit /b 1
+ )
)
exit /b %ERRORLEVEL%
@@ -269,17 +350,25 @@ rem ****************************************************************************
rem Script's usage.
rem ****************************************************************************
set USAGE_DISPLAYED=1
- echo run-xunit-perf.cmd -testBinLoc ^<path_to_tests^> [-library] [-arch] ^<x86^|x64^> [-configuration] ^<Release^|Debug^> [-uploadToBenchview] ^<path_to_benchview_tools^> [-runtype] ^<rolling^|private^> [-scenarioTest]
+ echo run-xunit-perf.cmd -testBinLoc ^<path_to_tests^> [-library] [-arch] ^<x86^|x64^> [-configuration] ^<Release^|Debug^> [-generateBenchviewData] ^<path_to_benchview_tools^> [-warmup] [-better] ^<asc ^| desc^> [-group] ^<group^> [-runtype] ^<rolling^|private^> [-scenarioTest] [-collectionFlags] ^<default^+CacheMisses^+InstructionRetired^+BranchMispredictions^+gcapi^>
echo/
echo For the path to the tests you can pass a parent directory and the script will grovel for
echo all tests in subdirectories and run them.
echo The library flag denotes whether the tests are build as libraries (.dll) or an executable (.exe)
echo Architecture defaults to x64 and configuration defaults to release.
- echo -uploadtoBenchview is used to specify a path to the Benchview tooling and when this flag is
- echo set we will upload the results of the tests to the coreclr container in benchviewupload.
+ echo -generateBenchviewData is used to specify a path to the Benchview tooling and when this flag is
+ echo set we will generate the results for upload to benchview.
+ echo -uploadToBenchview If this flag is set the generated benchview test data will be uploaded.
+ echo -nowarmup specifies not to discard the results of the first run
+ echo -better whether it is better to have ascending or descending numbers for the benchmark
+ echo -group specifies the Benchview group to which this data should be uploaded (default CoreCLR)
echo Runtype sets the runtype that we upload to Benchview, rolling for regular runs, and private for
echo PRs.
echo -scenarioTest should be included if you are running a scenario benchmark.
+ echo -collectionFlags This is used to specify what collectoin flags get passed to the performance
+ echo harness that is doing the test running. If this is not specified we only use stopwatch.
+ echo Other flags are "default", which is the whatever the test being run specified, "CacheMisses",
+ echo "BranchMispredictions", and "InstructionsRetired".
exit /b %ERRORLEVEL%
:print_error
@@ -287,19 +376,17 @@ rem ****************************************************************************
rem Function wrapper that unifies how errors are output by the script.
rem Functions output to the standard error.
rem ****************************************************************************
- echo [%DATE%][%TIME:~0,-3%][ERROR] %* 1>&2
+ call :print_to_console [ERROR] %* 1>&2
exit /b %ERRORLEVEL%
:print_to_console
rem ****************************************************************************
-rem Sends text to the console screen, no matter what (even when the script's
-rem output is redirected). This can be useful to provide information on where
-rem the script is executing.
+rem Sends text to the console screen. This can be useful to provide
+rem information on where the script is executing.
rem ****************************************************************************
- if defined _debug (
- echo [%DATE%][%TIME:~0,-3%] %* >CON
- )
- echo [%DATE%][%TIME:~0,-3%] %*
+ echo/
+ echo/%USERNAME%@%COMPUTERNAME% "%CD%"
+ echo/[%DATE%][%TIME:~0,-3%] %*
exit /b %ERRORLEVEL%
:run_cmd
@@ -315,19 +402,3 @@ rem ****************************************************************************
call :print_to_console $ %*
call %*
exit /b %ERRORLEVEL%
-
-:skip_failures
-rem ****************************************************************************
-rem Skip known failures
-rem ****************************************************************************
- IF /I [%TEST_ARCHITECTURE%] == [x86jit32] (
- IF /I "%~1" == "CscBench" (
- rem https://github.com/dotnet/coreclr/issues/11088
- exit /b 1
- )
- IF /I "%~1" == "SciMark2" (
- rem https://github.com/dotnet/coreclr/issues/11089
- exit /b 1
- )
- )
- exit /b 0
diff --git a/tests/scripts/run-xunit-perf.sh b/tests/scripts/run-xunit-perf.sh
index 6f49bf6e0a..e6758e59fb 100755
--- a/tests/scripts/run-xunit-perf.sh
+++ b/tests/scripts/run-xunit-perf.sh
@@ -1,5 +1,13 @@
#!/usr/bin/env bash
+function run_command {
+ echo ""
+ echo $USER@`hostname` "$PWD"
+ echo `date +"[%m/%d/%Y %H:%M:%S]"`" $ $@"
+ "$@"
+ return $?
+}
+
function print_usage {
echo ''
echo 'CoreCLR perf test script on Linux.'
@@ -14,29 +22,26 @@ function print_usage {
echo ' --coreFxBinDir="corefx/bin/Linux.AnyCPU.Debug"'
echo ''
echo 'Required arguments:'
- echo ' --testRootDir=<path> : Root directory of the test build (e.g. coreclr/bin/tests/Windows_NT.x64.Debug).'
- echo ' --testNativeBinDir=<path> : Directory of the native CoreCLR test build (e.g. coreclr/bin/obj/Linux.x64.Debug/tests).'
+ echo ' --testRootDir=<path> : Root directory of the test build (e.g. coreclr/bin/tests/Windows_NT.x64.Debug).'
+ echo ' --testNativeBinDir=<path> : Directory of the native CoreCLR test build (e.g. coreclr/bin/obj/Linux.x64.Debug/tests).'
echo ' (Also required: Either --coreOverlayDir, or all of the switches --coreOverlayDir overrides)'
echo ''
echo 'Optional arguments:'
- echo ' --coreOverlayDir=<path> : Directory containing core binaries and test dependencies. If not specified, the'
- echo ' default is testRootDir/Tests/coreoverlay. This switch overrides --coreClrBinDir,'
- echo ' --mscorlibDir, and --coreFxBinDir.'
- echo ' --coreClrBinDir=<path> : Directory of the CoreCLR build (e.g. coreclr/bin/Product/Linux.x64.Debug).'
- echo ' --mscorlibDir=<path> : Directory containing the built mscorlib.dll. If not specified, it is expected to be'
+ echo ' --coreOverlayDir=<path> : Directory containing core binaries and test dependencies. If not specified, the'
+ echo ' default is testRootDir/Tests/coreoverlay. This switch overrides --coreClrBinDir,'
+ echo ' --mscorlibDir, and --coreFxBinDir.'
+ echo ' --coreClrBinDir=<path> : Directory of the CoreCLR build (e.g. coreclr/bin/Product/Linux.x64.Debug).'
+ echo ' --mscorlibDir=<path> : Directory containing the built mscorlib.dll. If not specified, it is expected to be'
echo ' in the directory specified by --coreClrBinDir.'
- echo ' --coreFxBinDir="<path>" : The path to the unpacked runtime folder that is produced as part of a CoreFX build'
- echo ' --uploadToBenchview : Specify this flag in order to have the results of the run uploaded to Benchview.'
- echo ' This also requires that the os flag and runtype flag to be set. Lastly you must'
- echo ' also have the BV_UPLOAD_SAS_TOKEN set to a SAS token for the Benchview upload container'
- echo ' --benchViewOS=<os> : Specify the os that will be used to insert data into Benchview.'
- echo ' --runType=<private|rolling> : Specify the runType for Benchview.'
+ echo ' --coreFxBinDir="<path>" : The path to the unpacked runtime folder that is produced as part of a CoreFX build'
+ echo ' --generatebenchviewdata : BenchView tools directory.'
+ echo ' --uploadToBenchview : Specify this flag in order to have the results of the run uploaded to Benchview.'
+ echo ' This requires that the generatebenchviewdata, os and runtype flags to be set, and'
+ echo ' also have the BV_UPLOAD_SAS_TOKEN set to a SAS token for the Benchview upload container'
+ echo ' --benchViewOS=<os> : Specify the os that will be used to insert data into Benchview.'
+ echo ' --runType=<local|private|rolling> : Specify the runType for Benchview. [Default: local]'
}
-# Variables for xUnit-style XML output. XML format: https://xunit.github.io/docs/format-xml-v2.html
-xunitOutputPath=
-xunitTestOutputPath=
-
# libExtension determines extension for dynamic library files
OSName=$(uname -s)
libExtension=
@@ -59,95 +64,6 @@ case $OSName in
;;
esac
-function xunit_output_end {
- local errorSource=$1
- local errorMessage=$2
-
- local errorCount
- if [ -z "$errorSource" ]; then
- ((errorCount = 0))
- else
- ((errorCount = 1))
- fi
-
- echo '<?xml version="1.0" encoding="utf-8"?>' >>"$xunitOutputPath"
- echo '<assemblies>' >>"$xunitOutputPath"
-
- local line
-
- # <assembly ...>
- line=" "
- line="${line}<assembly"
- line="${line} name=\"CoreClrTestAssembly\""
- line="${line} total=\"${countTotalTests}\""
- line="${line} passed=\"${countPassedTests}\""
- line="${line} failed=\"${countFailedTests}\""
- line="${line} skipped=\"${countSkippedTests}\""
- line="${line} errors=\"${errorCount}\""
- line="${line}>"
- echo "$line" >>"$xunitOutputPath"
-
- # <collection ...>
- line=" "
- line="${line}<collection"
- line="${line} name=\"CoreClrTestCollection\""
- line="${line} total=\"${countTotalTests}\""
- line="${line} passed=\"${countPassedTests}\""
- line="${line} failed=\"${countFailedTests}\""
- line="${line} skipped=\"${countSkippedTests}\""
- line="${line}>"
- echo "$line" >>"$xunitOutputPath"
-
- # <test .../> <test .../> ...
- if [ -f "$xunitTestOutputPath" ]; then
- cat "$xunitTestOutputPath" >>"$xunitOutputPath"
- rm -f "$xunitTestOutputPath"
- fi
-
- # </collection>
- line=" "
- line="${line}</collection>"
- echo "$line" >>"$xunitOutputPath"
-
- if [ -n "$errorSource" ]; then
- # <errors>
- line=" "
- line="${line}<errors>"
- echo "$line" >>"$xunitOutputPath"
-
- # <error ...>
- line=" "
- line="${line}<error"
- line="${line} type=\"TestHarnessError\""
- line="${line} name=\"${errorSource}\""
- line="${line}>"
- echo "$line" >>"$xunitOutputPath"
-
- # <failure .../>
- line=" "
- line="${line}<failure>${errorMessage}</failure>"
- echo "$line" >>"$xunitOutputPath"
-
- # </error>
- line=" "
- line="${line}</error>"
- echo "$line" >>"$xunitOutputPath"
-
- # </errors>
- line=" "
- line="${line}</errors>"
- echo "$line" >>"$xunitOutputPath"
- fi
-
- # </assembly>
- line=" "
- line="${line}</assembly>"
- echo "$line" >>"$xunitOutputPath"
-
- # </assemblies>
- echo '</assemblies>' >>"$xunitOutputPath"
-}
-
function exit_with_error {
local errorSource=$1
local errorMessage=$2
@@ -158,10 +74,11 @@ function exit_with_error {
fi
echo "$errorMessage"
- xunit_output_end "$errorSource" "$errorMessage"
if ((printUsage != 0)); then
print_usage
fi
+
+ echo "Exiting script with error code: $EXIT_CODE_EXCEPTION"
exit $EXIT_CODE_EXCEPTION
}
@@ -185,11 +102,12 @@ function create_core_overlay {
if [ -n "$coreOverlayDir" ]; then
export CORE_ROOT="$coreOverlayDir"
- return
+ return 0
fi
- # Check inputs to make sure we have enough information to create the core layout. $testRootDir/Tests/Core_Root should
- # already exist and contain test dependencies that are not built.
+ # Check inputs to make sure we have enough information to create the core
+ # layout. $testRootDir/Tests/Core_Root should already exist and contain test
+ # dependencies that are not built.
local testDependenciesDir=$testRootDir/Tests/Core_Root
if [ ! -d "$testDependenciesDir" ]; then
exit_with_error "$errorSource" "Did not find the test dependencies directory: $testDependenciesDir"
@@ -208,13 +126,30 @@ function create_core_overlay {
coreOverlayDir=$testRootDir/Tests/coreoverlay
export CORE_ROOT="$coreOverlayDir"
if [ -e "$coreOverlayDir" ]; then
- rm -f -r "$coreOverlayDir"
+ rm -rf "$coreOverlayDir" || exit 1
fi
+
mkdir "$coreOverlayDir"
- cp -f -v "$coreFxBinDir"/* "$coreOverlayDir/" 2>/dev/null
- cp -f -v "$coreClrBinDir/"* "$coreOverlayDir/" 2>/dev/null
- cp -n -v "$testDependenciesDir"/* "$coreOverlayDir/" 2>/dev/null
+ cp -f -v "$coreFxBinDir/"* "$coreOverlayDir/" || exit 2
+ cp -f -p -v "$coreClrBinDir/"* "$coreOverlayDir/" # || exit 3
+ if [ -d "$mscorlibDir/bin" ]; then
+ cp -f -v "$mscorlibDir/bin/"* "$coreOverlayDir/" || exit 4
+ fi
+ cp -f -v "$testDependenciesDir/"xunit* "$coreOverlayDir/" || exit 5
+ cp -n -v "$testDependenciesDir/"* "$coreOverlayDir/" # || exit 6
+ if [ -f "$coreOverlayDir/mscorlib.ni.dll" ]; then
+ # Test dependencies come from a Windows build, and mscorlib.ni.dll would be the one from Windows
+ rm -f "$coreOverlayDir/mscorlib.ni.dll" || exit 7
+ fi
+ if [ -f "$coreOverlayDir/System.Private.CoreLib.ni.dll" ]; then
+ # Test dependencies come from a Windows build, and System.Private.CoreLib.ni.dll would be the one from Windows
+ rm -f "$coreOverlayDir/System.Private.CoreLib.ni.dll" || exit 8
+ fi
+
+ copy_test_native_bin_to_test_root || exit 9
+
+ return 0
}
function precompile_overlay_assemblies {
@@ -227,19 +162,19 @@ function precompile_overlay_assemblies {
for fileToPrecompile in ${filesToPrecompile}
do
local filename=${fileToPrecompile}
- echo Precompiling $filename
+ echo "Precompiling $filename"
$overlayDir/crossgen /Platform_Assemblies_Paths $overlayDir $filename 2>/dev/null
local exitCode=$?
if [ $exitCode == -2146230517 ]; then
- echo $filename is not a managed assembly.
+ echo "$filename is not a managed assembly."
elif [ $exitCode != 0 ]; then
- echo Unable to precompile $filename.
+ echo "Unable to precompile $filename."
else
- echo Successfully precompiled $filename
+ echo "Successfully precompiled $filename"
fi
done
else
- echo Skipping crossgen of FX assemblies.
+ echo "Skipping crossgen of FX assemblies."
fi
}
@@ -279,8 +214,14 @@ coreClrBinDir=
mscorlibDir=
coreFxBinDir=
uploadToBenchview=
-benchViewOS=
-runType=
+benchViewOS=`lsb_release -i -s``lsb_release -r -s`
+runType=local
+BENCHVIEW_TOOLS_PATH=
+benchViewGroup=CoreCLR
+perfCollection=
+collectionflags=stopwatch
+hasWarmupRun=--drop-first-value
+stabilityPrefix=
for i in "$@"
do
@@ -307,12 +248,21 @@ do
--coreFxBinDir=*)
coreFxBinDir=${i#*=}
;;
- --benchViewOS=*)
+ --benchViewOS=*)
benchViewOS=${i#*=}
;;
- --runType=*)
+ --runType=*)
runType=${i#*=}
;;
+ --collectionflags=*)
+ collectionflags=${i#*=}
+ ;;
+ --generatebenchviewdata=*)
+ BENCHVIEW_TOOLS_PATH=${i#*=}
+ ;;
+ --stabilityPrefix=*)
+ stabilityPrefix=${i#*=}
+ ;;
--uploadToBenchview)
uploadToBenchview=TRUE
;;
@@ -333,69 +283,101 @@ if [ ! -d "$testRootDir" ]; then
echo "Directory specified by --testRootDir does not exist: $testRootDir"
exit $EXIT_CODE_EXCEPTION
fi
-
-# Copy native interop test libraries over to the mscorlib path in
-# order for interop tests to run on linux.
-if [ -z "$mscorlibDir" ]; then
- mscorlibDir=$coreClrBinDir
+if [ ! -z "$BENCHVIEW_TOOLS_PATH" ] && { [ ! -d "$BENCHVIEW_TOOLS_PATH" ]; }; then
+ echo BenchView path: "$BENCHVIEW_TOOLS_PATH" was specified, but it does not exist.
+ exit $EXIT_CODE_EXCEPTION
fi
-if [ -d "$mscorlibDir" ] && [ -d "$mscorlibDir/bin" ]; then
- cp $mscorlibDir/bin/* $mscorlibDir
+if [ "$collectionflags" == "stopwatch" ]; then
+ perfCollection=Off
+else
+ perfCollection=On
fi
# Install xunit performance packages
-export NUGET_PACKAGES=$testNativeBinDir/../../../../packages
-echo "NUGET_PACKAGES = $NUGET_PACKAGES"
+CORECLR_REPO=$testNativeBinDir/../../../..
+DOTNETCLI_PATH=$CORECLR_REPO/Tools/dotnetcli
-pushd $testNativeBinDir/../../../../tests/scripts
-$testNativeBinDir/../../../../Tools/dotnetcli/dotnet restore --fallbacksource https://dotnet.myget.org/F/dotnet-buildtools/ --fallbacksource https://dotnet.myget.org/F/dotnet-core/
-popd
+export NUGET_PACKAGES=$CORECLR_REPO/packages
# Creat coreoverlay dir which contains all dependent binaries
-create_core_overlay
-precompile_overlay_assemblies
-copy_test_native_bin_to_test_root
+create_core_overlay || { echo "Creating core overlay failed."; exit 1; }
+precompile_overlay_assemblies || { echo "Precompiling overlay assemblies failed."; exit 1; }
# Deploy xunit performance packages
cd $CORE_ROOT
-echo "CORE_ROOT dir = $CORE_ROOT"
DO_SETUP=TRUE
-
if [ ${DO_SETUP} == "TRUE" ]; then
-cp $testNativeBinDir/../../../../../packages/Microsoft.DotNet.xunit.performance.runner.cli/1.0.0-alpha-build0040/lib/netstandard1.3/Microsoft.DotNet.xunit.performance.runner.cli.dll .
-cp $testNativeBinDir/../../../../../packages/Microsoft.DotNet.xunit.performance.analysis.cli/1.0.0-alpha-build0040/lib/netstandard1.3/Microsoft.DotNet.xunit.performance.analysis.cli.dll .
-cp $testNativeBinDir/../../../../../packages/Microsoft.DotNet.xunit.performance.run.core/1.0.0-alpha-build0040/lib/dotnet/*.dll .
+ $DOTNETCLI_PATH/dotnet restore $CORECLR_REPO/tests/src/Common/PerfHarness/PerfHarness.csproj || { echo "dotnet restore failed."; exit 1; }
+ $DOTNETCLI_PATH/dotnet publish $CORECLR_REPO/tests/src/Common/PerfHarness/PerfHarness.csproj -c Release -o "$coreOverlayDir" || { echo "dotnet publish failed."; exit 1; }
fi
# Run coreclr performance tests
-echo "Test root dir is: $testRootDir"
+echo "Test root dir: $testRootDir"
tests=($(find $testRootDir/JIT/Performance/CodeQuality -name '*.exe') $(find $testRootDir/performance/perflab/PerfLab -name '*.dll'))
-echo "current dir is $PWD"
-rm measurement.json
+if [ -f measurement.json ]; then
+ rm measurement.json || exit $EXIT_CODE_EXCEPTION;
+fi
+
for testcase in ${tests[@]}; do
+ directory=$(dirname "$testcase")
+ filename=$(basename "$testcase")
+ filename="${filename%.*}"
-test=$(basename $testcase)
-testname=$(basename $testcase .exe)
-echo "....Running $testname"
-cp $testcase .
-cp $testcase-*.txt .
-
-chmod u+x ./corerun
-echo "./corerun Microsoft.DotNet.xunit.performance.runner.cli.dll $test -runner xunit.console.netcore.exe -runnerhost ./corerun -verbose -runid perf-$testname"
-./corerun Microsoft.DotNet.xunit.performance.runner.cli.dll $test -runner xunit.console.netcore.exe -runnerhost ./corerun -verbose -runid perf-$testname
-echo "./corerun Microsoft.DotNet.xunit.performance.analysis.cli.dll perf-$testname.xml -xml perf-$testname-summary.xml"
-./corerun Microsoft.DotNet.xunit.performance.analysis.cli.dll perf-$testname.xml -xml perf-$testname-summary.xml
-if [ "$uploadToBenchview" == "TRUE" ]
- then
- python3.5 ../../../../../tests/scripts/Microsoft.BenchView.JSONFormat/tools/measurement.py xunit perf-$testname.xml --better desc --drop-first-value --append
-fi
+ test=$(basename $testcase)
+ testname=$(basename $testcase .exe)
+
+ cp $testcase . || exit 1
+ if [ stat -t "$directory/$filename"*.txt 1>/dev/null 2>&1 ]; then
+ cp "$directory/$filename"*.txt . || exit 1
+ fi
+
+ # TODO: Do we need this here.
+ chmod u+x ./corerun
+
+ echo ""
+ echo "----------"
+ echo " Running $testname"
+ echo "----------"
+ run_command $stabilityPrefix ./corerun PerfHarness.dll $test --perf:runid Perf --perf:collect $collectionflags 1>"Perf-$filename.log" 2>&1 || exit 1
+ if [ -d "$BENCHVIEW_TOOLS_PATH" ]; then
+ run_command python3.5 "$BENCHVIEW_TOOLS_PATH/measurement.py" xunit "Perf-$filename.xml" --better desc $hasWarmupRun --append || {
+ echo [ERROR] Failed to generate BenchView data;
+ exit 1;
+ }
+ fi
+
+ # Rename file to be archived by Jenkins.
+ mv -f "Perf-$filename.log" "$CORECLR_REPO/Perf-$filename-$perfCollection.log" || {
+ echo [ERROR] Failed to move "Perf-$filename.log" to "$CORECLR_REPO".
+ exit 1;
+ }
+ mv -f "Perf-$filename.xml" "$CORECLR_REPO/Perf-$filename-$perfCollection.xml" || {
+ echo [ERROR] Failed to move "Perf-$filename.xml" to "$CORECLR_REPO".
+ exit 1;
+ }
done
-if [ "$uploadToBenchview" == "TRUE" ]
- then
- python3.5 ../../../../../tests/scripts/Microsoft.BenchView.JSONFormat/tools/submission.py measurement.json --build ../../../../../build.json --machine-data ../../../../../machinedata.json --metadata ../../../../../submission-metadata.json --group "CoreCLR" --type "$runType" --config-name "Release" --config Configuration "Release" --config OS "$benchViewOS" --arch "x64" --machinepool "Perfsnake"
- python3.5 ../../../../../tests/scripts/Microsoft.BenchView.JSONFormat/tools/upload.py submission.json --container coreclr
+
+if [ -d "$BENCHVIEW_TOOLS_PATH" ]; then
+ args=measurement.json
+ args+=" --build ../../../../../build.json"
+ args+=" --machine-data ../../../../../machinedata.json"
+ args+=" --metadata ../../../../../submission-metadata.json"
+ args+=" --group $benchViewGroup"
+ args+=" --type $runType"
+ args+=" --config-name Release"
+ args+=" --config Configuration Release"
+ args+=" --config OS $benchViewOS"
+ args+=" --config Profile $perfCollection"
+ args+=" --arch x64"
+ args+=" --machinepool Perfsnake"
+ run_command python3.5 "$BENCHVIEW_TOOLS_PATH/submission.py" $args || {
+ echo [ERROR] Failed to generate BenchView submission data;
+ exit 1;
+ }
+fi
+
+if [ -d "$BENCHVIEW_TOOLS_PATH" ] && { [ "$uploadToBenchview" == "TRUE" ]; }; then
+ run_command python3.5 "$BENCHVIEW_TOOLS_PATH/upload.py" submission.json --container coreclr
fi
-mkdir ../../../../../sandbox
-cp *.xml ../../../../../sandbox
diff --git a/tests/scripts/scripts.csproj b/tests/scripts/scripts.csproj
new file mode 100644
index 0000000000..b1a1aab6e5
--- /dev/null
+++ b/tests/scripts/scripts.csproj
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+ <ItemGroup>
+ <PackageReference Include="Microsoft.DotNet.xunit.performance.run.core">
+ <Version>1.0.0-alpha-build0040</Version>
+ </PackageReference>
+ <PackageReference Include="Microsoft.DotNet.xunit.performance.analysis.cli">
+ <Version>1.0.0-alpha-build0040</Version>
+ </PackageReference>
+ <PackageReference Include="Microsoft.DotNet.xunit.performance.runner.cli">
+ <Version>1.0.0-alpha-build0040</Version>
+ </PackageReference>
+ <PackageReference Include="Microsoft.DotNet.xunit.performance">
+ <Version>1.0.0-alpha-build0040</Version>
+ </PackageReference>
+ <PackageReference Include="xunit.console.netcore">
+ <Version>1.0.2-prerelease-00177</Version>
+ </PackageReference>
+ <PackageReference Include="Microsoft.DotNet.BuildTools.TestSuite">
+ <Version>1.0.0-prerelease-00629-04</Version>
+ </PackageReference>
+ </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netstandard1.3</TargetFramework>
+ <TargetFrameworkIdentifier>.NETStandard</TargetFrameworkIdentifier>
+ <PackageTargetFallback>$(PackageTargetFallback);dnxcore50;portable-net45+win8</PackageTargetFallback>
+ <ContainsPackageReferences>true</ContainsPackageReferences>
+ <PrereleaseResolveNuGetPackages>false</PrereleaseResolveNuGetPackages>
+ <RuntimeIdentifiers>win7-x86;win7-x64</RuntimeIdentifiers>
+ <IsTestProject>false</IsTestProject>
+ </PropertyGroup>
+ <Import Project="$(MSBuildThisFileDirectory)..\src\dir.targets" />
+ <Target Name="Build"
+ DependsOnTargets="ResolveReferences" />
+</Project> \ No newline at end of file
diff --git a/tests/setup-runtime-dependencies.cmd b/tests/setup-runtime-dependencies.cmd
deleted file mode 100755
index 0079d42f60..0000000000
--- a/tests/setup-runtime-dependencies.cmd
+++ /dev/null
@@ -1,145 +0,0 @@
-@if not defined _echo @echo off
-setlocal
-
-set __ThisScriptShort=%0
-set __ThisScriptFull=%~f0
-set __ThisScriptPath=%~dp0
-
-REM =========================================================================================
-REM ===
-REM === Parse arguments
-REM ===
-REM =========================================================================================
-
-set __OutputDir=
-set __Arch=
-
-:Arg_Loop
-if "%1" == "" goto ArgsDone
-
-if /i "%1" == "/?" goto Usage
-if /i "%1" == "-?" goto Usage
-if /i "%1" == "/h" goto Usage
-if /i "%1" == "-h" goto Usage
-if /i "%1" == "/help" goto Usage
-if /i "%1" == "-help" goto Usage
-
-if /i "%1" == "/arch" (set __Arch=%2&shift&shift&goto Arg_Loop)
-if /i "%1" == "/outputdir" (set __OutputDir=%2&shift&shift&goto Arg_Loop)
-
-echo Invalid command-line argument: %1
-goto Usage
-
-:ArgsDone
-
-if not defined __OutputDir goto Usage
-if not defined __Arch goto Usage
-
-REM Check if the platform is supported
-if /i %__Arch% == "arm" (
- echo No runtime dependencies for Arm32.
- exit /b 0
- )
-
-REM =========================================================================================
-REM ===
-REM === Check if dotnet CLI and necessary directories exist
-REM ===
-REM =========================================================================================
-
-set __DotNetToolDir=%__ThisScriptPath%..\Tools
-set __DotNetCmd=%__DotNetToolDir%\dotnetcli\dotnet.exe
-set __PackageDir=%__ThisScriptPath%..\Packages
-set __TmpDir=%Temp%\coreclr_gcstress_%RANDOM%
-
-REM Check if dotnet cli exists
-if not exist "%__DotNetToolDir%" (
- echo Directory containing dotnet CLI does not exist: %__DotNetToolDir%
- goto Fail
-)
-if not exist "%__DotNetCmd%" (
- echo dotnet.exe does not exist: %__DotNetCmd%
- goto Fail
-)
-
-REM Create directories needed
-if not exist "%__PackageDir%" md "%__PackageDir%"
-if not exist "%__OutputDir%" md "%__OutputDir%"
-
-REM Check and create a temp directory
-if exist "%__TmpDir%" (
- rmdir /S /Q %__TmpDir%
-)
-mkdir %__TmpDir%
-
-REM Project.json path
-set __JsonFilePath=%__TmpDir%\project.json
-
-REM =========================================================================================
-REM ===
-REM === Download packages
-REM ===
-REM =========================================================================================
-
-REM Write dependency information to project.json
-echo { ^
- "dependencies": { ^
- "runtime.win7-%__Arch%.Microsoft.NETCore.CoreDisTools": "1.0.1-prerelease-*" ^
- }, ^
- "frameworks": { "dnxcore50": { } } ^
- } > "%__JsonFilePath%"
-
-echo JSON file: %__JsonFilePath%
-type "%__JsonFilePath%"
-
-REM Download the package
-echo Downloading CoreDisTools package
-set DOTNETCMD="%__DotNetCmd%" restore "%__JsonFilePath%" --source https://dotnet.myget.org/F/dotnet-core/ --packages "%__PackageDir%"
-echo %DOTNETCMD%
-call %DOTNETCMD%
-if errorlevel 1 goto Fail
-
-REM Get downloaded dll path
-echo Locating coredistools.dll
-FOR /F "delims=" %%i IN ('dir %__PackageDir%\coredistools.dll /b/s ^| findstr /R "runtime.win[0-9]*-%__Arch%"') DO set __LibPath=%%i
-echo CoreDisTools library path: %__LibPath%
-if not exist "%__LibPath%" (
- echo Failed to locate the downloaded library: %__LibPath%
- goto Fail
-)
-
-REM Copy library to output directory
-echo Copy library: %__LibPath% to %__OutputDir%
-copy /y "%__LibPath%" "%__OutputDir%"
-if errorlevel 1 (
- echo Failed to copy %__LibPath% to %__OutputDir%
- goto Fail
-)
-
-REM Delete temporary files
-if exist "%__TmpDir%" (
- rmdir /S /Q "%__TmpDir%"
-)
-
-exit /b 0
-
-:Fail
-if exist "%__TmpDir%" (
- rmdir /S /Q "%__TmpDir%"
-)
-exit /b 1
-
-REM =========================================================================================
-REM ===
-REM === Helper routines
-REM ===
-REM =========================================================================================
-
-:Usage
-echo.
-echo Download coredistools for GC stress testing
-echo.
-echo Usage:
-echo %__ThisScriptShort% /arch ^<TargetArch^> /outputdir ^<coredistools_lib_install_path^>
-echo.
-exit /b 1
diff --git a/tests/setup-runtime-dependencies.sh b/tests/setup-runtime-dependencies.sh
deleted file mode 100755
index 4573e084bd..0000000000
--- a/tests/setup-runtime-dependencies.sh
+++ /dev/null
@@ -1,159 +0,0 @@
-#!/usr/bin/env bash
-# set -x
-
-#
-# Constants
-#
-readonly EXIT_CODE_SUCCESS=0
-
-#
-# This script should be located in coreclr/tests.
-#
-
-function print_usage {
- echo ''
- echo 'Download coredistools for GC stress testing'
- echo ''
- echo 'Command line:'
- echo ''
- echo './setup-gcstress.sh --outputDir=<coredistools_lib_install_path>'
- echo ''
- echo 'Required arguments:'
- echo ' --outputDir=<path> : Directory to install libcoredistools.so'
- echo ''
-}
-
-# temorary directory
-tmpDirPath=
-
-function exit_with_error {
- local errorCode=$1
- local errorMsg=$2
-
- if [ ! -z "$2" ]; then
- echo $2
- fi
-
- if [ -e $tmpDirPath ]; then
- rm -rf $tmpDirPath
- fi
-
- exit $errorCode
-}
-
-function handle_ctrl_c {
- exit_with_error 1 'Aborted by Ctrl+C'
- }
-
-# Register the Ctrl-C handler
-trap handle_ctrl_c INT
-
-# Argument variables
-libInstallDir=
-
-# Handle arguments
-verbose=0
-for i in "$@"
-do
- case $i in
- -h|--help)
- exit $EXIT_CODE_SUCCESS
- ;;
- -v|--verbose)
- verbose=1
- ;;
- --outputDir=*)
- libInstallDir=${i#*=}
- ;;
- *)
- echo "Unknown switch: $i"
- print_usage
- exit $EXIT_CODE_SUCCESS
- ;;
- esac
-done
-
-if [ -z "$libInstallDir" ]; then
- echo "--libInstallDir is required."
- print_usage
- exit_with_error 1
-fi
-
-# create temp directory
-tmpDirPath=`mktemp -d`
-if [ ! -e $tmpDirPath ]; then
- exit_with_error 1 "Cannot create a temporary directory"
-fi
-
-# This script must be located in coreclr/tests.
-scriptDir=$(cd "$(dirname "$0")"; pwd -P)
-
-echo "Running init-tools.sh"
-$scriptDir/../init-tools.sh
-
-dotnetToolsDir=$scriptDir/../Tools
-dotnetCmd=${dotnetToolsDir}/dotnetcli/dotnet
-packageDir=${scriptDir}/../packages
-jsonFilePath=${tmpDirPath}/project.json
-
-# Check tool directory
-if [ ! -e $dotnetToolsDir ]; then
- exit_with_error 1 'Directory containing dotnet commandline does not exist:'$dotnetToolsDir
-fi
-if [ ! -e $dotnetCmd ]; then
- exit_with_error 1 'dotnet commandline does not exist:'$dotnetCmd
-fi
-
-# make package directory
-if [ ! -e $packageDir ]; then
- mkdir -p $packageDir
-fi
-
-# make output directory
-if [ ! -e $libInstallDir ]; then
- mkdir -p $libInstallDir
-fi
-
-# Query runtime Id
-rid=`$dotnetCmd --info | grep 'RID:' | sed 's/^ *RID: *//g'`
-if [ -z "$rid" ]; then
- exit_with_error 1 "Failed to query runtime Id"
-fi
-
-# Write dependency information to project.json
-packageName='runtime.'$rid'.Microsoft.NETCore.CoreDisTools'
-echo { \
- \"dependencies\": { \
- \"$packageName\": \"1.0.1-prerelease-*\" \
- }, \
- \"frameworks\": { \"dnxcore50\": { } } \
- } > $jsonFilePath
-
-# Download the package
-echo Downloading CoreDisTools package
-bash -c -x "$dotnetCmd restore $jsonFilePath --source https://dotnet.myget.org/F/dotnet-core/ --packages $packageDir"
-if [ $? -ne 0 ]
-then
- exit_with_error 1 "Failed to restore the package"
-fi
-
-# Get library path
-libPath=`find $packageDir | grep $rid | grep -m 1 libcoredistools`
-if [ ! -e $libPath ]; then
- exit_with_error 1 'Failed to locate the downloaded library'
-fi
-
-# Copy library to output directory
-echo 'Copy library:' $libPath '-->' $libInstallDir/
-cp -f $libPath $libInstallDir
-if [ $? -ne 0 ]
-then
- exit_with_error 1 "Failed to copy the library"
-fi
-
-# Delete temporary files
-rm -rf $tmpDirPath
-
-# Return success
-exit $EXIT_CODE_SUCCESS
-
diff --git a/tests/skipCrossGenFiles.arm.txt b/tests/skipCrossGenFiles.arm.txt
index df66983baa..2e12456c1b 100644
--- a/tests/skipCrossGenFiles.arm.txt
+++ b/tests/skipCrossGenFiles.arm.txt
@@ -1,2 +1,3 @@
mscorlib.dll
System.Runtime.WindowsRuntime.UI.Xaml.dll
+System.Private.CoreLib.dll
diff --git a/tests/skipCrossGenFiles.arm64.txt b/tests/skipCrossGenFiles.arm64.txt
index 53eec85069..ee3972bb75 100644
--- a/tests/skipCrossGenFiles.arm64.txt
+++ b/tests/skipCrossGenFiles.arm64.txt
@@ -3,3 +3,4 @@ Microsoft.CodeAnalysis.VisualBasic.dll
System.Net.NameResolution.dll
System.Net.Sockets.dll
System.Net.Primitives.dll
+System.Private.CoreLib.dll
diff --git a/tests/skipCrossGenFiles.x64.txt b/tests/skipCrossGenFiles.x64.txt
index df66983baa..2e12456c1b 100644
--- a/tests/skipCrossGenFiles.x64.txt
+++ b/tests/skipCrossGenFiles.x64.txt
@@ -1,2 +1,3 @@
mscorlib.dll
System.Runtime.WindowsRuntime.UI.Xaml.dll
+System.Private.CoreLib.dll
diff --git a/tests/skipCrossGenFiles.x86.txt b/tests/skipCrossGenFiles.x86.txt
index df66983baa..2e12456c1b 100644
--- a/tests/skipCrossGenFiles.x86.txt
+++ b/tests/skipCrossGenFiles.x86.txt
@@ -1,2 +1,3 @@
mscorlib.dll
System.Runtime.WindowsRuntime.UI.Xaml.dll
+System.Private.CoreLib.dll
diff --git a/tests/src/CLRTest.CrossGen.targets b/tests/src/CLRTest.CrossGen.targets
index d91bdcc7ea..6bb5cdb103 100644
--- a/tests/src/CLRTest.CrossGen.targets
+++ b/tests/src/CLRTest.CrossGen.targets
@@ -40,11 +40,14 @@ WARNING: When setting properties based on their current state (for example:
if [ ! -z ${RunCrossGen+x} ]%3B then
export COMPlus_ZapRequire=$(ZapRequire)
export COMPlus_ZapRequireList=$(MSBuildProjectName)
- if [ ! -f $(MSBuildProjectName).ni.exe ]%3B then
+ if [ ! -f $(MSBuildProjectName).org ]%3B then
TakeLock
- if [ ! -f $(MSBuildProjectName).ni.exe ]%3B then
- echo $_DebuggerFullPath "$CORE_ROOT/crossgen" /Platform_Assemblies_Paths $CORE_ROOT%3A$PWD $(MSBuildProjectName).exe
- $_DebuggerFullPath "$CORE_ROOT/crossgen" /Platform_Assemblies_Paths $CORE_ROOT%3A$PWD $(MSBuildProjectName).exe
+ if [ ! -f $(MSBuildProjectName).org ]%3B then
+ mkdir IL
+ cp $(MSBuildProjectName).exe IL/$(MSBuildProjectName).exe
+ mv $(MSBuildProjectName).exe $(MSBuildProjectName).org
+ echo $_DebuggerFullPath "$CORE_ROOT/crossgen" /Platform_Assemblies_Paths $CORE_ROOT%3A$PWD/IL%3A$PWD /in $(MSBuildProjectName).org /out $(MSBuildProjectName).exe
+ $_DebuggerFullPath "$CORE_ROOT/crossgen" /Platform_Assemblies_Paths $CORE_ROOT%3A$PWD/IL%3A$PWD /in $(MSBuildProjectName).org /out $(MSBuildProjectName).exe
__cgExitCode=$?
if [ $__cgExitCode -ne 0 ]
then
@@ -73,12 +76,15 @@ REM CrossGen Script
if defined RunCrossGen (
set COMPlus_ZapRequire=$(ZapRequire)
set COMPlus_ZapRequireList=$(MSBuildProjectName)
- if not exist "$(MSBuildProjectName).ni.exe" (
+ if not exist "$(MSBuildProjectName).org" (
call :TakeLock
set CrossGenStatus=0
- if not exist "$(MSBuildProjectName).ni.exe" (
- echo "%_DebuggerFullPath% %CORE_ROOT%\crossgen.exe" /Platform_Assemblies_Paths %CORE_ROOT%%3B%25cd%25 $(MSBuildProjectName).exe
- %_DebuggerFullPath% "%CORE_ROOT%\crossgen.exe" /Platform_Assemblies_Paths %CORE_ROOT%%3B%25cd%25 $(MSBuildProjectName).exe
+ if not exist "$(MSBuildProjectName).org" (
+ mkdir IL
+ copy $(MSBuildProjectName).exe IL\$(MSBuildProjectName).exe
+ ren $(MSBuildProjectName).exe $(MSBuildProjectName).org
+ echo "%_DebuggerFullPath% %CORE_ROOT%\crossgen.exe" /Platform_Assemblies_Paths %CORE_ROOT%%3B%25cd%25\IL%3B%25cd%25 /in $(MSBuildProjectName).org /out $(MSBuildProjectName).exe
+ %_DebuggerFullPath% "%CORE_ROOT%\crossgen.exe" /Platform_Assemblies_Paths %CORE_ROOT%%3B%25cd%25\IL%3B%25cd%25 /in $(MSBuildProjectName).org /out $(MSBuildProjectName).exe
set CrossGenStatus=!ERRORLEVEL!
)
call :ReleaseLock
diff --git a/tests/src/CLRTest.Execute.Bash.targets b/tests/src/CLRTest.Execute.Bash.targets
index f015cc710d..f95408f512 100644
--- a/tests/src/CLRTest.Execute.Bash.targets
+++ b/tests/src/CLRTest.Execute.Bash.targets
@@ -18,45 +18,6 @@ WARNING: When setting properties based on their current state (for example:
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Target
- Name="GetIlasmRoundTripBashScript"
- Returns="$(IlasmRoundTripBashScript)">
- <PropertyGroup>
- <InputAssemblyName Condition="'$(CLRTestKind)' == 'RunOnly'">$([MSBuild]::MakeRelative($(OutputPath), $(_CLRTestToRunFileFullPath)).Replace("\","/"))</InputAssemblyName>
- <InputAssemblyName Condition="'$(CLRTestKind)' == 'BuildAndRun'">$(MSBuildProjectName).exe</InputAssemblyName>
- <DisassemblyName>$(MSBuildProjectName).dasm.il</DisassemblyName>
- <TargetAssemblyName>$(MSBuildProjectName).asm.exe</TargetAssemblyName>
-
- <IlasmRoundTripBashScript Condition="'$(IlasmRoundTrip)'=='true'">
- <![CDATA[
-# Disable Ilasm round-tripping for Linker tests.
-# Todo: Ilasm round-trip on linked binaries.
-
-if [ -z "$DoLink" ];
-then
- echo "$CORE_ROOT/ildasm" -raweh -out=$(DisassemblyName) $(InputAssemblyName)
- "$CORE_ROOT/ildasm" -raweh -out=$(DisassemblyName) $(InputAssemblyName)
- ERRORLEVEL=$?
- if [ $ERRORLEVEL -ne 0 ]
- then
- echo EXECUTION OF ILDASM - FAILED $ERRORLEVEL
- exit 1
- fi
-
- echo "$CORE_ROOT/ilasm" -output=$(TargetAssemblyName) $(_IlasmSwitches) $(DisassemblyName)
- "$CORE_ROOT/ilasm" -output=$(TargetAssemblyName) $(_IlasmSwitches) $(DisassemblyName)
- ERRORLEVEL=$?
- if [ $ERRORLEVEL -ne 0 ]
- then
- echo EXECUTION OF ILASM - FAILED $ERRORLEVEL
- exit 1
- fi
-fi
- ]]>
- </IlasmRoundTripBashScript>
- </PropertyGroup>
- </Target>
-
<!-- This is here because of this bug: http://blogs.msdn.com/b/msbuild/archive/2006/01/03/508629.aspx-->
<Target Name="FetchExternalPropertiesForXpalt">
<!--Call GetExecuteShFullPath to get ToRunProject cmd file Path -->
@@ -122,9 +83,9 @@ fi
]]></BashCLRTestEnvironmentCompatibilityCheck>
<BashCLRTestEnvironmentCompatibilityCheck Condition="'$(JitOptimizationSensitive)' == 'true'"><![CDATA[
$(BashCLRTestEnvironmentCompatibilityCheck)
-if [ \( ! -z "$COMPlus_JitStress" \) -o \( ! -z "$COMPlus_JitStressRegs" \) -o \( ! -z "$COMPlus_JITMinOpts" \) ]
+if [ \( ! -z "$COMPlus_JitStress" \) -o \( ! -z "$COMPlus_JitStressRegs" \) -o \( ! -z "$COMPlus_JITMinOpts" \) -o \( ! -z "$COMPlus_TailcallStress" \) ]
then
- echo "SKIPPING EXECUTION BECAUSE ONE OR MORE OF (COMPlus_JitStress, COMPlus_JitStressRegs, COMPlus_JITMinOpts) IS SET"
+ echo "SKIPPING EXECUTION BECAUSE ONE OR MORE OF (COMPlus_JitStress, COMPlus_JitStressRegs, COMPlus_JITMinOpts, COMPlus_TailcallStress) IS SET"
exit $(GCBashScriptExitCode)
fi
]]></BashCLRTestEnvironmentCompatibilityCheck>
@@ -275,10 +236,11 @@ fi
</PropertyGroup>
<PropertyGroup>
<_CLRTestRunFile Condition="'$(CLRTestIsHosted)'=='true'">"$CORE_ROOT/corerun"</_CLRTestRunFile>
- <BashCLRTestLaunchCmds Condition="'$(IlasmRoundTrip)'=='true'"><![CDATA[
-if [ -z "$DoLink" ]; then
- echo $(_CLRTestRunFile) $(TargetAssemblyName) $CLRTestExecutionArguments
- $(_CLRTestRunFile) $(TargetAssemblyName) $CLRTestExecutionArguments
+ <BashCLRTestLaunchCmds><![CDATA[
+if [ -z "$DoLink" -a ! -z "$RunningIlasmRoundTrip" ];
+then
+ echo $(_CLRTestRunFile) $(TargetAssemblyName) $CLRTestExecutionArguments
+ $(_CLRTestRunFile) $(TargetAssemblyName) $CLRTestExecutionArguments
if [ $? -ne $CLRTestExpectedExitCode ]
then
echo END EXECUTION OF IL{D}ASM BINARY - FAILED $? vs $CLRTestExpectedExitCode
@@ -408,7 +370,6 @@ $(BashCLRTestEnvironmentCompatibilityCheck)
$(BashCLRTestArgPrep)
$(BashCLRTestExitCodePrep)
$(JitDisasmBashScript)
-# IlasmRoundTrip Script
$(IlasmRoundTripBashScript)
# PreCommands
$(BashCLRTestPreCommands)
diff --git a/tests/src/CLRTest.Execute.Batch.targets b/tests/src/CLRTest.Execute.Batch.targets
index db2a17425d..545fc72eb2 100644
--- a/tests/src/CLRTest.Execute.Batch.targets
+++ b/tests/src/CLRTest.Execute.Batch.targets
@@ -18,39 +18,6 @@ WARNING: When setting properties based on their current state (for example:
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Target
- Name="GetIlasmRoundTripBatchScript"
- Returns="$(IlasmRoundTripBatchScript)">
- <PropertyGroup>
- <InputAssemblyName Condition="'$(CLRTestKind)' == 'RunOnly'">$([MSBuild]::MakeRelative($(OutputPath), $(_CLRTestToRunFileFullPath)))</InputAssemblyName>
- <InputAssemblyName Condition="'$(CLRTestKind)' == 'BuildAndRun'">$(MSBuildProjectName).exe</InputAssemblyName>
- <DisassemblyName>$(MSBuildProjectName).dasm.il</DisassemblyName>
- <TargetAssemblyName>$(MSBuildProjectName).asm.exe</TargetAssemblyName>
-
- <!-- https://github.com/dotnet/coreclr/issues/2481. Delete /raweh to ildasm once it is resolved.-->
- <IlasmRoundTripBatchScript Condition="'$(IlasmRoundTrip)'=='true'">
- <![CDATA[
-REM Disable Ilasm round-tripping for Linker tests.
-REM Todo: Ilasm round-trip on linked binaries.
-IF NOT DEFINED DoLink (
- ECHO %CORE_ROOT%\ildasm.exe /raweh /out=$(DisassemblyName) $(InputAssemblyName)
- %CORE_ROOT%\ildasm.exe /raweh /out=$(DisassemblyName) $(InputAssemblyName)
- IF NOT "!ERRORLEVEL!"=="0" (
- ECHO EXECUTION OF ILDASM - FAILED !ERRORLEVEL!
- Exit /b 1
- )
- ECHO %CORE_ROOT%\ilasm.exe /output=$(TargetAssemblyName) $(_IlasmSwitches) $(DisassemblyName)
- %CORE_ROOT%\ilasm.exe /output=$(TargetAssemblyName) $(_IlasmSwitches) $(DisassemblyName)
- IF NOT "!ERRORLEVEL!"=="0" (
- ECHO EXECUTION OF ILASM - FAILED !ERRORLEVEL!
- Exit /b 1
- )
-)
- ]]>
- </IlasmRoundTripBatchScript>
- </PropertyGroup>
- </Target>
-
<!-- This is here because of this bug: http://blogs.msdn.com/b/msbuild/archive/2006/01/03/508629.aspx-->
<Target Name="FetchExternalProperties">
<!--Call GetExecuteCmdFullPath to get ToRunProject cmd file Path -->
@@ -105,13 +72,15 @@ IF NOT DEFINED DoLink (
$(BatchCLRTestEnvironmentCompatibilityCheck)
IF NOT "%COMPlus_GCStress%"=="" (
ECHO SKIPPING EXECUTION BECAUSE COMPlus_GCStress IS SET
+ popd
Exit /b 0
)
]]></BatchCLRTestEnvironmentCompatibilityCheck>
<BatchCLRTestEnvironmentCompatibilityCheck Condition="'$(JitOptimizationSensitive)' == 'true'"><![CDATA[
$(BatchCLRTestEnvironmentCompatibilityCheck)
-IF "%COMPlus_JitStress%"=="" IF "%COMPlus_JitStressRegs%"=="" IF "%COMPlus_JITMinOpts%"=="" goto :Compatible1
- ECHO SKIPPING EXECUTION BECAUSE ONE OR MORE OF (COMPlus_JitStress, COMPlus_JitStressRegs, COMPlus_JITMinOpts) IS SET
+IF "%COMPlus_JitStress%"=="" IF "%COMPlus_JitStressRegs%"=="" IF "%COMPlus_JITMinOpts%"=="" IF "%COMPlus_TailcallStress%"=="" goto :Compatible1
+ ECHO SKIPPING EXECUTION BECAUSE ONE OR MORE OF (COMPlus_JitStress, COMPlus_JitStressRegs, COMPlus_JITMinOpts, COMPlus_TailcallStress) IS SET
+ popd
Exit /b 0
:Compatible1
]]></BatchCLRTestEnvironmentCompatibilityCheck>
@@ -119,6 +88,7 @@ IF "%COMPlus_JitStress%"=="" IF "%COMPlus_JitStressRegs%"=="" IF "%COMPlus_JITMi
$(BatchCLRTestEnvironmentCompatibilityCheck)
IF NOT "%COMPlus_HeapVerify%"=="" (
ECHO SKIPPING EXECUTION BECAUSE COMPlus_HeapVerify IS SET
+ popd
Exit /b 0
)
]]></BatchCLRTestEnvironmentCompatibilityCheck>
@@ -141,10 +111,12 @@ ECHO Actual: %CLRTestExitCode%
IF NOT "%CLRTestExitCode%"=="%CLRTestExpectedExitCode%" (
ECHO END EXECUTION - FAILED
ECHO FAILED
+ popd
Exit /b 1
) ELSE (
ECHO END EXECUTION - PASSED
ECHO PASSED
+ popd
Exit /b 0
)
@@ -215,6 +187,7 @@ set Assemblies=-a System.Private.CoreLib
IF defined DoLink (
IF NOT EXIST !ILLINK! (
ECHO ILLink executable [%ILLINK%] Invalid
+ popd
Exit /b 1
)
@@ -241,6 +214,7 @@ IF defined DoLink (
IF NOT defined KeepLinkedBinaries (
IF EXIST %LinkBin% rmdir /s /q %LinkBin%
)
+ popd
Exit /b 1
)
@@ -270,7 +244,7 @@ if defined DoLink (
)
]]>
</BatchLinkerTestCleanupCmds>
- </PropertyGroup>
+ </PropertyGroup>
<PropertyGroup>
<_CLRTestRunFile Condition="'$(CLRTestIsHosted)'=='true'">"%CORE_ROOT%\corerun.exe"</_CLRTestRunFile>
<BatchCLRTestLaunchCmds><![CDATA[
@@ -279,19 +253,7 @@ IF NOT "%CLRCustomTestLauncher%"=="" (
) ELSE (
set LAUNCHER=%_DebuggerFullPath% $(_CLRTestRunFile)
)
- ]]></BatchCLRTestLaunchCmds>
- <BatchCLRTestLaunchCmds Condition=" '$(IlasmRoundTrip)'=='true' "><![CDATA[
- $(BatchCLRTestLaunchCmds)
-IF NOT DEFINED DoLink (
- ECHO %LAUNCHER% $(TargetAssemblyName) %CLRTestExecutionArguments% %Host_Args%
- %LAUNCHER% $(TargetAssemblyName) %CLRTestExecutionArguments% %Host_Args%
-
- IF NOT "!ERRORLEVEL!"=="%CLRTestExpectedExitCode%" (
- ECHO END EXECUTION OF IL{D}ASM BINARY - FAILED !ERRORLEVEL! vs %CLRTestExpectedExitCode%
- ECHO FAILED
- Exit /b 1
- )
-)
+$(BatchIlrtTestLaunchCmds)
]]></BatchCLRTestLaunchCmds>
<BatchCLRTestLaunchCmds Condition="'$(CLRTestKind)' == 'BuildAndRun'">
<![CDATA[
@@ -378,6 +340,7 @@ ECHO - OPTIONS -
@(BatchCLRTestExecutionScriptArgument -> 'ECHO -%(Identity) %(ParamName)
ECHO %(Description)', '
')
+popd
Exit /b 1
:ArgsDone
@@ -404,7 +367,6 @@ $(BatchCLRTestEnvironmentCompatibilityCheck)
$(JitDisasmBatchScript)
-REM IlasmRoundTrip Script
$(IlasmRoundTripBatchScript)
REM Precommands
diff --git a/tests/src/CLRTest.Jit.targets b/tests/src/CLRTest.Jit.targets
index 1a0b5e3fce..1dd872c4af 100644
--- a/tests/src/CLRTest.Jit.targets
+++ b/tests/src/CLRTest.Jit.targets
@@ -67,7 +67,99 @@ if defined RunningJitDisasm (
</JitDisasmBatchScript>
</PropertyGroup>
</Target>
-
+
+ <Target
+ Name="GetIlasmRoundTripBashScript"
+ Returns="$(IlasmRoundTripBashScript)">
+ <PropertyGroup>
+ <InputAssemblyName Condition="'$(CLRTestKind)' == 'RunOnly'">$([MSBuild]::MakeRelative($(OutputPath), $(_CLRTestToRunFileFullPath)).Replace("\","/"))</InputAssemblyName>
+ <InputAssemblyName Condition="'$(CLRTestKind)' == 'BuildAndRun'">$(MSBuildProjectName).exe</InputAssemblyName>
+ <DisassemblyName>$(MSBuildProjectName).dasm.il</DisassemblyName>
+ <TargetAssemblyName>$(MSBuildProjectName).asm.exe</TargetAssemblyName>
+
+ <IlasmRoundTripBashScript>
+ <![CDATA[
+# IlasmRoundTrip Script
+
+# Disable Ilasm round-tripping for Linker tests.
+# Todo: Ilasm round-trip on linked binaries.
+
+if [ -z "$DoLink" -a ! -z "$RunningIlasmRoundTrip" ];
+then
+ echo "$CORE_ROOT/ildasm" -raweh -out=$(DisassemblyName) $(InputAssemblyName)
+ "$CORE_ROOT/ildasm" -raweh -out=$(DisassemblyName) $(InputAssemblyName)
+ ERRORLEVEL=$?
+ if [ $ERRORLEVEL -ne 0 ]
+ then
+ echo EXECUTION OF ILDASM - FAILED $ERRORLEVEL
+ exit 1
+ fi
+
+ echo "$CORE_ROOT/ilasm" -output=$(TargetAssemblyName) $(_IlasmSwitches) $(DisassemblyName)
+ "$CORE_ROOT/ilasm" -output=$(TargetAssemblyName) $(_IlasmSwitches) $(DisassemblyName)
+ ERRORLEVEL=$?
+ if [ $ERRORLEVEL -ne 0 ]
+ then
+ echo EXECUTION OF ILASM - FAILED $ERRORLEVEL
+ exit 1
+ fi
+fi
+ ]]>
+ </IlasmRoundTripBashScript>
+ </PropertyGroup>
+ </Target>
+
+ <Target Name="GetIlasmRoundTripBatchScript"
+ Returns="$(IlasmRoundTripBatchScript);$(BatchIlrtTestLaunchCmds)">
+ <PropertyGroup>
+ <InputAssemblyName Condition="'$(CLRTestKind)' == 'RunOnly'">$([MSBuild]::MakeRelative($(OutputPath), $(_CLRTestToRunFileFullPath)))</InputAssemblyName>
+ <InputAssemblyName Condition="'$(CLRTestKind)' == 'BuildAndRun'">$(MSBuildProjectName).exe</InputAssemblyName>
+ <DisassemblyName>$(MSBuildProjectName).dasm.il</DisassemblyName>
+ <TargetAssemblyName>$(MSBuildProjectName).asm.exe</TargetAssemblyName>
+
+ <!-- https://github.com/dotnet/coreclr/issues/2481. Delete /raweh to ildasm once it is resolved.-->
+ <IlasmRoundTripBatchScript>
+ <![CDATA[
+REM IlasmRoundTrip Script
+
+REM Disable Ilasm round-tripping for Linker tests.
+REM Todo: Ilasm round-trip on linked binaries.
+IF NOT DEFINED DoLink (
+ IF DEFINED RunningIlasmRoundTrip (
+ echo %CORE_ROOT%\ildasm.exe /raweh /out=$(DisassemblyName) $(InputAssemblyName)
+ %CORE_ROOT%\ildasm.exe /raweh /out=$(DisassemblyName) $(InputAssemblyName)
+ IF NOT "!ERRORLEVEL!"=="0" (
+ ECHO EXECUTION OF ILDASM - FAILED !ERRORLEVEL!
+ Exit /b 1
+ )
+ ECHO %CORE_ROOT%\ilasm.exe /output=$(TargetAssemblyName) $(_IlasmSwitches) $(DisassemblyName)
+ %CORE_ROOT%\ilasm.exe /output=$(TargetAssemblyName) $(_IlasmSwitches) $(DisassemblyName)
+ IF NOT "!ERRORLEVEL!"=="0" (
+ ECHO EXECUTION OF ILASM - FAILED !ERRORLEVEL!
+ Exit /b 1
+ )
+ )
+)
+ ]]>
+ </IlasmRoundTripBatchScript>
+ <BatchIlrtTestLaunchCmds><![CDATA[
+IF NOT DEFINED DoLink (
+ if defined RunningIlasmRoundTrip (
+ ECHO %LAUNCHER% $(TargetAssemblyName) %CLRTestExecutionArguments% %Host_Args%
+ %LAUNCHER% $(TargetAssemblyName) %CLRTestExecutionArguments% %Host_Args%
+
+ IF NOT "!ERRORLEVEL!"=="%CLRTestExpectedExitCode%" (
+ ECHO END EXECUTION OF IL{D}ASM BINARY - FAILED !ERRORLEVEL! vs %CLRTestExpectedExitCode%
+ ECHO FAILED
+ Exit /b 1
+ )
+ )
+)
+]]>
+ </BatchIlrtTestLaunchCmds>
+ </PropertyGroup>
+ </Target>
+
<PropertyGroup Condition="$(RunWithGcStress) != ''" >
<CLRTestBatchPreCommands>
<![CDATA[
diff --git a/tests/src/Common/PerfHarness/PerfHarness.cs b/tests/src/Common/PerfHarness/PerfHarness.cs
index b3a0ea48c5..f78022517b 100644
--- a/tests/src/Common/PerfHarness/PerfHarness.cs
+++ b/tests/src/Common/PerfHarness/PerfHarness.cs
@@ -1,4 +1,4 @@
-using System.IO;
+using System.IO;
using System.Reflection;
using System.Collections.Generic;
using Microsoft.Xunit.Performance.Api;
diff --git a/tests/src/Common/PerfHarness/PerfHarness.csproj b/tests/src/Common/PerfHarness/PerfHarness.csproj
new file mode 100644
index 0000000000..39eff59c12
--- /dev/null
+++ b/tests/src/Common/PerfHarness/PerfHarness.csproj
@@ -0,0 +1,12 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <OutputType>exe</OutputType>
+ <TargetFramework>netcoreapp2.0</TargetFramework>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <PackageReference Include="xunit.performance.api" Version="1.0.0-beta-build0007" />
+ </ItemGroup>
+
+</Project> \ No newline at end of file
diff --git a/tests/src/Common/PerfHarness/project.json b/tests/src/Common/PerfHarness/project.json
deleted file mode 100644
index a1ecb2867e..0000000000
--- a/tests/src/Common/PerfHarness/project.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "version": "1.0.0-*",
- "buildOptions": {
- "debugType": "portable",
- "emitEntryPoint": true
- },
- "dependencies": {},
- "frameworks": {
- "netcoreapp1.1": {
- "dependencies": {
- "Microsoft.NETCore.App": {
- "type": "platform",
- "version": "1.1.0"
- },
- "xunit.performance.api": "1.0.0-beta-build0003"
- }
- }
- }
-}
diff --git a/tests/src/Common/build_against_pkg_dependencies/build_against_pkg_dependencies.csproj b/tests/src/Common/build_against_pkg_dependencies/build_against_pkg_dependencies.csproj
index 63c54488f2..dc74f7d4ad 100644
--- a/tests/src/Common/build_against_pkg_dependencies/build_against_pkg_dependencies.csproj
+++ b/tests/src/Common/build_against_pkg_dependencies/build_against_pkg_dependencies.csproj
@@ -5,10 +5,33 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<CLRTestKind>BuildOnly</CLRTestKind>
+ <IsTestProject>false</IsTestProject>
</PropertyGroup>
<ItemGroup>
- <DnuSourceList Include="$(CORE_ROOT)\.nuget\pkg" />
+ <PackageReference Include="Microsoft.NETCore.ILAsm">
+ <Version>$(CoreClrPackageVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="Microsoft.NETCore.ILDAsm">
+ <Version>$(CoreClrPackageVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="Microsoft.NETCore.Jit">
+ <Version>$(CoreClrPackageVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="Microsoft.NETCore.Runtime.CoreCLR">
+ <Version>$(CoreClrPackageVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="Microsoft.NETCore.TestHost">
+ <Version>$(CoreClrPackageVersion)</Version>
+ </PackageReference>
</ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp2.0</TargetFramework>
+ <TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier>
+ <PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8</PackageTargetFallback>
+ <RuntimeIdentifiers>win-x64;win-x86;win7-x86;win7-x64;win10-arm64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;osx-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64;opensuse.42.1-x64;linux-x64</RuntimeIdentifiers>
+ <ContainsPackageReferences>true</ContainsPackageReferences>
+ <PrereleaseResolveNuGetPackages>false</PrereleaseResolveNuGetPackages>
+ </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<Target Name="Build"
DependsOnTargets="ResolveReferences" />
diff --git a/tests/src/Common/build_against_pkg_dependencies/project.json b/tests/src/Common/build_against_pkg_dependencies/project.json
deleted file mode 100644
index 327340f11d..0000000000
--- a/tests/src/Common/build_against_pkg_dependencies/project.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "dependencies": {
- "Microsoft.NETCore.ILAsm": "2.0.0-preview1-25221-01",
- "Microsoft.NETCore.ILDAsm": "2.0.0-preview1-25221-01",
- "Microsoft.NETCore.Jit": "2.0.0-preview1-25221-01",
- "Microsoft.NETCore.Runtime.CoreCLR": "2.0.0-preview1-25221-01",
- "Microsoft.NETCore.TestHost": "2.0.0-preview1-25221-01"
- },
- "frameworks": {
- "netcoreapp2.0": {
- "imports": [
- "dnxcore50",
- "portable-net45+win8"
- ]
- }
- },
- "runtimes": {
- "win-x64": {},
- "win-x86": {},
- "win7-x86": {},
- "win7-x64": {},
- "win10-arm64": {},
- "ubuntu.14.04-x64": {},
- "ubuntu.16.04-x64": {},
- "ubuntu.16.10-x64": {},
- "osx.10.12-x64": {},
- "osx-x64": {},
- "centos.7-x64": {},
- "rhel.7-x64": {},
- "debian.8-x64": {},
- "fedora.24-x64": {},
- "opensuse.42.1-x64": {},
- "linux-x64": {}
- }
-}
diff --git a/tests/src/Common/empty/project.json b/tests/src/Common/empty/project.json
deleted file mode 100644
index e1ec3bfd42..0000000000
--- a/tests/src/Common/empty/project.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "dependencies": {
- },
- "frameworks": {
- "netcoreapp1.1": {}
- },
- "runtimes": {
- "win7-x86": {},
- "win7-x64": {},
- "ubuntu.14.04-x64": {},
- "ubuntu.16.04-x64": {},
- "ubuntu.16.10-x64": {},
- "osx.10.12-x64": {},
- "centos.7-x64": {},
- "rhel.7-x64": {},
- "debian.8-x64": {},
- "fedora.24-x64": {}
- }
-}
diff --git a/tests/src/Common/external/external.depproj b/tests/src/Common/external/external.depproj
index 5a16122cdb..51b36208b6 100644
--- a/tests/src/Common/external/external.depproj
+++ b/tests/src/Common/external/external.depproj
@@ -5,19 +5,55 @@
<!-- Given that xunit packages bring with them part of the framework, we need to specify a runtime in order to get the assets
This RID value doesn't really matter, since the assets we are copying are not RID specific, so defaulting to Windows here
-->
- <ProjectJson>$(MSBuildThisFileDirectory)project.json</ProjectJson>
- <ProjectLockJson>$(MSBuildThisFileDirectory)project.lock.json</ProjectLockJson>
+ <RestoreOutputPath>$(MSBuildThisFileDirectory)obj</RestoreOutputPath>
<Language>C#</Language>
<NugetTargetMoniker>.NETCoreApp,Version=v1.1</NugetTargetMoniker>
+ <NugetTargetMonikerShort>netcoreapp1.1</NugetTargetMonikerShort>
<NugetRuntimeIdentifier>win7-x64</NugetRuntimeIdentifier>
+ <ContainsPackageReferences>true</ContainsPackageReferences>
<OutputPath>$(TargetingPackPath)</OutputPath>
<XUnitRunnerPackageId Condition="'$(TargetGroup)' != 'netfx'">xunit.console.netcore</XUnitRunnerPackageId>
<XUnitRunnerPackageId Condition="'$(TargetGroup)' == 'netfx'">xunit.runner.console</XUnitRunnerPackageId>
<CLRTestKind>SharedLibrary</CLRTestKind>
+ <IsTestProject>false</IsTestProject>
</PropertyGroup>
<ItemGroup>
- <None Include="project.json" />
+ <PackageReference Include="Microsoft.CodeAnalysis.Compilers">
+ <Version>1.1.1</Version>
+ </PackageReference>
+ <PackageReference Include="xunit.performance.api">
+ <Version>$(XUnitPerformanceApiVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="xunit.performance.core">
+ <Version>$(XUnitPerformanceApiVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="xunit.performance.execution">
+ <Version>$(XUnitPerformanceApiVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="xunit.performance.metrics">
+ <Version>$(XUnitPerformanceApiVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="Microsoft.Diagnostics.Tracing.TraceEvent">
+ <Version>$(MicrosoftDiagnosticsTracingLibraryVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="Newtonsoft.Json">
+ <Version>9.0.1</Version>
+ </PackageReference>
+ <PackageReference Include="xunit">
+ <Version>$(XunitPackageVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="xunit.console.netcore">
+ <Version>$(XUnitConsoleNetCoreVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="xunit.runner.utility">
+ <Version>$(XunitPackageVersion)</Version>
+ </PackageReference>
</ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <PackageTargetFallback>$(PackageTargetFallback);dnxcore50;portable-net45+win8</PackageTargetFallback>
+ <RuntimeIdentifiers>win7-x86;win7-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<PackageToInclude Include="xunit.abstractions"/>
<PackageToInclude Include="xunit.assert"/>
@@ -40,6 +76,10 @@
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup>
+ <ProjectAssetsFile>$(SourceDir)Common\external\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
+
<Target Name="AddXunitConsoleRunner" BeforeTargets="ResolveReferences" Condition="'$(TargetGroup)' == 'netfx'">
<Error Condition="!Exists('$(PackagesDir)$(XUnitRunnerPackageId)\$(XUnitPackageVersion)\tools\xunit.console.exe')"
Text="Error: looks the package $(PackagesDir)$(XUnitRunnerPackageId)\$(XUnitPackageVersion) not restored or missing xunit.console.exe."
diff --git a/tests/src/Common/external/project.json b/tests/src/Common/external/project.json
deleted file mode 100644
index 12c986a98b..0000000000
--- a/tests/src/Common/external/project.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "dependencies": {
- "Microsoft.CodeAnalysis.Compilers": "1.1.1",
- "xunit.performance.api": "1.0.0-beta-build0003",
- "xunit.performance.core": "1.0.0-beta-build0003",
- "xunit.performance.execution": "1.0.0-beta-build0003",
- "xunit.performance.metrics": "1.0.0-beta-build0003",
- "Microsoft.Diagnostics.Tracing.TraceEvent": "1.0.3-alpha-experimental",
- "Newtonsoft.Json": "9.0.1",
- "xunit": "2.2.0-beta2-build3300",
- "xunit.console.netcore": "1.0.2-prerelease-00177",
- "xunit.runner.utility": "2.2.0-beta2-build3300"
- },
- "frameworks": {
- "netcoreapp1.1": {
- "imports": [
- "dnxcore50",
- "portable-net45+win8"
- ]
- }
- },
- "runtimes": {
- "win7-x86": {},
- "win7-x64": {}
- }
-}
diff --git a/tests/src/Common/netcoreapp/project.json b/tests/src/Common/netcoreapp/project.json
deleted file mode 100644
index ca40b18d1e..0000000000
--- a/tests/src/Common/netcoreapp/project.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "dependencies": {
- "Microsoft.NETCore.App": "2.0.0-beta-001494-00",
- "System.Runtime.CompilerServices.Unsafe": "4.4.0-preview1-25221-01"
- },
- "frameworks": {
- "netcoreapp2.0": {}
- }
-}
diff --git a/tests/src/Common/targeting_pack_ref/project.json b/tests/src/Common/targeting_pack_ref/project.json
deleted file mode 100644
index 0754b74690..0000000000
--- a/tests/src/Common/targeting_pack_ref/project.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "dependencies": {
- "Microsoft.TargetingPack.Private.CoreCLR": "2.0.0-preview1-25221-01"
- },
- "frameworks": {
- "netcoreapp1.1": {
- "imports": [
- "dnxcore50",
- "portable-net45+win8"
- ]
- }
- },
- "runtimes": {
- "win7-x86": {},
- "win7-x64": {},
- "ubuntu.14.04-x64": {},
- "ubuntu.16.04-x64": {},
- "ubuntu.16.10-x64": {},
- "osx.10.12-x64": {},
- "centos.7-x64": {},
- "rhel.7-x64": {},
- "debian.8-x64": {},
- "fedora.24-x64": {}
- }
-}
diff --git a/tests/src/Common/targeting_pack_ref/targeting_pack_ref.csproj b/tests/src/Common/targeting_pack_ref/targeting_pack_ref.csproj
index 65e37c03c3..620a447779 100644
--- a/tests/src/Common/targeting_pack_ref/targeting_pack_ref.csproj
+++ b/tests/src/Common/targeting_pack_ref/targeting_pack_ref.csproj
@@ -5,6 +5,20 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<CLRTestKind>BuildOnly</CLRTestKind>
+ <IsTestProject>false</IsTestProject>
+ </PropertyGroup>
+ <ItemGroup>
+ <PackageReference Include="Microsoft.TargetingPack.Private.CoreCLR">
+ <Version>$(CoreClrPackageVersion)</Version>
+ </PackageReference>
+ </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier>
+ <PackageTargetFallback>$(PackageTargetFallback);dnxcore50;portable-net45+win8</PackageTargetFallback>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ <ContainsPackageReferences>true</ContainsPackageReferences>
+ <PrereleaseResolveNuGetPackages>false</PrereleaseResolveNuGetPackages>
</PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<Target Name="Build"
diff --git a/tests/src/Common/test_dependencies/project.json b/tests/src/Common/test_dependencies/project.json
deleted file mode 100644
index 4477c687e0..0000000000
--- a/tests/src/Common/test_dependencies/project.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "dependencies": {
- "Microsoft.NETCore.Platforms": "2.0.0-preview1-25221-01",
- "Microsoft.Private.CoreFx.NETCoreApp": "4.4.0-preview1-25221-01",
- "System.Memory": "4.4.0-preview1-25221-01",
- "System.Runtime.CompilerServices.Unsafe": "4.4.0-preview1-25221-01",
- "System.Security.Permissions": "4.4.0-preview1-25221-01"
- },
- "frameworks": {
- "netcoreapp2.0": {
- "imports": [
- "dnxcore50",
- "netcoreapp1.1",
- "portable-net45+win8"
- ]
- }
- },
- "runtimes": {
- "win-x64": {},
- "win-x86": {},
- "win7-x86": {},
- "win7-x64": {},
- "ubuntu.14.04-x64": {},
- "ubuntu.16.04-x64": {},
- "ubuntu.16.10-x64": {},
- "osx.10.12-x64": {},
- "osx-x64": {},
- "centos.7-x64": {},
- "rhel.7-x64": {},
- "debian.8-x64": {},
- "fedora.24-x64": {},
- "linux-x64": {}
- }
-}
diff --git a/tests/src/Common/test_dependencies/test_dependencies.csproj b/tests/src/Common/test_dependencies/test_dependencies.csproj
index 0b0f5b82bf..f5b1b319c7 100644
--- a/tests/src/Common/test_dependencies/test_dependencies.csproj
+++ b/tests/src/Common/test_dependencies/test_dependencies.csproj
@@ -6,8 +6,35 @@
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<CLRTestKind>BuildOnly</CLRTestKind>
<NugetTargetMoniker>.NETCoreApp,Version=v2.0</NugetTargetMoniker>
+ <NugetTargetMonikerShort>netcoreapp2.0</NugetTargetMonikerShort>
+ <IsTestProject>false</IsTestProject>
+ </PropertyGroup>
+ <ItemGroup>
+ <PackageReference Include="Microsoft.NETCore.CoreDisTools">
+ <Version>1.0.1-prerelease-*</Version>
+ </PackageReference>
+ <PackageReference Include="Microsoft.Private.CoreFx.NETCoreApp">
+ <Version>4.4.0-$(CoreFxExpectedPrerelease)</Version>
+ </PackageReference>
+ <PackageReference Include="System.Memory">
+ <Version>4.4.0-$(CoreFxExpectedPrerelease)</Version>
+ </PackageReference>
+ <PackageReference Include="System.Runtime.CompilerServices.Unsafe">
+ <Version>4.4.0-$(CoreFxExpectedPrerelease)</Version>
+ </PackageReference>
+ <PackageReference Include="System.Security.Permissions">
+ <Version>4.4.0-$(CoreFxExpectedPrerelease)</Version>
+ </PackageReference>
+ </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp2.0</TargetFramework>
+ <TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier>
+ <PackageTargetFallback>$(PackageTargetFallback);dnxcore50;netcoreapp1.1;portable-net45+win8</PackageTargetFallback>
+ <RuntimeIdentifiers>win-x64;win-x86;win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;osx-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64;linux-x64</RuntimeIdentifiers>
+ <ContainsPackageReferences>true</ContainsPackageReferences>
+ <PrereleaseResolveNuGetPackages>false</PrereleaseResolveNuGetPackages>
</PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<Target Name="Build"
- DependsOnTargets="ResolveReferences" />
-</Project>
+ DependsOnTargets="ResolveReferences" />
+</Project> \ No newline at end of file
diff --git a/tests/src/Common/test_runtime/project.json b/tests/src/Common/test_runtime/project.json
deleted file mode 100644
index 575d75d089..0000000000
--- a/tests/src/Common/test_runtime/project.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "dependencies": {
- "Microsoft.NETCore.Platforms": "2.0.0-preview1-25221-01",
- "Microsoft.DotNet.CoreCLR.TestDependencies": "1.0.0-prerelease",
- "jit-dasm": "0.0.1.4",
- "cijobs": "0.0.1.2",
- "jit-analyze": "0.0.1.1"
- },
- "frameworks": {
- "netcoreapp2.0": {
- "imports": [
- "dnxcore50",
- "portable-net45+win8"
- ]
- }
- },
- "runtimes": {
- "win-x64": {},
- "win-x86": {},
- "win7-x86": {},
- "win7-x64": {},
- "ubuntu.14.04-x64": {},
- "ubuntu.16.04-x64": {},
- "ubuntu.16.10-x64": {},
- "osx.10.12-x64": {},
- "osx-x64": {},
- "centos.7-x64": {},
- "rhel.7-x64": {},
- "debian.8-x64": {},
- "fedora.24-x64": {},
- "linux-x64": {}
- }
-}
diff --git a/tests/src/Common/test_runtime/test_runtime.csproj b/tests/src/Common/test_runtime/test_runtime.csproj
index 3b55297f3d..0212b05274 100644
--- a/tests/src/Common/test_runtime/test_runtime.csproj
+++ b/tests/src/Common/test_runtime/test_runtime.csproj
@@ -5,14 +5,35 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<CLRTestKind>BuildOnly</CLRTestKind>
- <!-- Reset the Default project.json-->
- <ProjectJson></ProjectJson>
- <ProjectLockJson></ProjectLockJson>
<NugetTargetMoniker>.NETCoreApp,Version=v2.0</NugetTargetMoniker>
+ <NugetTargetMonikerShort>netcoreapp2.0</NugetTargetMonikerShort>
+ <IsTestProject>false</IsTestProject>
</PropertyGroup>
<ItemGroup>
- <None Include="project.json" />
+ <PackageReference Include="Microsoft.NETCore.Platforms">
+ <Version>2.0.0-$(CoreFxExpectedPrerelease)</Version>
+ </PackageReference>
+ <PackageReference Include="Microsoft.DotNet.CoreCLR.TestDependencies">
+ <Version>1.0.0-prerelease</Version>
+ </PackageReference>
+ <PackageReference Include="jit-dasm">
+ <Version>0.0.1.4</Version>
+ </PackageReference>
+ <PackageReference Include="cijobs">
+ <Version>0.0.1.2</Version>
+ </PackageReference>
+ <PackageReference Include="jit-analyze">
+ <Version>0.0.1.1</Version>
+ </PackageReference>
</ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp2.0</TargetFramework>
+ <TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier>
+ <PackageTargetFallback>$(PackageTargetFallback);dnxcore50;portable-net45+win8</PackageTargetFallback>
+ <RuntimeIdentifiers>win-x64;win-x86;win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;osx-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64;linux-x64</RuntimeIdentifiers>
+ <ContainsPackageReferences>true</ContainsPackageReferences>
+ <PrereleaseResolveNuGetPackages>false</PrereleaseResolveNuGetPackages>
+ </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<Target Name="Build"
DependsOnTargets="ResolveReferences" />
diff --git a/tests/src/GC/API/GCHandleCollector/Usage.cs b/tests/src/GC/API/GCHandleCollector/Usage.cs
index b78271b243..f346966a6b 100644
--- a/tests/src/GC/API/GCHandleCollector/Usage.cs
+++ b/tests/src/GC/API/GCHandleCollector/Usage.cs
@@ -146,9 +146,16 @@ public class Usage
// ensure threshold is increasing
if (!CheckPercentageIncrease(handleCount, prevHandleCount))
{
- // see github#4093 for the rationale for fail-fast in this test.
- Environment.FailFast(string.Empty);
- return false;
+ Console.WriteLine("Percentage not increasing, performing Collect/WFPF/Collect cycle");
+ GC.Collect();
+ GC.WaitForPendingFinalizers();
+ GC.Collect();
+
+ if (handleCount == HandleCollectorTest.Count)
+ {
+ Console.WriteLine("No handles finalized in Collect/WFPF/Collect cycle");
+ return false;
+ }
}
prevHandleCount = handleCount;
}
diff --git a/tests/src/GC/Features/HeapExpansion/pluggaps.csproj b/tests/src/GC/Features/HeapExpansion/pluggaps.csproj
index 8a1f7a47e2..0250cab230 100644
--- a/tests/src/GC/Features/HeapExpansion/pluggaps.csproj
+++ b/tests/src/GC/Features/HeapExpansion/pluggaps.csproj
@@ -10,7 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<GCStressIncompatible>true</GCStressIncompatible>
- <HeapVerifyIncompatible Condition="'$(Platform)' == 'x86'">true</HeapVerifyIncompatible>
+ <HeapVerifyIncompatible>true</HeapVerifyIncompatible>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
diff --git a/tests/src/GC/Scenarios/DoublinkList/dlcollect.cs b/tests/src/GC/Scenarios/DoublinkList/dlcollect.cs
index a17e95a270..f7aa10dccb 100644
--- a/tests/src/GC/Scenarios/DoublinkList/dlcollect.cs
+++ b/tests/src/GC/Scenarios/DoublinkList/dlcollect.cs
@@ -11,6 +11,7 @@
namespace DoubLink {
using System;
using System.Collections.Generic;
+ using System.Runtime.CompilerServices;
public class DLCollect
{
@@ -63,11 +64,38 @@ namespace DoubLink {
}
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ public bool DrainFinalizerQueue(int iRep, int iObj)
+ {
+ int lastValue = DLinkNode.FinalCount;
+ while (true)
+ {
+ GC.Collect();
+ GC.WaitForPendingFinalizers();
+ GC.Collect();
+
+ if (DLinkNode.FinalCount == iRep * iObj * 10)
+ {
+ return true;
+ }
+
+ if (DLinkNode.FinalCount != lastValue)
+ {
+ Console.WriteLine(" Performing Collect/Wait/Collect cycle again");
+ lastValue = DLinkNode.FinalCount;
+ continue;
+ }
+
+ Console.WriteLine(" Finalized number stable at " + lastValue);
+ return false;
+ }
+ }
public bool runTest(int iRep, int iObj)
{
Mv_Collect = new List<DoubLink>(iRep);
+ bool success = false;
for(int i=0; i <10; i++)
{
SetLink(iRep, iObj);
@@ -75,16 +103,13 @@ namespace DoubLink {
GC.Collect();
}
- GC.WaitForPendingFinalizers();
-
- if (DLinkNode.FinalCount != iRep * iObj * 10)
+ if (DrainFinalizerQueue(iRep, iObj))
{
- // see github#4093 for the rationale for fail-fast in this test.
- Environment.FailFast(string.Empty);
+ success = true;
}
Console.WriteLine("{0} DLinkNodes finalized", DLinkNode.FinalCount);
- return (DLinkNode.FinalCount==iRep*iObj*10);
+ return success;
}
diff --git a/tests/src/GC/Scenarios/DoublinkList/dlstack.cs b/tests/src/GC/Scenarios/DoublinkList/dlstack.cs
index 5e207bec52..8fa63bf8fd 100644
--- a/tests/src/GC/Scenarios/DoublinkList/dlstack.cs
+++ b/tests/src/GC/Scenarios/DoublinkList/dlstack.cs
@@ -13,6 +13,7 @@
namespace DoubLink {
using System;
+ using System.Runtime.CompilerServices;
public class DLStack
{
@@ -63,36 +64,50 @@ namespace DoubLink {
}
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ public bool DrainFinalizerQueue(int iRep, int iObj)
+ {
+ int lastValue = DLinkNode.FinalCount;
+ while (true)
+ {
+ GC.Collect();
+ GC.WaitForPendingFinalizers();
+ GC.Collect();
+
+ if (DLinkNode.FinalCount == iRep * iObj * 10)
+ {
+ return true;
+ }
+
+ if (DLinkNode.FinalCount != lastValue)
+ {
+ Console.WriteLine(" Performing Collect/Wait/Collect cycle again");
+ lastValue = DLinkNode.FinalCount;
+ continue;
+ }
+
+ Console.WriteLine(" Finalized number stable at " + lastValue);
+ return false;
+ }
+ }
+
public bool runTest(int iRep, int iObj)
{
-
+ bool success = false;
for(int i=0; i <10; i++)
{
SetLink(iRep, iObj);
MakeLeak(iRep);
}
- long lastTotalMemory = long.MaxValue;
- long curTotalMemory = GC.GetTotalMemory(false);
-
- while (lastTotalMemory != curTotalMemory)
- {
- GC.Collect();
- GC.WaitForPendingFinalizers();
-
- lastTotalMemory = curTotalMemory;
- curTotalMemory = GC.GetTotalMemory(false);
- }
-
- if (DLinkNode.FinalCount != iRep * iObj * 10)
+ if (DrainFinalizerQueue(iRep, iObj))
{
- // see github#4093 for the rationale for fail-fast in this test.
- Environment.FailFast(string.Empty);
+ success = true;
}
Console.WriteLine("{0} DLinkNodes finalized", DLinkNode.FinalCount);
- return (DLinkNode.FinalCount==iRep*iObj*10);
+ return success;
}
diff --git a/tests/src/GC/Scenarios/DoublinkList/doublinkgen.cs b/tests/src/GC/Scenarios/DoublinkList/doublinkgen.cs
index 76436ea7fe..0f1016c3d0 100644
--- a/tests/src/GC/Scenarios/DoublinkList/doublinkgen.cs
+++ b/tests/src/GC/Scenarios/DoublinkList/doublinkgen.cs
@@ -11,6 +11,7 @@
namespace DoubLink {
using System;
+ using System.Runtime.CompilerServices;
public class DoubLinkGen
{
@@ -61,25 +62,47 @@ namespace DoubLink {
return 1;
}
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ public bool DrainFinalizerQueue(int iRep, int iObj)
+ {
+ int lastValue = DLinkNode.FinalCount;
+ while (true)
+ {
+ GC.Collect();
+ GC.WaitForPendingFinalizers();
+ GC.Collect();
+
+ if (DLinkNode.FinalCount == iRep * iObj)
+ {
+ return true;
+ }
+
+ if (DLinkNode.FinalCount != lastValue)
+ {
+ Console.WriteLine(" Performing Collect/Wait/Collect cycle again");
+ lastValue = DLinkNode.FinalCount;
+ continue;
+ }
+
+ Console.WriteLine(" Finalized number stable at " + lastValue);
+ return false;
+ }
+ }
public bool runTest(int iRep, int iObj)
{
SetLink(iRep, iObj);
Mv_Doub = null;
+ bool success = false;
- GC.Collect();
- GC.WaitForPendingFinalizers();
- GC.Collect();
-
- if (DLinkNode.FinalCount != iRep * iObj)
+ if (DrainFinalizerQueue(iRep, iObj))
{
- // see github#4093 for the rationale for fail-fast in this test.
- Environment.FailFast(string.Empty);
+ success = true;
}
Console.Write(DLinkNode.FinalCount);
Console.WriteLine(" DLinkNodes finalized");
- return (DLinkNode.FinalCount==iRep*iObj);
+ return success;
}
diff --git a/tests/src/GC/Stress/Framework/ReliabilityFramework.csproj b/tests/src/GC/Stress/Framework/ReliabilityFramework.csproj
index 7b42bd1b34..91921abba7 100644
--- a/tests/src/GC/Stress/Framework/ReliabilityFramework.csproj
+++ b/tests/src/GC/Stress/Framework/ReliabilityFramework.csproj
@@ -10,9 +10,9 @@
<OutputType>Exe</OutputType>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
- <CLRTestKind>BuildAndRun</CLRTestKind>
+ <CLRTestKind>BuildOnly</CLRTestKind>
+ <GenerateRunScript>false</GenerateRunScript>
<CLRTestPriority>1</CLRTestPriority>
- <CLRTestExecutionArguments>testmix_gc.config /maximumExecutionTime:-1</CLRTestExecutionArguments>
<DefineConstants>$(DefineConstants);STATIC;PROJECTK_BUILD</DefineConstants>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
diff --git a/tests/src/Interop/MarshalAPI/ReadWrite/ReadWriteObject.cs b/tests/src/Interop/MarshalAPI/ReadWrite/ReadWriteObject.cs
new file mode 100644
index 0000000000..a11c10b01b
--- /dev/null
+++ b/tests/src/Interop/MarshalAPI/ReadWrite/ReadWriteObject.cs
@@ -0,0 +1,116 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Threading.Tasks;
+
+using CoreFXTestLibrary;
+
+internal struct BlittableStruct
+{
+ internal int a;
+ internal int b;
+ internal byte c;
+ internal short d;
+ internal IntPtr p;
+}
+
+internal struct StructWithReferenceTypes
+{
+ internal IntPtr ptr;
+ internal string str;
+ [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
+ internal int[] byValArr;
+}
+
+class Test
+{
+ static int Main(string[] args)
+ {
+ TestNegativeCases();
+ TestBlittableStruct();
+ TestStructWithReferenceType();
+
+ return 100;
+ }
+
+ static void TestNegativeCases()
+ {
+ Assert.Throws<ArgumentNullException>(() => { Marshal.WriteByte(null, 0, 0); });
+ Assert.Throws<ArgumentNullException>(() => { Marshal.WriteInt16(null, 0, 0); });
+ Assert.Throws<ArgumentNullException>(() => { Marshal.WriteInt32(null, 0, 0); });
+ Assert.Throws<ArgumentNullException>(() => { Marshal.WriteInt64(null, 0, 0); });
+ Assert.Throws<ArgumentNullException>(() => { Marshal.WriteIntPtr(null, 0, IntPtr.Zero); });
+ Assert.Throws<ArgumentNullException>(() => { Marshal.ReadByte(null, 0); });
+ Assert.Throws<ArgumentNullException>(() => { Marshal.ReadInt16(null, 0); });
+ Assert.Throws<ArgumentNullException>(() => { Marshal.ReadInt32(null, 0); });
+ Assert.Throws<ArgumentNullException>(() => { Marshal.ReadIntPtr(null, 0); });
+ }
+
+ static void TestBlittableStruct()
+ {
+ Console.WriteLine("TestBlittableStruct");
+
+ BlittableStruct blittableStruct = new BlittableStruct();
+ blittableStruct.a = 200;
+ blittableStruct.b = 300;
+ blittableStruct.c = 10;
+ blittableStruct.d = 123;
+ blittableStruct.p = new IntPtr(100);
+
+ object boxedBlittableStruct = (object)blittableStruct;
+
+ int offsetOfB = Marshal.OffsetOf<BlittableStruct>("b").ToInt32();
+ int offsetOfC = Marshal.OffsetOf<BlittableStruct>("c").ToInt32();
+ int offsetOfD = Marshal.OffsetOf<BlittableStruct>("d").ToInt32();
+ int offsetOfP = Marshal.OffsetOf<BlittableStruct>("p").ToInt32();
+
+ Assert.AreEqual(Marshal.ReadInt32(boxedBlittableStruct, 0), 200);
+ Assert.AreEqual(Marshal.ReadInt32(boxedBlittableStruct, offsetOfB), 300);
+ Assert.AreEqual(Marshal.ReadByte(boxedBlittableStruct, offsetOfC), 10);
+ Assert.AreEqual(Marshal.ReadInt16(boxedBlittableStruct, offsetOfD), 123);
+ Assert.AreEqual(Marshal.ReadIntPtr(boxedBlittableStruct, offsetOfP), new IntPtr(100));
+
+ Marshal.WriteInt32(boxedBlittableStruct, 0, 300);
+ Marshal.WriteInt32(boxedBlittableStruct, offsetOfB, 400);
+ Marshal.WriteByte(boxedBlittableStruct, offsetOfC, 20);
+ Marshal.WriteInt16(boxedBlittableStruct, offsetOfD, 144);
+
+ Marshal.WriteIntPtr(boxedBlittableStruct, offsetOfP, new IntPtr(500));
+
+ Assert.AreEqual(((BlittableStruct)boxedBlittableStruct).a, 300);
+ Assert.AreEqual(((BlittableStruct)boxedBlittableStruct).b, 400);
+ Assert.AreEqual(((BlittableStruct)boxedBlittableStruct).c, 20);
+ Assert.AreEqual(((BlittableStruct)boxedBlittableStruct).d, 144);
+ Assert.AreEqual(((BlittableStruct)boxedBlittableStruct).p, new IntPtr(500));
+ }
+
+ static void TestStructWithReferenceType()
+ {
+ Console.WriteLine("TestStructWithReferenceType");
+
+ StructWithReferenceTypes structWithReferenceTypes = new StructWithReferenceTypes();
+ structWithReferenceTypes.ptr = new IntPtr(100);
+ structWithReferenceTypes.str = "ABC";
+ structWithReferenceTypes.byValArr = new int[10] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
+
+ object boxedStruct = (object)structWithReferenceTypes;
+
+ int offsetOfStr = Marshal.OffsetOf<StructWithReferenceTypes>("str").ToInt32();
+ int offsetOfByValArr = Marshal.OffsetOf<StructWithReferenceTypes>("byValArr").ToInt32();
+
+ Assert.AreEqual(Marshal.ReadInt32(boxedStruct, 0), 100);
+ Assert.AreNotEqual(Marshal.ReadIntPtr(boxedStruct, offsetOfStr), IntPtr.Zero);
+ Assert.AreEqual(Marshal.ReadInt32(boxedStruct, offsetOfByValArr + sizeof(int) * 2), 3);
+
+ Marshal.WriteInt32(boxedStruct, 0, 200);
+ Marshal.WriteInt32(boxedStruct, offsetOfByValArr + sizeof(int) * 9, 100);
+
+ Assert.AreEqual(((StructWithReferenceTypes)boxedStruct).ptr, new IntPtr(200));
+ Assert.AreEqual(((StructWithReferenceTypes)boxedStruct).byValArr[9], 100);
+ Assert.AreEqual(((StructWithReferenceTypes)boxedStruct).byValArr[8], 9);
+ Assert.AreEqual(((StructWithReferenceTypes)boxedStruct).str, "ABC");
+ }
+}
+
diff --git a/tests/src/Interop/MarshalAPI/ReadWrite/ReadWriteObject.csproj b/tests/src/Interop/MarshalAPI/ReadWrite/ReadWriteObject.csproj
new file mode 100644
index 0000000000..14fcd2c97d
--- /dev/null
+++ b/tests/src/Interop/MarshalAPI/ReadWrite/ReadWriteObject.csproj
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <AssemblyName>ReadWriteObject</AssemblyName>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{F1E66554-8C8E-4141-85CF-D0CD6A0CD0B0}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+
+ <DefineConstants>$(DefineConstants);STATIC</DefineConstants>
+ </PropertyGroup>
+ <!-- Default configurations to help VS understand the configurations -->
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+ </PropertyGroup>
+ <ItemGroup>
+ <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+ <Visible>False</Visible>
+ </CodeAnalysisDependentAssemblyPaths>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="ReadWriteObject.cs" />
+ <Compile Include="..\..\common\Assertion.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\..\Common\CoreCLRTestLibrary\CoreCLRTestLibrary.csproj">
+ <Project>{c8c0dc74-fac4-45b1-81fe-70c4808366e0}</Project>
+ <Name>CoreCLRTestLibrary</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+</Project>
diff --git a/tests/src/Interop/MarshalAPI/String/StringMarshalingTest.cs b/tests/src/Interop/MarshalAPI/String/StringMarshalingTest.cs
index 714dac83e4..29ee83a8c0 100644
--- a/tests/src/Interop/MarshalAPI/String/StringMarshalingTest.cs
+++ b/tests/src/Interop/MarshalAPI/String/StringMarshalingTest.cs
@@ -52,6 +52,39 @@ public class StringMarshalingTest
}
}
+ private unsafe void SecureStringToBSTRToString()
+ {
+ foreach (String ts in TestStrings)
+ {
+ SecureString secureString = new SecureString();
+ foreach (char character in ts)
+ {
+ secureString.AppendChar(character);
+ }
+
+ IntPtr BStr = IntPtr.Zero;
+ String str;
+
+ try
+ {
+ BStr = Marshal.SecureStringToBSTR(secureString);
+ str = Marshal.PtrToStringBSTR(BStr);
+ }
+ finally
+ {
+ if (BStr != IntPtr.Zero)
+ {
+ Marshal.ZeroFreeBSTR(BStr);
+ }
+ }
+
+ if (!str.Equals(ts))
+ {
+ throw new Exception();
+ }
+ }
+ }
+
private void StringToCoTaskMemAnsiToString()
{
foreach (String ts in TestStrings)
@@ -201,6 +234,7 @@ public class StringMarshalingTest
public bool RunTests()
{
StringToBStrToString();
+ SecureStringToBSTRToString();
StringToCoTaskMemAnsiToString();
StringToCoTaskMemUniToString();
StringToHGlobalAnsiToString();
diff --git a/tests/src/Interop/StringMarshalling/LPSTR/LPSTRTest.cs b/tests/src/Interop/StringMarshalling/LPSTR/LPSTRTest.cs
index 12cff70438..74a2087eca 100644
--- a/tests/src/Interop/StringMarshalling/LPSTR/LPSTRTest.cs
+++ b/tests/src/Interop/StringMarshalling/LPSTR/LPSTRTest.cs
@@ -31,6 +31,25 @@ class Test
}
#endregion
+ #region "Helper"
+ // ************************************************************
+ // Returns the appropriate exit code
+ // *************************************************************
+ static int ExitTest()
+ {
+ if (fails == 0)
+ {
+ Console.WriteLine("PASS");
+ return 100;
+ }
+ else
+ {
+ Console.WriteLine("FAIL - " + fails + " failure(s) occurred");
+ return 101;
+ }
+ }
+ #endregion
+
#region ReversePInvoke
public static string Call_DelMarshal_InOut(string s)
@@ -219,6 +238,6 @@ class Test
ReportFailure("Method ReverseP_MarshalStrB_InOut[Managed Side],return value is false");
}
#endregion
- return 100;
+ return ExitTest();
}
}
diff --git a/tests/src/Interop/StringMarshalling/LPSTR/LPSTRTestNative.cpp b/tests/src/Interop/StringMarshalling/LPSTR/LPSTRTestNative.cpp
index b440c52ef5..485d949abb 100644
--- a/tests/src/Interop/StringMarshalling/LPSTR/LPSTRTestNative.cpp
+++ b/tests/src/Interop/StringMarshalling/LPSTR/LPSTRTestNative.cpp
@@ -123,16 +123,16 @@ extern "C" DLL_EXPORT int __cdecl Writeline(char * pFormat, int i, char c, doubl
}
-typedef LPCTSTR (__stdcall * Test_DelMarshal_InOut)(/*[in]*/ LPCSTR s);
+typedef LPCWSTR (__stdcall * Test_DelMarshal_InOut)(/*[in]*/ LPCSTR s);
extern "C" DLL_EXPORT BOOL __cdecl RPinvoke_DelMarshal_InOut(Test_DelMarshal_InOut d, /*[in]*/ LPCSTR s)
{
- LPCTSTR str = d(s);
- const char *ret = "Return";
+ LPCWSTR str = d(s);
+ LPCWSTR ret = W("Return");
- size_t lenstr = _tcslen(str);
- size_t lenret = _tcslen(ret);
+ size_t lenstr = wcslen(str);
+ size_t lenret = wcslen(ret);
- if((lenret != lenstr)||(_tcsncmp(str,ret,lenstr)!=0))
+ if((lenret != lenstr)||(wcsncmp(str,ret,lenstr)!=0))
{
printf("Error in RPinvoke_DelMarshal_InOut, Returned value didn't match\n");
return FALSE;
diff --git a/tests/src/JIT/CheckProjects/CheckProjects.cs b/tests/src/JIT/CheckProjects/CheckProjects.cs
index be42ab9cfe..28cc10d174 100644
--- a/tests/src/JIT/CheckProjects/CheckProjects.cs
+++ b/tests/src/JIT/CheckProjects/CheckProjects.cs
@@ -86,7 +86,11 @@ internal class ScanProjectFiles
foreach (FileInfo f in projectRootDir.GetFiles("*.*proj", SearchOption.AllDirectories))
{
- ParseAndUpdateProj(f.FullName, s_tryAndFix);
+ if (!f.FullName.Contains("JIT\\config") && !f.FullName.Contains("JIT/config"))
+ {
+ ParseAndUpdateProj(f.FullName, s_tryAndFix);
+ }
+
}
Console.WriteLine("{0} projects, {1} needed fixes, {2} fixes deferred, {3} were fixed",
diff --git a/tests/src/JIT/CheckProjects/CheckProjects.csproj b/tests/src/JIT/CheckProjects/CheckProjects.csproj
index 3bc83992bb..02d073a3fb 100644
--- a/tests/src/JIT/CheckProjects/CheckProjects.csproj
+++ b/tests/src/JIT/CheckProjects/CheckProjects.csproj
@@ -9,6 +9,7 @@
<OutputType>Exe</OutputType>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ <GCStressIncompatible>true</GCStressIncompatible>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -28,10 +29,9 @@
<ItemGroup>
<Compile Include="CheckProjects.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
-</Project> \ No newline at end of file
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
+</Project>
diff --git a/tests/src/JIT/Directed/TypedReference/TypedReference.csproj b/tests/src/JIT/Directed/TypedReference/TypedReference.csproj
index 36cd9b760b..13a728059d 100644
--- a/tests/src/JIT/Directed/TypedReference/TypedReference.csproj
+++ b/tests/src/JIT/Directed/TypedReference/TypedReference.csproj
@@ -27,9 +27,10 @@
<ItemGroup>
<Compile Include="TypedReference.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Directed/UnrollLoop/loop6_cs_d.csproj b/tests/src/JIT/Directed/UnrollLoop/loop6_cs_d.csproj
index 953edac964..dcef420e0a 100644
--- a/tests/src/JIT/Directed/UnrollLoop/loop6_cs_d.csproj
+++ b/tests/src/JIT/Directed/UnrollLoop/loop6_cs_d.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="loop6.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Directed/UnrollLoop/loop6_cs_do.csproj b/tests/src/JIT/Directed/UnrollLoop/loop6_cs_do.csproj
index 829c62c4c4..84ef3caf97 100644
--- a/tests/src/JIT/Directed/UnrollLoop/loop6_cs_do.csproj
+++ b/tests/src/JIT/Directed/UnrollLoop/loop6_cs_do.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="loop6.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Directed/UnrollLoop/loop6_cs_r.csproj b/tests/src/JIT/Directed/UnrollLoop/loop6_cs_r.csproj
index 3c5f1cc245..22e4d5e32d 100644
--- a/tests/src/JIT/Directed/UnrollLoop/loop6_cs_r.csproj
+++ b/tests/src/JIT/Directed/UnrollLoop/loop6_cs_r.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="loop6.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Directed/UnrollLoop/loop6_cs_ro.csproj b/tests/src/JIT/Directed/UnrollLoop/loop6_cs_ro.csproj
index a41f31a39d..1b0800a1af 100644
--- a/tests/src/JIT/Directed/UnrollLoop/loop6_cs_ro.csproj
+++ b/tests/src/JIT/Directed/UnrollLoop/loop6_cs_ro.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="loop6.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Generics/Coverage/chaos65204782cs.csproj b/tests/src/JIT/Generics/Coverage/chaos65204782cs.csproj
index 9cd1843162..2271820bbd 100644
--- a/tests/src/JIT/Generics/Coverage/chaos65204782cs.csproj
+++ b/tests/src/JIT/Generics/Coverage/chaos65204782cs.csproj
@@ -33,4 +33,4 @@
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
</PropertyGroup>
-</Project> \ No newline at end of file
+</Project>
diff --git a/tests/src/JIT/Generics/Coverage/chaos65204782cs_o.csproj b/tests/src/JIT/Generics/Coverage/chaos65204782cs_o.csproj
index c5f459d9aa..6311f4eb47 100644
--- a/tests/src/JIT/Generics/Coverage/chaos65204782cs_o.csproj
+++ b/tests/src/JIT/Generics/Coverage/chaos65204782cs_o.csproj
@@ -10,6 +10,7 @@
<OutputType>Exe</OutputType>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ <GCStressIncompatible>true</GCStressIncompatible>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -34,4 +35,4 @@
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
</PropertyGroup>
-</Project> \ No newline at end of file
+</Project>
diff --git a/tests/src/JIT/Methodical/Boxing/morph/sin3double.ilproj b/tests/src/JIT/Methodical/Boxing/morph/sin3double.ilproj
index d8ec34de75..0ae44d99ef 100644
--- a/tests/src/JIT/Methodical/Boxing/morph/sin3double.ilproj
+++ b/tests/src/JIT/Methodical/Boxing/morph/sin3double.ilproj
@@ -32,11 +32,9 @@
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
- <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
</PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Methodical/VT/etc/_dbggc_nested.csproj b/tests/src/JIT/Methodical/VT/etc/_dbggc_nested.csproj
index afe15bbe2d..2edd488ce0 100644
--- a/tests/src/JIT/Methodical/VT/etc/_dbggc_nested.csproj
+++ b/tests/src/JIT/Methodical/VT/etc/_dbggc_nested.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="gc_nested.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/VT/etc/_dbgnested.csproj b/tests/src/JIT/Methodical/VT/etc/_dbgnested.csproj
index 33039679f7..3579d2647e 100644
--- a/tests/src/JIT/Methodical/VT/etc/_dbgnested.csproj
+++ b/tests/src/JIT/Methodical/VT/etc/_dbgnested.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="nested.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/VT/etc/_relgc_nested.csproj b/tests/src/JIT/Methodical/VT/etc/_relgc_nested.csproj
index 7ec8612274..2638322546 100644
--- a/tests/src/JIT/Methodical/VT/etc/_relgc_nested.csproj
+++ b/tests/src/JIT/Methodical/VT/etc/_relgc_nested.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="gc_nested.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/VT/etc/_relnested.csproj b/tests/src/JIT/Methodical/VT/etc/_relnested.csproj
index b0b398de80..0298dde5d2 100644
--- a/tests/src/JIT/Methodical/VT/etc/_relnested.csproj
+++ b/tests/src/JIT/Methodical/VT/etc/_relnested.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="nested.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/VT/etc/_speed_dbggc_nested.csproj b/tests/src/JIT/Methodical/VT/etc/_speed_dbggc_nested.csproj
index 2b1acc4a5c..d3849b1a14 100644
--- a/tests/src/JIT/Methodical/VT/etc/_speed_dbggc_nested.csproj
+++ b/tests/src/JIT/Methodical/VT/etc/_speed_dbggc_nested.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="gc_nested.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/VT/etc/_speed_dbgnested.csproj b/tests/src/JIT/Methodical/VT/etc/_speed_dbgnested.csproj
index 97be5fecbd..4a165d377d 100644
--- a/tests/src/JIT/Methodical/VT/etc/_speed_dbgnested.csproj
+++ b/tests/src/JIT/Methodical/VT/etc/_speed_dbgnested.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="nested.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/VT/etc/_speed_relgc_nested.csproj b/tests/src/JIT/Methodical/VT/etc/_speed_relgc_nested.csproj
index 592c20a7b8..694363a0ce 100644
--- a/tests/src/JIT/Methodical/VT/etc/_speed_relgc_nested.csproj
+++ b/tests/src/JIT/Methodical/VT/etc/_speed_relgc_nested.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="gc_nested.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/VT/etc/_speed_relnested.csproj b/tests/src/JIT/Methodical/VT/etc/_speed_relnested.csproj
index 817c22f9c3..ca5a53abba 100644
--- a/tests/src/JIT/Methodical/VT/etc/_speed_relnested.csproj
+++ b/tests/src/JIT/Methodical/VT/etc/_speed_relnested.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="nested.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/VT/etc/gc_nested.csproj b/tests/src/JIT/Methodical/VT/etc/gc_nested.csproj
index f858d0f6bd..9601e61e1e 100644
--- a/tests/src/JIT/Methodical/VT/etc/gc_nested.csproj
+++ b/tests/src/JIT/Methodical/VT/etc/gc_nested.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="gc_nested.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/VT/etc/nested.csproj b/tests/src/JIT/Methodical/VT/etc/nested.csproj
index 11babc3182..c2ba77845c 100644
--- a/tests/src/JIT/Methodical/VT/etc/nested.csproj
+++ b/tests/src/JIT/Methodical/VT/etc/nested.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="nested.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/acceptance/Boxing/boxing001.ilproj b/tests/src/JIT/Methodical/acceptance/Boxing/boxing001.ilproj
index 3d7729f5e7..cfbf44f7b0 100644
--- a/tests/src/JIT/Methodical/acceptance/Boxing/boxing001.ilproj
+++ b/tests/src/JIT/Methodical/acceptance/Boxing/boxing001.ilproj
@@ -32,11 +32,9 @@
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
- <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
</PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Methodical/refany/_dbggcreport.csproj b/tests/src/JIT/Methodical/refany/_dbggcreport.csproj
index c8dd1da34c..0e77a28947 100644
--- a/tests/src/JIT/Methodical/refany/_dbggcreport.csproj
+++ b/tests/src/JIT/Methodical/refany/_dbggcreport.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="gcreport.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/refany/_dbgnative.csproj b/tests/src/JIT/Methodical/refany/_dbgnative.csproj
index 1ffea88844..e8edef3a7c 100644
--- a/tests/src/JIT/Methodical/refany/_dbgnative.csproj
+++ b/tests/src/JIT/Methodical/refany/_dbgnative.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="native.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/refany/_dbgstress1.csproj b/tests/src/JIT/Methodical/refany/_dbgstress1.csproj
index eb5c6626f3..9704560fab 100644
--- a/tests/src/JIT/Methodical/refany/_dbgstress1.csproj
+++ b/tests/src/JIT/Methodical/refany/_dbgstress1.csproj
@@ -29,9 +29,10 @@
<ItemGroup>
<Compile Include="stress1.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/refany/_dbgstress3.csproj b/tests/src/JIT/Methodical/refany/_dbgstress3.csproj
index c41462c110..540ee3c8dc 100644
--- a/tests/src/JIT/Methodical/refany/_dbgstress3.csproj
+++ b/tests/src/JIT/Methodical/refany/_dbgstress3.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="stress3-64bit.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/refany/_dbgvirtcall.csproj b/tests/src/JIT/Methodical/refany/_dbgvirtcall.csproj
index f1b1b10a24..50a1e714c2 100644
--- a/tests/src/JIT/Methodical/refany/_dbgvirtcall.csproj
+++ b/tests/src/JIT/Methodical/refany/_dbgvirtcall.csproj
@@ -29,9 +29,10 @@
<ItemGroup>
<Compile Include="virtcall.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/refany/_relgcreport.csproj b/tests/src/JIT/Methodical/refany/_relgcreport.csproj
index 8781f33cdb..da3914fcdb 100644
--- a/tests/src/JIT/Methodical/refany/_relgcreport.csproj
+++ b/tests/src/JIT/Methodical/refany/_relgcreport.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="gcreport.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/refany/_relnative.csproj b/tests/src/JIT/Methodical/refany/_relnative.csproj
index 50bccd2c9d..88e840991c 100644
--- a/tests/src/JIT/Methodical/refany/_relnative.csproj
+++ b/tests/src/JIT/Methodical/refany/_relnative.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="native.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/refany/_relstress1.csproj b/tests/src/JIT/Methodical/refany/_relstress1.csproj
index 08cfb0238f..19a9a55226 100644
--- a/tests/src/JIT/Methodical/refany/_relstress1.csproj
+++ b/tests/src/JIT/Methodical/refany/_relstress1.csproj
@@ -29,9 +29,10 @@
<ItemGroup>
<Compile Include="stress1.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/refany/_relstress3.csproj b/tests/src/JIT/Methodical/refany/_relstress3.csproj
index 03c37ce533..65da5b03e3 100644
--- a/tests/src/JIT/Methodical/refany/_relstress3.csproj
+++ b/tests/src/JIT/Methodical/refany/_relstress3.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="stress3-64bit.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/refany/_relvirtcall.csproj b/tests/src/JIT/Methodical/refany/_relvirtcall.csproj
index 459da7d647..d1e9e6767c 100644
--- a/tests/src/JIT/Methodical/refany/_relvirtcall.csproj
+++ b/tests/src/JIT/Methodical/refany/_relvirtcall.csproj
@@ -29,9 +29,10 @@
<ItemGroup>
<Compile Include="virtcall.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/refany/_speed_dbggcreport.csproj b/tests/src/JIT/Methodical/refany/_speed_dbggcreport.csproj
index 21e1dfb876..2e39368075 100644
--- a/tests/src/JIT/Methodical/refany/_speed_dbggcreport.csproj
+++ b/tests/src/JIT/Methodical/refany/_speed_dbggcreport.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="gcreport.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/refany/_speed_dbgnative.csproj b/tests/src/JIT/Methodical/refany/_speed_dbgnative.csproj
index f7fde093de..8757d50b1a 100644
--- a/tests/src/JIT/Methodical/refany/_speed_dbgnative.csproj
+++ b/tests/src/JIT/Methodical/refany/_speed_dbgnative.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="native.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/refany/_speed_dbgstress1.csproj b/tests/src/JIT/Methodical/refany/_speed_dbgstress1.csproj
index 10d26819f4..10a8cd5f6a 100644
--- a/tests/src/JIT/Methodical/refany/_speed_dbgstress1.csproj
+++ b/tests/src/JIT/Methodical/refany/_speed_dbgstress1.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="stress1.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/refany/_speed_dbgstress3.csproj b/tests/src/JIT/Methodical/refany/_speed_dbgstress3.csproj
index cfd702ecae..124554ed79 100644
--- a/tests/src/JIT/Methodical/refany/_speed_dbgstress3.csproj
+++ b/tests/src/JIT/Methodical/refany/_speed_dbgstress3.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="stress3-64bit.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/refany/_speed_dbgvirtcall.csproj b/tests/src/JIT/Methodical/refany/_speed_dbgvirtcall.csproj
index 531b47a9bc..45aad43acc 100644
--- a/tests/src/JIT/Methodical/refany/_speed_dbgvirtcall.csproj
+++ b/tests/src/JIT/Methodical/refany/_speed_dbgvirtcall.csproj
@@ -29,9 +29,10 @@
<ItemGroup>
<Compile Include="virtcall.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/refany/_speed_relgcreport.csproj b/tests/src/JIT/Methodical/refany/_speed_relgcreport.csproj
index 3fb0a8d27f..a0bc8fff61 100644
--- a/tests/src/JIT/Methodical/refany/_speed_relgcreport.csproj
+++ b/tests/src/JIT/Methodical/refany/_speed_relgcreport.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="gcreport.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/refany/_speed_relnative.csproj b/tests/src/JIT/Methodical/refany/_speed_relnative.csproj
index 11e2afd4be..30045fba82 100644
--- a/tests/src/JIT/Methodical/refany/_speed_relnative.csproj
+++ b/tests/src/JIT/Methodical/refany/_speed_relnative.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="native.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/refany/_speed_relstress1.csproj b/tests/src/JIT/Methodical/refany/_speed_relstress1.csproj
index f300ebc4aa..0e484466b1 100644
--- a/tests/src/JIT/Methodical/refany/_speed_relstress1.csproj
+++ b/tests/src/JIT/Methodical/refany/_speed_relstress1.csproj
@@ -29,9 +29,10 @@
<ItemGroup>
<Compile Include="stress1.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/refany/_speed_relstress3.csproj b/tests/src/JIT/Methodical/refany/_speed_relstress3.csproj
index fd6a9aedb9..6e160e6e01 100644
--- a/tests/src/JIT/Methodical/refany/_speed_relstress3.csproj
+++ b/tests/src/JIT/Methodical/refany/_speed_relstress3.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="stress3-64bit.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/refany/_speed_relvirtcall.csproj b/tests/src/JIT/Methodical/refany/_speed_relvirtcall.csproj
index ecae4158e9..ab78d753e8 100644
--- a/tests/src/JIT/Methodical/refany/_speed_relvirtcall.csproj
+++ b/tests/src/JIT/Methodical/refany/_speed_relvirtcall.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="virtcall.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/refany/array1.csproj b/tests/src/JIT/Methodical/refany/array1.csproj
index 83c8927f2d..8c713ad864 100644
--- a/tests/src/JIT/Methodical/refany/array1.csproj
+++ b/tests/src/JIT/Methodical/refany/array1.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="array1.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/refany/array2.csproj b/tests/src/JIT/Methodical/refany/array2.csproj
index 1890a9c9d0..1d57843df2 100644
--- a/tests/src/JIT/Methodical/refany/array2.csproj
+++ b/tests/src/JIT/Methodical/refany/array2.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="array2.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/refany/format.csproj b/tests/src/JIT/Methodical/refany/format.csproj
index 18b8fa8e87..008ec5fad3 100644
--- a/tests/src/JIT/Methodical/refany/format.csproj
+++ b/tests/src/JIT/Methodical/refany/format.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="format.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/refany/gcreport.csproj b/tests/src/JIT/Methodical/refany/gcreport.csproj
index 04d0fffb01..c40ea0504b 100644
--- a/tests/src/JIT/Methodical/refany/gcreport.csproj
+++ b/tests/src/JIT/Methodical/refany/gcreport.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="gcreport.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/refany/lcs.csproj b/tests/src/JIT/Methodical/refany/lcs.csproj
index 122a161b4a..187948b805 100644
--- a/tests/src/JIT/Methodical/refany/lcs.csproj
+++ b/tests/src/JIT/Methodical/refany/lcs.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="lcs.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/refany/native.csproj b/tests/src/JIT/Methodical/refany/native.csproj
index db30722d05..a100b56c0d 100644
--- a/tests/src/JIT/Methodical/refany/native.csproj
+++ b/tests/src/JIT/Methodical/refany/native.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="native.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/refany/virtcall.csproj b/tests/src/JIT/Methodical/refany/virtcall.csproj
index fecf6cc43e..1f7727308c 100644
--- a/tests/src/JIT/Methodical/refany/virtcall.csproj
+++ b/tests/src/JIT/Methodical/refany/virtcall.csproj
@@ -29,9 +29,10 @@
<ItemGroup>
<Compile Include="virtcall.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/tailcall_v4/smallFrame.il b/tests/src/JIT/Methodical/tailcall_v4/smallFrame.il
index dad77eadf2..eb2ac39bf2 100644
--- a/tests/src/JIT/Methodical/tailcall_v4/smallFrame.il
+++ b/tests/src/JIT/Methodical/tailcall_v4/smallFrame.il
@@ -358,7 +358,8 @@
// Code size 7 (0x7)
.maxstack 8
//.line 114,114 : 3,16 ''
- IL_0000: tail. call valuetype RetBuff RetBufferBug::TailCallee()
+// tail. // tail.call, pop, ret sequence is never valid for .NET Core (but is accepted by .NET x64)
+ IL_0000: call valuetype RetBuff RetBufferBug::TailCallee()
IL_0005: pop
//.line 115,115 : 2,3 ''
IL_0006: ret
diff --git a/tests/src/JIT/Methodical/xxobj/operand/_dbgrefanyval.csproj b/tests/src/JIT/Methodical/xxobj/operand/_dbgrefanyval.csproj
index 0225a059b7..b15027176f 100644
--- a/tests/src/JIT/Methodical/xxobj/operand/_dbgrefanyval.csproj
+++ b/tests/src/JIT/Methodical/xxobj/operand/_dbgrefanyval.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="refanyval.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/xxobj/operand/_relrefanyval.csproj b/tests/src/JIT/Methodical/xxobj/operand/_relrefanyval.csproj
index faf18d60df..10128517d2 100644
--- a/tests/src/JIT/Methodical/xxobj/operand/_relrefanyval.csproj
+++ b/tests/src/JIT/Methodical/xxobj/operand/_relrefanyval.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="refanyval.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/xxobj/operand/_speed_dbgrefanyval.csproj b/tests/src/JIT/Methodical/xxobj/operand/_speed_dbgrefanyval.csproj
index 82d5593bcd..7ff0df3280 100644
--- a/tests/src/JIT/Methodical/xxobj/operand/_speed_dbgrefanyval.csproj
+++ b/tests/src/JIT/Methodical/xxobj/operand/_speed_dbgrefanyval.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="refanyval.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/xxobj/operand/_speed_relrefanyval.csproj b/tests/src/JIT/Methodical/xxobj/operand/_speed_relrefanyval.csproj
index f7e7aafbeb..7089fece10 100644
--- a/tests/src/JIT/Methodical/xxobj/operand/_speed_relrefanyval.csproj
+++ b/tests/src/JIT/Methodical/xxobj/operand/_speed_relrefanyval.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="refanyval.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Methodical/xxobj/operand/refanyval.csproj b/tests/src/JIT/Methodical/xxobj/operand/refanyval.csproj
index 8f35c4bb65..fa8199743a 100644
--- a/tests/src/JIT/Methodical/xxobj/operand/refanyval.csproj
+++ b/tests/src/JIT/Methodical/xxobj/operand/refanyval.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="refanyval.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/Adams/Adams.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/Adams/Adams.cs
index 431d857f16..3f21d9cd4c 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/Adams/Adams.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/Adams/Adams.cs
@@ -15,7 +15,6 @@ using Microsoft.Xunit.Performance;
#if XUNIT_PERF
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
#endif // XUNIT_PERF
namespace Benchstone.BenchF
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/Adams/Adams.csproj b/tests/src/JIT/Performance/CodeQuality/BenchF/Adams/Adams.csproj
index 80afc6699a..9d5cf5d0e6 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/Adams/Adams.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/Adams/Adams.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="Adams.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/BenchMk2/BenchMk2.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/BenchMk2/BenchMk2.cs
index c4cfc0b217..5c616a5b6c 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/BenchMk2/BenchMk2.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/BenchMk2/BenchMk2.cs
@@ -9,7 +9,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchF
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/BenchMk2/BenchMk2.csproj b/tests/src/JIT/Performance/CodeQuality/BenchF/BenchMk2/BenchMk2.csproj
index 174ee76e18..c42c73625c 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/BenchMk2/BenchMk2.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/BenchMk2/BenchMk2.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="BenchMk2.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/BenchMrk/BenchMrk.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/BenchMrk/BenchMrk.cs
index f342b2d84e..ec70102f27 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/BenchMrk/BenchMrk.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/BenchMrk/BenchMrk.cs
@@ -9,7 +9,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchF
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/BenchMrk/BenchMrk.csproj b/tests/src/JIT/Performance/CodeQuality/BenchF/BenchMrk/BenchMrk.csproj
index 1594ae0a45..e26289d3f4 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/BenchMrk/BenchMrk.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/BenchMrk/BenchMrk.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="BenchMrk.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/Bisect/Bisect.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/Bisect/Bisect.cs
index 724416a626..cd44b1c83e 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/Bisect/Bisect.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/Bisect/Bisect.cs
@@ -10,7 +10,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchF
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/Bisect/Bisect.csproj b/tests/src/JIT/Performance/CodeQuality/BenchF/Bisect/Bisect.csproj
index 70fdb06897..345ee32477 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/Bisect/Bisect.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/Bisect/Bisect.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="Bisect.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/DMath/DMath.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/DMath/DMath.cs
index 47c5e20285..dbce024099 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/DMath/DMath.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/DMath/DMath.cs
@@ -9,7 +9,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchF
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/DMath/DMath.csproj b/tests/src/JIT/Performance/CodeQuality/BenchF/DMath/DMath.csproj
index bd1b084df5..9eb733599a 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/DMath/DMath.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/DMath/DMath.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="DMath.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/FFT/FFT.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/FFT/FFT.cs
index 8881eae6c6..3ddd75491d 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/FFT/FFT.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/FFT/FFT.cs
@@ -11,7 +11,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchF
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/FFT/FFT.csproj b/tests/src/JIT/Performance/CodeQuality/BenchF/FFT/FFT.csproj
index 10f39efd08..28b1fa42a7 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/FFT/FFT.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/FFT/FFT.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="FFT.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/InProd/InProd.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/InProd/InProd.cs
index 26096b736e..08665a8950 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/InProd/InProd.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/InProd/InProd.cs
@@ -9,7 +9,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchF
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/InProd/InProd.csproj b/tests/src/JIT/Performance/CodeQuality/BenchF/InProd/InProd.csproj
index 975bf96f92..0d3d9d324a 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/InProd/InProd.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/InProd/InProd.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="InProd.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/InvMt/InvMt.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/InvMt/InvMt.cs
index 6ecfb62d91..ee0af77b59 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/InvMt/InvMt.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/InvMt/InvMt.cs
@@ -10,7 +10,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchF
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/InvMt/InvMt.csproj b/tests/src/JIT/Performance/CodeQuality/BenchF/InvMt/InvMt.csproj
index 417f1c5631..8971e8aa78 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/InvMt/InvMt.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/InvMt/InvMt.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="InvMt.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/LLoops/LLoops.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/LLoops/LLoops.cs
index 73ec09aa04..d7d7eb8259 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/LLoops/LLoops.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/LLoops/LLoops.cs
@@ -58,7 +58,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchF
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/LLoops/LLoops.csproj b/tests/src/JIT/Performance/CodeQuality/BenchF/LLoops/LLoops.csproj
index 6751cc2492..2b4d20a5c3 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/LLoops/LLoops.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/LLoops/LLoops.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="LLoops.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/Lorenz/Lorenz.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/Lorenz/Lorenz.cs
index 5819446bf0..5fe7ef34e4 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/Lorenz/Lorenz.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/Lorenz/Lorenz.cs
@@ -10,7 +10,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchF
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/Lorenz/Lorenz.csproj b/tests/src/JIT/Performance/CodeQuality/BenchF/Lorenz/Lorenz.csproj
index 1ab94d40c8..0a309d0b35 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/Lorenz/Lorenz.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/Lorenz/Lorenz.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="Lorenz.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/MatInv4/MatInv4.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/MatInv4/MatInv4.cs
index a00c29b843..02588e18ed 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/MatInv4/MatInv4.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/MatInv4/MatInv4.cs
@@ -8,7 +8,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchF
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/MatInv4/MatInv4.csproj b/tests/src/JIT/Performance/CodeQuality/BenchF/MatInv4/MatInv4.csproj
index 09454d9218..2c43dba6cd 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/MatInv4/MatInv4.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/MatInv4/MatInv4.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="MatInv4.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/NewtE/NewtE.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/NewtE/NewtE.cs
index 47f90d8616..cc698f44dd 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/NewtE/NewtE.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/NewtE/NewtE.cs
@@ -11,7 +11,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchF
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/NewtE/NewtE.csproj b/tests/src/JIT/Performance/CodeQuality/BenchF/NewtE/NewtE.csproj
index 1213cae10a..a0978c2c6a 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/NewtE/NewtE.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/NewtE/NewtE.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="NewtE.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/NewtR/NewtR.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/NewtR/NewtR.cs
index c590f6e570..bfb6546a38 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/NewtR/NewtR.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/NewtR/NewtR.cs
@@ -10,7 +10,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchF
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/NewtR/NewtR.csproj b/tests/src/JIT/Performance/CodeQuality/BenchF/NewtR/NewtR.csproj
index a6f11c0f06..3fffb1b1b8 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/NewtR/NewtR.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/NewtR/NewtR.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="NewtR.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/Regula/Regula.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/Regula/Regula.cs
index 0011288e55..c2978914b2 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/Regula/Regula.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/Regula/Regula.cs
@@ -10,7 +10,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchF
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/Regula/Regula.csproj b/tests/src/JIT/Performance/CodeQuality/BenchF/Regula/Regula.csproj
index 37fa54eda8..b674da9031 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/Regula/Regula.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/Regula/Regula.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="Regula.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/Romber/Romber.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/Romber/Romber.cs
index a4d56f7b0f..1e7c6879ad 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/Romber/Romber.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/Romber/Romber.cs
@@ -10,7 +10,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchF
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/Romber/Romber.csproj b/tests/src/JIT/Performance/CodeQuality/BenchF/Romber/Romber.csproj
index ca2c525458..147ae342a4 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/Romber/Romber.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/Romber/Romber.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="Romber.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/Secant/Secant.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/Secant/Secant.cs
index 060fb5b0a4..9dcc1feb3f 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/Secant/Secant.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/Secant/Secant.cs
@@ -10,7 +10,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchF
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/Secant/Secant.csproj b/tests/src/JIT/Performance/CodeQuality/BenchF/Secant/Secant.csproj
index 27e3773834..9bc41d95aa 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/Secant/Secant.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/Secant/Secant.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="Secant.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/Simpsn/Simpsn.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/Simpsn/Simpsn.cs
index 5b2df292af..34c6c56230 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/Simpsn/Simpsn.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/Simpsn/Simpsn.cs
@@ -10,7 +10,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchF
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/Simpsn/Simpsn.csproj b/tests/src/JIT/Performance/CodeQuality/BenchF/Simpsn/Simpsn.csproj
index d7b09af860..b63153a388 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/Simpsn/Simpsn.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/Simpsn/Simpsn.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="Simpsn.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/SqMtx/SqMtx.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/SqMtx/SqMtx.cs
index b22aad88b7..8ea7556d56 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/SqMtx/SqMtx.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/SqMtx/SqMtx.cs
@@ -9,7 +9,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchF
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/SqMtx/SqMtx.csproj b/tests/src/JIT/Performance/CodeQuality/BenchF/SqMtx/SqMtx.csproj
index 90d780e258..daf711df07 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/SqMtx/SqMtx.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/SqMtx/SqMtx.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="SqMtx.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/Trap/Trap.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/Trap/Trap.cs
index 3a0de102ed..33895ccc0c 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/Trap/Trap.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/Trap/Trap.cs
@@ -10,7 +10,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchF
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/Trap/Trap.csproj b/tests/src/JIT/Performance/CodeQuality/BenchF/Trap/Trap.csproj
index e9f704cf6b..97909f61d0 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/Trap/Trap.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/Trap/Trap.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="Trap.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/Whetsto/Whetsto.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/Whetsto/Whetsto.cs
index ffe3fa5d8b..d72e58789d 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/Whetsto/Whetsto.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/Whetsto/Whetsto.cs
@@ -10,7 +10,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchF
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/Whetsto/Whetsto.csproj b/tests/src/JIT/Performance/CodeQuality/BenchF/Whetsto/Whetsto.csproj
index 02eaf525e9..c08f3ff969 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/Whetsto/Whetsto.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/Whetsto/Whetsto.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="Whetsto.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/8Queens/8Queens.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/8Queens/8Queens.cs
index e641ee0a74..d499441822 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/8Queens/8Queens.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/8Queens/8Queens.cs
@@ -9,7 +9,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchI
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/8Queens/8Queens.csproj b/tests/src/JIT/Performance/CodeQuality/BenchI/8Queens/8Queens.csproj
index a4c3de5674..5db8e820ac 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/8Queens/8Queens.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/8Queens/8Queens.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="8Queens.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/Ackermann/Ackermann.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/Ackermann/Ackermann.cs
index 5bfa196527..5188571c91 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/Ackermann/Ackermann.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/Ackermann/Ackermann.cs
@@ -9,7 +9,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchI
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/Ackermann/Ackermann.csproj b/tests/src/JIT/Performance/CodeQuality/BenchI/Ackermann/Ackermann.csproj
index 8f72e1c87e..08dfa01a1a 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/Ackermann/Ackermann.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/Ackermann/Ackermann.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="Ackermann.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/AddArray/AddArray.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/AddArray/AddArray.cs
index d38e6b4475..16da08250d 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/AddArray/AddArray.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/AddArray/AddArray.cs
@@ -9,7 +9,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchI
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/AddArray/AddArray.csproj b/tests/src/JIT/Performance/CodeQuality/BenchI/AddArray/AddArray.csproj
index ffadd54595..9c260fe837 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/AddArray/AddArray.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/AddArray/AddArray.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="AddArray.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/AddArray2/AddArray2.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/AddArray2/AddArray2.cs
index a6004f0309..3ce1a98f9f 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/AddArray2/AddArray2.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/AddArray2/AddArray2.cs
@@ -9,7 +9,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchI
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/AddArray2/AddArray2.csproj b/tests/src/JIT/Performance/CodeQuality/BenchI/AddArray2/AddArray2.csproj
index 2619b38c0c..265b099233 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/AddArray2/AddArray2.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/AddArray2/AddArray2.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="AddArray2.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/Array1/Array1.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/Array1/Array1.cs
index 780b7ce66f..5e383ace66 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/Array1/Array1.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/Array1/Array1.cs
@@ -16,7 +16,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchI
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/Array1/Array1.csproj b/tests/src/JIT/Performance/CodeQuality/BenchI/Array1/Array1.csproj
index cb1ed7b648..3bbd8afc30 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/Array1/Array1.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/Array1/Array1.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="Array1.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/Array2/Array2.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/Array2/Array2.cs
index dac100c5a7..45a4a9765b 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/Array2/Array2.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/Array2/Array2.cs
@@ -9,7 +9,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchI
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/Array2/Array2.csproj b/tests/src/JIT/Performance/CodeQuality/BenchI/Array2/Array2.csproj
index b368d85bda..9a3f889660 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/Array2/Array2.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/Array2/Array2.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="Array2.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/BenchE/BenchE.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/BenchE/BenchE.cs
index b16c48280b..5d9a7f10cb 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/BenchE/BenchE.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/BenchE/BenchE.cs
@@ -9,7 +9,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchI
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/BenchE/BenchE.csproj b/tests/src/JIT/Performance/CodeQuality/BenchI/BenchE/BenchE.csproj
index 6d58dc402f..05e511d32b 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/BenchE/BenchE.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/BenchE/BenchE.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="BenchE.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/BubbleSort/BubbleSort.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/BubbleSort/BubbleSort.cs
index 558484d3d6..a2fbbcee30 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/BubbleSort/BubbleSort.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/BubbleSort/BubbleSort.cs
@@ -9,7 +9,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchI
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/BubbleSort/BubbleSort.csproj b/tests/src/JIT/Performance/CodeQuality/BenchI/BubbleSort/BubbleSort.csproj
index 776afa72c0..674e4f687a 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/BubbleSort/BubbleSort.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/BubbleSort/BubbleSort.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="BubbleSort.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/BubbleSort2/BubbleSort2.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/BubbleSort2/BubbleSort2.cs
index 8c2e63a954..2dba59a793 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/BubbleSort2/BubbleSort2.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/BubbleSort2/BubbleSort2.cs
@@ -9,7 +9,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchI
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/BubbleSort2/BubbleSort2.csproj b/tests/src/JIT/Performance/CodeQuality/BenchI/BubbleSort2/BubbleSort2.csproj
index 448892e8eb..d5870cd244 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/BubbleSort2/BubbleSort2.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/BubbleSort2/BubbleSort2.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="BubbleSort2.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/CSieve/CSieve.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/CSieve/CSieve.cs
index aca263711d..67544bae59 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/CSieve/CSieve.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/CSieve/CSieve.cs
@@ -10,7 +10,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchI
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/CSieve/CSieve.csproj b/tests/src/JIT/Performance/CodeQuality/BenchI/CSieve/CSieve.csproj
index edbab6006b..85a1aea481 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/CSieve/CSieve.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/CSieve/CSieve.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="CSieve.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/Fib/Fib.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/Fib/Fib.cs
index ee028db20f..3dd897db0f 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/Fib/Fib.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/Fib/Fib.cs
@@ -9,7 +9,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchI
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/Fib/Fib.csproj b/tests/src/JIT/Performance/CodeQuality/BenchI/Fib/Fib.csproj
index ff30f8ccf7..91763f28fa 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/Fib/Fib.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/Fib/Fib.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="Fib.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/HeapSort/HeapSort.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/HeapSort/HeapSort.cs
index 64b5c8f33b..b33087bd8e 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/HeapSort/HeapSort.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/HeapSort/HeapSort.cs
@@ -9,7 +9,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchI
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/HeapSort/HeapSort.csproj b/tests/src/JIT/Performance/CodeQuality/BenchI/HeapSort/HeapSort.csproj
index 270e55060f..7aed611204 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/HeapSort/HeapSort.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/HeapSort/HeapSort.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="HeapSort.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/IniArray/IniArray.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/IniArray/IniArray.cs
index 268af7b779..ff878d6127 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/IniArray/IniArray.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/IniArray/IniArray.cs
@@ -9,7 +9,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchI
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/IniArray/IniArray.csproj b/tests/src/JIT/Performance/CodeQuality/BenchI/IniArray/IniArray.csproj
index bcf7b40d72..15e50078ac 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/IniArray/IniArray.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/IniArray/IniArray.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="IniArray.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/LogicArray/LogicArray.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/LogicArray/LogicArray.cs
index c5b4e3b0d8..c82b1e1e8b 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/LogicArray/LogicArray.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/LogicArray/LogicArray.cs
@@ -9,7 +9,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchI
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/LogicArray/LogicArray.csproj b/tests/src/JIT/Performance/CodeQuality/BenchI/LogicArray/LogicArray.csproj
index 669a0efdd5..3ab835d461 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/LogicArray/LogicArray.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/LogicArray/LogicArray.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="LogicArray.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/Midpoint/Midpoint.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/Midpoint/Midpoint.cs
index 9146874358..f04fa9ff60 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/Midpoint/Midpoint.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/Midpoint/Midpoint.cs
@@ -9,7 +9,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchI
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/Midpoint/Midpoint.csproj b/tests/src/JIT/Performance/CodeQuality/BenchI/Midpoint/Midpoint.csproj
index 666ba47ce2..76d2a5a391 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/Midpoint/Midpoint.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/Midpoint/Midpoint.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="Midpoint.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/MulMatrix/MulMatrix.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/MulMatrix/MulMatrix.cs
index a45c012984..202ed3c052 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/MulMatrix/MulMatrix.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/MulMatrix/MulMatrix.cs
@@ -9,7 +9,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchI
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/MulMatrix/MulMatrix.csproj b/tests/src/JIT/Performance/CodeQuality/BenchI/MulMatrix/MulMatrix.csproj
index 78573f88cc..4c73bd6564 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/MulMatrix/MulMatrix.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/MulMatrix/MulMatrix.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="MulMatrix.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/NDhrystone/NDhrystone.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/NDhrystone/NDhrystone.cs
index 33effcbf40..7a28c97cf7 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/NDhrystone/NDhrystone.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/NDhrystone/NDhrystone.cs
@@ -14,7 +14,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchI
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/NDhrystone/NDhrystone.csproj b/tests/src/JIT/Performance/CodeQuality/BenchI/NDhrystone/NDhrystone.csproj
index 5622ad71d2..b8eb815e06 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/NDhrystone/NDhrystone.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/NDhrystone/NDhrystone.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="NDhrystone.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/Permutate/Permutate.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/Permutate/Permutate.cs
index 43fc28b370..5dda2631b2 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/Permutate/Permutate.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/Permutate/Permutate.cs
@@ -9,7 +9,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchI
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/Permutate/Permutate.csproj b/tests/src/JIT/Performance/CodeQuality/BenchI/Permutate/Permutate.csproj
index 63339c8903..76d7b9ded5 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/Permutate/Permutate.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/Permutate/Permutate.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="Permutate.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/Pi/Pi.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/Pi/Pi.cs
index 2fe0918784..7a6bed7dd7 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/Pi/Pi.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/Pi/Pi.cs
@@ -9,7 +9,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchI
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/Pi/Pi.csproj b/tests/src/JIT/Performance/CodeQuality/BenchI/Pi/Pi.csproj
index 5228f957ba..c2368e0d35 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/Pi/Pi.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/Pi/Pi.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="Pi.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/Puzzle/Puzzle.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/Puzzle/Puzzle.cs
index 2271e02455..220b5c7023 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/Puzzle/Puzzle.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/Puzzle/Puzzle.cs
@@ -9,7 +9,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchI
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/Puzzle/Puzzle.csproj b/tests/src/JIT/Performance/CodeQuality/BenchI/Puzzle/Puzzle.csproj
index ea10a44d83..66d9b49550 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/Puzzle/Puzzle.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/Puzzle/Puzzle.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="Puzzle.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/QuickSort/QuickSort.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/QuickSort/QuickSort.cs
index 7cdac96a69..b5bbc47913 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/QuickSort/QuickSort.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/QuickSort/QuickSort.cs
@@ -9,7 +9,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchI
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/QuickSort/QuickSort.csproj b/tests/src/JIT/Performance/CodeQuality/BenchI/QuickSort/QuickSort.csproj
index f16d1d38b1..87408cd0b4 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/QuickSort/QuickSort.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/QuickSort/QuickSort.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="QuickSort.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/TreeInsert/TreeInsert.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/TreeInsert/TreeInsert.cs
index 2867abc4d4..76d04d607a 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/TreeInsert/TreeInsert.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/TreeInsert/TreeInsert.cs
@@ -9,7 +9,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchI
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/TreeInsert/TreeInsert.csproj b/tests/src/JIT/Performance/CodeQuality/BenchI/TreeInsert/TreeInsert.csproj
index caa2de7720..a768a01d95 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/TreeInsert/TreeInsert.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/TreeInsert/TreeInsert.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="TreeInsert.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/TreeSort/TreeSort.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/TreeSort/TreeSort.cs
index e0971346cf..07c7c29877 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/TreeSort/TreeSort.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/TreeSort/TreeSort.cs
@@ -9,7 +9,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchI
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/TreeSort/TreeSort.csproj b/tests/src/JIT/Performance/CodeQuality/BenchI/TreeSort/TreeSort.csproj
index 9d253e28b4..770b495ac5 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/TreeSort/TreeSort.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/TreeSort/TreeSort.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="TreeSort.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/XposMatrix/XposMatrix.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/XposMatrix/XposMatrix.cs
index de8b486049..47fbf3730a 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/XposMatrix/XposMatrix.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/XposMatrix/XposMatrix.cs
@@ -9,7 +9,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Benchstone.BenchI
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/XposMatrix/XposMatrix.csproj b/tests/src/JIT/Performance/CodeQuality/BenchI/XposMatrix/XposMatrix.csproj
index a234c09352..a18aa8811a 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/XposMatrix/XposMatrix.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/XposMatrix/XposMatrix.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="XposMatrix.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/binarytrees/binarytrees.csharp.cs b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/binarytrees/binarytrees.csharp.cs
index 05dbe94f09..6e44629499 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/binarytrees/binarytrees.csharp.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/binarytrees/binarytrees.csharp.cs
@@ -15,7 +15,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
[assembly: MeasureGCCounts]
namespace BenchmarksGame
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/binarytrees/binarytrees.csharp3.cs b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/binarytrees/binarytrees.csharp3.cs
index 6dcf48a422..0cc239274b 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/binarytrees/binarytrees.csharp3.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/binarytrees/binarytrees.csharp3.cs
@@ -16,7 +16,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
[assembly: MeasureGCCounts]
namespace BenchmarksGame
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/binarytrees/binarytrees.csproj b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/binarytrees/binarytrees.csproj
index 3cbf952833..d10772f2af 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/binarytrees/binarytrees.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/binarytrees/binarytrees.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
<GCStressIncompatible>true</GCStressIncompatible>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
@@ -32,11 +33,9 @@
<ItemGroup>
<Compile Include="binarytrees.csharp.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
- <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
</PropertyGroup>
</Project>
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/binarytrees/binarytrees3.csproj b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/binarytrees/binarytrees3.csproj
index a7c8f2daf3..3dffd5e4bf 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/binarytrees/binarytrees3.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/binarytrees/binarytrees3.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
<GCStressIncompatible>true</GCStressIncompatible>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
@@ -32,11 +33,9 @@
<ItemGroup>
<Compile Include="binarytrees.csharp3.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
- <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
</PropertyGroup>
</Project>
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/fasta/fasta.csharp-2.cs b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/fasta/fasta.csharp-2.cs
index 92fbceb692..3e97d64429 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/fasta/fasta.csharp-2.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/fasta/fasta.csharp-2.cs
@@ -16,7 +16,6 @@ using System.IO;
using System.Text;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace BenchmarksGame
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/fasta/fasta.csproj b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/fasta/fasta.csproj
index 259d5e8ff3..5d5c7f72c6 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/fasta/fasta.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/fasta/fasta.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="fasta.csharp-2.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/fastaredux/fastaredux.csharp.cs b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/fastaredux/fastaredux.csharp.cs
index df8999a2de..c7a786a77e 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/fastaredux/fastaredux.csharp.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/fastaredux/fastaredux.csharp.cs
@@ -16,7 +16,6 @@ using System.IO;
using System.Text;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace BenchmarksGame
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/fastaredux/fastaredux.csproj b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/fastaredux/fastaredux.csproj
index 8d77905de9..30c542ee27 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/fastaredux/fastaredux.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/fastaredux/fastaredux.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="fastaredux.csharp.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/k-nucleotide/k-nucleotide.cs b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/k-nucleotide/k-nucleotide.cs
index 54bd10702c..3325a61926 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/k-nucleotide/k-nucleotide.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/k-nucleotide/k-nucleotide.cs
@@ -2,7 +2,7 @@
http://benchmarksgame.alioth.debian.org/
*
* submitted by Josh Goldfoot
- *
+ *
*/
using System;
@@ -14,7 +14,6 @@ using Microsoft.Xunit.Performance;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
[assembly: MeasureGCCounts]
namespace BenchmarksGame
@@ -24,13 +23,13 @@ public class knucleotide
{
#if DEBUG
const int Iterations = 1;
- const string InputFile = "knucleotide-input.txt";
+ const string InputFile = "knucleotide-input.txt";
static int[] expectedCountLetter = new int[] { 1480, 974, 970, 1576 };
static int[] expectedCountPairs = new int[] { 420, 272, 292, 496, 273, 202, 201, 298, 316, 185, 167, 302, 470, 315, 310, 480 };
static int[] expectedCountFragments = new int[] { 54, 24, 4, 0, 0 };
#else
const int Iterations = 10;
- const string InputFile = "knucleotide-input-big.txt";
+ const string InputFile = "knucleotide-input-big.txt";
static int[] expectedCountLetter = new int[] { 302923, 198136, 197566, 301375 };
static int[] expectedCountPairs = new int[] { 91779, 60030, 59889, 91225, 60096, 39203, 39081, 59756, 59795, 39190, 39023, 59557, 91253, 59713, 59572, 90837 };
static int[] expectedCountFragments = new int[] { 11765, 3572, 380, 7, 7 };
@@ -90,7 +89,7 @@ public class knucleotide
public static int Main(string[] args)
{
int iterations = Iterations;
-
+
string inputFile = FindInput(InputFile);
if (inputFile == null)
{
@@ -258,7 +257,7 @@ public class knucleotide
{
throw new Exception("unable to find input");
}
- foreach (var iteration in Benchmark.Iterations)
+ foreach (var iteration in Benchmark.Iterations)
{
using (iteration.StartMeasurement())
{
@@ -284,7 +283,7 @@ public class knucleotide
{
throw new Exception("unable to find input");
}
- foreach (var iteration in Benchmark.Iterations)
+ foreach (var iteration in Benchmark.Iterations)
{
using (iteration.StartMeasurement())
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/k-nucleotide/k-nucleotide.csproj b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/k-nucleotide/k-nucleotide.csproj
index 097a3a2534..89c8ad5c47 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/k-nucleotide/k-nucleotide.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/k-nucleotide/k-nucleotide.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -39,11 +40,9 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
- <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
</PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/nbody/nbody.csharp-3.cs b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/nbody/nbody.csharp-3.cs
index 2124cf4d9e..60e083ad11 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/nbody/nbody.csharp-3.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/nbody/nbody.csharp-3.cs
@@ -13,7 +13,6 @@ using Microsoft.Xunit.Performance;
using System;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace BenchmarksGame
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/nbody/nbody.csproj b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/nbody/nbody.csproj
index f8c3785f54..be7e66e2a3 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/nbody/nbody.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/nbody/nbody.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="nbody.csharp-3.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/pidigits/pi-digits.cs b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/pidigits/pi-digits.cs
index 7e36f0e424..3c79a89edc 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/pidigits/pi-digits.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/pidigits/pi-digits.cs
@@ -18,7 +18,6 @@ using System.Numerics;
using System.Text;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace BenchmarksGame
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/pidigits/pi-digits.csproj b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/pidigits/pi-digits.csproj
index 7396e3b00f..003871e447 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/pidigits/pi-digits.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/pidigits/pi-digits.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="pi-digits.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/regexdna/regexdna.csharp-6.cs b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/regexdna/regexdna.csharp-6.cs
index 19928012ba..882bfd23f9 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/regexdna/regexdna.csharp-6.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/regexdna/regexdna.csharp-6.cs
@@ -19,7 +19,6 @@ using System.Text.RegularExpressions;
using System.Threading;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace BenchmarksGame
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/regexdna/regexdna.csproj b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/regexdna/regexdna.csproj
index 6f334e9afb..e7b9d42bd0 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/regexdna/regexdna.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/regexdna/regexdna.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -39,11 +40,9 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
- <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
</PropertyGroup>
</Project>
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/revcomp/revcomp.csharp-1.cs b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/revcomp/revcomp.csharp-1.cs
index 4e875742e8..bca63bd00e 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/revcomp/revcomp.csharp-1.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/revcomp/revcomp.csharp-1.cs
@@ -16,7 +16,6 @@ using System.Diagnostics;
using System.IO;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace BenchmarksGame
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/revcomp/revcomp.csproj b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/revcomp/revcomp.csproj
index 69d39df429..00789ed3a5 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/revcomp/revcomp.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/revcomp/revcomp.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -39,11 +40,9 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
- <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
</PropertyGroup>
</Project>
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/spectralnorm/spectralnorm.cs b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/spectralnorm/spectralnorm.cs
index 01eeea07bf..5f2b1aed5f 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/spectralnorm/spectralnorm.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/spectralnorm/spectralnorm.cs
@@ -13,7 +13,6 @@ using Microsoft.Xunit.Performance;
using System;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace BenchmarksGame
{
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/spectralnorm/spectralnorm.csproj b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/spectralnorm/spectralnorm.csproj
index e12feab89a..3cbd6d32db 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/spectralnorm/spectralnorm.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/spectralnorm/spectralnorm.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="spectralnorm.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/Burgers/Burgers.cs b/tests/src/JIT/Performance/CodeQuality/Burgers/Burgers.cs
index 02dafa2dda..9880ee511f 100644
--- a/tests/src/JIT/Performance/CodeQuality/Burgers/Burgers.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Burgers/Burgers.cs
@@ -4,7 +4,7 @@
//
// .NET SIMD to solve Burgers' equation
//
-// Benchmark based on
+// Benchmark based on
// https://github.com/taumuon/SIMD-Vectorisation-Burgers-Equation-CSharp
// http://www.taumuon.co.uk/2014/10/net-simd-to-solve-burgers-equation.html
@@ -15,7 +15,6 @@ using System.Numerics;
using System.Runtime.CompilerServices;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
public class Burgers
{
@@ -192,7 +191,7 @@ public class Burgers
double[] x = linspace(0.0, 2.0 * Math.PI, nx);
double[] initial = GetAnalytical(x, 0.0, nu);
- // Warmup
+ // Warmup
GetCalculated0(1, nx, dx, dt, nu, initial);
GetCalculated1(1, nx, dx, dt, nu, initial);
diff --git a/tests/src/JIT/Performance/CodeQuality/Burgers/Burgers.csproj b/tests/src/JIT/Performance/CodeQuality/Burgers/Burgers.csproj
index 0f57308962..bb0aca7f14 100644
--- a/tests/src/JIT/Performance/CodeQuality/Burgers/Burgers.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/Burgers/Burgers.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="Burgers.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/Bytemark/ByteMark.cs b/tests/src/JIT/Performance/CodeQuality/Bytemark/ByteMark.cs
index 280744bf5b..79e7c5e709 100644
--- a/tests/src/JIT/Performance/CodeQuality/Bytemark/ByteMark.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Bytemark/ByteMark.cs
@@ -3,7 +3,7 @@
// See the LICENSE file in the project root for more information.
/*
** This program was translated to C# and adapted for xunit-performance.
-** New variants of several tests were added to compare class versus
+** New variants of several tests were added to compare class versus
** struct and to compare jagged arrays vs multi-dimensional arrays.
*/
@@ -24,7 +24,7 @@
** are error-free. Consequently, McGraw-HIll and BYTE Magazine make
** no claims in regard to the fitness of the source code, executable
** code, and documentation of the BYTEmark.
-**
+**
** Furthermore, BYTE Magazine, McGraw-Hill, and all employees
** of McGraw-Hill cannot be held responsible for any damages resulting
** from the use of this code or the results obtained from using
@@ -36,7 +36,6 @@ using System;
using System.IO;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
internal class global
{
@@ -1273,7 +1272,7 @@ public class ByteMark
{
using (iteration.StartMeasurement())
{
- for (int i = 0; i < NumericSortJaggedIterations; i++)
+ for (int i = 0; i < NumericSortJaggedIterations; i++)
{
t.Run();
}
@@ -1295,7 +1294,7 @@ public class ByteMark
{
using (iteration.StartMeasurement())
{
- for (int i = 0; i < NumericSortRectangularIterations; i++)
+ for (int i = 0; i < NumericSortRectangularIterations; i++)
{
t.Run();
}
@@ -1317,7 +1316,7 @@ public class ByteMark
{
using (iteration.StartMeasurement())
{
- for (int i = 0; i < StringSortIterations; i++)
+ for (int i = 0; i < StringSortIterations; i++)
{
t.Run();
}
@@ -1338,7 +1337,7 @@ public class ByteMark
{
using (iteration.StartMeasurement())
{
- for (int i = 0; i < BitOpsIterations; i++)
+ for (int i = 0; i < BitOpsIterations; i++)
{
t.Run();
}
@@ -1360,7 +1359,7 @@ public class ByteMark
{
using (iteration.StartMeasurement())
{
- for (int i = 0; i < EmFloatIterations; i++)
+ for (int i = 0; i < EmFloatIterations; i++)
{
t.Run();
}
@@ -1382,7 +1381,7 @@ public class ByteMark
{
using (iteration.StartMeasurement())
{
- for (int i = 0; i < EmFloatClassIterations; i++)
+ for (int i = 0; i < EmFloatClassIterations; i++)
{
t.Run();
}
@@ -1403,7 +1402,7 @@ public class ByteMark
{
using (iteration.StartMeasurement())
{
- for (int i = 0; i < FourierIterations; i++)
+ for (int i = 0; i < FourierIterations; i++)
{
t.Run();
}
@@ -1425,7 +1424,7 @@ public class ByteMark
{
using (iteration.StartMeasurement())
{
- for (int i = 0; i < AssignJaggedIterations; i++)
+ for (int i = 0; i < AssignJaggedIterations; i++)
{
t.Run();
}
@@ -1447,7 +1446,7 @@ public class ByteMark
{
using (iteration.StartMeasurement())
{
- for (int i = 0; i < AssignRectangularIterations; i++)
+ for (int i = 0; i < AssignRectangularIterations; i++)
{
t.Run();
}
@@ -1469,7 +1468,7 @@ public class ByteMark
{
using (iteration.StartMeasurement())
{
- for (int i = 0; i < IDEAEncryptionIterations; i++)
+ for (int i = 0; i < IDEAEncryptionIterations; i++)
{
t.Run();
}
@@ -1491,7 +1490,7 @@ public class ByteMark
{
using (iteration.StartMeasurement())
{
- for (int i = 0; i < NeuralJaggedIterations; i++)
+ for (int i = 0; i < NeuralJaggedIterations; i++)
{
t.Run();
}
@@ -1513,7 +1512,7 @@ public class ByteMark
{
using (iteration.StartMeasurement())
{
- for (int i = 0; i < NeuralIterations; i++)
+ for (int i = 0; i < NeuralIterations; i++)
{
t.Run();
}
@@ -1535,7 +1534,7 @@ public class ByteMark
{
using (iteration.StartMeasurement())
{
- for (int i = 0; i < LUDecompIterations; i++)
+ for (int i = 0; i < LUDecompIterations; i++)
{
t.Run();
}
diff --git a/tests/src/JIT/Performance/CodeQuality/Bytemark/Bytemark.csproj b/tests/src/JIT/Performance/CodeQuality/Bytemark/Bytemark.csproj
index 26a64c6e89..a293c23987 100644
--- a/tests/src/JIT/Performance/CodeQuality/Bytemark/Bytemark.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/Bytemark/Bytemark.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
<GCStressIncompatible>true</GCStressIncompatible>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
@@ -45,10 +46,9 @@
<Compile Include="numericsort.cs" />
<Compile Include="utility.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/FractalPerf/FractalPerf.cs b/tests/src/JIT/Performance/CodeQuality/FractalPerf/FractalPerf.cs
index cbaad45df5..d5761da4c2 100644
--- a/tests/src/JIT/Performance/CodeQuality/FractalPerf/FractalPerf.cs
+++ b/tests/src/JIT/Performance/CodeQuality/FractalPerf/FractalPerf.cs
@@ -13,7 +13,6 @@ using System.Threading.Tasks;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace FractalPerf
{
@@ -103,11 +102,11 @@ namespace FractalPerf
// set the Julia Set constant
complex seed = new complex(Real, Imaginary);
- // run through every point on the screen, setting
+ // run through every point on the screen, setting
// m and n to the coordinates
for (double m = XB; m < XE; m += XS) {
for (double n = YB; n < YE; n += YS) {
- // the initial z value is the current pixel,
+ // the initial z value is the current pixel,
// so x and y have to be set to m and n
complex accum = new complex(m, n);
// perform the iteration
@@ -120,8 +119,8 @@ namespace FractalPerf
accum = accum.square() + seed;
}
// determine the color using the number of
- // iterations it took for the number to become too big
- // char color = num % number_of_colors;
+ // iterations it took for the number to become too big
+ // char color = num % number_of_colors;
// plot the point
result += num;
}
@@ -168,7 +167,7 @@ namespace FractalPerf
}
return result;
}
-
+
public static int Main() {
bool result = TestBase();
return (result ? 100 : -1);
diff --git a/tests/src/JIT/Performance/CodeQuality/FractalPerf/FractalPerf.csproj b/tests/src/JIT/Performance/CodeQuality/FractalPerf/FractalPerf.csproj
index af7ce3b4c9..7bac1f4bdf 100644
--- a/tests/src/JIT/Performance/CodeQuality/FractalPerf/FractalPerf.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/FractalPerf/FractalPerf.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="FractalPerf.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/Inlining/InlineGCStruct.cs b/tests/src/JIT/Performance/CodeQuality/Inlining/InlineGCStruct.cs
index 660627cc72..1439c77dd9 100644
--- a/tests/src/JIT/Performance/CodeQuality/Inlining/InlineGCStruct.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Inlining/InlineGCStruct.cs
@@ -20,7 +20,6 @@ using System.Runtime.CompilerServices;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Inlining
{
diff --git a/tests/src/JIT/Performance/CodeQuality/Inlining/InlineGCStruct.csproj b/tests/src/JIT/Performance/CodeQuality/Inlining/InlineGCStruct.csproj
index 7ecdbab687..7d26fcb734 100644
--- a/tests/src/JIT/Performance/CodeQuality/Inlining/InlineGCStruct.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/Inlining/InlineGCStruct.csproj
@@ -30,11 +30,9 @@
<ItemGroup>
<Compile Include="InlineGCStruct.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
- <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
</PropertyGroup>
</Project>
diff --git a/tests/src/JIT/Performance/CodeQuality/Inlining/NoThrowInline.cs b/tests/src/JIT/Performance/CodeQuality/Inlining/NoThrowInline.cs
index dc05f44b33..f28d4caf81 100644
--- a/tests/src/JIT/Performance/CodeQuality/Inlining/NoThrowInline.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Inlining/NoThrowInline.cs
@@ -11,7 +11,6 @@ using System.Collections.Generic;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Inlining
{
diff --git a/tests/src/JIT/Performance/CodeQuality/Inlining/NoThrowInline.csproj b/tests/src/JIT/Performance/CodeQuality/Inlining/NoThrowInline.csproj
index 34b42c389f..965618d15d 100644
--- a/tests/src/JIT/Performance/CodeQuality/Inlining/NoThrowInline.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/Inlining/NoThrowInline.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -31,11 +32,9 @@
<ItemGroup>
<Compile Include="NoThrowInline.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
- <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
</PropertyGroup>
</Project>
diff --git a/tests/src/JIT/Performance/CodeQuality/Linq/Linq.cs b/tests/src/JIT/Performance/CodeQuality/Linq/Linq.cs
index 58ea46a0c9..2a0fd27890 100644
--- a/tests/src/JIT/Performance/CodeQuality/Linq/Linq.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Linq/Linq.cs
@@ -9,7 +9,6 @@ using System.Collections.Generic;
using System.Linq;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
public class Product
{
diff --git a/tests/src/JIT/Performance/CodeQuality/Linq/Linq.csproj b/tests/src/JIT/Performance/CodeQuality/Linq/Linq.csproj
index 2fc6cb0419..6fac3b034a 100644
--- a/tests/src/JIT/Performance/CodeQuality/Linq/Linq.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/Linq/Linq.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="Linq.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AbsDouble.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AbsDouble.cs
index 6429a39ce4..f5650ab2c7 100644
--- a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AbsDouble.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AbsDouble.cs
@@ -40,7 +40,7 @@ namespace Functions
if (diff > doubleEpsilon)
{
- throw new Exception($"Expected Result {absDoubleExpectedResult}; Actual Result {result}");
+ throw new Exception($"Expected Result {absDoubleExpectedResult,20:g17}; Actual Result {result,20:g17}");
}
}
}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AcosDouble.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AcosDouble.cs
index 3ba2867a8e..4df08bd063 100644
--- a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AcosDouble.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AcosDouble.cs
@@ -40,7 +40,7 @@ namespace Functions
if (diff > doubleEpsilon)
{
- throw new Exception($"Expected Result {acosDoubleExpectedResult}; Actual Result {result}");
+ throw new Exception($"Expected Result {acosDoubleExpectedResult,20:g17}; Actual Result {result,20:g17}");
}
}
}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AsinDouble.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AsinDouble.cs
index 030756ce44..e20b65c422 100644
--- a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AsinDouble.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AsinDouble.cs
@@ -40,7 +40,7 @@ namespace Functions
if (diff > doubleEpsilon)
{
- throw new Exception($"Expected Result {asinDoubleExpectedResult}; Actual Result {result}");
+ throw new Exception($"Expected Result {asinDoubleExpectedResult,20:g17}; Actual Result {result,20:g17}");
}
}
}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/Atan2Double.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/Atan2Double.cs
index 82831e6412..1fcde440af 100644
--- a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/Atan2Double.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/Atan2Double.cs
@@ -41,7 +41,7 @@ namespace Functions
if (diff > doubleEpsilon)
{
- throw new Exception($"Expected Result {atan2DoubleExpectedResult}; Actual Result {result}");
+ throw new Exception($"Expected Result {atan2DoubleExpectedResult,20:g17}; Actual Result {result,20:g17}");
}
}
}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AtanDouble.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AtanDouble.cs
index ec2ebe389e..28619e8527 100644
--- a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AtanDouble.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AtanDouble.cs
@@ -40,7 +40,7 @@ namespace Functions
if (diff > doubleEpsilon)
{
- throw new Exception($"Expected Result {atanDoubleExpectedResult}; Actual Result {result}");
+ throw new Exception($"Expected Result {atanDoubleExpectedResult,20:g17}; Actual Result {result,20:g17}");
}
}
}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/CeilingDouble.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/CeilingDouble.cs
index f822aae256..e28e9e67a5 100644
--- a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/CeilingDouble.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/CeilingDouble.cs
@@ -40,7 +40,7 @@ namespace Functions
if (diff > doubleEpsilon)
{
- throw new Exception($"Expected Result {ceilingDoubleExpectedResult}; Actual Result {result}");
+ throw new Exception($"Expected Result {ceilingDoubleExpectedResult,20:g17}; Actual Result {result,20:g17}");
}
}
}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/CosDouble.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/CosDouble.cs
index e95ab5c241..faf69b0439 100644
--- a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/CosDouble.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/CosDouble.cs
@@ -40,7 +40,7 @@ namespace Functions
if (diff > doubleEpsilon)
{
- throw new Exception($"Expected Result {cosDoubleExpectedResult}; Actual Result {result}");
+ throw new Exception($"Expected Result {cosDoubleExpectedResult,20:g17}; Actual Result {result,20:g17}");
}
}
}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/CoshDouble.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/CoshDouble.cs
index c8b7fb68cc..3a7e36d107 100644
--- a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/CoshDouble.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/CoshDouble.cs
@@ -40,7 +40,7 @@ namespace Functions
if (diff > doubleEpsilon)
{
- throw new Exception($"Expected Result {coshDoubleExpectedResult}; Actual Result {result}");
+ throw new Exception($"Expected Result {coshDoubleExpectedResult,20:g17}; Actual Result {result,20:g17}");
}
}
}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/ExpDouble.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/ExpDouble.cs
index 64be83972f..9af1cb8e8b 100644
--- a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/ExpDouble.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/ExpDouble.cs
@@ -40,7 +40,7 @@ namespace Functions
if (diff > doubleEpsilon)
{
- throw new Exception($"Expected Result {expDoubleExpectedResult}; Actual Result {result}");
+ throw new Exception($"Expected Result {expDoubleExpectedResult,20:g17}; Actual Result {result,20:g17}");
}
}
}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/FloorDouble.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/FloorDouble.cs
index 4d4b4f2f1b..158cc490df 100644
--- a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/FloorDouble.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/FloorDouble.cs
@@ -40,7 +40,7 @@ namespace Functions
if (diff > doubleEpsilon)
{
- throw new Exception($"Expected Result {floorDoubleExpectedResult}; Actual Result {result}");
+ throw new Exception($"Expected Result {floorDoubleExpectedResult,20:g17}; Actual Result {result,20:g17}");
}
}
}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/Log10Double.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/Log10Double.cs
index 330d8a726b..32cd2163a5 100644
--- a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/Log10Double.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/Log10Double.cs
@@ -40,7 +40,7 @@ namespace Functions
if (diff > doubleEpsilon)
{
- throw new Exception($"Expected Result {log10DoubleExpectedResult}; Actual Result {result}");
+ throw new Exception($"Expected Result {log10DoubleExpectedResult,20:g17}; Actual Result {result,20:g17}");
}
}
}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/LogDouble.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/LogDouble.cs
index bddb84b59c..38edbfbbd9 100644
--- a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/LogDouble.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/LogDouble.cs
@@ -40,7 +40,7 @@ namespace Functions
if (diff > doubleEpsilon)
{
- throw new Exception($"Expected Result {logDoubleExpectedResult}; Actual Result {result}");
+ throw new Exception($"Expected Result {logDoubleExpectedResult,20:g17}; Actual Result {result,20:g17}");
}
}
}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/PowDouble.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/PowDouble.cs
index c8248072b7..f36d84e179 100644
--- a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/PowDouble.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/PowDouble.cs
@@ -41,7 +41,7 @@ namespace Functions
if (diff > doubleEpsilon)
{
- throw new Exception($"Expected Result {powDoubleExpectedResult}; Actual Result {result}");
+ throw new Exception($"Expected Result {powDoubleExpectedResult,20:g17}; Actual Result {result,20:g17}");
}
}
}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/RoundDouble.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/RoundDouble.cs
index 9c5dcc9141..6c7a46992a 100644
--- a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/RoundDouble.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/RoundDouble.cs
@@ -40,7 +40,7 @@ namespace Functions
if (diff > doubleEpsilon)
{
- throw new Exception($"Expected Result {roundDoubleExpectedResult}; Actual Result {result}");
+ throw new Exception($"Expected Result {roundDoubleExpectedResult,20:g17}; Actual Result {result,20:g17}");
}
}
}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/SinDouble.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/SinDouble.cs
index 73886aaa3a..c684b9530b 100644
--- a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/SinDouble.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/SinDouble.cs
@@ -40,7 +40,7 @@ namespace Functions
if (diff > doubleEpsilon)
{
- throw new Exception($"Expected Result {sinDoubleExpectedResult}; Actual Result {result}");
+ throw new Exception($"Expected Result {sinDoubleExpectedResult,20:g17}; Actual Result {result,20:g17}");
}
}
}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/SinhDouble.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/SinhDouble.cs
index 8f79cc9576..69d1cb80da 100644
--- a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/SinhDouble.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/SinhDouble.cs
@@ -40,7 +40,7 @@ namespace Functions
if (diff > doubleEpsilon)
{
- throw new Exception($"Expected Result {sinhDoubleExpectedResult}; Actual Result {result}");
+ throw new Exception($"Expected Result {sinhDoubleExpectedResult,20:g17}; Actual Result {result,20:g17}");
}
}
}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/SqrtDouble.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/SqrtDouble.cs
index 5d9e554684..59e73b3fcb 100644
--- a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/SqrtDouble.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/SqrtDouble.cs
@@ -40,7 +40,7 @@ namespace Functions
if (diff > doubleEpsilon)
{
- throw new Exception($"Expected Result {sqrtDoubleExpectedResult}; Actual Result {result}");
+ throw new Exception($"Expected Result {sqrtDoubleExpectedResult,20:g17}; Actual Result {result,20:g17}");
}
}
}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/TanDouble.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/TanDouble.cs
index 6988c675dc..123948419f 100644
--- a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/TanDouble.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/TanDouble.cs
@@ -40,7 +40,7 @@ namespace Functions
if (diff > doubleEpsilon)
{
- throw new Exception($"Expected Result {tanDoubleExpectedResult}; Actual Result {result}");
+ throw new Exception($"Expected Result {tanDoubleExpectedResult,20:g17}; Actual Result {result,20:g17}");
}
}
}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/TanhDouble.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/TanhDouble.cs
index c4809e53a3..526a428069 100644
--- a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/TanhDouble.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/TanhDouble.cs
@@ -40,7 +40,7 @@ namespace Functions
if (diff > doubleEpsilon)
{
- throw new Exception($"Expected Result {tanhDoubleExpectedResult}; Actual Result {result}");
+ throw new Exception($"Expected Result {tanhDoubleExpectedResult,20:g17}; Actual Result {result,20:g17}");
}
}
}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Functions.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Functions.cs
index 8ddc6ad73b..aff91ba844 100644
--- a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Functions.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Functions.cs
@@ -8,7 +8,6 @@ using System.Diagnostics;
using Microsoft.Xunit.Performance;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Functions
{
@@ -24,23 +23,41 @@ namespace Functions
["absdouble"] = MathTests.AbsDoubleTest,
["abssingle"] = MathTests.AbsSingleTest,
["acosdouble"] = MathTests.AcosDoubleTest,
+ ["acossingle"] = MathTests.AcosSingleTest,
["asindouble"] = MathTests.AsinDoubleTest,
+ ["asinsingle"] = MathTests.AsinSingleTest,
["atandouble"] = MathTests.AtanDoubleTest,
+ ["atansingle"] = MathTests.AtanSingleTest,
["atan2double"] = MathTests.Atan2DoubleTest,
+ ["atan2single"] = MathTests.Atan2SingleTest,
["ceilingdouble"] = MathTests.CeilingDoubleTest,
+ ["ceilingsingle"] = MathTests.CeilingSingleTest,
["cosdouble"] = MathTests.CosDoubleTest,
+ ["cossingle"] = MathTests.CosSingleTest,
["coshdouble"] = MathTests.CoshDoubleTest,
+ ["coshsingle"] = MathTests.CoshSingleTest,
["expdouble"] = MathTests.ExpDoubleTest,
+ ["expsingle"] = MathTests.ExpSingleTest,
["floordouble"] = MathTests.FloorDoubleTest,
+ ["floorsingle"] = MathTests.FloorSingleTest,
["logdouble"] = MathTests.LogDoubleTest,
+ ["logsingle"] = MathTests.LogSingleTest,
["log10double"] = MathTests.Log10DoubleTest,
+ ["log10single"] = MathTests.Log10SingleTest,
["powdouble"] = MathTests.PowDoubleTest,
+ ["powsingle"] = MathTests.PowSingleTest,
["rounddouble"] = MathTests.RoundDoubleTest,
+ ["roundsingle"] = MathTests.RoundSingleTest,
["sindouble"] = MathTests.SinDoubleTest,
+ ["sinsingle"] = MathTests.SinSingleTest,
["sinhdouble"] = MathTests.SinhDoubleTest,
+ ["sinhsingle"] = MathTests.SinhSingleTest,
["sqrtdouble"] = MathTests.SqrtDoubleTest,
+ ["sqrtsingle"] = MathTests.SqrtSingleTest,
["tandouble"] = MathTests.TanDoubleTest,
- ["tanhdouble"] = MathTests.TanhDoubleTest
+ ["tansingle"] = MathTests.TanSingleTest,
+ ["tanhdouble"] = MathTests.TanhDoubleTest,
+ ["tanhsingle"] = MathTests.TanhSingleTest
};
private static int Main(string[] args)
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Functions.csproj b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Functions.csproj
index 773472d4a4..067ea9f7e0 100644
--- a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Functions.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Functions.csproj
@@ -9,7 +9,8 @@
<OutputType>Exe</OutputType>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
- <NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMoniker>.NETCoreApp,Version=v1.1</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netcoreapp1.1</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -29,8 +30,9 @@
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<ItemGroup>
+ <Compile Include="Functions.cs" />
+ <Compile Include="MathTests.cs" />
<Compile Include="Double\AbsDouble.cs" />
- <Compile Include="Single\AbsSingle.cs" />
<Compile Include="Double\AcosDouble.cs" />
<Compile Include="Double\AsinDouble.cs" />
<Compile Include="Double\AtanDouble.cs" />
@@ -40,10 +42,8 @@
<Compile Include="Double\CoshDouble.cs" />
<Compile Include="Double\ExpDouble.cs" />
<Compile Include="Double\FloorDouble.cs" />
- <Compile Include="Functions.cs" />
<Compile Include="Double\LogDouble.cs" />
<Compile Include="Double\Log10Double.cs" />
- <Compile Include="MathTests.cs" />
<Compile Include="Double\PowDouble.cs" />
<Compile Include="Double\RoundDouble.cs" />
<Compile Include="Double\SinDouble.cs" />
@@ -51,12 +51,27 @@
<Compile Include="Double\SqrtDouble.cs" />
<Compile Include="Double\TanDouble.cs" />
<Compile Include="Double\TanhDouble.cs" />
+ <Compile Include="Single\AbsSingle.cs" />
+ <Compile Include="Single\AcosSingle.cs" />
+ <Compile Include="Single\AsinSingle.cs" />
+ <Compile Include="Single\AtanSingle.cs" />
+ <Compile Include="Single\Atan2Single.cs" />
+ <Compile Include="Single\CeilingSingle.cs" />
+ <Compile Include="Single\CosSingle.cs" />
+ <Compile Include="Single\CoshSingle.cs" />
+ <Compile Include="Single\ExpSingle.cs" />
+ <Compile Include="Single\FloorSingle.cs" />
+ <Compile Include="Single\LogSingle.cs" />
+ <Compile Include="Single\Log10Single.cs" />
+ <Compile Include="Single\PowSingle.cs" />
+ <Compile Include="Single\RoundSingle.cs" />
+ <Compile Include="Single\SinSingle.cs" />
+ <Compile Include="Single\SinhSingle.cs" />
+ <Compile Include="Single\SqrtSingle.cs" />
+ <Compile Include="Single\TanSingle.cs" />
+ <Compile Include="Single\TanhSingle.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
</PropertyGroup>
-</Project>
+</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/AbsSingle.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/AbsSingle.cs
index 6168991297..8100c37e1d 100644
--- a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/AbsSingle.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/AbsSingle.cs
@@ -40,7 +40,7 @@ namespace Functions
if (diff > singleEpsilon)
{
- throw new Exception($"Expected Result {absSingleExpectedResult}; Actual Result {result}");
+ throw new Exception($"Expected Result {absSingleExpectedResult,10:g9}; Actual Result {result,10:g9}");
}
}
}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/AcosSingle.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/AcosSingle.cs
new file mode 100644
index 0000000000..b958cc1bb4
--- /dev/null
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/AcosSingle.cs
@@ -0,0 +1,47 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using Microsoft.Xunit.Performance;
+
+namespace Functions
+{
+ public static partial class MathTests
+ {
+ // Tests MathF.Acos(float) over 5000 iterations for the domain -1, +1
+
+ private const float acosSingleDelta = 0.0004f;
+ private const float acosSingleExpectedResult = 7852.41084f;
+
+ [Benchmark]
+ public static void AcosSingleBenchmark()
+ {
+ foreach (var iteration in Benchmark.Iterations)
+ {
+ using (iteration.StartMeasurement())
+ {
+ AcosSingleTest();
+ }
+ }
+ }
+
+ public static void AcosSingleTest()
+ {
+ var result = 0.0f; var value = -1.0f;
+
+ for (var iteration = 0; iteration < iterations; iteration++)
+ {
+ value += acosSingleDelta;
+ result += MathF.Acos(value);
+ }
+
+ var diff = MathF.Abs(acosSingleExpectedResult - result);
+
+ if (diff > singleEpsilon)
+ {
+ throw new Exception($"Expected Result {acosSingleExpectedResult,10:g9}; Actual Result {result,10:g9}");
+ }
+ }
+ }
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/AsinSingle.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/AsinSingle.cs
new file mode 100644
index 0000000000..917c49288f
--- /dev/null
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/AsinSingle.cs
@@ -0,0 +1,47 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using Microsoft.Xunit.Performance;
+
+namespace Functions
+{
+ public static partial class MathTests
+ {
+ // Tests MathF.Asin(float) over 5000 iterations for the domain -1, +1
+
+ private const float asinSingleDelta = 0.0004f;
+ private const float asinSingleExpectedResult = 1.57079590f;
+
+ [Benchmark]
+ public static void AsinSingleBenchmark()
+ {
+ foreach (var iteration in Benchmark.Iterations)
+ {
+ using (iteration.StartMeasurement())
+ {
+ AsinSingleTest();
+ }
+ }
+ }
+
+ public static void AsinSingleTest()
+ {
+ var result = 0.0f; var value = -1.0f;
+
+ for (var iteration = 0; iteration < iterations; iteration++)
+ {
+ value += asinSingleDelta;
+ result += MathF.Asin(value);
+ }
+
+ var diff = MathF.Abs(asinSingleExpectedResult - result);
+
+ if (diff > singleEpsilon)
+ {
+ throw new Exception($"Expected Result {asinSingleExpectedResult,10:g9}; Actual Result {result,10:g9}");
+ }
+ }
+ }
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/Atan2Single.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/Atan2Single.cs
new file mode 100644
index 0000000000..a3a4577947
--- /dev/null
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/Atan2Single.cs
@@ -0,0 +1,48 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using Microsoft.Xunit.Performance;
+
+namespace Functions
+{
+ public static partial class MathTests
+ {
+ // Tests MathF.Atan2(float, float) over 5000 iterations for the domain y: -1, +1; x: +1, -1
+
+ private const float atan2SingleDeltaX = -0.0004f;
+ private const float atan2SingleDeltaY = 0.0004f;
+ private const float atan2SingleExpectedResult = 3930.14282f;
+
+ [Benchmark]
+ public static void Atan2SingleBenchmark()
+ {
+ foreach (var iteration in Benchmark.Iterations)
+ {
+ using (iteration.StartMeasurement())
+ {
+ Atan2SingleTest();
+ }
+ }
+ }
+
+ public static void Atan2SingleTest()
+ {
+ var result = 0.0f; var valueX = 1.0f; var valueY = -1.0f;
+
+ for (var iteration = 0; iteration < iterations; iteration++)
+ {
+ valueX += atan2SingleDeltaX; valueY += atan2SingleDeltaY;
+ result += MathF.Atan2(valueY, valueX);
+ }
+
+ var diff = MathF.Abs(atan2SingleExpectedResult - result);
+
+ if (diff > singleEpsilon)
+ {
+ throw new Exception($"Expected Result {atan2SingleExpectedResult,10:g9}; Actual Result {result,10:g9}");
+ }
+ }
+ }
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/AtanSingle.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/AtanSingle.cs
new file mode 100644
index 0000000000..95cc0e226e
--- /dev/null
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/AtanSingle.cs
@@ -0,0 +1,47 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using Microsoft.Xunit.Performance;
+
+namespace Functions
+{
+ public static partial class MathTests
+ {
+ // Tests MathF.Atan(float) over 5000 iterations for the domain -1, +1
+
+ private const float atanSingleDelta = 0.0004f;
+ private const float atanSingleExpectedResult = 0.841940999f;
+
+ [Benchmark]
+ public static void AtanSingleBenchmark()
+ {
+ foreach (var iteration in Benchmark.Iterations)
+ {
+ using (iteration.StartMeasurement())
+ {
+ AtanSingleTest();
+ }
+ }
+ }
+
+ public static void AtanSingleTest()
+ {
+ var result = 0.0f; var value = -1.0f;
+
+ for (var iteration = 0; iteration < iterations; iteration++)
+ {
+ value += atanSingleDelta;
+ result += MathF.Atan(value);
+ }
+
+ var diff = MathF.Abs(atanSingleExpectedResult - result);
+
+ if (diff > singleEpsilon)
+ {
+ throw new Exception($"Expected Result {atanSingleExpectedResult,10:g9}; Actual Result {result,10:g9}");
+ }
+ }
+ }
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/CeilingSingle.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/CeilingSingle.cs
new file mode 100644
index 0000000000..85454f1cc8
--- /dev/null
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/CeilingSingle.cs
@@ -0,0 +1,47 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using Microsoft.Xunit.Performance;
+
+namespace Functions
+{
+ public static partial class MathTests
+ {
+ // Tests MathF.Ceiling(float) over 5000 iterations for the domain -1, +1
+
+ private const float ceilingSingleDelta = 0.0004f;
+ private const float ceilingSingleExpectedResult = 2502.0f;
+
+ [Benchmark]
+ public static void CeilingSingleBenchmark()
+ {
+ foreach (var iteration in Benchmark.Iterations)
+ {
+ using (iteration.StartMeasurement())
+ {
+ CeilingSingleTest();
+ }
+ }
+ }
+
+ public static void CeilingSingleTest()
+ {
+ var result = 0.0f; var value = -1.0f;
+
+ for (var iteration = 0; iteration < iterations; iteration++)
+ {
+ value += ceilingSingleDelta;
+ result += MathF.Ceiling(value);
+ }
+
+ var diff = MathF.Abs(ceilingSingleExpectedResult - result);
+
+ if (diff > singleEpsilon)
+ {
+ throw new Exception($"Expected Result {ceilingSingleExpectedResult,10:g9}; Actual Result {result,10:g9}");
+ }
+ }
+ }
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/CosSingle.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/CosSingle.cs
new file mode 100644
index 0000000000..3d1d6a3b58
--- /dev/null
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/CosSingle.cs
@@ -0,0 +1,47 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using Microsoft.Xunit.Performance;
+
+namespace Functions
+{
+ public static partial class MathTests
+ {
+ // Tests MathF.Cos(float) over 5000 iterations for the domain 0, PI
+
+ private const float cosSingleDelta = 0.000628318531f;
+ private const float cosSingleExpectedResult = -0.993487537f;
+
+ [Benchmark]
+ public static void CosSingleBenchmark()
+ {
+ foreach (var iteration in Benchmark.Iterations)
+ {
+ using (iteration.StartMeasurement())
+ {
+ CosSingleTest();
+ }
+ }
+ }
+
+ public static void CosSingleTest()
+ {
+ var result = 0.0f; var value = 0.0f;
+
+ for (var iteration = 0; iteration < iterations; iteration++)
+ {
+ value += cosSingleDelta;
+ result += MathF.Cos(value);
+ }
+
+ var diff = MathF.Abs(cosSingleExpectedResult - result);
+
+ if (diff > singleEpsilon)
+ {
+ throw new Exception($"Expected Result {cosSingleExpectedResult,10:g9}; Actual Result {result,10:g9}");
+ }
+ }
+ }
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/CoshSingle.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/CoshSingle.cs
new file mode 100644
index 0000000000..072a0dcf66
--- /dev/null
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/CoshSingle.cs
@@ -0,0 +1,47 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using Microsoft.Xunit.Performance;
+
+namespace Functions
+{
+ public static partial class MathTests
+ {
+ // Tests MathF.Cosh(float) over 5000 iterations for the domain -1, +1
+
+ private const float coshSingleDelta = 0.0004f;
+ private const float coshSingleExpectedResult = 5876.02588f;
+
+ [Benchmark]
+ public static void CoshSingleBenchmark()
+ {
+ foreach (var iteration in Benchmark.Iterations)
+ {
+ using (iteration.StartMeasurement())
+ {
+ CoshSingleTest();
+ }
+ }
+ }
+
+ public static void CoshSingleTest()
+ {
+ var result = 0.0f; var value = -1.0f;
+
+ for (var iteration = 0; iteration < iterations; iteration++)
+ {
+ value += coshSingleDelta;
+ result += MathF.Cosh(value);
+ }
+
+ var diff = MathF.Abs(coshSingleExpectedResult - result);
+
+ if (diff > singleEpsilon)
+ {
+ throw new Exception($"Expected Result {coshSingleExpectedResult,10:g9}; Actual Result {result,10:g9}");
+ }
+ }
+ }
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/ExpSingle.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/ExpSingle.cs
new file mode 100644
index 0000000000..e9d61c9f5d
--- /dev/null
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/ExpSingle.cs
@@ -0,0 +1,47 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using Microsoft.Xunit.Performance;
+
+namespace Functions
+{
+ public static partial class MathTests
+ {
+ // Tests MathF.Exp(float) over 5000 iterations for the domain -1, +1
+
+ private const float expSingleDelta = 0.0004f;
+ private const float expSingleExpectedResult = 5877.28564f;
+
+ [Benchmark]
+ public static void ExpSingleBenchmark()
+ {
+ foreach (var iteration in Benchmark.Iterations)
+ {
+ using (iteration.StartMeasurement())
+ {
+ ExpSingleTest();
+ }
+ }
+ }
+
+ public static void ExpSingleTest()
+ {
+ var result = 0.0f; var value = -1.0f;
+
+ for (var iteration = 0; iteration < iterations; iteration++)
+ {
+ value += expSingleDelta;
+ result += MathF.Exp(value);
+ }
+
+ var diff = MathF.Abs(expSingleExpectedResult - result);
+
+ if (diff > singleEpsilon)
+ {
+ throw new Exception($"Expected Result {expSingleExpectedResult,10:g9}; Actual Result {result,10:g9}");
+ }
+ }
+ }
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/FloorSingle.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/FloorSingle.cs
new file mode 100644
index 0000000000..ce1febb178
--- /dev/null
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/FloorSingle.cs
@@ -0,0 +1,47 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using Microsoft.Xunit.Performance;
+
+namespace Functions
+{
+ public static partial class MathTests
+ {
+ // Tests MathF.Floor(float) over 5000 iterations for the domain -1, +1
+
+ private const float floorSingleDelta = 0.0004f;
+ private const float floorSingleExpectedResult = -2498.0f;
+
+ [Benchmark]
+ public static void FloorSingleBenchmark()
+ {
+ foreach (var iteration in Benchmark.Iterations)
+ {
+ using (iteration.StartMeasurement())
+ {
+ FloorSingleTest();
+ }
+ }
+ }
+
+ public static void FloorSingleTest()
+ {
+ var result = 0.0f; var value = -1.0f;
+
+ for (var iteration = 0; iteration < iterations; iteration++)
+ {
+ value += floorSingleDelta;
+ result += MathF.Floor(value);
+ }
+
+ var diff = MathF.Abs(floorSingleExpectedResult - result);
+
+ if (diff > singleEpsilon)
+ {
+ throw new Exception($"Expected Result {floorSingleExpectedResult,10:g9}; Actual Result {result,10:g9}");
+ }
+ }
+ }
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/Log10Single.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/Log10Single.cs
new file mode 100644
index 0000000000..80f00b3ec8
--- /dev/null
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/Log10Single.cs
@@ -0,0 +1,47 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using Microsoft.Xunit.Performance;
+
+namespace Functions
+{
+ public static partial class MathTests
+ {
+ // Tests MathF.Log10(float) over 5000 iterations for the domain -1, +1
+
+ private const float log10SingleDelta = 0.0004f;
+ private const float log10SingleExpectedResult = -664.094971f;
+
+ [Benchmark]
+ public static void Log10SingleBenchmark()
+ {
+ foreach (var iteration in Benchmark.Iterations)
+ {
+ using (iteration.StartMeasurement())
+ {
+ Log10SingleTest();
+ }
+ }
+ }
+
+ public static void Log10SingleTest()
+ {
+ var result = 0.0f; var value = 0.0f;
+
+ for (var iteration = 0; iteration < iterations; iteration++)
+ {
+ value += log10SingleDelta;
+ result += MathF.Log10(value);
+ }
+
+ var diff = MathF.Abs(log10SingleExpectedResult - result);
+
+ if (diff > singleEpsilon)
+ {
+ throw new Exception($"Expected Result {log10SingleExpectedResult,10:g9}; Actual Result {result,10:g9}");
+ }
+ }
+ }
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/LogSingle.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/LogSingle.cs
new file mode 100644
index 0000000000..3f07ef16ab
--- /dev/null
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/LogSingle.cs
@@ -0,0 +1,48 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using Microsoft.Xunit.Performance;
+
+namespace Functions
+{
+ public static partial class MathTests
+ {
+ // Tests MathF.Log(float) over 5000 iterations for the domain -1, +1
+
+ private const float logSingleDelta = 0.0004f;
+ private const float logSingleExpectedResult = -1529.14014f;
+
+ [Benchmark]
+ public static void LogSingleBenchmark()
+ {
+ foreach (var iteration in Benchmark.Iterations)
+ {
+ using (iteration.StartMeasurement())
+ {
+ LogSingleTest();
+ }
+ }
+ }
+
+ public static void LogSingleTest()
+ {
+ var result = 0.0f; var value = 0.0f;
+
+ for (var iteration = 0; iteration < iterations; iteration++)
+ {
+ value += logSingleDelta;
+ result += MathF.Log(value);
+ }
+
+ var diff = MathF.Abs(logSingleExpectedResult - result);
+
+ if (diff > singleEpsilon)
+ {
+ throw new Exception($"Expected Result {logSingleExpectedResult,10:g9}; Actual Result {result,10:g9}");
+ }
+ }
+ }
+
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/PowSingle.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/PowSingle.cs
new file mode 100644
index 0000000000..49de8a0101
--- /dev/null
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/PowSingle.cs
@@ -0,0 +1,48 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using Microsoft.Xunit.Performance;
+
+namespace Functions
+{
+ public static partial class MathTests
+ {
+ // Tests MathF.Pow(float, float) over 5000 iterations for the domain x: +2, +1; y: -2, -1
+
+ private const float powSingleDeltaX = -0.0004f;
+ private const float powSingleDeltaY = 0.0004f;
+ private const float powSingleExpectedResult = 4659.30762f;
+
+ [Benchmark]
+ public static void PowSingleBenchmark()
+ {
+ foreach (var iteration in Benchmark.Iterations)
+ {
+ using (iteration.StartMeasurement())
+ {
+ PowSingleTest();
+ }
+ }
+ }
+
+ public static void PowSingleTest()
+ {
+ var result = 0.0f; var valueX = 2.0f; var valueY = -2.0f;
+
+ for (var iteration = 0; iteration < iterations; iteration++)
+ {
+ valueX += powSingleDeltaX; valueY += powSingleDeltaY;
+ result += MathF.Pow(valueX, valueY);
+ }
+
+ var diff = MathF.Abs(powSingleExpectedResult - result);
+
+ if (diff > singleEpsilon)
+ {
+ throw new Exception($"Expected Result {powSingleExpectedResult,10:g9}; Actual Result {result,10:g9}");
+ }
+ }
+ }
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/RoundSingle.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/RoundSingle.cs
new file mode 100644
index 0000000000..b494a2a985
--- /dev/null
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/RoundSingle.cs
@@ -0,0 +1,47 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using Microsoft.Xunit.Performance;
+
+namespace Functions
+{
+ public static partial class MathTests
+ {
+ // Tests MathF.Round(float) over 5000 iterations for the domain -PI/2, +PI/2
+
+ private const float roundSingleDelta = 0.000628318531f;
+ private const float roundSingleExpectedResult = 2.0f;
+
+ [Benchmark]
+ public static void RoundSingleBenchmark()
+ {
+ foreach (var iteration in Benchmark.Iterations)
+ {
+ using (iteration.StartMeasurement())
+ {
+ RoundSingleTest();
+ }
+ }
+ }
+
+ public static void RoundSingleTest()
+ {
+ var result = 0.0f; var value = -1.57079633f;
+
+ for (var iteration = 0; iteration < iterations; iteration++)
+ {
+ value += roundSingleDelta;
+ result += MathF.Round(value);
+ }
+
+ var diff = MathF.Abs(roundSingleExpectedResult - result);
+
+ if (diff > singleEpsilon)
+ {
+ throw new Exception($"Expected Result {roundSingleExpectedResult,10:g9}; Actual Result {result,10:g9}");
+ }
+ }
+ }
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/SinSingle.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/SinSingle.cs
new file mode 100644
index 0000000000..4d6228361e
--- /dev/null
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/SinSingle.cs
@@ -0,0 +1,47 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using Microsoft.Xunit.Performance;
+
+namespace Functions
+{
+ public static partial class MathTests
+ {
+ // Tests MathF.Sin(float) over 5000 iterations for the domain -PI/2, +PI/2
+
+ private const float sinSingleDelta = 0.000628318531f;
+ private const float sinSingleExpectedResult = 1.03592682f;
+
+ [Benchmark]
+ public static void SinSingleBenchmark()
+ {
+ foreach (var iteration in Benchmark.Iterations)
+ {
+ using (iteration.StartMeasurement())
+ {
+ SinSingleTest();
+ }
+ }
+ }
+
+ public static void SinSingleTest()
+ {
+ var result = 0.0f; var value = -1.57079633f;
+
+ for (var iteration = 0; iteration < iterations; iteration++)
+ {
+ value += sinSingleDelta;
+ result += MathF.Sin(value);
+ }
+
+ var diff = MathF.Abs(sinSingleExpectedResult - result);
+
+ if (diff > singleEpsilon)
+ {
+ throw new Exception($"Expected Result {sinSingleExpectedResult,10:g9}; Actual Result {result,10:g9}");
+ }
+ }
+ }
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/SinhSingle.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/SinhSingle.cs
new file mode 100644
index 0000000000..9ed01e4f55
--- /dev/null
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/SinhSingle.cs
@@ -0,0 +1,47 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using Microsoft.Xunit.Performance;
+
+namespace Functions
+{
+ public static partial class MathTests
+ {
+ // Tests MathF.Sinh(float) over 5000 iterations for the domain -1, +1
+
+ private const float sinhSingleDelta = 0.0004f;
+ private const float sinhSingleExpectedResult = 1.26028216f;
+
+ [Benchmark]
+ public static void SinhSingleBenchmark()
+ {
+ foreach (var iteration in Benchmark.Iterations)
+ {
+ using (iteration.StartMeasurement())
+ {
+ SinhSingleTest();
+ }
+ }
+ }
+
+ public static void SinhSingleTest()
+ {
+ var result = 0.0f; var value = -1.0f;
+
+ for (var iteration = 0; iteration < iterations; iteration++)
+ {
+ value += sinhSingleDelta;
+ result += MathF.Sinh(value);
+ }
+
+ var diff = MathF.Abs(sinhSingleExpectedResult - result);
+
+ if (diff > singleEpsilon)
+ {
+ throw new Exception($"Expected Result {sinhSingleExpectedResult,10:g9}; Actual Result {result,10:g9}");
+ }
+ }
+ }
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/SqrtSingle.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/SqrtSingle.cs
new file mode 100644
index 0000000000..f7349c1a5f
--- /dev/null
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/SqrtSingle.cs
@@ -0,0 +1,47 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using Microsoft.Xunit.Performance;
+
+namespace Functions
+{
+ public static partial class MathTests
+ {
+ // Tests MathF.Sqrt(float) over 5000 iterations for the domain 0, PI
+
+ private const float sqrtSingleDelta = 0.000628318531f;
+ private const float sqrtSingleExpectedResult = 5909.03027f;
+
+ [Benchmark]
+ public static void SqrtSingleBenchmark()
+ {
+ foreach (var iteration in Benchmark.Iterations)
+ {
+ using (iteration.StartMeasurement())
+ {
+ SqrtSingleTest();
+ }
+ }
+ }
+
+ public static void SqrtSingleTest()
+ {
+ var result = 0.0f; var value = 0.0f;
+
+ for (var iteration = 0; iteration < iterations; iteration++)
+ {
+ value += sqrtSingleDelta;
+ result += MathF.Sqrt(value);
+ }
+
+ var diff = MathF.Abs(sqrtSingleExpectedResult - result);
+
+ if (diff > singleEpsilon)
+ {
+ throw new Exception($"Expected Result {sqrtSingleExpectedResult,10:g9}; Actual Result {result,10:g9}");
+ }
+ }
+ }
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/TanSingle.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/TanSingle.cs
new file mode 100644
index 0000000000..b81050bfa3
--- /dev/null
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/TanSingle.cs
@@ -0,0 +1,47 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using Microsoft.Xunit.Performance;
+
+namespace Functions
+{
+ public static partial class MathTests
+ {
+ // Tests MathF.Tan(float) over 5000 iterations for the domain -PI/2, +PI/2
+
+ private const float tanSingleDelta = 0.0004f;
+ private const float tanSingleExpectedResult = 1.66717815f;
+
+ [Benchmark]
+ public static void TanSingleBenchmark()
+ {
+ foreach (var iteration in Benchmark.Iterations)
+ {
+ using (iteration.StartMeasurement())
+ {
+ TanSingleTest();
+ }
+ }
+ }
+
+ public static void TanSingleTest()
+ {
+ var result = 0.0f; var value = -1.0f;
+
+ for (var iteration = 0; iteration < iterations; iteration++)
+ {
+ value += tanSingleDelta;
+ result += MathF.Tan(value);
+ }
+
+ var diff = MathF.Abs(tanSingleExpectedResult - result);
+
+ if (diff > singleEpsilon)
+ {
+ throw new Exception($"Expected Result {tanSingleExpectedResult,10:g9}; Actual Result {result,10:g9}");
+ }
+ }
+ }
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/TanhSingle.cs b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/TanhSingle.cs
new file mode 100644
index 0000000000..160e1135bf
--- /dev/null
+++ b/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/TanhSingle.cs
@@ -0,0 +1,47 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using Microsoft.Xunit.Performance;
+
+namespace Functions
+{
+ public static partial class MathTests
+ {
+ // Tests MathF.Tanh(float) over 5000 iterations for the domain -1, +1
+
+ private const float tanhSingleDelta = 0.0004f;
+ private const float tanhSingleExpectedResult = 0.816701353f;
+
+ [Benchmark]
+ public static void TanhSingleBenchmark()
+ {
+ foreach (var iteration in Benchmark.Iterations)
+ {
+ using (iteration.StartMeasurement())
+ {
+ TanhSingleTest();
+ }
+ }
+ }
+
+ public static void TanhSingleTest()
+ {
+ var result = 0.0f; var value = -1.0f;
+
+ for (var iteration = 0; iteration < iterations; iteration++)
+ {
+ value += tanhSingleDelta;
+ result += MathF.Tanh(value);
+ }
+
+ var diff = MathF.Abs(tanhSingleExpectedResult - result);
+
+ if (diff > singleEpsilon)
+ {
+ throw new Exception($"Expected Result {tanhSingleExpectedResult,10:g9}; Actual Result {result,10:g9}");
+ }
+ }
+ }
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/Roslyn/CscBench.cs b/tests/src/JIT/Performance/CodeQuality/Roslyn/CscBench.cs
index e3337d115b..704e728c55 100644
--- a/tests/src/JIT/Performance/CodeQuality/Roslyn/CscBench.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Roslyn/CscBench.cs
@@ -13,7 +13,6 @@ using System.Linq;
using System.Runtime.CompilerServices;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
public static class CscBench
{
diff --git a/tests/src/JIT/Performance/CodeQuality/Roslyn/CscBench.csproj b/tests/src/JIT/Performance/CodeQuality/Roslyn/CscBench.csproj
index baea313f2c..bb5226e58c 100644
--- a/tests/src/JIT/Performance/CodeQuality/Roslyn/CscBench.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/Roslyn/CscBench.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
<GCStressIncompatible>true</GCStressIncompatible>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
@@ -30,10 +31,9 @@
<ItemGroup>
<Compile Include="CscBench.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark+roslyn\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark+roslyn\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark+roslyn\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/SIMD/ConsoleMandel/ConsoleMandel.cs b/tests/src/JIT/Performance/CodeQuality/SIMD/ConsoleMandel/ConsoleMandel.cs
index 5ab08202b6..c5058dcfac 100644
--- a/tests/src/JIT/Performance/CodeQuality/SIMD/ConsoleMandel/ConsoleMandel.cs
+++ b/tests/src/JIT/Performance/CodeQuality/SIMD/ConsoleMandel/ConsoleMandel.cs
@@ -9,7 +9,6 @@ using System.Diagnostics;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace SIMD
{
diff --git a/tests/src/JIT/Performance/CodeQuality/SIMD/ConsoleMandel/ConsoleMandel.csproj b/tests/src/JIT/Performance/CodeQuality/SIMD/ConsoleMandel/ConsoleMandel.csproj
index b6224770fa..dc256858fa 100644
--- a/tests/src/JIT/Performance/CodeQuality/SIMD/ConsoleMandel/ConsoleMandel.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/SIMD/ConsoleMandel/ConsoleMandel.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -38,10 +39,9 @@
<Compile Include="VectorFloatStrict.cs" />
<Compile Include="VectorHelpers.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/SIMD/RayTracer/RayTracer.csproj b/tests/src/JIT/Performance/CodeQuality/SIMD/RayTracer/RayTracer.csproj
index 0b1e5be0ae..ea19938bd5 100644
--- a/tests/src/JIT/Performance/CodeQuality/SIMD/RayTracer/RayTracer.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/SIMD/RayTracer/RayTracer.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -44,10 +45,9 @@
<Compile Include="Surfaces.cs" />
<Compile Include="Vector.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/SIMD/RayTracer/RayTracerBench.cs b/tests/src/JIT/Performance/CodeQuality/SIMD/RayTracer/RayTracerBench.cs
index 254672b462..715e0e2a89 100644
--- a/tests/src/JIT/Performance/CodeQuality/SIMD/RayTracer/RayTracerBench.cs
+++ b/tests/src/JIT/Performance/CodeQuality/SIMD/RayTracer/RayTracerBench.cs
@@ -14,7 +14,6 @@ using System.Threading.Tasks;
using System.Collections.Concurrent;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace SIMD
{
diff --git a/tests/src/JIT/Performance/CodeQuality/SIMD/SeekUnroll/SeekUnroll.cs b/tests/src/JIT/Performance/CodeQuality/SIMD/SeekUnroll/SeekUnroll.cs
index 81d9c0952f..bfa1f43a5f 100644
--- a/tests/src/JIT/Performance/CodeQuality/SIMD/SeekUnroll/SeekUnroll.cs
+++ b/tests/src/JIT/Performance/CodeQuality/SIMD/SeekUnroll/SeekUnroll.cs
@@ -12,7 +12,6 @@ using System.Collections.Generic;
using Xunit;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
public static class SeekUnroll
{
diff --git a/tests/src/JIT/Performance/CodeQuality/SIMD/SeekUnroll/SeekUnroll.csproj b/tests/src/JIT/Performance/CodeQuality/SIMD/SeekUnroll/SeekUnroll.csproj
index d5c72559ec..dc31f186a2 100644
--- a/tests/src/JIT/Performance/CodeQuality/SIMD/SeekUnroll/SeekUnroll.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/SIMD/SeekUnroll/SeekUnroll.csproj
@@ -30,11 +30,9 @@
<ItemGroup>
<Compile Include="SeekUnroll.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
- <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
</PropertyGroup>
</Project>
diff --git a/tests/src/JIT/Performance/CodeQuality/SciMark/SciMark.csproj b/tests/src/JIT/Performance/CodeQuality/SciMark/SciMark.csproj
index 917d749d41..65726fce85 100644
--- a/tests/src/JIT/Performance/CodeQuality/SciMark/SciMark.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/SciMark/SciMark.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
<AssemblyName>SciMark</AssemblyName>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
@@ -39,10 +40,9 @@
<Compile Include="SparseCompRow.cs" />
<Compile Include="Stopwatch.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/SciMark/kernel.cs b/tests/src/JIT/Performance/CodeQuality/SciMark/kernel.cs
index 3cba0c16c8..e06d7ff093 100644
--- a/tests/src/JIT/Performance/CodeQuality/SciMark/kernel.cs
+++ b/tests/src/JIT/Performance/CodeQuality/SciMark/kernel.cs
@@ -4,9 +4,9 @@
/// <license>
/// This is a port of the SciMark2a Java Benchmark to C# by
/// Chris Re (cmr28@cornell.edu) and Werner Vogels (vogels@cs.cornell.edu)
-///
+///
/// For details on the original authors see http://math.nist.gov/scimark2
-///
+///
/// This software is likely to burn your processor, bitflip your memory chips
/// anihilate your screen and corrupt all your disks, so you it at your
/// own risk.
@@ -17,7 +17,6 @@ using Microsoft.Xunit.Performance;
using System;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace SciMark2
{
@@ -217,7 +216,7 @@ namespace SciMark2
// +** * * +
// +* * * * +
// +* * * * +
- // +* * * * +
+ // +* * * * +
// +-----------------+
//
// (as best reproducible with integer artihmetic)
diff --git a/tests/src/JIT/Performance/CodeQuality/Serialization/Deserialize.cs b/tests/src/JIT/Performance/CodeQuality/Serialization/Deserialize.cs
index 56fc2665ad..5658161644 100644
--- a/tests/src/JIT/Performance/CodeQuality/Serialization/Deserialize.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Serialization/Deserialize.cs
@@ -13,7 +13,6 @@ using Newtonsoft.Json.Bson;
using Microsoft.Xunit.Performance;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Serialization
{
diff --git a/tests/src/JIT/Performance/CodeQuality/Serialization/Deserialize.csproj b/tests/src/JIT/Performance/CodeQuality/Serialization/Deserialize.csproj
index c08d1cd14b..e28565bb52 100644
--- a/tests/src/JIT/Performance/CodeQuality/Serialization/Deserialize.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/Serialization/Deserialize.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="Deserialize.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark+serialize\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark+serialize\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark+serialize\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/Serialization/Serialize.cs b/tests/src/JIT/Performance/CodeQuality/Serialization/Serialize.cs
index 39ab5876c9..6e2c41a6d1 100644
--- a/tests/src/JIT/Performance/CodeQuality/Serialization/Serialize.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Serialization/Serialize.cs
@@ -12,7 +12,6 @@ using Newtonsoft.Json.Bson;
using Microsoft.Xunit.Performance;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Serialization
{
diff --git a/tests/src/JIT/Performance/CodeQuality/Serialization/Serialize.csproj b/tests/src/JIT/Performance/CodeQuality/Serialization/Serialize.csproj
index 04798526f9..235de76463 100644
--- a/tests/src/JIT/Performance/CodeQuality/Serialization/Serialize.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/Serialization/Serialize.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="Serialize.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark+serialize\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark+serialize\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark+serialize\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/Span/Indexer.cs b/tests/src/JIT/Performance/CodeQuality/Span/Indexer.cs
index 4a7264ba92..c7f4846548 100644
--- a/tests/src/JIT/Performance/CodeQuality/Span/Indexer.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Span/Indexer.cs
@@ -14,7 +14,6 @@ using Xunit;
using Microsoft.Xunit.Performance;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Span
{
@@ -526,7 +525,7 @@ namespace Span
Invoke((int innerIterationCount) =>
{
byte result = TestKnownSizeArray(innerIterationCount);
- return result;
+ return result;
},
"KnownSizeArray({0})", length);
}
@@ -1014,7 +1013,7 @@ namespace Span
Console.WriteLine("Some tests failed validation");
return -1;
}
-
+
return 100;
}
}
diff --git a/tests/src/JIT/Performance/CodeQuality/Span/Indexer.csproj b/tests/src/JIT/Performance/CodeQuality/Span/Indexer.csproj
index a871713d1d..0427657cf5 100644
--- a/tests/src/JIT/Performance/CodeQuality/Span/Indexer.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/Span/Indexer.csproj
@@ -12,6 +12,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -34,11 +35,9 @@
<ItemGroup>
<Compile Include="Indexer.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
- <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
</PropertyGroup>
</Project>
diff --git a/tests/src/JIT/Performance/CodeQuality/Span/SpanBench.cs b/tests/src/JIT/Performance/CodeQuality/Span/SpanBench.cs
index d84152132d..ef694421ef 100644
--- a/tests/src/JIT/Performance/CodeQuality/Span/SpanBench.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Span/SpanBench.cs
@@ -14,7 +14,6 @@ using Xunit;
using Microsoft.Xunit.Performance;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace Span
{
@@ -1109,7 +1108,7 @@ namespace Span
#endregion
#region TestSpanAsSpanStringChar<T>
-
+
[Benchmark(InnerIterationCount = BaseIterations)]
[InlineData(1)]
[InlineData(10)]
@@ -1146,7 +1145,7 @@ namespace Span
}
}
- #endregion
+ #endregion
#endregion // TestSpanAPIs
@@ -1186,7 +1185,7 @@ namespace Span
}
}
}
-
+
// The only failure modes are crash/exception.
return 100;
}
diff --git a/tests/src/JIT/Performance/CodeQuality/Span/SpanBench.csproj b/tests/src/JIT/Performance/CodeQuality/Span/SpanBench.csproj
index 7404828bcd..f3bcfa2ed9 100644
--- a/tests/src/JIT/Performance/CodeQuality/Span/SpanBench.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/Span/SpanBench.csproj
@@ -12,6 +12,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -33,11 +34,9 @@
<ItemGroup>
<Compile Include="SpanBench.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
- <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
</PropertyGroup>
</Project>
diff --git a/tests/src/JIT/Performance/CodeQuality/V8/Crypto/Crypto.cs b/tests/src/JIT/Performance/CodeQuality/V8/Crypto/Crypto.cs
index 620e012848..f49f92f8db 100644
--- a/tests/src/JIT/Performance/CodeQuality/V8/Crypto/Crypto.cs
+++ b/tests/src/JIT/Performance/CodeQuality/V8/Crypto/Crypto.cs
@@ -44,7 +44,6 @@ using System.Collections.Generic;
using System.Globalization;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
namespace V8.Crypto
{
diff --git a/tests/src/JIT/Performance/CodeQuality/V8/Crypto/Crypto.csproj b/tests/src/JIT/Performance/CodeQuality/V8/Crypto/Crypto.csproj
index ec9e4e1bbf..ff54fab733 100644
--- a/tests/src/JIT/Performance/CodeQuality/V8/Crypto/Crypto.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/V8/Crypto/Crypto.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="Crypto.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/CodeQuality/V8/Richards/Richards.cs b/tests/src/JIT/Performance/CodeQuality/V8/Richards/Richards.cs
index 5095d22ad7..33f00ad8aa 100644
--- a/tests/src/JIT/Performance/CodeQuality/V8/Richards/Richards.cs
+++ b/tests/src/JIT/Performance/CodeQuality/V8/Richards/Richards.cs
@@ -15,7 +15,6 @@ using System;
using System.Collections.Generic;
[assembly: OptimizeForBenchmarks]
-[assembly: MeasureInstructionsRetired]
// using System.Diagnostics;
// using System.Text.RegularExpressions;
diff --git a/tests/src/JIT/Performance/CodeQuality/V8/Richards/Richards.csproj b/tests/src/JIT/Performance/CodeQuality/V8/Richards/Richards.csproj
index f81039d693..50c8420691 100644
--- a/tests/src/JIT/Performance/CodeQuality/V8/Richards/Richards.csproj
+++ b/tests/src/JIT/Performance/CodeQuality/V8/Richards/Richards.csproj
@@ -10,6 +10,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
@@ -29,10 +30,9 @@
<ItemGroup>
<Compile Include="Richards.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Performance/RunBenchmarks/RunBenchmarks.csproj b/tests/src/JIT/Performance/RunBenchmarks/RunBenchmarks.csproj
index 0489b0a8b0..6932f71cae 100644
--- a/tests/src/JIT/Performance/RunBenchmarks/RunBenchmarks.csproj
+++ b/tests/src/JIT/Performance/RunBenchmarks/RunBenchmarks.csproj
@@ -28,10 +28,9 @@
<ItemGroup>
<Compile Include="RunBenchmarks.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b51817/b51817.csproj b/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b51817/b51817.csproj
index 46b4b8e24f..949136259b 100644
--- a/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b51817/b51817.csproj
+++ b/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b51817/b51817.csproj
@@ -27,9 +27,10 @@
<ItemGroup>
<Compile Include="b51817.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b52593/b52593.csproj b/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b52593/b52593.csproj
index fb24d78107..bb1bf4d139 100644
--- a/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b52593/b52593.csproj
+++ b/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b52593/b52593.csproj
@@ -27,9 +27,10 @@
<ItemGroup>
<Compile Include="b52593.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b52733/b52733.csproj b/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b52733/b52733.csproj
index 2358d4970f..68a40de4bd 100644
--- a/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b52733/b52733.csproj
+++ b/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b52733/b52733.csproj
@@ -27,9 +27,10 @@
<ItemGroup>
<Compile Include="b52733.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b52840/b52840.csproj b/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b52840/b52840.csproj
index 26cd0e80c3..509a6628ea 100644
--- a/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b52840/b52840.csproj
+++ b/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b52840/b52840.csproj
@@ -27,9 +27,10 @@
<ItemGroup>
<Compile Include="b52840.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53226/b53226a.csproj b/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53226/b53226a.csproj
index 3c046ea754..99cdb6ebbb 100644
--- a/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53226/b53226a.csproj
+++ b/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53226/b53226a.csproj
@@ -27,9 +27,10 @@
<ItemGroup>
<Compile Include="b53226a.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53226/b53226b.csproj b/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53226/b53226b.csproj
index 9acb19163a..3bd0fa0fa7 100644
--- a/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53226/b53226b.csproj
+++ b/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53226/b53226b.csproj
@@ -27,9 +27,10 @@
<ItemGroup>
<Compile Include="b53226b.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b66533/b66533.csproj b/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b66533/b66533.csproj
index 1067ba1e42..390448cfd3 100644
--- a/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b66533/b66533.csproj
+++ b/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b66533/b66533.csproj
@@ -27,9 +27,10 @@
<ItemGroup>
<Compile Include="b66533.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_10780/GitHub_10780.cs b/tests/src/JIT/Regression/JitBlue/GitHub_10780/GitHub_10780.cs
new file mode 100644
index 0000000000..7b69838a3a
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/GitHub_10780/GitHub_10780.cs
@@ -0,0 +1,52 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+// Repro case for a bug involving hoisting of static field loads out of
+// loops and (illegally) above the corresponding type initializer calls.
+
+using System.Runtime.CompilerServices;
+
+namespace N
+{
+ public struct Pair
+ {
+ public int Left;
+ public int Right;
+
+ public static Pair TenFour = new Pair() { Left = 10, Right = 4 };
+ }
+
+ static class C
+ {
+ static int Sum;
+ static int Two;
+
+ // Bug repro requires a use of a Pair value; this is a small fn that takes
+ // a Pair by value to serve as that use. Inline it aggressively so that
+ // we won't think the call might kill the static field.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ static void Accumulate(Pair pair)
+ {
+ Sum += pair.Left + pair.Right;
+ }
+
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static void SumNFourteens(int n)
+ {
+ for (int i = 0; i < n; ++i)
+ {
+ Two = 2; // Store to C.Two here is a global side-effect above which we won't hoist the static initializer (since it may throw).
+ Accumulate(Pair.TenFour); // Hoisting the load of Pair.TenFour above the static init call is incorrect.
+ }
+ }
+
+ public static int Main(string[] args)
+ {
+ Sum = 0;
+ SumNFourteens(7); // Now Sum = 14 * 7 = 98 (and Two = 2)
+ return Sum + Two; // 98 + 2 = 100 on success
+ }
+ }
+}
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_10780/GitHub_10780.csproj b/tests/src/JIT/Regression/JitBlue/GitHub_10780/GitHub_10780.csproj
new file mode 100644
index 0000000000..6223cb9edd
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/GitHub_10780/GitHub_10780.csproj
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{1D93D1C3-458A-44ED-ABCC-7D0739B28C92}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+
+ <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+ </PropertyGroup>
+ <!-- Default configurations to help VS understand the configurations -->
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ </PropertyGroup>
+ <ItemGroup>
+ <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+ <Visible>False</Visible>
+ </CodeAnalysisDependentAssemblyPaths>
+ </ItemGroup>
+ <PropertyGroup>
+ <DebugType></DebugType>
+ <Optimize>True</Optimize>
+ <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+ </PropertyGroup>
+ <ItemGroup>
+ <Compile Include="GitHub_10780.cs" />
+ </ItemGroup>
+ <PropertyGroup>
+ <!-- NOTE: tailcall stress should be reenabled under zapdisable when #11408 is fixed -->
+ <CLRTestBatchPreCommands><![CDATA[
+$(CLRTestBatchPreCommands)
+if "%COMPlus_ZapDisable%"=="" set COMPlus_TailcallStress=1
+]]></CLRTestBatchPreCommands>
+ <BashCLRTestPreCommands><![CDATA[
+$(BashCLRTestPreCommands)
+if [ -z $COMPlus_ZapDisable ]; then
+ export COMPlus_TailcallStress=1
+fi
+]]></BashCLRTestPreCommands>
+ </PropertyGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ </PropertyGroup>
+</Project>
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_11343/GitHub_11343.cs b/tests/src/JIT/Regression/JitBlue/GitHub_11343/GitHub_11343.cs
new file mode 100644
index 0000000000..e23d9fc76c
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/GitHub_11343/GitHub_11343.cs
@@ -0,0 +1,33 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using System.Runtime.CompilerServices;
+
+class GitHub_11343
+{
+ const int Passed = 100;
+ const int Failed = 0;
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static void Test()
+ {
+ string s = null;
+ // Should throw NullReferenceException even if the result is not used
+ int unused = s.Length;
+ }
+
+ static int Main()
+ {
+ try
+ {
+ Test();
+ return Failed;
+ }
+ catch (NullReferenceException)
+ {
+ return Passed;
+ }
+ }
+}
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_11343/GitHub_11343.csproj b/tests/src/JIT/Regression/JitBlue/GitHub_11343/GitHub_11343.csproj
new file mode 100644
index 0000000000..c493c4ed35
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/GitHub_11343/GitHub_11343.csproj
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+
+ <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+ </PropertyGroup>
+ <!-- Default configurations to help VS understand the configurations -->
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ </PropertyGroup>
+ <ItemGroup>
+ <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+ <Visible>False</Visible>
+ </CodeAnalysisDependentAssemblyPaths>
+ </ItemGroup>
+ <PropertyGroup>
+ <DebugType></DebugType>
+ <Optimize>True</Optimize>
+ </PropertyGroup>
+ <ItemGroup>
+ <Compile Include="GitHub_11343.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ </PropertyGroup>
+</Project>
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_11408/GitHub_11408.cs b/tests/src/JIT/Regression/JitBlue/GitHub_11408/GitHub_11408.cs
new file mode 100644
index 0000000000..715cd5f0cf
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/GitHub_11408/GitHub_11408.cs
@@ -0,0 +1,45 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using System.Runtime.CompilerServices;
+
+class GitHub_11408
+{
+ const int Pass = 100;
+ const int Fail = -1;
+
+ unsafe class Program
+ {
+ static int save = 7;
+
+ static void foo(IntPtr x)
+ {
+ save = *(int*)x;
+ Console.WriteLine(*(int*)x);
+ }
+
+ static void bar()
+ {
+ int x = 42;
+ foo((IntPtr)(&x));
+ }
+
+ public static int Main(string[] args)
+ {
+ bar();
+
+ if (save == 42)
+ {
+ Console.WriteLine("Pass");
+ return Pass;
+ }
+ else
+ {
+ Console.WriteLine("Fail");
+ return Fail;
+ }
+ }
+ }
+}
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_11408/GitHub_11408.csproj b/tests/src/JIT/Regression/JitBlue/GitHub_11408/GitHub_11408.csproj
new file mode 100644
index 0000000000..251856c956
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/GitHub_11408/GitHub_11408.csproj
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+
+ <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+ </PropertyGroup>
+ <!-- Default configurations to help VS understand the configurations -->
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ </PropertyGroup>
+ <ItemGroup>
+ <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+ <Visible>False</Visible>
+ </CodeAnalysisDependentAssemblyPaths>
+ </ItemGroup>
+ <PropertyGroup>
+ <DebugType></DebugType>
+ <Optimize>True</Optimize>
+ <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+ </PropertyGroup>
+ <ItemGroup>
+ <Compile Include="GitHub_11408.cs" />
+ </ItemGroup>
+ <PropertyGroup>
+ <CLRTestBatchPreCommands><![CDATA[
+$(CLRTestBatchPreCommands)
+set COMPlus_TailcallStress=1
+]]></CLRTestBatchPreCommands>
+ <BashCLRTestPreCommands><![CDATA[
+$(BashCLRTestPreCommands)
+export COMPlus_TailcallStress=1
+]]></BashCLRTestPreCommands>
+ </PropertyGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ </PropertyGroup>
+</Project>
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_11508/GitHub_11508.cs b/tests/src/JIT/Regression/JitBlue/GitHub_11508/GitHub_11508.cs
new file mode 100644
index 0000000000..11081ba9ae
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/GitHub_11508/GitHub_11508.cs
@@ -0,0 +1,56 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using System.Collections.Generic;
+using System.Runtime.CompilerServices;
+
+namespace TestApp
+{
+ public struct StructWithValue : IEquatable<StructWithValue>
+ {
+ private ushort value;
+
+ public StructWithValue(ushort v)
+ {
+ value = v;
+ }
+
+
+ public bool Equals(StructWithValue other)
+ {
+ if (value.Equals (other.value))
+ return true;
+ else
+ return false;
+ }
+ }
+
+ class Program
+ {
+ [MethodImpl(MethodImplOptions.NoOptimization)]
+ static int Main(string[] args)
+ {
+ var comparer = EqualityComparer<StructWithValue>.Default;
+
+ for (ushort i = 0; ; i++)
+ {
+ var a = new StructWithValue(i);
+ var b = new StructWithValue(i);
+
+ if (!comparer.Equals(a, b))
+ {
+ return 0;
+ }
+
+ if (i == ushort.MaxValue)
+ {
+ break;
+ }
+ }
+
+ return 100;
+ }
+ }
+}
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_11508/GitHub_11508.csproj b/tests/src/JIT/Regression/JitBlue/GitHub_11508/GitHub_11508.csproj
new file mode 100644
index 0000000000..4c38b3e92c
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/GitHub_11508/GitHub_11508.csproj
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ </PropertyGroup>
+ <!-- Default configurations to help VS understand the configurations -->
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
+ <ItemGroup>
+ <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+ <Visible>False</Visible>
+ </CodeAnalysisDependentAssemblyPaths>
+ </ItemGroup>
+ <PropertyGroup>
+ <DebugType>None</DebugType>
+ <Optimize>True</Optimize>
+ </PropertyGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="GitHub_11508.cs" />
+ </ItemGroup>
+ <!-- <PropertyGroup>
+ <ProjectJson>$(JitPackagesConfigFileDirectory)threading+thread\project.json</ProjectJson>
+ <ProjectLockJson>$(JitPackagesConfigFileDirectory)threading+thread\project.lock.json</ProjectLockJson>
+ </PropertyGroup>-->
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+</Project>
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_11574/GitHub_11574.cs b/tests/src/JIT/Regression/JitBlue/GitHub_11574/GitHub_11574.cs
new file mode 100644
index 0000000000..9e6e5d94cd
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/GitHub_11574/GitHub_11574.cs
@@ -0,0 +1,44 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Runtime.CompilerServices;
+
+class Program
+{
+ static byte[] s_arr2;
+ static byte[] s_arr3;
+
+ static void Init()
+ {
+ s_arr2 = new byte[] { 0x11, 0x12, 0x13 };
+ s_arr3 = new byte[] { 0x21, 0x22, 0x33 };
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static int Check(int actual, int added, int expected, int rv)
+ {
+ return (actual == expected) ? rv : 0;
+ }
+
+ static int Main(string[] args)
+ {
+ Init();
+
+ byte[] arr1 = new byte[] { 2 };
+ byte[] arr2 = s_arr2;
+ byte[] arr3 = s_arr3;
+
+ int rv = 100;
+ int len = arr1.Length + arr2.Length + arr3.Length;
+ int cur = 0;
+ rv = Check(cur, 0, 0, rv);
+ cur += arr1.Length;
+ rv = Check(cur, arr1.Length, 1, rv);
+ cur += arr2.Length;
+ rv = Check(cur, arr2.Length, 4, rv);
+ cur += arr3.Length;
+ rv = Check(cur, arr3.Length, 7, rv);
+ return Check(cur, 0, len, rv);
+ }
+}
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_11574/GitHub_11574.csproj b/tests/src/JIT/Regression/JitBlue/GitHub_11574/GitHub_11574.csproj
new file mode 100644
index 0000000000..e5e41eab5a
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/GitHub_11574/GitHub_11574.csproj
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ </PropertyGroup>
+ <!-- Default configurations to help VS understand the configurations -->
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
+ <ItemGroup>
+ <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+ <Visible>False</Visible>
+ </CodeAnalysisDependentAssemblyPaths>
+ </ItemGroup>
+ <PropertyGroup>
+ <DebugType>None</DebugType>
+ <Optimize>True</Optimize>
+ </PropertyGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="GitHub_11574.cs" />
+ </ItemGroup>
+ <!-- <PropertyGroup>
+ <ProjectJson>$(JitPackagesConfigFileDirectory)threading+thread\project.json</ProjectJson>
+ <ProjectLockJson>$(JitPackagesConfigFileDirectory)threading+thread\project.lock.json</ProjectLockJson>
+ </PropertyGroup>-->
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+</Project>
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_11689/GitHub_11689.cs b/tests/src/JIT/Regression/JitBlue/GitHub_11689/GitHub_11689.cs
new file mode 100644
index 0000000000..3d8428c928
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/GitHub_11689/GitHub_11689.cs
@@ -0,0 +1,39 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+// Repro case for a bug involving hoisting of static field loads out of
+// loops and (illegally) above the corresponding type initializer calls.
+
+using System.Runtime.CompilerServices;
+
+namespace N
+{
+ struct WrappedInt
+ {
+ public int Value;
+
+ public static WrappedInt Twenty = new WrappedInt() { Value = 20 };
+ }
+ public static class C
+ {
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ static int unwrap(WrappedInt wi) => wi.Value;
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static int foo(int s, int n)
+ {
+ for (int i = 0; i < n; ++i)
+ {
+ s += unwrap(WrappedInt.Twenty); // Loading WrappedInt.Twenty must happen after calling the cctor
+ }
+
+ return s;
+ }
+
+ public static int Main(string[] args)
+ {
+ return foo(20, 4);
+ }
+ }
+}
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_11689/GitHub_11689.csproj b/tests/src/JIT/Regression/JitBlue/GitHub_11689/GitHub_11689.csproj
new file mode 100644
index 0000000000..63b9927c67
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/GitHub_11689/GitHub_11689.csproj
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{A04B4F1F-62D3-4799-94AB-ABFB220415BE}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+
+ <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+ </PropertyGroup>
+ <!-- Default configurations to help VS understand the configurations -->
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ </PropertyGroup>
+ <ItemGroup>
+ <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+ <Visible>False</Visible>
+ </CodeAnalysisDependentAssemblyPaths>
+ </ItemGroup>
+ <PropertyGroup>
+ <DebugType></DebugType>
+ <Optimize>True</Optimize>
+ <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+ </PropertyGroup>
+ <ItemGroup>
+ <Compile Include="GitHub_11689.cs" />
+ </ItemGroup>
+ <PropertyGroup>
+ <!-- NOTE: tailcall stress should be reenabled under zapdisable when #11408 is fixed -->
+ <CLRTestBatchPreCommands><![CDATA[
+$(CLRTestBatchPreCommands)
+if "%COMPlus_ZapDisable%"=="" set COMPlus_TailcallStress=1
+]]></CLRTestBatchPreCommands>
+ <BashCLRTestPreCommands><![CDATA[
+$(BashCLRTestPreCommands)
+if [ -z $COMPlus_ZapDisable ]; then
+ export COMPlus_TailcallStress=1
+fi
+]]></BashCLRTestPreCommands>
+ </PropertyGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ </PropertyGroup>
+</Project>
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_11733/GitHub_11733.cs b/tests/src/JIT/Regression/JitBlue/GitHub_11733/GitHub_11733.cs
new file mode 100644
index 0000000000..2c49d298d8
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/GitHub_11733/GitHub_11733.cs
@@ -0,0 +1,26 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using System.Runtime.CompilerServices;
+
+class C
+{
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static float L(float a)
+ {
+ return M(float.NegativeInfinity, a);
+ }
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ static float M(float a, float b)
+ {
+ return (float)Math.Pow(a, (float)Math.Pow(b, a));
+ }
+
+ static int Main()
+ {
+ return L(0) == M(float.NegativeInfinity, 0) ? 100 : 0;
+ }
+}
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_11733/GitHub_11733.csproj b/tests/src/JIT/Regression/JitBlue/GitHub_11733/GitHub_11733.csproj
new file mode 100644
index 0000000000..4caef234a1
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/GitHub_11733/GitHub_11733.csproj
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+
+ <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+ </PropertyGroup>
+ <!-- Default configurations to help VS understand the configurations -->
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ </PropertyGroup>
+ <ItemGroup>
+ <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+ <Visible>False</Visible>
+ </CodeAnalysisDependentAssemblyPaths>
+ </ItemGroup>
+ <PropertyGroup>
+ <DebugType></DebugType>
+ <Optimize>True</Optimize>
+ </PropertyGroup>
+ <ItemGroup>
+ <Compile Include="GitHub_11733.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ </PropertyGroup>
+</Project>
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_11804/GitHub_11804.il b/tests/src/JIT/Regression/JitBlue/GitHub_11804/GitHub_11804.il
new file mode 100644
index 0000000000..50d89734d9
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/GitHub_11804/GitHub_11804.il
@@ -0,0 +1,85 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+.assembly extern System.Private.CoreLib
+{
+ .publickeytoken = (7C EC 85 D7 BE A7 79 8E ) // |.....y.
+ .ver 4:0:0:0
+}
+.assembly extern System.Numerics.Vectors
+{
+ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....:
+ .ver 4:1:3:0
+}
+.assembly extern System.Runtime.CompilerServices.Unsafe
+{
+ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....:
+ .ver 4:0:3:0
+}
+.assembly GitHub_11804
+{
+ .custom instance void [System.Private.CoreLib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 )
+ .custom instance void [System.Private.CoreLib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = ( 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78 // ....T..WrapNonEx
+ 63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 ) // ceptionThrows.
+
+ .hash algorithm 0x00008004
+ .ver 0:0:0:0
+}
+.module GitHub_11804.exe
+// MVID: {9CC2AC15-DDA3-4ADF-9566-89AB25A8CF63}
+.imagebase 0x00400000
+.file alignment 0x00000200
+.stackreserve 0x00100000
+.subsystem 0x0003 // WINDOWS_CUI
+.corflags 0x00000001 // ILONLY
+// Image base: 0x01590000
+
+
+.class private abstract auto ansi sealed beforefieldinit C
+ extends [System.Private.CoreLib]System.Object
+{
+ .method private hidebysig static int32
+ UnsafeGrab() cil managed noinlining
+ {
+ // Code size 18 (0x12)
+ .maxstack 2
+ .locals init (valuetype [System.Numerics.Vectors]System.Numerics.Vector`1<int32> V_0)
+ IL_0000: ldloca.s V_0
+ IL_0002: ldc.i4.s 50
+ IL_0004: call instance void valuetype [System.Numerics.Vectors]System.Numerics.Vector`1<int32>::.ctor(!0)
+ IL_0009: ldloca.s V_0
+ IL_000b: call !!1& [System.Runtime.CompilerServices.Unsafe]System.Runtime.CompilerServices.Unsafe::As<valuetype [System.Numerics.Vectors]System.Numerics.Vector`1<int32>,int32>(!!0&)
+ IL_0010: ldind.i4
+ IL_0011: ret
+ } // end of method C::UnsafeGrab
+
+ .method private hidebysig static int32
+ IndexerGrab() cil managed noinlining
+ {
+ // Code size 18 (0x12)
+ .maxstack 2
+ .locals init (valuetype [System.Numerics.Vectors]System.Numerics.Vector`1<int32> V_0)
+ IL_0000: ldloca.s V_0
+ IL_0002: ldc.i4.s 50
+ IL_0004: call instance void valuetype [System.Numerics.Vectors]System.Numerics.Vector`1<int32>::.ctor(!0)
+ IL_0009: ldloca.s V_0
+ IL_000b: ldc.i4.0
+ IL_000c: call instance !0 valuetype [System.Numerics.Vectors]System.Numerics.Vector`1<int32>::get_Item(int32)
+ IL_0011: ret
+ } // end of method C::IndexerGrab
+
+ .method private hidebysig static int32
+ Main() cil managed
+ {
+ .entrypoint
+ // Code size 20 (0x14)
+ .maxstack 8
+
+ IL_0008: call int32 C::IndexerGrab()
+ IL_000d: call int32 C::UnsafeGrab()
+ IL_0012: add
+ IL_0013: ret
+ } // end of method C::Main
+
+} // end of class C
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_11804/GitHub_11804.ilproj b/tests/src/JIT/Regression/JitBlue/GitHub_11804/GitHub_11804.ilproj
new file mode 100644
index 0000000000..93c281624b
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/GitHub_11804/GitHub_11804.ilproj
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ </PropertyGroup>
+ <!-- Default configurations to help VS understand the configurations -->
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ </PropertyGroup>
+ <ItemGroup>
+ <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+ <Visible>False</Visible>
+ </CodeAnalysisDependentAssemblyPaths>
+ </ItemGroup>
+ <PropertyGroup>
+ <DebugType>None</DebugType>
+ <Optimize>True</Optimize>
+ </PropertyGroup>
+ <ItemGroup>
+ <Compile Include="GitHub_11804.il" />
+ </ItemGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ </PropertyGroup>
+</Project>
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_7906/GitHub_7906.csproj b/tests/src/JIT/Regression/JitBlue/GitHub_7906/GitHub_7906.csproj
index 2d330449a1..d6d753abaa 100644
--- a/tests/src/JIT/Regression/JitBlue/GitHub_7906/GitHub_7906.csproj
+++ b/tests/src/JIT/Regression/JitBlue/GitHub_7906/GitHub_7906.csproj
@@ -32,11 +32,9 @@
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
- <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
</PropertyGroup>
</Project>
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_8220/GitHub_8220.csproj b/tests/src/JIT/Regression/JitBlue/GitHub_8220/GitHub_8220.csproj
index 1d20f00012..1b7f8a70b5 100644
--- a/tests/src/JIT/Regression/JitBlue/GitHub_8220/GitHub_8220.csproj
+++ b/tests/src/JIT/Regression/JitBlue/GitHub_8220/GitHub_8220.csproj
@@ -33,11 +33,9 @@
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
- <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
</PropertyGroup>
</Project>
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_8231/GitHub_8231.csproj b/tests/src/JIT/Regression/JitBlue/GitHub_8231/GitHub_8231.csproj
index 6107b7f18d..7bdd3d7238 100644
--- a/tests/src/JIT/Regression/JitBlue/GitHub_8231/GitHub_8231.csproj
+++ b/tests/src/JIT/Regression/JitBlue/GitHub_8231/GitHub_8231.csproj
@@ -28,10 +28,9 @@
<ItemGroup>
<Compile Include="GitHub_8231.cs" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Regression/VS-ia64-JIT/V1.2-Beta1/b302509/b302509.csproj b/tests/src/JIT/Regression/VS-ia64-JIT/V1.2-Beta1/b302509/b302509.csproj
index 238a9b609a..db2490dda9 100644
--- a/tests/src/JIT/Regression/VS-ia64-JIT/V1.2-Beta1/b302509/b302509.csproj
+++ b/tests/src/JIT/Regression/VS-ia64-JIT/V1.2-Beta1/b302509/b302509.csproj
@@ -28,9 +28,10 @@
<ItemGroup>
<Compile Include="_5mvazhg.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/RyuJIT/DoWhileBndChk.csproj b/tests/src/JIT/RyuJIT/DoWhileBndChk.csproj
index 30b8c4b97e..a3fbd8a948 100644
--- a/tests/src/JIT/RyuJIT/DoWhileBndChk.csproj
+++ b/tests/src/JIT/RyuJIT/DoWhileBndChk.csproj
@@ -20,9 +20,10 @@
<ItemGroup>
<Compile Include="DoWhileBndChk.cs" />
</ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
- </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ </PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
diff --git a/tests/src/JIT/config/benchmark+roslyn/benchmark+roslyn.csproj b/tests/src/JIT/config/benchmark+roslyn/benchmark+roslyn.csproj
new file mode 100644
index 0000000000..9155703cd3
--- /dev/null
+++ b/tests/src/JIT/config/benchmark+roslyn/benchmark+roslyn.csproj
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+ <PropertyGroup>
+ <NugetTargetMoniker>.NETStandard,Version=v1.4</NugetTargetMoniker>
+ <NugetTargetMonikerShort>netstandard1.4</NugetTargetMonikerShort>
+ <IsTestProject>false</IsTestProject>
+ </PropertyGroup>
+ <ItemGroup>
+ <PackageReference Include="Microsoft.CodeAnalysis.Compilers">
+ <Version>1.1.1</Version>
+ </PackageReference>
+ <PackageReference Include="xunit.performance.api">
+ <Version>$(XUnitPerformanceApiVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="xunit.performance.core">
+ <Version>$(XUnitPerformanceApiVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="xunit.performance.execution">
+ <Version>$(XUnitPerformanceApiVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="xunit.performance.metrics">
+ <Version>$(XUnitPerformanceApiVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="Microsoft.Diagnostics.Tracing.TraceEvent">
+ <Version>$(MicrosoftDiagnosticsTracingLibraryVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="Microsoft.NETCore.Platforms">
+ <Version>2.0.0-preview2-25302-03</Version>
+ </PackageReference>
+ <PackageReference Include="System.Console">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Dynamic.Runtime">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Linq">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.IO.FileSystem">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Numerics.Vectors">
+ <Version>4.4.0-preview2-25302-03</Version>
+ </PackageReference>
+ <PackageReference Include="System.Reflection">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Reflection.Extensions">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Reflection.TypeExtensions">
+ <Version>4.4.0-preview2-25302-03</Version>
+ </PackageReference>
+ <PackageReference Include="System.Runtime">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Runtime.Extensions">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Runtime.Numerics">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Text.RegularExpressions">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Threading">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Threading.Tasks">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Threading.Tasks.Parallel">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Security.Cryptography.Algorithms">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="xunit">
+ <Version>$(XunitPackageVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="xunit.console.netcore">
+ <Version>$(XUnitConsoleNetCoreVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="xunit.runner.utility">
+ <Version>$(XunitPackageVersion)</Version>
+ </PackageReference>
+ </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netstandard1.4</TargetFramework>
+ <TargetFrameworkIdentifier>.NETStandard</TargetFrameworkIdentifier>
+ <PackageTargetFallback>$(PackageTargetFallback);dnxcore50;portable-net45+win8</PackageTargetFallback>
+ <ContainsPackageReferences>true</ContainsPackageReferences>
+ <PrereleaseResolveNuGetPackages>false</PrereleaseResolveNuGetPackages>
+ </PropertyGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <Target Name="Build"
+ DependsOnTargets="ResolveReferences" />
+</Project> \ No newline at end of file
diff --git a/tests/src/JIT/config/benchmark+roslyn/project.json b/tests/src/JIT/config/benchmark+roslyn/project.json
deleted file mode 100644
index 18907a1214..0000000000
--- a/tests/src/JIT/config/benchmark+roslyn/project.json
+++ /dev/null
@@ -1,38 +0,0 @@
-{
- "dependencies": {
- "Microsoft.CodeAnalysis.Compilers": "1.1.1",
- "xunit.performance.api": "1.0.0-beta-build0003",
- "xunit.performance.core": "1.0.0-beta-build0003",
- "xunit.performance.execution": "1.0.0-beta-build0003",
- "xunit.performance.metrics": "1.0.0-beta-build0003",
- "Microsoft.Diagnostics.Tracing.TraceEvent": "1.0.3-alpha-experimental",
- "Microsoft.NETCore.Platforms": "2.0.0-preview1-25221-01",
- "System.Console": "4.4.0-beta-24913-02",
- "System.Dynamic.Runtime": "4.4.0-beta-24913-02",
- "System.Linq": "4.4.0-beta-24913-02",
- "System.IO.FileSystem": "4.4.0-beta-24913-02",
- "System.Numerics.Vectors": "4.4.0-preview1-25221-01",
- "System.Reflection": "4.4.0-beta-24913-02",
- "System.Reflection.Extensions": "4.4.0-beta-24913-02",
- "System.Reflection.TypeExtensions": "4.4.0-preview1-25221-01",
- "System.Runtime": "4.4.0-beta-24913-02",
- "System.Runtime.Extensions": "4.4.0-beta-24913-02",
- "System.Runtime.Numerics": "4.4.0-beta-24913-02",
- "System.Text.RegularExpressions": "4.4.0-beta-24913-02",
- "System.Threading": "4.4.0-beta-24913-02",
- "System.Threading.Tasks": "4.4.0-beta-24913-02",
- "System.Threading.Tasks.Parallel": "4.4.0-beta-24913-02",
- "System.Security.Cryptography.Algorithms": "4.4.0-beta-24913-02",
- "xunit": "2.2.0-beta2-build3300",
- "xunit.console.netcore": "1.0.2-prerelease-00177",
- "xunit.runner.utility": "2.2.0-beta2-build3300"
- },
- "frameworks": {
- "netstandard1.4": {
- "imports": [
- "dnxcore50",
- "portable-net45+win8"
- ]
- }
- }
-}
diff --git a/tests/src/JIT/config/benchmark+serialize/benchmark+serialize.csproj b/tests/src/JIT/config/benchmark+serialize/benchmark+serialize.csproj
new file mode 100644
index 0000000000..36181432d2
--- /dev/null
+++ b/tests/src/JIT/config/benchmark+serialize/benchmark+serialize.csproj
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+ <PropertyGroup>
+ <NugetTargetMoniker>.NETStandard,Version=v1.4</NugetTargetMoniker>
+ <NugetTargetMonikerShort>netstandard1.4</NugetTargetMonikerShort>
+ <IsTestProject>false</IsTestProject>
+ </PropertyGroup>
+ <ItemGroup>
+ <PackageReference Include="xunit.performance.api">
+ <Version>$(XUnitPerformanceApiVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="xunit.performance.core">
+ <Version>$(XUnitPerformanceApiVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="xunit.performance.execution">
+ <Version>$(XUnitPerformanceApiVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="xunit.performance.metrics">
+ <Version>$(XUnitPerformanceApiVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="Microsoft.Diagnostics.Tracing.TraceEvent">
+ <Version>$(MicrosoftDiagnosticsTracingLibraryVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="Microsoft.NETCore.Platforms">
+ <Version>2.0.0-preview2-25302-03</Version>
+ </PackageReference>
+ <PackageReference Include="Newtonsoft.Json">
+ <Version>7.0.1</Version>
+ </PackageReference>
+ <PackageReference Include="System.Console">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.IO">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.IO.FileSystem">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Linq">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.ObjectModel">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Dynamic.Runtime">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Reflection">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Reflection.Extensions">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Reflection.TypeExtensions">
+ <Version>4.4.0-preview2-25302-03</Version>
+ </PackageReference>
+ <PackageReference Include="System.Runtime">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Runtime.Serialization.Json">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Runtime.Serialization.Primitives">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Runtime.Serialization.Xml">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Text.RegularExpressions">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Xml.XmlDocument">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Xml.XmlSerializer">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="xunit">
+ <Version>$(XunitPackageVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="xunit.console.netcore">
+ <Version>$(XUnitConsoleNetCoreVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="xunit.runner.utility">
+ <Version>$(XunitPackageVersion)</Version>
+ </PackageReference>
+ </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netstandard1.4</TargetFramework>
+ <TargetFrameworkIdentifier>.NETStandard</TargetFrameworkIdentifier>
+ <PackageTargetFallback>$(PackageTargetFallback);dnxcore50;portable-net45+win8</PackageTargetFallback>
+ <ContainsPackageReferences>true</ContainsPackageReferences>
+ <PrereleaseResolveNuGetPackages>false</PrereleaseResolveNuGetPackages>
+ </PropertyGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <Target Name="Build"
+ DependsOnTargets="ResolveReferences" />
+</Project>
diff --git a/tests/src/JIT/config/benchmark+serialize/project.json b/tests/src/JIT/config/benchmark+serialize/project.json
deleted file mode 100644
index b71701f9ef..0000000000
--- a/tests/src/JIT/config/benchmark+serialize/project.json
+++ /dev/null
@@ -1,38 +0,0 @@
-{
- "dependencies": {
- "xunit.performance.api": "1.0.0-beta-build0003",
- "xunit.performance.core": "1.0.0-beta-build0003",
- "xunit.performance.execution": "1.0.0-beta-build0003",
- "xunit.performance.metrics": "1.0.0-beta-build0003",
- "Microsoft.Diagnostics.Tracing.TraceEvent": "1.0.3-alpha-experimental",
- "Microsoft.NETCore.Platforms": "2.0.0-preview1-25221-01",
- "Newtonsoft.Json": "7.0.1",
- "System.Console": "4.4.0-beta-24913-02",
- "System.IO": "4.4.0-beta-24913-02",
- "System.IO.FileSystem": "4.4.0-beta-24913-02",
- "System.Linq": "4.4.0-beta-24913-02",
- "System.ObjectModel": "4.4.0-beta-24913-02",
- "System.Dynamic.Runtime": "4.4.0-beta-24913-02",
- "System.Reflection": "4.4.0-beta-24913-02",
- "System.Reflection.Extensions": "4.4.0-beta-24913-02",
- "System.Reflection.TypeExtensions": "4.4.0-preview1-25221-01",
- "System.Runtime": "4.4.0-beta-24913-02",
- "System.Runtime.Serialization.Json": "4.4.0-beta-24913-02",
- "System.Runtime.Serialization.Primitives": "4.4.0-beta-24913-02",
- "System.Runtime.Serialization.Xml": "4.4.0-beta-24913-02",
- "System.Text.RegularExpressions": "4.4.0-beta-24913-02",
- "System.Xml.XmlDocument": "4.4.0-beta-24913-02",
- "System.Xml.XmlSerializer": "4.4.0-beta-24913-02",
- "xunit": "2.2.0-beta2-build3300",
- "xunit.console.netcore": "1.0.2-prerelease-00177",
- "xunit.runner.utility": "2.2.0-beta2-build3300"
- },
- "frameworks": {
- "netstandard1.4": {
- "imports": [
- "dnxcore50",
- "portable-net45+win8"
- ]
- }
- }
-}
diff --git a/tests/src/JIT/config/benchmark/benchmark.csproj b/tests/src/JIT/config/benchmark/benchmark.csproj
new file mode 100644
index 0000000000..f739151181
--- /dev/null
+++ b/tests/src/JIT/config/benchmark/benchmark.csproj
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+ <PropertyGroup>
+ <NugetTargetMoniker>.NETStandard,Version=v1.4</NugetTargetMoniker>
+ <NugetTargetMonikerShort>netstandard1.4</NugetTargetMonikerShort>
+ <IsTestProject>false</IsTestProject>
+ </PropertyGroup>
+ <ItemGroup>
+ <PackageReference Include="xunit.performance.api">
+ <Version>$(XUnitPerformanceApiVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="xunit.performance.core">
+ <Version>$(XUnitPerformanceApiVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="xunit.performance.execution">
+ <Version>$(XUnitPerformanceApiVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="xunit.performance.metrics">
+ <Version>$(XUnitPerformanceApiVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="Microsoft.Diagnostics.Tracing.TraceEvent">
+ <Version>$(MicrosoftDiagnosticsTracingLibraryVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="Microsoft.NETCore.Platforms">
+ <Version>2.0.0-preview2-25302-03</Version>
+ </PackageReference>
+ <PackageReference Include="System.Collections.NonGeneric">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Console">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.IO.FileSystem">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Linq">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Linq.Parallel">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Linq.Expressions">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Memory">
+ <Version>4.4.0-preview2-25302-03</Version>
+ </PackageReference>
+ <PackageReference Include="System.Numerics.Vectors">
+ <Version>4.4.0-preview2-25302-03</Version>
+ </PackageReference>
+ <PackageReference Include="System.Reflection">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Reflection.Extensions">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Reflection.TypeExtensions">
+ <Version>4.4.0-preview2-25302-03</Version>
+ </PackageReference>
+ <PackageReference Include="System.Runtime">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Runtime.CompilerServices.Unsafe">
+ <Version>4.4.0-preview2-25302-03</Version>
+ </PackageReference>
+ <PackageReference Include="System.Runtime.Extensions">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Runtime.Numerics">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Text.RegularExpressions">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Threading">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Threading.Tasks">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Threading.Tasks.Parallel">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Threading.ThreadPool">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Diagnostics.Process">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Xml.XmlDocument">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="xunit">
+ <Version>$(XunitPackageVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="xunit.console.netcore">
+ <Version>$(XUnitConsoleNetCoreVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="xunit.runner.utility">
+ <Version>$(XunitPackageVersion)</Version>
+ </PackageReference>
+ </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netstandard1.4</TargetFramework>
+ <TargetFrameworkIdentifier>.NETStandard</TargetFrameworkIdentifier>
+ <PackageTargetFallback>$(PackageTargetFallback);dnxcore50;portable-net45+win8</PackageTargetFallback>
+ <ContainsPackageReferences>true</ContainsPackageReferences>
+ <PrereleaseResolveNuGetPackages>false</PrereleaseResolveNuGetPackages>
+ </PropertyGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <Target Name="Build"
+ DependsOnTargets="ResolveReferences" />
+</Project> \ No newline at end of file
diff --git a/tests/src/JIT/config/benchmark/project.json b/tests/src/JIT/config/benchmark/project.json
deleted file mode 100644
index aac92ecc0b..0000000000
--- a/tests/src/JIT/config/benchmark/project.json
+++ /dev/null
@@ -1,43 +0,0 @@
-{
- "dependencies": {
- "xunit.performance.api": "1.0.0-beta-build0003",
- "xunit.performance.core": "1.0.0-beta-build0003",
- "xunit.performance.execution": "1.0.0-beta-build0003",
- "xunit.performance.metrics": "1.0.0-beta-build0003",
- "Microsoft.Diagnostics.Tracing.TraceEvent": "1.0.3-alpha-experimental",
- "Microsoft.NETCore.Platforms": "2.0.0-preview1-25221-01",
- "System.Collections.NonGeneric": "4.4.0-beta-24913-02",
- "System.Console": "4.4.0-beta-24913-02",
- "System.IO.FileSystem": "4.4.0-beta-24913-02",
- "System.Linq": "4.4.0-beta-24913-02",
- "System.Linq.Parallel": "4.4.0-beta-24913-02",
- "System.Linq.Expressions": "4.4.0-beta-24913-02",
- "System.Memory": "4.4.0-preview1-25221-01",
- "System.Numerics.Vectors": "4.4.0-preview1-25221-01",
- "System.Reflection": "4.4.0-beta-24913-02",
- "System.Reflection.Extensions": "4.4.0-beta-24913-02",
- "System.Reflection.TypeExtensions": "4.4.0-preview1-25221-01",
- "System.Runtime": "4.4.0-beta-24913-02",
- "System.Runtime.CompilerServices.Unsafe": "4.4.0-preview1-25221-01",
- "System.Runtime.Extensions": "4.4.0-beta-24913-02",
- "System.Runtime.Numerics": "4.4.0-beta-24913-02",
- "System.Text.RegularExpressions": "4.4.0-beta-24913-02",
- "System.Threading": "4.4.0-beta-24913-02",
- "System.Threading.Tasks": "4.4.0-beta-24913-02",
- "System.Threading.Tasks.Parallel": "4.4.0-beta-24913-02",
- "System.Threading.ThreadPool": "4.4.0-beta-24913-02",
- "System.Diagnostics.Process": "4.4.0-beta-24913-02",
- "System.Xml.XmlDocument": "4.4.0-beta-24913-02",
- "xunit": "2.2.0-beta2-build3300",
- "xunit.console.netcore": "1.0.2-prerelease-00177",
- "xunit.runner.utility": "2.2.0-beta2-build3300"
- },
- "frameworks": {
- "netstandard1.4": {
- "imports": [
- "dnxcore50",
- "portable-net45+win8"
- ]
- }
- }
-}
diff --git a/tests/src/JIT/opt/Devirtualization/GitHub_9945_2.ilproj b/tests/src/JIT/opt/Devirtualization/GitHub_9945_2.ilproj
index f71ad15a05..8be1cb04bf 100644
--- a/tests/src/JIT/opt/Devirtualization/GitHub_9945_2.ilproj
+++ b/tests/src/JIT/opt/Devirtualization/GitHub_9945_2.ilproj
@@ -32,11 +32,9 @@
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
- <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
</PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/opt/Devirtualization/override.ilproj b/tests/src/JIT/opt/Devirtualization/override.ilproj
index 0bfc25ff45..75da709ced 100644
--- a/tests/src/JIT/opt/Devirtualization/override.ilproj
+++ b/tests/src/JIT/opt/Devirtualization/override.ilproj
@@ -32,11 +32,9 @@
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
- </PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
- <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+ <PropertyGroup>
+ <ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
</PropertyGroup>
</Project> \ No newline at end of file
diff --git a/tests/src/JIT/opt/Tailcall/TailcallVerifyTransparentLibraryWithPrefix.il b/tests/src/JIT/opt/Tailcall/TailcallVerifyTransparentLibraryWithPrefix.il
index e295a99a01..ca789a673f 100644
--- a/tests/src/JIT/opt/Tailcall/TailcallVerifyTransparentLibraryWithPrefix.il
+++ b/tests/src/JIT/opt/Tailcall/TailcallVerifyTransparentLibraryWithPrefix.il
@@ -198,7 +198,8 @@
IL_0022: call void [mscorlib]System.Console::WriteLine(string)
IL_0027: ldc.i4.s 101
IL_0029: stsfld int32 TailcallVerify.Condition22::Result
- IL_002e: tail. call int32 TailcallVerify.Condition22::Callee2()
+// tail. // tail.call, pop, ret sequence is never valid for .NET Core (but is accepted by .NET x64)
+ IL_002e: call int32 TailcallVerify.Condition22::Callee2()
IL_0033: pop
IL_0034: ret
} // end of method Condition22::Caller2
@@ -307,7 +308,8 @@
IL_0027: ldc.i4.s 101
IL_0029: stsfld int32 TailcallVerify.Condition22::Result
IL_002e: ldarg.0
- IL_002f: tail. callvirt instance int32 TailcallVerify.Condition22::Callee3()
+// tail. // tail.call, pop, ret sequence is never valid for .NET Core (but is accepted by .NET x64)
+ IL_002f: callvirt instance int32 TailcallVerify.Condition22::Callee3()
IL_0034: pop
IL_0035: ret
} // end of method Condition22::Caller3
diff --git a/tests/src/JIT/opt/Tailcall/TailcallVerifyWithPrefix.il b/tests/src/JIT/opt/Tailcall/TailcallVerifyWithPrefix.il
index 1c354b7cdb..565451803b 100644
--- a/tests/src/JIT/opt/Tailcall/TailcallVerifyWithPrefix.il
+++ b/tests/src/JIT/opt/Tailcall/TailcallVerifyWithPrefix.il
@@ -13,6 +13,11 @@
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
.ver 4:0:0:0
}
+.assembly extern System.Threading.Thread
+{
+ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
+ .ver 4:0:0:0
+}
.assembly extern System.Linq
{
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
@@ -2786,21 +2791,22 @@
.entrypoint
.maxstack 1
- ldstr "Condition1.Test1"
- call int32 TailcallVerify.Program::Run(string)
- pop
- ldstr "Condition1.Test2"
- call int32 TailcallVerify.Program::Run(string)
- pop
- ldstr "Condition1.Test3"
- call int32 TailcallVerify.Program::Run(string)
- pop
- ldstr "Condition2.Test1"
- call int32 TailcallVerify.Program::Run(string)
- pop
- ldstr "Condition2.Test2"
- call int32 TailcallVerify.Program::Run(string)
- pop
+ // Disable tests intending to test tail.call,pop,ret sequence.
+ //ldstr "Condition1.Test1"
+ //call int32 TailcallVerify.Program::Run(string)
+ //pop
+ //ldstr "Condition1.Test2"
+ //call int32 TailcallVerify.Program::Run(string)
+ //pop
+ //ldstr "Condition1.Test3"
+ //call int32 TailcallVerify.Program::Run(string)
+ //pop
+ //ldstr "Condition2.Test1"
+ //call int32 TailcallVerify.Program::Run(string)
+ //pop
+ //ldstr "Condition2.Test2"
+ //call int32 TailcallVerify.Program::Run(string)
+ //pop
ldstr "Condition3.Test1"
call int32 TailcallVerify.Program::Run(string)
pop
@@ -2935,12 +2941,13 @@
ldstr "Condition20.Test1"
call int32 TailcallVerify.Program::Run(string)
pop
- ldstr "Condition21.Test1"
- call int32 TailcallVerify.Program::Run(string)
- pop
- ldstr "Condition21.Test2"
- call int32 TailcallVerify.Program::Run(string)
- pop
+ // Disable tests intending to test tail.call,pop,ret sequence.
+ //ldstr "Condition21.Test1"
+ //call int32 TailcallVerify.Program::Run(string)
+ //pop
+ //ldstr "Condition21.Test2"
+ //call int32 TailcallVerify.Program::Run(string)
+ //pop
ldstr "Condition21.Test3"
call int32 TailcallVerify.Program::Run(string)
pop
@@ -2950,9 +2957,10 @@
ldstr "Condition21.Test7"
call int32 TailcallVerify.Program::Run(string)
pop
- ldstr "Condition22.Test2"
- call int32 TailcallVerify.Program::Run(string)
- pop
+ // Disable tests intending to test tail.call,pop,ret sequence.
+ //ldstr "Condition22.Test2"
+ //call int32 TailcallVerify.Program::Run(string)
+ //pop
ldstr "Condition22.Test4"
call int32 TailcallVerify.Program::Run(string)
ret
@@ -3561,7 +3569,8 @@
IL_0056: ldc.i4.3
IL_0057: ldc.i4.4
IL_0058: ldloc.0
- IL_0059: tail. call valuetype TailcallVerify.ValueType3Bytes TailcallVerify.Condition21::CalleeIsOdd1(int32,
+// tail. // tail.call, pop, ret sequence is never valid for .NET Core (but is accepted by .NET x64)
+ IL_0059: call valuetype TailcallVerify.ValueType3Bytes TailcallVerify.Condition21::CalleeIsOdd1(int32,
int32,
int32,
int32,
@@ -3940,7 +3949,8 @@
IL_0032: ldloca.s CS$0$0000
IL_0034: initobj TailcallVerify.ValueType3Bytes
IL_003a: ldloc.0
- IL_003b: tail. call valuetype TailcallVerify.ValueType3Bytes TailcallVerify.Condition21::CalleeIsEven2(int32,
+// tail. // tail.call, pop, ret sequence is never valid for .NET Core (but is accepted by .NET x64)
+ IL_003b: call valuetype TailcallVerify.ValueType3Bytes TailcallVerify.Condition21::CalleeIsEven2(int32,
int32,
int32,
valuetype TailcallVerify.ValueType3Bytes)
@@ -4610,7 +4620,8 @@
IL_0037: ldloca.s CS$0$0000
IL_0039: initobj TailcallVerify.ValueType3Bytes
IL_003f: ldloc.0
- IL_0040: tail. call valuetype TailcallVerify.ValueType3Bytes TailcallVerify.Condition21::CalleeE4(int32,
+// tail. // tail.call, pop, ret sequence is never valid for .NET Core (but is accepted by .NET x64)
+ IL_0040: call valuetype TailcallVerify.ValueType3Bytes TailcallVerify.Condition21::CalleeE4(int32,
int32,
int32,
int32,
@@ -9265,7 +9276,8 @@
IL_0022: call void [System.Console]System.Console::WriteLine(string)
IL_0027: ldc.i4.s 101
IL_0029: stsfld int32 TailcallVerify.Condition2::Result
- IL_002e: tail. call int32 TailcallVerify.Condition2::Callee1()
+// tail. // tail.call, pop, ret sequence is never valid for .NET Core (but is accepted by .NET x64)
+ IL_002e: call int32 TailcallVerify.Condition2::Callee1()
IL_0033: pop
IL_0034: ret
} // end of method Condition2::Caller1
@@ -9366,7 +9378,8 @@
IL_0027: ldc.i4.s 101
IL_0029: stsfld int32 TailcallVerify.Condition2::Result
IL_002e: ldc.i4.0
- IL_002f: tail. call string TailcallVerify.Condition2::Callee2(int32)
+// tail. // tail.call, pop, ret sequence is never valid for .NET Core (but is accepted by .NET x64)
+ IL_002f: call string TailcallVerify.Condition2::Callee2(int32)
IL_0034: pop
IL_0035: ret
} // end of method Condition2::Caller2
@@ -9501,7 +9514,8 @@
IL_0022: call void [System.Console]System.Console::WriteLine(string)
IL_0027: ldc.i4.s 101
IL_0029: stsfld int32 TailcallVerify.Condition1::Result
- IL_002e: tail. call valuetype TailcallVerify.ValueType3Bytes TailcallVerify.Condition1::Callee1()
+// tail. // tail.call, pop, ret sequence is never valid for .NET Core (but is accepted by .NET x64)
+ IL_002e: call valuetype TailcallVerify.ValueType3Bytes TailcallVerify.Condition1::Callee1()
IL_0033: pop
IL_0034: ret
} // end of method Condition1::Caller1
@@ -9607,7 +9621,8 @@
IL_0027: ldc.i4.s 101
IL_0029: stsfld int32 TailcallVerify.Condition1::Result
IL_002e: ldc.i4.0
- IL_002f: tail. call valuetype TailcallVerify.ValueType3Bytes TailcallVerify.Condition1::Callee2(int32)
+// tail. // tail.call, pop, ret sequence is never valid for .NET Core (but is accepted by .NET x64)
+ IL_002f: call valuetype TailcallVerify.ValueType3Bytes TailcallVerify.Condition1::Callee2(int32)
IL_0034: pop
IL_0035: ret
} // end of method Condition1::Caller2
@@ -9720,7 +9735,8 @@
IL_0047: ldc.i4 0x7fffffff
IL_004c: ldc.i4 0x80000000
IL_0051: ldc.i4 0x7fffffff
- IL_0056: tail. call valuetype TailcallVerify.ValueType3Bytes TailcallVerify.Condition1::Callee3(int32,
+// tail. // tail.call, pop, ret sequence is never valid for .NET Core (but is accepted by .NET x64)
+ IL_0056: call valuetype TailcallVerify.ValueType3Bytes TailcallVerify.Condition1::Callee3(int32,
int32,
int32,
int32,
@@ -9914,7 +9930,8 @@
IL_0099: ldc.r8 -1.7976931348623157e+308
IL_00a2: ldc.r4 3.4028235e+038
IL_00a7: ldloc.1
- IL_00a8: tail. call valuetype TailcallVerify.ValueType3Bytes TailcallVerify.Condition1::Callee4(int32,
+// tail. // tail.call, pop, ret sequence is never valid for .NET Core (but is accepted by .NET x64)
+ IL_00a8: call valuetype TailcallVerify.ValueType3Bytes TailcallVerify.Condition1::Callee4(int32,
int64,
valuetype TailcallVerify.ValueType3Bytes,
int16,
diff --git a/tests/src/JIT/opt/virtualstubdispatch/bigvtbl/bigvtbl_cs_d.csproj b/tests/src/JIT/opt/virtualstubdispatch/bigvtbl/bigvtbl_cs_d.csproj
index 79560c536a..db9b40619d 100644
--- a/tests/src/JIT/opt/virtualstubdispatch/bigvtbl/bigvtbl_cs_d.csproj
+++ b/tests/src/JIT/opt/virtualstubdispatch/bigvtbl/bigvtbl_cs_d.csproj
@@ -12,7 +12,7 @@
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<!-- NOTE: this test simply takes too long to complete under GC stress/heap verify; it is not fundamentally incompatible -->
- <GCStressIncompatible Condition="'$(Platform)' == 'x86'">true</GCStressIncompatible>
+ <GCStressIncompatible>true</GCStressIncompatible>
<HeapVerifyIncompatible>true</HeapVerifyIncompatible>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
diff --git a/tests/src/JIT/opt/virtualstubdispatch/bigvtbl/bigvtbl_cs_r.csproj b/tests/src/JIT/opt/virtualstubdispatch/bigvtbl/bigvtbl_cs_r.csproj
index df11c8210e..8316681204 100644
--- a/tests/src/JIT/opt/virtualstubdispatch/bigvtbl/bigvtbl_cs_r.csproj
+++ b/tests/src/JIT/opt/virtualstubdispatch/bigvtbl/bigvtbl_cs_r.csproj
@@ -12,7 +12,7 @@
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<!-- NOTE: this test simply takes too long to complete under GC stress/heap verify; it is not fundamentally incompatible -->
- <GCStressIncompatible Condition="'$(Platform)' == 'x86'">true</GCStressIncompatible>
+ <GCStressIncompatible>true</GCStressIncompatible>
<HeapVerifyIncompatible>true</HeapVerifyIncompatible>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
diff --git a/tests/src/JIT/superpmi/superpmicollect.csproj b/tests/src/JIT/superpmi/superpmicollect.csproj
index 18d15ed9df..f9e8bb1313 100644
--- a/tests/src/JIT/superpmi/superpmicollect.csproj
+++ b/tests/src/JIT/superpmi/superpmicollect.csproj
@@ -10,6 +10,7 @@
<OutputType>Exe</OutputType>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ <GCStressIncompatible>true</GCStressIncompatible>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
diff --git a/tests/src/Loader/classloader/PrivateInterfaceImpl/Test6_ImplementingClass.ilproj b/tests/src/Loader/classloader/PrivateInterfaceImpl/Test6_ImplementingClass.ilproj
index d050b73331..695c21365a 100644
--- a/tests/src/Loader/classloader/PrivateInterfaceImpl/Test6_ImplementingClass.ilproj
+++ b/tests/src/Loader/classloader/PrivateInterfaceImpl/Test6_ImplementingClass.ilproj
@@ -27,6 +27,7 @@
<ItemGroup>
<ProjectReference Include="Test6_forwarder.ilproj" />
+ <ProjectReference Include="Test6_supplier.ilproj" />
<ProjectReference Include="Test6_FriendPriInterface.ilproj" />
</ItemGroup>
diff --git a/tests/src/Loader/classloader/regressions/440935/Test.ilproj b/tests/src/Loader/classloader/regressions/440935/Test.ilproj
index 221ac0d672..89396c2dc4 100644
--- a/tests/src/Loader/classloader/regressions/440935/Test.ilproj
+++ b/tests/src/Loader/classloader/regressions/440935/Test.ilproj
@@ -27,6 +27,7 @@
<ItemGroup>
<ProjectReference Include="Foo.ilproj" />
+ <ProjectReference Include="Bar.ilproj" />
</ItemGroup>
<ItemGroup>
diff --git a/tests/src/Regressions/coreclr/9414/readonlyPrefix.cs b/tests/src/Regressions/coreclr/9414/readonlyPrefix.cs
new file mode 100644
index 0000000000..05148a1800
--- /dev/null
+++ b/tests/src/Regressions/coreclr/9414/readonlyPrefix.cs
@@ -0,0 +1,36 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+class Program
+{
+ interface IFrobber
+ {
+ void Frob();
+ }
+
+ class Frobber : IFrobber
+ {
+ public void Frob()
+ {
+ }
+ }
+
+ class Foo<T> where T : IFrobber
+ {
+ public static void FrobAll(T[,] arr)
+ {
+ for (int i = 0; i < arr.Length; i++)
+ {
+ // 'readonly' prefix on call to array's Address method must be respected, and the type check bypassed
+ arr[0, i].Frob();
+ }
+ }
+ }
+
+ private static int Main()
+ {
+ Foo<IFrobber>.FrobAll(new Frobber[,] { { new Frobber() } });
+ return 100;
+ }
+}
diff --git a/tests/src/Regressions/coreclr/9414/readonlyPrefix.csproj b/tests/src/Regressions/coreclr/9414/readonlyPrefix.csproj
new file mode 100644
index 0000000000..560073c0d1
--- /dev/null
+++ b/tests/src/Regressions/coreclr/9414/readonlyPrefix.csproj
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{CBD0D777-3583-49CC-8538-DD84447F6522}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <CLRTestKind>BuildAndRun</CLRTestKind>
+ <CLRTestPriority>0</CLRTestPriority>
+ </PropertyGroup>
+ <!-- Default configurations to help VS understand the configurations -->
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ </PropertyGroup>
+ <ItemGroup>
+ <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+ <Visible>False</Visible>
+ </CodeAnalysisDependentAssemblyPaths>
+ </ItemGroup>
+ <ItemGroup>
+ <!-- Add Compile Object Here -->
+ <Compile Include="readonlyPrefix.cs" />
+ </ItemGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+</Project> \ No newline at end of file
diff --git a/tests/src/TestWrappersConfig/TestWrappersConfig.csproj b/tests/src/TestWrappersConfig/TestWrappersConfig.csproj
new file mode 100644
index 0000000000..b108d48de7
--- /dev/null
+++ b/tests/src/TestWrappersConfig/TestWrappersConfig.csproj
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <CLRTestKind>BuildOnly</CLRTestKind>
+ <IsTestProject>false</IsTestProject>
+ </PropertyGroup>
+ <ItemGroup>
+ <PackageReference Include="Microsoft.NETCore.Platforms">
+ <Version>2.0.0-$(CoreFxExpectedPrerelease)</Version>
+ </PackageReference>
+ <PackageReference Include="xunit">
+ <Version>$(XunitPackageVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="xunit.assert">
+ <Version>$(XunitPackageVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="xunit.core">
+ <Version>$(XunitPackageVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="xunit.runner.msbuild">
+ <Version>$(XunitPackageVersion)</Version>
+ </PackageReference>
+ </ItemGroup>
+ <PropertyGroup>
+ <TargetFrameworks>netcoreapp1.1;net45</TargetFrameworks>
+ <TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier>
+ <PackageTargetFallback>$(PackageTargetFallback);dnxcore50;portable-net45+win8</PackageTargetFallback>
+ <RuntimeIdentifiers>win7-x86;win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;osx.10.12-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64</RuntimeIdentifiers>
+ <ContainsPackageReferences>true</ContainsPackageReferences>
+ <PrereleaseResolveNuGetPackages>false</PrereleaseResolveNuGetPackages>
+ </PropertyGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <Target Name="Build"
+ DependsOnTargets="ResolveReferences" />
+</Project> \ No newline at end of file
diff --git a/tests/src/TestWrappersConfig/project.json b/tests/src/TestWrappersConfig/project.json
deleted file mode 100644
index 56585e12b7..0000000000
--- a/tests/src/TestWrappersConfig/project.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "dependencies": {
- "Microsoft.NETCore.Platforms": "2.0.0-preview1-25221-01",
- "xunit": "2.2.0-beta2-build3300",
- "xunit.assert": "2.2.0-beta2-build3300",
- "xunit.core": "2.2.0-beta2-build3300",
- "xunit.runner.msbuild": "2.2.0-beta2-build3300"
- },
- "frameworks": {
- "netcoreapp1.1": {
- "imports": [
- "dnxcore50",
- "portable-net45+win8"
- ]
- },
- "net45": {
- "imports": "portable-net45+win8"
- }
- },
- "runtimes": {
- "win7-x86": {},
- "win7-x64": {},
- "ubuntu.14.04-x64": {},
- "ubuntu.16.04-x64": {},
- "ubuntu.16.10-x64": {},
- "osx.10.12-x64": {},
- "centos.7-x64": {},
- "rhel.7-x64": {},
- "debian.8-x64": {},
- "fedora.24-x64": {}
- }
-}
diff --git a/tests/src/baseservices/compilerservices/RuntimeWrappedException/RuntimeWrappedException.cs b/tests/src/baseservices/compilerservices/RuntimeWrappedException/RuntimeWrappedException.cs
index 29fb347ae1..00f1db420c 100644
--- a/tests/src/baseservices/compilerservices/RuntimeWrappedException/RuntimeWrappedException.cs
+++ b/tests/src/baseservices/compilerservices/RuntimeWrappedException/RuntimeWrappedException.cs
@@ -25,27 +25,12 @@ class Test
{
// Console.WriteLine("Incorrect exception and/or message. Expected RuntimeWrappedException: An object that does not derive "+
// "from System.Exception has been wrapped in a RuntimeWrappedException.\n But actually got: " + ex.InnerException);
- retVal = -1;
+ return -1;
}
StreamingContext ctx;
-
-// TODO: Expose once we have access to FormatterConverter
-// var info = new SerializationInfo(typeof(RuntimeWrappedException), new FormatterConverter());
-// ex.GetObjectData(info,ctx);
-//
- try
- {
- ex.GetObjectData(null,ctx);
- }
- catch (ArgumentNullException ex1)
- {
- retVal = 100;
- }
- catch (Exception ex1)
- {
- retVal = -1;
- }
+
+ retVal = 100;
}
diff --git a/tests/src/dir.props b/tests/src/dir.props
index cb976cc081..245e9f7982 100644
--- a/tests/src/dir.props
+++ b/tests/src/dir.props
@@ -13,6 +13,7 @@
<SkipSigning Condition="'$(CrossGen)' == 'true'">true</SkipSigning>
<!-- Set the project.json directory for generated TestWrappers. -->
<TestWrappersPackagesConfigFileDirectory>$(MSBuildThisFileDirectory)TestWrappersConfig\</TestWrappersPackagesConfigFileDirectory>
+ <AssemblyKey>Test</AssemblyKey>
</PropertyGroup>
<!-- Expose the target OS in a more convenient fashion -->
@@ -75,16 +76,23 @@
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
+ <!-- Don't reference the mscorlib facade -->
+ <PropertyGroup>
+ <ExcludeMscorlibFacade>true</ExcludeMscorlibFacade>
+ </PropertyGroup>
+
<!-- Set default ZapRequire level (used only when CrossGen is enabled) -->
<PropertyGroup>
<ZapRequire Condition="'$(ZapRequire)' == ''">2</ZapRequire>
</PropertyGroup>
<PropertyGroup>
- <ProjectJson>$(SourceDir)Common\test_dependencies\project.json</ProjectJson>
- <ProjectLockJson>$(SourceDir)Common\test_dependencies\project.lock.json</ProjectLockJson>
+ <RestoreOutputPath>$(MSBuildProjectDirectory)\obj</RestoreOutputPath>
<!-- Specify the target framework of the common test dependency project.json. -->
<NuGetTargetMoniker>.NETCoreApp,Version=v2.0</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netcoreapp2.0</NuGetTargetMonikerShort>
+ <PrereleaseResolveNuGetPackages>true</PrereleaseResolveNuGetPackages>
</PropertyGroup>
+
</Project>
diff --git a/tests/src/dir.targets b/tests/src/dir.targets
index 08c77df7cf..4e6c618021 100644
--- a/tests/src/dir.targets
+++ b/tests/src/dir.targets
@@ -50,11 +50,6 @@
<_CLRTestNeedsProjectToRun Condition=" '$(_CLRTestNeedsToRun)' and '!$(_CLRTestBuildsExecutable)' ">true</_CLRTestNeedsProjectToRun>
</PropertyGroup>
- <PropertyGroup Condition="'$(ReferenceSystemPrivateCoreLib)' == 'true'">
- <ProjectJson>$(SourceDir)Common/empty/project.json</ProjectJson>
- <ProjectLockJson>$(SourceDir)Common/empty/project.lock.json</ProjectLockJson>
- </PropertyGroup>
-
<!--
If it needs ProjectToRun, turn the project into a ProjectReference so it gets built
-->
@@ -189,4 +184,13 @@
DestinationFolder="$(OutputPath)"
Condition="Exists('$(AssemblyName).reflect.xml')"/>
</Target>
+
+ <PropertyGroup>
+ <ProjectAssetsFile>$(SourceDir)Common\test_dependencies\obj\project.assets.json</ProjectAssetsFile>
+ </PropertyGroup>
+
+ <PropertyGroup Condition="'$(ReferenceSystemPrivateCoreLib)' == 'true'">
+ <ProjectAssetsFile></ProjectAssetsFile >
+ </PropertyGroup>
+
</Project>
diff --git a/tests/src/dirs.proj b/tests/src/dirs.proj
index e49ab945a7..6ae2b7c09e 100644
--- a/tests/src/dirs.proj
+++ b/tests/src/dirs.proj
@@ -23,9 +23,11 @@
<DisabledProjects Include="Common\build_against_pkg_dependencies\build_against_pkg_dependencies.csproj" />
<DisabledProjects Include="Common\targeting_pack_ref\targeting_pack_ref.csproj" />
<DisabledProjects Include="Common\external\external.csproj" />
- <DisabledProjects Include="Common\external\external.depproj" />
+ <DisabledProjects Include="Common\PerfHarness\PerfHarness.csproj" />
<DisabledProjects Include="GC\Performance\Framework\GCPerfTestFramework.csproj" />
<DisabledProjects Include="JIT\superpmi\superpmicollect.csproj" Condition="'$(BuildTestsAgainstPackages)' == 'true'" />
+ <DisabledProjects Include="JIT\config\**" />
+ <DisabledProjects Include="Performance\performance.csproj" />
<DisabledProjects Include="Loader\classloader\generics\regressions\DD117522\Test.csproj" />
<DisabledProjects Include="Loader\classloader\generics\GenericMethods\VSW491668.csproj" /> <!-- issue 5501 -->
</ItemGroup>
diff --git a/tests/src/performance/linkbench/assets/MusicStore/Get-Crossgen.ps1 b/tests/src/performance/linkbench/assets/MusicStore/Get-Crossgen.ps1
new file mode 100644
index 0000000000..9a7cdf9802
--- /dev/null
+++ b/tests/src/performance/linkbench/assets/MusicStore/Get-Crossgen.ps1
@@ -0,0 +1,77 @@
+# Gets crossgen.exe
+#
+# Downloads NuGet.exe
+# Installs crossgen.exe and clrjit.dll using NuGet
+# Copies the files to $path
+
+param([string]$path = ".")
+
+$ErrorActionPreference = "Stop"
+
+Write-Host -ForegroundColor Green "Installing crossgen.exe to $path"
+
+if (-not (Test-Path $path))
+{
+ New-Item -Path $path -ItemType Directory -Force | Out-Null
+}
+
+$path = Get-Item $path
+
+function Get-NETCoreAppVersion()
+{
+ if (-not (Test-Path $PSScriptRoot\obj\project.assets.json))
+ {
+ Write-Error "project.assets.json is missing. do a dotnet restore."
+ exit
+ }
+
+ # ConvertFrom-Json can't be used here as it has an arbitrary size limit.
+ [void][System.Reflection.Assembly]::LoadWithPartialName("System.Web.Extensions")
+ $serializer = New-Object -TypeName System.Web.Script.Serialization.JavaScriptSerializer
+ $serializer.MaxJsonLength = 67108864
+
+ $json = $serializer.DeserializeObject((Get-Content $PSScriptRoot\obj\project.assets.json -Raw))
+
+ foreach ($name in $json["libraries"].Keys)
+ {
+ if ($name.StartsWith("Microsoft.NETCore.App/"))
+ {
+ $version = $name.SubString("Microsoft.NETCore.App/".Length)
+ break
+ }
+ }
+
+ return $version
+}
+
+$version = Get-NETCoreAppVersion
+Write-Host -ForegroundColor Green "autodetected shared framework version $version"
+
+$platform = "win-x64"
+
+$netcoreapppackage = "runtime.$platform.microsoft.netcore.app"
+$netcoreappversion = $version
+
+Write-Host -ForegroundColor Green "Getting NuGet.exe"
+
+$nugeturl = "https://dist.nuget.org/win-x86-commandline/v3.4.4/NuGet.exe"
+$nugetfeed = "https://dotnet.myget.org/F/dotnet-core/api/v3/index.json"
+$nugetexepath = "$path\NuGet.exe"
+$wc = New-Object System.Net.WebClient
+$wc.DownloadFile($nugeturl, $nugetexepath)
+
+
+Write-Host -ForegroundColor Green "Getting $netcoreapppackage $netcoreappversion"
+
+& "$nugetexepath" "install", "$netcoreapppackage", "-Source", "$nugetfeed", "-Version", "$netcoreappversion", "-OutputDirectory", "$path"
+if ($LastExitCode -ne 0) {
+ throw "NuGet install of $netcoreapppackage failed."
+}
+
+Copy-Item "$path\$netcoreapppackage.$netcoreappversion\tools\crossgen.exe" "$path\crossgen.exe" -Force
+Copy-Item "$path\$netcoreapppackage.$netcoreappversion\runtimes\$platform\native\clrjit.dll" "$path\clrjit.dll" -Force
+Remove-Item "$path\$netcoreapppackage.$netcoreappversion\" -recurse
+
+Remove-Item "$path\NuGet.exe"
+
+Write-Host -ForegroundColor Green "Success"
diff --git a/tests/src/performance/linkbench/assets/Roslyn/illinkcsproj b/tests/src/performance/linkbench/assets/Roslyn/illinkcsproj
index 1247c5e715..c8549e2d47 100644
--- a/tests/src/performance/linkbench/assets/Roslyn/illinkcsproj
+++ b/tests/src/performance/linkbench/assets/Roslyn/illinkcsproj
@@ -1,9 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <TargetFramework>netcoreapp2.0</TargetFramework>
- <RuntimeIdentifiers>win7-x86;win7-x64</RuntimeIdentifiers>
+ <OutputType>Exe</OutputType>
+ <TargetFramework>netcoreapp1.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
- <PackageReference Include="ILLink.Tasks" Version="0.1.0-preview" />
+ <PackageReference Include="Microsoft.NETCore.ILLink" Version="0.1.9-preview" />
</ItemGroup>
</Project>
+
diff --git a/tests/src/performance/linkbench/linkbench.cs b/tests/src/performance/linkbench/linkbench.cs
index 3d29957f90..ad0f83ef0e 100644
--- a/tests/src/performance/linkbench/linkbench.cs
+++ b/tests/src/performance/linkbench/linkbench.cs
@@ -1,3 +1,5 @@
+using Microsoft.Xunit.Performance;
+using Microsoft.Xunit.Performance.Api;
using System;
using System.Diagnostics;
using System.Collections.Generic;
@@ -8,8 +10,6 @@ using System.Text;
using System.Globalization;
using System.Linq;
using System.Xml.Linq;
-using Microsoft.Xunit.Performance;
-using Microsoft.Xunit.Performance.Api;
using Xunit;
using Xunit.Abstractions;
@@ -18,7 +18,8 @@ namespace LinkBench
public class Benchmark
{
public string Name;
-
+ public bool ShouldRun;
+ public string ProjFile;
public string UnlinkedDir;
public string LinkedDir;
public double UnlinkedMsilSize;
@@ -28,18 +29,29 @@ namespace LinkBench
public double MsilSizeReduction;
public double DirSizeReduction;
+ public delegate void SetupDelegate();
+ public SetupDelegate Setup;
+
private DirectoryInfo unlinkedDirInfo;
private DirectoryInfo linkedDirInfo;
private double certDiff;
const double MB = 1024 * 1024;
- public Benchmark(string _Name, string _UnlinkedDir, string _LinkedDir)
+ public Benchmark(string _Name, string _UnlinkedDir, string _LinkedDir, SetupDelegate _setup = null, bool _shouldRun = false)
{
Name = _Name;
UnlinkedDir = _UnlinkedDir;
LinkedDir = _LinkedDir;
unlinkedDirInfo = new DirectoryInfo(UnlinkedDir);
linkedDirInfo = new DirectoryInfo(LinkedDir);
+ ShouldRun = _shouldRun;
+ Setup = _setup;
+ }
+
+ public void SetToRun()
+ {
+ ShouldRun = true;
+ Environment.SetEnvironmentVariable("__test_" + Name, "true");
}
public void Compute()
@@ -50,8 +62,8 @@ namespace LinkBench
UnlinkedDirSize = GetDirSize(unlinkedDirInfo);
LinkedDirSize = GetDirSize(linkedDirInfo);
- MsilSizeReduction = (UnlinkedMsilSize - LinkedMsilSize) / UnlinkedMsilSize * 100;
- DirSizeReduction = (UnlinkedDirSize - LinkedDirSize) / UnlinkedDirSize * 100;
+ MsilSizeReduction = LinkedMsilSize / UnlinkedMsilSize;
+ DirSizeReduction = LinkedDirSize / UnlinkedDirSize;
}
// Compute total size of a directory, in MegaBytes
@@ -82,20 +94,10 @@ namespace LinkBench
foreach (string file in files)
{
- if (file.EndsWith(".ni.dll") || file.EndsWith(".ni.exe"))
+ if (IsMSIL(file))
{
- continue;
+ msilSize += new FileInfo(file).Length;
}
- try
- {
- AssemblyLoadContext.GetAssemblyName(file);
- }
- catch (BadImageFormatException)
- {
- continue;
- }
-
- msilSize += new FileInfo(file).Length;
}
return msilSize / MB;
@@ -126,22 +128,104 @@ namespace LinkBench
foreach (string file in files)
{
- try
+ if (IsMSIL(file))
{
- AssemblyLoadContext.GetAssemblyName(file);
+ FileInfo fileInfo = new FileInfo(file);
+ long linkedCert = GetCertSize(file);
+ long unlinkedCert = GetCertSize(UnlinkedDir + "\\" + fileInfo.Name);
+ totalDiff += (unlinkedCert - linkedCert);
}
- catch (BadImageFormatException)
+ }
+
+ return totalDiff / MB;
+ }
+
+ //Use AssemblyLoadContext.GetAssemblyName(file);
+ private bool IsMSIL(string file)
+ {
+ if (file.EndsWith(".ni.dll") || file.EndsWith(".ni.exe"))
+ {
+ // Likely Native Image.
+ return false;
+ }
+
+ try
+ {
+ AssemblyLoadContext.GetAssemblyName(file);
+ }
+ catch (Exception)
+ {
+ // We should check only for BadImageFormatException.
+ // But Checking for any exception until the following
+ // issue is fixed:
+ // https://github.com/dotnet/coreclr/issues/11499
+
+ return false;
+ }
+
+ return true;
+ }
+
+ public static void AddLinkerReference(string csproj)
+ {
+ var xdoc = XDocument.Load(csproj);
+ var ns = xdoc.Root.GetDefaultNamespace();
+ bool added = false;
+ foreach (var el in xdoc.Root.Elements(ns + "ItemGroup"))
+ {
+ if (el.Elements(ns + "PackageReference").Any())
{
- continue;
+ el.Add(new XElement(ns + "PackageReference",
+ new XAttribute("Include", "ILLink.Tasks"),
+ new XAttribute("Version", "0.1.4-preview")));
+ added = true;
+ break;
}
+ }
+ if (!added)
+ {
+ xdoc.Root.Add(new XElement(ns + "ItemGroup",
+ new XElement(ns + "PackageReference",
+ new XAttribute("Include", "ILLink.Tasks"),
+ new XAttribute("Version", "0.1.4-preview"))));
+ added = true;
+ }
+ using (var fs = new FileStream(csproj, FileMode.Create))
+ {
+ xdoc.Save(fs);
+ }
+ }
- FileInfo fileInfo = new FileInfo(file);
- long linkedCert = GetCertSize(file);
- long unlinkedCert = GetCertSize(UnlinkedDir + "\\" + fileInfo.Name);
- totalDiff += (unlinkedCert - linkedCert);
+ // TODO: remove this once the linker is able to handle
+ // ready-to-run assembies
+ public static void SetRuntimeFrameworkVersion(string csproj)
+ {
+ var xdoc = XDocument.Load(csproj);
+ var ns = xdoc.Root.GetDefaultNamespace();
+ var versionElement = xdoc.Root.Descendants(ns + "RuntimeFrameworkVersion").First();
+ string runtimeFrameworkVersion = "2.0.0-preview2-002093-00";
+ versionElement.Value = runtimeFrameworkVersion;
+ using (var fs = new FileStream(csproj, FileMode.Create))
+ {
+ xdoc.Save(fs);
}
+ }
- return totalDiff / MB;
+ // TODO: Remove this once we figure out what to do about apps
+ // that have the publish output filtered by a manifest
+ // file. It looks like aspnet has made this the default. See
+ // the bug at https://github.com/dotnet/sdk/issues/1160.
+ public static void PreventPublishFiltering(string csproj)
+ {
+ var xdoc = XDocument.Load(csproj);
+ var ns = xdoc.Root.GetDefaultNamespace();
+ var propertygroup = xdoc.Root.Element(ns + "PropertyGroup");
+ propertygroup.Add(new XElement(ns + "PublishWithAspNetCoreTargetManifest",
+ "false"));
+ using (var fs = new FileStream(csproj, FileMode.Create))
+ {
+ xdoc.Save(fs);
+ }
}
}
@@ -149,42 +233,132 @@ namespace LinkBench
{
private static ScenarioConfiguration scenarioConfiguration = new ScenarioConfiguration(new TimeSpan(2000000));
private static MetricModel SizeMetric = new MetricModel { Name = "Size", DisplayName = "File Size", Unit = "MB" };
- private static MetricModel PercMetric = new MetricModel { Name = "Perc", DisplayName = "% Reduction", Unit = "%" };
+ private static MetricModel PercMetric = new MetricModel { Name = "Ratio", DisplayName = "Reduction", Unit = "Linked/Unlinked" };
public static string Workspace;
+ public static string LinkBenchRoot;
public static string ScriptDir;
public static string AssetsDir;
private static Benchmark CurrentBenchmark;
+ private static Benchmark[] Benchmarks =
+ {
+ new Benchmark("HelloWorld",
+ "HelloWorld\\bin\\release\\netcoreapp2.0\\win10-x64\\unlinked",
+ "HelloWorld\\bin\\release\\netcoreapp2.0\\win10-x64\\linked",
+ () => Benchmark.AddLinkerReference("HelloWorld\\HelloWorld.csproj")),
+ new Benchmark("WebAPI",
+ "WebAPI\\bin\\release\\netcoreapp2.0\\win10-x64\\unlinked",
+ "WebAPI\\bin\\release\\netcoreapp2.0\\win10-x64\\linked",
+ () => { Benchmark.AddLinkerReference("WebAPI\\WebAPI.csproj");
+ Benchmark.PreventPublishFiltering("WebAPI\\WebAPI.csproj"); }),
+ //Remove the MusicStore from the run as the scenario is currently flaky and breaking performance runs
+ /*new Benchmark("MusicStore",
+ "JitBench\\src\\MusicStore\\bin\\release\\netcoreapp2.0\\win10-x64\\unlinked",
+ "JitBench\\src\\MusicStore\\bin\\release\\netcoreapp2.0\\win10-x64\\linked",
+ () => { Benchmark.AddLinkerReference("JitBench\\src\\MusicStore\\MusicStore.csproj");
+ Benchmark.SetRuntimeFrameworkVersion("JitBench\\src\\MusicStore\\MusicStore.csproj"); }),
+ new Benchmark("MusicStore_R2R",
+ "JitBench\\src\\MusicStore\\bin\\release\\netcoreapp2.0\\win10-x64\\R2R\\unlinked",
+ "JitBench\\src\\MusicStore\\bin\\release\\netcoreapp2.0\\win10-x64\\R2R\\linked"),*/
+ new Benchmark("Corefx",
+ "corefx\\bin\\ILLinkTrimAssembly\\netcoreapp-Windows_NT-Release-x64\\pretrimmed",
+ "corefx\\bin\\ILLinkTrimAssembly\\netcoreapp-Windows_NT-Release-x64\\trimmed"),
+ /*new Benchmark("Roslyn",
+ "roslyn\\Binaries\\Release\\Exes\\CscCore\\win7-x64\\publish",
+ "roslyn\\Binaries\\Release\\Exes\\CscCore\\win7-x64\\Linked") */
+ };
+
+ static int UsageError()
+ {
+ Console.WriteLine("Usage: LinkBench [--nosetup] [--nobuild] [--perf:runid <id>] [<benchmarks>]");
+ Console.WriteLine(" --nosetup: Don't clone and fixup benchmark repositories");
+ Console.WriteLine(" --nosetup: Don't build and link benchmarks");
+ Console.WriteLine(" --perf:runid: Specify the ID to append to benchmark result files");
+ Console.WriteLine(" Benchmarks: HelloWorld, WebAPI, MusicStore, MusicStore_R2R, CoreFX, Roslyn");
+ Console.WriteLine(" Default is to run all the above benchmarks.");
+ return -4;
+ }
+
public static int Main(String [] args)
{
- // Workspace is the ROOT of the coreclr tree.
- // If CORECLR_REPO is not set, the script assumes that the location of sandbox
- // is <path>\coreclr\sandbox.
- bool doClone = true;
+ bool doSetup = true;
bool doBuild = true;
+ string runId = "";
+ string runOne = null;
+ bool benchmarkSpecified = false;
- for(int i=0; i < args.Length; i++)
+ for (int i = 0; i < args.Length; i++)
{
- if (String.Compare(args[i], "noclone", true) == 0)
+ if (String.Compare(args[i], "--nosetup", true) == 0)
{
- doClone = false;
+ doSetup = false;
}
- else if (String.Compare(args[i], "nobuild", true) == 0)
+ else if (String.Compare(args[i], "--nobuild", true) == 0)
{
- doClone = false;
+ doSetup = false;
doBuild = false;
}
+ else if (String.Compare(args[i], "--perf:runid", true) == 0)
+ {
+ if (i + 1 < args.Length)
+ {
+ runId = args[++i] + "-";
+ }
+ else
+ {
+ Console.WriteLine("Missing runID ");
+ return UsageError();
+ }
+ }
+ else if (args[i][0] == '-')
+ {
+ Console.WriteLine("Unknown Option {0}", args[i]);
+ return UsageError();
+ }
else
{
- Console.WriteLine("Unknown argument");
- return -4;
+ foreach (Benchmark benchmark in Benchmarks)
+ {
+ if (String.Compare(args[i], benchmark.Name, true) == 0)
+ {
+ benchmark.SetToRun();
+ benchmarkSpecified = true;
+ break;
+ }
+ }
+
+ if (!benchmarkSpecified)
+ {
+ Console.WriteLine("Unknown Benchmark {0}", args[i]);
+ }
}
}
+ // If benchmarks are not explicitly specified, run all benchmarks
+ if (!benchmarkSpecified)
+ {
+ foreach (Benchmark benchmark in Benchmarks)
+ {
+ if (String.Compare(benchmark.Name, "CoreFX", true) == 0)
+ {
+ // CoreFX is not enabled by default, because the lab cannot run it yet.
+ // Jenkins runs on an older OS with path-length limit, which causes
+ // CoreFX build to fail.
+ continue;
+ }
+
+ benchmark.SetToRun();
+ }
+ }
+
+ // Workspace is the ROOT of the coreclr tree.
+ // If CORECLR_REPO is not set, the script assumes that the location of sandbox
+ // is <path>\coreclr\sandbox.
+ LinkBenchRoot = Directory.GetCurrentDirectory();
Workspace = Environment.GetEnvironmentVariable("CORECLR_REPO");
if (Workspace == null)
{
- Workspace = Directory.GetParent(Directory.GetCurrentDirectory()).FullName;
+ Workspace = Directory.GetParent(LinkBenchRoot).FullName;
}
if (Workspace == null)
{
@@ -192,38 +366,38 @@ namespace LinkBench
return -1;
}
- string LinkBenchDir = Workspace + "\\tests\\src\\performance\\linkbench\\";
- ScriptDir = LinkBenchDir + "scripts\\";
- AssetsDir = LinkBenchDir + "assets\\";
+ string linkBenchSrcDir = Workspace + "\\tests\\src\\performance\\linkbench\\";
+ ScriptDir = linkBenchSrcDir + "scripts\\";
+ AssetsDir = linkBenchSrcDir + "assets\\";
- Benchmark[] Benchmarks =
- {
- new Benchmark("HelloWorld",
- "LinkBench\\HelloWorld\\bin\\release\\netcoreapp2.0\\win10-x64\\publish",
- "LinkBench\\HelloWorld\\bin\\release\\netcoreapp2.0\\win10-x64\\linked"),
- new Benchmark("WebAPI",
- "LinkBench\\WebAPI\\bin\\release\\netcoreapp2.0\\win10-x64\\publish",
- "LinkBench\\WebAPI\\bin\\release\\netcoreapp2.0\\win10-x64\\linked"),
- new Benchmark("MusicStore",
- "LinkBench\\JitBench\\src\\MusicStore\\bin\\release\\netcoreapp2.0\\win10-x64\\publish",
- "LinkBench\\JitBench\\src\\MusicStore\\bin\\release\\netcoreapp2.0\\win10-x64\\linked"),
- new Benchmark("MusicStore_R2R",
- "LinkBench\\JitBench\\src\\MusicStore\\bin\\release\\netcoreapp2.0\\win10-x64\\publish_r2r",
- "LinkBench\\JitBench\\src\\MusicStore\\bin\\release\\netcoreapp2.0\\win10-x64\\linked_r2r"),
- new Benchmark("Corefx",
- "LinkBench\\corefx\\bin\\ILLinkTrimAssembly\\netcoreapp-Windows_NT-Release-x64\\pretrimmed",
- "LinkBench\\corefx\\bin\\ILLinkTrimAssembly\\netcoreapp-Windows_NT-Release-x64\\trimmed"),
- new Benchmark("Roslyn",
- "LinkBench\\roslyn\\Binaries\\Release\\Exes\\CscCore",
- "LinkBench\\roslyn\\Binaries\\Release\\Exes\\Linked"),
- };
+ Environment.SetEnvironmentVariable("LinkBenchRoot", LinkBenchRoot);
+ Environment.SetEnvironmentVariable("__dotnet1", LinkBenchRoot + "\\.Net1\\dotnet.exe");
+ Environment.SetEnvironmentVariable("__dotnet2", LinkBenchRoot + "\\.Net2\\dotnet.exe");
// Update the build files to facilitate the link step
- if(doClone)
+ if (doSetup)
{
- if(!Setup())
+ // Clone the benchmarks
+ using (var setup = new Process())
{
- return -2;
+ setup.StartInfo.FileName = ScriptDir + "clone.cmd";
+ setup.Start();
+ setup.WaitForExit();
+ if (setup.ExitCode != 0)
+ {
+ Console.WriteLine("Benchmark Setup failed");
+ return -2;
+ }
+ }
+
+ // Setup the benchmarks
+
+ foreach (Benchmark benchmark in Benchmarks)
+ {
+ if (benchmark.ShouldRun && benchmark.Setup != null)
+ {
+ benchmark.Setup();
+ }
}
}
@@ -238,7 +412,7 @@ namespace LinkBench
setup.WaitForExit();
if (setup.ExitCode != 0)
{
- Console.WriteLine("Setup failed");
+ Console.WriteLine("Benchmark build failed");
return -3;
}
}
@@ -255,8 +429,12 @@ namespace LinkBench
for (int i = 0; i < Benchmarks.Length; i++)
{
CurrentBenchmark = Benchmarks[i];
- string[] scriptArgs = { "--perf:runid", CurrentBenchmark.Name };
+ if (!CurrentBenchmark.ShouldRun)
+ {
+ continue;
+ }
+ string[] scriptArgs = { "--perf:runid", runId + CurrentBenchmark.Name };
using (var h = new XunitPerformanceHarness(scriptArgs))
{
h.RunScenario(emptyCmd, null, null, PostRun, scenarioConfiguration);
@@ -280,81 +458,14 @@ namespace LinkBench
addMeasurement(ref scenario, "MSIL Unlinked", SizeMetric, CurrentBenchmark.UnlinkedMsilSize);
addMeasurement(ref scenario, "MSIL Linked", SizeMetric, CurrentBenchmark.LinkedMsilSize);
- addMeasurement(ref scenario, "MSIL %Reduction", PercMetric, CurrentBenchmark.MsilSizeReduction);
+ addMeasurement(ref scenario, "MSIL Reduction", PercMetric, CurrentBenchmark.MsilSizeReduction);
addMeasurement(ref scenario, "Total Uninked", SizeMetric, CurrentBenchmark.UnlinkedDirSize);
addMeasurement(ref scenario, "Total Linked", SizeMetric, CurrentBenchmark.LinkedDirSize);
- addMeasurement(ref scenario, "Total %Reduction", PercMetric, CurrentBenchmark.DirSizeReduction);
+ addMeasurement(ref scenario, "Total Reduction", PercMetric, CurrentBenchmark.DirSizeReduction);
return scenario;
}
- private static bool Setup()
- {
- // Clone the benchmarks
- using (var setup = new Process())
- {
- setup.StartInfo.FileName = ScriptDir + "clone.cmd";
- Console.WriteLine("Run {0}", setup.StartInfo.FileName);
- setup.Start();
- setup.WaitForExit();
- if (setup.ExitCode != 0)
- {
- Console.WriteLine("clone failed");
- return false;
- }
- }
-
- //Update the project files
- AddLinkerReference("LinkBench\\HelloWorld\\HelloWorld.csproj");
- AddLinkerReference("LinkBench\\WebAPI\\WebAPI.csproj");
- AddLinkerReference("LinkBench\\JitBench\\src\\MusicStore\\MusicStore.csproj");
- RemoveCrossgenTarget("LinkBench\\JitBench\\src\\MusicStore\\MusicStore.csproj");
-
- return true;
- }
-
- private static void AddLinkerReference(string csproj)
- {
- var xdoc = XDocument.Load(csproj);
- var ns = xdoc.Root.GetDefaultNamespace();
- bool added = false;
- foreach (var el in xdoc.Root.Elements(ns + "ItemGroup"))
- {
- if (el.Elements(ns + "PackageReference").Any())
- {
- el.Add(new XElement(ns + "PackageReference",
- new XAttribute("Include", "ILLink.Tasks"),
- new XAttribute("Version", "0.1.0-preview")));
- added = true;
- break;
- }
- }
- if (!added)
- {
- xdoc.Root.Add(new XElement(ns + "ItemGroup",
- new XElement(ns + "PackageReference",
- new XAttribute("Include", "ILLink.Tasks"),
- new XAttribute("Version", "0.1.0-preview"))));
- added = true;
- }
- using (var fs = new FileStream(csproj, FileMode.Create))
- {
- xdoc.Save(fs);
- }
- }
-
- private static void RemoveCrossgenTarget(string csproj)
- {
- var xdoc = XDocument.Load(csproj);
- var ns = xdoc.Root.GetDefaultNamespace();
- var target = xdoc.Root.Element(ns + "Target");
- target.Remove();
- using (var fs = new FileStream(csproj, FileMode.Create))
- {
- xdoc.Save(fs);
- }
- }
-
private static void addMeasurement(ref ScenarioBenchmark scenario, string name, MetricModel metric, double value)
{
var iteration = new IterationModel
diff --git a/tests/src/performance/linkbench/linkbench.csproj b/tests/src/performance/linkbench/linkbench.csproj
index 2a3048ab21..46c79ff039 100644
--- a/tests/src/performance/linkbench/linkbench.csproj
+++ b/tests/src/performance/linkbench/linkbench.csproj
@@ -16,6 +16,7 @@
<NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
<DefineConstants>$(DefineConstants);STATIC</DefineConstants>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
@@ -23,8 +24,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
</PropertyGroup>
<PropertyGroup>
- <ProjectJson>..\project.json</ProjectJson>
- <ProjectLockJson>..\project.lock.json</ProjectLockJson>
+ <RestoreOutputPath>..\obj</RestoreOutputPath>
</PropertyGroup>
<ItemGroup>
<CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
diff --git a/tests/src/performance/linkbench/scripts/build.cmd b/tests/src/performance/linkbench/scripts/build.cmd
index 88b7eb139e..12f9f3f951 100644
--- a/tests/src/performance/linkbench/scripts/build.cmd
+++ b/tests/src/performance/linkbench/scripts/build.cmd
@@ -1,103 +1,141 @@
+setlocal ENABLEDELAYEDEXPANSION
@echo off
REM Usage: Build.cmd <LinkBench assets directory>
setlocal
-call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat"
-set ROOT=%cd%\LinkBench
set AssetDir=%1
set ExitCode=0
-mkdir LinkBench 2> nul
-pushd %ROOT%
+pushd %LinkBenchRoot%
+set __CORFLAGS="%VS140COMNTOOLS%\..\..\..\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\CorFlags.exe"
+if not exist %__CORFLAGS% (
+ echo corflags.exe not found
+ exit /b -1
+)
+
+if defined __test_HelloWorld call :HelloWorld
+if defined __test_WebAPI call :WebAPI
+if defined __test_MusicStore call :MusicStore
+if defined __test_MusicStore_R2R call :MusicStore_R2R
+if defined __test_CoreFx call :CoreFx
+if defined __test_Roslyn call :Roslyn
+
+popd
+exit /b %ExitCode%
+
+:HelloWorld
echo Build ** HelloWorld **
-cd %ROOT%\HelloWorld
-dotnet restore -r win10-x64
-dotnet publish -c release -r win10-x64
-dotnet msbuild /t:Link /p:LinkerMode=sdk /p:RuntimeIdentifier=win10-x64 /v:n /p:Configuration=release
+pushd %LinkBenchRoot%\HelloWorld
+call %__dotnet2% restore -r win10-x64
+call %__dotnet2% publish -c release -r win10-x64 /p:LinkDuringPublish=false --output bin\release\netcoreapp2.0\win10-x64\Unlinked
+call %__dotnet2% publish -c release -r win10-x64 --output bin\release\netcoreapp2.0\win10-x64\Linked
if errorlevel 1 set ExitCode=1
-echo -- Done --
+popd
+exit /b
+:WebAPI
echo Build ** WebAPI **
-cd %ROOT%\WebAPI
-dotnet restore -r win10-x64
-dotnet publish -c release -r win10-x64
-dotnet msbuild /t:Link /p:LinkerMode=sdk /p:RuntimeIdentifier=win10-x64 /v:n /p:Configuration=release
+pushd %LinkBenchRoot%\WebAPI
+call %__dotnet2% restore -r win10-x64
+call %__dotnet2% publish -c release -r win10-x64 /p:LinkDuringPublish=false --output bin\release\netcoreapp2.0\win10-x64\unlinked
+call %__dotnet2% publish -c release -r win10-x64 --output bin\release\netcoreapp2.0\win10-x64\linked
if errorlevel 1 set ExitCode=1
-echo -- Done --
+popd
+exit /b
+:MusicStore
echo Build ** MusicStore **
-cd %ROOT%\JitBench\src\MusicStore
+pushd %LinkBenchRoot%\JitBench\src\MusicStore
copy %AssetDir%\MusicStore\MusicStoreReflection.xml .
-dotnet restore -r win10-x64
-dotnet publish -c release -r win10-x64
-dotnet msbuild /t:Link /p:LinkerMode=sdk /p:RuntimeIdentifier=win10-x64 /v:n /p:LinkerRootFiles=MusicStoreReflection.xml /p:Configuration=release
+call %__dotnet2% restore -r win10-x64
+call %__dotnet2% publish -c release -r win10-x64 /p:LinkerRootDescriptors=MusicStoreReflection.xml /p:LinkDuringPublish=false --output bin\release\netcoreapp2.0\win10-x64\unlinked
+call %__dotnet2% publish -c release -r win10-x64 /p:LinkerRootDescriptors=MusicStoreReflection.xml --output bin\release\netcoreapp2.0\win10-x64\linked
if errorlevel 1 set ExitCode=1
-echo -- Done --
+popd
+exit /b
+:MusicStore_R2R
+REM Since the musicstore benchmark has a workaround to use an old framework (to get non-crossgen'd packages),
+REM we need to run crossgen on these assemblies manually for now.
+REM Even once we have the linker running on R2R assemblies and remove this workaround,
+REM we'll need a way to get the pre-crossgen assemblies for the size comparison.
+REM We need to use it to crossgen the linked assemblies for the size comparison,
+REM since the linker targets don't yet include a way to crossgen the linked assemblies.
echo Build ** MusicStore Ready2Run **
-cd %ROOT%\JitBench\src\MusicStore
+pushd %LinkBenchRoot%\JitBench\src\MusicStore
+copy %AssetDir%\MusicStore\Get-Crossgen.ps1
powershell -noprofile -executionPolicy RemoteSigned -file Get-Crossgen.ps1
pushd bin\release\netcoreapp2.0\win10-x64\
-call :SetupR2R publish
+mkdir R2R
+call :SetupR2R unlinked
if errorlevel 1 set ExitCode=1
call :SetupR2R linked
if errorlevel 1 set ExitCode=1
-echo -- Done --
+popd
+exit /b
+:CoreFx
echo Build ** CoreFX **
-cd %ROOT%\corefx
+pushd %LinkBenchRoot%\corefx
set BinPlaceILLinkTrimAssembly=true
call build.cmd -release
if errorlevel 1 set ExitCode=1
-echo -- Done --
+popd
+exit /b
+:Roslyn
echo Build ** Roslyn **
-cd %ROOT%\roslyn
-copy %AssetDir%\Roslyn\RoslynRoots.txt .
-copy %AssetDir%\Roslyn\RoslynRoots.xml .
-set RoslynRoot=%cd%
-REM Build Roslyn
-call restore.cmd
-msbuild /m Roslyn.sln /p:Configuration=Release
+pushd %LinkBenchRoot%\roslyn
+
REM Fetch ILLink
-mkdir illink
+if not exist illink mkdir illink
cd illink
-copy %AssetDir%\Roslyn\illinkcsproj illink.csproj
-dotnet restore illink.csproj -r win10-x64 --packages bin
+copy %AssetDir%\Roslyn\illinkcsproj illink.csproj
+call %__dotnet1% restore --packages pkg
+if errorlevel 1 set ExitCode=1
+set __IlLinkDll=%cd%\pkg\microsoft.netcore.illink\0.1.9-preview\lib\netcoreapp1.1\illink.dll
cd ..
+
+REM Build CscCore
+call Restore.cmd
+cd src\Compilers\CSharp\CscCore
+call %__dotnet1% publish -c Release -r win7-x64
+if errorlevel 1 set ExitCode=1
+REM Published CscCore to Binaries\Release\Exes\CscCore\win7-x64\publish
+cd ..\..\..\..
+
REM Create Linker Directory
-cd Binaries\Release\Exes
+cd Binaries\Release\Exes\CscCore\win7-x64\
mkdir Linked
-cd CscCore
+
REM Copy Unmanaged Assets
+cd publish
FOR /F "delims=" %%I IN ('DIR /b *') DO (
- corflags %%I >nul 2> nul
- if errorlevel 1 copy %%I ..\Linked >nul
+ %__CORFLAGS% %%I
+ if errorlevel 1 copy %%I ..\Linked
)
copy *.ni.dll ..\Linked
+
REM Run Linker
-dotnet %RoslynRoot%\illink\bin\illink.tasks\0.1.0-preview\tools\illink.dll -t -c link -a @%RoslynRoot%\RoslynRoots.txt -x %RoslynRoot%\RoslynRoots.xml -l none -out ..\Linked
+call %__dotnet1% %__IlLinkDll% -t -c link -a @%AssetDir%\Roslyn\RoslynRoots.txt -x %AssetDir%\Roslyn\RoslynRoots.xml -l none -out ..\Linked
if errorlevel 1 set ExitCode=1
-echo -- Done --
popd
-
-:Done
-exit /b %ExitCode%
+exit /b
:SetupR2R
REM Create R2R directory and copy all contents from MSIL to R2R directory
-mkdir %1_r2r
-xcopy /E /Y /Q %1 %1_r2r
+mkdir R2R\%1
+xcopy /E /Y /Q %1 R2R\%1
REM Generate Ready2Run images for all MSIL files by running crossgen
-cd %1_r2r
-copy ..\..\..\..\..\crossgen.exe
+pushd R2R\%1
+copy ..\..\..\..\..\..\crossgen.exe
FOR /F %%I IN ('dir /b *.dll ^| find /V /I ".ni.dll" ^| find /V /I "System.Private.CoreLib" ^| find /V /I "mscorlib.dll"') DO (
REM Don't crossgen Corlib, since the native image already exists.
REM For all other MSIL files (corflags returns 0), run crossgen
- corflags %%I >nul 2>nul
+ %__CORFLAGS% %%I
if not errorlevel 1 (
- crossgen /Platform_Assemblies_Paths . %%I >nul 2>nul
+ crossgen.exe /Platform_Assemblies_Paths . %%I
if errorlevel 1 (
exit /b 1
)
@@ -112,5 +150,5 @@ FOR /F "delims=" %%I IN ('dir /b *.dll') DO (
ren %%~nI.ni.dll %%I
)
)
-cd ..
+popd
exit /b 0
diff --git a/tests/src/performance/linkbench/scripts/clone.cmd b/tests/src/performance/linkbench/scripts/clone.cmd
index ae28d41d08..60cfe202b6 100644
--- a/tests/src/performance/linkbench/scripts/clone.cmd
+++ b/tests/src/performance/linkbench/scripts/clone.cmd
@@ -1,30 +1,64 @@
+setlocal ENABLEDELAYEDEXPANSION
@echo off
-rmdir /s /q LinkBench
+set EXITCODE=0
+pushd %LinkBenchRoot%
-set ROOT=%cd%\LinkBench
-mkdir LinkBench 2> nul
-pushd %ROOT%
+if not exist %__dotnet1% call :DotNet
+if defined __test_HelloWorld call :HelloWorld
+if defined __test_WebAPI call :WebAPI
+if defined __test_MusicStore call :MusicStore
+if defined __test_MusicStore_R2R call :MusicStore_R2R
+if defined __test_CoreFx call :CoreFx
+if defined __test_Roslyn call :Roslyn
+
+popd
+exit /b %EXITCODE%
+
+:DotNet
+REM Roslyn needs SDK 1.0.0, other benchmarks need SDK 2.0.0
+mkdir .Net1
+mkdir .Net2
+powershell -noprofile -executionPolicy RemoteSigned wget https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.ps1 -OutFile dotnet-install.ps1
+powershell -noprofile -executionPolicy RemoteSigned -file dotnet-install.ps1 -InstallDir .Net1
+powershell -noprofile -executionPolicy RemoteSigned -file dotnet-install.ps1 -Channel master -InstallDir .Net2 -version 2.0.0-preview2-005905
+if not exist %__dotnet1% set EXITCODE=1&& echo DotNet.1.0.0 uninstalled
+if not exist %__dotnet2% set EXITCODE=1&& echo DotNet.2.0.0 uninstalled
+exit /b
+
+:HelloWorld
mkdir HelloWorld
cd HelloWorld
-dotnet new console
-if errorlevel 1 exit /b 1
+call %__dotnet2% new console
+if errorlevel 1 set EXITCODE=1
cd ..
+exit /b
+:WebAPI
mkdir WebAPI
cd WebAPI
-dotnet new webapi
-if errorlevel 1 exit /b 1
+call %__dotnet2% new webapi
+if errorlevel 1 set EXITCODE=1
cd ..
+exit /b
+:MusicStore
git clone https://github.com/aspnet/JitBench -b dev
-if errorlevel 1 exit /b 1
+if errorlevel 1 set EXITCODE=1
+exit /b
+:MusicStore_R2R
+REM MusicStore_R2R requires a previous MusicStore run.
+REM No Additional Setup
+exit /b
+
+:CoreFx
git clone http://github.com/dotnet/corefx
-if errorlevel 1 exit /b 1
+if errorlevel 1 set EXITCODE=1
+exit /b
+:Roslyn
git clone https://github.com/dotnet/roslyn.git
-if errorlevel 1 exit /b 1
-
-popd \ No newline at end of file
+if errorlevel 1 set EXITCODE=1
+exit /b
diff --git a/tests/src/performance/perflab/PerfLab.csproj b/tests/src/performance/perflab/PerfLab.csproj
index ed197261fb..ccacb0b66c 100644
--- a/tests/src/performance/perflab/PerfLab.csproj
+++ b/tests/src/performance/perflab/PerfLab.csproj
@@ -12,6 +12,7 @@
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<DefineConstants>$(DefineConstants);STATIC</DefineConstants>
<NuGetTargetMoniker>.NETStandard,Version=v1.4</NuGetTargetMoniker>
+ <NuGetTargetMonikerShort>netstandard1.4</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
@@ -19,8 +20,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
</PropertyGroup>
<PropertyGroup>
- <ProjectJson>..\project.json</ProjectJson>
- <ProjectLockJson>..\project.lock.json</ProjectLockJson>
+ <RestoreOutputPath>..\obj</RestoreOutputPath>
</PropertyGroup>
<ItemGroup>
<CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
diff --git a/tests/src/performance/performance.csproj b/tests/src/performance/performance.csproj
new file mode 100644
index 0000000000..8133535f45
--- /dev/null
+++ b/tests/src/performance/performance.csproj
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+ <PropertyGroup>
+ <NugetTargetMoniker>.NETStandard,Version=v1.5</NugetTargetMoniker>
+ <NugetTargetMonikerShort>netstandard1.5</NugetTargetMonikerShort>
+ <IsTestProject>false</IsTestProject>
+ </PropertyGroup>
+ <ItemGroup>
+ <PackageReference Include="xunit.performance.api">
+ <Version>$(XUnitPerformanceApiVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="xunit.performance.core">
+ <Version>$(XUnitPerformanceApiVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="xunit.performance.execution">
+ <Version>$(XUnitPerformanceApiVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="xunit.performance.metrics">
+ <Version>$(XUnitPerformanceApiVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="Microsoft.Diagnostics.Tracing.TraceEvent">
+ <Version>$(MicrosoftDiagnosticsTracingLibraryVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="Microsoft.NETCore.Platforms">
+ <Version>2.0.0-preview2-25302-03</Version>
+ </PackageReference>
+ <PackageReference Include="System.Collections.NonGeneric">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Console">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.IO.FileSystem">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Linq">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Linq.Expressions">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Numerics.Vectors">
+ <Version>4.4.0-preview2-25302-03</Version>
+ </PackageReference>
+ <PackageReference Include="System.Reflection">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Reflection.Extensions">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Reflection.TypeExtensions">
+ <Version>4.4.0-preview2-25302-03</Version>
+ </PackageReference>
+ <PackageReference Include="System.Runtime">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Runtime.Extensions">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Runtime.Loader">
+ <Version>4.0.0</Version>
+ </PackageReference>
+ <PackageReference Include="System.Runtime.Numerics">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Text.RegularExpressions">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Threading">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Threading.Tasks">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Threading.Tasks.Parallel">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Diagnostics.Process">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Xml.XmlDocument">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Xml.XPath">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="System.Xml.XPath.XmlDocument">
+ <Version>4.4.0-beta-24913-02</Version>
+ </PackageReference>
+ <PackageReference Include="xunit">
+ <Version>$(XunitPackageVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="xunit.console.netcore">
+ <Version>$(XUnitConsoleNetCoreVersion)</Version>
+ </PackageReference>
+ <PackageReference Include="xunit.runner.utility">
+ <Version>$(XunitPackageVersion)</Version>
+ </PackageReference>
+ </ItemGroup>
+ <PropertyGroup>
+ <TargetFramework>netstandard1.5</TargetFramework>
+ <TargetFrameworkIdentifier>.NETStandard</TargetFrameworkIdentifier>
+ <PackageTargetFallback>$(PackageTargetFallback);dnxcore50;portable-net45+win8</PackageTargetFallback>
+ <ContainsPackageReferences>true</ContainsPackageReferences>
+ <PrereleaseResolveNuGetPackages>false</PrereleaseResolveNuGetPackages>
+ </PropertyGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <Target Name="Build"
+ DependsOnTargets="ResolveReferences" />
+</Project>
diff --git a/tests/src/performance/project.json b/tests/src/performance/project.json
deleted file mode 100644
index 86a42f2df7..0000000000
--- a/tests/src/performance/project.json
+++ /dev/null
@@ -1,42 +0,0 @@
-{
- "dependencies": {
- "xunit.performance.api": "1.0.0-beta-build0003",
- "xunit.performance.core": "1.0.0-beta-build0003",
- "xunit.performance.execution": "1.0.0-beta-build0003",
- "xunit.performance.metrics": "1.0.0-beta-build0003",
- "Microsoft.Diagnostics.Tracing.TraceEvent": "1.0.3-alpha-experimental",
- "Microsoft.NETCore.Platforms": "2.0.0-preview1-25221-01",
- "System.Collections.NonGeneric": "4.4.0-beta-24913-02",
- "System.Console": "4.4.0-beta-24913-02",
- "System.IO.FileSystem": "4.4.0-beta-24913-02",
- "System.Linq": "4.4.0-beta-24913-02",
- "System.Linq.Expressions": "4.4.0-beta-24913-02",
- "System.Numerics.Vectors": "4.4.0-preview1-25221-01",
- "System.Reflection": "4.4.0-beta-24913-02",
- "System.Reflection.Extensions": "4.4.0-beta-24913-02",
- "System.Reflection.TypeExtensions": "4.4.0-preview1-25221-01",
- "System.Runtime": "4.4.0-beta-24913-02",
- "System.Runtime.Extensions": "4.4.0-beta-24913-02",
- "System.Runtime.Loader": "4.0.0",
- "System.Runtime.Numerics": "4.4.0-beta-24913-02",
- "System.Text.RegularExpressions": "4.4.0-beta-24913-02",
- "System.Threading": "4.4.0-beta-24913-02",
- "System.Threading.Tasks": "4.4.0-beta-24913-02",
- "System.Threading.Tasks.Parallel": "4.4.0-beta-24913-02",
- "System.Diagnostics.Process": "4.4.0-beta-24913-02",
- "System.Xml.XmlDocument": "4.4.0-beta-24913-02",
- "System.Xml.XPath": "4.4.0-beta-24913-02",
- "System.Xml.XPath.XmlDocument": "4.4.0-beta-24913-02",
- "xunit": "2.2.0-beta2-build3300",
- "xunit.console.netcore": "1.0.2-prerelease-00177",
- "xunit.runner.utility": "2.2.0-beta2-build3300"
- },
- "frameworks": {
- "netstandard1.5": {
- "imports": [
- "dnxcore50",
- "portable-net45+win8"
- ]
- }
- }
-}
diff --git a/tests/testsFailingOutsideWindows.txt b/tests/testsFailingOutsideWindows.txt
index 5829a8f36c..3b59343f8a 100644
--- a/tests/testsFailingOutsideWindows.txt
+++ b/tests/testsFailingOutsideWindows.txt
@@ -57,6 +57,7 @@ JIT/Methodical/Boxing/xlang/_dbgsin_cs_il/_dbgsin_cs_il.sh
JIT/Methodical/Boxing/xlang/_odbgsin_cs_il/_odbgsin_cs_il.sh
JIT/Methodical/Boxing/xlang/_orelsin_cs_il/_orelsin_cs_il.sh
JIT/Methodical/Boxing/xlang/_relsin_cs_il/_relsin_cs_il.sh
+JIT/Regression/JitBlue/GitHub_11408/GitHub_11408/GitHub_11408.sh
Interop/StructMarshalling/PInvoke/MarshalStructAsLayoutExp/MarshalStructAsLayoutExp.sh
GC/LargeMemory/Allocation/finalizertest/finalizertest.sh
GC/LargeMemory/API/gc/reregisterforfinalize/reregisterforfinalize.sh
@@ -70,7 +71,6 @@ GC/Features/BackgroundGC/foregroundgc/foregroundgc.sh
GC/Features/LOHFragmentation/lohfragmentation/lohfragmentation.sh
GC/Features/SustainedLowLatency/scenario/scenario.sh
GC/Regressions/dev10bugs/536168/536168/536168.sh
-GC/Scenarios/DoublinkList/doublinkgen/doublinkgen.sh
Loader/classloader/TypeGeneratorTests/TypeGeneratorTest612/Generated612/Generated612.sh
Loader/classloader/TypeGeneratorTests/TypeGeneratorTest613/Generated613/Generated613.sh
Loader/classloader/TypeGeneratorTests/TypeGeneratorTest614/Generated614/Generated614.sh
diff --git a/tests/x86/compatjit_x86_testenv.cmd b/tests/x86/compatjit_x86_testenv.cmd
deleted file mode 100644
index d245370548..0000000000
--- a/tests/x86/compatjit_x86_testenv.cmd
+++ /dev/null
@@ -1,8 +0,0 @@
-@REM -------------------------------------------------------------------------
-@REM
-@REM This script provides x86 compatjit test environment settings
-@REM
-@REM -------------------------------------------------------------------------
-
-@REM Use compatjit.dll, not clrjit.dll.
-set COMPlus_UseWindowsX86CoreLegacyJit=1
diff --git a/tests/x86/ryujit_x86_testenv.cmd b/tests/x86/ryujit_x86_testenv.cmd
deleted file mode 100644
index 97e7ab8b56..0000000000
--- a/tests/x86/ryujit_x86_testenv.cmd
+++ /dev/null
@@ -1,5 +0,0 @@
-@REM This is no longer needed, except the CI system, during the conversion of RyuJIT/x86
-@REM to the default, still looks for it for the old "ryujit" tasks. Leave it here, and the
-@REM "ryujit" tasks will just run the default JIT (now RyuJIT).
-@REM
-@REM After the .NET CI is updated, this can be deleted.
diff --git a/tests/x86_jit32_issues.targets b/tests/x86_jit32_issues.targets
deleted file mode 100644
index 7a6983db26..0000000000
--- a/tests/x86_jit32_issues.targets
+++ /dev/null
@@ -1,516 +0,0 @@
-<?xml version="1.0" ?>
-<Project DefaultTargets = "GetListOfTestCmds" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Condition="'$(XunitTestBinBase)' != ''">
- <ExcludeList Include="$(XunitTestBinBase)\GC\API\GC\GetGeneration\GetGeneration.cmd">
- <Issue>6717</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\GC\API\GC\GetGenerationWR2\GetGenerationWR2.cmd">
- <Issue>6717</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\GC\Coverage\LargeObjectAlloc2\LargeObjectAlloc2.cmd">
- <Issue>6714</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\GC\Coverage\smalloom\smalloom.cmd">
- <Issue>6714</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\GC\Features\BackgroundGC\foregroundgc\foregroundgc.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\GC\Features\HeapExpansion\pluggaps\pluggaps.cmd">
- <Issue>6720</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\GC\Features\SustainedLowLatency\scenario\scenario.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\GC\LargeMemory\Allocation\finalizertest\finalizertest.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\GC\LargeMemory\Allocation\largeexceptiontest\largeexceptiontest.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\GC\LargeMemory\API\gc\collect\collect.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\GC\LargeMemory\API\gc\getgeneration\getgeneration.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\GC\LargeMemory\API\gc\gettotalmemory\gettotalmemory.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\GC\LargeMemory\API\gc\keepalive\keepalive.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\GC\LargeMemory\API\gc\reregisterforfinalize\reregisterforfinalize.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\GC\LargeMemory\API\gc\suppressfinalize\suppressfinalize.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\GC\Regressions\dev10bugs\536168\536168\536168.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\coverage\importer\Desktop\badldsfld_il_d\badldsfld_il_d.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\coverage\importer\Desktop\badldsfld_il_r\badldsfld_il_r.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\coverage\importer\Desktop\bleref_il_d\bleref_il_d.cmd">
- <Issue>2414</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\coverage\importer\Desktop\bleref_il_r\bleref_il_r.cmd">
- <Issue>2414</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\coverage\importer\Desktop\ldelemnullarr1_il_d\ldelemnullarr1_il_d.cmd">
- <Issue>2416</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\coverage\importer\Desktop\ldelemnullarr1_il_r\ldelemnullarr1_il_r.cmd">
- <Issue>2416</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\coverage\importer\Desktop\nonrefsdarr_il_d\nonrefsdarr_il_d.cmd">
- <Issue>2416</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\coverage\importer\Desktop\nonrefsdarr_il_r\nonrefsdarr_il_r.cmd">
- <Issue>2416</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\forceinlining\AttributeConflict\AttributeConflict.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\forceinlining\PositiveCases\PositiveCases.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\intrinsic\interlocked\rva_rvastatic1\rva_rvastatic1.cmd">
- <Issue>2433</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\intrinsic\interlocked\rva_rvastatic2\rva_rvastatic2.cmd">
- <Issue>2433</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\intrinsic\interlocked\rva_rvastatic3\rva_rvastatic3.cmd">
- <Issue>2433</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\intrinsic\interlocked\rva_rvastatic4\rva_rvastatic4.cmd">
- <Issue>2433</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\pinvoke\preemptive_cooperative\preemptive_cooperative.cmd">
- <Issue>2434</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\RVAInit\extended\extended.cmd">
- <Issue>2435</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\RVAInit\overlap\overlap.cmd">
- <Issue>2435</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\rvastatics\rvastatic1\rvastatic1.cmd">
- <Issue>2451</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\rvastatics\rvastatic2\rvastatic2.cmd">
- <Issue>2451</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\rvastatics\rvastatic3\rvastatic3.cmd">
- <Issue>2451</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\rvastatics\rvastatic4\rvastatic4.cmd">
- <Issue>2451</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\rvastatics\rvastatic5\rvastatic5.cmd">
- <Issue>2451</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\tailcall\tailcall\tailcall.cmd">
- <Issue>6714</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\tls\mutualrecurthd-tls\mutualrecurthd-tls.cmd">
- <Issue>2441</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\tls\test-tls\test-tls.cmd">
- <Issue>2441</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Generics\Coverage\chaos65204782cs\chaos65204782cs.cmd">
- <Issue>6714</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Generics\Coverage\chaos65204782cs_o\chaos65204782cs_o.cmd">
- <Issue>6714</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\localloc\verify\verify01_dynamic\verify01_dynamic.cmd">
- <Issue>2414</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\localloc\verify\verify01_large\verify01_large.cmd">
- <Issue>2414</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\localloc\verify\verify01_small\verify01_small.cmd">
- <Issue>2414</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\opt\cse\HugeArray\HugeArray.cmd">
- <Issue>6714</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\regress\ndpw\21220\b21220\b21220.cmd">
- <Issue>2414</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\Arrays\misc\_il_dbgarrres\_il_dbgarrres.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\Boxing\xlang\_dbgsin_cs_il\_dbgsin_cs_il.cmd">
- <Issue>3216</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\Boxing\xlang\_dbgsin_il_cs\_dbgsin_il_cs.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\Boxing\xlang\_dbgsin_il_il\_dbgsin_il_il.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\Boxing\xlang\_odbgsin_cs_il\_odbgsin_cs_il.cmd">
- <Issue>3216</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\Boxing\xlang\_odbgsin_il_cs\_odbgsin_il_cs.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\Boxing\xlang\_odbgsin_il_il\_odbgsin_il_il.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\Boxing\xlang\_orelsin_cs_il\_orelsin_cs_il.cmd">
- <Issue>3216</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\Boxing\xlang\_orelsin_il_cs\_orelsin_il_cs.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\Boxing\xlang\_orelsin_il_il\_orelsin_il_il.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\Boxing\xlang\_relsin_cs_il\_relsin_cs_il.cmd">
- <Issue>3216</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\Boxing\xlang\_relsin_il_cs\_relsin_il_cs.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\Boxing\xlang\_relsin_il_il\_relsin_il_il.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\cctor\misc\global_il_d\global_il_d.cmd">
- <Issue>2433</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\cctor\misc\global_il_r\global_il_r.cmd">
- <Issue>2433</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\cctor\misc\tail_il_d\tail_il_d.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\cctor\misc\tail_il_r\tail_il_r.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\cctor\misc\threads3_il_d\threads3_il_d.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\cctor\misc\threads3_il_r\threads3_il_r.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\cctor\simple\precise3_il_d\precise3_il_d.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\cctor\simple\precise3_il_r\precise3_il_r.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\delegate\_simpleoddpower_il_d\_simpleoddpower_il_d.cmd">
- <Issue>'GetType() == TI_METHOD'</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\delegate\_simpleoddpower_il_r\_simpleoddpower_il_r.cmd">
- <Issue>'GetType() == TI_METHOD'</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\eh\deadcode\badcodeafterfinally_d\badcodeafterfinally_d.cmd">
- <Issue>2444</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\eh\deadcode\badcodeafterfinally_r\badcodeafterfinally_r.cmd">
- <Issue>2444</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\explicit\basic\_il_relrefarg_i4\_il_relrefarg_i4.cmd">
- <Issue>6714</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\tailcall\_il_dbgpointer\_il_dbgpointer.cmd">
- <Issue>2435</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\tailcall\_il_dbgpointer_i\_il_dbgpointer_i.cmd">
- <Issue>2435</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\tailcall\_il_relpointer\_il_relpointer.cmd">
- <Issue>2435</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\tailcall\_il_relpointer_i\_il_relpointer_i.cmd">
- <Issue>2435</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\tailcall_v4\smallFrame\smallFrame.cmd">
- <Issue>4548</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\varargs\seh\fault_il_d\fault_il_d.cmd">
- <Issue>2414</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\varargs\seh\fault_il_r\fault_il_r.cmd">
- <Issue>2414</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\varargs\seh\filter_il_d\filter_il_d.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\varargs\seh\filter_il_r\filter_il_r.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\xxobj\operand\_il_dbglocalloc\_il_dbglocalloc.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\xxobj\operand\_il_rellocalloc\_il_rellocalloc.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\opt\Inline\regression\mismatch32\mismatch32\mismatch32.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\opt\Inline\regression\mismatch64\mismatch64\mismatch64.cmd">
- <Issue>'Arg type mismatch: Wanted long (size 8), Got struct (size 4) for call at IL offset 0x16'</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\opt\Inline\tests\LotsOfInlines\LotsOfInlines.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\opt\Tailcall\TailcallVerifyWithPrefix\TailcallVerifyWithPrefix.cmd">
- <Issue>x86 JIT doesn't support tail call opt</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\opt\virtualstubdispatch\bigvtbl\bigvtbl_cs_d\bigvtbl_cs_d.cmd">
- <Issue>6714</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\opt\virtualstubdispatch\bigvtbl\bigvtbl_cs_do\bigvtbl_cs_do.cmd">
- <Issue>6714</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\opt\virtualstubdispatch\bigvtbl\bigvtbl_cs_r\bigvtbl_cs_r.cmd">
- <Issue>6714</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Performance\CodeQuality\Math\Functions\Functions\Functions.cmd">
- <Issue>5430</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\CLR-x86-EJIT\v1-m10\b07847\b07847\b07847.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\CLR-x86-JIT\V1-M09.5-PDC\b16335\b16335\b16335.cmd">
- <Issue>6718</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\CLR-x86-JIT\V1-M09.5-PDC\b28776\b28776\b28776.cmd">
- <Issue>6714</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\CLR-x86-JIT\V1-M11-Beta1\b49644\b49644\b49644.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\CLR-x86-JIT\V1-M12-Beta2\b57367\b57367\b57367.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\CLR-x86-JIT\V1.2-Beta1\b102637\b102637\b102637.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\CLR-x86-JIT\V1.2-M01\b03689\b03689\b03689.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\CLR-x86-JIT\V1.2-M01\b08046\b08046\b08046.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\CLR-x86-JIT\V2.0-Beta2\b399444\b399444b\b399444b.cmd">
- <Issue>6714</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\Dev11\dev10_865840\dev10_865840\dev10_865840.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\Dev11\Dev11_468598\Test_HndIndex_10_Plain\Test_HndIndex_10_Plain.cmd">
- <Issue>5286</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\Dev11\Dev11_468598\Test_HndIndex_10_Reordered\Test_HndIndex_10_Reordered.cmd">
- <Issue>5286</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\Dev11\External\dev11_239804\ShowLocallocAlignment\ShowLocallocAlignment.cmd">
- <Issue>7163</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\JitBlue\GitHub_4044\GitHub_4044\GitHub_4044.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\VS-ia64-JIT\V2.0-Beta2\b311420\b311420\b311420.cmd">
- <Issue>6714</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\VS-ia64-JIT\V2.0-Beta2\b410474\b410474\b410474.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\SIMD\CircleInConvex_r\CircleInConvex_r.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\SIMD\CircleInConvex_ro\CircleInConvex_ro.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\Loader\classloader\TSAmbiguities\CollapsedInterfaces\HelloWorld\HelloWorld.cmd">
- <Issue>6714</Issue>
- </ExcludeList>
- </ItemGroup>
-
- <!-- Tests that need to be triaged for vararg usage as that is not supported -->
- <ItemGroup Condition="'$(XunitTestBinBase)' != ''">
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\PREFIX\unaligned\1\arglist\arglist.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\PREFIX\unaligned\2\arglist\arglist.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\PREFIX\unaligned\4\arglist\arglist.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\PREFIX\volatile\1\arglist\arglist.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\gc\misc\funclet\funclet.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\mcc\interop\mcc_i00\mcc_i00.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\mcc\interop\mcc_i01\mcc_i01.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\mcc\interop\mcc_i02\mcc_i02.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\mcc\interop\mcc_i03\mcc_i03.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\mcc\interop\mcc_i10\mcc_i10.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\mcc\interop\mcc_i11\mcc_i11.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\mcc\interop\mcc_i12\mcc_i12.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\mcc\interop\mcc_i13\mcc_i13.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\mcc\interop\mcc_i30\mcc_i30.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\mcc\interop\mcc_i31\mcc_i31.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\mcc\interop\mcc_i32\mcc_i32.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\mcc\interop\mcc_i33\mcc_i33.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\mcc\interop\mcc_i50\mcc_i50.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\mcc\interop\mcc_i51\mcc_i51.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\mcc\interop\mcc_i52\mcc_i52.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\mcc\interop\mcc_i53\mcc_i53.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\mcc\interop\mcc_i60\mcc_i60.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\mcc\interop\mcc_i61\mcc_i61.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\mcc\interop\mcc_i62\mcc_i62.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\mcc\interop\mcc_i63\mcc_i63.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\mcc\interop\mcc_i70\mcc_i70.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\mcc\interop\mcc_i71\mcc_i71.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\mcc\interop\mcc_i72\mcc_i72.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\mcc\interop\mcc_i73\mcc_i73.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\mcc\interop\mcc_i80\mcc_i80.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\mcc\interop\mcc_i81\mcc_i81.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\mcc\interop\mcc_i82\mcc_i82.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\mcc\interop\mcc_i83\mcc_i83.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\Coverage\arglist_pos\arglist_pos.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\refany\_il_dbgseq\_il_dbgseq.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\refany\_il_relseq\_il_relseq.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\CLR-x86-EJIT\V1-M12-Beta2\b26323\b26323\b26323.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\CLR-x86-JIT\V1-M09.5-PDC\b16423\b16423\b16423.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\CLR-x86-JIT\V1-M09.5-PDC\b26324\b26324a\b26324a.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\CLR-x86-JIT\V1-M09.5-PDC\b26324\b26324b\b26324b.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\CLR-x86-JIT\V1-M09.5-PDC\b28901\b28901\b28901.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\CLR-x86-JIT\V1-M09.5-PDC\b30838\b30838\b30838.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\CLR-x86-JIT\V1-M09.5-PDC\b30864\b30864\b30864.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\CLR-x86-JIT\V1-M09.5-PDC\b32374\b32374\b32374.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\CLR-x86-JIT\V1-M11-Beta1\b35784\b35784\b35784.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\CLR-x86-JIT\V1-M11-Beta1\b36472\b36472\b36472.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\CLR-x86-JIT\V1-M11-Beta1\b37598\b37598\b37598.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\CLR-x86-JIT\V1-M11-Beta1\b41391\b41391\b41391.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\CLR-x86-JIT\V1-M11-Beta1\b46867\b46867\b46867.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\CLR-x86-JIT\V1-M12-Beta2\b31745\b31745\b31745.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\CLR-x86-JIT\V1-M12-Beta2\b31746\b31746\b31746.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\CLR-x86-JIT\V1-M12-Beta2\b37646\b37646\b37646.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\CLR-x86-JIT\V1-M12-Beta2\b41852\b41852\b41852.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\CLR-x86-JIT\V1-M13-RTM\b88793\b88793\b88793.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\CLR-x86-JIT\V1-M13-RTM\b91248\b91248\b91248.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\CLR-x86-JIT\V2.0-Beta2\b409748\b409748\b409748.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\JitBlue\DevDiv_255294\DevDiv_255294\DevDiv_255294.cmd">
- <Issue>times out</Issue>
- </ExcludeList>
- </ItemGroup>
-</Project>
diff --git a/tests/xunitwrapper.targets b/tests/xunitwrapper.targets
index 3b343bd891..a0ff7f59fa 100644
--- a/tests/xunitwrapper.targets
+++ b/tests/xunitwrapper.targets
@@ -6,13 +6,13 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="ResolveNuGetPackages">
- <PrereleaseResolveNuGetPackageAssets Condition="Exists($(ProjectLockJson))"
+ <PrereleaseResolveNuGetPackageAssets Condition="Exists($(ProjectAssetsFile))"
AllowFallbackOnTargetSelection="true"
IncludeFrameworkReferences="false"
NuGetPackagesDirectory="$(PackagesDir)"
RuntimeIdentifier="$(TestNugetRuntimeId)"
ProjectLanguage="$(Language)"
- ProjectLockFile="$(ProjectLockJson)"
+ ProjectLockFile="$(ProjectAssetsFile)"
TargetMonikers="$(TargetFrameworkMoniker)">
<Output TaskParameter="ResolvedAnalyzers" ItemName="Analyzer" />
<Output TaskParameter="ResolvedReferences" ItemName="Reference" />