-
Notifications
You must be signed in to change notification settings - Fork 210
[RuntimeAsync] Merge from upstream #3093
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jakobbotsch
merged 143 commits into
dotnet:feature/async2-experiment
from
jakobbotsch:merge-from-upstream
Apr 21, 2025
Merged
[RuntimeAsync] Merge from upstream #3093
jakobbotsch
merged 143 commits into
dotnet:feature/async2-experiment
from
jakobbotsch:merge-from-upstream
Apr 21, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The stack walking over interpreter frames relies on the fact that the `InterpreterFrame` is always at higher address than all the `InterpMethodContextFrame` instances of the underlying interpreter frames. In the `ExecuteInterpretedMethod`, there are instances of both of these types and I haven't realized before that the compiler is free to pick any order of storing them in the stack frame of the method. It actually happens in Checked builds and results in an assert in the stack walker, because the `InterpreterFrame` is then determined to be skipped. This change fixes it by ensuring proper ordering of those instances using a wrapper struct.
* Replace CodeManState with cache in EECodeInfo for x86. On all other platforms CodeManState was unused and taking space in StackFrameIterator. Optimize some code paths to cache GC info early or decode the method size without decoding the whole table. Move PCTAddr (Eip pointer) into KNONVOLATILE_CONTEXT_POINTERS_EX to avoid recomputing it when switching between callee and caller contexts. * Revert the PCTAddr move into KNONVOLATILE_CONTEXT_POINTERS->Eip but keep the helpers * Improve the GC info cache by caching the table pointer instead of size and thus avoid repeated GetGCInfoToken() calls
Add mono.emsdk subset for clr.runtime on browser
Unhandled OOM in `GetAddressInfoExCallback` may crash the process. We should catch and forward exceptions in the method.
ToolsTests legs are failing: dotnet/runtime#114406 (comment) Psychic debugging (without actually trying to repro anything) tells me this is from #114346 that makes us emit more dynamic keyword warnings. That PR didn't trigger the ToolsTests leg since it's not a ILLink change.
Extends preinitialization support to cover scenario in dotnet/runtime#114354 (comment). * We only supported `ldsflda` instruction if the field was on the same type as we're preinitializing. This lifts the restriction to support loading addresses of readonly fields on other types, even if they have a static constructor, provided the cctor can be interpreted. One complication here is that this exposes us to correctness issues when address of the same field is loaded multiple times. We need to make sure nested preinit results are interned. The newly added `TestByRefFieldAddressEquality` test tests things that go wrong if we don't do interning. * We didn't support calling methods on types that have a static constructor. This lifts the restriction if the static constructor is side effect free (approximated by "can be interpreted"). * We had limitations around `ldobj` that is used when dereferencing pointers. This lifts some of the restrictions and we can now `ldobj` many valuetypes, including the special vtable ones.
The problem with this API is that in a trimmed app, accessing `Method` on a delegate type forces trimming to consider all delegate targets also targets of reflection (since we're grabbing a `MethodInfo` for whatever is the target). We do try to optimize this and only consider targets of the same delegate type, but in this case it means `Func<T, U>` and `Func<T,U,V>` which are very popular delegate types. Avoiding `Delegate.Method` is a 0.8% size saving for the Microsoft Store app. The differences are: * Originally this was calling `ToString` on the `MethodInfo`, which returns the name and signature of the method. I'm replacing this with `FullName` of the owning type and the name of the method. This is both more information and less information - we get owning type, we lose signature. It feels more useful nevertheless. * When the app is trimmed and `StackTraceSupport` feature switch is set to false, this will return question marks. The 0.8% size savings is present no matter the value of the `StackTraceSupport` switch.
…ide (take2) (#114352) This is a combination of @am11's work in PR dotnet/runtime#109087 and some work to just rewrite the Windows X86 helpers in assembly. For non 64-bit platforms, remove the helpers For Unix platforms, rely on an implementation which uses an FCall to native code to invoke the various operations. For Windows X86 on CoreCLR, rewrite the helpers in assembly with a tail-call approach for throwing. Also it was noted that the existing helpers do a fair bit of unnecessary stack manipulation, and the manual rewrite avoids all of that. Maybe this will actually be faster. (Turns out it is about the same on performance. The real win would come from re-ordering the argument order, but that's a much more invasive change in the JIT, which I judge to be too risky) Revert #114308 and fix the X86 NativeAOT build
* CertificateAuthority gains algorithm agility, varying across RSA and EC-DSA deterministically. * CertificateRequestChainTests stops using AsymmetricAlgorithm in advance of the new, non-AA types. * CertificateRequestLoadTests ensures that Load+Create yields the same as new+Create for all supported signature generator types. * PrivateKeyAssociationTests ensures the relationship of CopyWithPrivateKey, Get{Alg}PublicKey, Get{Alg}PrivateKey for all existing asymmetric algorithm types (even ECDH!)
* Name native threads before start on macOS * Use Thread.CurrentThread
* ExceptionHandling.RaiseAppDomainUnhandledExceptionEvent() Add new API for all runtimes. Add tests for all runtimes. --------- Co-authored-by: Stephen Toub <[email protected]>
The `rorx` instruction uses format IF_RWR_ARD_CNS. This format was not handled when killing GC refs in `emitOutputAM`. I added other cases of register write "ARD" address mode formats to the same case as "defense in depth" -- most or all of them are probably SIMD instructions with SIMD destination registers, and won't go down this code path. Diffs include cases in the HardwareIntrinsics tests, but also in the libraries code, for both x64 and x86.
* Fix the SetupCompileBeforeAttribute's ctor parameters being out of sync. AdditionalArgs was changed to a `string[]` in one ctor but not the other. Updated a test to give coverage. * Put throw helpers inside of `#if NET`. We are still compiling `Mono.Linker.Tests.Cases.Expectations` against `netstandard2.0` and `net471` and this
* Cleanup connection after managed websocket dispose. * Clean up in finalizer to avoid memory leak if user is not disposing properly.
* Add code owners for interpreter source files * Add owner notifications for coreclr interpreter label * Add kg
…tpHandler (#113728) * Ignore DefaultCredentials in Basic Auth * Fix formatting in AuthenticationHelper for Basic Auth credential check * Remove unnecessary blank line in AuthenticationHelper * Add SocketsHttpHandler_UseDefaultCredentials_OneRequestOnlyWhen401 test * update * update * update * update * Ignore DefaultCredentials in Digest auth * Update UT * Rename test method for clarity on Basic Authentication behavior * update * update * Refactor SocketsHttpHandler test to use Theory for authentication types Updated the SocketsHttpHandler_UseDefaultCredentials test to utilize [Theory] and [InlineData] attributes, allowing for testing with both Basic and Digest authentication types.
…doing build for FreeBSD-arm64 using internal libunwind (#110432) * Fix for "ld.lld: error: undefined symbol: _Uaarch64_setcontext" when doing build for arm64 using internal libunwind * New lines * 'comment' * stick to naming
…" step so we don't need to munge them through the different runtime jobs (#114706)
* Add alias for SN SquareRoot as well * Add store alias * Add Store intrinsics
…eAOT runtime pack as the runtime package. (#114556)
* Update dependencies from https://github.com/dotnet/arcade build 20250412.1 Microsoft.SourceBuild.Intermediate.arcade , 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.XliffTasks , Microsoft.DotNet.XUnitAssert , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions From Version 10.0.0-beta.25206.1 -> To Version 10.0.0-beta.25212.1 * Update dependencies from https://github.com/dotnet/arcade build 20250414.8 Microsoft.SourceBuild.Intermediate.arcade , 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.XliffTasks , Microsoft.DotNet.XUnitAssert , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions From Version 10.0.0-beta.25206.1 -> To Version 10.0.0-beta.25214.8 * Update sdk dependency --------- Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: Alexander Köplinger <[email protected]>
* Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20250305.1 Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers From Version 3.12.0-beta1.25127.1 -> To Version 3.12.0-beta1.25155.1 * Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20250323.4 Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers From Version 3.12.0-beta1.25127.1 -> To Version 3.12.0-beta1.25173.4 * Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20250326.1 Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers From Version 3.12.0-beta1.25127.1 -> To Version 3.12.0-beta1.25176.1 * Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20250327.1 Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers From Version 3.12.0-beta1.25127.1 -> To Version 3.12.0-beta1.25177.1 * Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20250328.1 Microsoft.CodeAnalysis.NetAnalyzers From Version 10.0.0-preview.25127.1 -> To Version 10.0.0-preview.25178.1 * Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20250331.1 Microsoft.CodeAnalysis.NetAnalyzers From Version 10.0.0-preview.25127.1 -> To Version 10.0.0-preview.25181.1 * Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20250414.1 Microsoft.CodeAnalysis.NetAnalyzers From Version 10.0.0-preview.25127.1 -> To Version 10.0.0-preview.25214.1 * Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20250415.1 Microsoft.CodeAnalysis.NetAnalyzers From Version 10.0.0-preview.25127.1 -> To Version 10.0.0-preview.25215.1 --------- Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: Larry Ewing <[email protected]> Co-authored-by: Alexander Köplinger <[email protected]>
* Update dependencies from https://github.com/dotnet/xharness build 20250326.1 Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit From Version 10.0.0-prerelease.25167.4 -> To Version 10.0.0-prerelease.25176.1 * Update dependencies from https://github.com/dotnet/xharness build 20250402.1 Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit From Version 10.0.0-prerelease.25167.4 -> To Version 10.0.0-prerelease.25202.1 * Update dependencies from https://github.com/dotnet/xharness build 20250411.1 Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit From Version 10.0.0-prerelease.25167.4 -> To Version 10.0.0-prerelease.25211.1 --------- Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: Larry Ewing <[email protected]>
…#114056) * Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20250329.2 optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR From Version 1.0.0-prerelease.25171.2 -> To Version 1.0.0-prerelease.25179.2 * Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20250404.2 optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR From Version 1.0.0-prerelease.25171.2 -> To Version 1.0.0-prerelease.25204.2 * Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20250412.3 optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR From Version 1.0.0-prerelease.25171.2 -> To Version 1.0.0-prerelease.25212.3 --------- Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: Alexander Köplinger <[email protected]>
…114448) * Do not build or ship standalone GC libs for coreclr android * Do not build server GC into the coreCLR runtime lib on Android * Properly guard server GC specific defines * Remove unnecesarry exclusion
* Support W3C Propagator * Fix the comment * Remove wrong assert * try fix tracestate in http tests * fix failure cases in the http tests * More http test fixes * fix typo in test * Address the feedback * Swap the comments * Add baggage extraction test with correlation-context * Address Miha's feedback * Feedback * Add the new exposed APIs
…4722) osx-arm64 queues have been timing out due to too many jobs sent to too few machines, by the superpmi-collect pipeline.
Rework the logic so the FCall doesn't do any allocations and defers any non-fast scenario to the slow path.
Add testing.
* use `printfAlloc` in a few places * move escape-analysis specific layout code to objectalloc.cpp * use custom layout for stack allocated boxes * use layout a bit more broadly in objectalloc.cpp
… (#112403) this is to make regions behave very similarly to segments for heavily pinning scenarios. previously we observed regression in heap size due to regions not being aggressively demoted. changes included in this PR - + use the same policy for demotion of pinned plugs as much as possible for regions. since objects in a region can only belong to one generation, for pins observed skip_pins_in_alloc_region they will not use the same policy as they must belong to what's already allocated in that region. this policy is only applicable for regions with only pins left. + attribute the pins to the higher generation's generation_allocation_size when appropriate. + update data for events correctly for these pins. with these changes I'm seeing a heavily pinned scenario be able to keep the heap size much lower and basically stable, vs without fix it goes up steadily. there can be some regression in % time in GC by design since we now leave more pins in gen0 which increases the amount of survived memory gen0 has to process.
…ed load (#114719) - Use different copies (library names) for p/invokes in the `DllImportSearchPathTests` so that we don't end up using the runtime cached of loaded unmanaged libraries - Add a test for default search flags
VSadov
approved these changes
Apr 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
cb70e12
into
dotnet:feature/async2-experiment
2 of 8 checks passed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Especially to pick up dotnet/runtime#114542
cc @VSadov