Skip to content

Commit c9915a4

Browse files
lewingCopilot
andcommitted
Merge origin/main into lewing-wasi-r2r-prototype (rebaseline 2026-07-13)
Rebaselines the WASI R2R prototype onto current main (67 commits, now includes dotnet#130446 param-homing merged upstream 07-12). 4 trivial conflicts resolved in favor of origin/main (jiteeversionguid.h GUID token; wasi PAL stubs/file/map comment+null-check polish that landed via dotnet#130051 squash). dotnet#130446 de-duplicated cleanly (our cherry-pick == main's merged change). Prototype-only delta preserved: dotnet#130384 (inline pinvokes, still draft upstream), GAP1 (crossgen2 Program.cs +Wasi optimistic-ISA), static-compose corerun glue + JIT-EE WasmWellKnownGlobalSymbol additions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2 parents 676fd33 + 8a53018 commit c9915a4

295 files changed

Lines changed: 14298 additions & 3365 deletions

File tree

Some content is hidden

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

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
]
1616
},
1717
"microsoft.dotnet.xharness.cli": {
18-
"version": "11.0.0-prerelease.26319.2",
18+
"version": "11.0.0-prerelease.26360.1",
1919
"commands": [
2020
"xharness"
2121
]

.github/instructions/cdac.instructions.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
applyTo: "src/native/managed/cdac/**"
2+
applyTo: "src/native/managed/cdac/**,docs/design/datacontracts/**,src/coreclr/**/datadescriptor/**"
33
---
44

55
# cDAC — Folder-Specific Guidance
@@ -32,3 +32,16 @@ When porting `HRESULT`-returning APIs to throw exceptions, the following mapping
3232
- `ArgumentException` → for `E_INVALIDARG`
3333
- `NullReferenceException` → for `E_POINTER`
3434
- `InvalidCastException` → for `E_NOINTERFACE`
35+
36+
## Documentation updates (ALL branches)
37+
38+
`docs/design/datacontracts/<Name>.md` is the authoritative spec of each contract (1:1 with `Abstractions/Contracts/I<Name>.cs`). If the PR changes any of the following without also updating the doc, **MUST** flag it as an error citing the exact doc file:
39+
40+
- **`Abstractions/Contracts/I<Name>.cs`** — added, removed, or renamed methods, or new exposed types/enums.
41+
- **`Contracts/Contracts/<Name>_<N>.cs`** — a new version file (needs a new `## Version N` section), or a semantic change to an existing version's algorithm. Pure refactors don't need doc updates.
42+
- **New contract** (new `I<Name>.cs` + `<Name>_1.cs`) — needs a new `docs/design/datacontracts/<Name>.md`.
43+
- **`src/coreclr/**/datadescriptor/**`** — added, removed, or renamed types, fields, or globals may need a matching update in every consuming contract's doc; check whichever contracts' algorithms are affected.
44+
45+
Do **NOT** require doc updates for pure refactors, test-only changes, bug fixes that restore documented behavior, `Legacy/**` (SOSDacImpl, DacDbi shim), or build/CI changes.
46+
47+

.github/policies/resourceManagement.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,6 @@ configuration:
395395
- JulieLeeMSFT
396396
- brzvlad
397397
- janvorli
398-
- kg
399398
replyTemplate: >-
400399
Tagging subscribers to this area: ${mentionees}
401400

.github/workflows/agentics-maintenance.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ jobs:
369369

370370
- name: Restore activity report logs cache
371371
id: activity_report_logs_cache
372-
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
372+
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
373373
with:
374374
path: ./.cache/gh-aw/activity-report-logs
375375
key: ${{ runner.os }}-activity-report-logs-${{ github.repository }}-${{ github.ref_name }}-${{ github.run_id }}
@@ -393,7 +393,7 @@ jobs:
393393
394394
- name: Save activity report logs cache
395395
if: ${{ always() }}
396-
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
396+
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
397397
with:
398398
path: ./.cache/gh-aw/activity-report-logs
399399
key: ${{ steps.activity_report_logs_cache.outputs.cache-primary-key }}
@@ -474,7 +474,7 @@ jobs:
474474

475475
- name: Restore forecast report logs cache
476476
id: forecast_report_logs_cache
477-
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
477+
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
478478
with:
479479
path: ./.github/aw/logs
480480
key: ${{ runner.os }}-forecast-report-logs-${{ github.repository }}-${{ github.ref_name }}-${{ github.run_id }}
@@ -520,7 +520,7 @@ jobs:
520520
521521
- name: Save forecast report logs cache
522522
if: ${{ always() }}
523-
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
523+
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
524524
with:
525525
path: ./.github/aw/logs
526526
key: ${{ runner.os }}-forecast-report-logs-${{ github.repository }}-${{ github.ref_name }}-${{ github.run_id }}

THIRD-PARTY-NOTICES.TXT

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1664,3 +1664,36 @@ Available at https://github.com/C2SP/wycheproof/blob/2fb7240f471b70bb3aa5cc9b071
16641664
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16651665
See the License for the specific language governing permissions and
16661666
limitations under the License.
1667+
1668+
License notice for Intel Decimal Floating-Point Math Library
1669+
-------------------------------
1670+
1671+
https://www.intel.com/content/www/us/en/developer/articles/tool/intel-decimal-floating-point-math-library.html
1672+
1673+
Copyright (c) 2007-2025, Intel Corp.
1674+
1675+
All rights reserved.
1676+
1677+
Redistribution and use in source and binary forms, with or without modification,
1678+
are permitted provided that the following conditions are met:
1679+
1680+
* Redistributions of source code must retain the above copyright notice, this
1681+
list of conditions and the following disclaimer.
1682+
* Redistributions in binary form must reproduce the above copyright notice,
1683+
this list of conditions and the following disclaimer in the documentation
1684+
and/or other materials provided with the distribution.
1685+
* Neither the name of Intel Corporation nor the names of its contributors
1686+
may be used to endorse or promote products derived from this software
1687+
without specific prior written permission.
1688+
1689+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1690+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1691+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
1692+
DISCLAIMED.
1693+
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
1694+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
1695+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
1696+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
1697+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
1698+
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
1699+
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

docs/design/datacontracts/DebugInfo.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ public readonly struct DebugVarInfo
337337
public uint VarNumber { get; init; }
338338
public DebugVarLocKind Kind { get; init; }
339339
public bool IsByRef { get; init; }
340+
public bool IsFloatingPoint { get; init; }
340341
public uint Register { get; init; }
341342
public uint Register2 { get; init; }
342343
public uint BaseRegister { get; init; }

docs/design/datacontracts/GC.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,6 @@ private HandleData CreateHandleData(TargetPointer handleAddress, byte uBlock, ui
839839
HandleData handleData = default;
840840
handleData.Handle = handleAddress;
841841
handleData.Type = GetInternalHandleType(type);
842-
handleData.JupiterRefCount = 0;
843842
handleData.IsPegged = false;
844843
handleData.StrongReference = IsStrongReference(type);
845844
if (HasSecondary(type))

docs/design/datacontracts/RuntimeTypeSystem.md

Lines changed: 58 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,6 @@ partial interface IRuntimeTypeSystem : IContract
232232
// A no metadata method is also a StoredSigMethodDesc
233233
public virtual bool IsNoMetadataMethod(MethodDescHandle methodDesc, out string methodName);
234234

235-
// A StoredSigMethodDesc is a MethodDesc for which the signature isn't found in metadata.
236-
public virtual bool IsStoredSigMethodDesc(MethodDescHandle methodDesc, out ReadOnlySpan<byte> signature);
237-
238235
// Return true for a MethodDesc that describes a method represented by the System.Reflection.Emit.DynamicMethod class
239236
// A DynamicMethod is also a StoredSigMethodDesc, and a NoMetadataMethod
240237
public virtual bool IsDynamicMethod(MethodDescHandle methodDesc);
@@ -257,6 +254,9 @@ partial interface IRuntimeTypeSystem : IContract
257254
// Corresponds to native MethodDesc::IsAsyncMethod().
258255
public virtual bool IsAsyncMethod(MethodDescHandle methodDesc);
259256

257+
// Return true and the raw signature bytes for a MethodDesc, or false if no signature could be resolved.
258+
public virtual bool TryGetMethodSignature(MethodDescHandle methodDesc, out ReadOnlySpan<byte> signature);
259+
260260
// Return true if a MethodDesc is in a collectible module
261261
public virtual bool IsCollectibleMethod(MethodDescHandle methodDesc);
262262

@@ -1332,6 +1332,10 @@ We depend on the following data descriptors:
13321332
| `StoredSigMethodDesc` | `cSig` | Count of bytes in the metadata signature |
13331333
| `StoredSigMethodDesc` | `ExtendedFlags` | Flags field for the `StoredSigMethodDesc` |
13341334
| `DynamicMethodDesc` | `MethodName` | Pointer to Null-terminated UTF8 string describing the Method desc |
1335+
| `AsyncMethodData` | `Flags` | Async method flags |
1336+
| `AsyncMethodData` | `Signature` | The async variant's signature (see `Signature`) |
1337+
| `Signature` | `SignaturePointer` | Pointer to the raw signature blob |
1338+
| `Signature` | `SignatureLength` | Count of bytes in the raw signature blob |
13351339
| `GCCoverageInfo` | `SavedCode` | Pointer to the GCCover saved code copy, if supported |
13361340

13371341
The following data descriptor types are used only for their sizes when computing the total size of a `MethodDesc` instance.
@@ -1595,6 +1599,50 @@ And the various apis are implemented with the following algorithms
15951599
return 0x06000000 | tokenRange | tokenRemainder;
15961600
}
15971601

1602+
public bool TryGetMethodSignature(MethodDescHandle methodDescHandle, out ReadOnlySpan<byte> signature)
1603+
{
1604+
MethodDesc methodDesc = _methodDescs[methodDescHandle.Address];
1605+
1606+
// Dynamic, EEImpl and Array methods store their signature directly on the MethodDesc.
1607+
MethodClassification classification = (MethodClassification)(methodDesc.Flags & MethodDescFlags.ClassificationMask);
1608+
if (classification is MethodClassification.Dynamic or MethodClassification.EEImpl or MethodClassification.Array)
1609+
{
1610+
signature = // StoredSigMethodDesc.Signature blob for methodDesc
1611+
return true;
1612+
}
1613+
1614+
// Async variant methods carry their signature in the AsyncMethodData.
1615+
if (HasFlag(methodDesc, MethodDescFlags.HasAsyncMethodData))
1616+
{
1617+
AsyncMethodData asyncData = // Read AsyncMethodData for methodDesc
1618+
if (((AsyncMethodFlags)asyncData.Flags).HasFlag(AsyncMethodFlags.IsAsyncVariant))
1619+
{
1620+
signature = // Read asyncData.Signature.SignatureLength bytes from asyncData.Signature.SignaturePointer
1621+
return true;
1622+
}
1623+
}
1624+
1625+
// Otherwise resolve the signature from ECMA metadata using the MethodDef token.
1626+
uint token = GetMethodToken(methodDescHandle);
1627+
if (EcmaMetadataUtils.GetRowId(token) == 0)
1628+
{
1629+
signature = default;
1630+
return false;
1631+
}
1632+
1633+
MetadataReader? mdReader = // Get metadata reader for the method's module, or null if unavailable
1634+
if (mdReader is null)
1635+
{
1636+
signature = default;
1637+
return false;
1638+
}
1639+
1640+
MethodDefinitionHandle methodDefHandle = MetadataTokens.MethodDefinitionHandle((int)EcmaMetadataUtils.GetRowId(token));
1641+
MethodDefinition methodDef = mdReader.GetMethodDefinition(methodDefHandle);
1642+
signature = mdReader.GetBlobBytes(methodDef.Signature);
1643+
return true;
1644+
}
1645+
15981646
public uint GetMethodDescSize(MethodDescHandle methodDescHandle)
15991647
{
16001648
MethodDesc methodDesc = _methodDescs[methodDescHandle.Address];
@@ -1667,30 +1715,6 @@ And the various apis are implemented with the following algorithms
16671715
return true;
16681716
}
16691717

1670-
public bool IsStoredSigMethodDesc(MethodDescHandle methodDescHandle, out ReadOnlySpan<byte> signature)
1671-
{
1672-
MethodDesc methodDesc = _methodDescs[methodDescHandle.Address];
1673-
1674-
switch (methodDesc.Classification)
1675-
{
1676-
case MethodDescClassification.Dynamic:
1677-
case MethodDescClassification.EEImpl:
1678-
case MethodDescClassification.Array:
1679-
break; // These have stored sigs
1680-
1681-
default:
1682-
signature = default;
1683-
return false;
1684-
}
1685-
1686-
TargetPointer Sig = // Read Sig field from StoredSigMethodDesc contract using address methodDescHandle.Address
1687-
uint cSig = // Read cSig field from StoredSigMethodDesc contract using address methodDescHandle.Address
1688-
1689-
TargetPointer methodNamePointer = // Read S field from DynamicMethodDesc contract using address methodDescHandle.Address
1690-
signature = // Read buffer from target memory starting at address Sig, with cSig bytes in it.
1691-
return true;
1692-
}
1693-
16941718
public bool IsDynamicMethod(MethodDescHandle methodDescHandle)
16951719
{
16961720
MethodDesc methodDesc = _methodDescs[methodDescHandle.Address];
@@ -2195,7 +2219,7 @@ The FieldDesc APIs of RuntimeTypeSystem version 1 depend on the following global
21952219

21962220
| Global name | Meaning |
21972221
| --- | --- |
2198-
| `FieldOffsetBigRVA` | Sentinel value of `FieldDesc::DWord2` indicating the field is an RVA static whose offset is too large to encode in the bitfield; the real offset must be read from the field's metadata (`FieldDefinition.GetRelativeVirtualAddress`). |
2222+
| `FieldOffsetBigRVA` | Sentinel value of `FieldDesc`'s offset bitfield (`m_dwOffset`, i.e. `DWord2 & OffsetMask`) indicating the field is an RVA static whose offset is too large to encode in the bitfield; the real offset must be read from the field's metadata (`FieldDefinition.GetRelativeVirtualAddress`). |
21992223
| `FieldOffsetNewEnc` | Sentinel value of `FieldDesc`'s offset bitfield indicating the field was added via Edit-and-Continue and does not yet have backing storage. |
22002224

22012225
The FieldDesc APIs of RuntimeTypeSystem version 1 depend on the following data descriptors:
@@ -2258,13 +2282,17 @@ uint GetFieldDescType(TargetPointer fieldDescPointer)
22582282
uint GetFieldDescOffset(TargetPointer fieldDescPointer, FieldDefinition? fieldDef)
22592283
{
22602284
uint DWord2 = target.Read<uint>(fieldDescPointer + /* FieldDesc::DWord2 offset */);
2261-
if (DWord2 == _target.ReadGlobal<uint>("FieldOffsetBigRVA"))
2285+
// DWord2 packs the 27-bit offset (low bits) with the 5-bit field type (high bits), so the offset
2286+
// must be masked out before comparing against the big-RVA sentinel. The native runtime compares the
2287+
// FieldDesc's m_dwOffset bitfield directly (see FieldDesc::GetOffset in src/coreclr/vm/field.h).
2288+
uint offset = DWord2 & (uint)FieldDescFlags2.OffsetMask;
2289+
if (offset == _target.ReadGlobal<uint>("FieldOffsetBigRVA"))
22622290
{
22632291
if (fieldDef is null)
22642292
throw new ArgumentNullException(nameof(fieldDef), "Field definition is required for big RVA fields");
22652293
return (uint)fieldDef.Value.GetRelativeVirtualAddress();
22662294
}
2267-
return DWord2 & (uint)FieldDescFlags2.OffsetMask;
2295+
return offset;
22682296
}
22692297

22702298
TargetPointer GetFieldDescStaticAddress(TargetPointer fieldDescPointer, bool unboxValueTypes = true)

docs/design/datacontracts/Signature.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ Data descriptors used:
3131
| Data Descriptor Name | Field | Meaning |
3232
| --- | --- | --- |
3333
| `VASigCookie` | `SizeOfArgs` | Total size in bytes of the pushed argument list. Used on x86 to locate the args base. |
34-
| `VASigCookie` | `SignaturePointer` | Target address of the raw vararg signature blob. |
35-
| `VASigCookie` | `SignatureLength` | Length in bytes of the raw vararg signature blob. |
34+
| `VASigCookie` | `Signature` | The raw vararg signature (see `Signature`). |
35+
| `Signature` | `SignaturePointer` | Target address of the raw signature blob. |
36+
| `Signature` | `SignatureLength` | Length in bytes of the raw signature blob. |
3637

3738
Global variables used:
3839
| Global Name | Type | Purpose |
@@ -104,7 +105,7 @@ void ISignature.GetVarArgSignature(TargetPointer vaSigCookieAddr, out TargetPoin
104105
TargetPointer vaSigCookie = _target.ReadPointer(vaSigCookieAddr);
105106
VASigCookie cookie = _target.ProcessedData.GetOrAdd<VASigCookie>(vaSigCookie);
106107

107-
signatureAddress = cookie.SignaturePointer;
108-
signatureLength = cookie.SignatureLength;
108+
signatureAddress = cookie.Signature.SignaturePointer;
109+
signatureLength = cookie.Signature.SignatureLength;
109110
}
110111
```

docs/design/datacontracts/StackWalk.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ IEnumerable<IStackDataFrameHandle> CreateStackWalk(
4545
bool isFirst = true);
4646

4747
// Gets the thread context at the given stack dataframe.
48-
// `flags` lets the caller request platform-specific shaping of the returned context.
4948
byte[] GetRawContext(
5049
IStackDataFrameHandle stackDataFrameHandle,
5150
StackwalkFlag flags = StackwalkFlag.Default);
@@ -54,7 +53,6 @@ byte[] GetRawContext(
5453
enum StackwalkFlag
5554
{
5655
Default = 0,
57-
X86ESPIgnoresCalleePoppedArgs = 0x1,
5856
}
5957

6058
// Gets the Frame address at the given stack dataframe. Returns TargetPointer.Null if the current dataframe does not have a valid Frame.
@@ -491,10 +489,6 @@ byte[] GetRawContext(
491489
StackwalkFlag flags = StackwalkFlag.Default);
492490
```
493491

494-
##### `StackwalkFlag.X86ESPIgnoresCalleePoppedArgs`
495-
See [comment](https://github.com/dotnet/runtime/blob/7f8276da27a20943339702df0abdfc02e21110a4/src/coreclr/debug/daccess/dacdbiimplstackwalk.cpp#L1016-L1063)
496-
497-
498492
`GetFrameAddress` gets the address of the current capital "F" Frame. This is only valid if the `IStackDataFrameHandle` is at a point where the context is based on a capital "F" Frame. For example, it is not valid when when the current context was created by using the stack frame unwinder.
499493
If the Frame is not valid, returns `TargetPointer.Null`.
500494

0 commit comments

Comments
 (0)