-
Notifications
You must be signed in to change notification settings - Fork 8
/
wasm-on-wasm.sh
executable file
·44 lines (33 loc) · 1.04 KB
/
wasm-on-wasm.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#! /bin/sh
set -e
#EXTRA_CMAKE_OPTIONS="-DTOYWASM_USE_JUMP_CACHE=ON -DTOYWASM_USE_JUMP_CACHE2=OFF"
#EXTRA_CMAKE_OPTIONS="-DTOYWASM_ENABLE_WASM_TAILCALL=ON" USE_TAILCALL=ON
export EXTRA_CMAKE_OPTIONS
./build-wasm32-wasi.sh
cmake \
-B build.native \
-DBUILD_TESTING=OFF \
${EXTRA_CMAKE_OPTIONS} \
.
cmake --build build.native
EXTRA_OPTIONS=--print-stats
TOYWASM_NATIVE=${TOYWASM_NATIVE:-./build.native/toywasm}
TOYWASM_WASM=${TOYWASM_WASM:-./build.wasm/toywasm}
echo "=== native ==="
time \
${TOYWASM_NATIVE} --version
echo "=== wasm ==="
time \
${TOYWASM_NATIVE} ${EXTRA_OPTIONS} --wasi --wasi-dir . -- \
${TOYWASM_WASM} --version
echo "=== wasm on wasm ==="
time \
${TOYWASM_NATIVE} ${EXTRA_OPTIONS} --wasi --wasi-dir . -- \
${TOYWASM_WASM} ${EXTRA_OPTIONS} --wasi --wasi-dir . -- \
${TOYWASM_WASM} --version
echo "=== wasm on wasm on wasm ==="
time \
${TOYWASM_NATIVE} ${EXTRA_OPTIONS} --wasi --wasi-dir . -- \
${TOYWASM_WASM} ${EXTRA_OPTIONS} --wasi --wasi-dir . -- \
${TOYWASM_WASM} ${EXTRA_OPTIONS} --wasi --wasi-dir . -- \
${TOYWASM_WASM} --version