Skip to content

Commit 5e3d368

Browse files
authored
Merge branch 'main' into interp-bitcast
2 parents ae56449 + f223627 commit 5e3d368

File tree

2,709 files changed

+187391
-153875
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,709 files changed

+187391
-153875
lines changed

.github/workflows/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Please make sure to include the @dotnet/runtime-infrastructure group as a review
66

77
For workflows that are triggered by pull requests, refer to GitHub's documentation for the `pull_request` and `pull_request_target` events. The `pull_request_target` event is the more common use case in this repository as it runs the workflow in the context of the target branch instead of in the context of the pull request's fork or branch. However, workflows that need to consume the contents of the pull request need to use the `pull_request` event. There are security considerations with each of the events though.
88

9-
Most workflows are intended to run only in the `dotnet/runtime` repository and not in forks. To force workflow jobs to be skipped in forks, each job should apply an `if` statement that checks the repository name or owner. Either approach works, but checking only the repository owner allows the workflow to run in copies or forks withing the dotnet org.
9+
Most workflows are intended to run only in the `dotnet/runtime` repository and not in forks. To force workflow jobs to be skipped in forks, each job should apply an `if` statement that checks the repository name or owner. Either approach works, but checking only the repository owner allows the workflow to run in copies or forks within the dotnet org.
1010

