Fixes #470
This commit increases size:
out/release/gen/bundle/main.js 7.3M -> 7.9M
out/release/gen/bundle/main.js.map 11M -> 12M
out/release/gen/snapshot_deno.bin 34M -> 37M
out/release/deno 49M -> 53M
Note the amount in the JS code added is quite small:
4.0K node_modules/text-encoding/index.js
4.0K node_modules/@types/text-encoding/index.d.ts
4.0K js/text_encoding.ts
Unclear to me what is causing the jump in snapshot size.
Switches to using asm incbin to embed the V8 snapshot instead of
outputing C code and then compiling it.
Compile time for from_snapshot.o goes from 44s to 1s.
- Add build scripts for Rust flatbuffers.
- Rewrites some reply.cc methods in Rust.
- Changes some struct elements to table in msg.fbs (rust flatbuffers
lacks support currently)
- Renames handlers_test to test_rs.
- This reorg is needed to make progress on the code cache handler.
* send()/recv() now operate on TypedArrays rather than ArrayBuffers.
* Remove a copy (through ArrayBuffer.slice()) from the send path.
* Remove a copy (through v8::ArrayBuffer::New()) from the return path.
* After moving a buffer from JS to native, the ArrayBuffer object and
it's views are made inaccessible ('neutered').
* `struct deno_buf` now holds two [ptr, length] tuples, one for the actual
memory allocation, and one for the logical data contained therein.
This is necessary because flatbuffers fills it's buffer bottom-up, so
the serialized blob doesn't start at beginning of the buffer, but
somewhere in the middle.
Move rust.gni and deno.gni into build_extra/
Removes rust_library which was only an action. This instead defines
rust_component, which is an action plus a gn "component" target
to expose the resulting object file. This simplifies link code in
rust.gni.
Support rust modules that can be linked into C++.