platform/upstream/dotnet/runtime.git
4 years agoUI changes for .NET 5
Nikola Milosavljevic (CLR) [Wed, 13 May 2020 13:42:07 +0000 (06:42 -0700)]
UI changes for .NET 5

4 years agoSet charset in editorconfig for .csproj (#35634)
Eric Erhardt [Thu, 30 Apr 2020 14:54:26 +0000 (09:54 -0500)]
Set charset in editorconfig for .csproj (#35634)

* Add editorconfig charset for csproj files.

This stops VS from inserting a BOM in these files.

* Removing BOM from .csproj files.

4 years agoRun runtime tests with mono on test change. (#35604)
Nathan Ricci [Thu, 30 Apr 2020 14:50:58 +0000 (10:50 -0400)]
Run runtime tests with mono on test change. (#35604)

 Adding tests or modifyig build-test.sh will run runtime tests on mono (in addition to coreclr).

4 years agoUpdate dependencies from https://github.com/dotnet/xharness build 20200429.6 (#35659)
dotnet-maestro[bot] [Thu, 30 Apr 2020 12:22:02 +0000 (14:22 +0200)]
Update dependencies from https://github.com/dotnet/xharness build 20200429.6 (#35659)

4 years agoDisable a few executables if DISABLE_EXECUTABLES is defined. (#35653)
monojenkins [Thu, 30 Apr 2020 12:19:27 +0000 (08:19 -0400)]
Disable a few executables if DISABLE_EXECUTABLES is defined. (#35653)

4 years agoAdd new unit test demonstrating a JIT crash in Crossgen2 build mode (#35623)
Tomáš Rylek [Thu, 30 Apr 2020 10:53:30 +0000 (12:53 +0200)]
Add new unit test demonstrating a JIT crash in Crossgen2 build mode (#35623)

4 years agoIntegrate Android into /t:Test (#35640)
Egor Bogatov [Thu, 30 Apr 2020 09:44:50 +0000 (12:44 +0300)]
Integrate Android into /t:Test (#35640)

Integrate Android into the "Test" workflow, e.g.:
```
./build.sh -os Android -arch arm64 -subset Mono+Libs

cd src/libraries/System.Buffers/tests

dotnet build /p:TargetOS=Android /p:TargetArchitecture=arm64 /t:Test
```
^ should run tests for any test suite on an active device or emulator.

4 years ago[master] Update dependencies from 5 repositories (#35567)
dotnet-maestro[bot] [Thu, 30 Apr 2020 08:40:47 +0000 (10:40 +0200)]
[master] Update dependencies from 5 repositories (#35567)

4 years agoDisable two failing tests. (#35652)
Sergey Andreenko [Thu, 30 Apr 2020 07:37:26 +0000 (00:37 -0700)]
Disable two failing tests. (#35652)

4 years agoFix compFastTailCalls check. (#35596)
Eugene Rozenfeld [Thu, 30 Apr 2020 07:22:19 +0000 (00:22 -0700)]
Fix compFastTailCalls check. (#35596)

compFastTailCalls is true if COMPlus_FastTailCalls is not 0.
It was introduced in #341 to help with testing:
setting COMPlus_FastTailCalls to 0 forces all tail-prefixed
calls to be dispatched via helpers.

This fixes a subtle bug with checking compFastTailCalls:
it needs to be checked after `fgInitargInfo` has been called in
`fgCanFastTailCall`. `fgInitArgInfo` adds the stub address for VSD calls
and `fgMorphTailCallViaHelpers` then removes it.

This change also factors out the logic for checking whether the call
has byref parameters that must be copied by the caller.

4 years agoBaseline profiler/rejit/rejit/rejit.cmd (#35641)
Simon Nattress [Thu, 30 Apr 2020 06:53:34 +0000 (23:53 -0700)]
Baseline profiler/rejit/rejit/rejit.cmd (#35641)

Related issue: https://github.com/dotnet/runtime/issues/35639

4 years agoRemove problematic #undef _ASSERTE (#35630)
Steve MacLean [Thu, 30 Apr 2020 03:20:37 +0000 (23:20 -0400)]
Remove problematic #undef _ASSERTE (#35630)

4 years agoRemove HW_Flag_UnfixedSIMDSize (#35594)
Egor Chesakov [Thu, 30 Apr 2020 02:40:29 +0000 (19:40 -0700)]
Remove HW_Flag_UnfixedSIMDSize (#35594)

* Remove HW_Flag_UnfixedSIMDSize usages in hwintrinsiclistarm64.h

* Remove HW_Flag_UnfixedSIMDSize usages in hwintrinsiclistxarch.h

* Remove HW_Flag_UnfixedSIMDSize and HWIntrinsicInfo::HasFixedSimdSize() in hwintrinsic.cpp hwintrinsic.h

* Change HWIntrinsicInfo::simdSize type to int and remove all the casts in hwintrinsic.cpp hwintrinsic.h

4 years agoRevert "Remove obsolete managedOsxBuild et. al (#35356)" (#35647)
Steve MacLean [Thu, 30 Apr 2020 02:28:17 +0000 (22:28 -0400)]
Revert "Remove obsolete managedOsxBuild et. al (#35356)" (#35647)

This reverts commit 5b9fe8f29f0429ad410eaeefdffed59509d83176.

4 years agoRemove obsolete managedOsxBuild et. al (#35356)
Steve MacLean [Thu, 30 Apr 2020 01:43:36 +0000 (21:43 -0400)]
Remove obsolete managedOsxBuild et. al (#35356)

* Remove obsolete managedOsxBuild et. al

Remove managedOsxBuild
Remove managedTestBuildOsGroup
Remove managedTestBuildOsSubgroup

4 years agoDelete DataContractSerializer's ILLinkTrim.xml file (#35520)
Stephen Toub [Thu, 30 Apr 2020 01:25:08 +0000 (21:25 -0400)]
Delete DataContractSerializer's ILLinkTrim.xml file (#35520)

The whole assembly isn't being trimmed:
```
    <!-- Too much private reflection. Do not bother with trimming -->
    <ILLinkTrimAssembly>false</ILLinkTrimAssembly>
```

(On top of that, the set_Option that's being kept here is only set via reflection by test code that's not actually built today; it's guarded behind a compilation constant that's not set.)

4 years agoUpdate link from corefx to runtime (#35633)
Jeremy Barton [Thu, 30 Apr 2020 01:23:33 +0000 (18:23 -0700)]
Update link from corefx to runtime (#35633)

4 years agohandle UnauthorizedAccessException from mmap on OSX (#35619)
Tomas Weinfurt [Thu, 30 Apr 2020 01:23:19 +0000 (18:23 -0700)]
handle UnauthorizedAccessException from mmap on OSX (#35619)

* handle UnauthorizedAccessException on OSX

* update SkipTestException text

* add comments

Co-authored-by: Tomas Weinfurt <furt@Shining.local>
4 years agoInvalid derivation of fixed fractionDigits (#34973)
mrj001 [Wed, 29 Apr 2020 23:13:46 +0000 (17:13 -0600)]
Invalid derivation of fixed fractionDigits (#34973)

* Added code to throw XmlSchemaException if the derived type attempts to alter the fixed value of fractionDigits from the base type.

4 years agoAdd OS loader relocation type statistics to Crossgen2 map file (#35587)
Tomáš Rylek [Wed, 29 Apr 2020 21:18:28 +0000 (23:18 +0200)]
Add OS loader relocation type statistics to Crossgen2 map file (#35587)

4 years agoFix NeedsAlignedBaseOffset for composite R2R (#35231)
David Wrighton [Wed, 29 Apr 2020 20:13:47 +0000 (13:13 -0700)]
Fix NeedsAlignedBaseOffset for composite R2R (#35231)

- Syncronize and correct NeedsAlignedBaseOffset
  - Crossgen2 and the runtime had different models for when the base type size needed to be aligned up
  - This caused issues for composite crossgen2 builds as the logic was heavily module focussed
  - Also, the IsInSameVersionBubble logic was non-functional for composite build

The new algorithm is similar to the old normal R2R rule, with the extension that alignment isn't required in the case of a type which has layout dependent on multiple modules if all of the modules involved are part of the same compilation. (Thus composite compilation is slightly more optimized).

The other rule which must be enforced to allow for inputbubble compilation is that all assemblies depended on by an input bubble compilation must be R2R compiled.

- Add testing for many different variations of compiling the tests with
crossgen, crossgen2, and crossgen2 with input bubble enabled/disable and various composite compilation arrangements.

- Fix R2RDump for composite images
- Fix R2RDump for various fixup types

4 years agoImplement Vector{Size}<T>.AllBitsSet (#33924)
Ganbarukamo41 [Wed, 29 Apr 2020 19:32:49 +0000 (04:32 +0900)]
Implement Vector{Size}<T>.AllBitsSet (#33924)

4 years agoSimple formatting cleanup over Uri (#31874)
Miha Zupan [Wed, 29 Apr 2020 19:19:30 +0000 (21:19 +0200)]
Simple formatting cleanup over Uri (#31874)

* Simple formatting cleanup over Uri

* More Uri test cleanup

* Address pr feedback

4 years agoCheck if PortableThreadPoolEventSource is enabled before logging (#8117) (#35608)
Jan Kotas [Wed, 29 Apr 2020 18:48:38 +0000 (11:48 -0700)]
Check if PortableThreadPoolEventSource is enabled before logging (#8117) (#35608)

Co-authored-by: Ben Adams <thundercat@illyriad.co.uk>
4 years agoOptimize Uri.GetHashCode (#32713)
Miha Zupan [Wed, 29 Apr 2020 17:50:15 +0000 (19:50 +0200)]
Optimize Uri.GetHashCode (#32713)

* Optimize Uri.GetHashCode

* Don't use case-insensitive string hashing when not necessary

* Don't expect Uri.GetHashCode to always be case-insensitive in tests

* Correct Uri.Equals test

Hash codes being equal doesn't mean that the values are equal

* Do not cache Uri GetHashCode

* Simplify Uri.Equals test

4 years ago[mono] Add Android sample and AndroidAppBuilder task (#35483)
Egor Bogatov [Wed, 29 Apr 2020 16:34:29 +0000 (19:34 +0300)]
[mono] Add Android sample and AndroidAppBuilder task (#35483)

4 years agoFixing break on OOB System.IO.Ports package where native dependency was no longer...
Jose Perez Rodriguez [Wed, 29 Apr 2020 16:26:56 +0000 (09:26 -0700)]
Fixing break on OOB System.IO.Ports package where native dependency was no longer produced (#35591)

4 years agoDon't create duplicate ZeroInits (#35585)
Carol Eidt [Wed, 29 Apr 2020 16:17:57 +0000 (09:17 -0700)]
Don't create duplicate ZeroInits (#35585)

4 years agoFurther tuning of the CORE_ROOT folder content (#35546)
Tomáš Rylek [Wed, 29 Apr 2020 15:04:03 +0000 (17:04 +0200)]
Further tuning of the CORE_ROOT folder content (#35546)

Based on Sergey's feedback I'm putting back the alternate JITs
(linuxonjit, protononjit) as they are actively used by the JIT team
in specialized scenarios. I have also pruned the PDB subfolder -
after extensive discussions I tried to be conservative in removing
only those PDB's we believe we don't need in Helix.

Thanks

Tomas

4 years agoImprove code coverage on collections with stream-based flows (#35046)
Layomi Akinrinade [Wed, 29 Apr 2020 14:46:47 +0000 (10:46 -0400)]
Improve code coverage on collections with stream-based flows (#35046)

* Improve code coverage on collections with stream-based flows

* Address feedback & fortify tests

4 years agoimprove cmake version detection (#35593)
Tomas Weinfurt [Wed, 29 Apr 2020 13:18:09 +0000 (06:18 -0700)]
improve cmake version detection (#35593)

4 years agoProvide dummy runtime_version.h when skipped (#35579)
Adeel Mujahid [Wed, 29 Apr 2020 13:17:35 +0000 (16:17 +0300)]
Provide dummy runtime_version.h when skipped (#35579)

With `-skipgenerateversion`, all MSBuild invocations are skipped.
In that case, we generate a dummy `version.c` file. Since
`runtime_version.h` is added as a required header, generate its dummy
variant in the same context.

4 years agoNativeCallableAttribute to UnmanagedCallersOnlyAttribute (#35592)
Aaron Robinson [Wed, 29 Apr 2020 06:00:39 +0000 (23:00 -0700)]
NativeCallableAttribute to UnmanagedCallersOnlyAttribute (#35592)

* NativeCallableAttribute to UnmanagedCallersOnlyAttribute

Replace NativeCallableAttribute usage with UnmanagedCallersOnlyAttribute.
Update tests.
Update coreclr implementation to reflect new name.

4 years ago[Arm64] Implement ASIMD widening, narrowing, saturating instructions (#35379)
Egor Chesakov [Wed, 29 Apr 2020 03:54:37 +0000 (20:54 -0700)]
[Arm64] Implement ASIMD widening, narrowing, saturating instructions (#35379)

4 years agoFix FieldRVA handling of Field tokens (#35557)
Simon Nattress [Wed, 29 Apr 2020 03:41:42 +0000 (20:41 -0700)]
Fix FieldRVA handling of Field tokens (#35557)

FieldRefs in the metadata tables are variable sized. We assumed the common 2 byte encoding, but if there are at least 0x10000 fields in the assembly 4 bytes are used in all tables with FieldRefs, including the FieldRva table we walk and patch.

Use row size to make sure we adjust based on the encoding, and preserve it when rewriting the metadata.

4 years agoAdd BSF and BSR fallbacks for BitOperations methods (#34550)
Clinton Ingram [Wed, 29 Apr 2020 01:38:04 +0000 (18:38 -0700)]
Add BSF and BSR fallbacks for BitOperations methods (#34550)

* implement X86Base, add BSF and BSR intrinsics
* add X86Base to Utf8String S.R.I. shim
* add BSF and BSR fallbacks in BitOperations
* add X86Base to zapinfo
* disable 'w' size bit for BSF and BSR

4 years agoNaricc/move patch before helix (#35434)
Nathan Ricci [Wed, 29 Apr 2020 01:09:37 +0000 (21:09 -0400)]
Naricc/move patch before helix (#35434)

* parent a070557b8357d83edb76dcc2bddd5cd16204aa7b
author Nathan Ricci <naricc@microsoft.com> 1587776427 -0400
committer Nathan Ricci <naricc@microsoft.com> 1588004048 -0400

Moved patching of mono just before sending to helix, and properly propagate runtimeFlavorDisplayName.

4 years agoAdd a WebAssembly version of System.Console. (#35555)
Zoltan Varga [Wed, 29 Apr 2020 00:33:57 +0000 (20:33 -0400)]
Add a WebAssembly version of System.Console. (#35555)

4 years agoUse crossgen out of bindir (#35577)
Jarret Shook [Tue, 28 Apr 2020 22:57:51 +0000 (15:57 -0700)]
Use crossgen out of bindir (#35577)

4 years agoAdd disk usage on osx (#35522)
Jarret Shook [Tue, 28 Apr 2020 22:54:46 +0000 (15:54 -0700)]
Add disk usage on osx (#35522)

* Add disk usage information for mac builds

* Add disk usage for test build as well

* Like normal, yml syntax change

* Add more usage

* yml syntax

* Show du on ios and tvos

* Add before and after usage

* Address pr feedback

4 years ago[mono] Integrate xharness tool (iOS) (#35316)
Egor Bogatov [Tue, 28 Apr 2020 22:50:34 +0000 (01:50 +0300)]
[mono] Integrate xharness tool (iOS) (#35316)

* Integrate xharness

4 years agoImplement IAsyncDisposable for XmlWriter (#35233)
buyaa-n [Tue, 28 Apr 2020 21:50:40 +0000 (14:50 -0700)]
Implement IAsyncDisposable for XmlWriter (#35233)

* Update XmlWriter to implement IAsyncDisposable

4 years agoAdd option for extra queries for SuperPmi (#35411)
Carol Eidt [Tue, 28 Apr 2020 21:39:07 +0000 (14:39 -0700)]
Add option for extra queries for SuperPmi (#35411)

* Add option for extra queries for SuperPmi

This adds an option to do extra queries for struct fields and types to make it easier to test and diff struct promotion enhancements, but we could consider adding other queries in future.

4 years agoRemove Targets* instances from .props files (#35353)
Anirudh Agnihotry [Tue, 28 Apr 2020 20:36:53 +0000 (13:36 -0700)]
Remove Targets* instances from .props files (#35353)

* remove TargetsNetfx from isPartialFacadeAssembly property

* Omit Resources corrected

* fix partial facade

* GeneratePlatformNotSupportedAssemblyMessage corrected

* OmitResources made similar to isPartialFacadeAssembly

* fixes omitsources

* moving targetFramework dependent properties to second property Group

* fix GeneratePlatformNotSupportedAssemblyWithGlobalPrefix

* correct define constants

* fix no warn

* fix assembly version

* fix packageTargetFramework

* fix the build

* src and ref intell working

* remove targets properties from tests file

* adding comment

4 years agoServer and client are synchronized via TaskCompletionSource (#35569)
Alexander Nikolaev [Tue, 28 Apr 2020 18:58:49 +0000 (20:58 +0200)]
Server and client are synchronized via TaskCompletionSource (#35569)

Http2_PendingSend_SendsReset test fails because client sends the second request with EndOfStream flag sooner than the server reads the last RstStream frame of the first request. This is caused by too short delay before the second request is made on the client. This PR replaces Task.Delay with a synchronization via TaskCompletionSource.

Fixes #2131

4 years agoRemove workaround PreserveDependency in System.Data.Common (#35543)
Eric Erhardt [Tue, 28 Apr 2020 18:51:39 +0000 (13:51 -0500)]
Remove workaround PreserveDependency in System.Data.Common (#35543)

https://github.com/mono/linker/issues/800 has been fixed. So we can remove these attributes now.

4 years agoAdd new attributes for ILLink analysis. (#35387)
Eric Erhardt [Tue, 28 Apr 2020 18:44:35 +0000 (13:44 -0500)]
Add new attributes for ILLink analysis. (#35387)

* Add new attributes for ILLink analysis.

DynamicallyAccessedMembersAttribute
DynamicDependencyAttribute
UnconditionalSuppressMessageAttribute

Fix #33861, #35339, #30902

4 years agofix build.ps1 script execution error on cmd due to whitespace (#35554)
Himanshu Soni [Tue, 28 Apr 2020 18:28:23 +0000 (23:58 +0530)]
fix build.ps1 script execution error on cmd due to whitespace (#35554)

4 years agoEnable more formerly-failing-on-mono tests. (#35208)
imhameed [Tue, 28 Apr 2020 17:15:33 +0000 (10:15 -0700)]
Enable more formerly-failing-on-mono tests. (#35208)

See:
- https://github.com/dotnet/runtime/issues/34377,
- https://github.com/dotnet/runtime/issues/34378, and
- https://github.com/dotnet/runtime/issues/34381.

4 years agoJIT: fixes for EH Write Thru and OSR (#35550)
Andy Ayers [Tue, 28 Apr 2020 17:06:20 +0000 (10:06 -0700)]
JIT: fixes for EH Write Thru and OSR (#35550)

For EH Write Thru: make sure to initialize the stack home for any EH live
register parameters. Fixes some runtime errors.

For OSR: don't allocate the patchpoint counter local until we're going to
transform a patchpoint. Fixes a post-phase assert.

4 years agoImprove JIT dump related docs (#35166)
Ganbarukamo41 [Tue, 28 Apr 2020 14:30:36 +0000 (23:30 +0900)]
Improve JIT dump related docs (#35166)

* Update viewing-jit-dumps.md

* Add jitconfigvalues.h for the sources of env. variables
* Add JitDumpASCII in the list of useful env. variables

* Fix casings for JitDumpASCII env var

* Environment variables on UNIX OSes are case sensitive

4 years agoRemove GeneratedAssemblyInfoFile workaround (#35558)
Viktor Hofer [Tue, 28 Apr 2020 14:28:08 +0000 (16:28 +0200)]
Remove GeneratedAssemblyInfoFile workaround (#35558)

* Remove GeneratedAssemblyInfoFile workaround

The underlying issue is fixed in the SDK.

4 years agoAdd zlib-dev to linux requirement (#35571)
Jan Jahoda [Tue, 28 Apr 2020 14:27:06 +0000 (16:27 +0200)]
Add zlib-dev to linux requirement (#35571)

On Ubuntu, the build fails on missing zlib.

4 years agoDelete deprecated tailcalls support (#35552)
Jan Kotas [Tue, 28 Apr 2020 14:24:47 +0000 (07:24 -0700)]
Delete deprecated tailcalls support (#35552)

Follow up on #341

4 years agoHandle CriticalExtensions and WeakSignature on 509Chain for macOS (#35548)
Kevin Jones [Tue, 28 Apr 2020 14:19:00 +0000 (10:19 -0400)]
Handle CriticalExtensions and WeakSignature on 509Chain for macOS (#35548)

* Support unknown critical extensions on macOS.

If a certificate contains an unprocessable critical extension
in a certificate, map the "CriticalExtensions" status to
HasNotSupportedCriticalExtension instead of throwing an exception.

* Ignore WeakSignature chain status on macOS.

X509Chain on Windows will not check for modern signatures, so we
will let macOS do the same thing.

4 years ago[debugger] Cleaning error before return Invalid_argument. (#35532)
monojenkins [Tue, 28 Apr 2020 13:56:06 +0000 (09:56 -0400)]
[debugger] Cleaning error before return Invalid_argument. (#35532)

Fixing this PR
https://github.com/mono/mono/pull/19542

Co-authored-by: thaystg <thaystg@users.noreply.github.com>
4 years agoenable package Testing (#35541)
Anirudh Agnihotry [Tue, 28 Apr 2020 13:35:04 +0000 (06:35 -0700)]
enable package Testing (#35541)

4 years ago[master] Update dependencies from mono/linker dotnet/xharness (#35474)
dotnet-maestro[bot] [Tue, 28 Apr 2020 12:04:38 +0000 (12:04 +0000)]
[master] Update dependencies from mono/linker dotnet/xharness (#35474)

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

- Microsoft.NET.ILLink.Tasks: 5.0.0-preview.3.20220.1 -> 5.0.0-preview.3.20225.2

* Update dependencies from https://github.com/dotnet/xharness build 20200427.9

- Microsoft.DotNet.XHarness.Tests.Runners: 1.0.0-prerelease.20221.3 -> 1.0.0-prerelease.20227.9

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
4 years agoDisable tests which require precise GC on mono (#35560)
Vlad Brezae [Tue, 28 Apr 2020 11:09:52 +0000 (14:09 +0300)]
Disable tests which require precise GC on mono (#35560)

While these didn't seem to fail with jit, they do fail with interpreter.

4 years agoMerge pull request #35429 from janvorli/fix-osx-debug-build-symbols
Jan Vorlicek [Tue, 28 Apr 2020 09:22:36 +0000 (11:22 +0200)]
Merge pull request #35429 from janvorli/fix-osx-debug-build-symbols

Fix OSX debug / checked build symbols

4 years agoMerge pull request #35418 from janvorli/fix-stack-overflow-reporting-osx
Jan Vorlicek [Tue, 28 Apr 2020 08:20:27 +0000 (10:20 +0200)]
Merge pull request #35418 from janvorli/fix-stack-overflow-reporting-osx

Enable stack overflow stack trace reporting on OSX

4 years agoMerge pull request #35218 from am11/feature/pal-tests
Jan Vorlicek [Tue, 28 Apr 2020 08:17:00 +0000 (10:17 +0200)]
Merge pull request #35218 from am11/feature/pal-tests

Fix PAL test build on non-Linux Unix platforms

4 years agoMerge pull request #35334 from davmason/eventsource_fixes
David Mason [Tue, 28 Apr 2020 08:11:47 +0000 (01:11 -0700)]
Merge pull request #35334 from davmason/eventsource_fixes

Write TraceEvent events to EventPipe even if an ETW provider is not enabled, and report EventSource errors over EventPipe.

4 years agoFix generation of Crossgen2 zips (#34971)
David Wrighton [Tue, 28 Apr 2020 02:09:05 +0000 (19:09 -0700)]
Fix generation of Crossgen2 zips (#34971)

The compressed crossgen2 zip file being created in the current builds are almost empty except for the license details. This fixes the problem by passing the right values into the installer project creation path, as well as setting the RuntimeIdentifier property as needed.

4 years agoImplement portable tailcall helpers (#341)
Jakob Botsch Nielsen [Tue, 28 Apr 2020 00:06:15 +0000 (02:06 +0200)]
Implement portable tailcall helpers (#341)

* Implement portable tailcall helpers

This implements tailcall-via-help support for all platforms supported by
the runtime. In this new mechanism the JIT asks the runtime for help
whenever it realizes it will need a helper to perform a tailcall, i.e.
when it sees an explicit tail. prefixed call that it cannot make into a
fast jump-based tailcall.

The runtime created two important IL stubs to help the JIT in performing
the necessary tailcalls. One IL stub is used to store the args for the
tailcall, while the other is used to dispatch the actual tailcall
itself. The JIT will then transform the call from

return tail. F(a1, ..., an);

to

IL_STUB_StoreTailCallArgs(a1, ..., an);
T result;
IL_STUB_DispatchTailCalls(..., &result);
return result;

The dispatcher is written in such a way that it is able to dispatch
multiple tailcalls in a row when tailcalled functions also perform
tailcalls. To do this, the JIT helps the dispatcher detect if the
caller's caller is also a dispatcher. When this is the case the
dispatcher returns to let the previous dispatcher perform the tailcall
with the currently stored args. This allows the frame to unwind and
ensures that sequences of tailcalls do not grow the stack more than by a
constant factor.

Due to this unwinding the args cannot be stored on the stack and are
instead stored in TLS. The GC is made specially of this buffer as the
args can be anything, including interior pointers.

The control-flow when performing the new tailcalls is nonstandard, so
this also changes the debugger to support proper stepping into/over/out
of tailcalled functions when they go through the new dispatcher.

x86's tailcalling mechanism does not change.

This commit also includes the following changes:

* Update design doc for helper-based tailcalls

* Change lowering of GT_LABEL on arm.

Generate movw/movt instead of adr on arm. adr on arm allows offsets
up to 4k, which may not be enough. In particular,
IL_STUB_CallTailCallTarget uses GT_LABEL before argument setup code
and it can be more than 4k.

* Add COMPlus_FastTailCalls environment variable.

COMPlus_FastTailCalls controls whether fast tail calls are allowed.
If COMPlus_FastTailCalls is 0, fast tail calls are not allowed even for
tail-prefixed calls. Only helper-based calls are allowed. This is useful
for testing helper-based calls.

Co-authored-by: Eugene Rozenfeld <erozen@microsoft.com>
4 years agoCode review feedback
David Mason [Fri, 24 Apr 2020 22:28:23 +0000 (15:28 -0700)]
Code review feedback

4 years agoAdd test for out of band messages over EventSource
David Mason [Fri, 24 Apr 2020 01:20:21 +0000 (18:20 -0700)]
Add test for out of band messages over EventSource

4 years agoMake EventSource log errors to eventpipe
David Mason [Thu, 23 Apr 2020 22:16:00 +0000 (15:16 -0700)]
Make EventSource log errors to eventpipe

4 years agoupdate eventsource
David Mason [Thu, 23 Apr 2020 11:06:19 +0000 (04:06 -0700)]
update eventsource

4 years agoAdd support of CreateScalarUnsafe() for arm64 intrinsic in JIT (#34579)
Kunal Pathak [Mon, 27 Apr 2020 23:11:48 +0000 (16:11 -0700)]
Add support of CreateScalarUnsafe() for arm64 intrinsic in JIT (#34579)

* Intrinsify Vector64.CreateScalarUnsafe() for byte, sbyte, short, ushort, int, uint, long, ulong, float
* Intrinsify Vector128.CreateScalarUnsafe() for byte, sbyte, short, ushort, int, uint, long, ulong, float, long, ulong, double

4 years agoUse intrinsics for SequenceEqual<byte> vectorization to emit at R2R (#32371)
Ben Adams [Mon, 27 Apr 2020 22:19:24 +0000 (23:19 +0100)]
Use intrinsics for SequenceEqual<byte> vectorization to emit at R2R (#32371)

4 years agoHandle additional X509 chain statuses for macOS
Kevin Jones [Mon, 27 Apr 2020 21:25:48 +0000 (17:25 -0400)]
Handle additional X509 chain statuses for macOS

MacOS returns a different status string for certificates that are in a special
database that are explicitly distrusted. Windows has similar behavior, which
reports the certificates as PAL_X509ChainExplicitDistrust. This makes macOS
do the same instead of throwing an exception.

Linux does not appear to have any special distrusting for these
certificates.

4 years agoHandle more basic constraints chain statuses on macOS
Kevin Jones [Mon, 27 Apr 2020 21:21:40 +0000 (17:21 -0400)]
Handle more basic constraints chain statuses on macOS

macOS can return additional chain status strings for a certificate that
was issued by a certificate that violated its basic constraints.

If a leaf certificate is issued from a certificate with CA:FALSE,
the strings BasicConstraintsCA and BasicConstraintsPathLen are
reported. We map these the same for BasicConstraints.

4 years ago[interp] Fix tracking of local refcount when adding movloc opcode (#35524)
Vlad Brezae [Mon, 27 Apr 2020 21:03:53 +0000 (00:03 +0300)]
[interp] Fix tracking of local refcount when adding movloc opcode  (#35524)

* [interp] Log also the used locals size for a method

* [interp] Fix tracking of local refcount when adding movloc opcode

Consider the following IL code pattern:

```
stloc.np 0
dup
stloc 1
```

When `stloc 1` instruction is processed, we know we have local 0 on the top of the stack so we can replace `dup/stloc` with `movloc 0 -> 1`. However, we need to make sure that the refcount for local 0 is increased so we don't prematurely kill instructions that store into this local (the `stloc.np` from above). This is needed because we remove a dependency from the stack but add one from the locals. If the local 0 would have been explicitly pushed with a ldloc, the refcount is updated when we handle the ldloc, and no other updates are necessary.

4 years agoSocketAsyncEngine.Unix: name socket event thread (#35471)
Tom Deseyn [Mon, 27 Apr 2020 19:59:56 +0000 (21:59 +0200)]
SocketAsyncEngine.Unix: name socket event thread (#35471)

* SocketAsyncEngine.Unix: name socket event thread

This makes it more easy to identify the thread amongst
the other threads in the application.

* PR feedback

* Make System.Threading.Thread Reference specific to Unix

4 years agoGuard against (de)serializing pointers & ref structs (#34777)
Layomi Akinrinade [Mon, 27 Apr 2020 19:29:45 +0000 (15:29 -0400)]
Guard against (de)serializing pointers & ref structs (#34777)

* Guard against (de)serializing pointers & ref structs

* Address review feedback

* Update isbyreflike check

* Address review feedback; fetch IsByRefLike with reflection

* Address review feedback

* Remove extra whitespace

* Add debug assert

* Add attribute-based fallback

* Ensure that property look-up with reflection is useful

* Remove IsByRefLike property reflection prob

* Move runtime type debug validation upstream

4 years agoRestore Seperate test builds, but fix broken pipe (#35378)
Steve MacLean [Mon, 27 Apr 2020 18:24:50 +0000 (14:24 -0400)]
Restore Seperate test builds, but fix broken pipe (#35378)

* Build coreclr targetGeneric tests separately for CI (#34790)

* Build CoreClr tests separately

* Build coreclr targetGeneric tests separately for CI
* Build coreclr targetGeneric tests separately in runtime.yml
* Distinguish generic build based on Libraries config
* Build OSX release libraries when CoreCLR changed
* Always use tar.gz compression for generic tests

* Mark all CoreCLR Interop/COM projects OsSpecific

* Assume debug/release libraries doesn't matter during test build

* Add comments

4 years agoDelete SQLCLR EEPolicy leftovers (#35440)
Jan Kotas [Mon, 27 Apr 2020 18:05:58 +0000 (11:05 -0700)]
Delete SQLCLR EEPolicy leftovers (#35440)

4 years agoTabs vs. spaces
Jan Kotas [Mon, 27 Apr 2020 18:05:12 +0000 (11:05 -0700)]
Tabs vs. spaces

4 years agoMerge pull request #35319 from krwq/nullable-xml-1
Krzysztof Wicher [Mon, 27 Apr 2020 17:51:31 +0000 (10:51 -0700)]
Merge pull request #35319 from krwq/nullable-xml-1

Nullable: System.Xml, part 1

4 years ago[installer] Add RuntimeSpecificFrameworkSuffix property (#35124)
Mitchell Hwang [Mon, 27 Apr 2020 17:42:47 +0000 (13:42 -0400)]
[installer] Add RuntimeSpecificFrameworkSuffix property (#35124)

Co-authored-by: Mitchell Hwang <mihw@microsoft.com>
4 years agoLSRA delete a custom logic to get a tree type, use a general one. (#35313)
Sergey Andreenko [Mon, 27 Apr 2020 16:57:35 +0000 (09:57 -0700)]
LSRA delete a custom logic to get a tree type, use a general one. (#35313)

* Test two ways of getting type in LSRA.

* Use `getDefType` in `updateMaxSpill`.

* Rename `typ` to `type`.

4 years agoImprove Crossgen2 map file emitter (#35459)
Tomáš Rylek [Mon, 27 Apr 2020 15:45:22 +0000 (17:45 +0200)]
Improve Crossgen2 map file emitter (#35459)

* Improve Crossgen2 map file emitter

I have rewritten the file name emitter with two main goals in mind:

1) Fix the long-standing problem that map file wasn't showing true
RVA's of the individual symbols / nodes, making it harder to
correlate its information with in-memory R2R PE layout.

2) Add section size and statistics section roughly mimicking what
JanV presented in his recent analytic breakdown of R2R contents.

Thanks

Tomas

4 years ago[mono] Implement System.Console for Android (#35415)
Egor Bogatov [Mon, 27 Apr 2020 14:49:53 +0000 (17:49 +0300)]
[mono] Implement System.Console for Android (#35415)

* Implement ConsolePal for Android

Co-authored-by: Stephen Toub <stoub@microsoft.com>
4 years agoSync shared crossgen2 files (#35504)
Michal Strehovský [Mon, 27 Apr 2020 14:23:43 +0000 (16:23 +0200)]
Sync shared crossgen2 files (#35504)

4 years agoFix Interop.Sys.Write signature (#35505)
Vlad Brezae [Mon, 27 Apr 2020 12:49:42 +0000 (15:49 +0300)]
Fix Interop.Sys.Write signature (#35505)

SystemNative_Write expects fd passed as intptr, while the original sigature was using int. This crashed on mono interpreter because we didn't zero extend the int argument to an intptr, passing in an invalid descriptor.

4 years agoRemove usage of non-generic collections from Mono's SPC (#35312)
Roman Marusyk [Mon, 27 Apr 2020 12:13:27 +0000 (15:13 +0300)]
Remove usage of non-generic collections from Mono's SPC (#35312)

* Remove usage of non-generic collections from Mono's SPC #35282

* Remove usage of non-generic collections from Mono's SPC

Fix #35282

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
4 years agoCompile the wasm cross compiler with llvm. (#35395)
Zoltan Varga [Mon, 27 Apr 2020 11:52:26 +0000 (07:52 -0400)]
Compile the wasm cross compiler with llvm. (#35395)

4 years agoadd correct value when cloning http headers (#35498)
Tomas Weinfurt [Mon, 27 Apr 2020 11:31:56 +0000 (04:31 -0700)]
add correct value when cloning http headers (#35498)

* add correct value when cloning http headers

* Address PR feedback

Co-authored-by: Tomas Weinfurt <furt@Shining.local>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
4 years agoskip Microsoft.XmlSerializer.Generator.Tests on FreeBSD (#35494)
Tomas Weinfurt [Mon, 27 Apr 2020 10:37:47 +0000 (03:37 -0700)]
skip Microsoft.XmlSerializer.Generator.Tests on FreeBSD (#35494)

4 years agofixes for Socket constructor from handle (#34986)
Tomas Weinfurt [Mon, 27 Apr 2020 09:58:20 +0000 (02:58 -0700)]
fixes for Socket constructor from handle (#34986)

* fixes for Socket from handle

* add netlink test

* feedback from review

* add test with socketpair

* update socketpair test

* improve netlink test & feedback from review

* remove extrae empty line

* fixup SocketOptionName.AcceptConnection on OSX and add test

* fix UDS getpeername on Windows

* add debug output to UDS test

* feedback from review

* refactor handling of small buffer for getpeername

* adjust buffer calculation

* update also InternalSize

* more fixes to deal with UDS

* update WinSock getpeername

* push size logic to pal

* feedback from review

* use Span<byte> with getpeername

Co-authored-by: Tomas Weinfurt <furt@Shining.local>
4 years agoRemove reader.TrySkip workaround in JsonDocument parse helper (#35484)
Layomi Akinrinade [Mon, 27 Apr 2020 06:08:25 +0000 (02:08 -0400)]
Remove reader.TrySkip workaround in JsonDocument parse helper (#35484)

4 years agoRemove Pure attribute from System.Collections.Immutable (#35118)
Eric StJohn [Mon, 27 Apr 2020 02:11:47 +0000 (19:11 -0700)]
Remove Pure attribute from System.Collections.Immutable (#35118)

* Preserve Pure attribute in System.Collections.Immutable

* Remove usage of [Pure] from Immutable Collections

4 years agoRefactor Task Socket.ConnectAsync methods to use AwaitableSocketAsyncEventArgs (...
Tom Deseyn [Mon, 27 Apr 2020 00:48:03 +0000 (02:48 +0200)]
Refactor Task Socket.ConnectAsync methods to use AwaitableSocketAsyncEventArgs (#787)

* Refactor Task Socket.ConnectAsync methods to use AwaitableSocketAsyncEventArgs

* Add back BeginConnect_IPAddresses_ListeningSocket_Throws_InvalidOperation

4 years agoAdd AttributeTargets.Interface to SkipLocalsInitAttribute (#35485)
Yair Halberstadt [Mon, 27 Apr 2020 00:11:21 +0000 (03:11 +0300)]
Add AttributeTargets.Interface to SkipLocalsInitAttribute (#35485)

* Add AttributeTargets.Interface to SkipLocalsInitAttribute

* Add AttributeTargets.Interface to ref SkipLocalsInit

4 years agoOptimize CoreCLR Helix runs by pruning the CORE_ROOT folder content (#35243)
Tomáš Rylek [Sun, 26 Apr 2020 22:07:47 +0000 (00:07 +0200)]
Optimize CoreCLR Helix runs by pruning the CORE_ROOT folder content (#35243)

This change limits the content of CORE_ROOT by removing some of the
unused artifacts, most notably the sharedFramework subfolder that
is not used by CoreCLR tests at all. The aim of this change is
to optimize the execution of CoreCLR tests in Helix where according
to Jarret's findings a large amount of time gets spent just
downloading and unpacking the test payloads.

Thanks

Tomas

4 years agoTotal digits invalid cast exception (#34463)
mrj001 [Sun, 26 Apr 2020 18:58:47 +0000 (12:58 -0600)]
Total digits invalid cast exception (#34463)

* Changed comparison so that it no longer casts Int32 values to Decimal.

4 years agoImprove JsonDocumentOptions test coverage (#35457)
madmir [Sun, 26 Apr 2020 15:51:06 +0000 (17:51 +0200)]
Improve JsonDocumentOptions test coverage (#35457)

* Improve JsonDocumentOptions test coverage

* Apply review feedback

Co-authored-by: madmir <madmir@users.noreply.github.com>
4 years agoRyuJIT: Optimize "X<<1" to "lea [X+X]" (#35210)
Egor Bogatov [Sun, 26 Apr 2020 15:21:27 +0000 (18:21 +0300)]
RyuJIT: Optimize "X<<1" to "lea [X+X]" (#35210)

* Optimize "X<<1" to "lea [X+X]"

* optimize to `add reg, reg`

4 years agoMark LoadAssemblyAndGetFunctionPointer as NativeCallable (#35470)
Jan Kotas [Sun, 26 Apr 2020 07:52:54 +0000 (00:52 -0700)]
Mark LoadAssemblyAndGetFunctionPointer as NativeCallable (#35470)