You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 1, 2020. It is now read-only.
On Project N, resolving a method on an interface (ldvirtftn), and calling a method on an interface (callvirt) in shared generic contexts (where the target depends on the context) is implemented by embedding a pointer to the virtual dispatch cell in the generic dictionary.
The sequence to call an interface method consists of:
Loading the this pointer in Arg0 register
Loading the generic context into Result register
Loading the dictionary slot with a pointer to the dispatch cell into Result register
call [Result]
We'll probably want a new R2R helper that does the call. The helper would have a custom calling convention that expects the generic context in the Result register and follows the above steps to resolve the target of the call. The existing R2R helper doesn't have a this pointer and is expected to return the address of the entrypoint to call. The lack of this pointer forces the helper to returning a dispatch stub (pointer to which we need to embed in the dictionary), but this will likely pose a problem once we start bringing up the type loader.
The sequence to load an address to an interface method consists of:
Loading the this pointer into Arg0
Loading the generic context into Arg1 register
Loading the dictionary slot with a pointer to the dispatch cell into Arg1 register
Calling RhpResolveInterfaceMethod
Again, we'll want a new R2R helper that does the resolution. The helper would take two arguments (context in Arg0, and this in Arg1) and would return the resolved address in Result. The existing R2R helper implemented in #2339 doesn't have a this parameter and forces the helper implementation to return a dispatch stub instead of the actual address of the resolved entrypoint.
On Project N, resolving a method on an interface (
ldvirtftn), and calling a method on an interface (callvirt) in shared generic contexts (where the target depends on the context) is implemented by embedding a pointer to the virtual dispatch cell in the generic dictionary.The sequence to call an interface method consists of:
thispointer in Arg0 registercall [Result]We'll probably want a new R2R helper that does the call. The helper would have a custom calling convention that expects the generic context in the Result register and follows the above steps to resolve the target of the call. The existing R2R helper doesn't have a
thispointer and is expected to return the address of the entrypoint to call. The lack ofthispointer forces the helper to returning a dispatch stub (pointer to which we need to embed in the dictionary), but this will likely pose a problem once we start bringing up the type loader.The sequence to load an address to an interface method consists of:
thispointer into Arg0RhpResolveInterfaceMethodAgain, we'll want a new R2R helper that does the resolution. The helper would take two arguments (context in Arg0, and
thisin Arg1) and would return the resolved address inResult. The existing R2R helper implemented in #2339 doesn't have athisparameter and forces the helper implementation to return a dispatch stub instead of the actual address of the resolved entrypoint.