platform/upstream/dotnet/runtime.git
16 months agoMultiple GDV: ignore non-inlineable candidates (#86835)
Egor Bogatov [Sat, 27 May 2023 18:38:16 +0000 (20:38 +0200)]
Multiple GDV: ignore non-inlineable candidates (#86835)

16 months agoFix tiered PGO info in TC Settings event (#86827)
Koundinya Veluri [Sat, 27 May 2023 18:37:18 +0000 (11:37 -0700)]
Fix tiered PGO info in TC Settings event (#86827)

- Moved initialization of the tiered PGO config values in EEConfig to before the TC Settings event is sent
- After this change, the TC Settings event shows the correct flags when tiered PGO is enabled

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

16 months agoFix packs subset build (#86832)
Adeel Mujahid [Sat, 27 May 2023 14:31:56 +0000 (17:31 +0300)]
Fix packs subset build (#86832)

16 months agoAdd NativeAOT build and runtime pack for linux-bionic (#86781)
Michal Strehovský [Sat, 27 May 2023 07:38:18 +0000 (16:38 +0900)]
Add NativeAOT build and runtime pack for linux-bionic (#86781)

Build and runtime pack for linux-bionic (Android without the Java part).

I tried not to regress the existing CoreCLR Android build that is based on a crossrootfs (#56622) - the if's basically deal with that. Note that it's likely broken anyway (#66562).

16 months agoUse `u8` literals in `ManagedTextSection`. (#86657)
Theodore Tsirpanis [Sat, 27 May 2023 00:14:23 +0000 (03:14 +0300)]
Use `u8` literals in `ManagedTextSection`. (#86657)

16 months agoCI: Fix running the workaround for `NuGet-Migrations` issue (#85692)
Ankit Jain [Fri, 26 May 2023 23:50:09 +0000 (19:50 -0400)]
CI: Fix running the workaround for `NuGet-Migrations` issue (#85692)

* CI: Fix running the workaround for `NuGet-Migrations` issue

The workaround adds:

`(CONSOLE_TEMP_DIR="%24(mktemp -d)" %3B "$DOTNET_ROOT/dotnet" new console -o "$CONSOLE_TEMP_DIR" %3B rm -rf "$CONSOLE_TEMP_DIR") || true`

which uses `$DOTNET_ROOT/dotnet`. But this is set for `HelixPreCommand`
which runs *before* `DOTNET_ROOT` is set.

Instead, use `HelixCommandPrefixItem`.

* rename HelixCommandPrefixItem to HelixCommandPrefixEnvVarItem

* Fix in helixpublishwitharcade.proj also

* Add the workaround for legacy payloads also, which includes wasm runtime tests

* fix typo

16 months agoAddress Metrics APIs issues (#86740)
Tarek Mahmoud Sayed [Fri, 26 May 2023 23:34:55 +0000 (16:34 -0700)]
Address Metrics APIs issues (#86740)

16 months agoAdd support for types with parameterized ctors to config binder gen (#86365)
Layomi Akinrinade [Fri, 26 May 2023 21:58:23 +0000 (14:58 -0700)]
Add support for types with parameterized ctors to config binder gen (#86365)

* Add support for types with parameterized ctors to config binder gen

* Ensure param-prop binding & exception behavior match reflection implementation

* Fix ctor preference logic and enable passing test

16 months agoChange our Android build and test legs to use the new CBL-Mariner-based images. ...
Jeremy Koritzinsky [Fri, 26 May 2023 21:38:17 +0000 (14:38 -0700)]
Change our Android build and test legs to use the new CBL-Mariner-based images. (#86776)

16 months ago[ComInterfaceGenerator] Fix StringMarshalling error message and actually copy attribu...
Jackson Schuster [Fri, 26 May 2023 20:52:09 +0000 (13:52 -0700)]
[ComInterfaceGenerator] Fix StringMarshalling error message and actually copy attributes from methods to shadows (#86731)

Co-authored-by: Jeremy Koritzinsky <jkoritzinsky@gmail.com>
16 months agoJIT: Pick some low-hanging fruit in physical promotion throughput (#86792)
Jakob Botsch Nielsen [Fri, 26 May 2023 19:39:48 +0000 (21:39 +0200)]
JIT: Pick some low-hanging fruit in physical promotion throughput (#86792)

* Skip any IR traversals entirely if there are no candidates locals for
  physical promotion
* During accounting, do a quick pre-check for candidates in each
  statement using the linked locals list, before doing the tree walk.

Result:
```
Collection                                       PDIFF
aspnet.run.windows.x64.checked.mch              -0.59%
benchmarks.run.windows.x64.checked.mch          -0.65%
benchmarks.run_pgo.windows.x64.checked.mch      -0.65%
benchmarks.run_tiered.windows.x64.checked.mch   -0.65%
coreclr_tests.run.windows.x64.checked.mch       -0.66%
libraries.crossgen2.windows.x64.checked.mch     -0.61%
libraries.pmi.windows.x64.checked.mch           -0.63%
libraries_tests.pmi.windows.x64.checked.mch     -0.68%
```

16 months agoJIT: Have physical promotion insert read backs before possible implicit control flow...
Jakob Botsch Nielsen [Fri, 26 May 2023 19:15:33 +0000 (21:15 +0200)]
JIT: Have physical promotion insert read backs before possible implicit control flow (#86706)

Physical promotion relies on being able to read back any promoted field
that is fresher in its struct local before control flows to any
successor block. This was failing to take implicit control flow into
account.

Fix #86498

16 months agoJIT: Allow RBO for known relops even without a dominator (#86774)
Jakob Botsch Nielsen [Fri, 26 May 2023 19:12:09 +0000 (21:12 +0200)]
JIT: Allow RBO for known relops even without a dominator (#86774)

Delay the check for whether there is a dominator to the case where we're
actually going to try to infer from it.

16 months agoGuarded devirtualization: multiple type checks (#86551)
Egor Bogatov [Fri, 26 May 2023 18:47:12 +0000 (20:47 +0200)]
Guarded devirtualization: multiple type checks (#86551)

Co-authored-by: Andy Ayers <andya@microsoft.com>
16 months agoUpdate NativeAot with latest ILLink changes (#86712)
Sven Boemer [Fri, 26 May 2023 17:44:43 +0000 (10:44 -0700)]
Update NativeAot with latest ILLink changes (#86712)

This brings us up to date with changes from `dotnet/linker` and
allows us to remove the `ReferenceSource` directories.

* Update Dataflow ReferenceSource

* Update ILCompiler DataFlow

* Update Logging ReferenceSource

* Update ILCompiler Logging

* Update Common/Compiler ReferenceSource

* Apply formatting

* Fix up license headers

* Update Common/Compiler

* Remove ReferenceSource

* Apply suggestions from code review

Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
---------

Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
16 months ago[mono][debugger] Remove cast bug (#86789)
Ilona Tomkowicz [Fri, 26 May 2023 17:10:03 +0000 (19:10 +0200)]
[mono][debugger] Remove cast bug (#86789)

* Fix.

* Test standardization.

16 months agoRemove inconsistent comments in Convert.cs (#86425)
skyoxZ [Fri, 26 May 2023 16:24:07 +0000 (00:24 +0800)]
Remove inconsistent comments in Convert.cs (#86425)

* Remove inconsistent comments

* Fix inconsistent comments

* Fix inconsistent comments

16 months agoAdd adjacency row length check (#86716)
Stefan [Fri, 26 May 2023 15:45:01 +0000 (17:45 +0200)]
Add adjacency row length check (#86716)

16 months agoupdate MediaTypeNames (#86770)
Tomas Weinfurt [Fri, 26 May 2023 14:56:20 +0000 (16:56 +0200)]
update MediaTypeNames (#86770)

16 months agofix ISA outerloop tests (#86705)
Egor Bogatov [Fri, 26 May 2023 09:55:14 +0000 (11:55 +0200)]
fix ISA outerloop tests (#86705)

16 months agoExpand CORINFO_HELP_CHKCASTANY cast (#86728)
Egor Bogatov [Fri, 26 May 2023 09:08:58 +0000 (11:08 +0200)]
Expand CORINFO_HELP_CHKCASTANY cast (#86728)

16 months ago[mono] Exclude unused bundle files in AppleAppBuilder (#86316)
Milos Kotlar [Fri, 26 May 2023 08:39:48 +0000 (10:39 +0200)]
[mono] Exclude unused bundle files in AppleAppBuilder (#86316)

* Exclude .cs dedup file

* Use excludes list and use a wildcard for icudt_*

* Use variable for ExcludeFromAppDir

16 months agoDump data in proc test (#86784)
Dan Moseley [Fri, 26 May 2023 07:56:47 +0000 (02:56 -0500)]
Dump data in proc test (#86784)

16 months ago[wasm] Add build-runtime-tests make target (#86785)
Ankit Jain [Fri, 26 May 2023 06:22:05 +0000 (02:22 -0400)]
[wasm] Add build-runtime-tests make target (#86785)

16 months agoLocalized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 218865...
dotnet bot [Fri, 26 May 2023 05:08:07 +0000 (22:08 -0700)]
Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2188652 (#86779)

* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2188521

* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2188521

16 months ago[wasm] Re-enable ~6700 runtime tests that got disabled mistakenly (#86747)
Ankit Jain [Fri, 26 May 2023 03:55:25 +0000 (23:55 -0400)]
[wasm] Re-enable ~6700 runtime tests that got disabled mistakenly (#86747)

* [wasm] Fix running merged test wrappers in runtime tests

- These were all getting removed because it looked for the incorrect
  script path in case of wasm

* [wasm] Disable a multithreaded runtime test

```
Operation is not supported on this platform.
   at System.Threading.Thread.ThrowIfNoThreadStart(Boolean internalThread)
   at System.Threading.Thread.Start(Boolean captureContext, Boolean internalThread)
   at System.Threading.Thread.Start()
   at MutualThdRecur_fptr.main()
   at Program.<>c__DisplayClass0_0.<<Main>$>g__TestExecutor29|30(TestFilter filter, StreamWriter tempLogSw, StreamWriter statsCsvSw)
```

* [wasm] Disable a failing test in JIT.Performance

`JIT/Performance/CodeQuality/Benchstones/MDBenchI/MDPuzzle/`
https://github.com/dotnet/runtime/issues/86772

* [wasm] Disable all JIT.Performance tests for now

16 months agoDefine the managed dependencies of the crossgen-corelib.proj file through ProjectRefe...
Jeremy Koritzinsky [Thu, 25 May 2023 22:38:38 +0000 (15:38 -0700)]
Define the managed dependencies of the crossgen-corelib.proj file through ProjectReferences (#86735)

16 months agoAdd some more testing around shadowing, inheritance, and project boundaries. (#86732)
Jeremy Koritzinsky [Thu, 25 May 2023 22:38:16 +0000 (15:38 -0700)]
Add some more testing around shadowing, inheritance, and project boundaries. (#86732)

16 months ago[wasm] Install latest LTS npm/node for codespaces (#86767)
Radek Doulik [Thu, 25 May 2023 20:00:22 +0000 (22:00 +0200)]
[wasm] Install latest LTS npm/node for codespaces (#86767)

* [wasm] Install latest LTS npm/node for codespaces

* Fix docker build

16 months agoUse cinv and cneg instead of csel when possible (#84926)
SwapnilGaikwad [Thu, 25 May 2023 20:00:09 +0000 (21:00 +0100)]
Use cinv and cneg instead of csel when possible (#84926)

* Use cinv instead of csel when possible

* Fix when the operands of conditional select should be reversed

* Scope down the cinv optimisation to local vars

* Use more generic CSINV instead of CINV instruction

* Add support for CSNEG and refactor conditional selects

* Fix initialisation of srcReg2

* Add RequiresProcessIsolation property to fix test failures

* Address review comments - Part 1

* Remove output type from conditional negate tests

* Ensure operands of cneg/cinv are invariants while optimising

* Update tests to the new format

* Use annotations to run tests through the framework

* Fix conditional negate tests

* Handle conditional negate/invert of shifted operands

16 months agoMake helix-inner-step send job warnaserror the same between windows and non-windows...
Parker Bibus [Thu, 25 May 2023 19:46:50 +0000 (12:46 -0700)]
Make helix-inner-step send job warnaserror the same between windows and non-windows platforms (#86729)

Add warnaserror to the Unix send to Helix step to match the windows send to helix step.

16 months ago[NativeAOT] Handle event pipe environment variable configuration and output to file...
Elinor Fung [Thu, 25 May 2023 19:40:52 +0000 (21:40 +0200)]
[NativeAOT] Handle event pipe environment variable configuration and output to file (#86656)

Updates to NativeAOT event pipe:
- Respect environment variable configuration
- Handle writing out to a file
- Enable tracing/eventpipe/config/name_config_with_pid test, which uses environment variable configuration to write directly to a file.

16 months agoAdd `DiagnosticOr<T>` type for gracefully handling failures in incremental generator...
Jackson Schuster [Thu, 25 May 2023 18:27:07 +0000 (11:27 -0700)]
Add `DiagnosticOr<T>` type for gracefully handling failures in incremental generator transformations (#86603)

16 months ago[mono][debugger] Don't pass uninitialized context to debugger (#86625)
Vlad Brezae [Thu, 25 May 2023 15:37:56 +0000 (18:37 +0300)]
[mono][debugger] Don't pass uninitialized context to debugger (#86625)

mono_dbg_debugger_agent_user_break first tries to initialize a context before sending it to the debugger machinery. If, during unwinding, we don't have a saved context, we were passing uninitialized data (with interpreter for example). On some architectures this was making unwinding break in mono_walk_stack_full, because the stack pointer was invalid. This change makes it so we at least pass a valid context.

16 months ago[Mono] Pass SIMD type variables using SIMD registers (#86634)
Fan Yang [Thu, 25 May 2023 15:35:43 +0000 (11:35 -0400)]
[Mono] Pass SIMD type variables using SIMD registers (#86634)

* Pass SIMD type variables in SIMD registers

* Disable support for 256/512 bit vectors.

---------

Co-authored-by: Zoltan Varga <vargaz@gmail.com>
16 months agoEnsure that the generated JsonSerializerContext.Default static property returns a...
Eirik Tsarpalis [Thu, 25 May 2023 14:38:16 +0000 (15:38 +0100)]
Ensure that the generated JsonSerializerContext.Default static property returns a sigleton. (#86757)

16 months agoInitial work to enable EventPipe in Linux (#86226)
Lakshan Fernando [Thu, 25 May 2023 11:57:41 +0000 (04:57 -0700)]
Initial work to enable EventPipe in Linux (#86226)

* Initial work to enable EventPipe in Linux

* GCC build break fix

* Only enable Unix

* FB

* restricting iOS

* Update src/coreclr/nativeaot/Directory.Build.props

Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
* FB

* license header

* Update src/coreclr/nativeaot/Runtime/eventpipe/ep-rt-aot.h

Co-authored-by: Elinor Fung <elfung@microsoft.com>
* FB

---------

Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
Co-authored-by: Elinor Fung <elfung@microsoft.com>
16 months agoLocalized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 218795...
dotnet bot [Thu, 25 May 2023 10:02:58 +0000 (03:02 -0700)]
Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2187956 (#86733)

* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2187689

* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2187689

16 months agoAdd IsEmpty and Length properties to System.BinaryData (#86721)
Cédric Luthi [Thu, 25 May 2023 09:40:39 +0000 (11:40 +0200)]
Add IsEmpty and Length properties to System.BinaryData (#86721)

Fixes #77970

16 months ago[browser] threads & js cleanup (#86278)
Pavel Savara [Thu, 25 May 2023 09:28:47 +0000 (11:28 +0200)]
[browser] threads & js cleanup (#86278)

16 months agoJIT: Adjust physical promotion heuristics (#86660)
Jakob Botsch Nielsen [Thu, 25 May 2023 09:08:22 +0000 (11:08 +0200)]
JIT: Adjust physical promotion heuristics (#86660)

Adjust the heuristics to take into account recent work on liveness and
assignment decomposition.  Stop phrasing things in terms of code size
(multiplied by basic block weights, which does not make sense).

16 months ago[jiterp] Fix rare case where an AOT method's arg_offsets were uninitialized while...
Katelyn Gadd [Thu, 25 May 2023 08:44:05 +0000 (01:44 -0700)]
[jiterp] Fix rare case where an AOT method's arg_offsets were uninitialized while we jitted its transition wrapper (#86745)

16 months ago[interp] Add float32 Vector128.Equals (#86738)
Katelyn Gadd [Thu, 25 May 2023 04:37:39 +0000 (21:37 -0700)]
[interp] Add float32 Vector128.Equals (#86738)

16 months agoAdd Microsoft.Extensions.Diagnostics.* to Aspnet Transport package (#86725)
William Godbe [Thu, 25 May 2023 02:16:53 +0000 (19:16 -0700)]
Add Microsoft.Extensions.Diagnostics.* to Aspnet Transport package (#86725)

16 months agoUse globalization invariant mode + prefer speed for AOT compilers (#86691)
Michal Strehovský [Thu, 25 May 2023 02:07:04 +0000 (11:07 +0900)]
Use globalization invariant mode + prefer speed for AOT compilers (#86691)

16 months agoOnly build specific tracing tests for NativeAOT leg (#86697)
Elinor Fung [Wed, 24 May 2023 23:17:37 +0000 (01:17 +0200)]
Only build specific tracing tests for NativeAOT leg (#86697)

16 months ago[wasm] Exports cleanup (#86718)
Radek Doulik [Wed, 24 May 2023 21:05:45 +0000 (23:05 +0200)]
[wasm] Exports cleanup (#86718)

Remove sections for old emscripten builds

16 months agoImplement byval-out marshalling for unmanaged->managed (#86666)
Jeremy Koritzinsky [Wed, 24 May 2023 20:43:37 +0000 (13:43 -0700)]
Implement byval-out marshalling for unmanaged->managed (#86666)

16 months agoFix timeouts in resourcemanager test (#86680)
madelson [Wed, 24 May 2023 20:38:16 +0000 (16:38 -0400)]
Fix timeouts in resourcemanager test (#86680)

* Update BinaryResourceWriterUnitTest.cs

Apply suggestion from https://github.com/dotnet/runtime/issues/86013#issuecomment-1560231543

Co-authored-by: Buyaa Namnan <buyankhishig.namnan@microsoft.com>
16 months agoUse the BannedApiAnalyzer instead of the LinqPoison mechanism to ban Linq in the...
Jeremy Koritzinsky [Wed, 24 May 2023 20:02:50 +0000 (13:02 -0700)]
Use the BannedApiAnalyzer instead of the LinqPoison mechanism to ban Linq in the managed type system (#86673)

16 months agoAvoid unnecessary closure in ServiceProviderEngineScope.CaptureDisposable (#86683)
Stephen Toub [Wed, 24 May 2023 18:07:01 +0000 (14:07 -0400)]
Avoid unnecessary closure in ServiceProviderEngineScope.CaptureDisposable (#86683)

Every call to this method is allocating a closure object, in order to capture `service`, even though it's only needed for a rare case.

16 months ago[ComInterfaceGenerator] Warn if StringMarshalling doesn't match base and warn if...
Jackson Schuster [Wed, 24 May 2023 17:44:05 +0000 (10:44 -0700)]
[ComInterfaceGenerator] Warn if StringMarshalling doesn't match base and warn if base interface cannot be generated (#86467)

16 months agoDelete native AOT interop doc (#86704)
Jan Kotas [Wed, 24 May 2023 17:37:53 +0000 (10:37 -0700)]
Delete native AOT interop doc (#86704)

This document lives at
https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/interop
now.

16 months agoAdd comments in asm for R_AI (#86677)
Egor Bogatov [Wed, 24 May 2023 16:49:50 +0000 (18:49 +0200)]
Add comments in asm for R_AI (#86677)

16 months agoReduce allocation in Activity.{Parent}Id (#86685)
Stephen Toub [Wed, 24 May 2023 16:36:58 +0000 (12:36 -0400)]
Reduce allocation in Activity.{Parent}Id (#86685)

16 months agoUnify Roslyn testing SDK version across the repo (#86669)
Jeremy Koritzinsky [Wed, 24 May 2023 16:30:29 +0000 (09:30 -0700)]
Unify Roslyn testing SDK version across the repo (#86669)

16 months ago[mono][aot] Deduplicate runtime invoke wrappers on iOS (#85908)
Milos Kotlar [Wed, 24 May 2023 15:55:07 +0000 (17:55 +0200)]
[mono][aot] Deduplicate runtime invoke wrappers on iOS (#85908)

* Deduplicate runtime invoke wrappers on iOS

* Move log to the add_extra_method_full

16 months ago[ppc64le] Added float32 support and implemented all R4 opcodes (#86092)
Alhad Deshpande [Wed, 24 May 2023 15:15:10 +0000 (20:45 +0530)]
[ppc64le] Added float32 support and implemented all R4 opcodes (#86092)

* [ppc64le] Fixed thunk address 8 byte alignment issue

* Fixed FSharp crash issue

* [ppc64le] Implementation of mono_arch_get_delegate_virtual_invoke_impl method for ppc64le architecture

* Fixed clang15 build issues and returning address of sc_sp instead of value

* Added float32 support and implemented related opcodes

* Correction in OP_RCONV_TO_R cases

* Corrected code for few opcodes

16 months agoUse an mrgctx for all gshared methods on iOS (#86583)
Milos Kotlar [Wed, 24 May 2023 14:51:57 +0000 (16:51 +0200)]
Use an mrgctx for all gshared methods on iOS (#86583)

16 months agoFix MakeGenericType/Method argument validation for function pointers (#86686)
Jan Kotas [Wed, 24 May 2023 12:17:56 +0000 (05:17 -0700)]
Fix MakeGenericType/Method argument validation for function pointers (#86686)

Fixes #86628

16 months ago[OSX] HybridGlobalization implement compare native function (#85965)
Meri Khamoyan [Wed, 24 May 2023 11:08:56 +0000 (15:08 +0400)]
[OSX] HybridGlobalization implement compare native function (#85965)

Implemented CompareStringNative for OSX platforms
Added changes done by @ilonatommy in #86305

16 months agoDelete `GT_ASG` (#85871)
SingleAccretion [Wed, 24 May 2023 10:51:33 +0000 (13:51 +0300)]
Delete `GT_ASG` (#85871)

* Physical promotion

* Early liveness

* Local morph

* Add internal blocks

* Object allocator

* Inlining

* Indirect call transformer

* Patchpoint transformation

* Instrumentation

* Importer: production

* Importer: consumption

* Delete assignment rationalization

* Simple dead code removal

* More code removal

* Fix up some comments and variable names

* Fix stress

* Simplify BasicBlock::FirstNonPhiDef

* Duplicate a comment

* Remove dead code

* Fix naming and comments

16 months agoJIT: Follow related intervals for single-reg LIR temp intervals (#86632)
Jakob Botsch Nielsen [Wed, 24 May 2023 09:31:26 +0000 (11:31 +0200)]
JIT: Follow related intervals for single-reg LIR temp intervals (#86632)

16 months agoFix a bug in type hierarchy marking in the trimmer (#86635)
Vitek Karas [Wed, 24 May 2023 08:20:22 +0000 (01:20 -0700)]
Fix a bug in type hierarchy marking in the trimmer (#86635)

If the base class has DAM annotation on it, but the only access is through a variabled typed as the derived class, the marking of everything on the base class happens during the processing of the derived class.

The bug was that it would only apply marking for the difference in effective annotations between derived and base, so if the annotation is on base, then both have effectively the same annotation and there would be no additional marking on base. So for example private methods would not be marked.

This also affected warnings on virtual methods - see tests for more details.

16 months ago[mono][wasm] Fix support for virtual invokes. (#86687)
Zoltan Varga [Wed, 24 May 2023 08:20:03 +0000 (04:20 -0400)]
[mono][wasm] Fix support for virtual invokes. (#86687)

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

16 months agoadd nuget.projectmodel to version.details (#86650)
Oleksandr Didyk [Wed, 24 May 2023 08:16:28 +0000 (10:16 +0200)]
add nuget.projectmodel to version.details (#86650)

16 months ago[browser][non-icu] `HybridGlobalization` normalization. (#85510)
Ilona Tomkowicz [Wed, 24 May 2023 07:12:11 +0000 (09:12 +0200)]
[browser][non-icu] `HybridGlobalization` normalization. (#85510)

* Normalization.

* Missing measurement.

* Trying to fix trimming error.

* Applied @pavelsavara's idea.

* Code review improvement.

* Feedback: standardize the exceptions.

* Revert changes from #85516 to clean the CI.

* feedback

16 months ago[main] Update dependencies from dotnet/runtime dotnet/xharness dotnet/hotreload-utils...
dotnet-maestro[bot] [Tue, 23 May 2023 20:43:31 +0000 (15:43 -0500)]
[main] Update dependencies from dotnet/runtime dotnet/xharness dotnet/hotreload-utils (#86582)

* Update dependencies from https://github.com/dotnet/runtime build 20230522.1

Microsoft.NET.ILLink.Tasks , Microsoft.NET.Sdk.IL , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.ILAsm , runtime.native.System.IO.Ports , System.Text.Json
 From Version 8.0.0-preview.5.23265.1 -> To Version 8.0.0-preview.5.23272.1

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

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 8.0.0-prerelease.23259.1 -> To Version 8.0.0-prerelease.23272.1

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

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 8.0.0-alpha.0.23265.2 -> To Version 8.0.0-alpha.0.23272.2

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
16 months agoMetrics APIs Additions (#86567)
Tarek Mahmoud Sayed [Tue, 23 May 2023 19:44:37 +0000 (12:44 -0700)]
Metrics APIs Additions (#86567)

16 months agoRemove STJ dependency on IncrementalValuesProvider.Collect() (#86616)
Eirik Tsarpalis [Tue, 23 May 2023 19:38:17 +0000 (20:38 +0100)]
Remove STJ dependency on IncrementalValuesProvider.Collect() (#86616)

* Remove dependency on IncrementalValuesProvider.Collect()

* Address feedback.

16 months agoRemove ProjectCapability=DotNetCoreWeb from WasiApp (#86639)
Marek Fišera [Tue, 23 May 2023 18:56:04 +0000 (20:56 +0200)]
Remove ProjectCapability=DotNetCoreWeb from WasiApp (#86639)

16 months agoAlways use simple while loop when simd is not supported (#85267)
Daniel Svensson [Tue, 23 May 2023 18:51:54 +0000 (20:51 +0200)]
Always use simple while loop when simd is not supported (#85267)

16 months agoDogfood ComInterfaceGenerator in crossgen2 (#84643)
Jackson Schuster [Tue, 23 May 2023 18:32:36 +0000 (11:32 -0700)]
Dogfood ComInterfaceGenerator in crossgen2 (#84643)

16 months agoOnly call Free in unmanaged->managed stubs when ownership has been transfered to...
Jeremy Koritzinsky [Tue, 23 May 2023 18:13:26 +0000 (11:13 -0700)]
Only call Free in unmanaged->managed stubs when ownership has been transfered to the callee (#86415)

16 months agoFix possible stack overflow in TotalOrderIeee754Comparer (#86593)
Kevin Jones [Tue, 23 May 2023 17:07:17 +0000 (13:07 -0400)]
Fix possible stack overflow in TotalOrderIeee754Comparer (#86593)

* Fix possible stack overflow in TotalOrderIeee754Comparer

* Add a test

16 months agoUpdate dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimizati...
dotnet-maestro[bot] [Tue, 23 May 2023 17:06:23 +0000 (13:06 -0400)]
Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20230522.4 (#86637)

optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR
 From Version 1.0.0-prerelease.23271.4 -> To Version 1.0.0-prerelease.23272.4

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
16 months agoImprove Microsoft.Extensions.Configuration debugging (#86624)
James Newton-King [Tue, 23 May 2023 17:06:00 +0000 (01:06 +0800)]
Improve Microsoft.Extensions.Configuration debugging (#86624)

* Improve Microsoft.Extensions.Configuration debugging

* Clean up

* Clean up

* Clean up + tests

16 months agoJIT: Use unsigned native return types for small structs (#86631)
Jakob Botsch Nielsen [Tue, 23 May 2023 16:54:24 +0000 (18:54 +0200)]
JIT: Use unsigned native return types for small structs (#86631)

Prefer the return type to be unsigned when small structs are returned in
registers. This causes the backend to use zero extension instead of sign
extension in a few cases, which has a smaller encoding on xarch.

16 months agoFix assert failure in grow_heap_segment in no GC region. (#86644)
Peter Sollich [Tue, 23 May 2023 16:37:03 +0000 (18:37 +0200)]
Fix assert failure in grow_heap_segment in no GC region. (#86644)

This addresses issue #86612.

We won't actually decommit anything once we enter a no GC region, so the assert was overeager for this case, but it seems better to keep the assert and turn off the gradual_decommit_in_progress_p flag when we enter a no GC region.

16 months agoDynamic heap count (#86245)
Peter Sollich [Tue, 23 May 2023 15:43:41 +0000 (17:43 +0200)]
Dynamic heap count (#86245)

This is an initial implementation for changing the GC heap count dynamically in response to changing load conditions.

Using more heaps will increase memory footprint, but in most cases also improve throughput because more GC work is parallelized, and lock contention on the allocation code path is reduced by spreading the load.

We try to keep the measured overhead from lock contention and GC pauses at 5% or below, and only reduce the heap count if the measured overhead is below 1% and we estimate a significant reduction in memory footprint. There is some more fine tuning for the cases where smaller reductions in either footprint or overhead are possible without impacting the other side of the equation too much.

Because the input data for GC pause etc. are quite noisy, we use a median of 3 filter before the data is used to make decisions. Preliminary data suggests this is effective, but we may need to do more filtering if gains in either direction appear to be small.

16 months ago[mono][interp] Attempt to devirtualize call if we have type information about `this...
Vlad Brezae [Tue, 23 May 2023 15:31:31 +0000 (18:31 +0300)]
[mono][interp] Attempt to devirtualize call if we have type information about `this` (#85528)

* [mono][interp] Preserve klass information when generating MINT_CKNULL

This information will be useful to later devirtualize the call

* [mono][interp] Add more specific type information for EqualityComparer.Default

* [mono][interp] Devirtualize calls if we can find a final implementation

Remove asserts from mono_class_get_virtual_method so we can check a virtual method on any klass, returning NULL if no implementation is found.

* [mono][interp] Optimize out null check on ldloca

* [mono][interp] Constant fold unop conditionals applied to non null values

* [mono][interp] Optimize out unused MINT_BOX

* [mono] Remove duplicated code between interp and jit

* [mono][metadata] Allow method to be called for abstract classes

It will just return null if a concrete implementation wasn't found.

* [mono][interp] Don't populate wrong type information into the stack state

* [mono][interp] Don't devirtualize final methods

They can still be overriden

* [mono][interp] Ensure class is initialized before getting aot method

16 months agoFix Incorrect RequiresDynamicCode attribute message (#86602)
Rupesh Ghosh [Tue, 23 May 2023 13:41:12 +0000 (19:11 +0530)]
Fix Incorrect RequiresDynamicCode attribute message (#86602)

* Fix Incorrect RequiresDynamicCode attribute message

Replace GetEnumValues<TEnum> in the RequiresDynamicCode attribute message on System.Type.GetEnumValues, System.Reflection.SignatureType.GetEnumValues and System.Runtime.GetEnumValues with Enum.GetValues<T> with Enum.GetValues<T>

Fix #86585

* Update attribute message as suggested in PR

* Add warning suppression

16 months ago[mono][AOT] Enabled tests which fail to JIT compile during AOT (#86581)
Vlad-Alexandru Ionescu [Tue, 23 May 2023 11:11:48 +0000 (13:11 +0200)]
[mono][AOT] Enabled tests which fail to JIT compile during AOT (#86581)

* Enabled 2 tests

Signed-off-by: Vlad - Alexandru Ionescu <vlad-alexandruionescu@Vlads-MacBook-Pro-5.local>
---------

Signed-off-by: Vlad - Alexandru Ionescu <vlad-alexandruionescu@Vlads-MacBook-Pro-5.local>
Co-authored-by: Vlad - Alexandru Ionescu <vlad-alexandruionescu@Vlads-MacBook-Pro-5.local>
16 months ago[browser] Turn webcil off for .NET < 8.0 (#86505)
Marek Fišera [Tue, 23 May 2023 08:54:46 +0000 (10:54 +0200)]
[browser] Turn webcil off for .NET < 8.0 (#86505)

16 months agoUnreachable filter end (#86492)
Vitek Karas [Tue, 23 May 2023 07:53:01 +0000 (00:53 -0700)]
Unreachable filter end (#86492)

Fixes the problem described in https://github.com/dotnet/roslyn/issues/67494 for illink.

`endfilter` instruction must be kept if the filter block is kept, even if the instruction itself is unreachable - per the ECMA spec. Fix the branch removal code to preserve the instruction unconditionally.

Adds a test to validate the new behavior.

I also enabled the test to run on NativeAOT, since it has code to handle this as well. We only validate that the compiler will not crash/warn, the Kept validation is disabled, since we can't really inspect IL of the produced methods in AOT.

Also fixes a bug in the illink test infra where the `By` property on `SkipKeptItemsValidationAttribute` was ignored.

16 months agoFix endless loop in illink analyzer (#86449)
Vitek Karas [Tue, 23 May 2023 07:50:10 +0000 (00:50 -0700)]
Fix endless loop in illink analyzer (#86449)

The root cause is the fact that `ArrayValue` is mutable, so it needs to be `DeepCopy` everywhere. So the first set of fixes is to make sure that even hoisted locals are correctly copied.
The second problem is that we use `HashSet` to store multiple values in `ValueSet`/`MultiValue`. HashSet assumes that items don't change identity (equality group) while they're stored inside. But `ArrayValue` does exactly that. So we can't rely on pure `HashSet` functionality to implement `Equals`.

Changes:
* Make Maybe<T> an IDeepCopyValue and make sure it deep copies its value - because it can store values which require a deep copy
* Make ValueSet<T> an IDeepCopyValue since it can store values which require a deep copy (this causes an effective rename of MultiValue.Clone to MultiValue.DeepCopy - lot of files touched)
* Modify ValueSet<T> to be careful when comparing for equality - we can't rely on immutability of values and since we store them in a hashset, the hashset itself effectively breaks. Maybe we should consider switching to a simple List? But then we want to to unify same values.
* Modify array equality comparison - previously it caused an allocation of a `HashSet` - we compare values quite a bit (in analyzer during multi-pass analysis). Currently we rely on values in arrays to be immutable.

Future looking:
The data flow analysis simply doesn't have a solution for mutable values (mostly mutable refence types, but I think similar set of problems might occur with structs as well). ILLink implements by-ref values, which are probably the closest approximation yet, but the full CFG data flow doesn't support those yet. And ultimately it's probably more complex then just by-ref values.
Proper fix is complex, and requires some design work first.

Note that we will want to backport this to .NET 7 very likely - I haven't looked yet how well it will port.

16 months agoAllow overbudget for small methods (#86473)
Egor Bogatov [Tue, 23 May 2023 07:21:59 +0000 (09:21 +0200)]
Allow overbudget for small methods (#86473)

Co-authored-by: Andy Ayers <andya@microsoft.com>
16 months agoAdd note about transient pointers to ECMA augments (#86622)
Jan Kotas [Tue, 23 May 2023 05:04:38 +0000 (22:04 -0700)]
Add note about transient pointers to ECMA augments (#86622)

Fixes #62784

16 months agoAbstract out System.Reflection.Emit.ILGenerator (#86594)
Buyaa Namnan [Tue, 23 May 2023 02:36:40 +0000 (19:36 -0700)]
Abstract out System.Reflection.Emit.ILGenerator (#86594)

* Abstract out ILGenerator

* Finish up abstracting

* Remove protected abstract methods, use more public abstract instead

* Use RuntimeILGenerator for Linq test

16 months agoUpdate GetElement and ToScalar to lower IND, LCL_FLD, and LCL_VAR specially (#86400)
Tanner Gooding [Tue, 23 May 2023 01:53:29 +0000 (18:53 -0700)]
Update GetElement and ToScalar to lower IND, LCL_FLD, and LCL_VAR specially (#86400)

* Update GetElement and ToScalar to lower IND, LCL_FLD, and LCL_VAR specially

* Ensure GetElement still correctly handles too large indices

* Only optimize to LCL_FLD for lvDoNotEnregister

* Account for an extreme edge case in offset overflow

* Use simdSize rather than maxSIMDStructBytes

16 months ago[wasm] No longer discard jiterp inference information when crossing a branch (#86611)
Katelyn Gadd [Tue, 23 May 2023 01:52:18 +0000 (18:52 -0700)]
[wasm] No longer discard jiterp inference information when crossing a branch (#86611)

* Discarding inferred state when crossing a branch is not strictly necessary and reduces performance
* Don't allow treating ldloca'd addresses as constant

16 months agoAdd a test for the first chance exception event (#86560)
SingleAccretion [Mon, 22 May 2023 23:33:11 +0000 (02:33 +0300)]
Add a test for the first chance exception event (#86560)

16 months agoRename setting for using RID graph to System.Runtime.Loader.UseRidGraph (#86598)
Elinor Fung [Mon, 22 May 2023 22:29:48 +0000 (00:29 +0200)]
Rename setting for using RID graph to System.Runtime.Loader.UseRidGraph (#86598)

16 months agoEnsure Avx512Vbmi has [Intrinsic] on the right members (#86604)
Tanner Gooding [Mon, 22 May 2023 22:25:03 +0000 (15:25 -0700)]
Ensure Avx512Vbmi has [Intrinsic] on the right members (#86604)

* Ensure Avx512Vbmi has [Intrinsic] on the right members

* Ensure vpermb is covered

16 months agoJIT: Switch basic block successors to a visitor pattern (#86543)
Jakob Botsch Nielsen [Mon, 22 May 2023 22:00:37 +0000 (00:00 +0200)]
JIT: Switch basic block successors to a visitor pattern (#86543)

BasicBlock::GetAllSuccs seems to be very slow.

16 months agoSwitch physical promotion stress modes to only be enabled in checked builds (#86590)
Jakob Botsch Nielsen [Mon, 22 May 2023 21:53:06 +0000 (23:53 +0200)]
Switch physical promotion stress modes to only be enabled in checked builds (#86590)

Otherwise we may be running old preview 4 bits with physical promotion
enabled and running into issues that were already fixed.

Fix #86588

16 months agoAvoid capturing diagnostic objects in Regex source generator incremental values ...
Stephen Toub [Mon, 22 May 2023 21:44:38 +0000 (17:44 -0400)]
Avoid capturing diagnostic objects in Regex source generator incremental values (#86606)

It's mostly a non-issue given how we use it, but Diagnostic's message arguments are compared with reference equality rather than value equality.  Store the data into our own object instead, and only create the actual Diagnostic objects when we're about to report them.

16 months agoAvoid capturing diagnostic objects in SG incremental values. (#86605)
Eirik Tsarpalis [Mon, 22 May 2023 21:39:42 +0000 (22:39 +0100)]
Avoid capturing diagnostic objects in SG incremental values. (#86605)

16 months ago[main] Update dependencies from dnceng/internal/dotnet-optimization (#86436)
dotnet-maestro[bot] [Mon, 22 May 2023 21:02:11 +0000 (14:02 -0700)]
[main] Update dependencies from dnceng/internal/dotnet-optimization (#86436)

* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20230517.3

optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR
 From Version 1.0.0-prerelease.23260.3 -> To Version 1.0.0-prerelease.23267.3

Dependency coherency updates

Microsoft.SourceLink.GitHub,Microsoft.DotNet.XliffTasks
 From Version 8.0.0-beta.23252.2 -> To Version 8.0.0-beta.23218.3 (parent: Microsoft.DotNet.Arcade.Sdk

* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20230518.7

optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR
 From Version 1.0.0-prerelease.23260.3 -> To Version 1.0.0-prerelease.23268.7

* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20230519.15

optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR
 From Version 1.0.0-prerelease.23260.3 -> To Version 1.0.0-prerelease.23269.15

* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20230520.4

optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR
 From Version 1.0.0-prerelease.23260.3 -> To Version 1.0.0-prerelease.23270.4

* Require clang-16 for PGO optimization

* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20230521.4

optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR
 From Version 1.0.0-prerelease.23260.3 -> To Version 1.0.0-prerelease.23271.4

* Revert sourcelink and xliff-tasks downgrades

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
Co-authored-by: Sven Boemer <sbomer@gmail.com>
16 months agoAvoid ToString allocations for each ISpanFormattable value in string.Concat/Join...
Stephen Toub [Mon, 22 May 2023 19:51:08 +0000 (15:51 -0400)]
Avoid ToString allocations for each ISpanFormattable value in string.Concat/Join(..., IEnumerable<T>) (#86521)

We can use a T's ISpanFormattable implementation to avoid the individual ToStrings. We also don't need to maintain a separate implementation for Concat; at the cost of one branch per value, we can just reuse the Join implementation and pick up all of its optimizations for Concat.