wasm-bindgen/crates
Alex Crichton 49d835a7bc Switch from heap/stack to just a heap
This commit switches strategies for storing `JsValue` from a heap/stack
to just one heap. This mirrors the new strategy for `JsValue` storage
in #1002 and should make multiplexing those strategies at
`wasm-bindgen`-time much easier.

Instead of having one array which acts as a stack for borrowed values
and one array for a heap of borrowed values, only one JS array is used
for storage of JS values now. This makes `getObject` far simpler by
simply being an array access, but it means that cloning an object now
reserves a new slot instead of reference counting it. If the old
reference counting behavior is needed it's thought that `Rc<JsValue>`
can be used in Rust.

The new "heap" has an initial stack pointer which grows downwards, and a
heap which grows upwards. The heap is a singly-linked-list which is
allocated/deallocated from. The stack grows downwards to zero and
presumably starts generating errors once it underflows. An initial stack
size of 32 is chosen as that should encompass all use cases today, but
we can eventually probably add configuration for this!

Note that the heap is initialized to all `null` for the stack and then
the initial JS values (`undefined`, `null`, `true`, `false`) are pushed
onto the heap in reserved locations.
2018-11-30 12:07:16 -08:00
..
backend Move closure shims into the descriptor 2018-11-29 12:42:44 -08:00
cli Merge pull request #1063 from alexcrichton/wasm2es6js-start 2018-11-29 17:30:24 -06:00
cli-support Switch from heap/stack to just a heap 2018-11-30 12:07:16 -08:00
futures Run rustfmt over everything 2018-11-27 12:07:59 -08:00
gc Run rustfmt over everything 2018-11-27 12:07:59 -08:00
js-sys Run rustfmt over everything 2018-11-27 12:07:59 -08:00
macro Add a #[wasm_bindgen(start)] attribute 2018-11-28 22:11:15 -08:00
macro-support Add a #[wasm_bindgen(start)] attribute 2018-11-28 22:11:15 -08:00
shared Add a #[wasm_bindgen(start)] attribute 2018-11-28 22:11:15 -08:00
test Bump to 0.2.28 2018-11-12 09:28:01 -08:00
test-macro Consistently use extern "C" 2018-11-27 12:27:00 -08:00
threads-xform Run rustfmt over everything 2018-11-27 12:07:59 -08:00
typescript Run rustfmt over everything 2018-11-27 12:07:59 -08:00
wasm-interpreter Move closure shims into the descriptor 2018-11-29 12:42:44 -08:00
web-sys Consistently use extern "C" 2018-11-27 12:27:00 -08:00
webidl Remove an unused crate from wasm-bindgen-webidl 2018-11-29 12:22:54 -08:00
webidl-tests Consistently use extern "C" 2018-11-27 12:27:00 -08:00