-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Interpreter P/Invoke support #115393
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
Interpreter P/Invoke support #115393
Conversation
@AaronRobinsonMSFT all the things you've commented on are from my WIP PR that I am still cleaning up, Katelyn has built her stuff on top of that. |
The working directory change is controversial, so I'm open to changing it around and making InterpreterTester be the one that builds the dll instead. IMO Interpreter.dll should be built alongside pinvoke.dll since that's the actual dependency, and we should be running it where-it-was-built instead of in InterpreterTester's artifacts dir. IIRC msbuild has never been able to express 'when foo.csproj is referenced by bar.csproj, copy these satellite files along with foo.dll'. I like being able to directly run Interpreter.dll with corerun in the debugger and have it work correctly without having to know to set a special cwd. But I can see the argument for doing it the other way. This will fail in a less confusing way once we have EH, at least - at that point you would see the dll not found error and be able to figure out what's wrong pretty quickly. |
@AaronRobinsonMSFT do you have any comments? I'd like to get this change in soon. |
Tagging subscribers to this area: @BrzVlad, @janvorli, @kg |
Everything works now as long as the prestub for the pinvoke doesn't throw (due to a missing entry point). If the pinvoke throws, our managed catch block runs (in the interpreter, I think) and then the prestub's catch block runs and asserts because there's no exception. It seems like we're probably missing an InlinedCallFrame for the pinvoke like jan mentioned in a chat, which suggests we need a dedicated call opcode for pinvokes even though a regular call mostly works. |
Marshaling wrappers work so enable test for them Separate call opcode for unmarshaled pinvokes Cleanup Do inlined pinvoke for CALL_PINVOKE opcode Update pinvoke test for new behavior
…allers in NDirectImportWorker
…lpers are compatible with arm32 thumb Checkpoint pinvoke changes
Encapsulate inlined callframe creation
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.
LGTM, thank you!
/ba-g the Android build timeouts in all recent PRs. |
Uh oh!
There was an error while loading. Please reload this page.