-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add rejit support to GetMethodDescData
- Loading branch information
Max Charlamb
committed
Nov 22, 2024
1 parent
09b30a4
commit d4de7c9
Showing
18 changed files
with
1,007 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...agnostics.DataContractReader.Abstractions/Contracts/Extensions/ICodeVersionsExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace Microsoft.Diagnostics.DataContractReader.Contracts.Extensions; | ||
|
||
internal static class ICodeVersionsExtensions | ||
{ | ||
internal static NativeCodeVersionHandle GetActiveNativeCodeVersion(this ICodeVersions cv, TargetPointer methodDesc) | ||
{ | ||
ILCodeVersionHandle iLCodeVersionHandle = cv.GetActiveILCodeVersion(methodDesc); | ||
return cv.GetActiveNativeCodeVersionForILCodeVersion(methodDesc, iLCodeVersionHandle); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...soft.Diagnostics.DataContractReader.Abstractions/Contracts/Extensions/IReJITExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Collections.Generic; | ||
|
||
namespace Microsoft.Diagnostics.DataContractReader.Contracts.Extensions; | ||
|
||
internal static class IReJITExtensions | ||
{ | ||
public static IEnumerable<TargetNUInt> GetRejitIds(this IReJIT rejit, Target target, TargetPointer methodDesc) | ||
{ | ||
ICodeVersions cv = target.Contracts.CodeVersions; | ||
|
||
IEnumerable<ILCodeVersionHandle> ilCodeVersions = cv.GetILCodeVersions(methodDesc); | ||
|
||
foreach (ILCodeVersionHandle ilCodeVersionHandle in ilCodeVersions) | ||
{ | ||
if (rejit.GetRejitState(ilCodeVersionHandle) == RejitState.Active) | ||
{ | ||
yield return rejit.GetRejitId(ilCodeVersionHandle); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.