Skip to content
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

Support target methods without body #207

Closed

Conversation

mcpiroman
Copy link

This allows to patch invocations to extern P/Invoke methods, e.g. if a game uses native plugin.

@pardeike
Copy link
Owner

So this basically returns an empty list of instructions for an external method? Sounds better than just throwing. I still wonder if one would want to fake a default return value and a Ret. Not sure, maybe a clean empty list is better.

@mcpiroman
Copy link
Author

I guess empty list is better in that faking things is more likely to cause trouble and confuse people.

So since in such cases original instructions list is empty, I've made this transpiler's argument optional (which can also be useful when original body is not required).

What I didn't mention is it doesn't support prefixes or postfixes (as there is no 'original' function to call). This would be theoretically possible but would require to copy the signature of a original method, which to my knowledge is quite hard to do (parameter attributes in particular).

@LunarWhisper
Copy link

Is there an approximate implementation timeline?

@pardeike
Copy link
Owner

I still need to quality check this pull request and find out why it makes the tests fail. So for now there is no estimate

@pardeike
Copy link
Owner

This PR touches a very sensitive part of Harmony and probably breaks parallel compatibility. It needs a lot more work and verification to get accepted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants