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

Add prototype implementation for WebAssembly #60

Closed
wants to merge 7 commits into from
Closed

Add prototype implementation for WebAssembly #60

wants to merge 7 commits into from

Conversation

MikeHolman
Copy link
Contributor

To better facilitate collaboration on our WebAssembly implementation, I'd like to merge our prototype into master. Note that this is still not stable or complete and current API is for testing purposes only. It will change, frequently. Use is only available through WScript.LoadWasmFile in ch.exe, which uses the JsRunWasmScriptForTestOnly JSRT API.

MikeHolman and others added 6 commits January 5, 2016 16:32
- fixed module SectEnd (DeclEnd), added function call decoding, and block control flow
- fixed INT32 constant decoding bug where only the first byte was being decoded
- enable If_Else ASTNode
- Nop handling
- fixed a bug in WasmBytecodeGenerator: when emitting Calls, should first test whether we've looked at all params before we try to read (and test for wnLIMIT)
- fixed missing handling of non-void return implicit blocks. now the binary decoder is at parity with sexpr at least in terms of the basic.wast example.
- This is one place where binary decoder and sexpr parser diverges. Sexpr parser needs to ReadFromCall() to consume the final RPAREN and discard it whereas a follow-up invocation of ReadFromCall() in the binary decoder will cause it to drop the subsequent byte.
- fix for function call argument register allocation management
- starting to implement loop and block labels and br
Getting function calls and loops working in the decoder and misc fixes
@msftclas
Copy link

Hi @MikeHolman, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!


It looks like you're a Microsoft contributor (Michael Holman). If you're full-time, we DON'T require a Contribution License Agreement. If you are a vendor, please DO sign the electronic Contribution License Agreement. It will take 2 minutes and there's no faxing! https://cla.microsoft.com.

TTYL, MSBOT;

@MikeHolman
Copy link
Contributor Author

@abchatra @LouisLaf @nmostafa, can you take a look?

//
// Read the entire content as a binary block.
//
fread((void*)contents, sizeof(char), lengthBytes, file);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should check the return value here for malformed files.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed in my new PR

@MikeHolman
Copy link
Contributor Author

Discussed offline with @EdMaurer. We'll keep wasm in a separate branch until feature is stable and then merge back to master. I'll send out another PR against a Microsoft/wasm branch shortly.

@MikeHolman MikeHolman closed this Jan 13, 2016
@dilijev
Copy link
Contributor

dilijev commented Jan 13, 2016

Moved to #63

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.

None yet

4 participants