step | gzipped size (K) |
---|---|
asm.js | 55.3 |
+ asm2wasm | 50.0 |
+ wasm opts | 45.2 |
- js opts | 44.1 |
wasm-only | 43.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(module | |
(type $0 (func (result i32))) | |
(type $1 (func (result i64))) | |
(memory $0 0) | |
(export "f32.informally_known_as_plain_snan" (func $4)) | |
(export "f32.all_ones_nan" (func $5)) | |
(export "f32.nan" (func $0)) | |
(export "f32.positive_nan" (func $1)) | |
(export "f32.plain_nan" (func $3)) | |
(export "f32.negative_nan" (func $2)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(module | |
(type $0 (func (result i32))) | |
(type $1 (func (result i64))) | |
(memory $0 0) | |
(export "f32.nan" (func $0)) | |
(export "f32.positive_nan" (func $1)) | |
(export "f32.negative_nan" (func $2)) | |
(export "f32.plain_nan" (func $3)) | |
(export "f32.informally_known_as_plain_snan" (func $4)) | |
(export "f32.all_ones_nan" (func $5)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function truncate(x) { | |
x = i64(x); // declare param as i64 | |
return i64_trunc(x) | 0; // truncate to low 32 bits | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int doubler(int x) { | |
return 2 * x; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In file included from /usr/include/c++/5/bits/char_traits.h:39:0, | |
from /usr/include/c++/5/ios:40, | |
from /usr/include/c++/5/istream:38, | |
from /home/alon/Dev/binaryen/src/wasm-binary.h:25, | |
from /home/alon/Dev/binaryen/src/wasm/wasm-binary.cpp:17: | |
/usr/include/c++/5/bits/stl_algobase.h: In instantiation of ‘_BI2 std::__copy_move_backward_a(_BI1, _BI1, _BI2) [with bool _IsMove = false; _BI1 = wasm::Expression**; _BI2 = ArenaVector<wasm::Expression*>::Iterator]’: | |
/usr/include/c++/5/bits/stl_algobase.h:614:5: required from ‘_BI2 std::__copy_move_backward_a2(_BI1, _BI1, _BI2) [with bool _IsMove = false; _BI1 = __gnu_cxx::__normal_iterator<wasm::Expression**, std::vector<wasm::Expression*> >; _BI2 = ArenaVector<wasm::Expression*>::Iterator]’ | |
/usr/include/c++/5/bits/stl_algobase.h:649:8: required from ‘_BI2 std::copy_backward(_BI1, _BI1, _BI2) [with _BI1 = __gnu_cxx::__normal_iterator<wasm::Expression**, std::vector<wasm::Expression*> >; _BI2 = Aren |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
template <typename SubType> | |
struct ArenaVectorBase { | |
size_t allocatedElements = 0; | |
void allocate(size_t size) { | |
abort(); // must be implemented in children | |
} | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function _arrayToHeap(typedArray){ | |
var numBytes = typedArray.length * typedArray.BYTES_PER_ELEMENT; | |
var ptr = Module._malloc(numBytes); | |
var heapBytes = Module.HEAPU8.subarray(ptr, ptr + numBytes); | |
heapBytes.set(typedArray); | |
return heapBytes; | |
} |