wasm-bindgen/crates
Alex Crichton cdbb31f3a9 Start removal of vector special-casing
This commit starts wasm-bindgen down a path of removing the special
casing it currently has around vectors, slices, and strings. This has
long been a thorn in wasm-bindgen's side as it doesn't handle other
kinds of vectors and otherwise is very inflexible with future additions.
Additionally it leads to a lot of duplicated-ish code throughout various
portions of codegen.

The fundamental reason for this was that two arguments were required to
be passed back to wasm, and I couldn't figure out a way to shove both
those arguments into a function argument. The new strategy here is that
there is one global stack well known to both JS and Rust which arguments
*may* also be transferred between.

By default all ABI arguments pass as literal function arguments, but if
two or more arguments need to be passed then the extra ones are all
passed through this global stack. The stack is effectively temporary
scratch space when crossing the JS/Rust boundary (both ways). No long
term storage is intended here.

The `simple` test is passing as a result of this commit, using strings
internally. The `Vector` type in the AST has been removed (yay!) and the
bulk of the implementation of slices and vectors now resides in the
`wasm-bindgen` crate itself, defining how to pass all these arguments
around. The JS generator, however, still needs to know about all the
sorts of vectors so it can generate appropriate code for JS.

Future commits will continue cleanup and get the rest of the tests
working.
2018-03-31 07:57:47 -07:00
..
backend Start removal of vector special-casing 2018-03-31 07:57:47 -07:00
cli Rename directories to remove "wasm-bindgen-" prefix in sub-crates 2018-03-29 08:28:25 -07:00
cli-support Start removal of vector special-casing 2018-03-31 07:57:47 -07:00
macro Remove executable bits 2018-03-29 14:50:40 -07:00
shared Start removal of vector special-casing 2018-03-31 07:57:47 -07:00
test-support Fix an unused mut warning 2018-03-31 02:35:09 -07:00