Skip to content

Latest commit

 

History

History
55 lines (50 loc) · 2.95 KB

File metadata and controls

55 lines (50 loc) · 2.95 KB

Compilation and Build

The current features of ZetaEngine are controlled using macros. The main macro switches in the code are as follows:

Macro Description Default Value
ZEN_ENABLE_ASAN Enable ASAN to check for memory leaks OFF
ZEN_ENABLE_DUMP_CALL_STACK Enable call stack dumping on exceptions OFF
ZEN_ENABLE_SINGLEPASS_JIT Enable single-pass JIT functionality OFF
ZEN_ENABLE_MULTIPASS_JIT Enable multi-pass JIT functionality OFF
ZEN_ENABLE_JIT_LOGGING Enable logging in JIT OFF
ZEN_ENABLE_BUILTIN_WASI Enable built-in WASI ON
ZEN_ENABLE_BUILTIN_LIBC Enable built-in libc (partial) ON
ZEN_ENABLE_CHECKED_ARITHMETIC Enable overflow checks OFF
ZEN_ENABLE_VIRTUAL_STACK Enable virtual stack OFF
ZEN_ENABLE_SPEC_TEST Enable spec tests OFF
ZEN_ENABLE_DWASM Enable DWASM functionality OFF
ZEN_ENABLE_ASSEMBLYSCRIPT_TEST Enable AssemblyScript tests OFF
ZEN_ENABLE_PROFILER Enable profiler functionality OFF
ZEN_ENABLE_LINUX_PERF Enable Linux perf functionality OFF
ZEN_ENABLE_DEBUG_GREEDY_RA Enable debugging for greedy RA OFF
ZEN_ENABLE_CPU_EXCEPTION Use CPU traps to implement WASM traps ON

Explanation:

  • CMAKE_BUILD_TYPE can be set to release or debug. Other configuration features can be enabled by adding the corresponding macros as needed.
  • After compilation, two binary files, dtvm and dtvmTest, will be generated in the build directory.

Command Line Instructions

Commands for dtvm

Command Description Default Value
-dir (directory)
type: string
""
-env (environment variables)
type: string
""
-f (function name)
type: string
""
-args (function parameters)
type: string
""
-log (log level:
0/trace
1/debug
2/info
3/warn
4/error
5/fatal)
type: string
"2"/"info"
-mode (execution mode:
0/interpreter
1/singlepass
2/multipass)
type: string
"0"/"interpreter"
-repl (REPL mode) type: bool false

Commands for dtvmTest

Command Description Default Value
-compileTimes (Set the number of compilation runs)
type: uint32
1
-dir (directory)
type: string
""
-env (environment variables)
type: string
""
-f (function name)
type: string
""
-args (function parameters)
type: string
""
-log (log level:
0/trace
1/debug
2/info
3/warn
4/error
5/fatal)
type: string
"2"/"info"
-mode (execution mode:
0/interpreter
1/singlepass
2/multipass)
type: string
"0"/"interpreter"
-runTimes (Set the number of execution runs)
type: uint32
1
-withWasi (Use WASI in statistics mode)
type: bool
true