platform/upstream/dotnet/runtime.git
4 years agoJIT: rework phase objects so we can use them more widely (#31808)
Andy Ayers [Thu, 6 Feb 2020 02:34:15 +0000 (18:34 -0800)]
JIT: rework phase objects so we can use them more widely (#31808)

Next part of #2109.

Add support for phases that are simply compiler methods or lambdas. These are
not used yet -- the plan is to introduce new phases gradually, cleaning up
redundant checking and dumping along the way. This will happen in subsequent
changes.

Remove a bit of now-redundant post-phase dumping and checking from lower.

Add the active phase to the assertion text, so we have some context.

4 years ago[interp] Make call_vararg non-recursive. (#31722)
monojenkins [Thu, 6 Feb 2020 01:22:07 +0000 (20:22 -0500)]
[interp] Make call_vararg non-recursive. (#31722)

[interp] Remove recursion from call_vararg.

This contributes to https://github.com/mono/mono/issues/18646 but is not enough to fix it.

You also have to fix newobj_fast, but that is apparently a bit difficult.

This is a reduced form of https://github.com/mono/mono/pull/18670, i.e. punting newobj_fast for now.

Co-authored-by: Jay Krell <jay.krell@cornell.edu>
4 years agoUse common CLR_CMAKE_* variables in more places (#31659)
Adeel Mujahid [Thu, 6 Feb 2020 00:50:05 +0000 (02:50 +0200)]
Use common CLR_CMAKE_* variables in more places (#31659)

* Use common CLR_CMAKE_* variables in more places

* Remove obsolete paragraph from README

4 years agoUpdate SkipOnCoreClr in RunContinueWithStressTestsNoState test (#31826)
Santiago Fernandez Madero [Thu, 6 Feb 2020 00:17:28 +0000 (16:17 -0800)]
Update SkipOnCoreClr in RunContinueWithStressTestsNoState test (#31826)

4 years agoFix arm64singlestepper #ifdef (#31776)
Steve MacLean [Thu, 6 Feb 2020 00:07:19 +0000 (19:07 -0500)]
Fix arm64singlestepper #ifdef (#31776)

4 years ago[runtime] Report crash when receiving crashing signals (#2052)
monojenkins [Thu, 6 Feb 2020 00:05:02 +0000 (19:05 -0500)]
[runtime] Report crash when receiving crashing signals (#2052)

The default handlers for SIGTRAP, SIGSYS on macOS and Linux crash the process, so we now have Mono report this.

This change also changes the presentation of the signal name on the stacktrace report dumped on error (from e.g. "SIGSEGV" to "segv").

Co-authored-by: Alexis Christoforides <alexis@thenull.net>
4 years ago[interp] Stack corruption running full AOT interpreter using ValueTuple. (#31790)
monojenkins [Wed, 5 Feb 2020 22:35:05 +0000 (17:35 -0500)]
[interp] Stack corruption running full AOT interpreter using ValueTuple. (#31790)

Calling a method compiled using full AOT from interpreter can lead to stack corruption if signature include a ValueTuple without fields on compilers where MONO_ZERO_LEN_ARRAY is not 0 (msvc, clang). This is due to doing memset on memory allocated using MONO_SIZEOF_GENERIC_INST but
then memset using sizeof (MonoGenericInst). Fix makes sure we allocate and memset the same size of memory since otherwise it will lead to an overwrite of allocated memory when type_argc is 0.

The repro is a little tricky since the called method needs to be in a full AOT assembly and then called from an interpreted assembly:

If this is included in a full AOT:ed assembly.

```
public class StackOverwrite
{
        [MethodImpl(MethodImplOptions.NoInlining)]
        static public ValueTuple trashStack()
        {
            return ValueTuple.Create();
        }
}
```

and this is run under interpreter using --ful-aot-interp:

```
class Program
{
        static int Main(string[] args)
        {
            var test = StackOverwrite.trashStack();
            return 0;
        }
}
```

It will corrupt the stack before applying the fix.

Thanks @buggeststar for bring the issue to our attention and assisting narrow down repro on how to trigger the issues.

Co-authored-by: Johan Lorensson <lateralusx.github@gmail.com>
4 years agoRemove old transport packages from CoreCLR and CoreFX. (#5523)
Jeremy Koritzinsky [Wed, 5 Feb 2020 22:13:40 +0000 (14:13 -0800)]
Remove old transport packages from CoreCLR and CoreFX. (#5523)

* Remove old transport packages from CoreCLR and CoreFX.

* Remove a lot of now unused goo from the coreclr packaging build.

* Remove unused Microsoft.Windows.Compatibility tests.

* Remove unused frameworkPackage.targets

4 years agoMake more Regex loops atomic automatically (#31738)
Stephen Toub [Wed, 5 Feb 2020 22:07:32 +0000 (17:07 -0500)]
Make more Regex loops atomic automatically (#31738)

* Change more Regex loops inside of atomic nodes to be atomic

* Allow Regex loops that end other loops to be made atomic

For example, given an expression like "(abcd*)*e", the inner d* loop will now be converted to be atomic, e.g. "(abc(?>d*))*e)".  We're careful not to convert an expression like "(abca*)*e)", where the inner loop has no overlap with what comes immediately after the loop but does with the start of the loop.

I also fixed what appears to be a long-standing bug in how character classes are canonicalized.  An attempt was made to avoid running the canonlicalization routine, but we almost always need to do it, and we were not doing it in some cases, resulting in character classes that were correct but not as optimized as they should have been, e.g. two abutting ranges when one would suffice, leading to poorer code gen.  It's part of this PR because I caught when changing the reduction tests to validate the full code tree including strings rather than just the codes list.

* Address PR feedback

And add more comments, more code coverage, more runtime asserts, etc.

I also noticed we weren't reducing Setloopatomic and Setlazy into {Not}oneloopatomic and [Not}onelazy, so I fixed that.

And I changed ReduceAtomic to actually remove unnecessary intermediate atomic nodes.

4 years agoTweak Regex compiled code and add more tests (#31730)
Stephen Toub [Wed, 5 Feb 2020 22:00:37 +0000 (17:00 -0500)]
Tweak Regex compiled code and add more tests (#31730)

* Fix override visibility on generated Regex.CompileToAssembly assembly

* Add some tests based on AT&T's regex test suite

4 years agoFix host compiler when cross OS DAC compiling (#31775)
Steve MacLean [Wed, 5 Feb 2020 21:58:18 +0000 (16:58 -0500)]
Fix host compiler when cross OS DAC compiling (#31775)

* Fix duplicate type definition MINIDUMP_TYPE

The Windows headers define MINIDUMP_TYPE. Do not define when using a
Windows HOST.

* Define DLLEXPORT macro as empty on Windows hosts

* Prefer HOST_WINDOWS to !HOST_UNIX

4 years ago[Arm64] Implement simple SIMD operations (#1601)
Egor Chesakov [Wed, 5 Feb 2020 21:35:48 +0000 (13:35 -0800)]
[Arm64] Implement simple SIMD operations (#1601)

* Update "And" in AdvSimd.cs AdvSimd.PlatformNotSupported.cs

* Update "AndNot" in AdvSimd.cs AdvSimd.PlatformNotSupported.cs

* Rename "AndNot" to "BitwiseClear" in AdvSimd.cs AdvSimd.PlatformNotSupported.cs

* Add "Divide" and "DivideScalar" in AdvSimd.cs AdvSimd.PlatformNotSupported.cs

* Add "Max" and "MaxScalar" in AdvSimd.cs AdvSimd.PlatformNotSupported.cs

* Add "Min" and "MinScalar" in AdvSimd.cs AdvSimd.PlatformNotSupported.cs

* Add "Multiply" and "MultiplyScalar" in AdvSimd.cs AdvSimd.PlatformNotSupported.cs

* Add "Negate" and "NegateScalar" in AdvSimd.cs AdvSimd.PlatformNotSupported.cs

* Update "Not" in AdvSimd.cs AdvSimd.PlatformNotSupported.cs

* Update "Or" in AdvSimd.cs AdvSimd.PlatformNotSupported.cs

* Update "OrNot" in AdvSimd.cs AdvSimd.PlatformNotSupported.cs

* Update "Sqrt" and "SqrtScalar" in AdvSimd.cs AdvSimd.PlatformNotSupported.cs

* Update "Subtract" and "SubtractScalar" in AdvSimd.cs AdvSimd.PlatformNotSupported.cs

* Update "Xor" in AdvSimd.cs AdvSimd.PlatformNotSupported.cs

* Update System.Runtime.Intrinsics.Experimental.cs

* Add "And" in AdvSimd in hwintrinsiclistarm64.h

* Add "AndNot" in AdvSimd in hwintrinsiclistarm64.h

* Add "DivideScalar" in AdvSimd in hwintrinsiclistarm64.h

* Add "Divide" in AdvSimd_Arm64 in hwintrinsiclistarm64.h

* Add "Max" and "MaxScalar" in hwintrinsiclistarm64.h

* Add "Min" and "MinScalar" in hwintrinsiclistarm64.h

* Add "Multiply" and "MultiplyScalar" in hwintrinsiclistarm64.h

* Add "Negate" and "NegateScalar" in hwintrinsiclistarm64.h

* Add "Not" in AdvSimd in hwintrinsiclistarm64.h

* Add "Or" in AdvSimd in hwintrinsiclistarm64.h

* Add "OrNot" in AdvSimd in hwintrinsiclistarm64.h

* Add "Sqrt" and "SqrtScalar" in hwintrinsiclistarm64.h

* Add "Subtract" and "SubtractScalar" in hwintrinsiclistarm64.h

* Add "Xor" in AdvSimd in hwintrinsiclistarm64.h

* Add "And" in GenerateTests.csx

* Add "BitwiseClear" in GenerateTests.csx

* Add "Divide" and "DivideScalar" in GenerateTests.csx

* Add "Max" and "MaxScalar" in GenerateTests.csx

* Add "Min" and "MinScalar" in GenerateTests.csx

* Add "Multiply" and "MultiplyScalar" in GenerateTests.csx

* Add "Negate" and "NegateScalar" in GenerateTests.csx

* Add "Not" in GenerateTests.csx

* Add "Or" in GenerateTests.csx

* Add "OrNot" in GenerateTests.csx

* Add "Sqrt" and "SqrtScalar" in GenerateTests.csx

* Add "Subtract" and "SubtractScalar" in GenerateTests.csx

* Add "Xor" in GenerateTests.csx

* Update "ReverseElementBits" in GenerateTests.csx

* Update Helpers.cs Helpers.tt

* Update AdvSimd/ AdvSimd.Arm64/

4 years ago[mono] Add mono_crash to the gitignore (#31815)
Ryan Lucia [Wed, 5 Feb 2020 21:29:19 +0000 (16:29 -0500)]
[mono] Add mono_crash to the gitignore (#31815)

4 years agoUse better names for Regex DynamicMethods to help when profiling (#31817)
Stephen Toub [Wed, 5 Feb 2020 21:28:52 +0000 (16:28 -0500)]
Use better names for Regex DynamicMethods to help when profiling (#31817)

Currently, names in the profiler just show up as "FindFirstChar37" or "Go21", and it's difficult to know with which regex it's associated.

4 years agoAdd cross OS support for MAKEDLLNAME (#31746)
Steve MacLean [Wed, 5 Feb 2020 20:15:01 +0000 (15:15 -0500)]
Add cross OS support for MAKEDLLNAME (#31746)

* Add MAKE_TARGET_DLLNAME

* Add  TARGET_MAIN_CLR_DLL_NAME_[WA]

* Use TARGET_MAIN_CLR_DLL_NAME_[AW] for DAC

* Remove MSCOREE_SHIM_[WA]

4 years agoMake Crossgen2 a self-contained package (#31741)
Fadi Hanna [Wed, 5 Feb 2020 19:44:43 +0000 (14:44 -0500)]
Make Crossgen2 a self-contained package (#31741)

* Make Crossgen2 a self-contained package

* Deleting the crossgen2 packaging project from the coreclr sub-repo

The packaging project for the package we ship is under the installer sub-repo

4 years agoallocate SocketAsyncEngine less frequenty to reduce the number of epoll_wait threads...
Adam Sitnik [Wed, 5 Feb 2020 19:38:36 +0000 (20:38 +0100)]
allocate SocketAsyncEngine less frequenty to reduce the number of epoll_wait threads (#2346)

4 years agoFix a consistency issue with command line parsing of file names (use FileInfo instead...
Fadi Hanna [Wed, 5 Feb 2020 19:16:09 +0000 (14:16 -0500)]
Fix a consistency issue with command line parsing of file names (use FileInfo instead of string) (#2033)

* Fix a consistency issue with command line parsing of file names (use FileInfo instead of string)

4 years agoRemoving unnecessary uses of `unreached` from hwintrinsic importation (#2298)
Tanner Gooding [Wed, 5 Feb 2020 18:53:22 +0000 (10:53 -0800)]
Removing unnecessary uses of `unreached` from hwintrinsic importation (#2298)

4 years agoDelete System.Data.SqlClient package (#2275)
Jan Kotas [Wed, 5 Feb 2020 18:51:03 +0000 (10:51 -0800)]
Delete System.Data.SqlClient package (#2275)

* Delete System.Data.SqlClient package

* Delete unnecessary SqlClient references

* Unify System.Data.SqlClient package reference

* Add System.Data facade test

* Add System.Data.SqlClient references
- Add System.Data.SqlClient package references for tests that need it
- Use System.Data.SqlClient reference assembly to build the System.Data shim
- Disable ILLinker for the shims since it does not work well with incremental builds and it is not necessary anyway

* Disable tests on Mono

Fixes https://github.com/dotnet/corefx/issues/40846

4 years agoRevert "Update ILLinkTasksVersion dependency (#2334)" (#31807)
Viktor Hofer [Wed, 5 Feb 2020 18:19:16 +0000 (19:19 +0100)]
Revert "Update ILLinkTasksVersion dependency (#2334)" (#31807)

This reverts commit a05c599e0c9ba113902ba59746e041f1513cc339.

4 years agoUpdate delegate return value to nullable (#31781)
buyaa-n [Wed, 5 Feb 2020 18:08:28 +0000 (10:08 -0800)]
Update delegate return value to nullable (#31781)

4 years agoDisable linux unwinder on Windows (#31777)
Steve MacLean [Wed, 5 Feb 2020 18:05:38 +0000 (13:05 -0500)]
Disable linux unwinder on Windows (#31777)

4 years agoAdd EMPTY_BASES_DECL (#26980)
Steve MacLean [Wed, 5 Feb 2020 18:04:40 +0000 (13:04 -0500)]
Add EMPTY_BASES_DECL (#26980)

* Add EMPTY_BASES_DECL

Add EMPTY_BASES_DECL to use MSVC __declspec(empty_bases).
This declaration tells MSVC to collapse empty base classes to
consume no space, as opposed to its default layout algoritihm
which requires base classes to consume at least one byte (in
multiple inheritance situations).

Mark a few classes which can contain empy base classes and may cause
layout differences between Windows and Clang

* Fix MapSHash deserialization

4 years agoAdd config knob to the gc to control its concept of what total physical memory is...
David Wrighton [Wed, 5 Feb 2020 17:57:16 +0000 (09:57 -0800)]
Add config knob to the gc to control its concept of what total physical memory is (#31767)

- The GC relies on the VM to compute this number normally, but the runtime uses heuristics which may be undesirable for the customer scenario (especially inside of a Windows Job object)
- This knob provides a way for the customer to override the heuristics

4 years agoAccount for UpperVector saves in minRegs (#31773)
Carol Eidt [Wed, 5 Feb 2020 16:00:02 +0000 (08:00 -0800)]
Account for UpperVector saves in minRegs (#31773)

When we use a jitStressRegs mode that limits the number of registers, we need to account for the UpperVectorSave.

Fix #31727

4 years ago[master] Update dependencies from dotnet/arcade Microsoft/vstest (#19613)
dotnet-maestro[bot] [Wed, 5 Feb 2020 15:29:57 +0000 (16:29 +0100)]
[master] Update dependencies from dotnet/arcade Microsoft/vstest (#19613)

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

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

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

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

* Update dependencies from https://github.com/microsoft/vstest build 20200131-02

- Microsoft.NET.Test.Sdk - 16.5.0-preview-20200131-02

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

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

* Rename RuntimeStressTestModes

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

- Microsoft.NET.Test.Sdk - 16.5.0-preview-20200203-01

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

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

* Update SkipOnCoreClrAttributes to new parameters

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

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

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

- Microsoft.NET.Test.Sdk - 16.5.0

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
Co-authored-by: Santiago Fernandez Madero <safern@microsoft.com>
4 years agoChange RegexCompiler to special-case sets of just 2 or 3 chars (#31734)
Stephen Toub [Wed, 5 Feb 2020 14:46:14 +0000 (09:46 -0500)]
Change RegexCompiler to special-case sets of just 2 or 3 chars (#31734)

* Change RegexCompiler to special-case sets of just 2 or 3 chars

* Apply suggestions from code review

Co-Authored-By: Dan Moseley <danmose@microsoft.com>
Co-authored-by: Dan Moseley <danmose@microsoft.com>
4 years agoDisable RunContinueWithStressTestsNoState test on checked coreclr (#31789)
Santiago Fernandez Madero [Wed, 5 Feb 2020 13:26:39 +0000 (05:26 -0800)]
Disable RunContinueWithStressTestsNoState test on checked coreclr (#31789)

4 years agoAvoid keeping runtext alive in Regex cache (#31736)
Stephen Toub [Wed, 5 Feb 2020 13:24:05 +0000 (08:24 -0500)]
Avoid keeping runtext alive in Regex cache (#31736)

Null out any references to the string in case the Regex object is kept alive in a cache and the string object is very large.

4 years agoUse HashCode.Combine directly (#31784)
Jan Kotas [Wed, 5 Feb 2020 13:17:10 +0000 (05:17 -0800)]
Use HashCode.Combine directly (#31784)

4 years agoReduce the number of platforms that run JIT stress pipelines (#31750)
Bruce Forstall [Wed, 5 Feb 2020 05:51:51 +0000 (21:51 -0800)]
Reduce the number of platforms that run JIT stress pipelines (#31750)

* Reduce the number of platforms that run JIT stress pipelines

The current set of platforms is overkill for JIT stress purposes.
This should reduce resource consumption and improve reliability.

Fixes #2100

4 years agoAdd JSON and other area CODEOWNERS (#31772)
Ahson Khan [Wed, 5 Feb 2020 05:33:42 +0000 (21:33 -0800)]
Add JSON and other area CODEOWNERS (#31772)

* Add JSON and other area CODEOWNERS

* Update json owners.

4 years ago[jit] Avoid calling mono_aot_direct_icalls_enabled_for_method () in non-aot mode...
monojenkins [Wed, 5 Feb 2020 05:00:15 +0000 (00:00 -0500)]
[jit] Avoid calling mono_aot_direct_icalls_enabled_for_method () in non-aot mode, it might be a stub if aot is disabled. (#31754)

Co-authored-by: Zoltan Varga <vargaz@gmail.com>
4 years agoFix intermittent crash in comhost tests (#31762)
Elinor Fung [Wed, 5 Feb 2020 04:26:22 +0000 (20:26 -0800)]
Fix intermittent crash in comhost tests (#31762)

4 years agoSeal CompareInfo and TextInfo (#31761)
Levi Broderick [Wed, 5 Feb 2020 02:15:35 +0000 (18:15 -0800)]
Seal CompareInfo and TextInfo (#31761)

4 years agoMinor improvements to Regex.Replace overhead (#31731)
Stephen Toub [Wed, 5 Feb 2020 01:50:56 +0000 (20:50 -0500)]
Minor improvements to Regex.Replace overhead (#31731)

* Avoid some SegmentBuilder overhead with empty Regex.Replace replacements

* Slightly reduce Regex.Replace overhead

4 years agoReduce PAL DAC exports (#31749)
Steve MacLean [Wed, 5 Feb 2020 00:57:32 +0000 (19:57 -0500)]
Reduce PAL DAC exports (#31749)

4 years agoFix check.* cross compilation linker errors (#31751)
Steve MacLean [Wed, 5 Feb 2020 00:55:30 +0000 (19:55 -0500)]
Fix check.* cross compilation linker errors (#31751)

4 years agoRemove GetRecycleMemoryInfo from DAC builds (#31748)
Steve MacLean [Wed, 5 Feb 2020 00:55:09 +0000 (19:55 -0500)]
Remove GetRecycleMemoryInfo from DAC builds (#31748)

4 years agoManaged Renames for consistency (#28819)
Steve MacLean [Wed, 5 Feb 2020 00:54:29 +0000 (19:54 -0500)]
Managed Renames for consistency (#28819)

* Managed Renames for consistency

Rename managed conditional compilation macros to match CoreCLR native concepts

    BIT64                   -> TARGET_64BIT
    BIT32                   -> TARGET_32BIT
    FEATURE_PAL             -> TARGET_UNIX
    PLATFORM_UNIX           -> TARGET_UNIX
    PLATFORM_WINDOWS        -> TARGET_WINDOWS
    PLATFORM_OSX            -> TARGET_OSX

Remove obsolete logic and obsolete defines: FeaturePal

* Simplify !TARGET_* to equivalent TARGET_*

* Remove stale SILVERLIGHT managed code

* Review feedback other

* Fix mono build break

* Fix System.Drawing.Imaging.ImageFormat.FindEncoding

* Add PAL Bridge comment

* Move FeatureCoreCLR per freedback

4 years agoDon't block specific generic types in field marshalling scenar… (#31679)
Jeremy Koritzinsky [Wed, 5 Feb 2020 00:10:30 +0000 (16:10 -0800)]
Don't block specific generic types in field marshalling scenar… (#31679)

Don't block specific generic types in field marshalling scenarios.

4 years agoMerge pull request #31759 from DrewScoggins/RealArchFixup
Drew Scoggins [Tue, 4 Feb 2020 23:30:41 +0000 (15:30 -0800)]
Merge pull request #31759 from DrewScoggins/RealArchFixup

Set default arch to match arcade and pass arch to ci_setup

4 years agoFix unused variable warning (#31747)
Steve MacLean [Tue, 4 Feb 2020 23:25:48 +0000 (18:25 -0500)]
Fix unused variable warning (#31747)

4 years agoRemove duplicate architecture argument
Drew Scoggins [Tue, 4 Feb 2020 23:20:52 +0000 (15:20 -0800)]
Remove duplicate architecture argument

4 years agoSet default arch to match arcade and pass arch to ci_setup
Drew Scoggins [Tue, 4 Feb 2020 23:03:07 +0000 (15:03 -0800)]
Set default arch to match arcade and pass arch to ci_setup

4 years agoUse PTRACE_GETREGSET for any arch in createdump (#22388)
Swift Kim [Tue, 4 Feb 2020 23:04:33 +0000 (08:04 +0900)]
Use PTRACE_GETREGSET for any arch in createdump (#22388)

Also ignore PTRACE_GETREGSET (NT_FPREGSET) failures for arm processes on
aarch64 kernels.

4 years agoDisable ThrowStatementDoesNotResetExceptionStackLineOtherMethod in arm64 (#31735)
Santiago Fernandez Madero [Tue, 4 Feb 2020 22:46:23 +0000 (14:46 -0800)]
Disable ThrowStatementDoesNotResetExceptionStackLineOtherMethod in arm64 (#31735)

4 years ago[mini] iltests.exe depends on TestDriver.dll (#3857)
monojenkins [Tue, 4 Feb 2020 22:28:41 +0000 (17:28 -0500)]
[mini] iltests.exe depends on TestDriver.dll (#3857)

Co-authored-by: Bernhard Urban-Forster <bernhard.urban@xamarin.com>
4 years agoUpdated composite R2R format doc (#2221)
Tomáš Rylek [Tue, 4 Feb 2020 21:38:32 +0000 (22:38 +0100)]
Updated composite R2R format doc (#2221)

I have resurrected my preliminary composite R2R format doc,
I rebased it to include some recent changes. For the process
itself, I assume I should first implement the self-contained
composite R2R format with standalone MSIL metadata as that's
the simplest scenario. After that I'll follow up w.r.t.
shared framework compilation and other scenarios (embedded MSIL,
single exe).

Thanks

Tomas

4 years agoFix logic to disable mscordbi build (#31745)
Steve MacLean [Tue, 4 Feb 2020 21:34:41 +0000 (16:34 -0500)]
Fix logic to disable mscordbi build (#31745)

4 years agoReuse positive offset blocks in Regex Boyer-Moore (#31733)
Stephen Toub [Tue, 4 Feb 2020 21:33:33 +0000 (16:33 -0500)]
Reuse positive offset blocks in Regex Boyer-Moore (#31733)

* Remove unnecessary local in compiled Regex Boyer-Moore

* Reuse positive offset blocks in Regex Boyer-Moore

* Update src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCompiler.cs

4 years agoDeadEnding Microsoft.CSharp and Bumping Version for System.Runtime.CompilerServices...
Anirudh Agnihotry [Tue, 4 Feb 2020 20:42:07 +0000 (12:42 -0800)]
DeadEnding Microsoft.CSharp and Bumping Version for System.Runtime.CompilerServices.Unsafe (#2354)

* Dead Ending Microsoft.CSharp Package and Bumping the leftout assembly versions to 5.0.0.0 (#2264)

* deadending Microsoft.Csharp Package and bumping the assembly versions

* retargeting and clean up

* Update Microsoft.CSharp.csproj

* fixing the build

* reference -> projectreference

* adding ignored reference

* removing package references and making R2rDump bin place to a specifc output directory

* remove package reference from R2r dump as well

* adding comment and targeting netstandard2.0

* adding back package references for netstandard lib build

* adding back baseline version for consistency

4 years agoFix The Resource File Name Change (#31723)
Tarek Mahmoud Sayed [Tue, 4 Feb 2020 20:11:36 +0000 (12:11 -0800)]
Fix The Resource File Name Change (#31723)

4 years ago[interp]Factor out common code. (#31653)
monojenkins [Tue, 4 Feb 2020 18:53:44 +0000 (13:53 -0500)]
[interp]Factor out common code. (#31653)

Co-authored-by: Jay Krell <jay.krell@cornell.edu>
4 years agoMerge pull request #31728 from DrewScoggins/ArchFixup
Drew Scoggins [Tue, 4 Feb 2020 18:45:59 +0000 (10:45 -0800)]
Merge pull request #31728 from DrewScoggins/ArchFixup

Fix the way we pass the arch to the setup script

4 years agoRemove unneeded type SecureStringHasher (#31707)
Levi Broderick [Tue, 4 Feb 2020 18:43:20 +0000 (10:43 -0800)]
Remove unneeded type SecureStringHasher (#31707)

string.GetHashCode is already randomized on .NET Core, no need for a custom hashing routine

4 years agoFix the way we pass the arch to the setup script
Drew Scoggins [Tue, 4 Feb 2020 18:35:36 +0000 (10:35 -0800)]
Fix the way we pass the arch to the setup script

4 years agoMerge pull request #2393 from EgorBo/fix-mono-sample
Egor Bogatov [Tue, 4 Feb 2020 17:52:00 +0000 (20:52 +0300)]
Merge pull request #2393 from EgorBo/fix-mono-sample

Add RunSample target to mono.proj

4 years agoOptimize `box + isinst + unbox.any` as `nop` (#1817)
Egor Bogatov [Tue, 4 Feb 2020 16:52:57 +0000 (19:52 +0300)]
Optimize `box + isinst + unbox.any` as `nop` (#1817)

Extend box pattern match to cover `box + isinst + unbox.any` .

4 years agoBump version to 6.13 (#31715)
monojenkins [Tue, 4 Feb 2020 16:42:34 +0000 (11:42 -0500)]
Bump version to 6.13 (#31715)

Co-authored-by: Jo Shields <directhex@apebox.org>
4 years agoLibraries code should not mutate string instances (#31700)
Levi Broderick [Tue, 4 Feb 2020 16:14:45 +0000 (08:14 -0800)]
Libraries code should not mutate string instances (#31700)

4 years agoUpdate src/mono/mono.proj
Egor Bogatov [Tue, 4 Feb 2020 15:06:20 +0000 (18:06 +0300)]
Update src/mono/mono.proj

Co-Authored-By: Alexander Köplinger <alex.koeplinger@outlook.com>
4 years agoUpdate src/mono/mono.proj
Egor Bogatov [Tue, 4 Feb 2020 15:06:10 +0000 (18:06 +0300)]
Update src/mono/mono.proj

Co-Authored-By: Alexander Köplinger <alex.koeplinger@outlook.com>
4 years agoRemove AppDomain usage from stack walk and related places (#31708)
Jan Vorlicek [Tue, 4 Feb 2020 15:03:47 +0000 (16:03 +0100)]
Remove AppDomain usage from stack walk and related places (#31708)

This is yet another cleanup removal of the AppDomain.

4 years agoAddress feedback
EgorBo [Tue, 4 Feb 2020 14:59:03 +0000 (17:59 +0300)]
Address feedback

4 years ago[interp] Remove goto for code_type unknown | interp | compiled. (#31667)
monojenkins [Tue, 4 Feb 2020 14:40:20 +0000 (09:40 -0500)]
[interp] Remove goto for code_type unknown | interp | compiled. (#31667)

[interp] Remove goto for code_type unknown | interp | compiled.

The goto kinda implies a loop, but it is really just handling one case
before the other, but the source misorders the checks, perhaps for perf,
which maybe, can be done equivalently with G_UNLIKELY, and also remove
some possible extra memory reads.

Co-authored-by: Jay Krell <jay.krell@cornell.edu>
4 years agoImplement Socket.DuplicateAndClose() for Windows (#1858)
Anton Firszov [Tue, 4 Feb 2020 13:18:19 +0000 (14:18 +0100)]
Implement Socket.DuplicateAndClose() for Windows (#1858)

* reimplement socket duplication, fix #1760

* additional cleanup

* ungroup PNSE tests, no RemoteExecutor timeout

* address review findings

* fix path for Interop.WSADuplicateSocket.cs

* remove swallowing in Socket(SocketInformation)

* review suggestions

* make sure duplicate socket is not inheritable

* remove debug code leftover

* harden SocketPal.CreateSocket()

* blittable WSAPROTOCOL_INFOW

* additional naming fixes,

default System.Net.Sockets.sln configurations to Windows_NT again

* disposal on errors, improve comments, more tests

* nits

* handle GetSockName() error

4 years agoUpdate ILLinkTasksVersion dependency (#2334)
Marek Safar [Tue, 4 Feb 2020 13:01:52 +0000 (14:01 +0100)]
Update ILLinkTasksVersion dependency (#2334)

4 years agoClean up
EgorBo [Tue, 4 Feb 2020 12:07:07 +0000 (15:07 +0300)]
Clean up

4 years agoWhen the interpreter does recurse, use a different function (#31635)
monojenkins [Tue, 4 Feb 2020 12:02:42 +0000 (07:02 -0500)]
When the interpreter does recurse, use a different function (#31635)

for each call site, so you can tell from a WebAssembly stack
which case it is. i.e. with function names but no line numbers.

With this, we can see that call_varargs contributes to the problem
here: https://github.com/mono/mono/issues/18646

Also, do not inline the interpreter, it probably/hopefully never was.

Co-authored-by: Jay Krell <jay.krell@cornell.edu>
4 years agoDon't require Checked config for coreclr tests
EgorBo [Tue, 4 Feb 2020 11:59:44 +0000 (14:59 +0300)]
Don't require Checked config for coreclr tests

4 years ago[runtime] Fix the --enable-minimal=aot build. (#31684)
Zoltan Varga [Tue, 4 Feb 2020 08:51:32 +0000 (03:51 -0500)]
[runtime] Fix the --enable-minimal=aot build. (#31684)

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

4 years agoRemove remaining libraries references to string.Copy (#31706)
Levi Broderick [Tue, 4 Feb 2020 08:22:44 +0000 (00:22 -0800)]
Remove remaining libraries references to string.Copy (#31706)

4 years agoRevert "Revert "Optimize typeof(T1).IsAssignableFrom(typeof(T2))" (#31643)" (#31705)
Jan Kotas [Tue, 4 Feb 2020 08:08:50 +0000 (00:08 -0800)]
Revert "Revert "Optimize typeof(T1).IsAssignableFrom(typeof(T2))" (#31643)" (#31705)

This reverts commit 729276d30fbafdc28cd9813f74c0bb49702d775c.

4 years agoMerge pull request #31699 from AndyAyersMS/Fix31665
Andy Ayers [Tue, 4 Feb 2020 07:45:48 +0000 (23:45 -0800)]
Merge pull request #31699 from AndyAyersMS/Fix31665

JIT: remove assert from postorder return value optimizations

4 years agoRemove unused locals in System.ServiceProcess.ServiceController (#31704)
Next Turn [Tue, 4 Feb 2020 07:24:17 +0000 (15:24 +0800)]
Remove unused locals in System.ServiceProcess.ServiceController (#31704)

* Remove unused locals in System.ServiceProcess.ServiceController

* Inline status variable

* Apply suggestions from code review

Co-Authored-By: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
4 years ago[interp]Fix the type of clause_args. (#31651)
monojenkins [Tue, 4 Feb 2020 06:26:50 +0000 (01:26 -0500)]
[interp]Fix the type of clause_args. (#31651)

Co-authored-by: Jay Krell <jay.krell@cornell.edu>
4 years agoFix logic in compareTypesForCast (#31681)
Andy Ayers [Tue, 4 Feb 2020 05:30:56 +0000 (21:30 -0800)]
Fix logic in compareTypesForCast (#31681)

We weren't careful enough with `__Canon` in some cases, which lead to unsafely
returning `MustNot` when the cast outcome was not determined at jit time.

Add an extra check, update comments, and add some test cases.

Addresses the failures seen in #1195 (which was reverted).

4 years agoFix issue 1871 exception test failing (#31696)
Mike McLaughlin [Tue, 4 Feb 2020 05:04:27 +0000 (21:04 -0800)]
Fix issue 1871 exception test failing (#31696)

Don't adjust the offset by 1 instead of the architecture instruction size (STACKWALK_CONTROLPC_ADJUST_OFFSET).

4 years agoAllow null IV for Create{Encryptor,Decryptor}.
Kevin Jones [Tue, 4 Feb 2020 04:03:21 +0000 (23:03 -0500)]
Allow null IV for Create{Encryptor,Decryptor}.

The IV is permitted to be null for most ciphers when in ECB
mode.

4 years agoAdd missing nullability annotation to string ctor (#31702)
Levi Broderick [Tue, 4 Feb 2020 03:19:14 +0000 (19:19 -0800)]
Add missing nullability annotation to string ctor (#31702)

4 years agoset THUMB_CODE bit (#21180)
Yaroslav Yamshchikov [Tue, 4 Feb 2020 02:46:54 +0000 (05:46 +0300)]
set THUMB_CODE bit (#21180)

4 years ago[aot] Avoid inflating gparams with byreflike types during generic sharing. (#31670)
Zoltan Varga [Tue, 4 Feb 2020 02:35:04 +0000 (21:35 -0500)]
[aot] Avoid inflating gparams with byreflike types during generic sharing. (#31670)

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

4 years ago[Arm64] Update execution characteristics for crc32b, crc32h, facge, facgt (#8500)
Egor Chesakov [Tue, 4 Feb 2020 01:47:14 +0000 (17:47 -0800)]
[Arm64] Update execution characteristics for crc32b, crc32h, facge, facgt (#8500)

* Add execution characteristics for Crc32 instructions in emitarm64.cpp

* Update execution characteristics for DV_3B instructions in emitarm64.cpp

* Add execution characteristics for DV_3D instructions in emitarm64.cpp

* Update comment in emitIns_R_R_R in emitarm64.cpp

4 years agoSave stack arguments size in InlinedCallFrame.m_Datum on x86 to handle callee's poppi...
Fadi Hanna [Tue, 4 Feb 2020 01:09:30 +0000 (20:09 -0500)]
Save stack arguments size in InlinedCallFrame.m_Datum on x86 to handle callee's popping of arguments (#26834)

* Save stack arguments size in InlinedCallFrame.m_Datum on x86 to handle callee's popping of arguments

* Move stack arguments sizes logic to Windows-only

4 years agoFix package testing run name prefix (#31690)
Santiago Fernandez Madero [Tue, 4 Feb 2020 00:44:33 +0000 (16:44 -0800)]
Fix package testing run name prefix (#31690)

4 years agoJIT: remove assert from postorder return value optimizations
Andy Ayers [Tue, 4 Feb 2020 00:34:34 +0000 (16:34 -0800)]
JIT: remove assert from postorder return value optimizations

We were trying to assert that we weren't losing side effects when folding
return value trees. But this seems to be more trouble than it is worth as
the set of side effects can also change.

Also re-enable the disabled tests, and make one of them Pri0.

Fixes #31665.

4 years agoDisable two JIT tests failing with known issue tracked under #31665 (#31674)
Tomáš Rylek [Tue, 4 Feb 2020 00:19:59 +0000 (01:19 +0100)]
Disable two JIT tests failing with known issue tracked under #31665 (#31674)

* Disable two JIT tests failing with known issue tracked under #31665

* Address Andy's PR feedback - make the exclusion clauses global

4 years agoDelete unnecessary netstandard builds (#31641)
Jan Kotas [Tue, 4 Feb 2020 00:14:05 +0000 (16:14 -0800)]
Delete unnecessary netstandard builds (#31641)

* Delete unnecessary netstandard builds and NuGet packages of inbox components

- Delete netstandard builds and NuGet packages for System.Reflection.Emit.*
- Delete netstandard builds and NuGet packages for System.Reflection.TypeExtensions
- Delete netstandard build for System.Buffers\ref
- Delete clrcompression UAP  build support

Contributes to #2138

* Remove packages from the baseline

4 years agoMerge pull request #31694 from DrewScoggins/anscoggi/FixArch
Drew Scoggins [Tue, 4 Feb 2020 00:08:52 +0000 (16:08 -0800)]
Merge pull request #31694 from DrewScoggins/anscoggi/FixArch

* Update Arch and add RunKind variable

* Fix up Linux script as well

4 years agoFix up Linux script as well
Drew Scoggins [Mon, 3 Feb 2020 23:58:12 +0000 (15:58 -0800)]
Fix up Linux script as well

4 years agoAdd Single and Double overloads to BinaryPrimitives (#6864)
Eric Erhardt [Mon, 3 Feb 2020 23:48:01 +0000 (17:48 -0600)]
Add Single and Double overloads to BinaryPrimitives (#6864)

* Add Single and Double overloads to BinaryPrimitives

Fix #2365

4 years agoRemove popped trees more aggressively. (#31677)
Eugene Rozenfeld [Mon, 3 Feb 2020 23:40:18 +0000 (15:40 -0800)]
Remove popped trees more aggressively. (#31677)

When processing CEE_POP the importer sometimes created trees
like
ASG(tmp1, expr)
followed by
COMMA(ADDR(tmp1), NOP))
and that was causing some CQ issues.

LocalAddressVisitor was then marking tmp1 as address-exposed
and we never get rid of the dead ASG(tmp1, expr). What's worse, we
then were adding a zero-initialization for tmp1 in the prolog.

The fix here is to create a NOP instead of a COMMA is there are
no side-effects in the first operand of the COMMA.

This addresses the first example in #2325.

4 years agoUpdate Arch and add RunKind variable
Drew Scoggins [Mon, 3 Feb 2020 23:39:42 +0000 (15:39 -0800)]
Update Arch and add RunKind variable

4 years agoMerge branch 'master' of https://www.github.com/dotnet/runtime
Drew Scoggins [Mon, 3 Feb 2020 23:38:14 +0000 (15:38 -0800)]
Merge branch 'master' of https://github.com/dotnet/runtime

4 years agoInitial Crossgen2 fixes for composite R2R support (#31652)
Tomáš Rylek [Mon, 3 Feb 2020 23:19:21 +0000 (00:19 +0100)]
Initial Crossgen2 fixes for composite R2R support (#31652)

With initial local changes to enable composite R2R I have finally
been able to compile a CoreCLR unit test in this mode. It doesn't
yet work at runtime, these changes just fix initial compiler issues
I hit during the build:

1) Delegate constructor signature was missing some comparison logic
that ended up asserting in the node comparer in the composite
build.

2) I have removed two seeminly superfluous parameters to
CreateMethodEntrypointNodeHelper.

3) I have removed an assertion related to multi-file RVA fields
that I believe to be no longer relevant after the refactorings
to copy the RVA fields around properly.

Thanks

Tomas

4 years agoLink System.Globalization.Native into coreclr (#6928)
Santiago Fernandez Madero [Mon, 3 Feb 2020 21:53:39 +0000 (13:53 -0800)]
Link System.Globalization.Native into coreclr (#6928)

* Link System.Globalization.Native into coreclr

* Add more paths to coreclr subset filters

* Fix linux build

* PR Feedback

* PR Feedback 2

* Fix build (pass -DREPO_ROOT_DIR only on coreclr atm), System.IO.Ports.Native needs to be built first

* Remove version header file from static libs

* Remove CORECLR_BUILD variable definition

4 years agohandle GetSockName() error
Anton Firszov [Mon, 3 Feb 2020 21:08:59 +0000 (22:08 +0100)]
handle GetSockName() error

4 years ago[mini] Add method-triggered printing for runtime stats (#2355)
monojenkins [Mon, 3 Feb 2020 21:05:51 +0000 (16:05 -0500)]
[mini] Add method-triggered printing for runtime stats (#2355)

This work extends the `--stats` command to take in an optional method name. When a matching method is compiled or transformed, the stats will be printed out at that point in addition to after program execution. This is useful for products looking to measure startup time and activity, as well as for ourselves to track any loader performance regressions.

Once this lands, we should see about running it on a cadence, ideally on both desktop and Android. Additionally, more work needs to be done to the counters to expose them in a way more friendly to consumption on Android/wasm (including a callback). We should also update the website to document this additional behavior.

Co-authored-by: Ryan Lucia <ryan@luciaonline.net>
Co-authored-by: Kyle Markland <v-kymark@microsoft.com>
Co-authored-by: Rene Garcia <v-regarc@microsoft.com>