-
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
[mono][interp] Fix unboxing during CALLI #59747
Conversation
Tagging subscribers to this area: @BrzVlad Issue DetailsOn interp we were storing function pointers as a simple InterpMethod. The problem is that, when loading an InterpMethod with a ldvirtftn opcode, the resulting method might need to have its this pointer unboxed, so this information needs to be embedded into the function pointer. We achieve this by passing function pointers in the interpreter via an InterpFtnDesc, which contains the need_unbox information. Each InterpMethod caches the function descriptors for both unboxing scenarios. In order to interop with llvmonly we must use a MonoFtnDesc as a function pointer so this must point to point to an InterpFtnDesc in order to resolve normal interp calls. Contributes to #54374
|
10cf370
to
61a28cb
Compare
61a28cb
to
da1f8eb
Compare
Some observations about this change:
|
So do you want to keep working on it, or take it as-is and do follow-up PRs?
Yea that would work too. we could also add more mint opcodes - |
da1f8eb
to
dd0aa15
Compare
0e9aa2e
to
e5ce21b
Compare
On interp we were storing function pointers as a simple InterpMethod. The problem is that, when loading an InterpMethod with a ldvirtftn opcode, the resulting method might need to have its this pointer unboxed, so this information needs to be embedded into the function pointer. We achieve this by tagging the InterpMethod whether we need to perform unboxing as part of calling it.
e5ce21b
to
27429d7
Compare
On interp we were storing function pointers as a simple InterpMethod. The problem is that, when loading an InterpMethod with a ldvirtftn opcode, the resulting method might need to have its this pointer unboxed, so this information needs to be embedded into the function pointer. We achieve this by passing function pointers in the interpreter via an InterpFtnDesc, which contains the need_unbox information. Each InterpMethod caches the function descriptors for both unboxing scenarios.
In order to interop with llvmonly we must use a MonoFtnDesc as a function pointer so this must point to point to an InterpFtnDesc in order to resolve normal interp calls.
Contributes to #54374