Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/design/datacontracts/GCInfo.md
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,9 @@ For encodings without interruptible ranges (`HAS_INTERRUPTIBLE_RANGES` is false,

**Slot filtering**: Before reporting any slot, the algorithm checks:
- **Scratch registers**: Only reported for the active/leaf frame (`ActiveStackFrame` flag).
Valid Wasm GC info never contains register slots, so the WebAssembly platform
decoder's scratch-register predicate always returns false and asserts in debug
builds if called, mirroring the native unsupported-platform fallback.
- **Scratch stack slots**: Only reported for the active/leaf frame (slots in the outgoing/scratch area).
- **FP-based-only mode** (`ReportFPBasedSlotsOnly`): Only frame-register-relative stack slots are reported; all register slots and non-frame-relative stack slots are skipped.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Diagnostics;

namespace Microsoft.Diagnostics.DataContractReader.Contracts.GCInfoHelpers;

// Mirrors Wasm32GcInfoEncoding in src/coreclr/inc/gcinfotypes.h.
Expand Down Expand Up @@ -37,5 +39,13 @@ internal sealed class WasmGCInfoTraits : IGCInfoTraits
public static int NUM_INTERRUPTIBLE_RANGES_ENCBASE => 1;
public static bool HAS_FIXED_STACK_PARAMETER_SCRATCH_AREA => false;
public static bool HAS_INTERRUPTIBLE_RANGES => false;
public static bool IsScratchRegister(uint regNum) => false;

// Valid Wasm GC info has no register slots; RyuJIT never emits one. Mirror the
// native fallback (gcinfodecoder.cpp PORTABILITY_ASSERT): flag the unexpected
// call in debug builds and otherwise return false, like other unimplemented platforms.
public static bool IsScratchRegister(uint regNum)
{
Debug.Fail("Wasm GC info must not contain register slots.");
return false;
}
}
Loading