1111
```yaml
1212
jobs:

docs/design/coreclr/botr/clr-abi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,12 @@ To return `Continuation` we use a volatile/calee-trash register that cannot be u
116116
| risc-v | a2 |
117117

118118
### Passing `Continuation` argument
119-
The `Continuation` parameter is passed at the same position as generic instantiation parameter or immediately after, if both present.
119+
The `Continuation` parameter is passed at the same position as generic instantiation parameter or immediately after, if both present. For x86 the argument order is reversed.
120120

121121
```
122122
call(["this" pointer] [return buffer pointer] [generics context] [continuation] [userargs]) // not x86
123123
124-
call(["this" pointer] [return buffer pointer] [userargs] [generics context] [continuation]) // x86
124+
call(["this" pointer] [return buffer pointer] [userargs] [continuation] [generics context]) // x86
125125
```
126126

127127
## AMD64-only: by-value value types

docs/design/datacontracts/StackWalk.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,13 @@ This contract depends on the following descriptors:
4242
| `InlinedCallFrame` | `CallSiteSP` | SP saved in Frame |
4343
| `InlinedCallFrame` | `CallerReturnAddress` | Return address saved in Frame |
4444
| `InlinedCallFrame` | `CalleeSavedFP` | FP saved in Frame |
45+
| `InlinedCallFrame` (arm) | `SPAfterProlog` | Value of the SP after prolog. Used on ARM to maintain additional JIT invariant |
4546
| `SoftwareExceptionFrame` | `TargetContext` | Context object saved in Frame |
4647
| `SoftwareExceptionFrame` | `ReturnAddress` | Return address saved in Frame |
4748
| `FramedMethodFrame` | `TransitionBlockPtr` | Pointer to Frame's TransitionBlock |
4849
| `TransitionBlock` | `ReturnAddress` | Return address associated with the TransitionBlock |
4950
| `TransitionBlock` | `CalleeSavedRegisters` | Platform specific CalleeSavedRegisters struct associated with the TransitionBlock |
51+
| `TransitionBlock` (arm) | `ArgumentRegisters` | ARM specific `ArgumentRegisters` struct |
5052
| `FuncEvalFrame` | `DebuggerEvalPtr` | Pointer to the Frame's DebuggerEval object |
5153
| `DebuggerEval` | `TargetContext` | Context saved inside DebuggerEval |
5254
| `DebuggerEval` | `EvalDuringException` | Flag used in processing FuncEvalFrame |
@@ -56,7 +58,8 @@ This contract depends on the following descriptors:
5658
| `HijackFrame` | `HijackArgsPtr` | Pointer to the Frame's stored HijackArgs |
5759
| `HijackArgs` (amd64) | `CalleeSavedRegisters` | CalleeSavedRegisters data structure |
5860
| `HijackArgs` (amd64 Windows) | `Rsp` | Saved stack pointer |
59-
| `HijackArgs` (arm64) | For each register `r` saved in HijackArgs, `r` | Register names associated with stored register values |
61+
| `HijackArgs` (arm/arm64/x86) | For each register `r` saved in HijackArgs, `r` | Register names associated with stored register values |
62+
| `ArgumentRegisters` (arm) | For each register `r` saved in ArgumentRegisters, `r` | Register names associated with stored register values |
6063
| `CalleeSavedRegisters` | For each callee saved register `r`, `r` | Register names associated with stored register values |
6164
| `TailCallFrame` (x86 Windows) | `CalleeSavedRegisters` | CalleeSavedRegisters data structure |
6265
| `TailCallFrame` (x86 Windows) | `ReturnAddress` | Frame's stored instruction pointer |
@@ -244,6 +247,8 @@ Most of the handlers are implemented in `BaseFrameHandler`. Platform specific co
244247

245248
InlinedCallFrames store and update only the IP, SP, and FP of a given context. If the stored IP (CallerReturnAddress) is 0 then the InlinedCallFrame does not have an active call and should not update the context.
246249

250+
* On ARM, the InlinedCallFrame stores the value of the SP after the prolog (`SPAfterProlog`) to allow unwinding for functions with stackalloc. When a function uses stackalloc, the CallSiteSP can already have been adjusted. This value should be placed in R9.
251+
247252
#### SoftwareExceptionFrame
248253

249254
SoftwareExceptionFrames store a copy of the context struct. The IP, SP, and all ABI specified (platform specific) callee-saved registers are copied from the stored context to the working context.
@@ -254,6 +259,8 @@ TransitionFrames hold a pointer to a `TransitionBlock`. The TransitionBlock hold
254259

255260
When updating the context from a TransitionFrame, the IP, SP, and all ABI specified callee-saved registers are copied over.
256261

262+
* On ARM, the additional register values stored in `ArgumentRegisters` are copied over. The `TransitionBlock` holds a pointer to the `ArgumentRegister` struct containing these values.
263+
257264
The following Frame types also use this mechanism:
258265
* FramedMethodFrame
259266
* CLRToCOMMethodFrame
@@ -289,7 +296,9 @@ HijackFrames carry a IP (ReturnAddress) and a pointer to `HijackArgs`. All platf
289296
* x64 - On x64, HijackArgs contains a CalleeSavedRegister struct. The saved registers values contained in the struct are copied over to the working context.
290297
* Windows - On Windows, HijackArgs also contains the SP value directly which is copied over to the working context.
291298
* Non-Windows - On OS's other than Windows, HijackArgs does not contain an SP value. Instead since the HijackArgs struct lives on the stack, the SP is `&hijackArgs + sizeof(HijackArgs)`. This value is also copied over.
292-
* arm64 - Unlike on x64, on arm64 HijackArgs contains a list of register values instead of the CalleeSavedRegister struct. These values are copied over to the working context. The SP is fetched using the same technique as on x64 non-Windows where `SP = &hijackArgs + sizeof(HijackArgs)` and is copied over to the working context.
299+
* x86 - On x86, HijackArgs contains a list of register values instead of the CalleeSavedRegister struct. These values are copied over to the working context. The SP copied over to the working context and found using `SP = &hijackArgs + sizeof(HijackArgs)`.
300+
* arm64 - Unlike on x64, on arm64 HijackArgs contains a list of register values instead of the CalleeSavedRegister struct. These values are copied over to the working context. The SP is fetched using the same technique as on x64 non-Windows where `SP = &hijackArgs + sizeof(HijackArgs) + (hijackArgsSize % 16)` and is copied over to the working context. Note: `HijackArgs` may be padded to maintain 16 byte stack alignment.
301+
* arm - Similar to arm64, HijackArgs contains a list of register values. These values are copied over to the working context. The SP is fetched using the same technique as arm64 where `SP = &hijackArgs + sizeof(HijackArgs) + (hijackArgsSize % 8)` and is copied over to the working context. Note: `HijackArgs` may be padded to maintain 8 byte stack alignment.
293302

294303
#### TailCallFrame
295304

docs/project/list-of-diagnostics.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,9 @@ Diagnostic id values for experimental APIs must not be recycled, as that could s
310310

311311
| Diagnostic ID | Introduced | Removed | Description |
312312
| :---------------- | ---------: | ------: | :---------- |
313-
| __`SYSLIB5001`__ | .NET 9 | TBD | `Tensor<T>` and related APIs in System.Numerics.Tensors are experimental |
313+
| __`SYSLIB5001`__ | .NET 9 | .NET 10 | `Tensor<T>` and related APIs in System.Numerics.Tensors are experimental |
314314
| __`SYSLIB5002`__ | .NET 9 | TBD | `SystemColors` alternate colors are experimental |
315315
| __`SYSLIB5003`__ | .NET 9 | TBD | `System.Runtime.Intrinsics.Arm.Sve` is experimental |
316316
| __`SYSLIB5004`__ | .NET 9 | TBD | `X86Base.DivRem` is experimental since performance is not as optimized as `T.DivRem` |
317-
| __`SYSLIB5005`__ | .NET 9 | TBD | `System.Formats.Nrbf` is experimental |
317+
| __`SYSLIB5005`__ | .NET 9 | .NET 10 | `System.Formats.Nrbf` is experimental |
318318
| __`SYSLIB5006`__ | .NET 10 | TBD | Types for Post-Quantum Cryptography (PQC) are experimental. |

eng/CodeAnalysis.src.globalconfig

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ dotnet_diagnostic.CA1860.severity = warning
480480
# CA1861: Avoid constant arrays as arguments
481481
dotnet_diagnostic.CA1861.severity = warning
482482

483-
# CA1862: Prefer using 'StringComparer'/'StringComparison' to perform case-insensitive string comparisons
483+
# CA1862: Use the 'StringComparison' method overloads to perform case-insensitive string comparisons
484484
dotnet_diagnostic.CA1862.severity = suggestion
485485

486486
# CA1863: Use 'CompositeFormat'
@@ -513,6 +513,15 @@ dotnet_diagnostic.CA1871.severity = warning
513513
# CA1872: Prefer 'Convert.ToHexString' and 'Convert.ToHexStringLower' over call chains based on 'BitConverter.ToString'
514514
dotnet_diagnostic.CA1872.severity = warning
515515

516+
# CA1873: Avoid potentially expensive logging
517+
dotnet_diagnostic.CA1873.severity = warning
518+
519+
# CA1874: Use 'Regex.IsMatch'
520+
dotnet_diagnostic.CA1874.severity = warning
521+
522+
# CA1875: Use 'Regex.Count'
523+
dotnet_diagnostic.CA1875.severity = warning
524+
516525
# CA2000: Dispose objects before losing scope
517526
dotnet_diagnostic.CA2000.severity = none
518527

@@ -564,7 +573,13 @@ dotnet_diagnostic.CA2021.severity = warning
564573
# CA2022: Avoid inexact read with 'Stream.Read'
565574
dotnet_diagnostic.CA2022.severity = warning
566575

567-
# CA2025: Ensure tasks using 'IDisposable' instances complete before the instances are disposed
576+
# CA2023: Invalid braces in message template
577+
dotnet_diagnostic.CA2023.severity = warning
578+
579+
# CA2024: Do not use 'StreamReader.EndOfStream' in async methods
580+
dotnet_diagnostic.CA2024.severity = warning
581+
582+
# CA2025: Do not pass 'IDisposable' instances into unawaited tasks
568583
dotnet_diagnostic.CA2025.severity = warning
569584

570585
# CA2100: Review SQL queries for security vulnerabilities

eng/RuntimeIdentifier.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
<!-- On Windows, we can build for Windows and Mobile.
2424
For other TargetOSes, create a "win" build, built from TargetOS sources and "win" pre-built packages. -->
2525
<PortableOS Condition="'$(HostOS)' == 'win' and '$(TargetsMobile)' != 'true'">win</PortableOS>
26+
27+
<PortableTargetRid Condition="'$(PortableTargetRid)' == ''">$(PortableOS)-$(TargetArchitecture)</PortableTargetRid>
2628
</PropertyGroup>
2729

2830
<!-- TargetRid is used to name the target platform.

eng/Subsets.props

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,6 @@
8282
<DefaultSubsets Condition="'$(DotNetBuildPass)' == '2' and '$(TargetOS)' == 'windows' and '$(TargetArchitecture)' == 'x86'">crossdacpack</DefaultSubsets>
8383
</PropertyGroup>
8484

85-
<PropertyGroup>
86-
<!-- In .NET product build mode we want to build all of the assets even in a PGO-instrumented build as downstream repos will not be able to pull assets from a matching non-PGO-instrumented build. -->
87-
<BuildOnlyPgoInstrumentedAssets Condition="'$(PgoInstrument)' == 'true' and '$(DotNetBuild)' != 'true'">true</BuildOnlyPgoInstrumentedAssets>
88-
</PropertyGroup>
89-
9085
<PropertyGroup Condition="'$(BuildMonoAOTCrossCompilerOnly)' == 'true' or ('$(DotNetBuildAllRuntimePacks)' == 'true' and '$(MonoAOTCrossCompilerSupported)' == 'true')">
9186
<MonoCrossAOTTargetOS>android+browser+wasi</MonoCrossAOTTargetOS>
9287
<MonoCrossAOTTargetOS Condition="'$(TargetOS)' == 'osx'">$(MonoCrossAOTTargetOS)+tvos+ios+maccatalyst</MonoCrossAOTTargetOS>
@@ -522,7 +517,7 @@
522517
<ProjectToBuild Include="$(CoreClrProjectRoot)crossgen-corelib.proj" Category="clr" />
523518
</ItemGroup>
524519

525-
<ItemGroup Condition="$(_subset.Contains('+clr.packages+')) and '$(BuildOnlyPgoInstrumentedAssets)' != 'true'">
520+
<ItemGroup Condition="$(_subset.Contains('+clr.packages+'))">
526521
<ProjectToBuild Include="$(CoreClrProjectRoot).nuget\coreclr-packages.proj" Category="clr" />
527522
</ItemGroup>
528523

@@ -578,7 +573,7 @@
578573
<ProjectToBuild Include="@(ManagedProjectToBuild)" BuildInParallel="true" Category="host" />
579574
</ItemGroup>
580575

581-
<ItemGroup Condition="$(_subset.Contains('+host.pkg+')) and '$(BuildOnlyPgoInstrumentedAssets)' != 'true'">
576+
<ItemGroup Condition="$(_subset.Contains('+host.pkg+'))">
582577
<PkgprojProjectToBuild Include="$(InstallerProjectRoot)pkg\projects\host-packages.proj" />
583578
<ProjectToBuild Include="@(PkgprojProjectToBuild)" Category="host" />
584579
</ItemGroup>
@@ -635,11 +630,6 @@
635630
<Choose>
636631
<When Condition="$(_subset.Contains('+packs.product+'))">
637632
<Choose>
638-
<When Condition="'$(BuildOnlyPgoInstrumentedAssets)' == 'true'">
639-
<ItemGroup>
640-
<ProjectToBuild Include="$(InstallerProjectRoot)pkg\sfx\bundle\Microsoft.NETCore.App.Bundle.bundleproj" Category="packs" />
641-
</ItemGroup>
642-
</When>
643633
<When Condition="'$(BuildMonoAOTCrossCompilerOnly)' == 'true'">
644634
<ItemGroup Condition="'$(MonoCrossAOTTargetOS)' != ''">
645635
<ProjectToBuild Include="$(InstallerProjectRoot)pkg\sfx\Microsoft.NETCore.App\monocrossaot.proj" Category="packs" />
@@ -650,8 +640,7 @@
650640
<_BuildCoreCLRRuntimePack Condition="'$(RuntimeFlavor)' == 'CoreCLR' and '$(CoreCLRSupported)' == 'true'">true</_BuildCoreCLRRuntimePack>
651641
<_BuildMonoRuntimePack Condition="'$(RuntimeFlavor)' == 'Mono' and '$(MonoSupported)' == 'true'">true</_BuildMonoRuntimePack>
652642
<_BuildHostPack Condition="'$(RuntimeFlavor)' == '$(PrimaryRuntimeFlavor)' and '$(TargetsMobile)' != 'true'">true</_BuildHostPack>
653-
<_BuildCdacPack Condition="'$(_CDacToolsBuilt)' == 'true' and '$(RuntimeFlavor)' == 'CoreCLR' and '$(TargetsMobile)' != 'true' and '$(TargetsLinuxMusl)' != 'true' and ('$(TargetOS)' == 'windows' or '$(TargetOS)' == 'osx' or '$(TargetOS)' == 'linux')">true</_BuildCdacPack>
654-
<_BuildCdacPack Condition="'$(DotNetBuildSourceOnly)' == 'true' or '$(TargetArchitecture)' == 'arm' or '$(TargetArchitecture)' == 'armel' or '$(TargetArchitecture)' == 'x86' or '$(TargetArchitecture)' == 'riscv64'">false</_BuildCdacPack>
643+
<_BuildCdacPack Condition="'$(_CDacToolsBuilt)' == 'true' and '$(RuntimeFlavor)' == 'CoreCLR' and '$(TargetsMobile)' != 'true' and ('$(TargetOS)' == 'windows' or '$(TargetOS)' == 'osx' or '$(TargetOS)' == 'linux')">true</_BuildCdacPack>
655644
<_BuildBundle Condition="'$(RuntimeFlavor)' == '$(PrimaryRuntimeFlavor)' and '$(TargetsMobile)' != 'true'">true</_BuildBundle>
656645
</PropertyGroup>
657646

@@ -709,12 +698,12 @@
709698
</When>
710699
</Choose>
711700

712-
<ItemGroup Condition="$(_subset.Contains('+packs.installers+')) AND '$(BuildOnlyPgoInstrumentedAssets)' != 'true'">
701+
<ItemGroup Condition="$(_subset.Contains('+packs.installers+'))">
713702
<InstallerProjectToBuild Include="$(InstallerProjectRoot)pkg\sfx\installers.proj" />
714703
<ProjectToBuild Include="@(InstallerProjectToBuild)" Category="packs" />
715704
</ItemGroup>
716705

717-
<ItemGroup Condition="$(_subset.Contains('+packs.tests+')) AND '$(BuildOnlyPgoInstrumentedAssets)' != 'true'">
706+
<ItemGroup Condition="$(_subset.Contains('+packs.tests+'))">
718707
<TestProjectToBuild Include="$(InstallerProjectRoot)tests\Microsoft.DotNet.CoreSetup.Packaging.Tests\Microsoft.DotNet.CoreSetup.Packaging.Tests.csproj" />
719708
<ProjectToBuild Include="@(TestProjectToBuild)" BuildInParallel="true" Test="true" Category="packs" />
720709
</ItemGroup>

0 commit comments

Comments
 (0)