Badre BSAILA [Fri, 13 Jan 2023 01:16:49 +0000 (02:16 +0100)]
PEReader doesn't work with "IsLoadedImage" and "PrefetchMetadata" options (#80106)
* PEReader doesn't work with "IsLoadedImage" and "PrefetchMetadata" options
* Apply suggestions from code review
Co-authored-by: MartyIX <203266+MartyIX@users.noreply.github.com>
Co-authored-by: Buyaa Namnan <buyankhishig.namnan@microsoft.com>
Vladimir Sadov [Fri, 13 Jan 2023 00:25:57 +0000 (16:25 -0800)]
Moving GetCurrentProcessorId() to shared (#80532)
* move GetCurrentProcessorId() to shared
* delete more native code
* PR feedback
* fix unix build
* unnecessary HAVE_SCHED_GETCPU
Stephen Toub [Fri, 13 Jan 2023 00:25:49 +0000 (19:25 -0500)]
Make System.Collections.Immutable adhere to repo's var policy (#80556)
* Make System.Collections.Immutable consistent with repo's var policy
* Fix vars that were just merged in new file
Stephen Toub [Fri, 13 Jan 2023 00:15:47 +0000 (19:15 -0500)]
Use MemoryExtensions.Equals in CharArrayHelpers.EqualsOrdinalAsciiIgnoreCase (#80561)
* Use MemoryExtensions.Equals in CharArrayHelpers.EqualsOrdinalAsciiIgnoreCase
* Delete CharArrayHelpers.EqualsOrdinalAsciiIgnoreCase/Trim
Just use span directly.
Andrew Au [Thu, 12 Jan 2023 23:13:59 +0000 (15:13 -0800)]
Move a regression test out of CI (#80399)
Co-authored-by: Bruce Forstall <brucefo@microsoft.com>
Eirik Tsarpalis [Thu, 12 Jan 2023 22:41:19 +0000 (22:41 +0000)]
Add support for JsonUnmappedMemberHandling (#79945)
* Add support for JsonUnmappedMemberHandling.
* Address feedback
* Ignore global UnmappedMemberHandling setting when a JsonExtensionDataAttribute is specified.
* Fix VerifyOptionsEqual method.
* Update src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonTypeInfo.cs
Co-authored-by: Krzysztof Wicher <mordotymoja@gmail.com>
Co-authored-by: Krzysztof Wicher <mordotymoja@gmail.com>
Stephen Toub [Thu, 12 Jan 2023 22:40:26 +0000 (17:40 -0500)]
Replace unnecessary string.Replace in ManifestBuilder.GetTypeName (#80557)
Kevin Jones [Thu, 12 Jan 2023 22:38:15 +0000 (17:38 -0500)]
Implement Shuffle, GetString, and GetItems on Random{NumberGenerator} (#78598)
* Implement Shuffle, GetString, and GetItems.
* Cleanup and additional tests
* Use where possible
* Code review feedback
* Additional uses of Random throughout tests
* Feedback on documentation
* Use ref to span to get span in string.Create.
Co-authored-by: Benjamin Moir <DaZombieKiller@users.noreply.github.com>
Co-authored-by: Theodore Tsirpanis <teo@tsirpanis.gr>
Co-authored-by: Michał Petryka <35800402+MichalPetryka@users.noreply.github.com>
* Code review feedback
* Code review feedback
* Apply suggestions from code review
Co-authored-by: Dan Moseley <danmose@microsoft.com>
* Use AssertExtensions over Assert
* Improve comment
* No idea where AssertHexString came from
* Update src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RandomNumberGenerator.cs
Co-authored-by: Jeremy Barton <jbarton@microsoft.com>
Co-authored-by: Benjamin Moir <DaZombieKiller@users.noreply.github.com>
Co-authored-by: Theodore Tsirpanis <teo@tsirpanis.gr>
Co-authored-by: Michał Petryka <35800402+MichalPetryka@users.noreply.github.com>
Co-authored-by: Dan Moseley <danmose@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Jeremy Barton <jbarton@microsoft.com>
Stephen Toub [Thu, 12 Jan 2023 19:58:26 +0000 (14:58 -0500)]
Fix most violations of new CA1859 (#80335)
* Fix most violations of new CA1859
The analyzer recommends replacing uses of types with other types that could reduce overheads (e.g. `List<T>` instead of `IList<T>`). This fixes most of the violations we currently have of the rule, but it doesn't enable it yet because there are too many false positives; fixes for those are in-flight. Some of these replacements won't help with perf (e.g. using `ArgumentException` instead of `Exception` as the return type of a throw helper create method), but there's little harm to them, and some of them do avoid overheads like allocation (e.g. foreach'ing something typed as `Dictionary<>` instead of `IDictionary<>` will avoid an enumerator allocation, accessing `Count` on a `List<T>` instead of `IList<T>` will avoid an interface dispatch, etc.)
* Fix mistaken replacement
Jackson Schuster [Thu, 12 Jan 2023 19:48:25 +0000 (11:48 -0800)]
Create analyzer in ComInterfaceGenerator to enforce the generator is used with IUnknown only (#78189)
Creates an analyzer that warns if the GeneratedComInterfaceAttribute is
used with InterfaceTypeAttribute that has an argument that is not
'InterfaceIsIUnknown'
Co-authored-by: Jeremy Koritzinsky <jkoritzinsky@gmail.com>
Co-authored-by: Elinor Fung <elfung@microsoft.com>
Martin Taillefer [Thu, 12 Jan 2023 18:53:20 +0000 (10:53 -0800)]
Add tests for frozen collections (#80395)
Co-authored-by: Martin Taillefer <mataille@microsoft.com>
Tarek Mahmoud Sayed [Thu, 12 Jan 2023 16:43:01 +0000 (08:43 -0800)]
Fix Configuration to ensure calling the property setters. (#80438)
Tanner Gooding [Thu, 12 Jan 2023 16:33:52 +0000 (08:33 -0800)]
Adding the Vector512 and Vector512<T> types (#76642)
* Adding the Vector512 and Vector512<T> types
* Support properly packing Vector512<T>
* Responding to PR feedback and ensure Vector512 is treated as an HFA for Arm64
* Bring Vector512 inline with the new Vector64/128/256 APIs
* Adding support for generating the Vector512 tests
* Generate the Vector512 tests
* Ensure the ref assembly is up to date
* Fixing a couple JIT asserts
* Fixing tests to pass the right number of constructor parameters
* Ensure the HWIntrinsic test templates support 64-byte alignment
* Ensure the vector Dot tests correctly sum using pairs
* Ensure the Dot test computes the result pairs correctly
* Simplify the alignment check to avoid future churn
* Don't churn the Vector64/128/256 tests on the Vector512 PR
* Do update the Dot tests to have the updated validation
* Fix Vector128 divide by scalar
* Ensure field layout tests exist for Vector256 and Vector512
* Updating the R2R version from 8.0 to 9.0
* Ensure Vector512 tests are disabled in the same place as the Vector64/128/256 tests
* Remove a stray .
* Fixing the NativeAOT field layout tests
* Update an addition location where the R2R version is defined
* Disable Vector512 tests for llvmfullaot due to https://github.com/dotnet/runtime/issues/80467
* Increase the value of ngsharedvt-trampolines
* Move various HWIntrinsics to outerloop for unaccelerated platforms
* Ensure the HardwareIntrinsics tests are being filtered to outerloop where appropriate
Co-authored-by: Fan Yang <yangfan@microsoft.com>
Adam Sitnik [Thu, 12 Jan 2023 15:21:20 +0000 (16:21 +0100)]
Invalidate buffered data when bypassing the FileStream cache (#80432)
Elinor Fung [Thu, 12 Jan 2023 15:06:24 +0000 (07:06 -0800)]
Get entry assembly name from host for GetProcessInfo2 command during suspension (#80301)
- Host runtime contract returns entry assembly name based on managed
app being run, empty string for non-app (component) scenarios
- ProcessInfo2 command falls back to querying for entry assembly name
from host
Kevin Jones [Thu, 12 Jan 2023 14:52:25 +0000 (09:52 -0500)]
Fix small buffer handling with the Platform Crypto Provider
Stephen Toub [Thu, 12 Jan 2023 14:35:12 +0000 (09:35 -0500)]
Fix timeout in regex source generated test (#80459)
* Fix timeout in regex source generated test
The test is using Roslyn to dynamically emit a Regex with the source generator, as we do throughout the test suite. However, this test is about validating the default static regex timeout, and the Roslyn code itself uses a regex. To work around this, this PR splits off the source generated test into its own dedicated one that doesn't rely on Roslyn.
* Fix .NET Framework test build
Stephen Toub [Thu, 12 Jan 2023 14:34:56 +0000 (09:34 -0500)]
Fix NetFramework name in Directory.Build.targets (#80440)
Eirik Tsarpalis [Thu, 12 Jan 2023 14:26:32 +0000 (14:26 +0000)]
Address feedback from #79828. (#80509)
Viktor Hofer [Thu, 12 Jan 2023 14:09:40 +0000 (15:09 +0100)]
Fix build invocation on Windows without os param (#80544)
Regressed with https://github.com/dotnet/runtime/commit/
2ca7cf7140ebfaa8e34732b529c194416b122e89
dotnet-maestro[bot] [Thu, 12 Jan 2023 14:00:39 +0000 (15:00 +0100)]
[main] Update dependencies from dotnet/arcade (#80234)
* Update dependencies from https://github.com/dotnet/arcade build
20230104.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.23053.5 -> To Version 8.0.0-beta.23054.2
* Update dependencies from https://github.com/dotnet/arcade build
20230105.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.23053.5 -> To Version 8.0.0-beta.23055.2
* Update dependencies from https://github.com/dotnet/arcade build
20230105.3
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.23053.5 -> To Version 8.0.0-beta.23055.3
* Update dependencies from https://github.com/dotnet/arcade build
20230106.4
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.23053.5 -> To Version 8.0.0-beta.23056.4
* React to SDK change around linking
* Update NetCoreAppToolCurrent to net8.0
* Upgrade aspnetcoretoolcurrent as well
* Update dependencies from https://github.com/dotnet/arcade build
20230108.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.23053.5 -> To Version 8.0.0-beta.23058.1
* [wasm] WasmAppHost: fix new analyzer warning
`/__w/1/s/src/mono/wasm/host/WebServerStartup.cs(94,17): error ASP0019: Use IHeaderDictionary.Append or the indexer to append or set headers. IDictionary.Add will throw an ArgumentException when attempting to add a duplicate key. [/__w/1/s/src/mono/wasm/host/WasmAppHost.csproj]
`
* Fix CA1512 analyzer warnings
* fix
* React to aspnetcore analyzers
* Update dependencies from https://github.com/dotnet/arcade build
20230109.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.23053.5 -> To Version 8.0.0-beta.23059.1
* Update tfm in WasmApp.LocalBuild.props
* [wasm] Use dotnet version from global.json for helix
* Fix illink tests and react to analyzer
* Update hardcoded linker tfm
* Fix illink tests
The analyzer tests download a ref package, but its version must at least roughly match the version used to run the tests.
Since this updates the SDK to 8.0, update the tests to pick some 8.0 ref package.
Also the new compiler produces two new warnings in one case, so baselined those in the test.
* Fix ILLinker tests on NativeAOT
* Resolve analyzer warning in MonoLinkerTestsCasesExpectations
* Upgrade xunit runner tfm
* Delete dead property
* In NativeAOT common files with ILLink have ILLink format, meaning tabs instead of spaces
* Upgrade SDK because of "Failed to create CoreCLR"
"Failed to create CoreCLR, HRESULT: 0x80131524" during runtime test ILC invocation. Might be fixed with https://github.com/dotnet/runtime/commit/
6c0c96ccc775cad4119e2d5d3a1797c4126b4533
* Update macOS version target triple
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
Co-authored-by: vitek-karas <10670590+vitek-karas@users.noreply.github.com>
Co-authored-by: Tlakollo <tlcejava@microsoft.com>
Jan Dupej [Thu, 12 Jan 2023 13:24:27 +0000 (14:24 +0100)]
[mono] Fixed getting namespace names of array types. (#80426)
* [mono] Fixed getting namespace names of array types. #42633
* [mono] Namespace getter icall of Type, code style.
* Reenabled TypeInfoTests.Namespace for Mono.
* [mono] Namespace for array types now works also for jagged arrays.
* [mono] Fixed Type.Namespace for enums.
* [mono] Fixed failing Microsoft.XmlSerializer.Generator.Tests.SgenCommandTest.
* Adding cases to TypeInfoTests.Namespace test.
Stephen Toub [Thu, 12 Jan 2023 12:51:22 +0000 (07:51 -0500)]
Remove two string.Replace calls from CreditCardAttribute.IsValid (#80523)
SingleAccretion [Thu, 12 Jan 2023 06:14:36 +0000 (09:14 +0300)]
Disable `ExposedLocalsNumbering` (#80522)
* Disable the test
* Correct the exclusion path
Co-authored-by: Bruce Forstall <brucefo@microsoft.com>
Co-authored-by: Bruce Forstall <brucefo@microsoft.com>
Katelyn Gadd [Thu, 12 Jan 2023 03:42:01 +0000 (19:42 -0800)]
[wasm] Implement more jiterpreter opcodes (#80520)
* Implement the ADD_MUL indirect loads
* Implement floating point conditional branches
* Implement some intrinsics
Andrew Au [Wed, 11 Jan 2023 23:25:37 +0000 (15:25 -0800)]
Fix a few profiler related issues associated with frozen objects (#79563)
Andrew Au [Wed, 11 Jan 2023 23:25:20 +0000 (15:25 -0800)]
Decommit memory as needed (#79912)
Tanner Gooding [Wed, 11 Jan 2023 23:00:48 +0000 (15:00 -0800)]
Consistently use fgMakeMultiUse in the gtNewSimd*Node APIs (#80242)
* Consistently use fgMakeMultiUse in the gtNewSimd*Node APIs
* Apply formatting patch
* Ensure that the fgMakeMultiUse ordering is correct so the comma is evaluated first
* Apply formatting patch
* Ensure operand ordering is correct for SimdWiden
* Apply formatting patch
Jakob Botsch Nielsen [Wed, 11 Jan 2023 20:12:11 +0000 (21:12 +0100)]
JIT: Fix invalid last use propagation for implicit byrefs (#80489)
Fix #80488
Milos Kotlar [Wed, 11 Jan 2023 20:06:16 +0000 (21:06 +0100)]
[mono][interp] Add a bitset with IL jump targets (#80136)
* add bitset for IL target jumps
* Enable disabled test
Tlakaelel Axayakatl Ceja [Wed, 11 Jan 2023 19:59:14 +0000 (11:59 -0800)]
Change github illink links (#80407)
Change github illink links to point from dotnet/linker to dotnet/runtime
Delete scripts that clone illink into runtime since illink now lives in runtime
Create a forward link for error 1012 in illink, that leads users to open an issue in runtime
Viktor Hofer [Wed, 11 Jan 2023 16:58:32 +0000 (17:58 +0100)]
Lowercase TargetOS (#80164)
Follow-up on #32451
Follow-up on #80074
In #43651, the "Windows" OS name was lowercased to achieve target frameworks with RIDs in them. At that time, the original plan was to lowercase all TargetOS values but that had to be cut because of resources. This PR finishes that and updates build systems, YML, markdowns and managed components.
To not break existing developer workflows, the passed-in -os value is automatically lower-cased in the script entry points and validated in the msbuild entry point.
Lee Coward [Wed, 11 Jan 2023 16:46:06 +0000 (08:46 -0800)]
Remove IETF RFC license info (#80506)
guidfromname.cpp contains a reference to an IETF RFC draft. This needs to be clarified for downstream FOSS licensing scans by removing the draft reference.
This PR corrects the IETF RFC reference and retains the final published RFC references.
Resolves #79231
Allan Targino [Wed, 11 Jan 2023 15:29:18 +0000 (12:29 -0300)]
Adds diagnostics to detect duplicated event names in LSG (#80460)
fixes https://github.com/dotnet/runtime/issues/64667
Viktor Hofer [Wed, 11 Jan 2023 14:37:37 +0000 (15:37 +0100)]
Fix ILLink.Tasks package published multiple times (#80487)
Šimon Rozsíval [Wed, 11 Jan 2023 14:35:33 +0000 (15:35 +0100)]
Fix parsing the output of `ping` on Samsung phones (#80133)
* Account for different formats of ping output
* Avoid allocation
Pavel Savara [Wed, 11 Jan 2023 13:25:06 +0000 (14:25 +0100)]
WASI gc - fix stack range (#80456)
* WASI gc - fix stack range (#80456)
* feedback
Stephen Toub [Wed, 11 Jan 2023 13:17:37 +0000 (08:17 -0500)]
Fix delegate allocation in CachingContext.GetOrAddJsonTypeInfo (#80437)
* Fix delegate allocation in CachingContext.GetOrAddJsonTypeInfo
* Address PR feedback
Stephen Toub [Wed, 11 Jan 2023 12:23:28 +0000 (07:23 -0500)]
Remove some temp string allocations from Uri (#80469)
Stephen Toub [Wed, 11 Jan 2023 12:21:15 +0000 (07:21 -0500)]
Remove some split/substring/trim allocations from System.Net.* (#80471)
SingleAccretion [Wed, 11 Jan 2023 12:11:57 +0000 (15:11 +0300)]
Fix numbering of exposed `LCL_VAR`s (#79772)
* Fix numbering of exposed LCL_VARs
The conservative VN must be unique for different uses lest
we risk running into memory safety issues, by, e. g. removing
range checks based on "racy" data.
* Add a test
Without the fix, 4 out of 5 runs fail on my machine.
* Succeed the test on platforms without threads
No threading => no races.
* Disable on Mono interp
SingleAccretion [Wed, 11 Jan 2023 12:10:23 +0000 (15:10 +0300)]
Transform local indirections off of `TYP_BLK` locals; support numbering exposed LCL_FLDs (#79771)
Thefrank [Wed, 11 Jan 2023 10:29:31 +0000 (02:29 -0800)]
Fix CPU_COUNT check for FreeBSD 13.1+ (#77867)
HAVE_GNU_CPU_COUNT has always incorrectly failed for FreeBSD.
This has not been an issue until FreeBSD 13.1 with its addition of `sched_getaffinity` and `sched_setaffinity`.
Jakob Botsch Nielsen [Wed, 11 Jan 2023 08:19:46 +0000 (09:19 +0100)]
JIT: Add a pass of early liveness and use it for forward sub and last-use copy elision for implicit byrefs (#79346)
This runs a pass of liveness right after local morph and uses it for forward sub and to omit copies of structs when passed as implicit byrefs at their last use.
Fix #76069
Fix #75206
Fix #65025
Fix #9839
This PR introduces the following new JIT invariants:
* When optimizing, local morph will now thread all locals into a tree list accessed by Statement::LocalsTreeList. This tree list is kept valid starting from local morph and ending with forward sub. There is no memory impact of this since we reuse the GenTree::gtPrev and GenTree::gtNext fields.
* Early liveness information (GTF_VAR_DEATH and the promoted struct death vars map) is kept valid (sound) starting from early liveness and ending with morph.
There are asserts that the tree list is up to date when it is accessed. This is done through a new member fgNodeThreading that replaces the preexisting fgStmtListThreaded and keeps information about what the current kind of node threading is.
The benefits are large, -2 MB on win-x64 collections (-0.85% on libraries.pmi that only has optimized contexts), with a number of regressions as expected when removing locals.
The improvements primarily come from the omission of copies for implicit byrefs, so the benefits on platforms with fewer implicit byrefs is smaller, but the forward sub change alone is still very impactful (e.g. -300K on linux-x64).
The throughput impact is around 1% in optimized contexts and below 0.1% in unoptimized contexts, the latter due to local morph needing to check if it should be threading nodes.
Viktor Hofer [Wed, 11 Jan 2023 08:16:41 +0000 (09:16 +0100)]
Remove Drawing.Common .NETCoreApp PNSEs (#80435)
System.Drawing.Common was throwing PNSEs on non Windows platforms when
accessing public API which makes sense as the library isn't supposed to
be used on other platforms.
That said, we already have a runtime hook that throws when DllImports
are invoked. We intentionally want to allow accessing Drawing exchange
types to not break customers when they don't rely on GDI+ or other
native functions.
This is also part of a wider effort that allows this library to be
ported to another repository (which doesn't support targeting RIDs).
Mike McLaughlin [Wed, 11 Jan 2023 08:13:37 +0000 (00:13 -0800)]
Fix multiple dumps from being generated (#80474)
Issue: https://github.com/dotnet/runtime/issues/78956
After a core dump is generated because of a unhandled managed exception
abort() is called but a SIGSEGV is generated in libpthread.so which is
caught by the runtime and a second core dump is generated. The fix is
to uninstall/uninitialize all the signal handlers, not just SIGABORT.
Katelyn Gadd [Wed, 11 Jan 2023 05:39:19 +0000 (21:39 -0800)]
[wasm] Jiterpreter opcode updates + implement safepoints (#80479)
* Implement CPOBJ_VT_NOREF
* Implement STOBJ_VT_NOREF and improve bailout statistics
* Support performing safepoints in jiterpreter traces without bailing out
Michal Strehovský [Wed, 11 Jan 2023 02:37:52 +0000 (11:37 +0900)]
Reduce the number of forced `MethodTable`s (#79594)
When we're doing an optimized build, we go over the whole program twice:
* First time to build a whole program view: at this point we e.g. scan the IL method bodies to see what they depend on, or analyze reflection use within the program
* The second time to do actual codegen: this time we no longer analyze reflection use and expect that the first phase would have rooted everything that's necessary from reflection perspective.
In both phases, we assume any type with a "constructed" `MethodTable` is visible to reflection because one can just call `object.GetType()` and reflect on stuff. We need to pass a list of constructed `MethodTable`s from the first phase to the second phase because some `MethodTable`s could be the result of reflection analysis and we need to make sure they're compiled.
But crucially, up until now we didn't really track which `MethodTable`s are actual reflection roots and which ones just showed up in the dependency graph because the analyzed program happened to use it. We don't actually need to pass the latter ones as roots to compilation because the compilation phase is going to figure them out if they're needed anyway and if the compilation doesn't come up with some, that's fine because one wouldn't be able to call `object.GetType` on those anyway, because they're _not actually part of the program_.
Passing all of the MethodTables we saw from scanning to compilation is actually size bloat because scanning overapproximates things (by necessity, since it doesn't have a whole program view).
In this pull request I'm introducing `ReflectedTypeNode` to model `MethodTable`s that are actual targets of reflection. Only those will get passed as roots to the compilation phase. From now on we need to be mindful of how we refer to types. If a reference to a type is a result of non-code dependency, we should use `ReflectedType` to model it.
Saves about 1.2% (32 kB) in size on a Hello World.
I'm seeing it helps in two patterns:
https://github.com/dotnet/runtime/blob/
b1a2080b9ce5833802fe2d632f79de6402097f14/src/libraries/System.Private.CoreLib/src/System/Byte.cs#L1088-L1093
RyuJIT is able to eliminate the dead code in the if branch, but we were still rooting the type within the branch from the box.
The second pattern seems to be around RyuJIT devirtualizing things and preventing a box, which now eliminates the `MethodTable`.
tkrafael [Wed, 11 Jan 2023 00:41:22 +0000 (21:41 -0300)]
Feature/logging messagetemplate compat (#80364)
Co-authored-by: Rafael Nicoletti <rafael.nicoletti@ubuntu>
Allan Targino [Tue, 10 Jan 2023 23:45:30 +0000 (20:45 -0300)]
Adds diagnostic for out parameter in LSG (#80458)
fixes https://github.com/dotnet/runtime/issues/64665
Szczepan Ćwikliński [Tue, 10 Jan 2023 23:35:16 +0000 (00:35 +0100)]
Add initial support for FreeBSD.arm64 (#71486)
* changes to compile runtime under FreeBSD ARM64 host
* TOOLSET_PREFIX for FreeBSD host set to llvm during crossbuild
* Detect FreeBSD amd64 or aarch64 message
* Fix gen-dactable-rva.sh padding zeros
* cross build options for FreeBSD arm64 for mono
* Revert eng/native/configuretools.cmake
* Try to better detect host arch under FreeBSD
* Indent
* Don't pad DAC_TABLE_RVA
* Comment update
* Add freebsd-arm64 RIDs, enable CG2 package generation for FreeBSD builds
* Extra condition for mono build
* Added targetos to crossgen2 command during build
* Add targetos along with targetarch for crossgen2 commands
* Typo fixed in comment
* Set Cpsr to gp_spsr for FreeBSD/aarch64 (still crashing exception
unwind)
* Fix mono configure/build CPU_COUNT for FreeBSD
* Use check_symbol_exists for HAVE_GNU_CPU_COUNT check
* fix cross compile error
* Fix build error with targetos
Co-authored-by: Szczepan <sec@codebay.pl>
Juan Hoyos [Tue, 10 Jan 2023 21:42:41 +0000 (13:42 -0800)]
Revert "Reserve memory for FOH in-range (#78292)" (#80400)
Original change did improve codegen for certain cases but we were unable to detect performance improvements from that. It caused some troubles for !dumpheap - it's easier to revert it than fix.
Tlakaelel Axayakatl Ceja [Tue, 10 Jan 2023 21:33:04 +0000 (13:33 -0800)]
Build tools subset to generate artifacts (#80406)
Build the tools along with the libraries to produce the illink packages in the artifacts folder during the runtime official build (#80406)
Katelyn Gadd [Tue, 10 Jan 2023 21:10:49 +0000 (13:10 -0800)]
[wasm] optimize out 'is this method MulticastDelegate.Invoke' checks in aot->interp transitions (#80181)
* When creating an InterpMethod, identify whether it is MulticastDelegate.Invoke and store that in a flag to optimize interp_entry
* Always inline some jiterpreter APIs
Bruce Forstall [Tue, 10 Jan 2023 20:51:19 +0000 (12:51 -0800)]
Increase test scenario invocation parallelism (#80409)
The MSBuild code that invokes Helix to execute coreclr and libraries tests
spawns an MSBuild task for each "configuration" (which is a particular set of
environment variables, such as a set of JIT stress modes), and each of those
MSBuild invocations creates a (large) set of HelixWorkItem that are submitted
to Helix for running for that particular configuration. (One HelixWorkItem
is created for each partition of the test tree). But the MSBuild task also
waits for all the work items to finish before letting another configuration
start. The MSBuild invocations are run in parallel, but only to the level
of parallelism allowed by MSBuild settings. MSBuild is invoked with "/maxcpucount",
which means one MSBuild "node" per processor on the machine, thus one
configuration in parallel per processor. The AzDO machines we run on appear
to have 3 processors allocated to them (at least in some cases). Many test configurations
have far more than 3 configurations (e.g., jitstress-isas-x86 has 55 configurations),
so that's a lot of waiting.
These MSBuild tasks are doing very little: creating HelixWorkItems, invoking Helix,
and waiting. We can run many, many more MSBuild tasks in parallel,
to "flood" Helix with more work that could be done in parallel.
This change passes a larger `/maxcpucount` argument when invoking MSBuild in
cases where this would be beneficial.
(Note that ideally we wouldn't depend on MSBuild parallelism, and a single MSBuild
instance, or other code not written in MSBuild, could create and wait for all the
needed HelixWorkItems for all scenarios in a single process. But that's not how
it's currently architected.)
Eric Erhardt [Tue, 10 Jan 2023 19:57:11 +0000 (13:57 -0600)]
Remove RequiresDynamicCode from Microsoft.Extensions.DependencyInjection (#79425)
* Remove RequiresDynamicCode from Microsoft.Extensions.DependencyInjection
We need a better approach in order to support applications that use DependencyInjection and publish for NativeAOT. DependencyInjection needs to have reliable behavior before and after publishing for NativeAOT. The application can't work successfully at development-time, but then fail after publishing with PublishAot=true.
We will resolve the 2 NativeAOT warnings above by adding a runtime check that is behind the new AppContext switch added in https://github.com/dotnet/runtime/pull/80246 (`System.Runtime.CompilerServices.RuntimeFeature.IsDynamicCodeSupported`). The runtime check ensures the Types being used with Enumerable and Open Generic services are only Reference Types. If an application tries to create an Enumerable or Closed Generic service of a ValueType, DependencyInjection will throw an exception. The check is enabled by default when PublishAot=true.
Fix #79286
Alexander Köplinger [Tue, 10 Jan 2023 17:57:38 +0000 (18:57 +0100)]
Don't upgrade homebrew packages in CI (#80443)
Fixes https://github.com/dotnet/runtime/issues/80428, originally caused by https://github.com/actions/setup-python/issues/577 and https://github.com/actions/runner-images/issues/6868
Thays Grazia [Tue, 10 Jan 2023 17:34:14 +0000 (14:34 -0300)]
[wasm][debugger] Removing console.debug message helper to make debugger work. (#72812)
* Removing console.debug message helper to make debugger work.
* Update src/mono/wasm/runtime/debug.ts
Co-authored-by: Larry Ewing <lewing@microsoft.com>
* Addressing @radical comments offline.
* Fixing merge.
* Fix line change error.
* Totally removing the message.
* Remove unused comment
Co-authored-by: Larry Ewing <lewing@microsoft.com>
Co-authored-by: Ilona Tomkowicz <32700855+ilonatommy@users.noreply.github.com>
Thays Grazia [Tue, 10 Jan 2023 15:45:58 +0000 (12:45 -0300)]
Reverting wrong commit changing the helloworld sample (#80390)
Steve Pfister [Tue, 10 Jan 2023 14:53:05 +0000 (09:53 -0500)]
[workloads] Specify arm64 alias instead of arm in the arm64 pack (#79555)
Kunal Pathak [Tue, 10 Jan 2023 14:20:21 +0000 (06:20 -0800)]
Cache allregs to avoid checking the type repeatedly (#76850)
* cache the available registers
* Convert to PhasedVar
* Store the references instead of values
* Replace allRegs(constant_index) with actual values
* Remove call to varTypeIsSIMD()
Stephen Toub [Tue, 10 Jan 2023 12:53:48 +0000 (07:53 -0500)]
Remove some string allocation from NormalizeServiceName (#80384)
Mostly just using AsSpan/Slice instead of Substring. The remaining Substrings could away if we added a Uri.CheckHostName overload that took a span.
Stephen Toub [Tue, 10 Jan 2023 12:48:21 +0000 (07:48 -0500)]
Remove Substrings from PhoneAttribute (#80389)
Miha Zupan [Tue, 10 Jan 2023 11:50:44 +0000 (12:50 +0100)]
Enforce HttpClient limits on GetFromJsonAsync (#79386)
* Enforce HttpClient limits on GetFromJsonAsync
* Disable tests requiring Sockets on Browser
* Avoid LengthLimitReadStream overhead for DeleteFromJsonAsync
* Improve wrapper stream
* Remove content null check
Badre BSAILA [Tue, 10 Jan 2023 11:15:38 +0000 (12:15 +0100)]
measure the perf impact of deduplicating IsCompleted call in GetConsumingEnumerable (#78887)
* measure the perf impact of deduplicating IsCompleted call in GetConsumingEnumerable
* simplify the while condition
Co-authored-by: Krzysztof Wicher <mordotymoja@gmail.com>
Co-authored-by: Krzysztof Wicher <mordotymoja@gmail.com>
dotnet-maestro[bot] [Tue, 10 Jan 2023 11:01:15 +0000 (12:01 +0100)]
[main] Update dependencies from dotnet/icu dotnet/runtime-assets dotnet/emsdk dotnet/runtime dotnet/roslyn-analyzers dotnet/roslyn dotnet/llvm-project (#80235)
* Update dependencies from https://github.com/dotnet/runtime-assets build
20230104.2
Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Drawing.Common.TestData , System.Formats.Tar.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.23054.1 -> To Version 8.0.0-beta.23054.2
* Update dependencies from https://github.com/dotnet/emsdk build
20230104.1
Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100
From Version 8.0.0-alpha.1.22620.1 -> To Version 8.0.0-alpha.1.23054.1
* Update dependencies from https://github.com/dotnet/roslyn-analyzers build
20230104.1
Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
From Version 3.3.4-beta1.23053.6 -> To Version 3.3.4-beta1.23054.1
* Update dependencies from https://github.com/dotnet/roslyn build
20230104.16
Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
From Version 4.6.0-1.23054.2 -> To Version 4.6.0-1.23054.16
* Update dependencies from https://github.com/dotnet/roslyn-analyzers build
20230105.4
Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
From Version 3.3.4-beta1.23053.6 -> To Version 3.3.4-beta1.23055.4
* Update dependencies from https://github.com/dotnet/roslyn build
20230105.11
Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
From Version 4.6.0-1.23054.2 -> To Version 4.6.0-1.23055.11
* Update dependencies from https://github.com/dotnet/llvm-project build
20230106.1
runtime.linux-arm64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.linux-musl-x64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-musl-x64.Microsoft.NETCore.Runtime.ObjWriter , runtime.linux-x64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.ObjWriter , runtime.osx.11.0-arm64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.osx.11.0-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.ObjWriter , runtime.win-arm64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.win-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.win-x64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.ObjWriter
From Version 1.0.0-alpha.1.23052.1 -> To Version 1.0.0-alpha.1.23056.1
* Update dependencies from https://github.com/dotnet/icu build
20230106.1
Microsoft.NETCore.Runtime.ICU.Transport
From Version 8.0.0-alpha.1.23052.1 -> To Version 8.0.0-alpha.1.23056.1
* Update dependencies from https://github.com/dotnet/roslyn-analyzers build
20230106.1
Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
From Version 3.3.4-beta1.23053.6 -> To Version 3.3.4-beta1.23056.1
* Update dependencies from https://github.com/dotnet/roslyn build
20230106.14
Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
From Version 4.6.0-1.23054.2 -> To Version 4.6.0-1.23056.14
* Update dependencies from https://github.com/dotnet/roslyn build
20230108.1
Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
From Version 4.6.0-1.23054.2 -> To Version 4.6.0-1.23058.1
* Fix new compiler warning
* More warning fixes
* Update dependencies from https://github.com/dotnet/runtime-assets build
20230109.1
Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Drawing.Common.TestData , System.Formats.Tar.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.23054.1 -> To Version 8.0.0-beta.23059.1
* Update dependencies from https://github.com/dotnet/runtime build
20230108.2
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-alpha.1.22631.1 -> To Version 8.0.0-alpha.1.23058.2
* Update dependencies from https://github.com/dotnet/roslyn-analyzers build
20230108.2
Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
From Version 3.3.4-beta1.23053.6 -> To Version 3.3.4-beta1.23058.2
* Update dependencies from https://github.com/dotnet/llvm-project build
20230109.1
runtime.linux-arm64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.linux-musl-x64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-musl-x64.Microsoft.NETCore.Runtime.ObjWriter , runtime.linux-x64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.ObjWriter , runtime.osx.11.0-arm64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.osx.11.0-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.ObjWriter , runtime.win-arm64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.win-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.win-x64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.ObjWriter
From Version 1.0.0-alpha.1.23052.1 -> To Version 1.0.0-alpha.1.23059.1
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: vitek-karas <10670590+vitek-karas@users.noreply.github.com>
dotnet bot [Tue, 10 Jan 2023 10:57:02 +0000 (02:57 -0800)]
Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID
2083765 (#80405)
Qiao Pengcheng [Tue, 10 Jan 2023 10:02:05 +0000 (05:02 -0500)]
[LoongArch64] fix the addr error on embedded CPU. (#80412)
Michal Strehovský [Tue, 10 Jan 2023 07:48:18 +0000 (16:48 +0900)]
Generate fewer TentativeInstanceMethod nodes (#80414)
In order for the compiler to be able to eliminate bodies of instance methods on types that were never allocated, the compiler has a concept of "tentative instance methods".
E.g.
```csharp
Foo f = null;
f?.DoSomething();
class Foo
{
public void DoSomething() { expensive stuff }
}
```
When compiling `Main()` instead of generating code that refers to the entrypoint of `DoSomething` (that we would then have to compile), we generate it as a reference to a "tentative method". This tentative method will either turn into a throw helper, or the real instance method. This depends on whether the owning type of the method was seen as allocated - the tentative method conditionally depends on the real body if the type was allocated.
Before this PR, tentative methods were dispensed from `MethodEntrypoint` method on `NodeFactory`. I.e. anyone asking for a method entrypoint could potentially get a tentative entrypoint. But this also means that places that refer to method bodies and already know the owning type is allocated still introduce an unnecessary tentative entrypoint node. They should refer to the entrypoint directly. This pull request does that. One now needs to explicitly ask for a tentative entrypoint - `MethodEntrypoint`. We actually only have two places that really need to do it.
This is pretty much a zero diff change - we only change bookkeeping within the compiler.
I saw one difference in WebApi - references to finalizers from unconstructed MethodTables now bring the real method. We can fix that multiple ways. I couldn't decide the best one, so I left it out for now (should we ask for a tentative entrypoint? should we fill it out as zero? should we say unconstructed types don't have finalizers and skip it?)
Giridhar Trivedi [Tue, 10 Jan 2023 03:04:25 +0000 (08:34 +0530)]
[mono] Fix crash when GetDelegateForFunctionPointer is passed non delegate type (#79744)
When GetDelegateForFunctionPointer is invoked with non delegate type.
It iterates over all the methods available to check if these
methods are present. "Invoke" method is one such method which is
executed by the coreCLR for any type of delegates. Having said that
with non delegate "Invoke" method is not supported hence
"mono_class_get_method_from_name_checked" returns NULL.
Handle this case whenever mono_class_get_method_from_name_checked
returns NULL for any methods which are not supported.
Co-authored-by: Giridhar Trivedi <giridhar.trivedi@in.ibm.com>
Giridhar Trivedi [Tue, 10 Jan 2023 03:03:23 +0000 (08:33 +0530)]
Handle crash when [out] parameter of type Intptr* is passed to delegate (#79763)
When a delegate is passed an [out] parameter of type "intptr *"
it will crash since this data type is not handled in
emit_managed_wrapper_ilgen. This will lead to a crash.
With this fix [out] parameter of type "Intptr *" is handled
after adding an addition case statement to handle MONO_TYPE_PTR
in emit_managed_wrapper_ilgen.
Co-authored-by: Giridhar Trivedi <giridhar.trivedi@in.ibm.com>
Stephen Toub [Tue, 10 Jan 2023 02:31:00 +0000 (21:31 -0500)]
Remove Substring from EventSource.InitializeProviderMetadata (#80386)
Eric Erhardt [Tue, 10 Jan 2023 02:29:19 +0000 (20:29 -0600)]
Update Libraries Feature Switches for DynamicCodeSupport (#80397)
Elinor Fung [Tue, 10 Jan 2023 02:26:06 +0000 (18:26 -0800)]
Remove check for assembly name in p/invoke library load (#80394)
Stephen Toub [Tue, 10 Jan 2023 01:28:02 +0000 (20:28 -0500)]
Rename some BinaryPrimitives files (and move some functions) (#80381)
Zero code changes... just renamed some files, moved the contents of one file to another, and deleted a then empty file.
Stephen Toub [Tue, 10 Jan 2023 01:27:32 +0000 (20:27 -0500)]
Add public RefSafetyRulesAttribute (#80379)
Jakob Botsch Nielsen [Mon, 9 Jan 2023 23:38:05 +0000 (00:38 +0100)]
AOT: Handle printing names of generic parameter types (#80371)
This case is hittable with tokens representing open generic types that
may have their full type names printed as a comment in JIT disasm after
e398ba2.
Tanner Gooding [Mon, 9 Jan 2023 21:35:55 +0000 (13:35 -0800)]
Add a debug only config knob to control the maximum force inline depth (#80349)
Tomáš Rylek [Mon, 9 Jan 2023 21:31:17 +0000 (22:31 +0100)]
Fix HFA detection in Crossgen2 (#80218)
According to customer feedback some WPF apps are crashing on arm64
at runtime in debug mode when compiled with Crossgen2. Based on
the initial investigation by Anton Lapounov and with help from
Jan Vorlicek I have managed to identify that the problem is caused
by a mismatch between the native CoreCLR runtime and Crossgen2
w.r.t. identification of HFA types.
This change puts Crossgen2 behavior in sync with the CoreCLR
runtime. I have verified locally that this makes the GC ref map
for the method System.Windows.Media.PathGeometry.GetPathBoundsAsRB
identical with the runtime version and avoids the assertion failure
that was previously triggered in debug CoreCLR builds due to this
mismatch.
Thanks
Tomas
Lee Coward [Mon, 9 Jan 2023 20:47:13 +0000 (12:47 -0800)]
remove draft UUID section superseded by RFC 4122 (#80377)
Eric Erhardt [Mon, 9 Jan 2023 20:42:00 +0000 (14:42 -0600)]
Add IsDynamicCodeSupported Feature Switch (#80246)
* Add IsDynamicCodeSupported Feature Switch
This adds the ability to disable reflection emit for testing. It also allows for applications/libraries to simulate NativeAOT behavior (like switching on RuntimeFeature.IsDynamicCodeSupported) without actually publishing for NativeAOT.
Fix #39806
* Add IsDynamicCodeSupported feature switch support for Mono
* Remove featuredefault for IsDynamicCodeSupported so it isn't substituted during CoreLib's build.
* Add Intrinsic attribute back for Mono
Eirik Tsarpalis [Mon, 9 Jan 2023 20:04:42 +0000 (20:04 +0000)]
Add sourcegen support for required & init-only properties. (#79828)
* Add sourcegen support for required & init-only properties.
* Add test coverage for required fields & remove a few async void methods.
* Remove commented out code.
* Tweak JsonSerializerOptions resolution logic in wrapper implementation
Bruce Forstall [Mon, 9 Jan 2023 18:56:09 +0000 (10:56 -0800)]
Report more accurately when loop unrolling changes the IR (#80310)
Since unrolling rarely kicks in, reduce JitDump volume by not printing
IR in the JitDump after the unrolling phase unless necessary.
Adam Sitnik [Mon, 9 Jan 2023 18:53:02 +0000 (19:53 +0100)]
perfcollect docs: run two commands instead of three (#76325)
Mukund Raghav Sharma (Moko) [Mon, 9 Jan 2023 18:04:48 +0000 (10:04 -0800)]
Updated type of heap_segment_survived from int to size_t to facilitate survival >= 2GB. (#80302)
* Updated type of survived from int to size_t
* Fixed another printf message
* Reordered the survived field
* Addressed feedback.
Co-authored-by: Mukund Raghav Sharma <musharm@microsoft.com>
Allan Targino [Mon, 9 Jan 2023 17:54:57 +0000 (14:54 -0300)]
retrieve method symbol only once in logging source gen parser (#80365)
Martin Taillefer [Mon, 9 Jan 2023 15:58:12 +0000 (07:58 -0800)]
Add more specialized frozen collection types. (#79794)
* Add more specialized frozen collection types.
- Add SmallFrozenDictionary/Set which don't do any hashing and simply iterate through arrays,
testing each element
- Add SparseRangeInt32FrozenSet which uses a bit vector for storage.
FrozenDictionary/Set each have some constants defined to drive the heuristics that
decide when to use the small and sparse collection types. I did some preliminary tuning
of these, but this could use a detailed benchmark to pick the right values. I'll leave
the fine-tuning to a separate PR.
* Expand supported numeric sets on .NET 7+
Co-authored-by: Martin Taillefer <mataille@microsoft.com>
Radek Doulik [Mon, 9 Jan 2023 10:41:51 +0000 (11:41 +0100)]
Use PackedIndexOfIsSupported checks in more places (#80254)
* Use PackedIndexOfIsSupported checks in more places
This should avoids the size regression on WebAssembly and possibly other
platforms without Sse2.
The regression is side effect of https://github.com/dotnet/runtime/pull/78861
which uses `PackedSpanHelpers.CanUsePackedIndexOf (!!T)` and TShouldUsePacked.Value
to guard the usage of PackedSpanHelpers.
Because these involve generics, illinker is unable to link
the PackedSpanHelpers type away and that pulls other parts in, like
System.Runtime.Intrinsics.X86.* types. See https://gist.github.com/radekdoulik/
c0b52247d472f69bcf983ade78a924ea
for more complete list.
This change gets us back 9,216 bytes in the case of app used to repro
the regression.
...
- Type System.PackedSpanHelpers
- Type System.Runtime.Intrinsics.X86.X86Base
- Type System.Runtime.Intrinsics.X86.Sse
- Type System.Runtime.Intrinsics.X86.Sse2
Summary:
- 9,216 File size -0.76% (of 1,215,488)
- 2,744 Metadata size -0.43% (of 636,264)
- 4 Types count
* Update src/libraries/System.Private.CoreLib/src/System/IndexOfAnyValues/IndexOfAnyValues.cs
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* Update src/libraries/System.Private.CoreLib/src/System/IndexOfAnyValues/IndexOfAnyValues.cs
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* Feedback
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
Jakob Botsch Nielsen [Mon, 9 Jan 2023 09:30:42 +0000 (10:30 +0100)]
JIT: Fall back to a canonical SIMD handle in gtGetStructHandleForSimdOrHW (#80240)
Jakob Botsch Nielsen [Mon, 9 Jan 2023 09:30:12 +0000 (10:30 +0100)]
JIT: Fix purity of CORINFO_HELP_GETREFANY on win-x64 (#80292)
We mark this helper as pure, but on win-x64 the struct argument becomes
an implicit byref and the JIT does not support purity through the
"load".
Radek Zikmund [Mon, 9 Jan 2023 08:34:05 +0000 (09:34 +0100)]
Add SslClientAuthenticationOptions.ClientCertificateContext (#80182)
* Add SslClientAuthenticationOptions.ClientCertificateContext
* Minor changes
* Add test for mutual authentication
* Add diagnostic events
* More tests
* Small fixes
* fixup! Add diagnostic events
* Regenerate ref files
* Early return in case of CertificateContext
* Remove unwanted test
* fixup! Early return in case of CertificateContext
* Add docs
* Fix failing test on Win 7
* Remove unnecessary section in mutual auth test
* Fix failing tests
* Fix test failures on OSX
dotnet bot [Mon, 9 Jan 2023 08:29:54 +0000 (00:29 -0800)]
Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID
2081878 (#80322)
tkrafael [Mon, 9 Jan 2023 00:42:28 +0000 (21:42 -0300)]
initial support for '@' symbol in message template (#79038)
Co-authored-by: Rafael Nicoletti <rafael.nicoletti@ubuntu>
Qiao Pengcheng [Sun, 8 Jan 2023 08:00:22 +0000 (03:00 -0500)]
[LoongArch64] amend the ABI for the tests: (#80326)
`JIT/SIMD/Vector3Interop_r/Vector3Interop_r.sh`
`JIT/Directed/VectorABI/VectorMgdMgd_r/VectorMgdMgd_r.sh`
Vladimir Sadov [Sun, 8 Jan 2023 07:50:29 +0000 (23:50 -0800)]
clone the QueueUserAPC2 related defninitions to not require 22621 (#80333)
Jason Malinowski [Sun, 8 Jan 2023 04:08:48 +0000 (20:08 -0800)]
Mark Task.IsFaulted as ensuring that Task.Exception is non-null (#80278)
* Mark Task.IsFaulted as ensuring that Task.Exception is non-null
* Address PR feedback
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Huo Yaoyuan [Sun, 8 Jan 2023 03:46:57 +0000 (11:46 +0800)]
Add debugger display for huge BigInteger (#75796)
* Add debugger display for huge BigInteger
* Apply suggestions from code review
Co-authored-by: tfenise <tfenise@live.com>
* Adjust for overflow and rounding
* Fix and add test
* Apply suggestions from code review
Co-authored-by: tfenise <tfenise@live.com>
* Skip test on browser
* Adjust overflow handling and comment
* Apply suggestions from code review
Co-authored-by: Dan Moseley <danmose@microsoft.com>
* Revert "Adjust overflow handling and comment"
This reverts commit
ceac7654aeb7ce4b2b91f6d84cf891c4bcdce755.
* Update ToString culture
Co-authored-by: tfenise <tfenise@live.com>
* Apply suggestions from code review
Co-authored-by: Tanner Gooding <tagoo@outlook.com>
* Update for constant and shortcut
* Use invariant culture in test
* Use log10(2) as a constant
Co-authored-by: Drew Kersnar <18474647+dakersnar@users.noreply.github.com>
* Update length thresold to 4*uint
* Update bigger test cases
* Update test value
Co-authored-by: tfenise <tfenise@live.com>
Co-authored-by: Dan Moseley <danmose@microsoft.com>
Co-authored-by: Tanner Gooding <tagoo@outlook.com>
Co-authored-by: Drew Kersnar <18474647+dakersnar@users.noreply.github.com>
Jochem [Sun, 8 Jan 2023 03:43:31 +0000 (04:43 +0100)]
Clarify INumber.IsPositive and INumber.IsNegative documentation (#80026)
* Clarify INumber.IsPositive and INumber.IsNegative documentation
* Add clarification for negative zero
gpetrou [Sun, 8 Jan 2023 03:40:18 +0000 (05:40 +0200)]
Fix nullable annotations in ITypedList (#80033)
Steve Molloy [Sun, 8 Jan 2023 03:38:04 +0000 (19:38 -0800)]
Restore Advance when reading float/double with XmlBufferReader. (#80274)
* Restore Advance when reading float/double with XmlBufferReader.
* Removing extra unneeded usings that got magically added and are failing on not-my-machine.