3 ms·
Cool. The whole repo is about 24K lines, and the vmcore_wasm dir is ~8300 lines. ~/git/languages/wasm-micro-runtime$ find . -name '*.[ch]' |xargs wc -l |sor
by chubot 8y ago
Cool. The whole repo is about 24K lines, and the vmcore_wasm dir is ~8300 lines.
~/git/languages/wasm-micro-runtime$ find . -name '*.[ch]' |xargs wc -l |sort -n
...
472 ./core/iwasm/runtime/vmcore_wasm/wasm-opcode.h
478 ./core/shared-lib/utils/runtime_timer.c
537 ./core/shared-lib/platform/zephyr/bh_thread.c
581 ./core/iwasm/runtime/platform/zephyr/wasm_math.c
590 ./core/shared-lib/mem-alloc/ems/ems_alloc.c
841 ./core/iwasm/lib/native-interface/attr-container.c
893 ./core/iwasm/lib/native/libc/libc_wrapper.c
1220 ./core/iwasm/runtime/vmcore_wasm/wasm-runtime.c
2160 ./core/iwasm/runtime/vmcore_wasm/wasm-interp.c
2874 ./core/iwasm/runtime/vmcore_wasm/wasm-loader.c
24534 total
There is also a C++ VM here that’s ~7700 lines. I haven’t tried either one but it would be interesting to see how they compare!
https://github.com/WebAssembly/wabt/tree/master/src/interp https://github.com/WebAssembly/wabt/tree/master/src/interp
~/git/languages/wabt/src/interp$ wc -l *.cc *.h
1863 binary-reader-interp.cc
3585 interp.cc
642 interp-disassemble.cc
740 interp-trace.cc
43 binary-reader-interp.h
735 interp.h
94 interp-internal.h
7702 total