platform/upstream/dotnet/runtime.git
4 years ago[mono] Make some API functions public and private (#33736)
Aleksey Kliger (λgeek) [Tue, 24 Mar 2020 13:29:45 +0000 (09:29 -0400)]
[mono] Make some API functions public and private (#33736)

* [mini] Move mono_install_load_aot_data_hook to a public header

It's already a MONO_API and it is used, for example, by Xamarin.iOS, but it
wasn't in a public header.

Mark it external only.  There are no uses of it inside the runtiem

* [gc] Make mono_gc_init_finalizer_thread a public API

It was already used by Xamarin.iOS but wasn't in a public header and required
compiling with --disable-visibility-hidden in order to dlsym the symbol.

If --with-lazy-gc-thread-creation is used, embedders must call this function to
create the finalizer therad.  Otherwise the function does nothing and the
runtime will create the finalizer thread automatically.

* [utils] Move mono_trace_init to a public header

It was already marked as MONO_API, but it was not in a public header.
It is used by embedders such as Xamarin.iOS

* Update ios sample

* Revert "[utils] Move mono_trace_init to a public header"

This reverts commit a0cc08768e97c7b630ccbf54e48020b06436f874.

* [utils] init mono_logger in all public API functions

Embedders don't need to call mono_trace_init before calling
mono_trace_set_log_handler, mono_trace_set_print_handler or mono_trace_set_printerr_handler

* [jit] Move mono_install_load_aot_data_hook to mono-private-unstable.h

We do not guarantee that this API will be stable

4 years agoiOS: Enable System.Net.Security.Native and parts of System.Security.Cryptography...
Alexander Köplinger [Tue, 24 Mar 2020 13:29:16 +0000 (14:29 +0100)]
iOS: Enable System.Net.Security.Native and parts of System.Security.Cryptography.Native.Apple (#33970)

Unavailable APIs are excluded via #if for now.

4 years agoFix build break with latest VS preview (#33996)
Jan Kotas [Tue, 24 Mar 2020 13:20:28 +0000 (06:20 -0700)]
Fix build break with latest VS preview (#33996)

runtime\src\coreclr\src\gc\gc.cpp(4343,1): warning C5208: unnamed class used in typedef name cannot declare members other than non-static data members, member enumerations, or member classes

4 years agoFix incorrect comment in Queue.Dequeue (#34006)
Anton Vasiliev [Tue, 24 Mar 2020 12:48:04 +0000 (15:48 +0300)]
Fix incorrect comment in Queue.Dequeue (#34006)

The comment in front of System.Collections.Queue.Dequeue() changed to
match actual routine behavior.

4 years agoMinor doc updates (#34003)
Jan Kotas [Tue, 24 Mar 2020 12:47:28 +0000 (05:47 -0700)]
Minor doc updates (#34003)

4 years agoRemove a few boxing/string allocations in XmlJsonWriter (#33991)
Stephen Toub [Tue, 24 Mar 2020 12:46:56 +0000 (08:46 -0400)]
Remove a few boxing/string allocations in XmlJsonWriter (#33991)

4 years agoSuppress analyzer warning about ValueTask usage (#33994)
Stephen Toub [Tue, 24 Mar 2020 12:45:08 +0000 (08:45 -0400)]
Suppress analyzer warning about ValueTask usage (#33994)

4 years ago[interp] Replace ldloca + ldfld/stfld pairs with ldloc/stloc (#33952)
monojenkins [Tue, 24 Mar 2020 11:59:18 +0000 (07:59 -0400)]
[interp] Replace ldloca + ldfld/stfld pairs with ldloc/stloc (#33952)

If loaded/stored field is the only field of the valuetype. This is meant to mainly optimize IntPtr accesses, which contains a single void* field and is heavily used in Unsafe intrinsics.

Co-authored-by: BrzVlad <BrzVlad@users.noreply.github.com>
4 years agoRename TARGET_DARWIN to TARGET_OSX (#33959)
Alexander Köplinger [Tue, 24 Mar 2020 10:44:34 +0000 (11:44 +0100)]
Rename TARGET_DARWIN to TARGET_OSX (#33959)

https://github.com/dotnet/runtime/pull/33716 set TARGET_DARWIN for iOS too but most of the logic is really OSX-specific.
Unset TARGET_DARWIN for iOS and rename the rest of the occurrences to TARGET_OSX.

4 years ago[master] Update dependencies from dotnet/arcade mono/linker (#33852)
dotnet-maestro[bot] [Tue, 24 Mar 2020 09:12:04 +0000 (10:12 +0100)]
[master] Update dependencies from dotnet/arcade mono/linker (#33852)

* Update dependencies from https://github.com/dotnet/arcade build 20200320.1

- Microsoft.DotNet.XUnitExtensions - 5.0.0-beta.20170.1
- Microsoft.DotNet.VersionTools.Tasks - 5.0.0-beta.20170.1
- Microsoft.DotNet.ApiCompat - 5.0.0-beta.20170.1
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20170.1
- Microsoft.DotNet.Build.Tasks.Feed - 5.0.0-beta.20170.1
- Microsoft.DotNet.Build.Tasks.Packaging - 5.0.0-beta.20170.1
- Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk - 5.0.0-beta.20170.1
- Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk - 5.0.0-beta.20170.1
- Microsoft.DotNet.CodeAnalysis - 5.0.0-beta.20170.1
- Microsoft.DotNet.GenAPI - 5.0.0-beta.20170.1
- Microsoft.DotNet.GenFacades - 5.0.0-beta.20170.1
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20170.1
- Microsoft.DotNet.RemoteExecutor - 5.0.0-beta.20170.1
- Microsoft.DotNet.XUnitConsoleRunner - 2.5.1-beta.20170.1

* Update dependencies from https://github.com/dotnet/arcade build 20200320.4

- Microsoft.DotNet.XUnitExtensions - 5.0.0-beta.20170.4
- Microsoft.DotNet.VersionTools.Tasks - 5.0.0-beta.20170.4
- Microsoft.DotNet.ApiCompat - 5.0.0-beta.20170.4
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20170.4
- Microsoft.DotNet.Build.Tasks.Feed - 5.0.0-beta.20170.4
- Microsoft.DotNet.Build.Tasks.Packaging - 5.0.0-beta.20170.4
- Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk - 5.0.0-beta.20170.4
- Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk - 5.0.0-beta.20170.4
- Microsoft.DotNet.CodeAnalysis - 5.0.0-beta.20170.4
- Microsoft.DotNet.GenAPI - 5.0.0-beta.20170.4
- Microsoft.DotNet.GenFacades - 5.0.0-beta.20170.4
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20170.4
- Microsoft.DotNet.RemoteExecutor - 5.0.0-beta.20170.4
- Microsoft.DotNet.XUnitConsoleRunner - 2.5.1-beta.20170.4

* Update dependencies from https://github.com/mono/linker build 20200320.1

- ILLink.Tasks - 0.1.6-prerelease.20170.1

* Update dependencies from https://github.com/dotnet/arcade build 20200321.1

- Microsoft.DotNet.XUnitExtensions - 5.0.0-beta.20171.1
- Microsoft.DotNet.VersionTools.Tasks - 5.0.0-beta.20171.1
- Microsoft.DotNet.ApiCompat - 5.0.0-beta.20171.1
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20171.1
- Microsoft.DotNet.Build.Tasks.Feed - 5.0.0-beta.20171.1
- Microsoft.DotNet.Build.Tasks.Packaging - 5.0.0-beta.20171.1
- Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk - 5.0.0-beta.20171.1
- Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk - 5.0.0-beta.20171.1
- Microsoft.DotNet.CodeAnalysis - 5.0.0-beta.20171.1
- Microsoft.DotNet.GenAPI - 5.0.0-beta.20171.1
- Microsoft.DotNet.GenFacades - 5.0.0-beta.20171.1
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20171.1
- Microsoft.DotNet.RemoteExecutor - 5.0.0-beta.20171.1
- Microsoft.DotNet.XUnitConsoleRunner - 2.5.1-beta.20171.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
4 years agoRemove Mono runtime vcruntime140.dll release build dependency. (#33853)
Johan Lorensson [Tue, 24 Mar 2020 07:24:12 +0000 (08:24 +0100)]
Remove Mono runtime vcruntime140.dll release build dependency. (#33853)

CoreCLR static link vcruntime140.dll, but dynamic link rest of
C-runtime using ucrt.lib in release build. Commit align Mono runtime to
follow same pattern, removing dependency on vcruntime140.dll.

4 years agoImplement icall used by RuntimeHelpers.EnsureSufficientExecutionStack on netcore...
Johan Lorensson [Tue, 24 Mar 2020 07:22:46 +0000 (08:22 +0100)]
Implement icall used by RuntimeHelpers.EnsureSufficientExecutionStack on netcore Mono. (#33857)

Current implementation always returned true for Windows/Linux/Android.
There are however use of this API in Task library to make sure recursive
tasks won't hit stackoverflow. There are several tests in System.Threading.Tasks
that currently hit this, at least on Windows, causing test failures.

Fix use stack limits already setup in register_thread and used by GC when
doing conservative stack scan. If the limits have not been setup or is not
supported on platform, we will use old defaults, always assume there is
enough stack space available. Heuristics around size of minimum execution
stack needed are picked from corresponding CoreCLR implementation.

4 years agoFix nullability annotations for ProfileOptimization.StartProfile (#33945)
Jan Kotas [Tue, 24 Mar 2020 07:00:45 +0000 (00:00 -0700)]
Fix nullability annotations for ProfileOptimization.StartProfile (#33945)

Fixes #33426

4 years agoUpdate README.md (#33999)
Robert Henry [Tue, 24 Mar 2020 04:42:23 +0000 (21:42 -0700)]
Update README.md (#33999)

Add missing back-ticks to quote a path name.

4 years agoUpdate README.md (#33995)
Robert Henry [Tue, 24 Mar 2020 04:40:13 +0000 (21:40 -0700)]
Update README.md (#33995)

Add missing articles ("the") to README.md

4 years agoMove unbox tramp method address table to data segment, MONO_ARCH_CODE_EXEC_ONLY....
monojenkins [Tue, 24 Mar 2020 04:28:06 +0000 (00:28 -0400)]
Move unbox tramp method address table to data segment, MONO_ARCH_CODE_EXEC_ONLY. (#33969)

unbox tramp method addresses are emitted as a table of calls and read at runtime by get_call_table_entry. This is problematic on platforms that doesn't allow data to be read from instruction stream.

Fix follow same pattern as method address table emitted as function pointers into table in data segment when using MONO_ARCH_CODE_EXEC_ONLY.

Co-authored-by: lateralusX <lateralusX@users.noreply.github.com>
4 years ago[mono] retry mono_threads_pthread_kill if result == EAGAIN on Linux (#33966)
Aleksey Kliger (λgeek) [Tue, 24 Mar 2020 03:13:58 +0000 (23:13 -0400)]
[mono] retry mono_threads_pthread_kill if result == EAGAIN on Linux (#33966)

* [mono] retry mono_threads_pthread_kill if result == EAGAIN on Linux

Try to address https://github.com/dotnet/runtime/issues/32377
(signal queue overflow) by sleeping and retrying a few times.

4 years ago[Arm64] Implement more hardware intrinsics as proposed in #24794 (#33889)
Egor Chesakov [Tue, 24 Mar 2020 02:39:36 +0000 (19:39 -0700)]
[Arm64] Implement more hardware intrinsics as proposed in #24794 (#33889)

- Implements the following intrinsics as proposed in #24794:

* AbsoluteDifferenceAdd

* MultiplyExtended, MultiplyExtendedScalar

* PolynomialMultiply

* ReciprocalEstimate, ReciprocalEstimateScalar

* ReciprocalExponentScalar

* ReciprocalSquareRootEstimate, ReciprocalSquareRootEstimateScalar

* ReciprocalSquareRootStep, ReciprocalSquareRootStepScalar

* ReciprocalStep, ReciprocalStepScalar

- Implements frecpe, frecps, frecpx, frsqrte, frsqrts, urecpe, ursqrte instructions

- Fixes implementation for fcmeq, fcmge, fcmgt, fcmle, fcmlt *(zero immediate)* instructions

- Adds missing flag BaseTypeFromFirstArg for AbsoluteDifference intrinsics

4 years ago[jit] Move mono_install_load_aot_data_hook to mono-private-unstable.h
Aleksey Kliger [Tue, 24 Mar 2020 01:26:24 +0000 (21:26 -0400)]
[jit] Move mono_install_load_aot_data_hook to mono-private-unstable.h

We do not guarantee that this API will be stable

4 years ago[utils] init mono_logger in all public API functions
Aleksey Kliger [Tue, 24 Mar 2020 01:21:35 +0000 (21:21 -0400)]
[utils] init mono_logger in all public API functions

Embedders don't need to call mono_trace_init before calling
mono_trace_set_log_handler, mono_trace_set_print_handler or mono_trace_set_printerr_handler

4 years agoRevert "[utils] Move mono_trace_init to a public header"
Aleksey Kliger [Tue, 24 Mar 2020 01:18:35 +0000 (21:18 -0400)]
Revert "[utils] Move mono_trace_init to a public header"

This reverts commit a0cc08768e97c7b630ccbf54e48020b06436f874.

4 years agoUpdate ios sample
Aleksey Kliger [Wed, 18 Mar 2020 21:08:20 +0000 (17:08 -0400)]
Update ios sample

4 years ago[utils] Move mono_trace_init to a public header
Aleksey Kliger [Wed, 18 Mar 2020 20:41:25 +0000 (16:41 -0400)]
[utils] Move mono_trace_init to a public header

It was already marked as MONO_API, but it was not in a public header.
It is used by embedders such as Xamarin.iOS

4 years ago[gc] Make mono_gc_init_finalizer_thread a public API
Aleksey Kliger [Wed, 18 Mar 2020 20:38:52 +0000 (16:38 -0400)]
[gc] Make mono_gc_init_finalizer_thread a public API

It was already used by Xamarin.iOS but wasn't in a public header and required
compiling with --disable-visibility-hidden in order to dlsym the symbol.

If --with-lazy-gc-thread-creation is used, embedders must call this function to
create the finalizer therad.  Otherwise the function does nothing and the
runtime will create the finalizer thread automatically.

4 years ago[mini] Move mono_install_load_aot_data_hook to a public header
Aleksey Kliger [Wed, 18 Mar 2020 20:30:33 +0000 (16:30 -0400)]
[mini] Move mono_install_load_aot_data_hook to a public header

It's already a MONO_API and it is used, for example, by Xamarin.iOS, but it
wasn't in a public header.

Mark it external only.  There are no uses of it inside the runtiem

4 years ago[mono] Add headers for unstable APIs (#33869)
Aleksey Kliger (λgeek) [Mon, 23 Mar 2020 23:54:30 +0000 (19:54 -0400)]
[mono] Add headers for unstable APIs (#33869)

* [mono] Add headers for unstable APIs

We have functions that are de-facto part of the Mono embedding API that are
used by Xamarin.iOS or Xamarin.Android that are not in a state where we want to
commit to supporting them forever in their current form.

Nonetheless, we would like to make sure that the symbols for these functions
are visible even if we otherwise compile the runtime with
`-fvisisibility=hidden`, and we would like to discourage declaring the
functions in the embedder's own headers.

The functions that go into the
`mono/{utils,metadata,jit}/mono-private-unstable.h` headers will all be marked
with `MONO_API MONO_RT_EXTERNAL_ONLY` but we will not guarantee that the
functions will be there from one release to the next or that they will not
change their signatures or their behaviors.

* [msvc] Add the three mono-private-unstable.h files

4 years agoMore efficient interop for BITMAPINFOHEADER (#33967)
Jan Kotas [Mon, 23 Mar 2020 22:53:35 +0000 (15:53 -0700)]
More efficient interop for BITMAPINFOHEADER (#33967)

4 years agoFixed build with GDBJIT enabled and PREJIT disabled (#33958)
Kirill Frolov [Mon, 23 Mar 2020 21:41:05 +0000 (00:41 +0300)]
Fixed build with GDBJIT enabled and PREJIT disabled (#33958)

This commit fixes build for case, when FEATURE_GDBJIT
is enabled, but FEATURE_PREJIT is disabled.

This solves issue #33956.

4 years ago[jit] Perform inlining earlier during call processing to avoid loading vtable/rgctx...
monojenkins [Mon, 23 Mar 2020 19:16:45 +0000 (15:16 -0400)]
[jit] Perform inlining earlier during call processing to avoid loading vtable/rgctx args which are not needed. (#33951)

Co-authored-by: vargaz <vargaz@users.noreply.github.com>
4 years ago[debug_interp] Do not use uninitialized local. (#33910)
monojenkins [Mon, 23 Mar 2020 11:38:36 +0000 (07:38 -0400)]
[debug_interp] Do not use uninitialized local. (#33910)

Co-authored-by: jaykrell <jaykrell@users.noreply.github.com>
4 years ago[loader] Fix mistake in netcore_load_reference comment (#33941)
Ryan Lucia [Mon, 23 Mar 2020 06:10:45 +0000 (02:10 -0400)]
[loader] Fix mistake in netcore_load_reference comment (#33941)

The code here was right, the comment wrong. Also updated to mention that we now check APP_PATHS.

4 years agoOptimized built-in factory lookup (#2248)
Yoh Deadfall [Mon, 23 Mar 2020 02:37:30 +0000 (05:37 +0300)]
Optimized built-in factory lookup (#2248)

* Optimized built-in factory lookup

* Inlined array construction of factories

* Optimized init of default converter lookup

* Removed comments

* Returned comments back

4 years agoAdd service name to TimeoutException message (#33927)
Francesco Saltori [Mon, 23 Mar 2020 01:06:39 +0000 (02:06 +0100)]
Add service name to TimeoutException message (#33927)

4 years agoIncrease number of attempts before failure in ECDSA-DER (#33933)
Jeremy Barton [Sun, 22 Mar 2020 18:51:47 +0000 (11:51 -0700)]
Increase number of attempts before failure in ECDSA-DER (#33933)

Of the four test keys, 3 have a 75% chance of being smaller than max on each call.
 (1 - 0.75) ^ 10 = 9.5e-7, so failure happens slightly more rarely than 1 in a million.

The fourth test key only has a 43.75% chance (1 - (.75 * .75)) of being smaller,
and (1 - .4375) ^ 10 = 3.1e-3, so slightly more likely than 3 per thousand.

Raising the iteration count to 36 brings the fourth key odds of failure to about 1 in a billion (1.01e-9).
36 iterations makes the other 3 fail at 1e-22; but 1e-9 is attained at 15 iterations.

4 years agoCreate one-shot PEM reader and writer
Kevin Jones [Sun, 22 Mar 2020 18:10:45 +0000 (14:10 -0400)]
Create one-shot PEM reader and writer

The reader and writer use the restricted form of PEM from IETF RFC 7468.

The reader uses the `laxtextualmsg` form, with a restricted subset of allowed whitespace (no vertical tab or form feed).

The writer writes according to the `stricttextualmsg` form.

4 years agoAdd clrcompression static library (#33922)
Next Turn [Sun, 22 Mar 2020 15:43:58 +0000 (23:43 +0800)]
Add clrcompression static library (#33922)

4 years agoRemove unused strings in System.ServiceProcess (#33929)
Francesco Saltori [Sun, 22 Mar 2020 15:32:49 +0000 (16:32 +0100)]
Remove unused strings in System.ServiceProcess (#33929)

4 years agoCreate test wrappers in run phase, not build phase aka make Crossgen2 runs green...
Tomáš Rylek [Sun, 22 Mar 2020 09:20:45 +0000 (10:20 +0100)]
Create test wrappers in run phase, not build phase aka make Crossgen2 runs green (#33898)

We need to compile the test wrappers in the test run phase as the
build phase is potentially common to multiple test runs and doesn't
generally know about execution details like the use of Crossgen
/ Crossgen2. Because of this Simon's change to baseline
Crossgen2-specific issues doesn't work.

Thanks

Tomas

4 years ago[llvm] Unify the emission of GOT access. NFC. (#33714)
monojenkins [Sun, 22 Mar 2020 01:18:18 +0000 (21:18 -0400)]
[llvm] Unify the emission of GOT access. NFC. (#33714)

Co-authored-by: vargaz <vargaz@users.noreply.github.com>
4 years agoEnable Microsoft.Extensions.DependencyInjection (#33816)
Maryam Ariyan [Sun, 22 Mar 2020 00:20:32 +0000 (17:20 -0700)]
Enable Microsoft.Extensions.DependencyInjection (#33816)

* Enables DI and Options

4 years agoAnnotate System.Net.Mail for nullable reference types (#33826)
Stephen Toub [Sat, 21 Mar 2020 22:01:49 +0000 (18:01 -0400)]
Annotate System.Net.Mail for nullable reference types (#33826)

4 years agoRemove duplicates and fix namespaces in S.T.RegularExpressions (#33917)
Viktor Hofer [Sat, 21 Mar 2020 18:59:46 +0000 (19:59 +0100)]
Remove duplicates and fix namespaces in S.T.RegularExpressions (#33917)

4 years agoEnable Windows arm64 JIT stress pipeline testing (#33906)
Bruce Forstall [Sat, 21 Mar 2020 17:41:21 +0000 (10:41 -0700)]
Enable Windows arm64 JIT stress pipeline testing (#33906)

Windows arm32 is still disabled until https://github.com/dotnet/runtime/issues/1097
is fully resolved.

4 years agoFix LangVersion for C# projects (#33868)
Stephen Toub [Sat, 21 Mar 2020 15:03:25 +0000 (11:03 -0400)]
Fix LangVersion for C# projects (#33868)

4 years ago[mono] Implement System.Console for iOS (#33827)
Egor Bogatov [Sat, 21 Mar 2020 14:01:13 +0000 (17:01 +0300)]
[mono] Implement System.Console for iOS (#33827)

* Add iOS version of System.Console

4 years agoNaricc/add coreclr check (#33810)
Nathan Ricci [Sat, 21 Mar 2020 13:30:39 +0000 (09:30 -0400)]
Naricc/add coreclr check (#33810)

Initial break up of tests by runtime; we now have catagories of tests that fail on mono/coreclr/both.

4 years agoFix cancellation-related deadlock in BoundedChannel (#33883)
Stephen Toub [Sat, 21 Mar 2020 12:17:57 +0000 (08:17 -0400)]
Fix cancellation-related deadlock in BoundedChannel (#33883)

If:
- a BoundedChannel is opted-in to synchronous continuations via someone setting AllowSynchronousContinuations on its options when constructed, and
- if a read operation is performed when there's no data available and with a cancelable cancellation token, and
- if cancellation is requested concurrently with a write being performed that will satisfy that read...

then there's the potential for a deadlock.  While holding a lock, the writer needs to unregister the cancellation for the reader's operation prior to trying to complete it, and needs to know that all cancellation-related work has quiesced before it proceeds to try to complete that reader.  If the cancellation is currently in progress then, it waits for the cancellation callback to complete.  However, if a synchronous continuation was used, then it's possible the user's synchronous continuation might call back into the bounded channel and perform an operation that might require taking that same lock.  Deadlock.

The fix is to simply not try to use synchronous continuations with bounded channel when a cancelable token is employed.

4 years agoRemove more unnecessary LINQ usage (#33892)
Stephen Toub [Sat, 21 Mar 2020 12:15:46 +0000 (08:15 -0400)]
Remove more unnecessary LINQ usage (#33892)

4 years agoAdd System.Globalization.Native support for Windows (#33704)
Santiago Fernandez Madero [Sat, 21 Mar 2020 07:32:41 +0000 (00:32 -0700)]
Add System.Globalization.Native support for Windows (#33704)

* Add System.Globalization.Native support for Windows

* PR Feedback

* Fix build and address more feedback

* More PR Feedback

* Fix OSX build and update lib name in dllimport

* Remove un-necessary include and update issue link

4 years agoMerge pull request #33882 from dotnet/50yaml
Vivek Mishra [Sat, 21 Mar 2020 06:32:58 +0000 (23:32 -0700)]
Merge pull request #33882 from dotnet/50yaml

5.0 yamls and  edits for 3.1.200

4 years agoUnify some cmake function definitions (#33716)
Adeel Mujahid [Sat, 21 Mar 2020 02:45:42 +0000 (04:45 +0200)]
Unify some cmake function definitions (#33716)

* Unify some cmake function definitions

* Address CR feedback

* Make installers /Zc:strictStrings compatible

* Make installer /Gz compatible

* Remove skip-strip internal implementation

* Use CLR_CMAKE_TARGET_DARWIN

* Establish iOS to Darwin relationship

* Simplify iOS conditions

4 years agoFix missing lock in CoreRTNameMangler (#33903)
Tomáš Rylek [Sat, 21 Mar 2020 02:44:47 +0000 (03:44 +0100)]
Fix missing lock in CoreRTNameMangler (#33903)

4 years agoRevert "Unify instruction set definition (#33730)" (#33901)
David Wrighton [Sat, 21 Mar 2020 02:43:26 +0000 (19:43 -0700)]
Revert "Unify instruction set definition (#33730)" (#33901)

This reverts commit f80a5147ef7662c3238275568c9dad7655a9684f.

4 years agoOnly run format job in master branch (#33896)
Bruce Forstall [Sat, 21 Mar 2020 00:55:37 +0000 (17:55 -0700)]
Only run format job in master branch (#33896)

* Only run format job in master branch

Don't run it in servicing branches, since it depends
on an unversioned `jitutils` repo.

* Run format job on PR builds as well

* Fix Target check to match reality, not documentation

4 years agoUpdate RegionInfo data and Fix RegionInfo.CurrentRegion on Windows (#33834)
Tarek Mahmoud Sayed [Sat, 21 Mar 2020 00:49:24 +0000 (17:49 -0700)]
Update RegionInfo data and Fix RegionInfo.CurrentRegion on Windows (#33834)

* Update RegionInfo data and Fix RegionInfo.CurrentRegion on Windows

* Address the feedback

* feedback

* More Feedback addressing

4 years agoAdd spec: deserializing objects with parameterized ctors (#33095)
Layomi Akinrinade [Fri, 20 Mar 2020 22:59:24 +0000 (15:59 -0700)]
Add spec: deserializing objects with parameterized ctors (#33095)

* Add spec: deserializing objects with parameterized ctors

* State updated parameter-JSON matching proposal

* Address review feedback and add more notes about matching behavior

* Update spec with thoughts following spec review

* Fix typo

4 years agoDelete repo tools manifest in CI to fix CI errors (#33871)
Viktor Hofer [Fri, 20 Mar 2020 22:51:29 +0000 (23:51 +0100)]
Delete repo tools manifest in CI to fix CI errors (#33871)

An updated SDK with the net5.0 tfm change seems to break dotnet repo
tool restore, presumably because multiple compatible tfms are found.
Working around this by deleting the repo tools manifest file until the
issue is fixed.

4 years agoFix DAC minidump generation (#33833)
Mike McLaughlin [Fri, 20 Mar 2020 22:18:54 +0000 (15:18 -0700)]
Fix DAC minidump generation (#33833)

CompressDebugInfo::EnumMemoryRegions did not add the correct debug info
memory when FEATURE_ON_STACK_REPLACEMENT is enabled. This caused the
diagnostics SOS tests to failure on Windows.

4 years ago+ ref/src/tests/pkg (#33844)
Maryam Ariyan [Fri, 20 Mar 2020 21:36:56 +0000 (14:36 -0700)]
+ ref/src/tests/pkg (#33844)

Microsoft.Extensions.Configuration.FileExtensions
Microsoft.Extensions.Configuration.Ini

4 years ago5.0 yamls and edits for 3.1.200
vivmishra [Fri, 20 Mar 2020 19:41:06 +0000 (12:41 -0700)]
5.0 yamls and  edits for 3.1.200

4 years agoForbid block morph in CSE. (#33845)
Sergey Andreenko [Fri, 20 Mar 2020 19:40:16 +0000 (12:40 -0700)]
Forbid block morph in CSE. (#33845)

* Don't call `fgMorphCopyBlock` during CSE.

It could do tranformations that replace trees, some of them could be CSE defs or uses, it would lead to asserts when we try to find them.

* Dump additional information about struct localVariables.

4 years agoAdd [JsonConstructor] and support for deserializing with parameterized ctors (#33444)
Layomi Akinrinade [Fri, 20 Mar 2020 18:29:21 +0000 (11:29 -0700)]
Add [JsonConstructor] and support for deserializing with parameterized ctors (#33444)

* Add [JsonConstructor] and support for deserializing with parameterized ctors

* Add some more tests and clean up

* Move property and parameter caches from converter to JsonClassInfo

* Address review feedback

* Address review feedback and reduce regression for existing benchmarks

* Address review feedback and add more tests

* Clean up arg state on ReadStack

4 years agoRemove SOS_README.md from every app's OutDir (#33878)
Mike McLaughlin [Fri, 20 Mar 2020 18:21:28 +0000 (11:21 -0700)]
Remove SOS_README.md from every app's OutDir (#33878)

Issue #https://github.com/dotnet/runtime/issues/33648

4 years agoUse HW-intrinsics in BitConverter for double <-> long / float <-> int (#33476)
Günther Foidl [Fri, 20 Mar 2020 15:31:20 +0000 (16:31 +0100)]
Use HW-intrinsics in BitConverter for double <-> long / float <-> int (#33476)

* Use hw-intrinsics in BitConverter for double <-> long and float <-> int to emit movd instead of using the stack

* Added comment for workaround

Cf. https://github.com/dotnet/runtime/pull/33476#issuecomment-600937760

4 years ago[interp] Remove MINT_TYPE_P (#33850)
monojenkins [Fri, 20 Mar 2020 15:09:05 +0000 (11:09 -0400)]
[interp] Remove MINT_TYPE_P (#33850)

MINT_TYPE_P is equivalent to the integer versions. By removing it we reduce the number of interpreter types and instructions, making it also easier to apply optimizations on instructions targeting these types.

Co-authored-by: BrzVlad <BrzVlad@users.noreply.github.com>
4 years ago[coop] Make MONO_ENTER_GC_UNSAFE fatal if no_safepoints is set (#32666)
monojenkins [Fri, 20 Mar 2020 14:58:30 +0000 (10:58 -0400)]
[coop] Make MONO_ENTER_GC_UNSAFE fatal if no_safepoints is set (#32666)

Previously it would print a warning, only, because otherwise we would get a
second assert in the same place while the crash machinery would run from the
current thread from the abort in `mono_fatal_with_history`

The solution is to turn off the "no safepoints" bit since we know we're
definitely going to assert here.

Also record the current state in the checked mode state transition history to
make it a bit easier to diagnose where the problem surfaced.

Also fixed up a pair of other debugging/tracing messages so the message strings
accurately reflect the state.

Co-authored-by: lambdageek <lambdageek@users.noreply.github.com>
4 years agoFix running tests (#33719)
Andrey Kurdyumov [Fri, 20 Mar 2020 14:55:59 +0000 (20:55 +0600)]
Fix running tests (#33719)

without that code I have stack trace on Python 3.7.1
when run tests\runtest.cmd /coreclr Top200
```
Traceback (most recent call last):
  File "runtest.py", line 2450, in <module>
    sys.exit(main(args))
  File "runtest.py", line 2423, in main
    lambda path: do_setup(host_os,
  File "runtest.py", line 550, in create_and_use_test_env
    ret_code = func(None)
  File "runtest.py", line 2433, in <lambda>
    test_filter_path))
  File "runtest.py", line 2356, in do_setup
    build_test_wrappers(host_os, arch, build_type, coreclr_repo_location, test_location, None, test_filter_path)
  File "runtest.py", line 1871, in build_test_wrappers
    delete_existing_wrappers(to_unicode(test_location))
  File "runtest.py", line 1822, in to_unicode
    return str(s, "utf-8")
TypeError: decoding str is not supported
```

* Simplify string conversion and update Python
* Fix path to Python3 executable

It was discovered during testing CoreRT in
https://github.com/dotnet/corert/pull/8021

4 years agoRevert "allocate SocketAsyncEngine less frequenty to reduce the number of epoll_wait...
Adam Sitnik [Fri, 20 Mar 2020 14:55:04 +0000 (15:55 +0100)]
Revert "allocate SocketAsyncEngine less frequenty to reduce the number of epoll_wait threads (#2346)" (#33855)

This reverts commit 34dbb20d83719e15bc1bd3976c6638bbee901a0b.

4 years agoChange Environment.OSVersion to use RtlGetVersion (#33651)
Stephen Toub [Fri, 20 Mar 2020 14:08:17 +0000 (10:08 -0400)]
Change Environment.OSVersion to use RtlGetVersion (#33651)

4 years agoAnnotate System.Runtime.WindowsRuntime for nullable reference types (#33692)
Stephen Toub [Fri, 20 Mar 2020 13:58:40 +0000 (09:58 -0400)]
Annotate System.Runtime.WindowsRuntime for nullable reference types (#33692)

4 years agorework locking in SslStream to support TLS1.3 (#32925)
Tomas Weinfurt [Fri, 20 Mar 2020 13:31:49 +0000 (06:31 -0700)]
rework locking in SslStream to support TLS1.3 (#32925)

* initial locking

* feedback from review

* update _handshakeWaiter

* feedback from review

* feedback from review

* feedback from review

4 years agoUpdating the Copyright line display when running 'mono --version' (#32910)
monojenkins [Fri, 20 Mar 2020 12:21:41 +0000 (08:21 -0400)]
Updating the Copyright line display when running 'mono --version' (#32910)

Removes the copyright year.

```
$ mono --version
Mono JIT compiler version 6.6.0.166 (2019-08/d9001b5ae70 Wed Feb 12 19:20:16 EST 2020)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS:
SIGSEGV:       altstack
Notification:  kqueue
Architecture:  amd64
Disabled:      none
Misc:          softdebug
Interpreter:   yes
LLVM:          yes(610)
Suspend:       hybrid
GC:            sgen (concurrent by default)
```

Co-authored-by: ivancitin <ivancitin@users.noreply.github.com>
4 years ago[debugger] Fix NOT_IMPLEMENTED while debugging. (#33702)
monojenkins [Fri, 20 Mar 2020 12:21:27 +0000 (08:21 -0400)]
[debugger] Fix NOT_IMPLEMENTED while debugging. (#33702)

- Changed the behavior on debugger-agent, if we can't parse the new behavior is to return invalid_argument and not assert and stop debugging
- Changed the mono_domain_set_fast before return from assembly_commands.
- Add error message when return INVALID_ARGUMENT

Fixes mono/mono#19146

Co-authored-by: thaystg <thaystg@users.noreply.github.com>
4 years agoRemove dead code from bug-10127.cs. (#31976)
monojenkins [Fri, 20 Mar 2020 12:08:15 +0000 (08:08 -0400)]
Remove dead code from bug-10127.cs. (#31976)

Co-authored-by: jaykrell <jaykrell@users.noreply.github.com>
4 years ago[FreeBSD] Fix for libinotify support and compile (#33607)
monojenkins [Fri, 20 Mar 2020 12:01:18 +0000 (08:01 -0400)]
[FreeBSD] Fix for libinotify support and compile (#33607)

Resolves mono/mono#18528 in for both detection and compiling. This should backport cleanly to next release.

Tested on 12.1-RELEASE with libinotify; configure detects features correctly, compiles successfully, resolves some observed issues during run.

```
#define HAVE_SYS_INOTIFY_H 1
#define HAVE_LIBINOTIFY 1
#define HAVE_INOTIFY_INIT 1
#define HAVE_INOTIFY_ADD_WATCH 1
#define HAVE_INOTIFY_RM_WATCH 1
#define HAVE_INOTIFY 1
```

Co-authored-by: rootwyrm <rootwyrm@users.noreply.github.com>
4 years agoFix R2RDump generic signature parsing (#33825)
Jan Vorlicek [Fri, 20 Mar 2020 08:43:51 +0000 (09:43 +0100)]
Fix R2RDump generic signature parsing (#33825)

The signature parsing wasn't handling module overrides correctly. For
generic type parameters, the current module needs to be reset to the
outer module.

4 years agoDon't pass the managed array object down when clearing a native array field. (#33830)
Jeremy Koritzinsky [Fri, 20 Mar 2020 05:37:06 +0000 (22:37 -0700)]
Don't pass the managed array object down when clearing a native array field. (#33830)

* Don't pass the managed array object down when clearing a native array field.

* Add test.

4 years agoUse ReadOnlySpan<byte> for defaultDerInit (#33828)
Kevin Jones [Fri, 20 Mar 2020 02:35:42 +0000 (22:35 -0400)]
Use ReadOnlySpan<byte> for defaultDerInit (#33828)

* Use ReadOnlySpan for defaultDerInit.

This removes an array allocation for each type initializer.

* Regenerate files.

4 years agoReactivate JsonSerializer polymorphic tests (#33815)
Layomi Akinrinade [Fri, 20 Mar 2020 02:10:28 +0000 (19:10 -0700)]
Reactivate JsonSerializer polymorphic tests (#33815)

4 years ago[master] Update dependencies from dotnet/arcade mono/linker Microsoft/vstest (#33750)
dotnet-maestro[bot] [Fri, 20 Mar 2020 01:04:47 +0000 (21:04 -0400)]
[master] Update dependencies from dotnet/arcade mono/linker Microsoft/vstest (#33750)

* Update dependencies from https://github.com/dotnet/arcade build 20200318.2

- Microsoft.DotNet.XUnitExtensions - 5.0.0-beta.20168.2
- Microsoft.DotNet.VersionTools.Tasks - 5.0.0-beta.20168.2
- Microsoft.DotNet.ApiCompat - 5.0.0-beta.20168.2
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20168.2
- Microsoft.DotNet.Build.Tasks.Feed - 5.0.0-beta.20168.2
- Microsoft.DotNet.Build.Tasks.Packaging - 5.0.0-beta.20168.2
- Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk - 5.0.0-beta.20168.2
- Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk - 5.0.0-beta.20168.2
- Microsoft.DotNet.CodeAnalysis - 5.0.0-beta.20168.2
- Microsoft.DotNet.GenAPI - 5.0.0-beta.20168.2
- Microsoft.DotNet.GenFacades - 5.0.0-beta.20168.2
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20168.2
- Microsoft.DotNet.RemoteExecutor - 5.0.0-beta.20168.2
- Microsoft.DotNet.XUnitConsoleRunner - 2.5.1-beta.20168.2

* Update dependencies from https://github.com/mono/linker build 20200319.1

- ILLink.Tasks - 0.1.6-prerelease.20169.1

* Update dependencies from https://github.com/microsoft/vstest build 20200318-01

- Microsoft.NET.Test.Sdk - 16.6.0-preview-20200318-01

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
4 years agoNew attempt at enabling Windows ARM32 runs (#32819)
Tomáš Rylek [Fri, 20 Mar 2020 00:24:17 +0000 (01:24 +0100)]
New attempt at enabling Windows ARM32 runs (#32819)

4 years agoFix src/libraries to build on clang 10 (#33734)
Omair Majid [Fri, 20 Mar 2020 00:23:36 +0000 (20:23 -0400)]
Fix src/libraries to build on clang 10 (#33734)

Clang 10 enable new warnings, some of which is affecting the
src/libraries code.

Clang 10 has added `-Walloca` to warn about uses of `alloca`. This
commit replaces the only non-compliant use of that with a single fixed
stack-allocated buffer.

Clang 10 has also added `-Wimplicit-int-float-conversion`. This commit
uses explicit casts to double to avoid the warnings.

Fixes #33681

Also contains a small fix for slist.h that was somehow missed in #33096.

After this commit, I can build all of runtime with Clang 10.

4 years ago[mono] Enter GC Unsafe mode in some string allocation functions (#33754)
Aleksey Kliger (λgeek) [Thu, 19 Mar 2020 23:00:09 +0000 (19:00 -0400)]
[mono] Enter GC Unsafe mode in some string allocation functions (#33754)

All these functions are MONO_RT_EXTERNAL_ONLY and they all allocate managed
objects.

Fixes a coop state machine assertion if an embedder calls the function and it needs to take the GC
lock to do a collection.

4 years agoDon't crash with SO for AdvSimd.IsSupported (#33761)
Egor Bogatov [Thu, 19 Mar 2020 22:29:59 +0000 (01:29 +0300)]
Don't crash with SO for AdvSimd.IsSupported (#33761)

4 years agoMake "iOS" not part of "all" to avoid some outerloop assumptions (#33811)
Jo Shields [Thu, 19 Mar 2020 20:39:37 +0000 (16:39 -0400)]
Make "iOS" not part of "all" to avoid some outerloop assumptions (#33811)

4 years agoAdd MemberNotNull/When attributes (#33567)
Julien Couvreur [Thu, 19 Mar 2020 18:31:17 +0000 (11:31 -0700)]
Add MemberNotNull/When attributes (#33567)

* Add MemberNotNull/When attributes

* Apply [CLSCompliant(false)]

* Fix typos and indent

* Move [CLSCompliant(false)] and remove AllowMultiple

* Declare attributes in ref file

* Store parameters into readonly properties

* Don't use deconstruction

* Qualify, move properties, remove this

4 years agoUnify instruction set definition (#33730)
David Wrighton [Thu, 19 Mar 2020 16:29:19 +0000 (09:29 -0700)]
Unify instruction set definition (#33730)

* Unify instruction set definition
- Build simple DSL to describe the instruction set support of the compiler/jit/etc
- Parse DSL and produce data structures useable throughout our compilation environment
- This is in support of adding more granular instruction set support to crossgen2, but this change is pulled out into its own PR to ease reviewing cost
- Make it hard to mess up 64bit instruction set variants by adding helper function to fill them in.
- Add 64 bit variant names to 32bit instruction set enum to remove the need to add a large number of #ifdefs to the jit

4 years agoEnable HTTP/2 client cert authentication in WinHttpHandler (#33158)
Alexander Nikolaev [Thu, 19 Mar 2020 14:37:00 +0000 (15:37 +0100)]
Enable HTTP/2 client cert authentication in WinHttpHandler (#33158)

Pre-release WinHTTP's version supports client cert authentication over HTTP/2, but the feature must be explicitly opted-in. PR sets WINHTTP_OPTION_ENABLE_HTTP2_PLUS_CLIENT_CERT to TRUE before invoking WinHttpConnect if the request's protocol is HTTP/2 and scheme is HTTPS.

This PR also enables all HTTP 1.1 tests for WinHttpHandler on .Net Core and Framework and the most of HTTP/2 tests on .Net Core.

4 years agoExclude packages from checksum generation (#33722)
Matt Mitchell [Thu, 19 Mar 2020 14:30:25 +0000 (07:30 -0700)]
Exclude packages from checksum generation (#33722)

- Remove PreparedArtifacts upload
- Alter the ItemGroup for artifacts that have checksums generated to not include nuget or symbol packages

4 years agoBump global.json dotnet version (#33735)
Egor Bogatov [Thu, 19 Mar 2020 11:00:23 +0000 (14:00 +0300)]
Bump global.json dotnet version (#33735)

4 years ago[runtime] Fix the mapping of 'int' in jit icall signatures, it should be int32 not...
monojenkins [Thu, 19 Mar 2020 10:38:35 +0000 (06:38 -0400)]
[runtime] Fix the mapping of 'int' in jit icall signatures, it should be int32 not native int. (#33711)

Co-authored-by: vargaz <vargaz@users.noreply.github.com>
4 years agoMake iOS sample simulator friendly (#33740)
Egor Bogatov [Thu, 19 Mar 2020 10:29:15 +0000 (13:29 +0300)]
Make iOS sample simulator friendly (#33740)

4 years agoIgnore register unwinder callback for empty patch_info data table on Windows. (#33726)
Johan Lorensson [Thu, 19 Mar 2020 10:01:53 +0000 (11:01 +0100)]
Ignore register unwinder callback for empty patch_info data table on Windows. (#33726)

Running System.Runtime.Serialization.Xml test suite triggers calls to
mono_code_manager_reserve with 0 size code block. On Windows, allocating
code regions from code manager will also add callback for code region
into unwinder function table, but since region could be 0 length,
it will be causing a crash in RtlInstallFunctionTableCallback OS call.

Fix hardens code to not try to register callbacks for code regions
of size 0, since that is considered a critical error by Windows OS API.

4 years agoRemove bad calls to ReferenceEquals (#33739)
Jeremy Barton [Thu, 19 Mar 2020 09:47:05 +0000 (02:47 -0700)]
Remove bad calls to ReferenceEquals (#33739)

All of these calls to ReferenceEquals pass a value type, which gets boxed, and
ReferenceEquals returns false.
Further, all of the calls originated in .NET Framework, so the moderately
expensive way of saying "false" has been there for a while.

* Inline the expression to `false`
* Further inline and remove dead blocks or unnecessary ifs.
* Delete any comments explaining the code, since they're not relevant.

4 years ago[interp] Optimize out intptr ctor (#33720)
monojenkins [Thu, 19 Mar 2020 08:37:37 +0000 (04:37 -0400)]
[interp] Optimize out intptr ctor (#33720)

Co-authored-by: BrzVlad <BrzVlad@users.noreply.github.com>
4 years agoMono DISABLE_SIMD define still emits OP codes depending on SIMD support. (#33717)
Johan Lorensson [Thu, 19 Mar 2020 03:31:29 +0000 (04:31 +0100)]
Mono DISABLE_SIMD define still emits OP codes depending on SIMD support. (#33717)

Fix makes sure runtime checks also report that SIMD has been disabled.
Returning FALSE from is_simd_supported will turn of MONO_OPT_SIMD and
disable all SSE/AVX cpu features will prevent code checking cpu
capabilities to emit SIMD instructions.

4 years agoFix warning building Mono using -Wint-conversion. (#33723)
Johan Lorensson [Thu, 19 Mar 2020 03:29:17 +0000 (04:29 +0100)]
Fix warning building Mono using -Wint-conversion. (#33723)

4 years agoFix SIMD case on arm64 linux with zapDisabled. (#33712)
Sergey Andreenko [Thu, 19 Mar 2020 01:57:51 +0000 (18:57 -0700)]
Fix SIMD case on arm64 linux with zapDisabled. (#33712)

4 years ago[Arm64] Implement Store Hardware Intrinsic (#33535)
Egor Chesakov [Thu, 19 Mar 2020 01:31:08 +0000 (18:31 -0700)]
[Arm64] Implement Store Hardware Intrinsic (#33535)

4 years agoMerge pull request #33678 from maryamariyan/fromoldmaster-di-spec
Maryam Ariyan [Thu, 19 Mar 2020 01:25:26 +0000 (18:25 -0700)]
Merge pull request #33678 from maryamariyan/fromoldmaster-di-spec

Brings over history on DI.Specification.Tests from Extensions