platform/upstream/dotnet/runtime.git
4 years ago[interp] Small cleanups (#36706)
monojenkins [Wed, 20 May 2020 10:52:01 +0000 (06:52 -0400)]
[interp] Small cleanups (#36706)

Co-authored-by: BrzVlad <BrzVlad@users.noreply.github.com>
4 years ago[mono] Fix iOS sample and use `dotnet publish` (#36745)
Egor Bogatov [Wed, 20 May 2020 10:47:22 +0000 (13:47 +0300)]
[mono] Fix iOS sample and use `dotnet publish` (#36745)

Use `dotnet publish` with linker just like for Android.

4 years agoUse latest compiler toolset from Arcade (#36741)
Levi Broderick [Wed, 20 May 2020 07:24:53 +0000 (00:24 -0700)]
Use latest compiler toolset from Arcade (#36741)

4 years agoCode sharing between generic methods in member accessor (#36710)
Yoh Deadfall [Wed, 20 May 2020 06:46:25 +0000 (09:46 +0300)]
Code sharing between generic methods in member accessor (#36710)

* Code sharing between generic methods in member accessor

* Removed redudant value type check

4 years agoRemove Fedora29 from test matrix and add Fedora32 (#36716)
Santiago Fernandez Madero [Wed, 20 May 2020 06:08:44 +0000 (23:08 -0700)]
Remove Fedora29 from test matrix and add Fedora32 (#36716)

4 years agoJIT: fix no return call accounting (#36719)
Andy Ayers [Wed, 20 May 2020 01:22:13 +0000 (18:22 -0700)]
JIT: fix no return call accounting (#36719)

The jit tracks the number of no return calls to determine if it should run
throw helper merging and to decide if no return calls should tail called.

The accounting is currently done when the calls are initially imported,
so if code is duplicated (by say finally cloning the count may end up being
an under-estimate. While not a correctness issue, it is better for the count
to be accurate (or an over-estimate).

So, update the count when cloning a no-return call.

Closes #36584.

4 years agoAdd build information to libraries helix jobs (#36713)
Santiago Fernandez Madero [Tue, 19 May 2020 23:18:41 +0000 (16:18 -0700)]
Add build information to libraries helix jobs (#36713)

* Add build information to libraries helix jobs

* Remove BUILD_URI

4 years agoRemove duplicated tests from System.Text.Json.Tests (#36483)
David Cantu [Tue, 19 May 2020 22:54:13 +0000 (15:54 -0700)]
Remove duplicated tests from System.Text.Json.Tests (#36483)

4 years agoRemove TheadPool initialization volatile (#36697)
Ben Adams [Tue, 19 May 2020 22:00:47 +0000 (23:00 +0100)]
Remove TheadPool initialization volatile (#36697)

* Remove TheadPool initialization volatile

* Better ThreadPoolGlobals setup for Mono

* Feedback

* Move back to lambda

4 years agoAdding a ci leg for Source build (#36141)
Anirudh Agnihotry [Tue, 19 May 2020 21:44:01 +0000 (14:44 -0700)]
Adding a ci leg for Source build (#36141)

* successfullsource build

* adding a new source build leg.

* remove yy

* add default vlaue

* addressing feedback

* use boolean value

* addind comment and other feedback

* adding colon and removing unintentional change

* adding default value of isSourceBUild

4 years agoContain non-candidate regOptional lclVars (#36601)
Carol Eidt [Tue, 19 May 2020 21:38:28 +0000 (14:38 -0700)]
Contain non-candidate regOptional lclVars (#36601)

4 years agoRemoved extra slash. (#36722)
Nathan Ricci [Tue, 19 May 2020 21:28:54 +0000 (17:28 -0400)]
Removed extra slash. (#36722)

Remove extra / from path on runtimetests.

4 years agofix handling of Ssl2 and enable disabled tests (#36098)
Tomas Weinfurt [Tue, 19 May 2020 20:42:11 +0000 (13:42 -0700)]
fix handling of Ssl2 and enable disabled tests (#36098)

* attempt to fix ssl2

* adjust length calculation

* enable tests

* fix ReadAsyncInternal

* use PlatformDetection.SupportsSsl2

* feedback from review

Co-authored-by: Tomas Weinfurt <furt@Shining.local>
4 years agoTry using socket syscalls that accepts a single buffer to improve performance (#36371)
Tom Deseyn [Tue, 19 May 2020 18:43:24 +0000 (20:43 +0200)]
Try using socket syscalls that accepts a single buffer to improve performance (#36371)

* Try using socket syscalls that accepts a single buffer to improve performance

* Remove ref from Receive calls

* Prefix Pal methods invoking methods with Sys

* Also use single-buffer syscalls for sync Socket Receive methods

* Improve comment

* PR feedback

* Assert SocketAddress null instead of checking

4 years agoFixed Incorrectly named function arguments in TryGetPlatformSocketOption. (#36694)
AraHaan [Tue, 19 May 2020 18:35:01 +0000 (14:35 -0400)]
Fixed Incorrectly named function arguments in TryGetPlatformSocketOption. (#36694)

Fixes #36686.

4 years agoImprove sort function in crossgen2 (#36676)
David Wrighton [Tue, 19 May 2020 18:12:20 +0000 (11:12 -0700)]
Improve sort function in crossgen2 (#36676)

- Increase memory locality substantially in composite images
- Sort non-generic methods with module together
- Sort generic methods near other generic methods with similar instantiations

Json benchmark showed improvement from 237,827 RPS to 270,306 RPS, and reduced working set by about 10MB

4 years agoRevert unintentional alignment change for Vector256<T> (#36673)
Anton Lapounov [Tue, 19 May 2020 17:09:08 +0000 (10:09 -0700)]
Revert unintentional alignment change for Vector256<T> (#36673)

Addresses https://github.com/dotnet/runtime/pull/35864#issuecomment-629803015.  In an earlier change I also added the `type.Instantiation[0].IsPrimitive` condition to the `IsVectorType` predicate.  Revert that part as well and allow only primitive numeric types for HFA/HVA purpose.  The same list of 10 types is recognized in `MethodTable::GetVectorSize` and `Compiler::getBaseTypeAndSizeOfSIMDType`.

4 years agoAdd RequiresUnreferencedCodeAttribute (#36674)
Eric Erhardt [Tue, 19 May 2020 15:29:15 +0000 (10:29 -0500)]
Add RequiresUnreferencedCodeAttribute (#36674)

This attribute is used by the linker to know which methods are unsafe to use when an application is trimmed.

Fix #33862

4 years agoRemove duplicated code from SR.cs (#36277)
Marek Safar [Tue, 19 May 2020 14:26:01 +0000 (16:26 +0200)]
Remove duplicated code from SR.cs (#36277)

4 years ago[master] Update dependencies from mono/linker Microsoft/vstest (#36692)
dotnet-maestro[bot] [Tue, 19 May 2020 14:09:05 +0000 (14:09 +0000)]
[master] Update dependencies from mono/linker Microsoft/vstest (#36692)

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

Microsoft.NET.ILLink.Tasks
 From Version 5.0.0-preview.3.20268.2 -> To Version 5.0.0-preview.3.20268.5

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

Microsoft.NET.Test.Sdk
 From Version 16.7.0-preview-20200515-03 -> To Version 16.7.0-preview-20200518-01

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
4 years agoFix RuntimeInformation.IsOSPlatform for Browser/WASM (#36665)
Alexander Köplinger [Tue, 19 May 2020 13:57:20 +0000 (15:57 +0200)]
Fix RuntimeInformation.IsOSPlatform for Browser/WASM (#36665)

The native code was still using the previous `WEBASSEMBLY` name instead of `BROWSER` as decided in https://github.com/dotnet/runtime/issues/33328.

4 years agoChecking strings against length seem to have better perf (#36443)
Youssef Victor [Tue, 19 May 2020 13:39:51 +0000 (15:39 +0200)]
Checking strings against length seem to have better perf (#36443)

* Chckecing strings against length seem to have better perf

* Apply suggestions from code review

Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
Co-authored-by: Ben Adams <thundercat@illyriad.co.uk>
* Apply suggestions from code review

Co-authored-by: Ben Adams <thundercat@illyriad.co.uk>
* Update src/libraries/System.Drawing.Common/src/System/Drawing/BitmapSelector.cs

Co-authored-by: Ben Adams <thundercat@illyriad.co.uk>
* Apply suggestions from code review

* Update src/libraries/System.Private.CoreLib/src/System/Reflection/AssemblyNameFormatter.cs

* fix build error

* Update SmtpClient.cs

* Update AssemblyNameFormatter.cs

* Update LoggingEventSource.cs

* Fix build error

* Apply suggestions from code review

* Update src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/SyndicationContent.cs

* Fix build error

* Apply suggestions from code review

Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
Co-authored-by: Ben Adams <thundercat@illyriad.co.uk>
4 years agoLibunwind1.5rc2 (#36027)
Steve MacLean [Tue, 19 May 2020 11:46:16 +0000 (07:46 -0400)]
Libunwind1.5rc2 (#36027)

* Add libunwind 1.5rc2 source

Rename unused autoconfig dir aux -> aux_ consistent with
original checkin

* Delete files added by 1.3-rc1

* Update libunwind version in CMake

* Add libunwind-version.txt

* Add changes for SunOS from @am11

* Revert change to oop

* Remove obsolete add_definition

* Fix musl build

* Fix comment

* Be consistent and use HOST

* Fix error in unw_sigcontext libunwind/libunwind#179

Introduced by libunwind/libunwind#71

__reseverved needs to be big enough to store a unw_fpsimd_context_t
Which includes 32 128-bit registers, stored as 64 64-bit half registers.
Fix off by 2 issue

* Arm64 support !UNWIND_CONTEXT_IS_UCONTEXT_T

Co-authored-by: Adeel <adeelbm@outlook.com>
4 years agoRewrite NegotiateStream.XxAsync operations with async/await (#36583)
Stephen Toub [Tue, 19 May 2020 11:42:06 +0000 (07:42 -0400)]
Rewrite NegotiateStream.XxAsync operations with async/await (#36583)

* Rewrite NegotiateStream.Read/Write* operations with async/await

Gets rid of a bunch of IAsyncResult cruft and makes the XxAsync APIs cancelable.

* Combine NegoState into NegotiateStream

* Rewrite AuthenticateAs* with async/await

* Add more NegotiateStream tests

Including for cancellation and a product fix to enable cancellation.

* Update ref with overrides

* Remove custom IAsyncResults from System.Net.Security

* Fix UnitTests project

4 years ago[mono] Enable System.Runtime.Tests on Android (#36655)
Egor Bogatov [Tue, 19 May 2020 11:08:03 +0000 (14:08 +0300)]
[mono] Enable System.Runtime.Tests on Android (#36655)

4 years agoWASM app builder changes. (#36422)
Zoltan Varga [Tue, 19 May 2020 01:11:09 +0000 (21:11 -0400)]
WASM app builder changes. (#36422)

* Add an ExtraAssemblies parameter to the WasmAppBuilder task.

* Pass more assemblies to the pinvoke table generator.

* Improve the wasm sample.

* Move WasmAppBuilder to tools-local.

4 years agoPrefix protected fields with underscore for the internal XmlRawWriter (#35759)
Roman Marusyk [Mon, 18 May 2020 23:52:45 +0000 (02:52 +0300)]
Prefix protected fields with underscore for the internal XmlRawWriter (#35759)

* Prefix protected fields with underscore for the internal XmlRawWriter and its descendant classes

4 years agoRemove BuildOS (#36667)
Anirudh Agnihotry [Mon, 18 May 2020 21:49:44 +0000 (14:49 -0700)]
Remove BuildOS (#36667)

4 years agoFix R2RTest parsing of the issues.targets (#36650)
Jan Vorlicek [Mon, 18 May 2020 21:37:29 +0000 (23:37 +0200)]
Fix R2RTest parsing of the issues.targets (#36650)

The format of the file has changed a bit some time ago, but the R2RTest
wasn't updated accordingly, so test exclusion stopped working. This
change fixes it.

4 years agoProduce Mono+LLVM runtime packs on desktop platforms (#35841)
Jo Shields [Mon, 18 May 2020 21:35:38 +0000 (17:35 -0400)]
Produce Mono+LLVM runtime packs on desktop platforms (#35841)

* Add LLVM Mono runtime build

* Switch from 'llvm' boolean to 'runtimeVariant' freeform string in yaml

This makes it easier to add oddball variant builds, without a big pile of booleans for every possible variant

* Add an LLVM suffix to installer nupkgs

* Add runtimeVariant to CoreCLR artifact names

* Add installer run for LLVM JIT Mono

* Actually specify LLVM or not to installer build

* Unique name for LLVM installer run

* Ensure log uploads are disambiguated

* Fix dependency in full matrix

* Add LLVMAOT variant, which bundles llc/opt for current arch

* Make sure we don't use Mono.LLVM package names on CoreCLR or Mobile

* Fix perf runs to deal with runtimeVariant

* Try to reconcile perf test artifact names

* Make bundling llc/opt the default when LLVM enabled on Mono

4 years agoRemove PreserveDependency on non-existing type (#36657)
Eric Erhardt [Mon, 18 May 2020 19:33:42 +0000 (14:33 -0500)]
Remove PreserveDependency on non-existing type (#36657)

The DefaultArrayConverter type was been refactored away causing the linker to warn about it.

4 years agoRemove unnecessary initialization from Utf8JsonWriter ctors (#36651)
Stephen Toub [Mon, 18 May 2020 17:47:04 +0000 (13:47 -0400)]
Remove unnecessary initialization from Utf8JsonWriter ctors (#36651)

4 years agoRemoved redundant visibility check (#36648)
Yoh Deadfall [Mon, 18 May 2020 16:16:23 +0000 (19:16 +0300)]
Removed redundant visibility check (#36648)

4 years agoFix failing Sockets tests after argument exception changes (#36645)
Stephen Toub [Mon, 18 May 2020 15:58:41 +0000 (11:58 -0400)]
Fix failing Sockets tests after argument exception changes (#36645)

4 years agoDelete OrderBy(...).First{OrDefault}(...) optimization (#36643)
Stephen Toub [Mon, 18 May 2020 15:58:11 +0000 (11:58 -0400)]
Delete OrderBy(...).First{OrDefault}(...) optimization (#36643)

The optimization removes the O(n log n) cost of the OrderBy. But it can result in executing the predicate passed to First{OrDefault} more than in .NET Framework; it would always execute it n times, whereas previously it would execute it <= n times.  Developers have expressed concern about the change, in particular when using a relatively expensive predicate on a relatively short list, or when unadvisedly relying on side-effecting predicates.

4 years agoSync one more shared crossgen2 file (#36638)
Michal Strehovský [Mon, 18 May 2020 15:38:04 +0000 (17:38 +0200)]
Sync one more shared crossgen2 file (#36638)

4 years agoUpdate dependencies from https://github.com/mono/linker build 20200518.2 (#36647)
dotnet-maestro[bot] [Mon, 18 May 2020 14:18:48 +0000 (14:18 +0000)]
Update dependencies from https://github.com/mono/linker build 20200518.2 (#36647)

Microsoft.NET.ILLink.Tasks
 From Version 5.0.0-preview.3.20265.2 -> To Version 5.0.0-preview.3.20268.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
4 years ago[mono] Linking statically ICU shim on mono (#35790)
Thays Grazia [Mon, 18 May 2020 14:02:32 +0000 (11:02 -0300)]
[mono] Linking statically ICU shim on mono (#35790)

Linking statically ICU shim on mono for windows, linux, macOs and android.

4 years agoFix mono file name on iOS/Browser (#36646)
Alexander Köplinger [Mon, 18 May 2020 13:49:35 +0000 (15:49 +0200)]
Fix mono file name on iOS/Browser (#36646)

We initially intended to just use libmono.so/dylib as the name to simplify and follow the libcoreclr.dylib pattern and we did that by just copying to a different name after the build.

However that didn't work on Android since the name gets embedded inside the binary and Android checks that these match, so we'd either have to change the (auto)make to use the correct library name (and possibly creates complex conditionals in the Makefile for netcore) or go back to using `libmonosgen-2.0` on iOS.

We decided to do the latter.

4 years ago[mono] Fix AssemblyLoadContext.GetRuntimeAssembly() for AssemblyBuilders (#36367)
Alexis Christoforides [Mon, 18 May 2020 12:46:49 +0000 (08:46 -0400)]
[mono] Fix AssemblyLoadContext.GetRuntimeAssembly() for AssemblyBuilders (#36367)

4 years agoAdd iOS x86 build (#36602)
Alexander Köplinger [Mon, 18 May 2020 09:27:21 +0000 (11:27 +0200)]
Add iOS x86 build (#36602)

Needed for the iOS Simulator for 32bit iOS devices.

4 years agoNaricc/ci interpreter arm64 (#36258)
Nathan Ricci [Sun, 17 May 2020 23:51:37 +0000 (19:51 -0400)]
Naricc/ci interpreter arm64 (#36258)

Change mono interpreter runs to be a scenario instead of a seperate leg. Also enable arm64 interpreter runs, and add test exclusions.

4 years agoCMake: Point download URLs directly to https:// (#36615)
Nick Craver [Sun, 17 May 2020 23:27:13 +0000 (19:27 -0400)]
CMake: Point download URLs directly to https:// (#36615)

4 years agoSync crossgen2 shared files (#36610)
Michal Strehovský [Sun, 17 May 2020 19:35:32 +0000 (21:35 +0200)]
Sync crossgen2 shared files (#36610)

4 years agoRemoved left-over NUnit references from comments (#36606)
Alfred Myers [Sun, 17 May 2020 15:37:47 +0000 (12:37 -0300)]
Removed left-over NUnit references from comments (#36606)

4 years ago[master] Update dependencies from mono/linker Microsoft/vstest dotnet/xharness (...
dotnet-maestro[bot] [Sun, 17 May 2020 14:18:20 +0000 (14:18 +0000)]
[master] Update dependencies from mono/linker Microsoft/vstest dotnet/xharness (#36598)

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

Microsoft.NET.ILLink.Tasks
 From Version 5.0.0-preview.3.20265.1 -> To Version 5.0.0-preview.3.20265.2

* Update dependencies from https://github.com/microsoft/vstest build 20200515-03

Microsoft.NET.Test.Sdk
 From Version 16.7.0-preview-20200515-01 -> To Version 16.7.0-preview-20200515-03

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

Microsoft.DotNet.XHarness.Tests.Runners
 From Version 1.0.0-prerelease.20265.1 -> To Version 1.0.0-prerelease.20265.8

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
4 years ago[interp] Don't share interp_in signatures for different valuetypes (#36520)
monojenkins [Sat, 16 May 2020 20:47:39 +0000 (16:47 -0400)]
[interp] Don't share interp_in signatures for different valuetypes (#36520)

We share interp_in wrappers for different types of signatures if the corresponding params are equivalent. This was added in https://github.com/mono/mono/commit/5cbe93884798684efbb81abd79e0e2a170544b75. This was reusing some sharing mechanism used by gsharedvt. Those wrappers are shared with regard to managed->managed transitions so it takes additional freedoms, converting all valuetypes to ValueTuples instances. These can end up being marshalled differently from the initial struct so we can't use this valuetype sharing infrastructure in the interp_in_wrappers which can operate on native structs.

Fixes test_0_marshal_struct_delegate from pinvoke3.cs

Co-authored-by: BrzVlad <BrzVlad@users.noreply.github.com>
4 years ago[mono] Enable some System.Reflection.Emit tests (#35872)
Alexis Christoforides [Sat, 16 May 2020 17:38:41 +0000 (13:38 -0400)]
[mono] Enable some System.Reflection.Emit tests (#35872)

4 years agoFix StackTraceTests to work with JIT optimization (#36596)
Bruce Forstall [Sat, 16 May 2020 17:01:15 +0000 (10:01 -0700)]
Fix StackTraceTests to work with JIT optimization (#36596)

Disable optimization/inlining on methods that are expected to
remain on the stack.

4 years agoupdating area owners (#36467)
Manish Godse [Sat, 16 May 2020 15:53:28 +0000 (08:53 -0700)]
updating area owners (#36467)

* updating area owners

* adding cross-gen contrib as owner

4 years agoPort changes to shared files Nullable.cs, Enum.cs (#36597)
Michal Strehovský [Sat, 16 May 2020 14:09:54 +0000 (16:09 +0200)]
Port changes to shared files Nullable.cs, Enum.cs (#36597)

4 years ago[mono] Use "dotnet publish" for Android sample with ILLink (#36593)
Egor Bogatov [Sat, 16 May 2020 13:15:56 +0000 (16:15 +0300)]
[mono] Use "dotnet publish" for Android sample with ILLink (#36593)

4 years agoSslStream.AuthenticateAs sync overloads with SslOptions made public (#36221)
Marie Píchová [Sat, 16 May 2020 09:15:05 +0000 (11:15 +0200)]
SslStream.AuthenticateAs sync overloads with SslOptions made public (#36221)

4 years agoFix IL projects build inside visual studio (#36570)
Santiago Fernandez Madero [Sat, 16 May 2020 06:16:48 +0000 (23:16 -0700)]
Fix IL projects build inside visual studio (#36570)

4 years agoProduce DropFromSingleFile annotations in RuntimeList.xml (#36578)
Vladimir Sadov [Fri, 15 May 2020 23:01:16 +0000 (16:01 -0700)]
Produce DropFromSingleFile annotations in RuntimeList.xml (#36578)

* SingleFileHostInclude

* style fixes

* PR feedback

4 years agoBuild an apphost with hostfxr and hostpolicy linked in (#36230)
Vladimir Sadov [Fri, 15 May 2020 22:01:32 +0000 (15:01 -0700)]
Build an apphost with hostfxr and hostpolicy linked in (#36230)

* hostfxr: Build most of hostfxr as a static library

This is part of the work to create an apphost that bundles both hostfxr
and hostpolicy.  The main distinction between the static and shared
versions of hostfxr is that the static version contains a hostpolicy
resolver that references the hostpolicy symbols directly rather than
loading them from a DLL.

* hostpolicy: Build as a static library

This change is part of the work to enable an apphost that bundles both
hostfxr and hostpolicy.  There's no distinction between hostpolicy
that's built as a shared library and as a static library: the shared
library is built by linking an empty object file with the static
library.

* corehost: Allow linking of hostfxr and hostpolicy with apphost

Provide a hostfxr_iface class, that abstracts how the hostfxr functions called
by the early stage in the hosting layer is resolved.

* dotnet: Teach the muxer binary about hostfxr_iface

* apphost: Teach apphost about hostfxr_iface

This provides two implementations of hostfxr_iface: one for the static
apphost, which bundles hostfxr and hostpolicy, and another for the
conventional apphost, which loads them dynamically on startup.

* Add exports for hostfxr and policy

* Exports for unix

* EXPORTS_LINKER_OPTION

* use generateversionscript.awk from ENG

* Move fxr files out of static

* Fixes for Linux

* Fix for   win-x86

* move HEADERS next to SOURCES similarly to other files.

* PR feedback (simplifying hostpolicy_resolver::try_get_dir for static host)

* Publish static_apphost to Microsoft.NETCore.App.Host

* bind to entry points without probing, when in a static host.

* Add a test case

* renamed hostfxr_iface --> hostfxr_resolver_t

* renamed shared --> standalone

* rename static_apphost --> singlefilehost

* Signing exclusions for singlefilehost

* switched StaticHost tst to a different asset (mostly a copy of StandaloneApp)

* get_method_module_path

Co-authored-by: Leandro Pereira <leandro.pereira@microsoft.com>
Co-authored-by: Swaroop Sridhar <swaroop.sridhar@microsoft.com>
4 years agoDelete DebugThreadTracking from networking code (#36549)
Stephen Toub [Fri, 15 May 2020 21:47:15 +0000 (17:47 -0400)]
Delete DebugThreadTracking from networking code (#36549)

The System.Net.* libs in dotnet/runtime inherited this from .NET Framework.  To my knowledge it's not once helped flag any issues in dotnet/runtime, it's only built into debug builds, it's become very inconsistent as the code base has evolved, and it's just cluttering stuff up.  So, goodbye.

4 years agoMore HTTP/2 performance (and a few functional) improvements (#36246)
Stephen Toub [Fri, 15 May 2020 21:30:17 +0000 (17:30 -0400)]
More HTTP/2 performance (and a few functional) improvements (#36246)

* Use span instead of array for StatusHeaderName

* Fix potential leak into CancellationToken

We need to dispose of the linked token source we create.

Also cleaned up some unnecessarily complicated code nearby.

* Fix HttpConnectionBase.LogExceptions

My previous changes here were flawed for the sync-completing case, and also accidentally introduced a closure.

* Clean up protocol state if/else cascades into switches

* Consolidate a bunch of exception throws into helpers

* Fix cancellation handling of WaitFor100ContinueAsync

* Change AsyncMutex's linked list to be circular

* Remove linked token sources

Rather than creating temporary linked token sources with the request body source and the supplied cancellation token, we can instead just register with the supplied token to cancel the request body source.  This is valid because canceling any part of sending a request cancels any further sending of that request, not just that one constituent operation.

* Avoid registering for linked cancellation until absolutely necessary

We can avoid registering with the cancellation token until after we know that our send is completing asynchronously.

* Remove closure/delegate allocation from WaitForDataAsync

`this` was being closed over accidentally.  I can't wait for static lambdas.

* Avoid a temporary list for storing trailers

Since it only exists to be defensive but we don't expect response.TrailingHeaders to be accessed until after the whole response has been received, we can store the headers into an HttpResponseHeaders instance and swap that instance in at the end.  Best and common case, we avoid the list. Worst and uncommon case, we pay the overhead of the extra HttpResponseHeaders instead of the List.

* Delete dead AcquireWriteLockAsync method

* Reduce header frame overhead

Minor optimizations to improve the asm

* Remove unnecessary throws with GetShutdownException

* Avoid extra lock in SendHeadersAsync

* Move Http2Stream construction out of lock

Makes a significant impact on reducing lock contention.

* Streamline RemoveStream

Including moving credit adjustment out of the lock

* Move response message allocation to ctor

Remove it from within the lock

* Reorder interfaces on Http2Stream

IHttpTrace doesn't need to be prioritized.

* Address PR feedback

4 years agoMerge pull request #36153 from krwq/sp_rem_sysnative_dep
Krzysztof Wicher [Fri, 15 May 2020 21:21:20 +0000 (14:21 -0700)]
Merge pull request #36153 from krwq/sp_rem_sysnative_dep

Remove dependency on System.Native from System.IO.Ports

4 years agoFix argument exception warnings on runtime (#35717)
buyaa-n [Fri, 15 May 2020 20:55:30 +0000 (13:55 -0700)]
Fix argument exception warnings on runtime (#35717)

* Fix argument exception warnings on runtime

* Apply feedback

* Addressing feedback and test fix

* Fix test failures

* Fix tests for NetFx run

* Fix suppressed warning for socket.SendAsyn(e) and fix corresponding tests

* Applied feedback

4 years agoNext round of multireg preliminary changes (#36155)
Carol Eidt [Fri, 15 May 2020 20:04:26 +0000 (13:04 -0700)]
Next round of multireg preliminary changes (#36155)

This is a zero-diff set of mostly refactoring changes in preparation for supporting multireg locals:
- Move `genRegCopy()` and `genStructReturn()` to codegencommon.cpp, making a new method for `genSIMDSplitReturn` which is target-specific.
- Factor out a new `genUnspillLocal` method from `genUnspillRegIfNeeded()`.
- Similarly factor out `genSpillLocal()`
- Rename `genMultiRegCallStoreToLocal()` and more generally support multireg local stores.
- Fix a bug in the order and shift amount for last-use bits on `GenTreeLclVar`
- Some additional cleanup and preparatory changes

4 years agoEnable basic generation of ngen pdb from composite image (#36311)
David Wrighton [Fri, 15 May 2020 19:31:27 +0000 (12:31 -0700)]
Enable basic generation of ngen pdb from composite image (#36311)

* Enable basic generation of ngen pdb from composite image
- Port non-line number handling portion of ngen pdb from crossgen to r2rdump
  - This pdb generation logic may be used for both composite and non-composite R2R images
  - Only pdb generation is supported. Perfmap generation for unix is not supported
  - pdb generation is only supported on Windows x86 and amd64 platforms. Diasymreader is not supported on other systems
  - Pdb generation does not generation symbols with the same names as crossgen. Instead it uses the name generator from r2rdump. For current needs this should be sufficient
- Update composite file format so that pdb generation process will work. Major difference is that a CorHeader is always produced for composite images now. This CorHeader is not used by the runtime, but is required for DiaSymReader to generate an ngen pdb.

4 years agoDisable MemoryCacheTest.Trim in arm64 and enable Runtime.Caching tests on Unix (...
Santiago Fernandez Madero [Fri, 15 May 2020 19:26:51 +0000 (12:26 -0700)]
Disable MemoryCacheTest.Trim in arm64 and enable Runtime.Caching tests on Unix (#36494)

4 years ago[master] Update dependencies from mono/linker Microsoft/vstest dotnet/xharness (...
dotnet-maestro[bot] [Fri, 15 May 2020 19:12:55 +0000 (19:12 +0000)]
[master] Update dependencies from mono/linker Microsoft/vstest dotnet/xharness (#36525)

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

Microsoft.NET.ILLink.Tasks
 From Version 5.0.0-preview.3.20264.1 -> To Version 5.0.0-preview.3.20265.1

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

Microsoft.NET.Test.Sdk
 From Version 16.7.0-preview-20200429-01 -> To Version 16.7.0-preview-20200515-01

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

Microsoft.DotNet.XHarness.Tests.Runners
 From Version 1.0.0-prerelease.20264.9 -> To Version 1.0.0-prerelease.20265.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
4 years agoAdd comment to NetworkStream's ctor about socket.Blocking check (#36539)
Stephen Toub [Fri, 15 May 2020 19:06:34 +0000 (15:06 -0400)]
Add comment to NetworkStream's ctor about socket.Blocking check (#36539)

4 years agoMove mobile AppBuilder & AOTCompiler projects into tools-local (#36478)
Steve Pfister [Fri, 15 May 2020 17:36:11 +0000 (13:36 -0400)]
Move mobile AppBuilder & AOTCompiler projects into tools-local (#36478)

Moving the projects will make sure their artifacts are always available to the different CI legs.

4 years agoMerge pull request #36347 from NikolaMilosavljevic/burn.ui
Nikola Milosavljevic [Fri, 15 May 2020 15:55:28 +0000 (08:55 -0700)]
Merge pull request #36347 from NikolaMilosavljevic/burn.ui

UI changes for .NET 5

4 years agoConvert Extract(0) to ToScalar() (#36474)
Kunal Pathak [Fri, 15 May 2020 15:48:59 +0000 (08:48 -0700)]
Convert Extract(0) to ToScalar() (#36474)

* Convert Extract(0) to ToScalar()
* Update the shim

4 years agoClean up text in config.yml issue template (#36529)
Stephen Toub [Fri, 15 May 2020 14:48:15 +0000 (10:48 -0400)]
Clean up text in config.yml issue template (#36529)

4 years agoIgnore .github folder changes in CI (#36530)
Viktor Hofer [Fri, 15 May 2020 14:45:36 +0000 (16:45 +0200)]
Ignore .github folder changes in CI (#36530)

4 years agoRename 'Blank' issue template to 'Blank issue' (#36533)
Eirik Tsarpalis [Fri, 15 May 2020 14:29:56 +0000 (15:29 +0100)]
Rename 'Blank' issue template to 'Blank issue' (#36533)

* Update and rename 04_blank.md to 04_blank_issue.md

* Use consistent casing

4 years agoConsolidate NetCoreAppCurrent properties (#35953)
Viktor Hofer [Fri, 15 May 2020 14:03:20 +0000 (16:03 +0200)]
Consolidate NetCoreAppCurrent properties (#35953)

4 years agoUpdate 02_api_proposal.md
Stephen Toub [Fri, 15 May 2020 13:56:50 +0000 (09:56 -0400)]
Update 02_api_proposal.md

4 years agoUpdate 02_api_proposal.md
Stephen Toub [Fri, 15 May 2020 13:55:59 +0000 (09:55 -0400)]
Update 02_api_proposal.md

4 years agoorder issue template files (#36524)
Eirik Tsarpalis [Fri, 15 May 2020 13:51:05 +0000 (14:51 +0100)]
order issue template files (#36524)

4 years agoUpdate XHarness for latest fixes (#36484)
Santiago Fernandez Madero [Fri, 15 May 2020 13:00:19 +0000 (06:00 -0700)]
Update XHarness for latest fixes (#36484)

This includes a couple of fixes in xharness.

4 years ago[docs] How to run tests on iOS and Android (#36297)
Egor Bogatov [Fri, 15 May 2020 12:02:05 +0000 (15:02 +0300)]
[docs] How to run tests on iOS and Android (#36297)

4 years ago[mono] Improve Android OpenSSL temp hack (#36463)
Egor Bogatov [Fri, 15 May 2020 11:48:11 +0000 (14:48 +0300)]
[mono] Improve Android OpenSSL temp hack (#36463)

4 years agoImplement get_own_executable_path for SunOS (#36514)
Adeel Mujahid [Fri, 15 May 2020 09:11:39 +0000 (12:11 +0300)]
Implement get_own_executable_path for SunOS (#36514)

4 years agoRefactor `HasMultiRegRetVal` and `impFixupCallStructReturn`. (#36465)
Sergey Andreenko [Fri, 15 May 2020 09:10:56 +0000 (02:10 -0700)]
Refactor `HasMultiRegRetVal` and `impFixupCallStructReturn`. (#36465)

* Fix target definitions.

They were used in asserts only, no changes.

* Fix failures after a recent HW changes.

* Add a const getter for `ReturnTypeDesc` from a call.

Used to make some new methods const as well.

* Refactor `HasMultiRegRetVal` and `impFixupCallStructReturn`.

Delete an unnecessary nested condition and make checks more straightforward.

* Delete an extra `.` in some dumps.

* Add an additional check that `ReturnTypeDesc` is initialized.

* Remove old `const_cast` around `GetReturnTypeDesc`.

* Replace non-const `GetReturnTypeDesc` with other methods.

* Fix uninitialized `gtSpillFlags, gtOtherRegs, gtReturnTypeDesc` in `fgMorphIntoHelperCall`.

4 years agoImprove Uri.Equals by removing unsafe code (#36444)
Miha Zupan [Fri, 15 May 2020 05:22:09 +0000 (07:22 +0200)]
Improve Uri.Equals by removing unsafe code (#36444)

* Improve Uri.Equals

* Remove not useful and duplicated comments

4 years agoMerge pull request #36424 from layomia/kvp_policy
Layomi Akinrinade [Fri, 15 May 2020 04:12:23 +0000 (00:12 -0400)]
Merge pull request #36424 from layomia/kvp_policy

Honor PropertyNamingPolicy, PropertyNameCaseInsensitive, & Encoder options when (de)serializing KeyValuePair instances

4 years agoFix DAC layout in checked builds (#35542)
Steve MacLean [Fri, 15 May 2020 02:00:10 +0000 (22:00 -0400)]
Fix DAC layout in checked builds (#35542)

4 years agoAdd dotnet cli to runtime test Helix jobs (#35426)
Simon Nattress [Fri, 15 May 2020 01:39:37 +0000 (18:39 -0700)]
Add dotnet cli to runtime test Helix jobs (#35426)

* Currently managed tools such as crossgen2 and XUnit are run against the built runtime which is slow on Debug builds, and can obscure errors when the XUnit test harness fails due to an introduced runtime bug.
* Add `xunit.console.runtimeconfig.dev.json` which allows `xunit.console` to use the repo-local dotnet.cmd on dev boxes and the same version installed on the path in Helix.
* When running crossgen2 during test execution, support both local dev and Helix scenario when deciding which dotnet to run. On Helix, simply use `dotnet` which assumes a compatible dotnet runtime is in the path. Locally, tests are run with `runtest.cmd|sh` which sets `__TestDotNetCmd` to the repo-local dotnet script. This preserves the characteristic that no machine-wide 5.0 dotnet runtime must be installed for the runtime tests.
* Update batch scripting to also use `dotnet.cmd|sh` when running Crossgen2 replacing corerun.exe.
* crossgen2's `runtimes` folder is not getting copied to `CORE_ROOT` which causes the runtime host to abort the launch on the Unix CI VMs since crossgen.deps.json refers to files in that subfolder. Adjust the `CORE_ROOT` pruning in `Directory.Build.targets` to include subfolders for the two tools that need it.
* Improve XUnit test boilerplate. Printing `Exception.Message` doesn't include stack trace. Use `ToString()` instead.
* Import notargets sdk in `helixpublicwitharcade.proj`. It doesn't use the official sdk so `BundledNETCoreAppPackageVersion` wasn't set. Import the `Microsoft.Build.NoTargets` sdk so we can find the bundled runtime package version.

4 years agoAdding the support of reusing machine-wide credentials in the case where the machine...
Jose Perez Rodriguez [Fri, 15 May 2020 01:02:11 +0000 (18:02 -0700)]
Adding the support of reusing machine-wide credentials in the case where the machine is already domain-joined to the LDAP Server. (#36405)

* Adding the support of reusing machine-wide credentials in the case where
the machine is already domain-joined to the LDAP Server.

Co-authored-by: Alexander Chermyanin <flamencist@mail.ru>
* Addressing feedback and adding ldap4net to TPN

Co-authored-by: Alexander Chermyanin <flamencist@mail.ru>
4 years agoMerge remote-tracking branch 'upstream/master' into kvp_policy
Layomi Akinrinade [Fri, 15 May 2020 00:45:19 +0000 (17:45 -0700)]
Merge remote-tracking branch 'upstream/master' into kvp_policy

4 years agoAdd options to ignore default values during serialization (#36322)
Layomi Akinrinade [Fri, 15 May 2020 00:39:08 +0000 (20:39 -0400)]
Add options to ignore default values during serialization (#36322)

* Add options to ignore default values during serialization

* Address review feedback

* Fix typo in test

4 years agoMove mobile test runners to libs.pretest instead of P2P (#36473)
Santiago Fernandez Madero [Thu, 14 May 2020 23:51:48 +0000 (16:51 -0700)]
Move mobile test runners to libs.pretest instead of P2P (#36473)

4 years agoImplement unwrapping a ComWrappers CCW when dumping a stowed exception. (#36360)
Jeremy Koritzinsky [Thu, 14 May 2020 23:27:35 +0000 (16:27 -0700)]
Implement unwrapping a ComWrappers CCW when dumping a stowed exception. (#36360)

4 years agoAdd issue templates (#36431)
Dan Moseley [Thu, 14 May 2020 23:19:16 +0000 (16:19 -0700)]
Add issue templates (#36431)

* more

* commented

* yml

* Add an issue template for API proposals

* Update .github/ISSUE_TEMPLATE/api-proposal.md

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Update .github/ISSUE_TEMPLATE/api-proposal.md

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Update .github/ISSUE_TEMPLATE/api-proposal.md

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* comment out template instructions

* apply consistent naming

* feedback

* add blank

* H2 and H3

Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
4 years agoR2RTest - Partial composite images (#36471)
Simon Nattress [Thu, 14 May 2020 23:18:55 +0000 (16:18 -0700)]
R2RTest - Partial composite images (#36471)

Allow compiling composite R2R images which reference assemblies not in the composite. For example, this would allow compiling a set of application assemblies with references to ASP.NET / Framework. Currently R2RTest treats all references as unrooted inputs for the composite image.

4 years agoRemove unnessary guard against switched property names
Layomi Akinrinade [Thu, 14 May 2020 22:31:53 +0000 (15:31 -0700)]
Remove unnessary guard against switched property names

4 years agoIssue 36212: Remove space in parameter name (#36439)
Shimmy [Thu, 14 May 2020 21:53:25 +0000 (00:53 +0300)]
Issue 36212: Remove space in parameter name (#36439)

* Issue 36212: Remove space in parameter name

* Update src/coreclr/src/vm/comutilnative.cpp

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
4 years agoNext round of Struct Improvements (#36146)
Carol Eidt [Thu, 14 May 2020 21:49:33 +0000 (14:49 -0700)]
Next round of Struct Improvements (#36146)

- Allow accessing a SIMD12 as 16 bytes if it's the single field of a parent struct of 16 bytes.
- On x64/ux don't copy an argument just because it is promoted; the copy would force it to memory anyway.
- Use block init for a promoted struct that's been marked lvDoNotEnregister.
- Allow field-by-field copy of structs with the same fields

4 years agoOptimize ToScalar() and GetElement() to use arm64 intrinsic (#36156)
Kunal Pathak [Thu, 14 May 2020 21:06:45 +0000 (14:06 -0700)]
Optimize ToScalar() and GetElement() to use arm64 intrinsic (#36156)

* ARM64 intrisic for ToScalar() and GetElement()

* Fixed GetElement to just operate on constants

* Fix bug in rationalize for Vector64<long>

* fix NotSupported issue for GetElement and ToScalar

* Reuse the baseType/retType in impSpecialIntrinsic and impBaseIntrinsic

* Update comment

* fix breaks

* add comments

* ran jit-format

* Refactored to move common logic inside isSupportedBaseType

* review comments

* reuse simdSize

* formatting

* one missing formatting

4 years agoReplace System.Native call in Interop.Errors.cs
Krzysztof Wicher [Thu, 14 May 2020 21:00:32 +0000 (14:00 -0700)]
Replace System.Native call in Interop.Errors.cs

4 years agoStartup optimization w.r.t. manifest access in composite mode (#36446)
Tomáš Rylek [Thu, 14 May 2020 20:19:08 +0000 (22:19 +0200)]
Startup optimization w.r.t. manifest access in composite mode (#36446)

During my work on fixing runtime crashes in composite build
with large version bubble enabled I noticed room for startup
perf improvement and a very slight working set optimization:

For component assemblies of a composite image, we can basically
share the cache of those manifest assembly references that
have already been resolved (GetNativeMetadataAssemblyRefFromCache)
within the native image because that is the logical owner
of the manifest metadata.

In the "asymptotic" case of composite images with many
components, the pre-existing behavior was basically
a quadratic O(n^2) algorithm in the number of component
assemblies. This change reduces it to linear in the sense
that all assembly references from the composite image get
resolved only once.

Thanks

Tomas

4 years ago[Mono] Don't set thread name of main thread on Linux (#36116)
Aleksey Kliger (λgeek) [Thu, 14 May 2020 19:57:32 +0000 (15:57 -0400)]
[Mono] Don't set thread name of main thread on Linux (#36116)

* [mono] Record MonoNativeThreadId of the main thread

We would like to know the MonoNativeThreadId (pthread_t on Linux) of the main
thread of the application.  We can identify the main thread (on linux) because
it is the one for which `gettid () == getpid ()`.  (`gettid()` returns a
`pid_t` which is not the same thing as a `pthread_t`, hence this roundabout way
of detecting it.)

A complication arises in embedding scenarios: the main thread is not
necessarily the one that calls `mono_jit_init` or otherwise interacts with the
runtime.  Therefore we do the `gettid() == getpid ()` test at `MonoThreadInfo`
creation time when we call `register_thread`.

If the main thread never interacts with Mono, the main thread is not known to
us.

* [mono] Don't set name of main thread on Linux

Setting the name of the main thread also changes the name of the process.

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

The corresponding fix for CoreCLR is https://github.com/dotnet/runtime/pull/34064

* Re-enable test from https://github.com/dotnet/runtime/pull/34064

4 years agoMake depproj intermediate output paths unique again (#36451)
Viktor Hofer [Thu, 14 May 2020 18:50:17 +0000 (20:50 +0200)]
Make depproj intermediate output paths unique again (#36451)

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

Depprojs depend on IntermediateOutputPath being set in a props file early enough as restore is happening per configuration. Even though it isn't recommended that the TargetFramework property is read before the project is loaded, we currently encode the TargetFramework in the IntermediateOutputPath for depproj files. The long-term fix is to get rid of per configuration restores by getting rid of our depproj files.

4 years agoUpdate Linux docker instructions (#36370)
Simon Nattress [Thu, 14 May 2020 18:12:30 +0000 (11:12 -0700)]
Update Linux docker instructions (#36370)

* Update linux-instructions.md to use root build.sh