-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[cdac] Basic ISOSDacInterface::GetMethodDescData #106413
Conversation
Tagging subscribers to this area: @tommcdon |
ebdeb59
to
2383fd2
Compare
79bbf28
to
ebb4a67
Compare
e9fe709
to
aac3faf
Compare
@@ -38,6 +38,9 @@ TargetPointer GetLoaderAllocator(ModuleHandle handle); | |||
TargetPointer GetThunkHeap(ModuleHandle handle); | |||
TargetPointer GetILBase(ModuleHandle handle); | |||
ModuleLookupTables GetLookupTables(ModuleHandle handle); | |||
TargetPointer GetModuleLookupMapElement(TargetPointer table, uint rid, out TargetNUInt flags); | |||
bool IsCollectibleLoaderAllocator(ModuleHandle handle); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'll want to have a LoaderAllocator contract. There is a bunch of ... stuff... on there, and I feel like we'll likely need something there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this particular API (checking if the module is collectible), it seems like it should cut out the LoaderAllocator
concept? Since once you're at the Module
(instead of a MethodDesc), the module's IsCollectible should match the module's loader allocator's IsCollectible.
src/native/managed/cdacreader/src/Contracts/RuntimeTypeSystem_1.NonValidated.cs
Outdated
Show resolved
Hide resolved
public virtual bool IsVersionable(MethodDescHandle methodDesc); | ||
|
||
// Return a pointer to the IL versioning state of the MethodDesc | ||
public virtual TargetPointer GetMethodDescVersioningState(MethodDescHandle methodDesc); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're going to need the ability to walk the list of IL versions, and Native code versions, and query various details about these things. This doesn't feel like the right api. Could you get it onto the CodeVersions contract?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just extracts the address from the MethodDescCodeData. All the logic for working with the versioning state is in CodeVersions.
It's not that different from
TargetPointer modAddr = RuntimeTypeSystem.GetModule(TypeHandle th);
ModuleHandle mod = Loader.GetModuleHandle(modAddr);
RTS gives you a pointer and Loader turns it into a handle that you can use for queries. Similarly RTS will give a pointer to the versioning state and CodeVersions will consume it in some manner.
Currently the versioning state is consumed entirely internally in the CodeVersions contract, but in the future it could be exposed via a handle or through some data API (see GetSpecificNativeCodeVersion
and IsActiveNativeCodeVersion
implementations)
@@ -38,6 +38,9 @@ TargetPointer GetLoaderAllocator(ModuleHandle handle); | |||
TargetPointer GetThunkHeap(ModuleHandle handle); | |||
TargetPointer GetILBase(ModuleHandle handle); | |||
ModuleLookupTables GetLookupTables(ModuleHandle handle); | |||
TargetPointer GetModuleLookupMapElement(TargetPointer table, uint rid, out TargetNUInt flags); | |||
bool IsCollectibleLoaderAllocator(ModuleHandle handle); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this particular API (checking if the module is collectible), it seems like it should cut out the LoaderAllocator
concept? Since once you're at the Module
(instead of a MethodDesc), the module's IsCollectible should match the module's loader allocator's IsCollectible.
Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it. |
Currently only works on non-generic non-R2R methods (and probably only ones that are still Tier0)
TODO:
LoaderAllocator
contractLoaderModule
members from MethodDescChunk and FnPtrTypeDesccontributes to #99302