Skip to content

Commit bf424dd

Browse files
authored
Merge branch 'main' into allow-xcast
2 parents 7c6fd55 + 8fa9785 commit bf424dd

File tree

234 files changed

+13993
-1411
lines changed

Some content is hidden

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

234 files changed

+13993
-1411
lines changed

.github/policies/resourceManagement.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,7 @@ configuration:
725725
mentionees:
726726
- akoeplinger
727727
- matouskozak
728+
- simonrozsival
728729
replyTemplate: >-
729730
Tagging subscribers to this area: ${mentionees}
730731

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

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,34 @@ There is no defined/enforced/declared ordering between the generic parameter and
9696
call(["this" pointer] [return buffer pointer] [generics context|varargs cookie] [userargs]*)
9797
```
9898

99+
## Async
100+
101+
Async calling convention is additive to other calling conventions when supported. The set of scenarios is constrained to regular static/virtual calls and does not, for example, support PInvokes or varargs. At the minimum ordinary static calls, calls with `this` parameter or generic hidden parameters are supported.
102+
103+
Async calling convention adds an extra `Continuation` parameter and an extra return, which sematically takes precedence when not `null`. A non-null `Continuation` upon return signals that the computation is not complete and the formal result is not ready. A non-null argument means that the function is resuming and should extract the state from the `Continuation` and continue execution (while ignoring all other arguments).
104+
105+
The `Continuation` is a managed object and needs to be tracked accordingly. The GC info includes the continuation result as live at Async call sites.
106+
107+
### Returning `Continuation`
108+
To return `Continuation` we use a volatile/calee-trash register that cannot be used to return the actual result.
109+
110+
| arch | `REG_ASYNC_CONTINUATION_RET` |
111+
| ------------- | ------------- |
112+
| x86 | ecx |
113+
| x64 | rcx |
114+
| arm | r2 |
115+
| arm64 | x2 |
116+
| risc-v | a2 |
117+
118+
### Passing `Continuation` argument
119+
The `Continuation` parameter is passed at the same position as generic instantiation parameter or immediately after, if both present.
120+
121+
```
122+
call(["this" pointer] [return buffer pointer] [generics context] [continuation] [userargs]) // not x86
123+
124+
call(["this" pointer] [return buffer pointer] [userargs] [generics context] [continuation]) // x86
125+
```
126+
99127
## AMD64-only: by-value value types
100128

101129
Just like native, AMD64 has implicit-byrefs. Any structure (value type in IL parlance) that is not 1, 2, 4, or 8 bytes in size (i.e., 3, 5, 6, 7, or >= 9 bytes in size) that is declared to be passed by value, is instead passed by reference. For JIT generated code, it follows the native ABI where the passed-in reference is a pointer to a compiler generated temp local on the stack. However, there are some cases within remoting or reflection where apparently stackalloc is too hard, and so they pass in pointers within the GC heap, thus the JITed code must report these implicit byref parameters as interior pointers (BYREFs in JIT parlance), in case the callee is one of these reflection paths. Similarly, all writes must use checked write barriers.
@@ -729,4 +757,4 @@ MyStruct Test2()
729757
// We can use memset here
730758
return default;
731759
}
732-
```
760+
```

docs/design/specs/runtime-async.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,4 @@ Other restrictions are likely to be permanent, including
8383
| Flag | Value | Description |
8484
| ------------- | ------------- | ------------- |
8585
| . . . | . . . | . . . |
86-
|Async |0x0400 |Method is an Async Method.|
86+
|Async |0x2000 |Method is an Async Method.|

docs/project/os-onboarding.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ VMs and raw metal environments are used for Android, Apple, Linux, and Windows O
119119

120120
### Other
121121

122-
Other environments are typically use a custom process.
122+
Other environments have their own process.
123+
124+
- [Android](../workflow/testing/libraries/testing-android.md#upgrading-the-android-ndk-version-in-ci-pipelines)
123125

124126
- [Browser Wasm](https://github.com/dotnet/runtime/pull/112066)
125127

docs/workflow/using-docker.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ The main Docker images are the most commonly used ones, and the ones you will pr
4747
| Azure Linux (x64) | Debian sid | LoongArch | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-cross-loongarch64` | `/crossrootfs/loongarch64` |
4848
| Azure Linux (x64) | Ubuntu 18.04 | S390x | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-cross-s390x` | `/crossrootfs/s390x` |
4949
| Azure Linux (x64) | Ubuntu 18.04 (Wasm) | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-webassembly-amd64` | `/crossrootfs/x64` |
50-
| Debian (x64) | Debian 12 | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-gcc14-amd64` | *N/A* |
50+
| Debian (x64) | Debian 12 | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-gcc15-amd64` | *N/A* |
5151
| Ubuntu (x64) | Tizen 9.0 | Arm32 (armel) | `mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-cross-armel-tizen` | `/crossrootfs/armel` |
5252
| Ubuntu (x64) | Ubuntu 20.04 | Arm32 (v6) | `mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-20.04-cross-armv6-raspbian-10` | `/crossrootfs/armv6` |
5353

eng/Subsets.props

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
<PropertyGroup>
6161
<DefaultPrimaryRuntimeFlavor>CoreCLR</DefaultPrimaryRuntimeFlavor>
6262
<DefaultPrimaryRuntimeFlavor Condition="'$(CoreCLRSupported)' != 'true'">Mono</DefaultPrimaryRuntimeFlavor>
63+
<DefaultPrimaryRuntimeFlavor Condition="'$(TargetsBrowser)' == 'true' and !$(Subset.ToLowerInvariant().Contains('clr'))">Mono</DefaultPrimaryRuntimeFlavor>
6364
<PrimaryRuntimeFlavor Condition="'$(PrimaryRuntimeFlavor)' == ''">$(DefaultPrimaryRuntimeFlavor)</PrimaryRuntimeFlavor>
6465
</PropertyGroup>
6566

@@ -646,7 +647,7 @@
646647
</PropertyGroup>
647648

648649
<PropertyGroup Condition="'$(DotNetBuildAllRuntimePacks)' == 'true' and '$(DotNetBuildSourceOnly)' != 'true'">
649-
<_BuildCoreCLRRuntimePack Condition="'$(CoreCLRSupported)' == 'true'">true</_BuildCoreCLRRuntimePack>
650+
<_BuildCoreCLRRuntimePack Condition="'$(CoreCLRSupported)' == 'true' and '$(TargetsBrowser)' != 'true'">true</_BuildCoreCLRRuntimePack>
650651
<_BuildMonoRuntimePack Condition="'$(MonoSupported)' == 'true'">true</_BuildMonoRuntimePack>
651652
</PropertyGroup>
652653

0 commit comments

Comments
 (0)