platform/upstream/dotnet/runtime.git
3 years agoUpdate mono workload id and version to match the workload spec (#52468)
Steve Pfister [Mon, 10 May 2021 23:54:40 +0000 (19:54 -0400)]
Update mono workload id and version to match the workload spec (#52468)

The id of the package we produce will be Microsoft.NET.Workload.Mono.ToolChain.Manifest-<sdk-band>

3 years agoFold "cmp & 1" to "cmp" (#52524)
Egor Bogatov [Mon, 10 May 2021 22:29:23 +0000 (01:29 +0300)]
Fold "cmp & 1" to "cmp" (#52524)

3 years agoInclude register selection heuristics in "Allocating Registers" table (#52513)
Kunal Pathak [Mon, 10 May 2021 21:46:11 +0000 (03:16 +0530)]
Include register selection heuristics in "Allocating Registers" table (#52513)

* Print Heuristic used to allocate register in table

* some more fixes to heuristics

* Fixed all problems

* Better formatting

* cleanup

* Rename RegSel_ to STAT_

3 years agochange if order to improve FileStream perf for cases when both buffers are of the...
Adam Sitnik [Mon, 10 May 2021 21:32:58 +0000 (23:32 +0200)]
change if order to improve FileStream perf for cases when both buffers are of the same size (#51489)

* change if order to improve the perf for case where buffer.Length == _bufferSize

* add comment that explains what we are doing and why

* apply the optimization to ReadAsync as well

3 years agoIntroduce the preview feature attribute (#52419)
Prashanth Govindarajan [Mon, 10 May 2021 20:52:35 +0000 (13:52 -0700)]
Introduce the preview feature attribute (#52419)

* Introduce RequiresPreviewFeaturesAttribute

* Address comments and add a unit test

* Include Delegate and Interface

Address comments

3 years agoRemove JitBench (#52400)
Koundinya Veluri [Mon, 10 May 2021 20:48:05 +0000 (13:48 -0700)]
Remove JitBench (#52400)

It has been broken since a couple of years. The one from the `coreclr` repo still works to some degree if it is needed.

3 years agoNSAutoreleasePool instance should be added to all threads. (#52023)
Aaron Robinson [Mon, 10 May 2021 20:31:39 +0000 (13:31 -0700)]
NSAutoreleasePool instance should be added to all threads. (#52023)

Add an NSAutoreleasePool to all managed create threads including the Main and Finalizer.

This expands the current support where support was only added to ThreadPool threads.

New feature switch was created and the ThreadPool one was removed.
 - System.Threading.Thread.EnableAutoreleasePool

Updated AutoReleaseTest for the new scenarios.

3 years agoUpdate dependencies from https://github.com/dotnet/emsdk build 20210426.1 (#52547)
dotnet-maestro[bot] [Mon, 10 May 2021 20:21:52 +0000 (20:21 +0000)]
Update dependencies from https://github.com/dotnet/emsdk build 20210426.1 (#52547)

[main] Update dependencies from dotnet/emsdk

3 years agoCrossgen2 pipeline optimize (#51154)
t-mustafin [Mon, 10 May 2021 19:43:32 +0000 (22:43 +0300)]
Crossgen2 pipeline optimize (#51154)

* Initial implementation of crossgen2 pipeline mode

- Add --out-near-input option, which adds .ni. suffix to input filepath
  and stores resulting ni.dll near original dll. In this mode --out option can be skipped.
- Add --single-file-compilation mode, which allows to compile all input files separately.

* [crossgen2] Optimize pipeline mode

Load input and reference modules only once by crossgen2 start.

Signed-off-by: Timur Mustafin <t.mustafin@partner.samsung.com>
* Feedback: make typeSystemContext with opened files

Construct new typeSystemContext with already opened PEReaders and PDBReaders.

Signed-off-by: Timur Mustafin <t.mustafin@partner.samsung.com>
Co-authored-by: Gleb Balykov <g.balykov@samsung.com>
3 years agoRemove the HTTP2 and HTTP3 implementations on browser-wasm. (#52420)
Eric Erhardt [Mon, 10 May 2021 19:00:48 +0000 (14:00 -0500)]
Remove the HTTP2 and HTTP3 implementations on browser-wasm. (#52420)

* Remove the HTTP2 and HTTP3 implementations on browser-wasm.

This allows for HPackEncoder and QPackEncoder to be trimmed in browser wasm.

Contributes to #44534

3 years ago[System.Runtime.Loader] Add hot reload test infrastructure (#51144)
Aleksey Kliger (λgeek) [Mon, 10 May 2021 18:58:06 +0000 (14:58 -0400)]
[System.Runtime.Loader] Add hot reload test infrastructure  (#51144)

Adding infrastructure for hot reload testing.

For each test we define a new library assembly project.  The `.csproj` has a `DeltaScript` property that specifies a JSON file that lists the name of an initial source file, and a list of updated versions of that file.  The https://github.com/dotnet/hotreload-utils Microsoft.DotNet.HotReload.Utils.Generator.BuildTool nuget .targets file will run a generator tool during the build to read the delta script and creates metadata, IL and PDB deltas that incorporate the updates.

The main testsuite references all the test assemblies, and when a test runs, it calls `ApplyUpdateUtil.ApplyUpdate` to load subsequent deltas and then compares the results before and after an update.

Dependencies:

- https://github.com/dotnet/hotreload-utils  - there is now a `Microsoft.DotNet.HotReload.Utils.Generator.BuildTool` MSBuild targets nupkg on the `dotnet6-transport` nuget feed.
- If `DOTNET_MODIFIABLE_ASSEMBLIES` is not set in the environment, we use remote executor to run the tests.

Mono is technically enabled, but practically it's not running anywhere:
- We have not enabled the MonoMetadataUpdate feature support on desktop linux or macos
- For wasm, ios and Android since we don't have remote executor support, we would need to adjust the test pipelines to pass the `DOTNET_MODIFIABLE_ASSEMBLIES` flag via xharness (and the app builder tasks).
- For ios and Android we would need to enable the interpreter as the execution engine, otherwise the tests are skipped.

To try it out locally with CoreCLR run:

```
./dotnet.sh build src/libraries/System.Runtime.Loader/tests /t:Test
```

For mono, build the runtime with `/p:MonoMetadataUpdate=true` and setenv `MONO_ENV_OPTIONS=--interp`

---

* [System.Runtime.Loader] Add hot reload test infrastructure

   Adding infrastructure for hot reload testing.

* Make a proper task for computing hotreload-delta-gen output files

* Don't need DeltaCount property, compute from json

   Compute the number of deltas that hotreload-delta-gen will produce by parsing the json script and counting the number of changes.

* Add dependency on hotreload-delta-gen tool

* use 'dotnet tool run hotreload-delta-gen' to generate EnC deltas

* Use remote executor if DOTNET_MODIFIABLE_ASSEMBLIES is not set

* Use DotNetTool property to run hotreload-delta-gen

   just `dotnet tool run hotreload-delta-gen` can fail on 6.0 preview 2 because of borked argument parsing

* Don't run on Mono for now

   1. mobile devices and wasm will need xharness or the app builder tasks to set the DOTNET_MODIFIABLE_ASSEMBLIES environment variable.
   2. for console apps, we need the hot reload capabilities API to check if the current runtime can do updates

* bump hotreload-delta-gen package version

* Run tests on Mono if feature enabled and interp is used

* fix remote executor detection

   just calling RemoteExecutor.IsSupported on wasm throws

   ```
   System.TypeInitializationException: The type initializer for 'Microsoft.DotNet.RemoteExecutor.RemoteExecutor' threw
an exception.
   ---> System.PlatformNotSupportedException: System.Diagnostics.Process is not supported on this platform.
   ```

* remove unneeded DefineConstants

* Use `$(TargetPath)` as input to ComputeDeltaOutputNames

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
* drop "BuildingProject" property check

   It's for the old project style, only

* Use Microsoft.DotNet.HotReload.Utils.Generator.BuildTool instead of hotreload-delta-gen

   Use an msbuild target nuget instead of the CLI tool

* Use well known version for Generator BuiltTool version

* Use published Generator.BuildTool package

* fix typos, indentantion; add copyright headers

* Remove ComputeDeltaFileOutputNames use nuget version

   The Microsoft.DotNet.HotReload.Utils.Generator.BuildTool nuget now includes a task to compute the output names.  So the targets in the nuget are entirely self-contained now - incremental builds and project references should work now.

   Bump to version 1.0.1 of Generator.BuildTool which has the necessary targets

* Fix style nits; add more copyright headers

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
3 years agoFix binlog names and paths for clr managed assets (#52341)
Juan Hoyos [Mon, 10 May 2021 18:39:41 +0000 (11:39 -0700)]
Fix binlog names and paths for clr managed assets (#52341)

3 years ago[mono] Add monovm_initialize_preparsed for Android (#52304)
Ryan Lucia [Mon, 10 May 2021 18:35:09 +0000 (14:35 -0400)]
[mono] Add monovm_initialize_preparsed for Android (#52304)

* [mono] Add monovm_initialize_preparsed for Android

Naming on the new structs TBD

* Fixes

3 years ago[mono][llvm] Remove most uses of SIMD_OP_, use the corresponding INTRINS_ enumeration...
Zoltan Varga [Mon, 10 May 2021 17:32:42 +0000 (13:32 -0400)]
[mono][llvm] Remove most uses of SIMD_OP_, use the corresponding INTRINS_ enumeration values instead. (#52538)

The ARM64 enums still need to be removed.

3 years agoImprove logging in src/tasks/Common/Utils.cs (#52545)
Alexander Köplinger [Mon, 10 May 2021 17:26:33 +0000 (19:26 +0200)]
Improve logging in src/tasks/Common/Utils.cs (#52545)

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

3 years ago[tasks] Rename MonoAOTCompiler AotInterp option to LLVMOnlyInterp; add FullInterp...
Aleksey Kliger (λgeek) [Mon, 10 May 2021 16:18:05 +0000 (12:18 -0400)]
[tasks] Rename MonoAOTCompiler AotInterp option to LLVMOnlyInterp; add FullInterp (#52209)

* [tasks] Rename MonoAOTCompiler AotInterp mode to LLVMOnlyInterp

   iOS supports a "FullAOT+Interp" mode using Mono's using the mini FullAOT plus interpreter fallback.

   So rename "AotInterp" (ambiguous) to LLVMOnlyInterp which is what Wasm is using

* [tasks] Describe "interp" modes in MonoAOTCompiler task

* [tasks] Add FullInterp Mode to MonoAOTCompiler

   It means we should use FullAOT compilation, but include the necessary code to allow the runtime to fallback to the interpreter if AOT compilation is not supported for some method.

3 years agoAdd ReadAtLeastAsync implementation for StreamPipeReader (#52246)
Emmanuel André [Mon, 10 May 2021 16:09:27 +0000 (18:09 +0200)]
Add ReadAtLeastAsync implementation for StreamPipeReader (#52246)

-  Increase segment size based on minimumSize
- Use MaxBufferSize from custom memory pool
- Align segment allocation logic on Pipe one
- Group ReadAtLeastAsync tests

3 years agoEnable loc build (#52479)
Eric StJohn [Mon, 10 May 2021 15:39:04 +0000 (08:39 -0700)]
Enable loc build (#52479)

* Add localization step to official build

* Add package to loc build

3 years ago[Android][libraries] Skip failing Android tests with ActiveIssues and proj level...
Mitchell Hwang [Mon, 10 May 2021 15:16:38 +0000 (11:16 -0400)]
[Android][libraries] Skip failing Android tests with ActiveIssues and proj level skips (#50800)

* [Android][libraries] Update test suites skipped

* [Android][libraries] Add System.Globalization.Tests ActiveIssues 36672

* [Android][libraries] Add System.IO.Compression.Tests ActiveIssues 36845

* [Android][libraries] Add System.Text.RegularExpressions ActiveIssues 36848

* [Android][libraries] Add System.Diagnostics.DiagnosticSource.Switches.Tests ActiveIssues 37073

* [Android][libraries] Add System.Net.Requests.Tests ActiveIssues 37087

* [Android][libraries] Add System.Runtime.Tests test proj skip 37088

* [Android][libraries] Add System.Runtime.Numerics.Tests ActiveIssues 37093

* [Android][libraries] Add System.Security.Cryptography.Pkcs.Tests test proj skip 37094

* [Android][libraries] Add System.Console.Tests Active Issues 37465

* [Android][libraries] Consolidate System.Runtime.Extensions.Tests ActiveIssues into 49868

* [Android][libraries] Add System.Threading.Tasks.Parallel.Tests ActiveIssue 50566

* [Android][libraries] Add System.Net.NetworkInformation.Functional.Tests ActiveIssues 50567

* [Android][libraries] Add System.Net.Sockets.Tests ActiveIssues 50568

* [Android][libraries] Add System.Diagnostics.Debug.Tests ActiveIssues 50570

* [Android][libraries] Add Microsoft.VisualBasic.Core.Tests ActiveIssues 50572

* [Android][libraries] Add System.Text.Encoding.Tests ActiveIssues 50573

* [Android][libraries] Add System.Net.Ping.Functional.Tests ActiveIssues 50574

* [Android][libraries] Add Microsoft.Extensions.Logging.Console.Tests ActiveIssues 50575

* [Android][libraries] Add System.Collections.Concurrent.Tests ActiveIssues 50576

* [Android][libraries] Add System.Threading.Thread.Tests ActiveIssues 50577

* [Android][libraries] Rename System.Collections.Immutable.Tests ActiveIssues 50579

* [Android][libraries] Rename System.Security.Cryptography.Csp.Tests ActiveIssues 50580

* [Android][libraries] Remove test level skips that are now test specific skips

* [Android][libraries] Remove closed ActiveIssues

* [Android][libraries] Add more crashing test suites to be skipped

* [Android][libraries] Add Microsoft.Extensions.Configuration.Functional.Tests ActiveIssue 50866

* [Android][libraries] Add Microsoft.Extensions.Configuration.Ini.Tests ActiveIssue 50867

* [Android][libraries] Add Microsoft.Extensions.Configuration.Json.Tests ActiveIssue 50868

* [Android][libraries] Add Microsoft.Extensions.Configuration.Xml.Tests ActiveIssue 50870

* [Android][libraries] Add Microsoft.Extensions.DependencyInjection.Tests test proj skip

* [Android][libraries] Add Microsoft.Extensions.DependencyModel.Tests ActiveIssue 50872

* [Android][libraries] Add Microsoft.Extensions.Http.Tests ActiveIssue 50873

* [Android][libraries] Add Microsoft.Extensions.Logging.EventSource.Tests test proj skip

* [Android][libraries] Add Microsoft.Extensions.Logging.Tests ActiveIssues 50875

* [Android][libraries] Add Microsoft.Extensions.Options.Tests ActiveIssues 50877

* [Android][libraries] Add Microsoft.Extensions.Primitives.Tests ActiveIssues 50878

* [Android][libraries] Add System.CodeDom.Tests ActiveIssues 50879

* [Android][libraries] Add System.Collections.Immutable.Tests ActiveIssues 50579

* [Android][libraries] Add System.Collections.NonGeneric.Tests ActiveIssues 37069

* [Android][libraries] Add System.Collections.Tests test proj skip

* [Android][libraries] Add System.ComponentModel.Primitives.Tests ActiveIssues 50881

* [Android][libraries] Add System.ComponentModel.Annotations.Tests ActiveIssues 50882

* [Android][libraries] Add System.ComponentModel.TypeConverter.Tests test proj skip

* [Android][libraries] Add System.Composition.Hosting.Tests ActiveIssues 50917

* [Android][libraries] Add System.Composition.Runtime.Tests ActiveIssues 50918

* [Android][libraries] Add System.Composition.Tests ActiveIssues 50919

* [Android][libraries] Add System.Data.Common.Tests test proj skip

* [Android][libraries] Add System.Diagnostics.DiagnosticSource.Tests ActiveIssue 50924

* [Android][libraries] Add System.Diganostics.TextWriterTraceListener.Tests ActiveIssue 50925

* [Android][libraries] Add System.Diagnostics.Tracing.Tests test proj skip

* [Android][libraries] Add System.IO.Pipelines.Tests ActiveIssue 50927

* [Android][libraries] Add System.Linq.Expressions.Tests ActiveIssue 37474

* [Android][libraries] Add System.Net.NameResolution.Functional.Tests ActiveIssue 50928

* [Android][libraries] Add System.Net.Primitives.Functional.Tests ActiveIssue 50571

* [Android][libraries] Add System.Net.Requests.Tests ActiveIssue 37087

* [Android][libraries] Add System.ObjectModel.Tests ActiveIssue 50933

* [Android][libraries] Add System.Resources.Extensions.Tests ActiveIssue 50934

* [Android][libraries] Add System.Resources.ResourceManager.Tests ActiveIssue 50935

* [Android][libraries] Add System.Runtime.Serialization.Primitives.Tests ActiveIssue 50936

* [Android][libraries] Add System.Security.Cryptography.X509Certificates.Tests ActiveIssue 50937

* [Android][libraries] Add System.Text.Json.Tests test proj skip

* [Android][libraries] Add System.Text.RegularExpressions.Tests ActiveIssues 50942

* [Android][libraries] Add System.Threading.Channels.Tests ActiveIssues 50943

* [Android][libraries] Add System.Xml.Linq.xNodeBuilder.Tests ActiveIssues 50944

* [Android][libraries] Add System.Xml.XmlSchema.XmlSchemaValidatorApi.Tests test proj skip

* [Android][libraries] Add System.Xml.XmlSchemaSet.Tests test proj skip

* [Android][libraries] Add System.Xml.Xsl.XslCompiledTransformApi.Tests test proj skip

* [Android][libraries] Add System.Xml.Xsl.XslTransformApi.Tests test proj skip

* [Android][libraries] Add System.Net.Sockets ActiveIssue EventSource 50568

* [Android][libraries] Add System.Net.Mail.Functional.Tests ActiveIssue  50999

* [Android][libraries] Clean up Android test architecture specific skips

* [Android][libraries] Add more test suite skips

* [Android][libraries] Skip test suites failing with PlatformNotSupportedException related failures

* [Android][libraries] Add more suites that have execution compromised

* [Android] Add new Microsoft.Extensions.Configuration.FileExtensions.Tests active issue

* [Android] Add new Microsoft.Extensions.Configuration.Ini.Tests active issue

* [Android] Add new Microsoft.Extensions.Configuration.Json.Tests active issue

* [Android] Add new Microsoft.Extensions.Configuration.Xml.Tests active issue

* [Android] Add new Microsoft.Extensions.Http.Tests active issue

* [Android] Fix System.Text.Json.Tests project path skip

Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
3 years agoMark HostFactoryResolver againa as source package (#52541)
Viktor Hofer [Mon, 10 May 2021 15:12:43 +0000 (17:12 +0200)]
Mark HostFactoryResolver againa as source package (#52541)

During the migration from pkgproj to csproj, the `<IsSourcePackage />` declaration was lost. Setting this again to auto-generate the expected build target.

3 years agoStop trying to estimate IL sizes (#52516)
David Fowler [Mon, 10 May 2021 14:26:18 +0000 (07:26 -0700)]
Stop trying to estimate IL sizes (#52516)

- We originally did this to reduce the amount of resizes when generating IL for huge method bodies but now that we don't inline the transitive closure of scoped dependencies, we can just estimate a modest size that avoids *most* resizes (512).
- The current ILEmitCallsiteAnalyzer doesn't keep track of visited callsites so can over estimate the size. Instread of fixing it, just delete it.

3 years agoAnnotate System.Diagnostics.Process.MaxWorkingSet/MinWorkingSet props as unsupported...
Maxim Lipnin [Mon, 10 May 2021 12:05:40 +0000 (15:05 +0300)]
Annotate System.Diagnostics.Process.MaxWorkingSet/MinWorkingSet props as unsupported on iOS/tvOS (#52395)

3 years agoAdds synchronous span APIs for datagram sockets. (#51956)
Pieter-Jan Briers [Mon, 10 May 2021 10:12:04 +0000 (12:12 +0200)]
Adds synchronous span APIs for datagram sockets. (#51956)

* Adds synchronous span APIs for datagram sockets.

Part of #33418/#938

* Doc comments for new APIs.

* Fix review nits.

* Add 0-byte send tests.

3 years ago[json tests] Fix CRLF vs LF issues (#52142)
Radek Doulik [Mon, 10 May 2021 09:31:07 +0000 (11:31 +0200)]
[json tests] Fix CRLF vs LF issues (#52142)

Context: https://github.com/dotnet/runtime/issues/52106

When running `System.Text.Json.Tests` on windows targeting `Browser`,
the line ending differs between host and target systems. Compensate for
that by using `Assert.Equal(..., ignoreLineEndingDifferences: true)`.

The `Browser` Environment.NewLine is `\n`, while windows use `\r\n`.
https://github.com/dotnet/runtime/blob/5bd0edfe860e41bdfd690d3743e730594307292e/src/libraries/System.Private.CoreLib/src/System/Environment.UnixOrBrowser.cs#L51

3 years ago[wasm] Add new simple benchmark sample (#51559)
Radek Doulik [Mon, 10 May 2021 09:08:35 +0000 (11:08 +0200)]
[wasm] Add new simple benchmark sample (#51559)

The sample can be used for quick benchmarking when working
on performance improvements.

It runs the measurements per approximate time (default 5 seconds) and
reports number of runs and time per call.

At the end of run, output summary with lowest times per call and also
`.md` table to make it easier to put resutls to github comments.

So far it contains Json [de]serialization I was using recently.
The Person class comes from Blazor benchmark.

Example `.md` output:

   | measurement | time |
   |-:|-:|
   |             Exceptions, TryCatch |     0.0107us |
   |        Exceptions, TryCatchThrow |     0.0064ms |
   |       Exceptions, TryCatchFilter |     0.1136us |
   |   Json, non-ASCII text serialize |     1.2292ms |
   | Json, non-ASCII text deserialize |     5.2554ms |
   |            Json, small serialize |     0.1928ms |
   |          Json, small deserialize |     0.2262ms |
   |            Json, large serialize |    51.0495ms |
   |          Json, large deserialize |    60.6860ms |

3 years agoFixed Broken Links in Documentation (#50653)
Mira Antolovich [Mon, 10 May 2021 08:09:08 +0000 (04:09 -0400)]
Fixed Broken Links in Documentation (#50653)

Co-authored-by: Youssef Victor <youssefvictor00@gmail.com>
Co-authored-by: Marek Safar <marek.safar@gmail.com>
3 years agoMono EventPipe fixes. (#52437)
Johan Lorensson [Mon, 10 May 2021 06:43:23 +0000 (08:43 +0200)]
Mono EventPipe fixes. (#52437)

Correct conversion of COMPlus_EventPipeCircularMB value.

CoreClr detach/shutdown is flagged much later than Mono, meaning
Mono won't run function in ep_shutdown. Since EventPipe won't
out live runtime and already runs and shutdown as integrated part
of Mono shutdown, this will always be FALSE on Mono.

Thread sleep needs to enter/exit GC safe or it will block STW, delaying
operations like sample profiler and GC.

3 years agoImprove loop cloning throughput (#52491)
Bruce Forstall [Mon, 10 May 2021 04:51:47 +0000 (21:51 -0700)]
Improve loop cloning throughput (#52491)

1. Cloning was rebuilding reachability and dominators after every
cloned loop. This is unnecessary; only rebuild it once, after all
the loops in the function are cloned.
2. Early out if we don't detect any clonable loops.

No asm diffs

3 years agoAllow build with VS2022 installed (#52487)
Brennan [Mon, 10 May 2021 03:45:19 +0000 (20:45 -0700)]
Allow build with VS2022 installed (#52487)

3 years agoJIT: extend VN to understand method table fetch from newobj (#52476)
Andy Ayers [Sun, 9 May 2021 21:53:40 +0000 (14:53 -0700)]
JIT: extend VN to understand method table fetch from newobj (#52476)

If we see a GT_IND whose base is JitNew, the value number of the IND
is the same as the value number of the class handle for the new.

Partial fix for #52370.

3 years agoTask/use get last p invoke error (#52212)
Kareem Zedan [Sun, 9 May 2021 19:42:21 +0000 (20:42 +0100)]
Task/use get last p invoke error (#52212)

* replacing GetLastWin32Error with GetLastPInvokeError in remaining assemblies

* replace GetLastWin32Error with GetLastPInvokeError in assemblies outside system.private.corelib

* Apply suggestions from code review

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
3 years agoBigInteger parsing optimizations (#47842)
Joseph Da Silva [Sun, 9 May 2021 06:33:05 +0000 (23:33 -0700)]
BigInteger parsing optimizations (#47842)

* Optimize BigInteger parsing

* Use ArrayPool<int> instead of ArrayPool<uint>.

* Additional changes

* Additional changes

3 years agoNow that we dont leak the SequencePosition flags anymore, we dont need to bitmask...
Kuinox [Sun, 9 May 2021 04:01:01 +0000 (06:01 +0200)]
Now that we dont leak the SequencePosition flags anymore, we dont need to bitmask the arguments before processing. (#49921)

3 years ago[mono] Fix runtime invokes to methods returning byref values in llvmonly mode. (...
Zoltan Varga [Sat, 8 May 2021 23:29:44 +0000 (19:29 -0400)]
[mono] Fix runtime invokes to methods returning byref values in llvmonly mode. (#52501)

Fixes some System.Runtime test failures on wasm.

3 years ago[mono] Fix invoking string ctors on wasm in AOT mode. (#52505)
Zoltan Varga [Sat, 8 May 2021 20:15:20 +0000 (16:15 -0400)]
[mono] Fix invoking string ctors on wasm in AOT mode. (#52505)

* [mono] Avoid passing a dummy string to string ctors from runtime invokes, pass NULL instead.

The call will go to a wrapper method which will ignore the 'this' argument anyway.

* [mono] Fix invoking string ctors on wasm in AOT mode.

3 years agoAvoid replacing realized service cache for singletons and promoted singletons (#52484)
David Fowler [Sat, 8 May 2021 19:36:12 +0000 (12:36 -0700)]
Avoid replacing realized service cache for singletons and promoted singletons (#52484)

- Scoped services resolved from the root container are singletons. This fixes a regression that caused the dynamically compiled callsite for scoped service to create new instances for scoped services resolved from root providers.
- Added a test and added an optimized path that does not compile singletons and promoted singletons using the background thread.

3 years agoEnsure DiagnosticSource has correct package ID (#52472)
Eric StJohn [Sat, 8 May 2021 19:21:30 +0000 (12:21 -0700)]
Ensure DiagnosticSource has correct package ID (#52472)

The `AvoidRestoreCycleOnSelfReference` workaround was causing
DiagnosticSource to get the wrong PackageID in the assets file when
referenced by other projects.  This wasn't a problem when using pkgproj
since we'd calculate dependencies from assembly references, ignoring
the assets file.  This is a problem now that we're using csproj pack,
since that gets dependencies from the assets file.

3 years agoFix: FileSystemEntry.Attributes property is not correct on Unix (#52235)
Carlos Sanchez [Sat, 8 May 2021 19:07:03 +0000 (12:07 -0700)]
Fix: FileSystemEntry.Attributes property is not correct on Unix (#52235)

* Hidden and ReadOnly unit tests.

* Unix: Correctly collect ReadOnly and Hidden flags from files and directories.

* Remove the _initialAttributes field from FileStatus. Directly call _status.GetAttributes from FileSYstemEntry.Attributes since the disk hit is necessary anyway.

* Address simplication and nullcheck suggestions

* Defering some more file checking actions to FileStatus. Addressing accessibility of methods/properties. Addressing suggestions.

* Address feedback: Remove unnecessary asserts but document why. Remove struct initialization. Simplify the order in which Initialize checks for unknown and symlink and add a comment.

* Cache egid and euid, and refresh should reset them

* Check IsNameHidden before ensuring cache initialized and checking HasHiddenFlag.

* The ifs inside FileSystemEntry.Initialize has two mutually exclusive conditions: symlink and unknown, so use else if.

* Use entry.IsSymbolicLink directly inside Initialize.

* Remove extra symlink check in FileSystemEnumerator.MoveNext, not needed and could cause unnecessary disk hit.

* Remove unused cache checks.

* Use HasHiddenFlag as expression body

* No need to soft retrieve hidden and read-only in FileSystemEntry.Initialize if in AttributesToSkip we are going to retrieve it anyway with a disk hit. Only in the case of DT_UNKNOWN, we will pre-retrieve the file cache, but we only need it when ShouldSkip is checked, and in that case, we won't have a disk hit.

* Make FileStatus.Initialize inlined in the only place where its called.

* EnsureCacheInitialized bring back order of conditions

* Syntax sugar for nullable egid and euid lazy retrieval

Co-authored-by: carlossanlop <Carlos Sanchez carlossanlop@users.noreply.github.com>
3 years agoEnable tests for MacCatalyst x64 (#51139)
Jo Shields [Sat, 8 May 2021 12:30:58 +0000 (08:30 -0400)]
Enable tests for MacCatalyst x64 (#51139)

3 years agoFix EventPipe shutdown to include last events in session. (#52431)
Johan Lorensson [Sat, 8 May 2021 11:06:49 +0000 (13:06 +0200)]
Fix EventPipe shutdown to include last events in session. (#52431)

Fixing an incorrect state check in write_event, write_event_2 that would
prevent events written during disable in ep_shutdown to be included
in session. Since most sessions already closed out at this point this
case is mainly hit using the default env based file session, but
it will also affect sessions that are running during shutdown since they
wouldn't get their rundown events included in session stream.

This is a regression from C++ -> C port of EventPipe library.

3 years agoFix ber scanf/printf, fix for a reverted PR. (#52178)
Sergey Andreenko [Sat, 8 May 2021 10:19:42 +0000 (03:19 -0700)]
Fix ber scanf/printf, fix for a reverted PR. (#52178)

* Reenable the tests.

* Use __arglist for windows.
Use ber_put_*/ber_get_* for Unix

* Use nuint for Linux.

* review response

3 years ago[main] Update dependencies from mono/linker (#52441)
dotnet-maestro[bot] [Sat, 8 May 2021 06:25:21 +0000 (08:25 +0200)]
[main] Update dependencies from mono/linker (#52441)

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.5.21255.1 -> To Version 6.0.100-preview.5.21257.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
3 years agoImprove flow graph DOT dump: conditional display, block ID (#52489)
Bruce Forstall [Sat, 8 May 2021 05:27:39 +0000 (22:27 -0700)]
Improve flow graph DOT dump: conditional display, block ID (#52489)

1. For conditional blocks, display a small summary of the branch taken path
of the block (namely, the JTRUE condition). This is currently very limited,
but could be expanded to additional cases as it proves useful (but it needs
to be very compact; you're expected to consult the JitDump for more details).
2. Optionally display both the bbNum and bbID as the block label. This makes
it easier to see which blocks remained the same through renames if comparing
flow graph displays from different phases. This is enabled by setting
`COMPlus_JitDumpFgBlockID=1`.

3 years agoUse a more reliable method for polling the PollingCounters. (#52490)
Steve Molloy [Sat, 8 May 2021 03:41:07 +0000 (20:41 -0700)]
Use a more reliable method for polling the PollingCounters. (#52490)

3 years agoMark RNGCryptoServiceProvider as Obsolete (#52373)
Jeff Handley [Sat, 8 May 2021 01:33:52 +0000 (18:33 -0700)]
Mark RNGCryptoServiceProvider as Obsolete (#52373)

* Mark RNGCryptoServiceProvider as Obsolete

* Use the static methods on RandomNumberGenerator instead of Create()

* Use RandomNumberGenerator.GetBytes() instead of RandomNumberGenerator.Create().GetBytes()

* Revert "Use RandomNumberGenerator.GetBytes() instead of RandomNumberGenerator.Create().GetBytes()"

This reverts commit 447f8485a08f831f34d00597a30800ac36f034ef.

* Update src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CurrentUserOnly.Windows.cs

Co-authored-by: Jeremy Barton <jbarton@microsoft.com>
3 years ago[wasm][aot] Disable individual failing tests for System.Diagnostics.{StackTrace,Trace...
Ankit Jain [Sat, 8 May 2021 01:14:11 +0000 (21:14 -0400)]
[wasm][aot] Disable individual failing tests for System.Diagnostics.{StackTrace,TraceSource} (#52478)

3 years agoremove dead interop (#52474)
Dan Moseley [Sat, 8 May 2021 00:40:24 +0000 (17:40 -0700)]
remove dead interop (#52474)

3 years agoTurn on verbose emcc output when rebuilding the runtime in local builds (#52467)
Larry Ewing [Sat, 8 May 2021 00:38:40 +0000 (19:38 -0500)]
Turn on verbose emcc output when rebuilding the runtime in local builds (#52467)

3 years agoImprove struct inits. (#52292)
Sergey Andreenko [Sat, 8 May 2021 00:34:52 +0000 (17:34 -0700)]
Improve struct inits. (#52292)

* Support STORE_LCL_VAR(0) after lowering.

* fix a nice catch from Tanner

3 years agoRemove AOT compiler binaries from all mono runtime packs (#51782)
Steve Pfister [Fri, 7 May 2021 23:53:20 +0000 (19:53 -0400)]
Remove AOT compiler binaries from all mono runtime packs (#51782)

Since we now package AOT compilers separately and include them in the mono workload, there is no longer a need to have them in the mono runtime packs.

You can find the AOT compiler packs in the net6 feed with the following format:

Microsoft.NETCore.App.Runtime.AOT.<host-rid>.Cross.<target-rid>

3 years agoFix over-zeroing of destination buffer with PaddingMode.Zeros
Kevin Jones [Fri, 7 May 2021 22:45:02 +0000 (18:45 -0400)]
Fix over-zeroing of destination buffer with PaddingMode.Zeros

This addresses two issues with how zero padding is handled.

The first is performance. When applying zero padding, we were clearing
the entire destination, then copying the plaintext over it. We were
zeroing more data than required, the only data that needed to be zeroed
is where the zero padding is applied.

The second is in the case of overlapping buffers for the plaintext
and ciphertext. However, this cannot happen currently since we always
ensure the destination buffer does not overlap the input buffer.
If overlapping is permitted in a future change, this would clear the
plaintext, not just where padding is required.

3 years agoJIT: remove crossgen assert when embedding class handle (#52453)
Andy Ayers [Fri, 7 May 2021 22:01:08 +0000 (15:01 -0700)]
JIT: remove crossgen assert when embedding class handle  (#52453)

#52210 requires class handle embedding that crossgen does not support.

Remove an assert as this is now an area where crossgen2 and crossgen diverge.

Resolves #52450.

3 years agoApple Silicon enable R2R CI testing (#52324)
Steve MacLean [Fri, 7 May 2021 21:51:50 +0000 (17:51 -0400)]
Apple Silicon enable R2R CI testing (#52324)

* Apple Silicon crossgen2 & enable R2R CI testing

3 years agoAdd TargetPlatformAttribute to list of removed attributes (#52452)
Marek Safar [Fri, 7 May 2021 21:27:36 +0000 (23:27 +0200)]
Add TargetPlatformAttribute to list of removed attributes (#52452)

3 years agoAdding Infrastructure to run linker on OOB Assemblies by manually calling the Linker...
Jose Perez Rodriguez [Fri, 7 May 2021 20:43:09 +0000 (13:43 -0700)]
Adding Infrastructure to run linker on OOB Assemblies by manually calling the Linker (#52272)

* Adding infrastructure to run the linker on OOB Assemblies manually

* Refactoring to abstract shared infrastructure

* Add OOB ignore list

* Address PR comments

* Rename properties so they don't intentionally get reused

* Addressing PR Feedback

* Addressing PR Feedback

3 years agoPNSE BinaryFormatter on mobile and skip related tests (#52248)
Steve Pfister [Fri, 7 May 2021 20:12:13 +0000 (16:12 -0400)]
PNSE BinaryFormatter on mobile and skip related tests (#52248)

3 years ago[mono] Allocate more memory for wrappers from mem managers if possible. (#52182)
Zoltan Varga [Fri, 7 May 2021 20:08:23 +0000 (16:08 -0400)]
[mono] Allocate more memory for wrappers from mem managers if possible. (#52182)

* Allocate memory for wrappers from mem managers if possible.

Also unify the dynamic and non-dynamic cases a bit.

* Add mono_metadata_signature_dup_mem_manager () helper function.

* Free more wrapper data.

3 years agoFix error where strings were being tracked on IgnoreCycles (#52253)
David Cantú [Fri, 7 May 2021 19:54:29 +0000 (14:54 -0500)]
Fix error where strings were being tracked on IgnoreCycles (#52253)

* Fix error where strings were being tracked on IgnoreCycles

* Fix comments

Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
* Update src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/ReferenceHandlerTests.IgnoreCycles.cs

Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
* Add assertion for IsInternalConverter

* Add tests for types with converter

Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
3 years agoFix mscordbi RPATH to find libmscordaccore.dylib (#51751)
Ilia [Fri, 7 May 2021 19:10:33 +0000 (22:10 +0300)]
Fix mscordbi RPATH to find libmscordaccore.dylib (#51751)

Now LC_RPATH for libmscordbi.dylib on macOS ARM64 is set to @loader_path again.  This commit partly reverts #45978.

Similar to #50932.

3 years agoFix JsonArray issues with empty array and GetPath() (#52339)
Steve Harter [Fri, 7 May 2021 17:16:54 +0000 (12:16 -0500)]
Fix JsonArray issues with empty array and GetPath() (#52339)

3 years agoFix typo in Strings.resx for Cryptography_AlgorithmTypesMustBeVisible (#52430)
Michael Lam [Fri, 7 May 2021 16:51:27 +0000 (17:51 +0100)]
Fix typo in Strings.resx for Cryptography_AlgorithmTypesMustBeVisible (#52430)

3 years agoDisable cache clearing S.CM.TC test from running in parallel (#52428)
Dan Moseley [Fri, 7 May 2021 15:05:51 +0000 (08:05 -0700)]
Disable cache clearing S.CM.TC test from running in parallel (#52428)

3 years ago[wasm][debugger] - RuntimeError: memory access out of bounds (#51859)
Pavel Savara [Fri, 7 May 2021 14:48:49 +0000 (16:48 +0200)]
[wasm][debugger] - RuntimeError: memory access out of bounds (#51859)

- fix null reference in describe_value() + add tests for it
- fix null reference in PDB load
- improved handling of targetCrashed in Inspector
- add windows chrome to probe path
- include debugging payload into test failure exception for easier debugging
- make it possible to compile with WasmBuildNative=true
- make it possible to compile with Debug runtime

3 years agoFixes COM warnings (#52176)
Lakshan Fernando [Fri, 7 May 2021 14:39:16 +0000 (07:39 -0700)]
Fixes COM warnings (#52176)

* Fixes COm warnings

* fb

* feedback

* missed one name change

* Update docs/workflow/trimming/feature-switches.md

Co-authored-by: Elinor Fung <elfung@microsoft.com>
Co-authored-by: Elinor Fung <elfung@microsoft.com>
3 years agoUse unprivileged socket to send ping on macOS/iOS/tvOS/Mac Catalyst (#52240)
Filip Navara [Fri, 7 May 2021 14:05:11 +0000 (16:05 +0200)]
Use unprivileged socket to send ping on macOS/iOS/tvOS/Mac Catalyst (#52240)

Revival of #42006 with some feedback incorporated.

This improves Ping behavior on macOS/iOS family. For unprivileged users, it allows to send/receive buffer with custom content and removes craft around spawning new process. (uses [this example](https://developer.apple.com/library/archive/samplecode/SimplePing/Introduction/Intro.html)).

It adds new macOS/iOS/tvOS targets for the assembly that exclude the process creation code.

Fixes #36941
Fixes #51395

Co-authored-by: Tomas Weinfurt <tweinfurt@yahoo.com>
3 years agoUpdate MetadataUpdateHandlers (#52409)
Pranav K [Fri, 7 May 2021 14:01:15 +0000 (07:01 -0700)]
Update MetadataUpdateHandlers (#52409)

3 years agoMore EventListener overhead reductions (#52092)
Miha Zupan [Fri, 7 May 2021 11:59:31 +0000 (13:59 +0200)]
More EventListener overhead reductions (#52092)

* More EventListener overhead reductions

* Use Type.GetTypeCode instead of RuntimeTypeHandle.GetCorElementType

* Fix int32 enum case

* Revert back from span to array

* DecodeObject => DecodeObjects

3 years agoAdd profiler startup command to the diagnostics command set (#52175)
David Mason [Fri, 7 May 2021 07:51:39 +0000 (00:51 -0700)]
Add profiler startup command to the diagnostics command set (#52175)

Add a diagnostics IPC command to load a startup profiler

3 years agoFix Mono async stackwalk when hitting AOT frames in stacks. (#52309)
Johan Lorensson [Fri, 7 May 2021 07:27:37 +0000 (09:27 +0200)]
Fix Mono async stackwalk when hitting AOT frames in stacks. (#52309)

EventPipe sample profiler on Mono hit a couple of issues doing async stack walks when having AOT frames in stack.

EventPipe background threads (diagnostic server and streaming threads) where not part of sample profiler STW. Include all except threads marked as no GC threads in STW, but don't include threads marked as no sample in sampling.

Aot jit info is cached in a separate list when doing async stackwalks, that list is then not visible through regular jit table meaning that EventPipe session rundown won't include mappings for these IP's. Fix is to detect that a stack walk includes async frames and then (after world as been restarted), registers these IP's in regular JIT table.

Fixed a couple of cases in decode_exception_debug_info that still took runtime locks even when in async mode leading to deadlocks.

Aot jit info cache used in async mode could leak a lot of memory the way its currently grow the list and was only designed to include a small number of jit info structs. Change it into a simple fixed sized hash table with a max bucket size of 32, hash table get allocated on first need and each jit info will be placed into its bucket based on its method id. Running on a full AOT version of S.P.C we have ~30K methods, this will allocate a little under 1000 buckets consuming 8KB of memory on x64. Other alternative would be to alloc full array using amodule->info.nmethods, that would however be much more memory intensive and would consume ~240KB for S.P.C on x64.

3 years agoUse MSVC compiler host architecture defines where applicable. (#52375)
Johan Lorensson [Fri, 7 May 2021 07:26:32 +0000 (09:26 +0200)]
Use MSVC compiler host architecture defines where applicable. (#52375)

Use MSVC compiler host architecture defines where applicable.

There are a couple of places where gcc/clang compiler host architecture
defines are in used, missing compilers like MSVC. Commit adds MSVC host
architecture defines in places where they make sense and can be applied.

NOTE, part of this already worked since it will fallbacks to TARGET_XXX
in a couple of places and currently this is the same as host architecture
on Windows, still adding MSVC host architecture defines for completeness
and future when host != target might differ.

3 years agoFix multiple MonoDebugMethodJitInfo memory leaks. (#52386)
Johan Lorensson [Fri, 7 May 2021 07:26:05 +0000 (09:26 +0200)]
Fix multiple MonoDebugMethodJitInfo memory leaks. (#52386)

3 years agoFix Mono build warnings on Windows. (#52387)
Johan Lorensson [Fri, 7 May 2021 07:25:51 +0000 (09:25 +0200)]
Fix Mono build warnings on Windows. (#52387)

3 years agoReduce loop inversion JitDump output (#52425)
Bruce Forstall [Fri, 7 May 2021 05:40:12 +0000 (22:40 -0700)]
Reduce loop inversion JitDump output (#52425)

If it is guaranteed that no IR changes were made, then return an
appropriate Phase status to suppress end phase IR dumps.

3 years ago Make PInvokeStaticSigInfo always report errors (#52405)
Elinor Fung [Fri, 7 May 2021 03:01:25 +0000 (20:01 -0700)]
 Make PInvokeStaticSigInfo always report errors (#52405)

3 years agoAdd counters to System.Runtime.Caching.MemoryCache (#51760)
Steve Molloy [Fri, 7 May 2021 02:19:00 +0000 (19:19 -0700)]
Add counters to System.Runtime.Caching.MemoryCache (#51760)

* Bring back counters for Core via EventSource et al.

* Change turnover to a rate counter. Add a test for counters.

* Exclude counter tests on wasm.

3 years agoEnhancements to MCS dumpMap (#52412)
Andy Ayers [Fri, 7 May 2021 01:36:53 +0000 (18:36 -0700)]
Enhancements to MCS dumpMap (#52412)

I've been trying to correlate methods in SPMI collections with methods
seen in profile data (say perfview). But for generic classes or generic
methods this is not easy.

To make it more feasible, in the "extra query" mode, get the names of
all the generic parameters, and then add these to the class name in MCS's
dumpMap output.

Also dump out the jit flags, so it's easier to find a particular instance
if the method was jitted more than once.

3 years agoImprove loop inversion (#52347)
Bruce Forstall [Fri, 7 May 2021 01:35:24 +0000 (18:35 -0700)]
Improve loop inversion (#52347)

* Improve loop inversion

When doing loop inversion, we duplicate the condition block to the
top of the loop to create a fall-through zero trip test. Improve
this by redirecting all incoming branches to the condition block
that appear to be coming from outside the potential loop body
to branch to the new duplicated condition block. This improves the
ability of the loop recognizer to find loops, whereas before we
would reject the loops as "multi-entry".

There are good diffs where more loops are detected, leading to
better optimization and more loop alignment. There are also
asm diffs regressions.

* Formatting

* Updates

1. Allow scratch block to be the loop head, since we introduce a
new block to duplicate the condition, so the scratch block becomes
a BBJ_NONE, which is fine.
2. Fix issue on x86 where a catch return, which is a BBJ_ALWAYS on
x86, can't be the "head" block of the loop.

3 years ago[wasm] Normalize WasmAppDir path (#52421)
Ankit Jain [Fri, 7 May 2021 01:27:59 +0000 (21:27 -0400)]
[wasm] Normalize WasmAppDir path (#52421)

3 years agoreturn true for IsDynamicCodeSupported when interpreter is available (#52422)
Larry Ewing [Fri, 7 May 2021 01:10:16 +0000 (20:10 -0500)]
return true for IsDynamicCodeSupported when interpreter is available (#52422)

3 years ago[wasm][aot] Update disabled tests to track new fixes on `main` (#52396)
Ankit Jain [Fri, 7 May 2021 00:39:37 +0000 (20:39 -0400)]
[wasm][aot] Update disabled tests to track new fixes on `main` (#52396)

* [wasm][aot] System.Runtime.Tests failing with a different issue now

The earlier one (https://github.com/dotnet/runtime/issues/51960) was
fixed.
New: https://github.com/dotnet/runtime/issues/52393

* Enable Common.Tests test tracked in https://github.com/dotnet/runtime/issues/50955, already fixed on main

* [wasm] System.Reflection.Tests - update to track change from crash to a

.. test failure.
Issue: https://github.com/dotnet/runtime/issues/51673

* Re-enable System.Collections.Tests, issue: https://github.com/dotnet/runtime/issues/51037

* Disable Microsoft.Extensions.Logging.Generators, and System.IO.Pipelines

Issue: https://github.com/dotnet/runtime/issues/52384
Issue: https://github.com/dotnet/runtime/issues/50959

* Enable two System.Reflection.Metadata* tests

Issue: https://github.com/dotnet/runtime/issues/51958

* Fix path for Microsoft.Extensions.Logging.Generators.Tests

3 years agoFix for hill climbing not working sometimes (#52397)
Koundinya Veluri [Thu, 6 May 2021 23:39:12 +0000 (16:39 -0700)]
Fix for hill climbing not working sometimes (#52397)

Updated the time intervals used in the hill climbing check to be unsigned to prevent wrap-around. This also prevents the check from failing when the current time is negative since the prior and next times are initialized to zero, and matches the previous implementation.

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

3 years agoRemove SSE2-specific logic from UTF-16 validation code (#52349)
Levi Broderick [Thu, 6 May 2021 22:36:31 +0000 (15:36 -0700)]
Remove SSE2-specific logic from UTF-16 validation code (#52349)

If a device does not support SSE41 but does support SIMD hardware acceleration, this method will fall back down generalized Vector-enabled code paths.

3 years agoDo not count page cache towards cgroup’s memory load (#51738)
Marcin Krystianc [Thu, 6 May 2021 22:34:34 +0000 (00:34 +0200)]
Do not count page cache towards cgroup’s memory load (#51738)

* Do not consider file cache pages as used memory

Since file cache pages can be easily evicted and re-used  they should not be considered as used memory.

* free stat_filename

* consider dirty pages

* diff noise

* use memory.stat only

* unix/cgroup.cpp

* diff noise

* use array

* PR remarks

3 years agoReduce unnecessary allocation of SeldomUsedFields in MemoryCache. (#51761)
Steve Molloy [Thu, 6 May 2021 22:23:46 +0000 (15:23 -0700)]
Reduce unnecessary allocation of SeldomUsedFields in MemoryCache. (#51761)

* Don't create SeldomUsedFields for an empty dependency collection.

* comment typo

Co-authored-by: Christopher Watford <christopher.watford@gmail.com>
Co-authored-by: Christopher Watford <christopher.watford@gmail.com>
3 years agoRe-enable some iOS tests (#52385)
Filip Navara [Thu, 6 May 2021 19:25:59 +0000 (21:25 +0200)]
Re-enable some iOS tests (#52385)

* [mobile][testing] Remove AppBundlePath directory to save space on CI

Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
3 years agoAllocate initial regions (#51752)
Andrew Au [Thu, 6 May 2021 19:14:31 +0000 (12:14 -0700)]
Allocate initial regions (#51752)

3 years agoUpdate dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimizati...
dotnet-maestro[bot] [Thu, 6 May 2021 18:55:06 +0000 (20:55 +0200)]
Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20210505.6 (#52338)

optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR
 From Version 1.0.0-prerelease.21228.9 -> To Version 1.0.0-prerelease.21255.6

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
3 years agoArm64: Use zero register where appropriate (#52269)
Kunal Pathak [Thu, 6 May 2021 18:48:34 +0000 (00:18 +0530)]
Arm64: Use zero register where appropriate (#52269)

3 years ago[main] Update dependencies from dotnet/arcade dotnet/xharness (#52382)
dotnet-maestro[bot] [Thu, 6 May 2021 18:34:34 +0000 (18:34 +0000)]
[main] Update dependencies from dotnet/arcade dotnet/xharness (#52382)

[main] Update dependencies from dotnet/arcade dotnet/xharness

3 years agoUse function pointers for interop in System.Net.NetworkInformation (#52192)
Jan Kotas [Thu, 6 May 2021 18:30:01 +0000 (11:30 -0700)]
Use function pointers for interop in System.Net.NetworkInformation (#52192)

3 years ago[main] Update dependencies from mono/linker (#52295)
dotnet-maestro[bot] [Thu, 6 May 2021 18:09:05 +0000 (18:09 +0000)]
[main] Update dependencies from mono/linker (#52295)

[main] Update dependencies from mono/linker

3 years agoObsolete the Rijndael and RijndaelManaged classes
Jeff Handley [Thu, 6 May 2021 16:28:41 +0000 (09:28 -0700)]
Obsolete the Rijndael and RijndaelManaged classes

3 years agoSystem.Data.* missed Equals nullable annotations (#52165)
hrrrrustic [Thu, 6 May 2021 16:08:58 +0000 (19:08 +0300)]
System.Data.* missed Equals nullable annotations  (#52165)

3 years agoSocket.SendFileAsync based on SendPacketsAsync (#52208)
Günther Foidl [Thu, 6 May 2021 15:44:25 +0000 (17:44 +0200)]
Socket.SendFileAsync based on SendPacketsAsync (#52208)

* Socket.SendFileAsync layered on top of SendPacketsAsync

* Tests

* Cleanup

* Set SendPacketsFlags

* Check if the socket is connection orientated

Cf. https://github.com/dotnet/runtime/pull/52208#discussion_r625922176

* Try to re-use the SendPacketsElement-array

Cf. https://github.com/dotnet/runtime/pull/52208#discussion_r625346014

* Fixed test

Cf. https://github.com/dotnet/runtime/pull/52208#discussion_r625316709

* Update src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs

3 years ago[metadata-update] Make a copy of the DIL when applying updates (#52344)
Aleksey Kliger (λgeek) [Thu, 6 May 2021 14:48:40 +0000 (10:48 -0400)]
[metadata-update] Make a copy of the DIL when applying updates (#52344)

Otherwise we may point into memory that is cleaned up by the GC

3 years agoUse MicrosoftDotNet500 cert for executable files (#52336)
Matt Mitchell [Thu, 6 May 2021 14:40:35 +0000 (07:40 -0700)]
Use MicrosoftDotNet500 cert for executable files (#52336)

Use this for .msi files, and update the incoming arcade provided defaults with MicrosoftDotNet500.
Do not use the UseDotNetCertificate property as this repo does not use Publish.proj

3 years agoJIT: more general value class devirtualization (#52210)
Andy Ayers [Thu, 6 May 2021 14:29:57 +0000 (07:29 -0700)]
JIT: more general value class devirtualization (#52210)

When devirtualization knows that the `this` object is a boxed value class,
it now attempts to update the call to invoke the unboxed entry (when there
is one).

This extends an existing optimization that worked on calls where the box was
local and only fed the call. We now handle calls that dispatch on boxed value
classes more generally,  even if their creation is not local or is local but
in a form the existng opt could not handle.

These new cases either come from failed local box removal opts (say multi-use
boxes) or from guarded devirtualization.

The "boxed" entry for value class methods is an un-inlineable VM stub. This
transformation effectively inlines the stub and unblocks inlining of the
underlying method.

3 years ago[mono][aot] Avoid an assert on wasm+aot on methods with vararg calling conventions...
Zoltan Varga [Thu, 6 May 2021 14:06:30 +0000 (10:06 -0400)]
[mono][aot] Avoid an assert on wasm+aot on methods with vararg calling conventions. (#52369)

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

3 years ago[mono] Fix the type argument to the byval llvm attribute. (#52354)
Zoltan Varga [Thu, 6 May 2021 13:58:08 +0000 (09:58 -0400)]
[mono] Fix the type argument to the byval llvm attribute. (#52354)

Fixes a problem with https://github.com/dotnet/runtime/pull/52290.

3 years ago[wasm][debugger][tests] move setting of the unit test locale to code (#52193)
Pavel Savara [Thu, 6 May 2021 13:53:43 +0000 (15:53 +0200)]
[wasm][debugger][tests] move setting of the unit test locale to code (#52193)

* move setting of the unit test locale to code. Build on windows doesn't depend n Makefile.