Bug 157313 - Implement the Wasm object in WebAssembly
Summary: Implement the Wasm object in WebAssembly
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-03 09:47 PDT by Xan Lopez
Modified: 2017-03-13 09:47 PDT (History)
3 users (show)

See Also:


Attachments
Wasm object (11.67 KB, patch)
2016-05-25 07:23 PDT, Xan Lopez
no flags Details | Formatted Diff | Diff
First WIP patch for WASM Module Parser (16.88 KB, patch)
2016-05-25 07:27 PDT, Xan Lopez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Xan Lopez 2016-05-03 09:47:03 PDT
I have a WIP patch that implements the Wasm global object with its instiantiateModule method, using the existing parsing functions available. It's enough to get the main WebAssembly demo () loading, but I get some errors during the process. I'm guessing either format changes or missing functionality in our implementation. I'll upload what I have shortly to see if the general approach seems sensible.
Comment 1 Xan Lopez 2016-05-03 09:47:42 PDT
Sorry, the demo is: https://webassembly.github.io/demo/
Comment 2 Xan Lopez 2016-05-25 07:23:31 PDT
Created attachment 279768 [details]
Wasm object

First WIP patch for comments. This just adds a Wasm object with a instantiateModule method, per the new version of the spec.
Comment 3 Xan Lopez 2016-05-25 07:27:03 PDT
Created attachment 279769 [details]
First WIP patch for WASM Module Parser

First WIP patch of the module parser.

The spec has changed quite a bit since the last updates to our code. Relevant comments:

- I have modified the wasm-module.js test file from Gecko, since I could not find a polyfill-like prototype that could output the latest version of the wasm binary format (?).

- Most of the changes are easily done continuining the previous structure of the code. Most relevant thing is that I'm doing some backtracking in case I fail to read the section that should come next. This could be done without backtracking at all, but it seemed simple enough to do it like this for a first test.

Uploading just the first reworked section parsing for comments, but all the others could be done in a similar way.
Comment 4 Xan Lopez 2016-05-25 07:33:29 PDT
Another bit:

- Right now all errors are reported as SyntaxError, but it would be nicer to be more nuanced about it. Gecko does that and it's probably pretty helpful for programmers when debugging their code.
Comment 5 JF Bastien 2017-03-13 09:47:24 PDT
This is now obsolete.