Skip to content

Commit 3cf533a

Browse files
author
Max Charlamb
committed
add GCCover contract docs
1 parent 9625d22 commit 3cf533a

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

docs/design/datacontracts/GCCover.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Contract GCCover
2+
3+
This contract encapsulates support for [GCCover](../coreclr/jit/investigate-stress.md) (GC stress testing) in the runtime.
4+
5+
## APIs of contract
6+
7+
```csharp
8+
public virtual TargetPointer? GetGCCoverageInfo(NativeCodeVersionHandle codeVersionHandle);
9+
```
10+
11+
## Version 1
12+
13+
Data descriptors used:
14+
| Data Descriptor Name | Field | Meaning |
15+
| --- | --- | --- |
16+
| NativeCodeVersionNode | GCCoverageInfo | pointer to GC coverage info |
17+
18+
Contracts used:
19+
| Contract Name |
20+
| --- |
21+
| CodeVersions |
22+
| RuntimeTypeSystem |
23+
24+
### Getting GCCoverageInfo for a NativeCodeVersion
25+
```csharp
26+
public virtual TargetPointer? GetGCCoverageInfo(NativeCodeVersionHandle codeVersionHandle);
27+
```
28+
1. If `codeVersionHandle` is synthetic, attempt to read the GCCoverageInfo off of the MethodDesc using the RuntimeTypeSystem contract.
29+
2. If `codeVersionHandle` is explicit, fetch the `NativeCodeVersionNode` and attempt to read the `GCCoverageInfo` pointer. This value will only exist on targets with `HAVE_GCCOVER` enabled. If this value exists return it. Otherwise return null.

docs/design/datacontracts/RuntimeTypeSystem.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ partial interface IRuntimeTypeSystem : IContract
159159
// Get an instruction pointer that can be called to cause the MethodDesc to be executed
160160
public virtual TargetCodePointer GetNativeCode(MethodDescHandle methodDesc);
161161

162+
// Gets the GCCoverageInfo pointer if available.
163+
// If not enabled in the target process, returns null.
164+
public virtual TargetPointer? GetGCCoverageInfo(MethodDescHandle methodDesc);
162165
}
163166
```
164167

0 commit comments

Comments
 (0)