platform/upstream/dotnet/runtime.git
18 months agoFix reserving executable memory as per allocation type in ClrVirtualAllocWithinRange...
Ilia [Fri, 24 Mar 2023 21:36:24 +0000 (22:36 +0100)]
Fix reserving executable memory as per allocation type in ClrVirtualAllocWithinRange() (#83819)

Fixes #83818

18 months agoImprove incremental handling in regex generator (#83868)
Stephen Toub [Fri, 24 Mar 2023 21:05:41 +0000 (17:05 -0400)]
Improve incremental handling in regex generator (#83868)

* Improve incrementalism:
- Don't calculate the tree or analysis inside the semantic info.
- Dont' store methodDeclartionSyntax and store a comparable across runs location instead.

* Add comments, clean up, and simplify parser

---------

Co-authored-by: Chris Sienkiewicz <chsienki@microsoft.com>
18 months ago[LSRA TP]: Skip free heuristics if no free registers are available (#83569)
Kunal Pathak [Fri, 24 Mar 2023 20:44:13 +0000 (13:44 -0700)]
[LSRA TP]: Skip free heuristics if no free registers are available (#83569)

* Add busy regs selection in different file to improve Release TP

* jit format

* Remove all the ifdef except in Release

* Skip the freeCandidates checks from free heuristics in Release mode

* Simplify things

18 months agoFix for issue #78866 and regression test (#83697)
Tomáš Rylek [Fri, 24 Mar 2023 19:28:10 +0000 (20:28 +0100)]
Fix for issue #78866 and regression test (#83697)

This fix breaks the infinite recursion cycle reported in the
above issue by propagating class load level to the interface
iterator.

Thanks

Tomas

18 months agoFix null dereference when logging enabled on 32-bit platforms in HostCodeHeap::Initia...
Ilia [Fri, 24 Mar 2023 19:13:05 +0000 (20:13 +0100)]
Fix null dereference when logging enabled on 32-bit platforms in HostCodeHeap::InitializeHeapList() (#83875)

18 months agoEncode the previous instruction's source reg to match consecutive loads from the...
SwapnilGaikwad [Fri, 24 Mar 2023 18:37:39 +0000 (18:37 +0000)]
Encode the previous instruction's source reg to match consecutive loads from the same stack location (#83886)

18 months agoConvert JIT\Directed tests to merged test groups (#83256)
Mark Plesko [Fri, 24 Mar 2023 17:57:06 +0000 (10:57 -0700)]
Convert JIT\Directed tests to merged test groups (#83256)

Steps involved in conversion:
- Remove test straccess4 - identical to straccess3_cs_d
- Remove duplicate csproj files - identical to versions without _cs in their names
- Manually remove main arg from out_of_range_fp_to_int_conversions.
- Remove Main from straccess3 (save as comment for local use)
- Remove switchdefaultonly* Main argument (replace with noinline constant argument)
- Remove IL namespace/class declarations (in shift/) that break ILTransform tool
  Related PR #64837
- Use $(TestLibraryProjectPath) in 5 ilproj files (helps ILTransform)
  Related PR #66157
- Manually rename ldfldstatic1_il_r

  Actual dedup strategy groups projs in groups based on suffixes _r, _d, etc.
  This file does not have a matching _d version, which leads ILTransform to
  inconsistently renaming projects.
- [cs-main] Remove unused Main arg from arglist\vararg.cs
- [ILTransform -p] Rename _d/_r ilproj to _il_d/_il_r (but undo debuginfo/tests)
- [ILTransform -n] 3 iterations - Deduplicate project names
- [ILTransform -a] Match .assembly names to project names
- [ILTransform -prociso] Set RequiresProcessIsolation based on other attributes
- [ILTransform -collapse-main-sig] Collapse .method Main to one line to help future ILTransform passes
- [ILTransform -public] Make entry points public, add class if entrypoint is global
- Manually remove "public public" from C# (ILTransform failure on multiline declaration)
- Manually fix accessibility after exposing main class (other now-public methods with private signatures)
- Manually add missing public/class to entry points (missed by ILTransform)
- [ILTransform -sr] Fix System.Runtime references
- [ILTransform -ilfact] [Fact], Main->TestEntryPoint, no OutputType==Exe
- Add projects for merged test runners and Directory.Build.props
- Move simple test runner code to __GenerateMainWrapper.Main (avoids conflicts with Program in tests)
- Rename IL classes to avoid keywords
- Manually update issues.targets (after renaming various projects)
- Manually convert more_tails.cs (and generated IL from it)
- Manually fix punning.cs (depended on simple wrapper using "class Program")
- Finish merge - incorporate changes to csproj/Dir.B.props - fix xunit.analyzers errors
- Rename csproj to be shorter/more consistent with upcoming JIT/Regression change

18 months ago[wasm] Work around NuGet-Migrations issue (#83832)
Alexander Köplinger [Fri, 24 Mar 2023 17:27:43 +0000 (18:27 +0100)]
[wasm] Work around NuGet-Migrations issue (#83832)

Like https://github.com/dotnet/runtime/pull/83833 but also includes wasi jobs.

See https://github.com/dotnet/runtime/issues/80619

18 months agoDump Jit flags textually in mcs (#83865)
Bruce Forstall [Fri, 24 Mar 2023 17:26:06 +0000 (10:26 -0700)]
Dump Jit flags textually in mcs (#83865)

E.g.,
`
0-GetJitFlags key 0 sizeInBytes-16 jitFlags-0000010040800010 instructionSetFlags-03FD7FFFFFA1FFFE ( CORJIT_FLAG_DEBUG_INFO CORJIT_FLAG_SKIP_VERIFICATION CORJIT_FLAG_BBOPT CORJIT_FLAG_TIER1 X86Base SSE SSE2 SSE3 SSSE3 SSE41 SSE42 AVX AVX2 AES BMI1 BMI2 FMA LZCNT PCLMULQDQ POPCNT MOVBE AVX512F AVX512F_VL AVX512BW AVX512BW_VL AVX512CD AVX512CD_VL AVX512DQ AVX512DQ_VL X86Base_X64 SSE_X64 SSE2_X64 SSE3_X64 SSSE3_X64 SSE41_X64 SSE42_X64 AVX_X64 AVX2_X64 AES_X64 BMI1_X64 BMI2_X64 FMA_X64 LZCNT_X64 PCLMULQDQ_X64 POPCNT_X64 MOVBE_X64 AVX512F_X64 AVX512F_VL_X64 AVX512BW_X64 AVX512BW_VL_X64 AVX512CD_X64 AVX512CD_VL_X64 AVX512DQ_X64 AVX512DQ_VL_X64 )
`

18 months agoAdd note to doc about not specifying `hostfxr_initialize_parameters::dotnet_root...
Elinor Fung [Fri, 24 Mar 2023 17:11:43 +0000 (10:11 -0700)]
Add note to doc about not specifying `hostfxr_initialize_parameters::dotnet_root` (#83802)

18 months agoMove version.cpp out of hostcommon - only used by hostpolicy (#83864)
Elinor Fung [Fri, 24 Mar 2023 17:10:53 +0000 (10:10 -0700)]
Move version.cpp out of hostcommon - only used by hostpolicy (#83864)

18 months agoenable SupportedLinuxPlatforms_IsSupportedIsTrue on arm32 Ubuntu (#83799)
Tomas Weinfurt [Fri, 24 Mar 2023 16:38:25 +0000 (09:38 -0700)]
enable SupportedLinuxPlatforms_IsSupportedIsTrue on arm32 Ubuntu (#83799)

18 months agoHandle custom modifiers on parameter constraints (#83850)
Steve Harter [Fri, 24 Mar 2023 16:26:42 +0000 (11:26 -0500)]
Handle custom modifiers on parameter constraints (#83850)

18 months agoUpdate Microsoft.Build.* SDKs (#83877)
Viktor Hofer [Fri, 24 Mar 2023 14:55:56 +0000 (15:55 +0100)]
Update Microsoft.Build.* SDKs (#83877)

Avoids net45 prebuilds in Traversal projects: https://github.com/microsoft/MSBuildSdks/pull/430

18 months agoDisabled SIMD operator intrinsics. (#83888)
Jan Dupej [Fri, 24 Mar 2023 14:53:46 +0000 (15:53 +0100)]
Disabled SIMD operator intrinsics. (#83888)

18 months agoUpdate PartitionerStatic.cs (#83867)
Theodor Zoulias [Fri, 24 Mar 2023 13:51:11 +0000 (15:51 +0200)]
Update PartitionerStatic.cs (#83867)

Fixed a typo in the title of a region directive.

18 months ago[wasm] Exclude PInvoke with function pointer in TimeZoneTests from wasm compilation...
Marek Fišera [Fri, 24 Mar 2023 12:04:20 +0000 (13:04 +0100)]
[wasm] Exclude PInvoke with function pointer in TimeZoneTests from wasm compilation (#83805)

18 months agoeng/SourceBuild.props: when unset, let the repo determine RuntimeOS. (#82546)
Tom Deseyn [Fri, 24 Mar 2023 11:37:29 +0000 (12:37 +0100)]
eng/SourceBuild.props: when unset, let the repo determine RuntimeOS. (#82546)

* eng/SourceBuild.props: when unset, let the repo determine RuntimeOS.

When source-build builds runtime, it will pass RuntimeOS and BaseOS.

When the repo is built directly using './build.sh --sb', let the repo
determine those values rather than calculating them in SourceBuild.props.

* global-build-job.yml: remove unneeded runtimeOS param.

18 months ago[mono][sgen] Remove outdated assertion (#83824)
Vlad Brezae [Fri, 24 Mar 2023 09:27:27 +0000 (11:27 +0200)]
[mono][sgen] Remove outdated assertion (#83824)

objects_pinned is incremented when we fail to promote an object from nursery due to lack of memory. A long time ago, the concurrent collector was only scanning major objects, while the nursery objects were promoted from a separate nursery collection done also during the finishing pause. This is no longer the case as the finishing concurrent collection directly promotes objects from the nursery, having similar behavior to a normal blocking collection.

18 months ago[QUIC] Fix failing parallel tests (#83687)
Marie Píchová [Fri, 24 Mar 2023 08:31:04 +0000 (09:31 +0100)]
[QUIC] Fix failing parallel tests (#83687)

* Hocus pocus

* Enable failing test

* Fixed touching msquic when it's not supported.

* Feedback

* Test of output

* Feedback

18 months agoExplicitly require `.eh_frame_hdr` section (#83866)
Adeel Mujahid [Fri, 24 Mar 2023 03:46:52 +0000 (05:46 +0200)]
Explicitly require `.eh_frame_hdr` section (#83866)

18 months agoMore precise fix for #83792 (#83856)
Katelyn Gadd [Fri, 24 Mar 2023 00:24:17 +0000 (17:24 -0700)]
More precise fix for #83792 (#83856)

18 months ago[main] Update dependencies from dotnet/roslyn-analyzers (#83722)
dotnet-maestro[bot] [Thu, 23 Mar 2023 23:51:53 +0000 (18:51 -0500)]
[main] Update dependencies from dotnet/roslyn-analyzers (#83722)

* Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20230320.2

Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
 From Version 3.3.5-beta1.23165.1 -> To Version 3.3.5-beta1.23170.2

* Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20230321.1

Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
 From Version 3.3.5-beta1.23165.1 -> To Version 3.3.5-beta1.23171.1

* Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20230322.1

Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
 From Version 3.3.5-beta1.23165.1 -> To Version 3.3.5-beta1.23172.1

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
18 months agoFix marshaller types in attributes for exception marshallers and fix non-generic...
Jeremy Koritzinsky [Thu, 23 Mar 2023 23:36:03 +0000 (16:36 -0700)]
Fix marshaller types in attributes for exception marshallers and fix non-generic managed type with generic marshaller cases (#80461)

18 months ago[wasm] Try to work around NuGet-Migrations issue (#83833)
Steve Pfister [Thu, 23 Mar 2023 23:15:55 +0000 (19:15 -0400)]
[wasm] Try to work around NuGet-Migrations issue (#83833)

Works around a CI issue where we somehow can't access a named mutex and fails

Contributes to https://github.com/dotnet/runtime/issues/80619

18 months ago[mono][debugger] Trying to fix dereference null pointer (#83848)
Thays Grazia [Thu, 23 Mar 2023 23:11:41 +0000 (20:11 -0300)]
[mono][debugger] Trying to fix dereference null pointer (#83848)

* Trying to fix dereference null pointer

* fix compilation error

18 months agoJIT: ensure we keep throw blocks cold when combining blocks (#83842)
Andy Ayers [Thu, 23 Mar 2023 22:46:49 +0000 (15:46 -0700)]
JIT: ensure we keep throw blocks cold when combining blocks (#83842)

Noticed in a bunch of diffs that there were throw blocks intermixed
with regular blocks. Turns out when compacting a block followed by
a throw, we'd lose track of the fact that the combination should be cold.

18 months agobetter link to open new issues in other repos (#83839)
Dan Moseley [Thu, 23 Mar 2023 21:56:07 +0000 (15:56 -0600)]
better link to open new issues in other repos (#83839)

linking to the actual page that has links to open issues in other repos, not the template.

18 months agoAdd Symbolication to XUnitLogChecker (#83702)
Ivan Diaz Sanchez [Thu, 23 Mar 2023 21:53:16 +0000 (14:53 -0700)]
Add Symbolication to XUnitLogChecker (#83702)

18 months agoEnable xunit.analyzers in merged test groups. (#83806)
Mark Plesko [Thu, 23 Mar 2023 21:38:44 +0000 (14:38 -0700)]
Enable xunit.analyzers in merged test groups. (#83806)

Main goal is to enable the rule that all [Fact] methods are in public types.
We'll need a custom rule to check that [Fact] methods are themselves public.
- Add reference in test_dependencies.csproj
- Set RunAnalyzers in Directory.Build.props for merged test groups
- Mostly disable other analyzer rules
- Clean a few warnings - notably enable a few tests in HardwareIntrinsics by making them public

In the future we will likely use a src/tests-specific EditorConfigFiles (.globalconfig) to disable some things across that entire tree.

18 months agoWhen the aggressive GCCollectionMode is specified, make sure the compacting parameter...
Mukund Raghav Sharma (Moko) [Thu, 23 Mar 2023 21:35:11 +0000 (14:35 -0700)]
When the aggressive GCCollectionMode is specified, make sure the compacting parameter is set appropriately (#83708)

* When the aggressive GCCollectionMode is specified, make sure the compacting parameter is set appropriately

* Update src/coreclr/System.Private.CoreLib/src/System/GC.CoreCLR.cs

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Updated logic for NativeAoT

---------

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
18 months agoUpdate know issues template. (#83846)
Juan Hoyos [Thu, 23 Mar 2023 21:23:44 +0000 (14:23 -0700)]
Update know issues template. (#83846)

18 months agoLoad levels explanation (#83840)
David Wrighton [Thu, 23 Mar 2023 20:35:25 +0000 (13:35 -0700)]
Load levels explanation (#83840)

Add some descriptions of how load levels work in the runtime

18 months agoAppend leftovers of FromBase64Transform's input buffer to the transform buffer (...
David Cantú [Thu, 23 Mar 2023 20:32:13 +0000 (15:32 -0500)]
Append leftovers of FromBase64Transform's input buffer to the transform buffer (#82148)

* Append leftovers of FromBase64Transform's input buffer to the transform buffer

* Address feedback

* fill _inputbuffer correctly on small inputs (< 4)

18 months agoUpdate debug-dump-template.md AzDO tenant link (#83845)
Juan Hoyos [Thu, 23 Mar 2023 20:04:17 +0000 (13:04 -0700)]
Update debug-dump-template.md AzDO tenant link (#83845)

18 months agoAdded floor and ceiling intrinsics for `System.Runtime.Intrinsics.Vector128` and...
Vlad-Alexandru Ionescu [Thu, 23 Mar 2023 20:02:51 +0000 (21:02 +0100)]
Added floor and ceiling intrinsics for `System.Runtime.Intrinsics.Vector128` and `System.Numerics.Vector` (#83592)

Added floor and ceil intrinsics

Signed-off-by: Vlad - Alexandru Ionescu <vlad-alexandruionescu@Vlads-MacBook-Pro-4.local>
18 months ago[main] Update dependencies from dotnet/arcade (#83584)
dotnet-maestro[bot] [Thu, 23 Mar 2023 19:49:37 +0000 (14:49 -0500)]
[main] Update dependencies from dotnet/arcade (#83584)

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

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

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

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

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

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

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

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

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
18 months agoUsing canonical All-pointers GC desc in more scenarios. (#83800)
Vladimir Sadov [Thu, 23 Mar 2023 19:26:55 +0000 (12:26 -0700)]
Using canonical All-pointers GC desc in more scenarios. (#83800)

* all-pointer maps in AOT

* a few asserts and refactorings

* IsAllGCPointers

* optimize more cases of all-pointer GC series

* Adding a test

* undo redundant changes

* make gcc happy

* missing null check

* fix x86 build (more parenthesis and casting)

* SkipOnMono an implementation-specific test.

18 months agoAdjust Test Watcher Timeout for Test Collections (#83746)
Ivan Diaz Sanchez [Thu, 23 Mar 2023 18:11:55 +0000 (11:11 -0700)]
Adjust Test Watcher Timeout for Test Collections (#83746)

18 months agoFix paths in "Stripping symbols" message (#82215)
Adeel Mujahid [Thu, 23 Mar 2023 17:15:22 +0000 (19:15 +0200)]
Fix paths in "Stripping symbols" message (#82215)

18 months ago[wasm] Do not run embuilder minimal build (#83475)
Radek Doulik [Thu, 23 Mar 2023 16:56:14 +0000 (17:56 +0100)]
[wasm] Do not run embuilder minimal build (#83475)

* [wasm] Do not run embuilder minimal build

* Update emsdk deps

* Do not set WasmCachePath for AOT tests

* Use staging images

* Use specific images as staging are not ready

* Revert "Do not set WasmCachePath for AOT tests"

This reverts commit 988ccd483ae9a3362af7db5d20b1fcac4d623fbe.

* Do not set WasmCachePath for AOT tests

* Use the stable images again

The changes should be already in

* One more image to stable

* Remove obsolete line

18 months agoFix typo 'to if check' -> 'to check if' (#83809)
Ilia Kosenkov [Thu, 23 Mar 2023 12:23:24 +0000 (14:23 +0200)]
Fix typo 'to if check' -> 'to check if' (#83809)

18 months agoMono: Replace exception strings with those stored in the resx file (#78341)
Sami Haq [Thu, 23 Mar 2023 10:59:44 +0000 (10:59 +0000)]
Mono: Replace exception strings with those stored in the resx file (#78341)

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

Co-authored-by: Dan Moseley <danmose@microsoft.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
18 months agoAdd template to open a known issue with populated JSON (#83801)
Juan Hoyos [Thu, 23 Mar 2023 05:49:24 +0000 (22:49 -0700)]
Add template to open a known issue with populated JSON (#83801)

* Rename 04_blank_issue.md to 05_blank_issue.md

* Create known issue template

* Rename 04_known_issue.md to 04_known_issue.yml

* Update 04_known_issue.yml

* Update 04_known_issue.yml

18 months ago[wasm] More accurate jiterpreter cfg size estimation; generate smaller dispatch table...
Katelyn Gadd [Thu, 23 Mar 2023 03:52:33 +0000 (20:52 -0700)]
[wasm] More accurate jiterpreter cfg size estimation; generate smaller dispatch tables (#83759)

* More accurate cfg size estimation
* Generate smaller dispatch tables for traces with backward branches
* Make sure we never actually can dispatch to the unreachable entries in the back branch table
* If we somehow generate a module bigger than 4KB, don't try to compile it. Just log a warning
* Better cfg logging for failed branches
* Add a separate runtime option that controls whether trace monitoring will print to the log

18 months agoStop displaying missing info in replay runs (#83788)
Kunal Pathak [Thu, 23 Mar 2023 03:07:32 +0000 (20:07 -0700)]
Stop displaying missing info in replay runs (#83788)

* Stop displaying missing info in replay runs

* Stop displaying missing info in asmdiff runs

18 months agoTemporary workaround for #83792 (#83794)
Katelyn Gadd [Thu, 23 Mar 2023 02:00:21 +0000 (19:00 -0700)]
Temporary workaround for #83792 (#83794)

The inlining changes have caused us to run some stuff in the interpreter in AOT configuration that used to run in AOT, which is somehow causing some floating point tests to fail that pass in interp-only mode. This workaround makes the tests work again.

18 months agoReduce size of async state machine by a reference field (#83696)
Stephen Toub [Thu, 23 Mar 2023 01:09:10 +0000 (21:09 -0400)]
Reduce size of async state machine by a reference field (#83696)

Every async state machine today has a field for an Action.  That field is used to cache an Action that's lazily created to point to its MoveNext method.  It's only needed, however, if the state machine awaits something that's not a known awaiter.

Interestingly, Task itself has a field for storing a delegate, which is only used today when the Task is created to invoke a delegate (e.g. Task.Run, ContinueWith, etc.).  I've considered that a liability, but I just realized we can use that same field for this async method cached Action as well, making it relevant to almost all tasks, and avoiding the need to have an extra field on the state machine box.

As the m_action on a task impacts the DebuggerDisplay rendering, I've also added a DebuggerDisplay to the state machine box type.  We can improve this further in the future, and also add a DebuggerTypeProxy later if desired.

18 months agoRemove another reference field from async state machines (#83737)
Stephen Toub [Wed, 22 Mar 2023 22:50:22 +0000 (18:50 -0400)]
Remove another reference field from async state machines (#83737)

The async state machine Task-derived type currently adds three fields:
- The StateMachine
- An Action field for caching any delegate created to MoveNext
- The ExecutionContext to flow to the next MoveNext invocation

The other pending PR gets rid of the Action field by using the unused Action field from the base Task for that purpose.

This PR gets rid of the ExecutionContext field by using the unused state object field from the base Task for that purpose.  The field is exposed via the public AsyncState property, so this also uses a bit from the state flags field to prevent this state object from being returned from that property.

The combination of removing those two fields shaves 16 bytes off of every `async Task` state machine box on 64-bit.  The only remaining field added by the state machine type is for the state machine itself, which is required.

18 months agoRemove now unnecessary IsKnownConstant special-casing in interpolated string handlers...
Stephen Toub [Wed, 22 Mar 2023 22:49:42 +0000 (18:49 -0400)]
Remove now unnecessary IsKnownConstant special-casing in interpolated string handlers (#83762)

Now that the JIT will unroll memcpys, we're better off just letting it do its thing.

18 months agoForce ASM compiler to target the same triple as C, in WASI build (#83787)
Jo Shields [Wed, 22 Mar 2023 22:32:21 +0000 (18:32 -0400)]
Force ASM compiler to target the same triple as C, in WASI build (#83787)

The upstream WASI SDK sets a default compiler triple of `--target=wasm32-wasi`. We don't, because we're compiling our for-WASI-use version of Clang as part of our more general LLVM, and as such, the default compiler triple is the LLVM default (i.e. linux-x64 on x64 Linux, etc).

In one place, we compile an Assembly file using Clang by setting CMAKE_ASM_COMPILER_VERSION = CMAKE_ASM_COMPILER_VERSION - but whilst CMAKE_C_COMPILER_TARGET is overridden to always be wasm32-wasi in the wasi-sdk.cmake toolchain file, the toolchain file does not set CMAKE_ASM_COMPILER_TARGET (and thus, when compiling Assembly, our Clang default to linux-x64 etc, not wasm32-wasi). Therefore, force the issue here in our CMakeLists.txt, so we use the correct compiler target.

18 months agoJIT: tolerate malformed IL when counting block successors (#83676)
Andy Ayers [Wed, 22 Mar 2023 19:51:01 +0000 (12:51 -0700)]
JIT: tolerate malformed IL when counting block successors (#83676)

If we run synthesis, we may now invoke `BasicBlock::NumSucc` before we've
detected some cases of invalid IL, In particular an endfinally that is not
within a finally (this gets detected during importation).

Tolerate this by reporting that an endfinally with no handler index has no
successors.

Fixes #83674.

18 months agoUpdate owners and fabricbot (#83732)
Arthur Vickers [Wed, 22 Mar 2023 18:27:30 +0000 (18:27 +0000)]
Update owners and fabricbot (#83732)

18 months agoAdd MemoryMappedFile.CreateFromFile(SafeFileHandle) overload (#83134), fixes #79187
Amal Abeygunawardana [Wed, 22 Mar 2023 15:40:18 +0000 (02:40 +1100)]
Add MemoryMappedFile.CreateFromFile(SafeFileHandle) overload (#83134), fixes #79187

18 months agoMove optimize bools pass to a new file (#83768)
Alan Hayward [Wed, 22 Mar 2023 13:04:34 +0000 (13:04 +0000)]
Move optimize bools pass to a new file (#83768)

No code changes, just moving.

18 months agoIncreased max length of OP_STOREX_MEMBASE to 16 on arm64, (#83770)
Jan Dupej [Wed, 22 Mar 2023 12:31:39 +0000 (13:31 +0100)]
Increased max length of OP_STOREX_MEMBASE to 16 on arm64, (#83770)

18 months ago[NativeAOT] Support exporting methods from referenced assemblies in a formal way...
Ivan Povazan [Wed, 22 Mar 2023 09:02:35 +0000 (10:02 +0100)]
[NativeAOT] Support exporting methods from referenced assemblies in a formal way (#83396)

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

18 months ago[wasm] Cache files in simple server (#83744)
Radek Doulik [Wed, 22 Mar 2023 08:53:42 +0000 (09:53 +0100)]
[wasm] Cache files in simple server (#83744)

* [wasm] Cache files in simple server

This improves measurements comparison between hosts with different
storage speeds. In our case local storage vs NFS storage
on the otherwise equal hardware.

The cache is filled during initial runs of browser-bench.

Also do not prefetch `icudt.dat` as it is not used anymore.

* Use StringComparer.OrdinalIgnoreCase for the cache

18 months agoAdd LinkerFlavor to NativeAOT (#83558)
Adeel Mujahid [Wed, 22 Mar 2023 06:15:16 +0000 (08:15 +0200)]
Add LinkerFlavor to NativeAOT (#83558)

* Add ability to specify linker via -p:LinkerFlavor

* Set linux default to bfd

18 months agoImprove string.Substring (#83758)
Egor Bogatov [Wed, 22 Mar 2023 04:29:55 +0000 (05:29 +0100)]
Improve string.Substring (#83758)

18 months agoCorrect formatting of config binder generator (#83614)
Layomi Akinrinade [Wed, 22 Mar 2023 01:13:01 +0000 (18:13 -0700)]
Correct formatting of config binder generator (#83614)

* Correct formatting of config binder generator

* Use span tokenization in multi-line emission logic

18 months agoUse an aka.ms link for the breaking change doc issue template (#83757)
Jeff Handley [Wed, 22 Mar 2023 00:29:51 +0000 (17:29 -0700)]
Use an aka.ms link for the breaking change doc issue template (#83757)

18 months agoAvoid losing messages for memory-mapped stress log (#81038)
Andrew Au [Tue, 21 Mar 2023 22:36:00 +0000 (15:36 -0700)]
Avoid losing messages for memory-mapped stress log (#81038)

18 months agoBump main pre-release version iteration to preview4 (#83691)
Carlos Sánchez López [Tue, 21 Mar 2023 21:44:42 +0000 (14:44 -0700)]
Bump main pre-release version iteration to preview4 (#83691)

* Bump main version to preview4

* Bump to P4 of emsdk manifest

---------

Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
18 months ago[wasm] Jiterpreter monitoring phase take 2 (#83489)
Katelyn Gadd [Tue, 21 Mar 2023 20:47:40 +0000 (13:47 -0700)]
[wasm] Jiterpreter monitoring phase take 2 (#83489)

* Add a monitoring phase to jiterpreter traces, that monitors an approximate number of opcodes executed before specific types of bailouts.
If a trace bails out frequently without executing enough opcodes, it will be rejected and turned into a nop to improve performance.
* Fix assert when running out of TraceInfo space

18 months ago[browser] partial reversal of PR #82826 (#83637)
Pavel Savara [Tue, 21 Mar 2023 20:36:44 +0000 (21:36 +0100)]
[browser] partial reversal of PR #82826 (#83637)

18 months ago[mono][jit] Add some barriers to the delegate invoke code. (#83673)
Zoltan Varga [Tue, 21 Mar 2023 19:06:30 +0000 (15:06 -0400)]
[mono][jit] Add some barriers to the delegate invoke code. (#83673)

Re: https://github.com/dotnet/runtime/issues/81123.

18 months agoArm64: Combine if conditions into compare chains (#79283)
Alan Hayward [Tue, 21 Mar 2023 18:23:05 +0000 (18:23 +0000)]
Arm64: Combine if conditions into compare chains (#79283)

Add a new stage optOptimizeCompareChainCondBlock in pass optOptimizeBools.

This aims to reduced the number of conditional jumps by joining cases when multiple conditions gate the execution of a block.

Example 1:
If ( a > b || c == d) { x = y; }

Will be represented in IR as:

 ------------ BB01 -> BB03 (cond), succs={BB02,BB03}
 *  JTRUE (GT a,b)

 ------------ BB02 -> BB04 (cond), preds={BB01} succs={BB03,BB04}
 *  JTRUE (NE c,d)

 ------------ BB03, preds={BB01, BB02} succs={BB04}
 *  ASG (x,y)
These operands will be combined into a single AND in the first block (with the first
condition inverted), wrapped by the test condition (NE(...,0)). Giving:

 ------------ BB01 -> BB03 (cond), succs={BB03,BB04}
 *  JTRUE (NE (AND (LE a,b), (NE c,d)), 0)

 ------------ BB03, preds={BB01} succs={BB04}
 *  ASG x,y
Example 2:
If ( a > b && c == d) { x = y; } else { x = z; }

Here the && conditions are connected via an OR. After the pass:

 ------------ BB01 -> BB03 (cond), succs={BB03,BB04}
 *  JTRUE (NE (OR (LE a,b), (NE c,d)), 0)

 ------------ BB03, preds={BB01} succs={BB05}
 *  ASG x,y

 ------------ BB04, preds={BB01} succs={BB05}
 *  ASG x,z
Example 3:
If ( a > b || c == d || e < f ) { x = y; }
The first pass of the optimization will combine two of the conditions. The
second pass will then combine remaining condition the earlier chain.

 ------------ BB01 -> BB03 (cond), succs={BB03,BB04}
 *  JTRUE (NE (OR ((NE (OR (NE c,d), (GE e,f)), 0), (LE a,b))), 0)

 ------------ BB03, preds={BB01} succs={BB04}
 *  ASG x,y
This optimization means that every condition within the IF statement is always evaluated,
as opposed to stopping at the first positive match.
Theoretically there is no maximum limit on the size of the generated chain. Therefore cost
checking is used to limit the maximum number of conditions that can be chained together.

Currently the cost checking limits to a maximum of three simple conditions. This is the same behaviour as GCC. Note that LLVM allows chains of much longer length.

18 months agoJIT: Expand handling of non-value commas in gtSplitTree (#83725)
Jakob Botsch Nielsen [Tue, 21 Mar 2023 18:21:59 +0000 (19:21 +0100)]
JIT: Expand handling of non-value commas in gtSplitTree (#83725)

We can have a 'value'-typed COMMA whose RHS operand is actually an
assignment. gtSplitTree would create illegal IR for this case.

For example:

N018 ( 38, 33) [000327] -ACXGO----- arg1 setup              ├──▌  COMMA     simd32
N011 ( 28, 25) [000328] -ACXGO-----                         │  ├──▌  COMMA     void
N008 ( 24, 22) [000320] -ACXG---R--                         │  │  ├──▌  ASG       byref
N007 (  3,  2) [000319] D------N---                         │  │  │  ├──▌  LCL_VAR   byref  V50 tmp45
N006 ( 20, 19) [000126] --CXG------                         │  │  │  └──▌  CALL help byref  CORINFO_HELP_UNBOX
N004 (  3,  2) [000124] ----------- arg1 in rsi             │  │  │     ├──▌  LCL_VAR   ref    V02 loc1
N005 (  3, 10) [000125] H---------- arg0 in rdi             │  │  │     └──▌  CNS_INT(h) long   0x7f6e4bb0e500 class
N010 (  4,  3) [000322] ---X-O-----                         │  │  └──▌  NULLCHECK byte
N009 (  3,  2) [000321] -----------                         │  │     └──▌  LCL_VAR   byref  V50 tmp45
N017 ( 10,  8) [000331] -A-XGO--R--                         │  └──▌  ASG       simd32 (copy)
N016 (  3,  2) [000330] D------N---                         │     ├──▌  LCL_VAR   simd32 V51 tmp46
N015 (  6,  5) [000329] ---XGO-N---                         │     └──▌  IND       simd32
N014 (  4,  3) [000326] -----O-N---                         │        └──▌  ADD       byref
N012 (  3,  2) [000324] -----O-----                         │           ├──▌  LCL_VAR   byref  V50 tmp45
N013 (  1,  1) [000325] -----------                         │           └──▌  CNS_INT   long   32

gtSplitTree would believe that [000327] was a value and would create the
following IR shape:

N016 ( 14, 11) [000428] -A-XGO--R--                         ▌  ASG       simd32 (copy)
N015 (  3,  2) [000427] D------N---                         ├──▌  LCL_VAR   simd32 V76 tmp71
N014 ( 10,  8) [000331] -A-XGO-NR--                         └──▌  ASG       simd32 (copy)
N013 (  3,  2) [000330] D------N---                            ├──▌  LCL_VAR   simd32 V51 tmp46
N012 (  6,  5) [000329] ---XGO-N---                            └──▌  IND       simd32
N011 (  4,  3) [000326] -----O-N---                               └──▌  ADD       byref
N009 (  3,  2) [000324] -----O-----                                  ├──▌  LCL_VAR   byref  V50 tmp45
N010 (  1,  1) [000325] -----------                                  └──▌  CNS_INT   long   32

Fix #83576

18 months agoDelete Mono/RuntimeMarshal.cs (#83678)
Jan Kotas [Tue, 21 Mar 2023 17:34:08 +0000 (10:34 -0700)]
Delete Mono/RuntimeMarshal.cs (#83678)

The methods in this file were partially redundant and partially specific to AssemblyName.

18 months agoUnroll Buffer.Memmove for constant lengths (#83638)
Egor Bogatov [Tue, 21 Mar 2023 16:52:34 +0000 (17:52 +0100)]
Unroll Buffer.Memmove for constant lengths (#83638)

Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
18 months ago[mono][aot] Load AOT module of a container assembly using assembly name (#83711)
Milos Kotlar [Tue, 21 Mar 2023 15:50:34 +0000 (16:50 +0100)]
[mono][aot] Load AOT module of a container assembly using assembly name (#83711)

* Load AOT module of a container assembly using assembly name

* Use mono_image_init to init the image

* Implement mono_loader_lock on load_container_amodule

* Avoid recursive invocation by setting container_assm_name to NULL

18 months ago[browser] Fix encoding problem when publishing with AOT (#83510)
Ilona Tomkowicz [Tue, 21 Mar 2023 14:53:21 +0000 (15:53 +0100)]
[browser] Fix encoding problem when publishing with AOT (#83510)

* Fix.

* Regex approach is not necessary.

* Fix encoding on Windows.

* Fixed build error.

* Reverted unnecessary changes. Blocked relink with unicode.

* Revet + nit.

* Applied @kg's review.

18 months ago[mono][jit] Add vector horizontal sums and ToScalar on arm64. (#83675)
Jan Dupej [Tue, 21 Mar 2023 14:49:00 +0000 (15:49 +0100)]
[mono][jit] Add vector horizontal sums and ToScalar on arm64. (#83675)

* SN_Sum operation on arm64. Fixed dup. Replaced addv, addp, faddp with their generalized variants. Added OP_EXTRACTx opcodes to arm64 codegen. Added horizontal sums.

* Fixed smov macro. Added SN_ToScalar. Fixed code style.

* Fixed vector sums of nint/nuint.

* Temporarily disable intrinsics, until all are implemented.

18 months ago[tvOS] Bump to new OSX 13 AppleTV queue (#83272)
Steve Pfister [Tue, 21 Mar 2023 14:14:30 +0000 (10:14 -0400)]
[tvOS] Bump to new OSX 13 AppleTV queue (#83272)

18 months agoReplace a load with cheaper mov instruction when possible (#83458)
SwapnilGaikwad [Tue, 21 Mar 2023 12:39:01 +0000 (12:39 +0000)]
Replace a load with cheaper mov instruction when possible (#83458)

18 months ago[mono][jit] Adding compare all/any intrinsics. (#83515)
Jan Dupej [Tue, 21 Mar 2023 09:37:45 +0000 (10:37 +0100)]
[mono][jit] Adding compare all/any intrinsics. (#83515)

* xxAny, xAll comparisons in progress.

* xxAny, xxAll comparisons, part 2.

* [mono][jit] Adding compare all/any operations. Fixed umov,smov macros.

* Removed superfluous changes.

* Restored newline at the end of HelloWorld.

* Fixed unmatched brace.

* Indentation.

* Normalized boolean values to 0/1. SIMD_EXTR_ constants have friendlier names. Equality/Inequality are now also intrinsics.

* Fixed element type for comparisons.

* Temporarily disabled intrinsics. Will be permanenty reenabled once all are implemented.

18 months agoLocalized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 214003...
dotnet bot [Tue, 21 Mar 2023 07:53:26 +0000 (00:53 -0700)]
Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2140030 (#83703)

18 months agoCorrect doc comment for IMultiplyOperators returns (#83693)
Marc Brooks [Tue, 21 Mar 2023 03:33:39 +0000 (22:33 -0500)]
Correct doc comment for IMultiplyOperators returns (#83693)

Replaced _divided-by_ with _multiplied-by_ in both
IMultiplyOperators.cs and NFloat.cs.
Fixes https://github.com/dotnet/runtime/issues/80521

18 months agoCleanup some HWIntrinsic logic to ensure the right gtType and simdSize are being...
Tanner Gooding [Tue, 21 Mar 2023 02:16:57 +0000 (19:16 -0700)]
Cleanup some HWIntrinsic logic to ensure the right gtType and simdSize are being set (#83516)

* Cleanup some HWIntrinsic logic to ensure the right gtType and simdSize are being set

* Apply formatting patch

* Add a missing GetLower call

* Fix an assert for lowering TYP_SIMD12 where its handled as TYP_SIMD16

* Ensure GetLower is used in Dot for TYP_SIMD32

* Apply formatting patch

* Insert after, not before, for the _GetLower to avoid a codegen regression

* Put the _GetLower in the right place to avoid the codegen regression

* Don't change the simd size of TYP_SIMD8/12 DotProduct unnecessarily

18 months agoUse BitOperations::PopCount() in genCountBits() (#83661)
Kunal Pathak [Tue, 21 Mar 2023 02:08:44 +0000 (19:08 -0700)]
Use BitOperations::PopCount() in genCountBits() (#83661)

18 months agoImprove RA for LowerBlockStore (#83627)
Egor Bogatov [Tue, 21 Mar 2023 00:49:42 +0000 (01:49 +0100)]
Improve RA for LowerBlockStore (#83627)

18 months agoSyntaxValueProvider: avoid performance issue with syntax list containing many items...
Charles Stoner [Tue, 21 Mar 2023 00:08:42 +0000 (17:08 -0700)]
SyntaxValueProvider: avoid performance issue with syntax list containing many items (#83483)

18 months agoRemove calling convention modifiers from cpuid sig (#83672)
Adeel Mujahid [Tue, 21 Mar 2023 00:03:59 +0000 (02:03 +0200)]
Remove calling convention modifiers from cpuid sig (#83672)

> /runtime/src/coreclr/vm/cgensys.h:107:26: error: stdcall calling convention is not supported on builtin function [-Werror,-Wignored-attributes]

18 months agoHandle recursive type graphs in config binding generator (#83644)
Layomi Akinrinade [Mon, 20 Mar 2023 22:25:17 +0000 (15:25 -0700)]
Handle recursive type graphs in config binding generator (#83644)

18 months agoRevert "[mono][aot] Load AOT module of a container assembly using assembly name ...
Milos Kotlar [Mon, 20 Mar 2023 21:42:54 +0000 (22:42 +0100)]
Revert "[mono][aot] Load AOT module of a container assembly using assembly name (#83511)" (#83686)

This reverts commit 1e601c5101e1f0573cd03560615aa8f6cb38fa64.

18 months ago[mono] Fix a race in gparam construction. (#83688)
Zoltan Varga [Mon, 20 Mar 2023 20:08:25 +0000 (16:08 -0400)]
[mono] Fix a race in gparam construction. (#83688)

Re: https://github.com/dotnet/runtime/issues/81123.

18 months agoImplement support for unspeakable types. (#83631)
Eirik Tsarpalis [Mon, 20 Mar 2023 20:08:09 +0000 (20:08 +0000)]
Implement support for unspeakable types. (#83631)

* Implement support for unspeakable types.

* Remove unneeded declarations.

* Record ambiguity information in exception message.

* Fix error message testing in wasm.

* Address feedback.

* Add test case for interface POCOs

* Update src/libraries/System.Text.Json/src/Resources/Strings.resx

Co-authored-by: Dan Moseley <danmose@microsoft.com>
---------

Co-authored-by: Dan Moseley <danmose@microsoft.com>
18 months agoReduce the size of some Http header values (#83640)
Miha Zupan [Mon, 20 Mar 2023 19:45:43 +0000 (20:45 +0100)]
Reduce the size of some Http header values (#83640)

* Reduce the size of some Http header values

* PR feedback

18 months agoupdate mariner Linux image to 2.0 (#81973)
Tomas Weinfurt [Mon, 20 Mar 2023 19:23:04 +0000 (12:23 -0700)]
update mariner Linux image to 2.0 (#81973)

* update mariner Linux image to 2.0

* product

* test

* force run

* centos

* update

18 months agoJIT: revise inlinee block numbering, enable synthesis for inlinees (#83610)
Andy Ayers [Mon, 20 Mar 2023 19:06:31 +0000 (12:06 -0700)]
JIT: revise inlinee block numbering, enable synthesis for inlinees (#83610)

Start numbering inlinee blocks from 1 instead of 1 + the root compiler's
max BB num. Update inlinee block bbNums when they are inserted into the
root compiler's graph.

Adjust computations in various places that knew about the old approach
and looked from inlinee compiler to root compiler for bitset, epochs and
the like.

Enable synthesis for inlinees, now that regular bitsets on inlinee compiler
instances behave sensibly.

There is still some messiness around inlinees inheriting root compiler
EH info which requires special checks. I will clean this up separately.

Fixes #82755.
Contributes to #82964.

18 months agoFix 'x < 0' for unsigned (#83656)
Will Smith [Mon, 20 Mar 2023 19:05:29 +0000 (12:05 -0700)]
Fix 'x < 0' for unsigned (#83656)

18 months agoFix porting from servicing release (#83633)
Tarek Mahmoud Sayed [Mon, 20 Mar 2023 18:08:42 +0000 (11:08 -0700)]
Fix porting from servicing release (#83633)

18 months agoPrint the state when the align instructions don't match up (#83286)
Kunal Pathak [Mon, 20 Mar 2023 17:58:52 +0000 (10:58 -0700)]
Print the state when the align instructions don't match up (#83286)

* Print the state when the align instructions don't match up

* build fix

* Update loop number during block compaction

* Adjust the ifdef

* Fix #ifdef with #if

* TEMP COMMIT

* Revert "TEMP COMMIT"

This reverts commit c10b70dc4787f734bb99d5d4bb69b1a545d6516d.

18 months agoAdd linux-musl-riscv64 RID (#83465)
Antoine Martin [Mon, 20 Mar 2023 16:51:16 +0000 (12:51 -0400)]
Add linux-musl-riscv64 RID (#83465)

18 months ago[mono][aot] Load AOT module of a container assembly using assembly name (#83511)
Milos Kotlar [Mon, 20 Mar 2023 16:22:38 +0000 (17:22 +0100)]
[mono][aot] Load AOT module of a container assembly using assembly name (#83511)

* Load AOT module of a container assembly using assembly name

* Use mono_image_init to init the image

* Implement mono_loader_lock on load_container_amodule

* Avoid recursive invocation by setting container_assm_name to NULL

18 months agoAdd new MemoryExtension.Replace(src, dst, ...) overload (#83120)
Stephen Toub [Mon, 20 Mar 2023 15:39:16 +0000 (11:39 -0400)]
Add new MemoryExtension.Replace(src, dst, ...) overload (#83120)

* Add new MemoryExtension.Replace(src, dst, ...) overload

* Address PR feedback

18 months agoUse escape sequence instead of char in utf-8 tests. (#83595)
Ilona Tomkowicz [Mon, 20 Mar 2023 15:24:55 +0000 (16:24 +0100)]
Use escape sequence instead of char in utf-8 tests. (#83595)

18 months agoFix ToString handling of [Flags] enums with negative values (#83616)
Stephen Toub [Mon, 20 Mar 2023 11:25:43 +0000 (07:25 -0400)]
Fix ToString handling of [Flags] enums with negative values (#83616)

* Fix ToString handling of [Flags] enums with negative values

Our Enum rewrite earlier in .NET 8 broke the handling of ToString for [Flags] enums with negative values.  Prior to that rewrite, all of the enum values were stored as a sorted array of ulongs, regardless of the enum's underlying type. Now, they're stored as a sorted array of the underlying type.  However, that means that for signed underlying types, the position of negative values moved from the end to the beginning.  We knew this, and accordingly updated tests that reflected that order (which as an implementation detail is observable via APIs that get the underlying values).  But what we didn't notice because we didn't have tests covering it is that the logic for formatting [Flags] enums actually depends on those negative values being after the non-negative ones.  That's for two reasons.  First, there's logic that special-cases 0 and assumes that an enum value of 0 must be in the first slot of the values array if it exists.  Second, the logic for deciding which enum values should be included starts at the largest unsigned value and walks down subtracting out matching bit patterns as they're found; if the values are sorted differently, the resulting strings are different.  Not only might different names be included, but a number might be rendered if the order of evaluation means that no perfect subsetting is found even if there would have been had a different order been used.

This fixes the issues by restoring the ordering based on the values being unsigned.  When we sort, we sort based on the unsigned version of the underlying primitive, even if it's signed.

* Collapse GetEnumInfo for integer types to only be unsigned

Rather than 13 possible `EnumInfo<T>`, we consolidate down to just 8, such that for all of the underlying types that are signed integers, we instead always use their unsigned counterparts.  This then ensures that the data for the values is always sorted according to the unsigned representation and all logic in Enum that performs searches based on value is always doing so consistently.

18 months agoDelete dead GetUserFeatureDirectory functions (#83660)
Stephen Toub [Mon, 20 Mar 2023 11:17:54 +0000 (07:17 -0400)]
Delete dead GetUserFeatureDirectory functions (#83660)

The only overload that's used is the one taking two arguments.