Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 27 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ OBJECT_MODEL_DIRS="src/engine/objmodel"
function exit_usage() {
echo "Usage: build.sh [options] <wizeng|objdump|unittest> <x86-linux|x86-64-darwin|x86-64-linux|arm64-linux|jvm|wasm-wave|v3i>"
echo "Options:"
echo " --nojit disable the JIT compiler"
echo " --O2 enable Virgil -O2 optimization level"
echo " --O3 enable Virgil -O3 optimization level"
echo " --test-monitors include the test monitors"
echo " --debug include the debug monitors"
echo " --nojit disable the JIT compiler (native targets)"
echo " --debug-gc enable GC debugging (native targets)"
echo " --gc-stats enable GC statistics (native targets)"
echo " --no-spec-test exclude the spec test mode"
echo " --no-wasm-run exclude the Wasm run mode"
echo " --cbd include the canonical bytecode description interpreter"
Expand Down Expand Up @@ -92,8 +95,17 @@ OBJECT_MODEL=boxed

while [[ $# -gt 0 ]]; do
case "$1" in
--O2)
V3C_OPTS+="$V3C_OPTS -O2"
;;
--O3)
V3C_OPTS+="$V3C_OPTS -O3"
;;
--gc-stats)
GC_STATS=1
;;
--nojit)
append_comma_sep REDEFS "SpcTuning.disable=true"
NO_JIT=1
;;
--test-monitors)
MONITORS="$MONITORS $TEST_MONITORS"
Expand Down Expand Up @@ -142,8 +154,17 @@ ENGINE="$ENGINE $OBJECT_MODEL_SRC"
PROGRAM=$1
TARGET=$2

if [[ "$TARGET" =~ x86 && $DEBUG_GC = 1 ]]; then
V3C_OPTS="$V3C_OPTS -redef-field=RiGc.debug=true"
if [ "$TARGET" =~ x86 ]; then
if [ "$DEBUG_GC" = 1 ]; then
append_comma_sep REDEFS "RiGc.debug=true"
fi
if [ "$GC_STATS" = 1 ]; then
append_comma_sep REDEFS "RiGc.stats=true"
append_comma_sep REDEFS "RiGc.verbose=true"
fi
if [ "$NO_JIT" = 1 ]; then
append_comma_sep REDEFS "SpcTuning.disable=true"
fi
fi

function make_build_file() {
Expand Down Expand Up @@ -201,6 +222,8 @@ BUILD_FILE=$(make_build_file)
PREGEN=${PREGEN:=1}

LANG_OPTS="-lang:fun-exprs -lang:simple-bodies -lang:descriptors"

# Add field redefinitions
if [ "$REDEFS" != "" ]; then
V3C_OPTS="$V3C_OPTS -redef-field=$REDEFS"
fi
Expand Down
Loading