platform/upstream/dotnet/runtime.git
2 years agoHTTP/2: Improve incoming header performance (#62614)
github-actions[bot] [Sat, 11 Dec 2021 05:27:24 +0000 (18:27 +1300)]
HTTP/2: Improve incoming header performance (#62614)

Co-authored-by: JamesNK <JamesNK@users.noreply.github.com>
2 years agoFix setting timestamp on Windows on readonly files (#62638)
Dan Moseley [Sat, 11 Dec 2021 04:42:23 +0000 (21:42 -0700)]
Fix setting timestamp on Windows on readonly files (#62638)

2 years agoExclude DNNE based test project from armel builds (#62486)
Adeel Mujahid [Sat, 11 Dec 2021 04:02:59 +0000 (06:02 +0200)]
Exclude DNNE based test project from armel builds (#62486)

2 years agoUpdate spmi asp.net script to collect some osr method contexts (#62635)
Andy Ayers [Sat, 11 Dec 2021 02:43:32 +0000 (18:43 -0800)]
Update spmi asp.net script to collect some osr method contexts (#62635)

Collect both non-pgo and pgo cases. For non-pgo, set OSR to trigger immediately
when any patchpoint is hit to maximize number of cases collected. For PGO, set
OSR to trigger once we've got a bit of profile data gathered by the Tier0 method.

2 years agoSkip native composite ReadyToRun images as inputs to Crossgen2 (#62537)
Tomáš Rylek [Sat, 11 Dec 2021 01:15:06 +0000 (02:15 +0100)]
Skip native composite ReadyToRun images as inputs to Crossgen2 (#62537)

According to the issue https://github.com/dotnet/runtime/issues/49247
a known pre-existing Crossgen2 bug is that it fails when presented
with the components of a previous Crossgen2 compilation in the
composite mode. This is because Crossgen2 lacks proper logic to
recognize the composite images and mistakes them for currently
unsupported managed C++ MSIL assemblies. This change adds the extra
check; I have also unified it between Crossgen2 and R2RDump.

Thanks

Tomas

2 years agoSwitch over Loader/classloader/TypeGeneratorTests to use merged wrappers (#61942)
Tomáš Rylek [Sat, 11 Dec 2021 00:26:40 +0000 (01:26 +0100)]
Switch over Loader/classloader/TypeGeneratorTests to use merged wrappers (#61942)

This change introduces test infra changes supporting new-style merged test wrappers.
As a first step in the test conversion the change switches over 1501 tests under the path
Loader/classloader/TypeGeneratorTests.

2 years agoMark overflow fix for regions (#60646)
Andrew Au [Fri, 10 Dec 2021 23:15:15 +0000 (15:15 -0800)]
Mark overflow fix for regions (#60646)

2 years agoCleanup name of CreateThread shim (#62648)
Jan Kotas [Fri, 10 Dec 2021 22:50:43 +0000 (14:50 -0800)]
Cleanup name of CreateThread shim (#62648)

2 years agoMake tests pass on AVX only host again (#62544)
Andrii Kurdiumov [Fri, 10 Dec 2021 22:34:43 +0000 (04:34 +0600)]
Make tests pass on AVX only host again (#62544)

Just anotate couple other methods which I need, based on https://github.com/dotnet/runtime/pull/61259 methodology

2 years agoFix double-negatives with MatchCharacterClass (#62636)
Stephen Toub [Fri, 10 Dec 2021 22:13:59 +0000 (17:13 -0500)]
Fix double-negatives with MatchCharacterClass (#62636)

Also add missing set description rendering for \d, \D

2 years agoFix describing concatenations in alternations (#62646)
Stephen Toub [Fri, 10 Dec 2021 21:29:48 +0000 (16:29 -0500)]
Fix describing concatenations in alternations (#62646)

I was previously too aggressive in getting rid of concatenations in the comment rendering.  We would end up flattening concatenations into alternations erroneously.

2 years ago[main] Update dependencies from dotnet/runtime-assets dotnet/arcade dotnet/xharness...
dotnet-maestro[bot] [Fri, 10 Dec 2021 21:22:11 +0000 (13:22 -0800)]
[main] Update dependencies from dotnet/runtime-assets dotnet/arcade dotnet/xharness dotnet/icu dotnet/hotreload-utils dotnet/llvm-project (#62582)

* Update dependencies from https://github.com/dotnet/runtime-assets build 20211203.1

Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Drawing.Common.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
 From Version 7.0.0-beta.21602.1 -> To Version 7.0.0-beta.21603.1

* Update dependencies from https://github.com/dotnet/llvm-project build 20211206.1

runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools
 From Version 11.1.0-alpha.1.21579.1 -> To Version 11.1.0-alpha.1.21606.1

* Update dependencies from https://github.com/dotnet/icu build 20211206.1

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 7.0.0-alpha.1.21579.1 -> To Version 7.0.0-alpha.1.21606.1

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

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 1.0.0-prerelease.21607.3 -> To Version 1.0.0-prerelease.21609.1

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

Microsoft.DotNet.XUnitExtensions , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.ApiCompat , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.GenFacades , Microsoft.DotNet.GenAPI , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.SharedFramework.Sdk
 From Version 7.0.0-beta.21602.3 -> To Version 7.0.0-beta.21609.2

* Update dependencies from https://github.com/dotnet/hotreload-utils build 20211206.2

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 1.0.2-alpha.0.21579.1 -> To Version 1.0.2-alpha.0.21606.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoFix lazy-initialization of Trace.s_correlationManager to be thread-safe (#62640)
Stephen Toub [Fri, 10 Dec 2021 20:28:32 +0000 (15:28 -0500)]
Fix lazy-initialization of Trace.s_correlationManager to be thread-safe (#62640)

If two threads race to initialize it, one may end up overwriting the others, which means state pushed onto the losing thread's stack might end up disappearing.

2 years agoAdd IsPackable to RateLimiting package and cleanup packaging TODOs (#62612)
Santiago Fernandez Madero [Fri, 10 Dec 2021 20:05:05 +0000 (14:05 -0600)]
Add IsPackable to RateLimiting package and cleanup packaging TODOs (#62612)

2 years agoAdd \w helper function to RegexCompiler / source generator (#62620)
Stephen Toub [Fri, 10 Dec 2021 19:17:23 +0000 (14:17 -0500)]
Add \w helper function to RegexCompiler / source generator (#62620)

2 years agoFix custom JsonConverterFactories not working with transitive type/property declarati...
Eirik Tsarpalis [Fri, 10 Dec 2021 18:17:43 +0000 (18:17 +0000)]
Fix custom JsonConverterFactories not working with transitive type/property declarations. (#62595)

2 years ago[wasm] Decrease the startup ceremony (#62587)
Pavel Savara [Fri, 10 Dec 2021 16:13:11 +0000 (17:13 +0100)]
[wasm] Decrease the startup ceremony (#62587)

* new API MONO.mono_run_main_and_exit and MONO.mono_run_main
* default onAbort
* console-v8-cjs sample
* reduced setup ceremony

2 years agoEnforce HTTP request Content-Length correctness (#62541)
Miha Zupan [Fri, 10 Dec 2021 15:50:23 +0000 (07:50 -0800)]
Enforce HTTP request Content-Length correctness (#62541)

* Enforce HTTP request Content-Length correctness

* Skip test on Browser

* Test that subsequent HTTP/1.1 requests can still succeed on a new connection

* Be consistent about exception nesting

2 years agoAdd instructions to skip restoring nuget packages (#62634)
Fan Yang [Fri, 10 Dec 2021 15:38:15 +0000 (10:38 -0500)]
Add instructions to skip restoring nuget packages (#62634)

Add build instructions to skip restoring nuget packages, when you only made change to mono.

2 years ago[wasm] Reduce number of calls to setTimer (#62433)
Pavel Savara [Fri, 10 Dec 2021 15:37:59 +0000 (16:37 +0100)]
[wasm] Reduce number of calls to setTimer (#62433)

* Reduce number of calls to setTimer (#62433)
* unit test
Co-authored-by: Marek Fišera <mara@neptuo.com>
2 years ago[wasm] Allow the main.js file to keep it's name (#62576)
Pavel Savara [Fri, 10 Dec 2021 13:04:27 +0000 (14:04 +0100)]
[wasm] Allow the main.js file to keep it's name (#62576)

* allow the main.js file to keep it's name
Co-authored-by: Ankit Jain <radical@gmail.com>
2 years agoMark forward delegate stubs as not having hidden arguments (#62617)
Jan Kotas [Fri, 10 Dec 2021 07:28:57 +0000 (23:28 -0800)]
Mark forward delegate stubs as not having hidden arguments (#62617)

2 years agoRelegate PatternsDataSet_ConstructRegexForAll_SourceGenerated test to 64-bit only...
Stephen Toub [Fri, 10 Dec 2021 05:58:34 +0000 (00:58 -0500)]
Relegate PatternsDataSet_ConstructRegexForAll_SourceGenerated test to 64-bit only (#62621)

2 years agoA little more regex source generator tweaking (#62605)
Stephen Toub [Fri, 10 Dec 2021 02:16:40 +0000 (21:16 -0500)]
A little more regex source generator tweaking (#62605)

* Remove now unecessary "Variable declared but never used" warning suppression

* Avoid declaring inputSpan in FindFirstChar if we don't have to

* Add RegexNode.Ref/Bol/Eol to non-backtracking list

* Move some additionalDeclarations back to where they're used

I was overaggressive in moving these to the beginning.  Some are fine where they're needed.

* Delete dead code

* Emit IsEmpty for more slice.Length checks

* Apply suggestions from code review

2 years agoPopulate NativeAOT sources from runtimelab (#62611)
Michal Strehovský [Fri, 10 Dec 2021 01:15:32 +0000 (10:15 +0900)]
Populate NativeAOT sources from runtimelab (#62611)

2 years agoAdd System.Native APIs needed by NativeAOT (#62571)
Michal Strehovský [Fri, 10 Dec 2021 00:39:21 +0000 (09:39 +0900)]
Add System.Native APIs needed by NativeAOT (#62571)

Porting files over from runtimelab branch - no changes to what was there.

2 years agoDisable CreateSpan_il test (#62598)
Bruce Forstall [Thu, 9 Dec 2021 23:30:54 +0000 (15:30 -0800)]
Disable CreateSpan_il test (#62598)

Failing in many jitstress modes

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

2 years agoReenable Mono runtime tests on PRs (#62437)
Alexander Köplinger [Thu, 9 Dec 2021 20:34:26 +0000 (21:34 +0100)]
Reenable Mono runtime tests on PRs (#62437)

2 years agoFix ReadAsync_ThrowsIfWriterCompletedWithException for PGO (#62584)
Egor Bogatov [Thu, 9 Dec 2021 20:05:47 +0000 (23:05 +0300)]
Fix ReadAsync_ThrowsIfWriterCompletedWithException for PGO (#62584)

2 years agoMake `gtHasRef` pay attention to LCL_FLD nodes (#62568)
SingleAccretion [Thu, 9 Dec 2021 19:23:07 +0000 (22:23 +0300)]
Make `gtHasRef` pay attention to LCL_FLD nodes (#62568)

* Add a test

* Make "gtHasRef" pay attention to LCL_FLD nodes

Fixes the interference checks in the forward substitution of relops optimization.

2 years agoHTTP/3: QPACK decoder performance (#62470)
github-actions[bot] [Thu, 9 Dec 2021 19:19:05 +0000 (08:19 +1300)]
HTTP/3: QPACK decoder performance (#62470)

Co-authored-by: James Newton-King <james@newtonking.com>
2 years agoUpdated testing document; patching and various mono-specific msbuild targets are...
Nathan Ricci [Thu, 9 Dec 2021 18:40:03 +0000 (13:40 -0500)]
Updated testing document; patching and various mono-specific msbuild targets are no longer needed. (#62588)

2 years agoApp does not Run as a service in a Windows Container (#62452)
Eric Erhardt [Thu, 9 Dec 2021 17:53:22 +0000 (11:53 -0600)]
App does not Run as a service in a Windows Container (#62452)

Removing SessionId check in IsWindowsService(). This check is not correct when the process is being run in a Windows container. The container will get a different SessionId.

Fix #52416

2 years agoFix some outerloop tests (#62559)
Dan Moseley [Thu, 9 Dec 2021 17:41:58 +0000 (10:41 -0700)]
Fix some outerloop tests (#62559)

* serialport

* Fix OpenOrCreate_DeleteOnClose_UsableAsMutex

* logging

* impersonated

* ping

2 years agoConvert some old style intrinsics to NamedIntrinsic (#62271)
Adeel Mujahid [Thu, 9 Dec 2021 16:25:34 +0000 (18:25 +0200)]
Convert some old style intrinsics to NamedIntrinsic (#62271)

* Convert some old style intrinsics to NamedIntrinsic

* Delete GetStubContextAddr and related code

* More cleanups

Co-authored-by: EgorBo <egorbo@gmail.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2 years ago[mono] Support LLVM inline assembly. (#62558)
imhameed [Thu, 9 Dec 2021 15:20:52 +0000 (07:20 -0800)]
[mono] Support LLVM inline assembly. (#62558)

This change adds a convenience function, named `mono_llvm_inline_asm`,
that wraps `LLVMGetInlineAsm` and `LLVMBuildCall2`.

Inline assembly isn't used right now for normal code generation. But
this can be used to ease debugging and development by inserting
easy-to-find markers in the generated code. Towards that end, this
change also adds a convenience `LLVMTypeRef`, named `void_func_t`, that
denotes a function type that takes no parameters and does not return a
value.

Example:

    mono_llvm_inline_asm (builder, void_func_t, "int $$0x3", "", LLVM_ASM_SIDE_EFFECT, NULL, 0, "");

2 years agoSkip source gen DLLs in mono AOT (#62518)
Andy Gocke [Thu, 9 Dec 2021 14:59:24 +0000 (06:59 -0800)]
Skip source gen DLLs in mono AOT (#62518)

These appear to be failing because Microsoft.CodeAnalysis isn't present, but that's expected
behavior for source generators/analyzers, as they are plugins.

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

2 years agoAdd additional binary operations into the RangeCheck analysis. (#61662)
anthonycanino [Thu, 9 Dec 2021 14:55:12 +0000 (06:55 -0800)]
Add additional binary operations into the RangeCheck analysis. (#61662)

* Add additional binary operations into the RangeCheck analysis.

GT_LSH and GT_MUL are now covered in the range analysis check. This
allows to catch and eliminate the range check for cases like

```
ReadOnlySpan<byte> readOnlySpan => new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };

byte byt = 0;
for (int i = 0; i < 5; i++)
{
  byt = readOnlySpan[i * 3];
  // ...
}
```

or

```
bool[] flags = new bool[Size + 1];

for (int i = 2; i <= Size; i++)
{
  for (int k = i * 2; k <= Size; k += i)
  {
    flags[k] = false;
  }
}
```

Note that without this change, the previous snippet would not eliminate
the range check on `flags[k]`, but the equivalent snippet would

```
for (int i = 2; i <= Size; i++)
{
  for (int k = i + i; k <= Size; k += i)
  {
    flags[k] = false;
  }
}

```

as additional was implemented in the range check analysis, but multiply
was not.

* RangeCheck multiply overflow fix and tests.

Tests catch some edge cases with multiplcation overflow IF
the overflow detection isn't implemented correctly.

* Use CheckedOps::Signed instead of false.

* Reduced overflow test array size to more reasonable value.

* Update src/coreclr/jit/rangecheck.cpp

Co-authored-by: Egor Bogatov <egorbo@gmail.com>
* Update src/coreclr/jit/rangecheck.cpp

Co-authored-by: Egor Bogatov <egorbo@gmail.com>
Co-authored-by: Egor Bogatov <egorbo@gmail.com>
2 years agofix the build (#62575)
Adam Sitnik [Thu, 9 Dec 2021 14:50:51 +0000 (15:50 +0100)]
fix the build (#62575)

2 years agoCI matrix update: add Ubuntu 21.04 - second attempt (#60162)
Jan Jahoda [Thu, 9 Dec 2021 12:47:15 +0000 (13:47 +0100)]
CI matrix update: add Ubuntu 21.04 - second attempt (#60162)

* CI matrix update: add Ubuntu 21.04 (#59578)

* Change base os from amd64 to arm

2 years agoMore regex source generator tweaks (#62539)
Stephen Toub [Thu, 9 Dec 2021 11:58:39 +0000 (06:58 -0500)]
More regex source generator tweaks (#62539)

* Remove some unnecessary capture position locals

Now that we emit a helper function for the uncapturing loop, we no longer need a local to temporarily store a popped capture position from the stack.

* Consolidate a few declaration lines

* Clean up descriptions further.

* Fix blank lines between nodes

* Build atomic description into some child nodes instead

* Remove stale Debug.Fail being emitted

I'd included it initially for debugging and never removed it.

* Avoid ReserveName for a few iteration variables

* Fix missing ||

* Fix += in char loop to use EmitAdd

Mainly so that `+= 1` is instead rendered as the more idiomatic `++`

* Update warning level in tests to ensure we're observing all warnings

* Clean up loop descriptions a bit

- Use "exactly" for repeaters
- Put a comma before "optionally"
- Special-case a minimum of 2 as "twice"

* Delete defunct base.InitializeReferences call.

This is now a nop.

* Update src/libraries/System.Text.RegularExpressions/gen/RegexGenerator.Emitter.cs

Co-authored-by: Jose Perez Rodriguez <joperezr@microsoft.com>
Co-authored-by: Jose Perez Rodriguez <joperezr@microsoft.com>
2 years agoUpdate Xharness dependencies (#62501)
Marek Fišera [Thu, 9 Dec 2021 10:24:54 +0000 (11:24 +0100)]
Update Xharness dependencies (#62501)

2 years ago[tests] Fix local test runs for mobile (#62549)
Mitchell Hwang [Thu, 9 Dec 2021 09:03:24 +0000 (04:03 -0500)]
[tests] Fix local test runs for mobile (#62549)

Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
2 years agoEscape lower-cased type names (#62507)
Julien Couvreur [Thu, 9 Dec 2021 08:05:25 +0000 (00:05 -0800)]
Escape lower-cased type names (#62507)

2 years agoPopulate NativeAOT sources from runtimelab (#62563)
Michal Strehovský [Thu, 9 Dec 2021 06:11:46 +0000 (15:11 +0900)]
Populate NativeAOT sources from runtimelab (#62563)

2 years agoPort annotations from runtimelab (#62562)
Michal Strehovský [Thu, 9 Dec 2021 05:12:59 +0000 (14:12 +0900)]
Port annotations from runtimelab (#62562)

Placing the attribute into ApiComplatExlude for now - there will be follow up work to do any necessary cleanups/propagation to non-shared parts of CoreLib before this can go into ref assemblies.

2 years agoUsing ReadOnlySpan<char> on SymbolicRegexRunner (#62542)
Jose Perez Rodriguez [Thu, 9 Dec 2021 03:12:33 +0000 (19:12 -0800)]
Using ReadOnlySpan<char> on SymbolicRegexRunner (#62542)

2 years ago[build] Create clr.host subset to remove patching step for mono runtime tests (#62500)
Nathan Ricci [Thu, 9 Dec 2021 03:07:08 +0000 (22:07 -0500)]
[build] Create clr.host subset to remove patching step for mono runtime tests (#62500)

* [build] Define a component and subset for corerun and copy mono runtime files to coreroot.

2 years agoImprove loop JitDump output (#62556)
Bruce Forstall [Thu, 9 Dec 2021 01:49:30 +0000 (17:49 -0800)]
Improve loop JitDump output (#62556)

In addition,
- Added COMPlus_JitDumpFgBlockFlags to include BasicBlock flags in the JitDumpFg ".dot" file
- Added COMPlus_JitDumpFgLoopFlags to include loop table flags in the JitDumpFg ".dot" file
- Added cLoopPtr/dLoopPtr, cLoops/dLoops debugger-used functions, and changed cLoop to call the standard dumper
- Added clrjit.natvis debugger display for LoopDsc
- Improved a few comments

No asm diffs

2 years agoSwitch over miscellaneous DllImports to GeneratedDllImport. (#62353)
Jeremy Koritzinsky [Thu, 9 Dec 2021 00:47:18 +0000 (16:47 -0800)]
Switch over miscellaneous DllImports to GeneratedDllImport. (#62353)

Co-authored-by: Aaron Robinson <arobins@microsoft.com>
2 years agoUpdate build pool to macOS 11 (#62294)
Juan Hoyos [Wed, 8 Dec 2021 23:18:41 +0000 (15:18 -0800)]
Update build pool to macOS 11 (#62294)

2 years agoDisable tests on Mac Catalyst in App Sandbox mode (#62536)
Simon Rozsival [Wed, 8 Dec 2021 22:22:13 +0000 (23:22 +0100)]
Disable tests on Mac Catalyst in App Sandbox mode (#62536)

* Run only relevat tests for app sandbox

* Fix typo

* Update src/libraries/tests.proj

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2 years ago[TODO-List-Cleanup] `gtHasRef` refactoring (#62526)
SingleAccretion [Wed, 8 Dec 2021 22:19:09 +0000 (01:19 +0300)]
[TODO-List-Cleanup] `gtHasRef` refactoring (#62526)

* Delete the "defOnly" parameter from "gtHasRef"

It was always passed as "false" and so effectively unused.

Additionally, the handling for it was broken, as the only
ASGs checked for were children of unary nodes, and those
do not even exist in IR (ASGs are either top-level, or
under a COMMA, or setup args).

Additionally, the meaning of "def" in IR is rather ambigious
and requires more context than just looking if it is the LHS
of an assignment, because of indirect stores with ADDR nodes.

* Use VisitOperands in gtHasRef

Allows to delete one more custom traversal.

I have measured the performance impact of this change on
a variety of IR and see that there is no change or a slight
improvement, on the order of 10%, depending on the how the
opers are distributed.

* Bring back the comment

2 years agoIntegration of changes in shared files from runtimelab/NativeAOT (#62515)
Michal Strehovský [Wed, 8 Dec 2021 21:42:14 +0000 (06:42 +0900)]
Integration of changes in shared files from runtimelab/NativeAOT (#62515)

2 years agoEnable memory-mapped stress log on cross platform (#61123)
Andrew Au [Wed, 8 Dec 2021 20:52:15 +0000 (12:52 -0800)]
Enable memory-mapped stress log on cross platform (#61123)

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
2 years agoFix createdump failure on MacOS Monterey version 12.0.1 (#62465)
Mike McLaughlin [Wed, 8 Dec 2021 20:32:57 +0000 (12:32 -0800)]
Fix createdump failure on MacOS Monterey version 12.0.1 (#62465)

Fix createdump failure on MacOS Monterey version 12.0.1.

Fails looking for the symbol _dyld_all_image_infos in dylinker. The fix is to fallback to searching all the symbols after searching the "external" symbols.

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

2 years agoJIT: refactor arm64 epilog generation (#62381)
Andy Ayers [Wed, 8 Dec 2021 19:54:46 +0000 (11:54 -0800)]
JIT: refactor arm64 epilog generation (#62381)

Instead of rederiving the frame type for epilog generation, use the
frame type (and other info) we derived during prolog generation.

This is done in anticipation of creating OSR epilogs, where we will
need aspects of epilog sequences for both the OSR method and the Tier0
method, and they may have different frame types.

2 years agoDelete gtEvalSizeFirst (#62330)
SingleAccretion [Wed, 8 Dec 2021 19:22:55 +0000 (22:22 +0300)]
Delete gtEvalSizeFirst (#62330)

The gtEvalSizeFirst special ordering case for dynamic block nodes
was originally introduced to ensure the changes were zero-diff.

However, it seems it does not pay for the complexity it introduces.
The dynamic block nodes are very rare, rarer still are cases when
we do actually make use of this mechanism, and practically non-existent
are cases where it matters (this is a rather minor optimization,
after all).

In fact, it appears it matters so little that this change is a
zero-diff one across all of SPMI...

2 years agoPort changes from 6.0 for future servicing releases into main (#62469)
Santiago Fernandez Madero [Wed, 8 Dec 2021 19:14:29 +0000 (13:14 -0600)]
Port changes from 6.0 for future servicing releases into main (#62469)

* Port changes from 6.0 for future servicing releases into main

* Include another change needed for servicing

* PR Feedback

2 years agoCI matrix: add openSUSE 15.2 - second attempt (#60161)
Jan Jahoda [Wed, 8 Dec 2021 17:17:08 +0000 (18:17 +0100)]
CI matrix: add openSUSE 15.2 - second attempt (#60161)

* CI matrix: add openSUSE 15.2 (#59574)

* Update opensuse docker image

* Add experimentaly another filte to the PR to trigger suse build

* Update eng/pipelines/libraries/helix.yml

Co-authored-by: Santiago Fernandez Madero <safern@microsoft.com>
2 years ago[mono][jit] Fix and optimize llvmonly+gsharedvt code generation (#61117)
Zoltan Varga [Wed, 8 Dec 2021 16:09:06 +0000 (11:09 -0500)]
[mono][jit] Fix and optimize llvmonly+gsharedvt code generation (#61117)

* [mono][jit] Revert parts of 62eafc1e67d332b902772065cb36b3c51c40c732.

The new approach doesn't work because it requires gsharedvt out
wrappers with signatures which might not exist in the program.

* Fix interp->aot calls to gsharedvt methods, they don't need a gsharedvt out wrapper.

* Fix the initialization of info->invoke_impl in mini_llvmonly_init_delegate (). Also initialize del->method there instead of doing it in generated code.

* Fix interp entry for gsharedvt methods.

* Extract vtable.interp_vtable into a MonoVTableEEData structure so more per-vtable ee data can be added later.

* Enable gsharedvt on wasm as an experiment.

* Add a fastpath for gsharedvt virtual calls.

* Fix/optimize interp entries for methods which cannot be AOTed.

* Instead of obtaining the interp entry wrapper using a JIT icall,
  store it as an AOT constant/rgctx entry.
* For gsharedvt methods, collect the arguments and call into
  the interpreter directly instead of using a gsharedvt out
  + interp entry wrapper.

* [mono][jit] Avoid computing a vtable arg for ctors which don't need it.

This can happen if the ctor is implemented as an intrinsics like
System.ByReference ().

* [mono][jit] Allow inline rgctx fetches during some parts of the decompose pass.

* [mono][jit] Add more specialized imt functions in llvmonly mode.

* [mono][aot] Fix the addition of generic methods from profiles.

Same as 0666ebc475871c27f5b9d4ee8e91922f20be46e9 but for generic methods.

* Disable gsharedvt on wasm.

2 years agoOptimize ReadOnlyTernaryTree for System.Private.Xml (#60076)
kronic [Wed, 8 Dec 2021 15:10:11 +0000 (18:10 +0300)]
Optimize ReadOnlyTernaryTree for System.Private.Xml (#60076)

* change generator

* generate code

* Refactoring FindElementProperty, FindAttributeProperty

* fix method FindCaseInsensitiveString scope

* move enum TernaryTreeByte and fix scope

* fix naming in enum TernaryTreeByte

* use ROS in FindElementProperty, FindAttributeProperty

* genarate code

* minor refactoring HtmlRawTextWriterGenerator.ttinclude

* generate code

Co-authored-by: kronic <kronic@softland.ru>
2 years agoMark static boxes as invariant (#62298)
SingleAccretion [Wed, 8 Dec 2021 13:37:06 +0000 (16:37 +0300)]
Mark static boxes as invariant (#62298)

This will be needed to make the upcoming changes to how
we parse the field sequences for boxed statics zero-diff.

It also happens to be a CQ improvement on its own.

2 years ago[wasm][debugger] View object attributes - DebugType=full (#62278)
Thays Grazia [Wed, 8 Dec 2021 13:12:03 +0000 (10:12 -0300)]
[wasm][debugger] View object attributes - DebugType=full (#62278)

* Fix view variable values from an assembly with debugType = full

* Addressing @ilonatommy comment.

* Adding the csproj for the new test.

* Adressing @radical comments.

* Apply suggestions from code review

Co-authored-by: Ankit Jain <radical@gmail.com>
* Removing method duplicated.
Keep peReader as an attribute as is recommended in the documentation. https://docs.microsoft.com/en-us/dotnet/api/system.reflection.metadata.pereaderextensions.getmetadatareader?view=net-6.0#System_Reflection_Metadata_PEReaderExtensions_GetMetadataReader_System_Reflection_PortableExecutable_PEReader_

* Calling Runtime.consoleAPICalled.

* addressing @radical comment.

Co-authored-by: Ankit Jain <radical@gmail.com>
2 years agoUnblock tests in LINQ interpreter only mode (#62463)
Michal Strehovský [Wed, 8 Dec 2021 08:10:20 +0000 (17:10 +0900)]
Unblock tests in LINQ interpreter only mode (#62463)

These tests were blocked for interpreter in #54970, but the failures don't repro when run with interpreter only on CoreCLR. The failures are specific to iDevices.

2 years agoS.IO.StringReader: Use ReadOnlySpan.IndexOfAny in ReadLine() for performance (#60463)
nietras [Wed, 8 Dec 2021 07:59:26 +0000 (08:59 +0100)]
S.IO.StringReader: Use ReadOnlySpan.IndexOfAny in ReadLine() for performance (#60463)

Co-authored-by: Adam Sitnik <adam.sitnik@gmail.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
2 years agoEnable max warnlevel from C# compiler (#62506)
Julien Couvreur [Wed, 8 Dec 2021 06:38:12 +0000 (22:38 -0800)]
Enable max warnlevel from C# compiler (#62506)

2 years agoConvert TryGetRawMetadata comment to XML documentation (#61515)
Petr Onderka [Wed, 8 Dec 2021 06:13:42 +0000 (07:13 +0100)]
Convert TryGetRawMetadata comment to XML documentation (#61515)

2 years agoDisable DispatchProxyTests.Test_Unloadability on Mono (#62504)
Aleksey Kliger (λgeek) [Wed, 8 Dec 2021 02:58:05 +0000 (21:58 -0500)]
Disable DispatchProxyTests.Test_Unloadability on Mono (#62504)

https://github.com/dotnet/runtime/issues/62503

Collectible ALCs aren't collected yet

2 years agoAdd Runtime portion of android startup scenario (#61861)
Parker Bibus [Wed, 8 Dec 2021 00:27:04 +0000 (18:27 -0600)]
Add Runtime portion of android startup scenario (#61861)

Add app with debug instrumentation build and download. Add android scenario calls and include xharness.

Co-authored-by: Bill Wert <billwert@microsoft.com>
2 years agoonly trigger compatibility mode when usage and configuration are global (#62488)
Pavel Savara [Tue, 7 Dec 2021 20:52:08 +0000 (21:52 +0100)]
only trigger compatibility mode when usage and configuration are global (#62488)

2 years agoSupport Process.Start() on MacCatalyst (#61507)
Simon Rozsival [Tue, 7 Dec 2021 19:33:38 +0000 (20:33 +0100)]
Support Process.Start() on MacCatalyst (#61507)

* Modify existing tests

* Enable process start and kill on MacCatalyst

* Typo

* Temporarily enable ProcessTests for MacCatalyst

* Temporarily enable ProcessTests for MacCatalyst - attempt 2

* Allow running Mac Catalyst builds in App Sandbox

* Allow enabling app sandbox for the other Mac Catalyst sample

* Add missing parameter to XCode project generator

* Remove unnecessary MacCatalyst detection

* Enable App Sandbox for Mac Catalyst tests

* Create a separate test branch for App Sandbox

* Remove the restriction to enable app sandbox just for Mac Catalyst apps

* Do not throw PNSE for Mac Catalyst

* Clean-up platform-specific conditions

* Build correct Process implementation for MacCatalyst

* Try to get more information from CI for further investigation of the failing build

* Revert "Try to get more information from CI for further investigation of the failing build"

This reverts commit fc63a370d688aa0d1dc890e6928a8d031d148e56.

* Add MacCatalyst target framework for System.Diagnostics.Process

* Add supported platform annotations for Mac Catalyst

* Fix annotations

* Remove incorrectly placed attributes

* Update attributes including the reference file

* Change platform attributes

* Generate app.entitlements in the BuildAppleAppBundles test build target

* Revert "Generate app.entitlements in the BuildAppleAppBundles test build target"

This reverts commit abbe2241586e3469c3d3e9d4ecd2cea2e09d3641.

* Enable AppSandbox when generating CMakeLists.txt for libraries tests

* Try implementing a workaround for app sandbox mode

* Fix app sandbox detection bug

* Add explanation comment

* Enable more tests for MacCatalyst

* Add apple app builder input validation

* Add Mac Catalyst w/ App Sandbox enabled to runtime-manual test pipeline

* Enable networking in App Sandbox mode

* Skip test which won't work on Mac Catalyst

* Skip some tests in app sandbox mode

* Update src/tasks/AppleAppBuilder/AppleAppBuilder.cs

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
* Add a clarification comment for a networking entitlement

* Simplify supported platform condition

* Remove temporarily enabled test

* Remove unnecessary attributes

* Replace checking env variable with checking errno in libproc

* Update docs

* Remove unnecessary changes

* Temporarily enable running System.Diagnostics.Process.Tests for this PR

This reverts commit 02d370c2cf730bf67a3cf6fca8fcb8c5e4ff1ccd.

* Revert "Temporarily enable running System.Diagnostics.Process.Tests for this PR"

This reverts commit dc72f0f1d068314317d088d33ec87f9aa6447854.

* Fix job suffix in runtime-manual

* Remove attributes

* Revert "Remove attributes"

This reverts commit 704e9fa73cd40854d1becc2889569bab3c47d62d.

* Try changing the order of attributes to please CI

* Update ApiCompat baseline

* ApiCompat step 1: remove all attributes for MaxWorkingSet setter

* Revert "Update ApiCompat baseline"

This reverts commit a2ad03207c5f9f40b9dd2c335a1b0f31c37a0ac5.

* Revert "ApiCompat step 1: remove all attributes for MaxWorkingSet setter"

This reverts commit be72a3d2564afb89a83198ef010b3d4622799601.

* Update ApiCompat baseline

* Update ApiCompat baseline after pulling upstream main

* Remove trailing whitespace

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
2 years agoUpdate area owners: carlossanlop changes area pods (#62495)
Jeff Handley [Tue, 7 Dec 2021 19:31:10 +0000 (11:31 -0800)]
Update area owners: carlossanlop changes area pods (#62495)

2 years ago[mono] Fix samples building against from TFM (#62491)
Alexander Köplinger [Tue, 7 Dec 2021 18:35:27 +0000 (19:35 +0100)]
[mono] Fix samples building against from TFM (#62491)

They were building against NetCoreAppToolCurrentVersion which is net6.0 instead of net7.0 and that caused the runtime pack from nuget.org to be used instead of the live-built binaries since the override in targetingpacks.targets no longer kicked in.

2 years ago[mono] Remove unused defines from config.h.in (#62490)
Alexander Köplinger [Tue, 7 Dec 2021 18:00:47 +0000 (19:00 +0100)]
[mono] Remove unused defines from config.h.in (#62490)

We're not actually using them in the code and not checking for the function existence in configure.cmake so they're a no-op.

2 years agoRemove #ifs in System.ComponentModel.TypeConverter (#62364)
Badre BSAILA [Tue, 7 Dec 2021 17:27:54 +0000 (18:27 +0100)]
Remove #ifs in System.ComponentModel.TypeConverter (#62364)

Make 2 scenarios work like they did on .NET Framework:

1. Skipping GuidAttribute and InterfaceTypeAttribute on interfaces.
2. GetExtenderProviders checks `component.Site.Container` for extenders

* Remove #ifs in System.ComponentModel.TypeConverter

* use reflection instead of making internals visible to test assembly

* make pass broken trimming test

* drop reflection

2 years agoNotepad with uppercase (#62487)
Dan Moseley [Tue, 7 Dec 2021 16:55:18 +0000 (09:55 -0700)]
Notepad with uppercase (#62487)

2 years agodon't run CanZipNamedPipe test on iOS/tvOS (#62477)
Adam Sitnik [Tue, 7 Dec 2021 16:18:59 +0000 (17:18 +0100)]
don't run CanZipNamedPipe test on iOS/tvOS (#62477)

* don't run the test on iOS/tvOS

* disable the buffering as originally intended https://github.com/dotnet/runtime/pull/62240/files#r761093748

2 years agoIssue 55685 processname optimisation (#59672)
Steve Dunn [Tue, 7 Dec 2021 16:15:15 +0000 (16:15 +0000)]
Issue 55685 processname optimisation (#59672)

Co-authored-by: Adam Sitnik <adam.sitnik@gmail.com>
2 years agoFix perf issues discovered in "For software performance, can you always trust inlinin...
Egor Bogatov [Tue, 7 Dec 2021 15:27:58 +0000 (18:27 +0300)]
Fix perf issues discovered in "For software performance, can you always trust inlining" blog (#61408)

2 years agoUpdate windows-requirements.md (#62476)
Steve Dunn [Tue, 7 Dec 2021 14:46:42 +0000 (14:46 +0000)]
Update windows-requirements.md (#62476)

* Update windows-requirements.md

* Update docs/workflow/requirements/windows-requirements.md

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Dan Moseley <danmose@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
2 years agoMore cleanup for source generator (#62461)
Stephen Toub [Tue, 7 Dec 2021 14:32:08 +0000 (09:32 -0500)]
More cleanup for source generator (#62461)

* More cleanup for source generator

- Add more comments, both to the implementation and to the generated code
- Avoid an unnecessary goto in the last branch of an alternation
- Invert the backreference logic so that we don't have an extra else branch / level of nesting in the common case
- Add node type asserts to all EmitXx functions
- Move the open-coded uncapture loop into its own shared function
- Remove scoping when outputting a Nothing
- Swap the sides of some if clauses to make them more idiomatic
- Change some "if (i < 1)" to "if (i == 0)"
- Change some "if (0 < span.Length)" to be "if (!span.IsEmpty)"

* Fix renames across RegexCompiler / source generator

2 years agoOptimize XmlTextEncoder.Write (#61773)
kronic [Tue, 7 Dec 2021 14:09:29 +0000 (17:09 +0300)]
Optimize XmlTextEncoder.Write (#61773)

* Optimize

* str->ros

* remove comment

* remove offset, count

* chunkSize to local

* Remove WriteStringFragment

* cleanup usings

* fix nullability

* optimize empty string

* Use ReadOnlySpan<char>

Co-authored-by: kronic <kronic@softland.ru>
2 years agoClean up symlink tests (#62087)
Dan Moseley [Tue, 7 Dec 2021 09:49:54 +0000 (02:49 -0700)]
Clean up symlink tests (#62087)

2 years ago[arm64] JIT: X % 2 == 0 -> X & 1 == 0 (#62399)
Egor Bogatov [Tue, 7 Dec 2021 09:01:17 +0000 (12:01 +0300)]
[arm64] JIT: X % 2 == 0 -> X & 1 == 0 (#62399)

2 years agoConvert System.DirectoryServices.Protocols and System.Drawing.Common to use Generated...
Jeremy Koritzinsky [Tue, 7 Dec 2021 05:09:15 +0000 (21:09 -0800)]
Convert System.DirectoryServices.Protocols and System.Drawing.Common to use GeneratedDllImport (#62365)

2 years agoEnsure all types are loaded when methods are accessed as function pointers (#62158)
Aaron Robinson [Tue, 7 Dec 2021 03:03:03 +0000 (19:03 -0800)]
Ensure all types are loaded when methods are accessed as function pointers (#62158)

* Ensure all types are loaded when methods are accessed as function pointers.

* Fix issues with Type punning with Type Equivalence.

* Add support for Generic instantiation over Canon for type punning.

2 years agoSymlink for dotnet host should be created at build time (#62455)
Nikola Milosavljevic [Tue, 7 Dec 2021 02:40:50 +0000 (18:40 -0800)]
Symlink for dotnet host should be created at build time (#62455)

* Create symlink at build time

* Pick up latest Installers package from Arcade

2 years agoRenaming some local variables to make the generated code more readable (#62460)
Jose Perez Rodriguez [Tue, 7 Dec 2021 02:32:04 +0000 (18:32 -0800)]
Renaming some local variables to make the generated code more readable (#62460)

* Renaming some local variables to make the generated code more readable

* Renaming crawlpos as well.

2 years agoFix Some Date and Time parsing cases (#62376)
Tarek Mahmoud Sayed [Tue, 7 Dec 2021 01:43:32 +0000 (17:43 -0800)]
Fix Some Date and Time parsing cases (#62376)

* Fix Some Date and Time parsing cases

* Avoid running the new test on Mac

* Exclude the browser for the new test

* Update src/libraries/System.Private.CoreLib/src/System/Globalization/DateTimeParse.cs

Co-authored-by: Santiago Fernandez Madero <safern@microsoft.com>
2 years agoFollow up to universal System.Linq.Expressions (#62229)
Michal Strehovský [Tue, 7 Dec 2021 00:20:12 +0000 (09:20 +0900)]
Follow up to universal System.Linq.Expressions (#62229)

2 years agoFix the presence of managed build logs on Windows (#62446)
Tomáš Rylek [Mon, 6 Dec 2021 21:29:36 +0000 (22:29 +0100)]
Fix the presence of managed build logs on Windows (#62446)

When analyzing PR failures I noticed that the log / wrn / err / binlog
combo only gets produced on Unix runs. I think this is also a bug
I made in the build script refactoring, the logging parameters
were used for the cmake build instead of the managed build.
[I can add a second set of logging parameters for the cmake build
phase if needed but I believe it wasn't there before my change.]

Thanks

Tomas

2 years agoFix for `cor.h(1951,8): error C2665: 'CorSigUncompressData': none of the 3 overloads...
Mikhail Pilin [Mon, 6 Dec 2021 21:15:55 +0000 (22:15 +0100)]
Fix for `cor.h(1951,8): error C2665: 'CorSigUncompressData': none of the 3 overloads could convert all the argument types` on VS2019 with warning level 4. (#60967)

2 years ago[wasm] load dotnet.js with import in tests (#62415)
Pavel Savara [Mon, 6 Dec 2021 21:13:56 +0000 (22:13 +0100)]
[wasm] load dotnet.js with import in tests (#62415)

* load dotnet.js with import in tests
* fix proxy fail and handle errors of this type
* feedback

2 years agoSome more Regex cleanup and optimization (mostly source generator) (#62426)
Stephen Toub [Mon, 6 Dec 2021 20:41:56 +0000 (15:41 -0500)]
Some more Regex cleanup and optimization (mostly source generator) (#62426)

* Reduce (?!) to nothing

The expression "(?!)" (an empty negative lookahead) is sometimes used in expressions at a point where we want to match nothing and thus fail a match, often in combination with a conditional operation.  This negative lookahead wrapped around an empty can be reduced to simply a Nothing, which is cheaper to process.

* Special-case an empty pattern in the source generator

* Output more idiomatic C# for some backreference conditionals

We currently output goto-based code, avoiding an actual if/else construct in case the child branches need to backtrack (and with the forced scoping for the if/else blocks, backtracking would result in compilation failures due to trying to jump to labels defined inside those scopes).  But if we know in advance that no such backtracking will happen, we can output the nicer if/else code.

* Improve code generated for backreferences

We were iterating through each individual character in our own open-coded loop, but for case-sensitive, we can just delegate to SequenceEqual.

* Avoid mutating RegexNode tree for expression conditionals

Rather than wrapping a node in a new positive lookahead assertion node, just call the logic to emit the node as if it were a positive lookahead.

* Change a few -1 comparisons to be 0 comparisons

Ever so slightly cheaper

* Factor stack pushing/popping into helper methods

2 years agoDisable Rollup warning for use of eval. (#62432)
Marek Fišera [Mon, 6 Dec 2021 19:47:08 +0000 (20:47 +0100)]
Disable Rollup warning for use of eval. (#62432)

2 years agoClarifying a comment in genFMAIntrinsic (#62439)
Tanner Gooding [Mon, 6 Dec 2021 19:33:26 +0000 (11:33 -0800)]
Clarifying a comment in genFMAIntrinsic (#62439)

2 years agoRevise the Regex description output in source (#62369)
Stephen Toub [Mon, 6 Dec 2021 18:58:53 +0000 (13:58 -0500)]
Revise the Regex description output in source (#62369)

* Improve comments in generated Regex code

To help make the generated code easier to understand and debug.

* Format RegexOptions textually when possible

2 years agoFix SuperPMI unit test 'strip' behavior (#62373)
Bruce Forstall [Mon, 6 Dec 2021 18:41:13 +0000 (10:41 -0800)]
Fix SuperPMI unit test 'strip' behavior (#62373)

In the case where replay of a test collection contains MISSING items,
or other SuperPMI replay failures, we strip the failing method contexts
from the result. This is very rare in the test scenario, but does happen
mostly (presumably) due to SuperPMI tool bugs. However, the strip command
wasn't actually being passed the set of things to strip, so it was just
doing a straight copy. Thus, we ended up failing the "clean replay" because
the failing MCs were still in the collection.

The test has had this problem for a long time, and it looks like it has
periodically hit in testing, but we haven't had bugs opened on these failures,
so we haven't noticed.

2 years agoEnsure that FMA codegen operand swapping matches the lsra selections (#62382)
Tanner Gooding [Mon, 6 Dec 2021 16:26:25 +0000 (08:26 -0800)]
Ensure that FMA codegen operand swapping matches the lsra selections (#62382)

* Ensure that FMA codegen operand swapping matches the lsra selections

* Ensure operands end up in the right slots