Do not track RuntimeDeterminedMethod dependencies from canonical methods - #5040
Conversation
The concept of RuntimeDeterminedMethodNode was added when I was trying to support a mode where generic dictionaries could have "holes" (null entries for things that are not used for the particular instantiation). This turned out to be not feasible and we now have dependency analysis infra to patch those holes up anyway. We don't need to track dependencies of canonical code on such granularity. The only exception to that were generic methods, but I'm fixing that by having the method generic dictionary (which is tracked as a runtime determined dependency of the canonical body) to also depend on the ShadowConcreteMethod (to make sure we can actually fill it). I'm doing this because the devirtualization in RyuJIT causes `getCallInfo` to be called with bogus `pResolvedToken` and we can no longer use that to get a `RuntimeDeterminedMethod` anyway.
|
@A-And this fixes the first issue you were seeing with compiling the plain |
|
@davidwrighton PTAL This causes an unfortunate 2 kB size on disk regression around Seems like the fix would be to investigate why RyuJIT doesn't inline the |
|
Let's close for now. Turns out this is actually more involved. |
|
Ok, I now have a complete fix. This uncovered a problem where the infrastructure that tracks dictionary dependencies was unaware of the methods injected into delegate types. We had a rule that said: whenever someone injects a virtual method on a type, the type system context needs to know. The rule needs an addition that says: whenever someone injects a method that contributes to a generic dictionary, type system needs to know too. |
The concept of RuntimeDeterminedMethodNode was added when I was trying to support a mode where generic dictionaries could have "holes" (null entries for things that are not used for the particular instantiation). This turned out to be not feasible and we now have dependency analysis infra to patch those holes up anyway. We don't need to track dependencies of canonical code on such granularity.
The only exception to that were generic methods, but I'm fixing that by having the method generic dictionary (which is tracked as a runtime determined dependency of the canonical body) to also depend on the ShadowConcreteMethod (to make sure we can actually fill it).
I'm doing this because the devirtualization in RyuJIT causes
getCallInfoto be called with boguspResolvedTokenand we can no longer use that to get aRuntimeDeterminedMethodanyway.