platform/upstream/dotnet/runtime.git
4 years ago[mono] Implement Environment.GetFolderPath on iOS (#34022)
Egor Bogatov [Tue, 31 Mar 2020 14:23:20 +0000 (17:23 +0300)]
[mono] Implement Environment.GetFolderPath on iOS (#34022)

* Implement Environment.GetFolderPath on iOS

* Address feedback

* Move GetFolderPathCore to Environment.Unix.GetFolderPathCore.cs

* Fix build issue

* Address feedback

* cache all special directories

* Fix build issue

* remove a whitespace

* Fix UserProfile issue

* undo changes in GetEnvironmentVariableCore

* Update Environment.Unix.Mono.cs

* Extract to InternalGetEnvironmentVariable

* Fix build issue

* Return emtpy string if underlying native function returns null

* Add nullability

4 years agoUpdate Microsoft.CodeAnalysis.FxCopAnalyzers to 3.0.0-beta3.final (#34312)
Stephen Toub [Tue, 31 Mar 2020 14:20:36 +0000 (10:20 -0400)]
Update Microsoft.CodeAnalysis.FxCopAnalyzers to 3.0.0-beta3.final (#34312)

4 years agoExpression.Field should validate field name for null (#34301)
Vitek Karas [Tue, 31 Mar 2020 13:53:01 +0000 (06:53 -0700)]
Expression.Field should validate field name for null (#34301)

Small change to correctly check for null in one of the overloads of Expression.Field.

4 years ago[mono] Use $(HostArch) for LLVM packages (#34322)
Egor Bogatov [Tue, 31 Mar 2020 13:26:52 +0000 (16:26 +0300)]
[mono] Use $(HostArch) for LLVM packages (#34322)

* Use HostArch for LLVM packages

* define HostArch for mono

4 years agoInitial perf jitdump implementation (#33893)
monojenkins [Tue, 31 Mar 2020 13:04:01 +0000 (09:04 -0400)]
Initial perf jitdump implementation (#33893)

Fixes mono/mono#17024

Co-authored-by: fanyang-mono <fanyang-mono@users.noreply.github.com>
4 years ago[runtime] Fix a problem with PR mono/mono#19361. (#34299)
monojenkins [Tue, 31 Mar 2020 09:06:04 +0000 (05:06 -0400)]
[runtime] Fix a problem with PR mono/mono#19361. (#34299)

<!--
Thank you for your Pull Request!

If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.

Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->

Co-authored-by: vargaz <vargaz@users.noreply.github.com>
4 years agoStreamline C heap allocations (#34289)
Jan Kotas [Tue, 31 Mar 2020 05:32:29 +0000 (22:32 -0700)]
Streamline C heap allocations (#34289)

- Remove unnecessary layers in heap allocation APIs
- Delete HeapCreate/Alloc/Free/Destroy from the PAL

4 years agoRemove TargetOS renaming under installer (#34313)
Jan Kotas [Tue, 31 Mar 2020 05:02:44 +0000 (22:02 -0700)]
Remove TargetOS renaming under installer (#34313)

4 years agoMerge pull request #34208 from maryamariyan/inspection
Maryam Ariyan [Tue, 31 Mar 2020 05:00:44 +0000 (22:00 -0700)]
Merge pull request #34208 from maryamariyan/inspection

Extensions commit mop-up

4 years agoChange PublicKeyToken for M.E. src and test projects
Maryam Ariyan [Fri, 27 Mar 2020 22:04:40 +0000 (15:04 -0700)]
Change PublicKeyToken for M.E. src and test projects
- Updates InternalsVisibleTo files as well

- Setup Logging.EventSource.Tests
- Fix three failing EventSourceLoggerTest tests
- Delete file: IntegrationTesting csproj not needed.
- Rename folder test -> tests (Logging/tests/DI.Common/tests)
- Cleanup other csproj

    fix compile issue

4 years agoCondition before/after import in IL.Sdk for pre5.0 (#34278)
Viktor Hofer [Tue, 31 Mar 2020 03:25:43 +0000 (05:25 +0200)]
Condition before/after import in IL.Sdk for pre5.0 (#34278)

With this, the IL SDK will continue to work when it comes to either single or multitargeting without restoring the projects in multi-targeting mode. This helps to not introduce a breaking change for 3.x SDKs.

4 years agoRevert "Switch reverse PInvoke to the NativeCallable plan (#34251)" (#34306)
Santiago Fernandez Madero [Tue, 31 Mar 2020 02:45:31 +0000 (19:45 -0700)]
Revert "Switch reverse PInvoke to the NativeCallable plan (#34251)" (#34306)

This reverts commit 4e30ff033fbd915c5a39df8901d43c601deeeeb4.

4 years agoRestore TargetArchitecture default (#34295)
Jan Kotas [Tue, 31 Mar 2020 00:58:56 +0000 (17:58 -0700)]
Restore TargetArchitecture default (#34295)

Fixes #34292

4 years agoExplicitly throw the OutOfMemoryException instead of relying on Shared.Rent/Array...
Felipe Pessoto [Tue, 31 Mar 2020 00:52:01 +0000 (21:52 -0300)]
Explicitly throw the OutOfMemoryException instead of relying on Shared.Rent/Array constructor. Because it can behave differently in OSX, where it supports int.MaxValue array size. (#34040)

4 years agoFlow TargetArchitecture always in Unix build script (#34300)
Santiago Fernandez Madero [Tue, 31 Mar 2020 00:30:52 +0000 (17:30 -0700)]
Flow TargetArchitecture always in Unix build script (#34300)

4 years agoMake `compCurBB` available for `fgMorphBlockReturn`. (#34184)
Sergey Andreenko [Tue, 31 Mar 2020 00:06:32 +0000 (17:06 -0700)]
Make `compCurBB` available for `fgMorphBlockReturn`. (#34184)

* Extract `fgMergeBlockReturn`.

Morph is already a very vague verb in the Jit, try to use a more precise one.

* Add a function header.

* Make `compCurBB` available for `fgMorphBlockReturn`.

When we generate an assignment we could need to create a new assertion, that requires `compCurBB` to be available.

* Delete `INVALID_POINTER_VALUE`.

I would like to remove it because:
1) it was debug only;
2) there were no null checks for `compHndBBtab`, because it is a dependent variable
so there was no need to distinguish valid null pointer from a bad invalid pointer;
3) that is the only place where this mechanism was used.

* Allow to CSE the merge return ASG.

I can't see a reason why it should not, there are no diffs.
The issue with the previous version was that we did not actually know what we were marking: GT_ASG, GT_COMMA, something else? Was the idea to mark individual ASG under COMMA?

4 years agoFix wrong assert in cgroups code (#34291)
Jan Vorlicek [Mon, 30 Mar 2020 23:27:02 +0000 (01:27 +0200)]
Fix wrong assert in cgroups code (#34291)

There is an assert in FindCgroupPath that fires when hierarchy_root
and cgroup_path_relative_to_mount are equal, which is the case for
cgroups that are not named. This assert checks that the common
path in those two variables ends with / which is only the case
with named groups.

We have never seen this assert to fire because cgroups initialization
happens before the debugger support initialization in PAL and so
asserts are disabled at that point. I am going to fix that in a
separate PR.

This problem was discovered with the standalone GC where the assert
actually fires as it uses a plain C assert function.

This change fixes the assert to account for the case when both the
paths are the same.

4 years ago[mono][llvm] Improve LLVM 9 compatibility. (#34182)
imhameed [Mon, 30 Mar 2020 21:01:25 +0000 (14:01 -0700)]
[mono][llvm] Improve LLVM 9 compatibility. (#34182)

Improve LLVM 9 compatibility.

Several intrinsics were removed in LLVM 7 and above; replace them with
IR sequences that generate the desired instructions.

Fix some type mismatch problems with the generated IR (in
Sse2.StoreAlignedNonTemporal, Vector128.CreateScalarUnsafe, and
Sse2.MaskMove); these were caught by running the coreclr hardware
intrinsic JIT tests.

Support the two-argument forms of Sse.SqrtScalar, Sse.ReciprocalScalar,
and Sse.ReciprocalSqrtScalar.

llvm::linkCoreCLRGC(), in llvm/CodeGen/GCs.h, was removed and replaced with
llvm::linkAllBuiltinGCs(), in llvm/CodeGen/BuiltinGCs.h.

In mono_llvm_dump_value and mono_llvm_dump_module, flush the c library's
stdout stream before using (and flushing) LLVM's own buffered output
functions.

4 years ago[CBOR] Implement tag and special value support for CborWriter and CborReader (#34046)
Eirik Tsarpalis [Mon, 30 Mar 2020 20:49:09 +0000 (21:49 +0100)]
[CBOR] Implement tag and special value support for CborWriter and CborReader (#34046)

* Implement tag support for CborWriter and CborReader

* Implement CBOR special value support

* add nested special value tests

* implement half-precision float decoding; address feedback

* address style

* remove dead code

* add checks for CBOR tags in indefinite-length collections

* Update src/libraries/System.Security.Cryptography.Encoding/tests/Cbor/CborWriter.Integer.cs

Co-Authored-By: Jeremy Barton <jbarton@microsoft.com>
Co-authored-by: Jeremy Barton <jbarton@microsoft.com>
4 years agoAdd System.Type converter for JsonSerializer (#34249)
Layomi Akinrinade [Mon, 30 Mar 2020 20:37:49 +0000 (16:37 -0400)]
Add System.Type converter for JsonSerializer (#34249)

* Add System.Type converter for JsonSerializer

* Address review feedback

* Remove throw helper

4 years agoHoist volatile variable's access outside the loop (#34225)
Kunal Pathak [Mon, 30 Mar 2020 20:06:05 +0000 (13:06 -0700)]
Hoist volatile variable's access outside the loop (#34225)

* Hoist volatile variable's access outside the loop

`_tables` is a volatile object and it has `_countPerLock` volatile field.
On ARM64, JIT generates memory barrier instruction "dmb" for every volatile
variable access which could be expensive. This PR caches the volatile
variables outside the loop and use cached local variables instead.

Fixes: https://github.com/dotnet/runtime/issues/34198

4 years agoAllow coreclr_create_delegate to return pointers to NativeCallable methods (#34270)
Jan Kotas [Mon, 30 Mar 2020 20:03:34 +0000 (13:03 -0700)]
Allow coreclr_create_delegate to return pointers to NativeCallable methods (#34270)

* Allow coreclr_create_delegate to return pointers to NativeCallable methods

Fixes #34266

* Simplify CorHost implementation

* Updated error message

4 years agoFix ASPNET package paths (#34283)
Eric StJohn [Mon, 30 Mar 2020 19:57:39 +0000 (12:57 -0700)]
Fix ASPNET package paths (#34283)

4 years agoGenerate memory barrier with inner shareable domain for ARM64 (#34227)
Kunal Pathak [Mon, 30 Mar 2020 19:09:09 +0000 (12:09 -0700)]
Generate memory barrier with inner shareable domain for ARM64 (#34227)

Today, for volatile variable access, JIT generates "dmb oshld" which is
a memory barrier with outer shareable domain.

Coreclr uses [atomics and interlocked APIs](https://github.com/dotnet/runtime/blob/fcd862e06413a000f9cafa9d2f359226c60b9b42/src/coreclr/src/inc/volatile.h#L153)
for memory safety and msvc / clang both generate inner shareable domain
for them. Hence it is sensible for JIT that is compiled with
[msvs](https://godbolt.org/z/8XEWYr) ./ [clang](https://godbolt.org/z/DMZi26)
to generate inner shareable domain for volatile access.
[gcc](https://godbolt.org/z/zSf4fS) too emits inner shareable domain for API
that takes full system memory barrier.

4 years agoFix debug symbol generation (#34154)
Jan Vorlicek [Mon, 30 Mar 2020 18:32:48 +0000 (20:32 +0200)]
Fix debug symbol generation (#34154)

* Fix debug symbol generation

The debug symbol generation got recently broken. For most of the
shared libraries, the debug symbols were stripped twice due to
the fact that install_clr for them was invoked twice - once for
the default install location and once for the sharedFramework
location and the stripping was executed in both of them. First
stripping stripped the symbols off the target binary and set
so called debuglink in the binary to point to the symbol file.
This debuglink includes a crc32 of the dbg symbols file.
The second stripping tried to strip symbols from the already
stripped binary. That resulted in a small dbg symbols file
that didn't actually contain any useful symbols. Moreover,
it is not possible to set a debuglink in a binary if it is
already set there. So the second attempt failed and the crc
was left set to the crc of the previous debug. Thus when
debugger loads such a binary, it cannot find the debug symbols
file, as the crc doesn't match. And even if it matched, the
data would have no value.

The fix is to modify install_clr so that it has an extra
optional argument to specify the secondary install location and
use just one install_clr per target. The function then does the
stripping just once and the actual installation once or twice
depending on the secondary location argumenbt presence.

* Fix libraries and installer

* Fix installer placement of lib files

4 years agofix TLS13 procesing on windows (#34181)
Tomas Weinfurt [Mon, 30 Mar 2020 18:29:39 +0000 (11:29 -0700)]
fix TLS13 procesing on windows (#34181)

* fix TLS13 procesing on windows

* fix test

* rework disabled renegotiation

* update platform detection

Co-authored-by: Tomas Weinfurt <furt@GokceOncu.middleeast.corp.microsoft.com>
4 years agoFix EnumerableViewOfDispatch.GetEnumerator ref counting (#34230)
Elinor Fung [Mon, 30 Mar 2020 18:27:43 +0000 (11:27 -0700)]
Fix EnumerableViewOfDispatch.GetEnumerator ref counting (#34230)

4 years agoVectorise BitArray for ARM64 (#33749)
Ganbarukamo41 [Mon, 30 Mar 2020 17:45:39 +0000 (02:45 +0900)]
Vectorise BitArray for ARM64 (#33749)

* Vectorise BitArray for ARM64

* Make algorithms endianness agnostic

* Change loop counter to uint to prevent overflow

* Fix CopyTo(bool[])

* Move constant variables outside the loop

* More unsigned goodness

* Use span.Clear instead of Fill(0)

4 years agoAdd solution files for Extensions projects (#34234)
Maryam Ariyan [Mon, 30 Mar 2020 17:29:54 +0000 (10:29 -0700)]
Add solution files for Extensions projects (#34234)

4 years agoJIT: initial workup for suppressing dumps and checks post-phase (#33305)
Andy Ayers [Mon, 30 Mar 2020 17:24:33 +0000 (10:24 -0700)]
JIT: initial workup for suppressing dumps and checks post-phase (#33305)

Allow phases to declare what parts of jit state they might have modified,
and suppress dumps and checks based on these declarations.

Existing phases that don't know about this are handled by defaulting to
reporting that everything might have been modified.

Changed over all explicit phases to return status, as well as a handful
of phases that are methods on the Compiler object. Also converted a few
lambda phases into Compiler phase methods.

4 years agoUnifying duplicate msbuild properties in CoreCLR build (#34261)
Jan Kotas [Mon, 30 Mar 2020 17:06:24 +0000 (10:06 -0700)]
Unifying duplicate msbuild properties in CoreCLR build (#34261)

- __TargetOS -> TargetOS
- __BuildType, BuildType -> Configuration
- __BuildArch, BuildArch -> TargetArchitecture

4 years agoFix for changed host behaviour on app crash (#34224)
Elinor Fung [Mon, 30 Mar 2020 16:47:26 +0000 (09:47 -0700)]
Fix for changed host behaviour on app crash (#34224)

* Switch back to only handling synchronous exceptions in host components

Add native hosting tests for components with unhandled exceptions.

* Switch setting /EHa to be for coreclr instead of shared default

4 years agoBump maximum ICU library version in Unix System.Globalization.Native (#34095)
Jan Vorlicek [Mon, 30 Mar 2020 12:44:47 +0000 (14:44 +0200)]
Bump maximum ICU library version in Unix System.Globalization.Native (#34095)

* Bump maximum ICU library version we scan in System.Globalization.Native on Unix

The maximum major version of ICU library that we start scanning at was set to 70
(50 as the minimum supported version + 20) long time ago. The available version
of ICU is approaching that limit (it is at 67 now).
This change bumps the max scanned version to 80 to give us enough head space
for a couple of years (guessing based on the current release rate)

* Reflect PR feedback

4 years ago[wasm] Throw an exception in some blocking operations in non-threaded mode. (#34265)
monojenkins [Mon, 30 Mar 2020 12:36:08 +0000 (08:36 -0400)]
[wasm] Throw an exception in some blocking operations in non-threaded mode. (#34265)

<!--
Thank you for your Pull Request!

If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.

Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->

Co-authored-by: vargaz <vargaz@users.noreply.github.com>
4 years ago[interp] Optimize Span<byte>.Fill (#34219)
Vlad Brezae [Mon, 30 Mar 2020 08:55:58 +0000 (11:55 +0300)]
[interp] Optimize Span<byte>.Fill (#34219)

* [interp] Intrinsify Type.IsValueType

* [interp] Intrinsify InitBlockUnaligned

4 years ago[llvmonly] Avoid marking the rgctx/vtable variable indirect, its not needed. (#33955)
monojenkins [Mon, 30 Mar 2020 08:53:48 +0000 (04:53 -0400)]
[llvmonly] Avoid marking the rgctx/vtable variable indirect, its not needed. (#33955)

In normal llvm mode, these variables are marked as indirect and stored to a stack slot so the EH code can access them.

Co-authored-by: vargaz <vargaz@users.noreply.github.com>
4 years ago[runtime] Allocate the memory for gshared gparams from image sets. (#34262)
monojenkins [Mon, 30 Mar 2020 08:43:24 +0000 (04:43 -0400)]
[runtime] Allocate the memory for gshared gparams from image sets. (#34262)

Fixes https://github.com/mono/mono/issues/18127.

<!--
Thank you for your Pull Request!

If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.

Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->

Co-authored-by: vargaz <vargaz@users.noreply.github.com>
4 years agoCleanup build scripts (#34268)
Jan Kotas [Mon, 30 Mar 2020 05:27:39 +0000 (22:27 -0700)]
Cleanup build scripts (#34268)

- Delete unnecessary msbuild properties (left-overs from the conversion to SDK projects)
- Delete jit.settings.targets

4 years agoSwitch reverse PInvoke to the NativeCallable plan (#34251)
Jan Kotas [Mon, 30 Mar 2020 04:33:06 +0000 (21:33 -0700)]
Switch reverse PInvoke to the NativeCallable plan (#34251)

Fixes #33581

4 years agoFix nullable annotation on GetIPv4Properties (#34257)
Stephen Toub [Mon, 30 Mar 2020 00:28:48 +0000 (20:28 -0400)]
Fix nullable annotation on GetIPv4Properties (#34257)

4 years agoRename ArchGroup -> TargetArchitecture (#34260)
Jan Kotas [Mon, 30 Mar 2020 00:20:20 +0000 (17:20 -0700)]
Rename ArchGroup -> TargetArchitecture (#34260)

Most places use TargetArchitecture already. These two properties seems to be always set to the same value.

4 years agoDelete *.nativeproj projects (#34259)
Jan Kotas [Sun, 29 Mar 2020 21:19:03 +0000 (14:19 -0700)]
Delete *.nativeproj projects (#34259)

Left-over from Razzle build

4 years agoAdded some stress coverage for Pinned Object Heap (#34217)
Vladimir Sadov [Sun, 29 Mar 2020 08:17:35 +0000 (01:17 -0700)]
Added some stress coverage for Pinned Object Heap (#34217)

4 years agoRemove a couple unnecessary ToStrings in System.DirectoryServices (#34244)
Stephen Toub [Sat, 28 Mar 2020 21:44:31 +0000 (17:44 -0400)]
Remove a couple unnecessary ToStrings in System.DirectoryServices (#34244)

These are calling ToString on a StringBuilder, but StringBuilder.Append has a StringBuilder-based overload in netcoreapp.  On other builds this will just fall back to the object-based overload, which will call ToString.

4 years agoAdd Nightly Build feed to README.md (#34241)
FreddyD-GH [Sat, 28 Mar 2020 20:57:06 +0000 (16:57 -0400)]
Add Nightly Build feed to README.md (#34241)

* Update README.md

* Update homepage and add section to dogfooding

* Link homepage to existing dogfooding.md page

* Add section for Obtaining nightly builds of NuGet packages

* Incorporate dotnet CLI commands

4 years agoUpdate SignedXml.cs (#34238)
Scott Xu [Sat, 28 Mar 2020 18:07:59 +0000 (02:07 +0800)]
Update SignedXml.cs (#34238)

4 years agoDelete tiered-compilation-guide.md (#34242)
Jan Kotas [Sat, 28 Mar 2020 18:07:36 +0000 (11:07 -0700)]
Delete tiered-compilation-guide.md (#34242)

This contains outdated information about tiered compilation preview

4 years agoUse separate key instances for span/array/array+offset test classes (#34199)
Jeremy Barton [Sat, 28 Mar 2020 16:58:34 +0000 (09:58 -0700)]
Use separate key instances for span/array/array+offset test classes (#34199)

Because the key object generation was done in the algorithm-specific base class,
the triplet of interface types was using the key instances in parallel.

By moving the static variable (and initialization thereof) to each of the derived
classes, the key objects are unique per class, which matches the test parallelism.

Making the classes be part of the same test collection would also solve this problem,
which would save on a few random keygens, but would likely overall take more
time due to the number of tests that would be moved to sequential execution.

4 years agoUpdate dependencies from https://github.com/mono/linker build 20200327.4 (#34237)
dotnet-maestro[bot] [Sat, 28 Mar 2020 14:32:35 +0000 (14:32 +0000)]
Update dependencies from https://github.com/mono/linker build 20200327.4 (#34237)

- ILLink.Tasks - 5.0.0-preview.3.20177.4

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
4 years ago.NET Core to .NET branding changes (#33694)
Jan Kotas [Sat, 28 Mar 2020 14:00:19 +0000 (07:00 -0700)]
.NET Core to .NET branding changes (#33694)

Contributes to #33680

4 years agoImprove platform detection for Android and SunOS (#34236)
Adeel Mujahid [Sat, 28 Mar 2020 13:51:54 +0000 (15:51 +0200)]
Improve platform detection for Android and SunOS (#34236)

4 years agoMove OSR related APIs to Common (#34232)
Michal Strehovský [Sat, 28 Mar 2020 13:50:04 +0000 (14:50 +0100)]
Move OSR related APIs to Common (#34232)

Also unifying the style with the others that just throw.

4 years ago[llvm] Handle this arguments as inputs to phi nodes, i.e. for IL code doing starg...
monojenkins [Sat, 28 Mar 2020 08:00:14 +0000 (04:00 -0400)]
[llvm] Handle this arguments as inputs to phi nodes, i.e. for IL code doing starg.0. (#34081)

<!--
Thank you for your Pull Request!

If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.

Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->

Co-authored-by: vargaz <vargaz@users.noreply.github.com>
4 years agoAdd RuntimeInformation.RuntimeIdentifier (#34206)
Eric Erhardt [Sat, 28 Mar 2020 05:47:13 +0000 (00:47 -0500)]
Add RuntimeInformation.RuntimeIdentifier (#34206)

* Add RuntimeInformation.RuntimeIdentifier

This value returns the Runtime Identifier (RID) of the current machine.

Contributes to #26780

* Include XML doc comments for the new property.

* Consistently check for AppContext strings.

4 years agoFix the coreclr outerloop build (#34223)
Jared Parsons [Sat, 28 Mar 2020 03:02:00 +0000 (20:02 -0700)]
Fix the coreclr outerloop build (#34223)

Revert the warn as error as it's causing the coreclr outerloop build to
break. Investigated fixing the warnings but there are a mix of C# and IL
warnings. The latter I'm less sure of the fix. Reverting to unblock and
will investigate the warnings in parallel.

closes #34220

4 years agoJIT: allow CORINFO_HELP_READYTORUN_GENERIC_HANDLE to be optimized (#34221)
Andy Ayers [Sat, 28 Mar 2020 02:33:32 +0000 (19:33 -0700)]
JIT: allow CORINFO_HELP_READYTORUN_GENERIC_HANDLE to be optimized (#34221)

This helper is idempotent and exception free, so enable it for value numbering.
Also, no need to spill the entire eval stack for a virtual stub calls.

Addresses part of #7723.

4 years agoFixing ifdef (#34218)
Maryam Ariyan [Fri, 27 Mar 2020 23:53:48 +0000 (16:53 -0700)]
Fixing ifdef (#34218)

4 years agoAdd notifyInstructionSetUsage api to jit interface (#34209)
David Wrighton [Fri, 27 Mar 2020 23:17:15 +0000 (16:17 -0700)]
Add notifyInstructionSetUsage api to jit interface (#34209)

* Add notifyInstructionSetUsage api to jit interface- Add api to be used when the jit is to notify the VM of any usage of higher level instruction sets- Note that this change does nothing using the api. This is merely a scaffolding change to prepare for functional changes later  - There is also scaffoling in the jit to JITDUMP any usage of the api

* Code review feedback

4 years agoUnwrap the TargetInvocationException when a IDispatch invoke throws. (#34201)
Aaron Robinson [Fri, 27 Mar 2020 23:16:24 +0000 (16:16 -0700)]
Unwrap the TargetInvocationException when a IDispatch invoke throws. (#34201)

* Unwrap the TargetInvocationException thrown during an IDispatch.
   This matches the behavior of .NET Framework.

4 years agoActive issue using 33993 (#34207)
Maryam Ariyan [Fri, 27 Mar 2020 22:03:00 +0000 (15:03 -0700)]
Active issue using 33993 (#34207)

4 years ago[interp] Constant fold also checked conversion opcodes (#33981)
monojenkins [Fri, 27 Mar 2020 21:06:40 +0000 (17:06 -0400)]
[interp] Constant fold also checked conversion opcodes (#33981)

Co-authored-by: BrzVlad <BrzVlad@users.noreply.github.com>
4 years agoUse RtlUnwind instead of RtlUnwindEx. (#34188)
Jay Krell [Fri, 27 Mar 2020 20:28:15 +0000 (13:28 -0700)]
Use RtlUnwind instead of RtlUnwindEx. (#34188)

Because the formerly uninitialized scratch context is now an input.

4 years agoNeed to convert from uint instead of cast here to maintain consistency with mono_gcha...
monojenkins [Fri, 27 Mar 2020 19:58:55 +0000 (15:58 -0400)]
Need to convert from uint instead of cast here to maintain consistency with mono_gchandle_new_weakref_internal. (#34153)

Looks like this was missed in: https://github.com/Unity-Technologies/mono/commit/941a335ea0f20c22a02a7947945f53787a56b2d3

Co-authored-by: UnityAlex <UnityAlex@users.noreply.github.com>
4 years ago[Host] Allow disabling reloadOnChange for Host's CreateDefaultBuilder (dotnet/Extensi...
Keith Kjer [Thu, 19 Mar 2020 16:40:58 +0000 (09:40 -0700)]
[Host] Allow disabling reloadOnChange for Host's CreateDefaultBuilder (dotnet/Extensions#2940)

* Add environment var to allow disabling live reload in default builder

* Switch to using hostingContext, rename flag to fit nomenclature.

* Change flag to memory data source. Change content root default instead of runtime default.

* Update config key to be hierarchical. Change await on positive case to be longer and cancel using the reload token.

* Uncomment a development test case.

* Apply suggestions from code review

Co-authored-by: Chris Ross <Tratcher@Outlook.com>
Commit migrated from https://github.com/dotnet/Extensions/commit/64140f90157fec1bfd8aeafdffe8f30308ccdf41

4 years agoFixed variable name typo (dotnet/Extensions#3085)
jeuxjeux20 [Mon, 16 Mar 2020 16:55:29 +0000 (17:55 +0100)]
Fixed variable name typo (dotnet/Extensions#3085)

Commit migrated from https://github.com/dotnet/Extensions/commit/5bcbaa2cd1b54da4d919841df815820185189a5c

4 years agoMerge pull request dotnet/Extensions#2957 from sywhang/dev/suwhang/fix-logging-event...
Sung Yoon Whang [Tue, 10 Mar 2020 21:57:24 +0000 (14:57 -0700)]
Merge pull request dotnet/Extensions#2957 from sywhang/dev/suwhang/fix-logging-event-source

Fix LoggingEventSource to handle null strings

Commit migrated from https://github.com/dotnet/Extensions/commit/8d0fa056d78af506e3218af056c92930e8a5d5c1

4 years agoAdd more tests
Sung Yoon Whang [Tue, 10 Mar 2020 21:14:52 +0000 (14:14 -0700)]
Add more tests

Commit migrated from https://github.com/dotnet/Extensions/commit/6171c146edcd6a119291faee6f90de904e0fe8d1

4 years agoRemove Serilog dependency in extensions (dotnet/Extensions#3040)
John Luo [Fri, 6 Mar 2020 22:59:15 +0000 (14:59 -0800)]
Remove Serilog dependency in extensions (dotnet/Extensions#3040)

* Remove Serilog dependency in extensions

* Add xunit logging for shutdown tests

* Need to remove dependency on AspNetCore.Testing and remove DumpCollector

Commit migrated from https://github.com/dotnet/Extensions/commit/540b4e8f129a132749a60174464b8c8274bfed7d

4 years ago[master] Switch to Windows Server queues (dotnet/Extensions#2927)
Doug Bunting [Wed, 4 Mar 2020 23:12:02 +0000 (15:12 -0800)]
[master] Switch to Windows Server queues (dotnet/Extensions#2927)

- add debug information for `Assert` failures in `MaximumOSVersionTest`
- update src/TestingUtils/Microsoft.AspNetCore.Testing/test/MaximumOSVersionTest.cs
  - co-Authored-By: @Tratcher
- try with VS2019 queues
- skip `MaximumOSVersion` tests on .NET due to xunit issue
  - co-authored-by: @Tratcher

Commit migrated from https://github.com/dotnet/Extensions/commit/26ff835952efd87e6794d72c6d684d61f7ff7f6c

4 years agoFix undetermined SPMI behavior. (#34183)
Sergey Andreenko [Fri, 27 Mar 2020 18:27:15 +0000 (11:27 -0700)]
Fix undetermined SPMI behavior. (#34183)

* Fix undeterminate SPMI behavior.

* another missed place.

4 years agoFix x86 packing issues in System.Data.OleDb (#33899)
FreddyD-GH [Fri, 27 Mar 2020 18:05:27 +0000 (14:05 -0400)]
Fix x86 packing issues in System.Data.OleDb (#33899)

* fix x86 packing issues

* revert unintentional change

* Fix formatting

Fix formatting

* Inline static initializations

* Fix bugs in static intialization

* Move all code to OleDbStruct.cs

* Rename the utility Type

* Inlining method returns

* add tests to test the x86 APIs

Co-authored-by: FreddyD <FreddyD@GIT>
Co-authored-by: Saurabh Singh <saurabh.singh@microsoft.com>
Co-authored-by: Saurabh Singh <sausing@microsoft.com>
4 years ago[master] Update dependencies from mono/linker (#34061)
dotnet-maestro[bot] [Fri, 27 Mar 2020 17:48:09 +0000 (17:48 +0000)]
[master] Update dependencies from mono/linker (#34061)

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

- ILLink.Tasks - 0.1.6-prerelease.20175.1

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

- ILLink.Tasks - 0.1.6-prerelease.20175.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
4 years agoFix HTTP SchSendAuxRecordTest (#33751)
Jan Jahoda [Fri, 27 Mar 2020 17:21:48 +0000 (18:21 +0100)]
Fix HTTP SchSendAuxRecordTest (#33751)

* Read content to end

* fix typo

* format code

4 years agoClean up warnings building CLR tests (#34155)
Jared Parsons [Fri, 27 Mar 2020 17:04:27 +0000 (10:04 -0700)]
Clean up warnings building CLR tests (#34155)

The CLR test build was producing two different warnings:
1. Invalid use of C# nullable reference types
1. Double import of disableversioncheck.targets

Unwinding the double import was tricky due to the way several of the
projects in this tree were double built with different variables which
changed the directories that code was imported from. Eventually settled
on an old C++ trick of using a set variable to avoid the future double
import.

Not particularly happy with this trick but also not a clear way to
unwind the double imports here.

Overall these warnings snuck into the build because warn as error was
disabled for all the MSBuild invocations. That was apparently due to
coreclr#19922 which has long since been closed. Hence I flipped back on
warn as error here.

4 years agoAdd how to run outer loop libraries tests (#32940)
Karel Zikmund [Fri, 27 Mar 2020 16:55:14 +0000 (09:55 -0700)]
Add how to run outer loop libraries tests (#32940)

* Add how to run outer loop libraries tests

4 years agoInclude doc files in Extensions transport package (#34176)
Eric StJohn [Fri, 27 Mar 2020 16:44:02 +0000 (09:44 -0700)]
Include doc files in Extensions transport package (#34176)

4 years agoUse ReadOnlySpan for RSA DefaultExponent
Kevin Jones [Fri, 27 Mar 2020 16:06:53 +0000 (12:06 -0400)]
Use ReadOnlySpan for RSA DefaultExponent

4 years ago[interp] Fix issues around not yet supported System.Runtime.Intrinsics (#34190)
Vlad Brezae [Fri, 27 Mar 2020 15:03:05 +0000 (17:03 +0200)]
[interp] Fix issues around not yet supported System.Runtime.Intrinsics (#34190)

* [interp] Intrinsify IsSupported properties

These were looping forever. Expand ENABLE_NETCORE guard for a few more properties.

* [interp] Don't inline methods that are already being inlined

Fixes stack overflows during inlining of recursive calls.

4 years agoDisable test (#34127)
Jan Jahoda [Fri, 27 Mar 2020 11:47:05 +0000 (12:47 +0100)]
Disable test (#34127)

4 years agoFix a few Process tests to avoid a FileStream assert (#33986)
Stephen Toub [Fri, 27 Mar 2020 11:45:06 +0000 (07:45 -0400)]
Fix a few Process tests to avoid a FileStream assert (#33986)

We have a few tests that:
- Call BeginOutput/ErrorReadLine on a Process
- Don't call WaitForExit()
- Dispose the Process object

That sequence can result in us Dispose'ing of a FileStream while it's currently issuing a Read, and with the right interleaving, can result in FileStream asserting. I've added WaitForExit() calls anywhere we're using Begin*ReadLine.

Two asides:
1. There are a bunch of Process objects in the Process tests that are going undisposed.  We should fix that.
2. It's unsettling that we're Dispose'ing of a FileStream in general while it might still be in use.  This seems like something that should be revisited.

4 years agoImprove PAL initialization diagnostics (#34136)
Jan Vorlicek [Fri, 27 Mar 2020 09:24:04 +0000 (10:24 +0100)]
Improve PAL initialization diagnostics (#34136)

When PAL initialization fails, most often the error code is just a generic
error code that doesn't help in quick diagnosing of the problem.
This change adds extra error codes that can be used to figure out
which part of PAL initialization has failed.

4 years agoUse 16.04 to build the x64-arm crossgen (#34171)
Jarret Shook [Fri, 27 Mar 2020 04:58:50 +0000 (21:58 -0700)]
Use 16.04 to build the x64-arm crossgen (#34171)

* Use 16.04 to build the x64-arm crossgen

* Update docs

4 years agoSpeed up SuperPMI mcs remove dup process (#33946)
Bruce Forstall [Fri, 27 Mar 2020 02:43:44 +0000 (19:43 -0700)]
Speed up SuperPMI mcs remove dup process (#33946)

* Speed up SuperPMI `mcs -removeDup`

Create a "Hash" class that encapsulates the MD5 hashing that is
used to determine if two MCs are equivalent. Primarily, this
allows caching the Windows Crypto provider, which it is very slow
to acquire.

In addition, make some changes to avoid unnecessary memory allocations
and other unnecessary work.

The result is that `mcs -removeDup` is about 4x faster.

Much of the remaining cost is that we read, deserialize the MC,
then reserialize the MC (if unique), and finally destroy the in-memory MC.
There is a lot of memory allocation/deallocation in this process that
could possibly be avoided or improved for this scenario.

* Factor out remove dup code to a separate class

* Add new RemoveDup class

* Add `-dedup` deduplication to `mcs -merge`

Also add `-thin`.

With this,

```
mcs.exe -merge base.mch *.mc -recursive
mcs.exe -removeDup -thin base.mch nodup.mch
```

can be replaced with:

```
mcs.exe -merge -recursive -dedup -thin nodup.mch *.mc
```

The main benefit is avoiding creating a potentially very large base.mch file.
Related, the data being processed only needs to be loaded once.

* Fix Linux build break

* Adjust tools to use new `mcs -merge -dedup -thin` arguments

Adjust superpmi.py script and superpmicollect.cs unit test.

* Update readme documentation for SuperPMI

Add description of `mcs -merge -dedup -thin` arguments and usage.

4 years agorename folder to tests (#34174)
Maryam Ariyan [Fri, 27 Mar 2020 02:42:58 +0000 (19:42 -0700)]
rename folder to tests (#34174)

4 years agoMove some Mono corelib strings to resources/nameof (#34089)
Dan Moseley [Fri, 27 Mar 2020 02:06:25 +0000 (19:06 -0700)]
Move some Mono corelib strings to resources/nameof (#34089)

* Add some nameofs

* Replace some literal strings

* Fix tests

* error

* param update in test

4 years agoMove a few stackallocs out of loops (#34149)
Stephen Toub [Fri, 27 Mar 2020 01:43:12 +0000 (21:43 -0400)]
Move a few stackallocs out of loops (#34149)

4 years ago[ActiveIssue] test flakiness on M.E.Caching.Memory (#34142)
Maryam Ariyan [Fri, 27 Mar 2020 00:24:55 +0000 (17:24 -0700)]
[ActiveIssue] test flakiness on M.E.Caching.Memory (#34142)

* ActiveIssue flakiness on M.E.Caching.Memory

* disable test OvercapacityPurge_AreThreadSafe

4 years agoMore auto-fixing of corelib (primarily mono/netcore) (#34071)
Stephen Toub [Thu, 26 Mar 2020 23:57:17 +0000 (19:57 -0400)]
More auto-fixing of corelib (primarily mono/netcore) (#34071)

* Use explicit type

* Use pattern matching

* Use null propagation

* Simplify default expressions

* Order modifiers

* Simplify null checks

* Make fields readonly

* Delete dead members

* Use switch expressions

* Remove unnecessary usings

* Fix a few issues

4 years agoMove __allocator under PAL_STDCPP_COMPAT (#34141)
Adeel Mujahid [Thu, 26 Mar 2020 23:14:54 +0000 (01:14 +0200)]
Move __allocator under PAL_STDCPP_COMPAT (#34141)

4 years agoClose issues fixed by serializer refactoring (#33819)
Layomi Akinrinade [Thu, 26 Mar 2020 22:53:20 +0000 (18:53 -0400)]
Close issues fixed by serializer refactoring (#33819)

* Close issues fixed by serializer refactoring

* Validate ext test results

* Fix CI issue

* Address review feedback

4 years agoFixing opts.setSupportedISAs to use the computed instructionSetFlags value (#34139)
Tanner Gooding [Thu, 26 Mar 2020 22:13:42 +0000 (15:13 -0700)]
Fixing opts.setSupportedISAs to use the computed instructionSetFlags value (#34139)

4 years agoDisable 64bit variants of instruction sets (#34147)
David Wrighton [Thu, 26 Mar 2020 22:06:26 +0000 (15:06 -0700)]
Disable 64bit variants of instruction sets (#34147)

- EnsureInstructionSetFlagsAreValid was permitting the invalid behavior of something like ArmBase.Arm64.IsSupported to return true when ArmBase.IsSupported reported false.
- Fix by having EnsureInstructionSetFlagsAreValid handle the case

4 years agoAdd JsonIgnoreCondition & per-property ignore logic (#34049)
Layomi Akinrinade [Thu, 26 Mar 2020 20:49:40 +0000 (16:49 -0400)]
Add JsonIgnoreCondition & per-property ignore logic (#34049)

* Add JsonIgnoreCondition & per-property ignore logic

* Address review feedback

4 years agoRevert some changes to managed CorInfoTypes (#34134)
Andy Ayers [Thu, 26 Mar 2020 20:15:05 +0000 (13:15 -0700)]
Revert some changes to managed CorInfoTypes (#34134)

Leftovers from earlier versions of OSR.

4 years agoDisable component governance (#34131)
Jared Parsons [Thu, 26 Mar 2020 20:03:57 +0000 (13:03 -0700)]
Disable component governance (#34131)

Disable component governance in our CI builds. These builds are not
shipping nor are they services hence they don't need governance.

Also these injected tasks emit lots of warning and error noise into our
build timelines. This makes it hard to filter out real issues in the
build.

Example output that these jobs currently add. Note none of these fail
the build but do show up as errors that we have to filter out
```
        error General (NETCORE_ENGINEERING_TELEMETRY=Build) Build failed (exit code '1').
        error General Bash exited with code '1'.
        error General Unable to locate dotnetcore on build agent.
        error General Unable to locate dotnetcore on build agent.
```

4 years ago[debugger] Bump protocol for this commit https://github.com/mono/mono/pull/19248...
monojenkins [Thu, 26 Mar 2020 19:51:52 +0000 (15:51 -0400)]
[debugger] Bump protocol for this commit https://github.com/mono/mono/pull/19248 (#34070)

Bump protocol for this commit https://github.com/mono/mono/pull/19248 as suggested by @vargaz.

Co-authored-by: thaystg <thaystg@users.noreply.github.com>
4 years agoExecute chmod only on Unix environments for host (#34133)
Viktor Hofer [Thu, 26 Mar 2020 19:50:25 +0000 (20:50 +0100)]
Execute chmod only on Unix environments for host (#34133)

Fixes the following error when cross-targeting Unix on a Windows machine:

`C:\git\runtime3\src\libraries\restore\runtime\runtime.depproj(73,5): error MSB3073: The command "chmod +x C:\git\runtime3\artifacts\bin\testhost\netcoreapp5.0-Linux-Debug-x64\dotnet.exe" exited with code 9009.`

4 years agoUnconditionally enable InstructionSet_ArmBase in PAL_GetJitCpuCapabilityFlags in...
Egor Chesakov [Thu, 26 Mar 2020 19:17:00 +0000 (12:17 -0700)]
Unconditionally enable InstructionSet_ArmBase in PAL_GetJitCpuCapabilityFlags in src/coreclr/src/pal/src/misc/jitsupport.cpp (#34107)

4 years agoAdding support for Sse2.StoreScalar for int/uint (#34085)
Tanner Gooding [Thu, 26 Mar 2020 19:09:19 +0000 (12:09 -0700)]
Adding support for Sse2.StoreScalar for int/uint (#34085)

* Adding support for Sse2.StoreScalar for int/uint

* Adding test templates for Sse2.StoreScalar int32/uint32

* Regenerating x86 HWIntrinsic tests

* Fixing the documentation comments for Sse2.LoadScalarVector128 int32/uint32

* Fixing the memory size documented for Sse2.LoadScalarVector128

4 years agoAdding the convenience Avx.Compare* overloads (#34100)
Tanner Gooding [Thu, 26 Mar 2020 19:08:02 +0000 (12:08 -0700)]
Adding the convenience Avx.Compare* overloads (#34100)

* Adding the convenience Avx.Compare* overloads

* Adding test templates for the convenience Avx.Compare* overloads

* Regenerating the x86 hardware intrinsic tests

* Fixing the ordering of Avx.CompareUnordered