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

Enable calls to JS. Update some tests. #61

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Conversation

eholk
Copy link
Collaborator

@eholk eholk commented Mar 15, 2017

This PR enables a few more tests that were previously xfailed or disabled during one of my recent changes.

The most significant change is that we now have a way of importing arbitrary functions from the host. See tinycore.rs for an example of how this works. Basically, you create an extern block with #[link(name)]. Then mir2wasm will emit imports for each of the functions in the block from the module name.

Using this new capability, rustrt.js now provides a panic function, which is called by Rust when code panics. Right now this just throws a Javascript error, but we could improve this significantly.

Unfortunately, the binaryen interpreter doesn't give us a way to import Javascript (as far as I know), so we can't call into rustrt.js. Because of this, I've disabled running in binaryen in the tests. This means from now on our only supported mode of execution is in a proper JS VM.

This change also includes some miscellaneous cleanup and refactoring, although more is still needed. Finally, I pointed the binaryen submodule at my own fork because I need a small fix to run on one of my Linux machines, but we can't merge this into binaryen proper because of ASAN failures.

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

Successfully merging this pull request may close these issues.

1 participant