Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
feb51ab
Fix hardcoded absolute paths for kvulkanSDL files in Xcode project
kevodwyer Apr 21, 2026
8f086d9
Add WASM JIT backend for Emscripten builds
kevodwyer Apr 22, 2026
377818f
Fix WASM JIT build errors
kevodwyer Apr 22, 2026
e66c53d
Add testJit Emscripten target: CPU tests with WASM JIT enabled
kevodwyer Apr 22, 2026
6f2efea
Fix WASM JIT register width, high-byte regs, and CF computation
kevodwyer Apr 23, 2026
4c63492
WASM JIT: per-branch cache flush, condition helpers, real jump EIPs
kevodwyer Apr 23, 2026
46c5da1
WASM JIT: fall back to normal interpreter when module instantiation f…
kevodwyer Apr 23, 2026
1d634ce
WASM JIT: CS-relative jump EIP, high-byte lazy flags, cache-clear leak
kevodwyer Apr 24, 2026
cc79cfb
WASM JIT: fix direct mode, seg caching, mem helpers, shift/string ops
kevodwyer Apr 24, 2026
952e6ef
WASM JIT: route near calls/jumps and Loop branches via emulateSingleOp
kevodwyer Apr 25, 2026
b2353d9
WASM JIT: route XADD and CMPXCHG variants through emulateSingleOp
kevodwyer Apr 25, 2026
d97da22
WASM JIT: delegate preCompile/postCompile to base class
kevodwyer Apr 25, 2026
3627daa
WASM JIT: writeEip before emulateSingleOp in mixed blocks; op-level o…
kevodwyer May 1, 2026
3170d5e
WASM JIT: same-block self-modifying-code bailout
kevodwyer May 1, 2026
95c4df5
WASM JIT: native codegen for 32-bit shl/shr/sar/rol/ror
kevodwyer May 1, 2026
84f3379
WASM JIT: document why each emulateSingleOp fallback still exists
kevodwyer May 1, 2026
c11101a
Add CLAUDE.md with build/architecture/debugging notes
kevodwyer May 1, 2026
a82dde4
JIT: add LoopBegin/LoopEnd to base class
kevodwyer May 1, 2026
b2b8134
JIT: migrate string-op rep loops to LoopBegin/LoopEnd
kevodwyer May 1, 2026
445aa4e
WASM JIT: implement LoopBegin/LoopEnd with structural loop+end
kevodwyer May 1, 2026
85f47c4
WASM JIT: native codegen for movsb (uses LoopBegin/LoopEnd)
kevodwyer May 1, 2026
aa7cbc9
WASM JIT: native codegen for movsw and movsd
kevodwyer May 1, 2026
225502a
WASM JIT: native codegen for cmpsb, cmpsw, cmpsd
kevodwyer May 1, 2026
e49cbaf
WASM JIT: native codegen for stosb, stosw, stosd
kevodwyer May 1, 2026
84c2604
WASM JIT: native codegen for lodsb, lodsw, lodsd
kevodwyer May 2, 2026
1068f9e
WASM JIT: native codegen for scasb, scasw, scasd
kevodwyer May 2, 2026
a7254c1
WASM JIT: drop string ops from header doc's emulateSingleOp list
kevodwyer May 2, 2026
a71c3d3
WASM JIT: add wasmReadPageBase/wasmWritePageBase TLB arrays
kevodwyer May 2, 2026
09b98a3
WASM JIT: inline TLB fast path for emulated reads
kevodwyer May 2, 2026
053f5ed
WASM JIT: inline TLB fast path for emulated writes (SMC-safe)
kevodwyer May 2, 2026
6a68f89
WASM JIT: document the inline TLB and RMW non-fast-path
kevodwyer May 2, 2026
c8fe7d7
WASM JIT: add MAXIMUM_MEMORY=3GiB to the jit makefile target
kevodwyer May 2, 2026
bd2d35b
WASM JIT: add multiThreadedJit emscripten target
kevodwyer May 2, 2026
cceca16
WASM JIT: serialize wasmTable mutations under multiThreadedJit
kevodwyer May 3, 2026
9f121bb
fix: guard collectAllJitBlocks with BOXEDWINE_JIT
kevodwyer May 3, 2026
8740d63
emscripten: add releasePerf makefile target
kevodwyer May 3, 2026
90bea7c
emscripten: add jitPerf makefile target
kevodwyer May 3, 2026
9f709af
WASM JIT: fix wrong block called when new block subsumes old block's …
kevodwyer May 8, 2026
4da85e4
Use INITIAL_MEMORY for Emscripten build
kevodwyer May 10, 2026
f7bbab0
wasm-jit: fix ROL/ROR b8/b16, imulRRI/imulRR, and emulateSingleOp seg…
kevodwyer May 15, 2026
aa33dfd
wasm-jit: fix negReg2 flags, emulateSingleOp flag cache, direct_test …
kevodwyer May 15, 2026
9402005
wasm-jit: fix scratch local pool exhaustion causing wrong JZ decisions
kevodwyer May 16, 2026
a95c504
wasm-jit: always store full lazy-flag state in arithSetup
kevodwyer May 16, 2026
a415d7f
wasm-jit: always store lazy flag state in arithSetup regardless of bl…
kevodwyer May 16, 2026
35e4fc3
wasm-jit: remove duplicate lazyTypeForSub definition
kevodwyer May 16, 2026
0a42088
wasm-jit: fix INC/DEC CF preservation and FLAGS_NULL null-pointer crash
kevodwyer May 18, 2026
4c15d66
wasm-jit: revert usesOldCF=true and dynamic_M cross-block flag approach
kevodwyer May 18, 2026
50fe882
wasm-jit: restore dynamic_M cross-block flag correctness fix
kevodwyer May 18, 2026
b9aa325
wasm-jit: always save oldCF for instructions that preserve CF (cross-…
kevodwyer May 18, 2026
939d564
wasm-jit: SAHF fix, C++ call_indirect, try/catch signal delivery, mak…
kevodwyer May 19, 2026
7926e09
wasm-jit: remove jitDiag target — belongs only in wasm-jit-diagnostics
kevodwyer May 19, 2026
8695ec0
wasm-jit: update IfLessThan/IfGreaterThan signatures for master refactor
kevodwyer May 19, 2026
4f9c71b
wasm-jit-diagnostics: fix testJit missing test subdirectory sources
kevodwyer May 19, 2026
8e83ca7
wasm-jit-diagnostics: add asmjit and test subdirs to testJit SRCS
kevodwyer May 19, 2026
3f565b1
Fix two WASM JIT test regressions introduced by master's new test cases
kevodwyer May 20, 2026
52d661b
wasmEmitter: declare memory import as shared in pthreads builds
kevodwyer May 21, 2026
f503239
multiThreadedJit: fix table-index collision with Atomics-based slot a…
kevodwyer May 21, 2026
cad785e
multiThreadedJit: fix null-function eviction race; add call_block bou…
kevodwyer May 21, 2026
bed54a1
multiThreadedJit: lazily install WASM blocks per worker
kevodwyer May 21, 2026
c711022
Scope JIT fallbacks to WASM backend
kevodwyer May 21, 2026
77ee515
Inline simple WASM JIT fallbacks
kevodwyer May 21, 2026
c414a62
Optimize WASM JIT fallback profiling
kevodwyer May 21, 2026
9de122f
Inline more WASM JIT fallback ops
kevodwyer May 22, 2026
4a35a1f
Inline more WASM JIT fallback ops
kevodwyer May 22, 2026
59477c0
Inline guarded WASM JIT div32 and idiv32
kevodwyer May 22, 2026
6236f16
Enable WASM JIT optimized exits and conditions
kevodwyer May 26, 2026
8060a4b
Instrument wasm jit performance
kevodwyer May 27, 2026
7b11f46
Improve wasm JIT block chaining
kevodwyer May 27, 2026
c30424e
Fix multithreaded wasm JIT dispatch
kevodwyer May 27, 2026
29eebce
Document wasm JIT optimization status
kevodwyer May 27, 2026
a7df1a7
Optimize wasm JIT condition helpers
kevodwyer May 28, 2026
fb11dc2
Fast path wasm JIT mov bridge
kevodwyer May 31, 2026
ff607a1
Optimize wasm JIT in-block branch exits
kevodwyer May 31, 2026
5e7c948
Instrument wasm JIT bridge dispatch
kevodwyer May 31, 2026
d985720
Port wasm normal core fast paths
kevodwyer May 31, 2026
cb781c8
Port wasm direct normal dispatch
kevodwyer May 31, 2026
cbf5e85
Use scoped normal dispatch for wasm JIT bridge
kevodwyer May 31, 2026
ab8b594
Enable wasm tail calls for emscripten targets
kevodwyer May 31, 2026
b2132f1
Update wasm JIT profiling roadmap
kevodwyer May 31, 2026
8d443bc
Inline hot wasm JIT x87 helpers
kevodwyer May 31, 2026
8f8fe42
Update wasm JIT investigation notes
kevodwyer May 31, 2026
a1b1e20
Add MIPS rolling window and warm average to emscripten mainloop
kevodwyer Jun 9, 2026
f16f6e2
Inline FPU helper fast paths in wasm JIT
kevodwyer Jun 9, 2026
a99d171
Add WASM JIT branch hinting
kevodwyer Jun 9, 2026
08039d1
Add opt-in save/load of wasm JIT modules as a zip
kevodwyer Jun 10, 2026
3391d12
Add offline wasm JIT cache pipeline with grouped ST and flat MT replay
kevodwyer Jun 11, 2026
062200c
WASM JIT: fix FNSTSW_AX reg-cache invalidation
kevodwyer Jun 11, 2026
ac1a332
Add binaryen_js.js for the wasm JIT cache pipeline
kevodwyer Jun 11, 2026
3477da6
WASM JIT: supply DecodedOp pointers to relocatable modules via import…
kevodwyer Jun 11, 2026
1b50b9d
WASM JIT: grouped-replay reloc parity via per-call relocBase parameter
kevodwyer Jun 11, 2026
cb08c5b
WASM JIT MT: per-call mutex fix, slot-readiness cache, gated chain loop
kevodwyer Jun 11, 2026
ece857a
WASM JIT: direct normal dispatch for interpreted chains (default on)
kevodwyer Jun 12, 2026
135a996
Update binaryen_js.js to newer Binaryen build
kevodwyer Jun 12, 2026
67d3c8d
WASM JIT: remove MT chain loop and stale cond_Z diagnostics
kevodwyer Jun 12, 2026
1c7ad57
WASM JIT: document remaining build-time defines in jitWasmCodeGen.h
kevodwyer Jun 12, 2026
14e2b4b
WASM JIT: gate transition profiling to record sessions; log MIPS ever…
kevodwyer Jun 12, 2026
c9c1a12
WASM JIT: piped (grouped) module replay for multi-threaded builds
kevodwyer Jun 12, 2026
ed743d8
Port pop-to-memory rewrite from upstream 2b426d7b: peek then commit E…
kevodwyer Jun 12, 2026
78c3e6c
Merge branch 'master' into feat/wasm-jit-staging
danoon2 Jun 13, 2026
6096e1a
Merge branch 'master' into feat/wasm-jit-staging
danoon2 Jun 13, 2026
ef6ece0
Merge branch 'master' into feat/wasm-jit-staging
danoon2 Jun 13, 2026
1b05365
2 changes that improve the score of jit from 23 to 33 (release 37) an…
kevodwyer Jun 14, 2026
91e5e53
make makefile recipes for copying asset file for jit targets match th…
kevodwyer Jun 14, 2026
f522ca9
tidy up calling convention when falling back to normal core from wasm…
kevodwyer Jun 14, 2026
3460864
some work on making the wasm jit use the base jit class more for the fpu
danoon2 Jun 14, 2026
10bf1a9
unit tests now accepts a -fast command line argument, it still tests …
danoon2 Jun 14, 2026
d7f89fd
some work on making the wasm jit use mmx base jit class
danoon2 Jun 14, 2026
260e899
some work on making the wasm jit use sse base jit class
danoon2 Jun 15, 2026
98f8b3b
update stale comment
kevodwyer Jun 16, 2026
93a1b80
initial work on overlapping wasm jit blocks
danoon2 Jun 16, 2026
b7a5192
now single and multi threaded java works well with the sub block wasm
danoon2 Jun 19, 2026
3c4e57c
removed some unnessary logic that was introduced by my initial wasm j…
danoon2 Jun 19, 2026
648259c
arm unit test fix
Jun 19, 2026
6d72eee
revert the x64 fix from 2 commits ago because the last commit for arm…
danoon2 Jun 19, 2026
7d8765d
WASM Jit: improves performance but break java, will try to fix that next
danoon2 Jun 20, 2026
ff8299a
fixed unit tests
danoon2 Jun 20, 2026
ffdd408
Fix trapping WASM JIT float conversions
kevodwyer Jun 22, 2026
a1d8ef7
Optimize WASM JIT hot paths and profiling
kevodwyer Jun 23, 2026
2971d9d
Merge branch 'master' into feat/wasm-jit-staging
danoon2 Jun 23, 2026
6d0594a
Optimize persistent WASM JIT replay
kevodwyer Jun 24, 2026
863540d
Fix wasm JIT direct-loop budget condition
kevodwyer Jun 30, 2026
6d57d7e
Fixed issues exposed by the tests by preflighting cross-page split wr…
danoon2 Jul 2, 2026
2e92d39
Merge branch 'feat/wasm-jit-staging' into james/x86_memory
danoon2 Jul 2, 2026
af654af
Inline wasm JIT sign conditions
kevodwyer Jul 1, 2026
32bf6ab
Tune MT wasm JIT generic exit chaining
kevodwyer Jul 1, 2026
ed3e22f
Fix wasm JIT callback warmup and stale nextOp
kevodwyer Jul 2, 2026
411446e
Fix JIT invalidation and in-block jump target handling
danoon2 Jul 3, 2026
b308549
fix for single threaded wasm jit with java
danoon2 Jul 3, 2026
1f3e365
Merge branch 'feat/wasm-jit-staging' into james/x86_memory
danoon2 Jul 3, 2026
cd400c1
updated jenkins to build jit version of the wasm build
danoon2 Jul 3, 2026
25b7c2e
added new url param disableWasmJitForWrittenCode. With this change wr…
kevodwyer Jul 4, 2026
9c05eab
fixed multithreaded jit emscripten unit tests and update build demo t…
danoon2 Jul 4, 2026
0a058c9
Linux arm64 fix for hardware TSO path
danoon2 Jul 4, 2026
d88d644
Merge branch 'james/x86_memory' into feat/wasm-jit-staging
danoon2 Jul 4, 2026
35331b0
added abiword automation to emscripten build
danoon2 Jul 7, 2026
7780124
fix bmp handling when screenshhot is in a zip
danoon2 Jul 7, 2026
b9fc736
fixed a bug with how screenshots are read in automation for the emscr…
danoon2 Jul 7, 2026
5c7a19e
firefox on windows runs abiword automation just fine, but on the linu…
danoon2 Jul 10, 2026
2cf67bd
-O2 was missing from the linker step, -O3 was not faster and created …
danoon2 Jul 12, 2026
1ec0bd1
Fixed MDK Perf single threaded jit wasm build when running in Firefox…
danoon2 Jul 15, 2026
42506c4
Fixed MDK Perf single threaded jit wasm build when running in Firefox…
danoon2 Jul 15, 2026
9769f1d
Fixed a 2-4% regression in performance across all platforms. I belie…
danoon2 Jul 17, 2026
6894c7c
wasm multi-thread jit will now shared compiled modules between thread…
danoon2 Jul 17, 2026
2b89d4f
Merge branch 'james/wasm_perf' into feat/wasm-jit-staging
danoon2 Jul 17, 2026
f01a84f
Fix MT WASM JIT invalidation during exec so live or CLONE_VM-shared d…
danoon2 Jul 18, 2026
9fd4e2c
some minor fixes and add testMultiThreadedJit to the jenkins build
danoon2 Jul 18, 2026
3ef89d1
fixed unit test
danoon2 Jul 18, 2026
c726295
fixed an audio crash in the multi-threaded jit wasm target
danoon2 Jul 18, 2026
e336e0f
added automation, automationMultiThreaded and automationMultiThreaded…
danoon2 Jul 18, 2026
b2b6dab
wasm automation fix
danoon2 Jul 18, 2026
68cf124
fixed multithreaded emscripten automation
danoon2 Jul 18, 2026
70a4a4e
run emscripten target unit tests in parallel.
danoon2 Jul 18, 2026
9c3190f
Merge branch 'master' into feat/wasm-jit-staging
danoon2 Jul 19, 2026
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
285 changes: 256 additions & 29 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,140 @@ void gitCheckout() {
}
}

void runEmscriptenUnitTest(String testName, String buildDir, String port) {
withEnv([
"BOXEDWINE_UNIT_TEST_NAME=${testName}",
"BOXEDWINE_UNIT_TEST_BUILD_DIR=${buildDir}",
"BOXEDWINE_UNIT_TEST_PORT=${port}"
]) {
sh '''#!/bin/bash
source ~/emsdk/emsdk_env.sh
cd project/emscripten
set -euo pipefail

firefox_profile="$(mktemp -d "$WORKSPACE/.firefox-${BOXEDWINE_UNIT_TEST_BUILD_DIR}.XXXXXX")"
cleanup_firefox_profile() {
if [ -z "$firefox_profile" ]; then
return 0
fi

case "$firefox_profile" in
"$WORKSPACE"/.firefox-*)
if ! rm -rf -- "$firefox_profile"; then
echo "WARNING: Could not remove Firefox profile: $firefox_profile" >&2
fi
firefox_profile=''
;;
*)
echo "WARNING: Refusing to remove unexpected Firefox profile path: $firefox_profile" >&2
firefox_profile=''
;;
esac
return 0
}
trap cleanup_firefox_profile EXIT

echo "Running ${BOXEDWINE_UNIT_TEST_NAME}"
cd "Build/${BOXEDWINE_UNIT_TEST_BUILD_DIR}"
emrun --kill-exit \
--port "$BOXEDWINE_UNIT_TEST_PORT" \
--browser="/usr/bin/firefox" \
--browser-args="--headless --no-remote --profile ${firefox_profile}" \
boxedwine.html
'''
}
}

void runEmscriptenAbiWordAutomation(String automationName, String buildDir, String port) {
withEnv([
"BOXEDWINE_AUTOMATION_NAME=${automationName}",
"BOXEDWINE_AUTOMATION_BUILD_DIR=${buildDir}",
"BOXEDWINE_AUTOMATION_PORT=${port}"
]) {
sh '''#!/bin/bash
source ~/emsdk/emsdk_env.sh
export DISPLAY=:0
export XAUTHORITY="$HOME/.Xauthority"
cd project/emscripten
set -euo pipefail

chrome_profile=''
cleanup_chrome_profile() {
local cleanup_attempt

if [ -z "$chrome_profile" ]; then
return 0
fi

case "$chrome_profile" in
"$WORKSPACE"/.chrome-*)
# emrun terminates Chrome, but its child processes can briefly
# recreate profile files while they are shutting down.
for cleanup_attempt in 1 2 3 4 5
do
if rm -rf -- "$chrome_profile"; then
chrome_profile=''
return 0
fi

if [ "$cleanup_attempt" != "5" ]; then
echo "Chrome profile is still busy; retrying cleanup (${cleanup_attempt}/5)"
sleep 1
fi
done

echo "WARNING: Chrome profile is still busy; leaving it for workspace cleanup: $chrome_profile" >&2
chrome_profile=''
return 0
;;
*)
echo "Refusing to remove unexpected Chrome profile path: $chrome_profile" >&2
return 1
;;
esac
}
trap cleanup_chrome_profile EXIT

last_rc=1
for attempt in 1 2 3
do
echo "${BOXEDWINE_AUTOMATION_NAME} attempt ${attempt}/3"
chrome_profile="$(mktemp -d "$WORKSPACE/.chrome-${BOXEDWINE_AUTOMATION_BUILD_DIR}-${attempt}.XXXXXX")"

cd "Build/${BOXEDWINE_AUTOMATION_BUILD_DIR}"
set +e
emrun --kill-exit \
--port "$BOXEDWINE_AUTOMATION_PORT" \
--timeout 600 \
--timeout-returncode 124 \
--browser="/usr/bin/google-chrome" \
--browser-args="--user-data-dir=${chrome_profile}" \
'boxedwine.html?root=boxedwine&overlay=abiword_auto&w=%2Ffiles&play=%2Ffiles%2Fscript.txt&p=ABIWORD.EXE&resolution=1024x768&storage=memory'
rc=$?
set -e
cd ../..

cleanup_chrome_profile
chrome_profile=''

if [ "$rc" = "111" ]; then
echo "${BOXEDWINE_AUTOMATION_NAME} passed"
exit 0
fi

last_rc="$rc"
echo "${BOXEDWINE_AUTOMATION_NAME} attempt ${attempt}/3 failed with exit code ${rc}"
done

echo "${BOXEDWINE_AUTOMATION_NAME} failed after 3 attempts"
if [ "$last_rc" = "0" ]; then
exit 1
fi
exit "$last_rc"
'''
}
}

void publishGithubBuildStatus(String state, String description) {
def commit = env.GIT_COMMIT ?: env.BOXEDWINE_GIT_COMMIT
if (!commit) {
Expand Down Expand Up @@ -98,12 +232,29 @@ pipeline {
sh '''#!/bin/bash
source ~/emsdk/emsdk_env.sh
cd project/emscripten
set -euo pipefail

make clean
make test
killall -9 python3
cd Build/Test
emrun --kill_start --kill_exit --browser="/usr/bin/firefox" --browser_args="--headless" boxedwine.html
make testJit
make testMultiThreadedJit

killall -9 python3 2>/dev/null || true
killall -9 firefox 2>/dev/null || true
'''
script {
parallel(
'Emscripten ST': {
runEmscriptenUnitTest('Emscripten ST unit tests', 'Test', '6921')
},
'Emscripten ST JIT': {
runEmscriptenUnitTest('Emscripten ST JIT unit tests', 'TestJit', '6922')
},
'Emscripten MT JIT': {
runEmscriptenUnitTest('Emscripten MT JIT unit tests', 'TestMultiThreadedJit', '6923')
}
)
}
}
}
stage ('Test Linux (x64)') {
Expand Down Expand Up @@ -196,35 +347,37 @@ pipeline {
dir("project/emscripten") {
sh '''#!/bin/bash
source ~/emsdk/emsdk_env.sh
set -e
set -x
rm -rf Deploy
make clean
make multiThreaded
if [ ! -f "Build/MultiThreaded/boxedwine.wasm" ]
then
echo "boxedwine.wasm DOES NOT exists."
exit 999
fi
mkdir -p Deploy/Web/MultiThreaded
cp Build/MultiThreaded/boxedwine.html Deploy/Web/MultiThreaded
cp boxedwine.css Deploy/Web/MultiThreaded
cp boxedwine-shell.js Deploy/Web/MultiThreaded
cp Build/MultiThreaded/boxedwine.js Deploy/Web/MultiThreaded
cp Build/MultiThreaded/boxedwine.wasm Deploy/Web/MultiThreaded
cp /var/www/buildfiles/* Deploy/Web/MultiThreaded
make release
if [ ! -f "Build/Release/boxedwine.wasm" ]
then
echo "boxedwine.wasm DOES NOT exists."
exit 999
fi
mkdir -p Deploy/Web/SingleThreaded
cp Build/Release/boxedwine.html Deploy/Web/SingleThreaded
cp boxedwine.css Deploy/Web/SingleThreaded
cp boxedwine-shell.js Deploy/Web/SingleThreaded
cp Build/Release/boxedwine.js Deploy/Web/SingleThreaded
cp Build/Release/boxedwine.wasm Deploy/Web/SingleThreaded
cp /var/www/buildfiles/* Deploy/Web/SingleThreaded

build_web_target() {
local make_target="$1"
local build_dir="$2"
local deploy_name="$3"
local deploy_dir="Deploy/Web/${deploy_name}"

make "${make_target}"
if [ ! -f "${build_dir}/boxedwine.wasm" ]
then
echo "${build_dir}/boxedwine.wasm DOES NOT exist."
exit 999
fi

mkdir -p "${deploy_dir}"
cp "${build_dir}/boxedwine.html" "${deploy_dir}"
cp boxedwine.css "${deploy_dir}"
cp boxedwine-shell.js "${deploy_dir}"
cp "${build_dir}/boxedwine.js" "${deploy_dir}"
cp "${build_dir}/boxedwine.wasm" "${deploy_dir}"
cp /var/www/buildfiles/* "${deploy_dir}"
}

build_web_target release Build/Release SingleThreaded
build_web_target multiThreaded Build/MultiThreaded MultiThreaded
build_web_target jit Build/Jit SingleThreadedJit
build_web_target multiThreadedJit Build/MultiThreadedJit MultiThreadedJit
'''
}
dir("project/emscripten") {
Expand Down Expand Up @@ -378,6 +531,80 @@ pipeline {
}
stage ('Automation') {
parallel {
stage ('Emscripten AbiWord Automation') {
agent {
label "emscripten"
}
steps {
script {
gitCheckout()
}
sh '''#!/bin/bash
source ~/emsdk/emsdk_env.sh
export DISPLAY=:0
export XAUTHORITY="$HOME/.Xauthority"
cd project/emscripten
set -euo pipefail

ABIWORD_AUTO_URL='https://boxedwine.org/v2/1/abiword_auto_v1.zip'
ABIWORD_AUTO_SHA256='80dc5a5f99f23637e4eb29b72e4f5484e9c03d697e72e4e4777574985b351181'
BOXEDWINE_AUTO_URL='https://boxedwine.org/v2/1/boxedwine_v1.zip'
BOXEDWINE_AUTO_SHA256='67742f667f989083a327d4405f7e4cd59cacea061a5936dbedcc5d47898de4d9'

file_matches_sha256() {
local file="$1"
local expected_sha="$2"
[ -f "$file" ] && printf '%s %s\\n' "$expected_sha" "$file" | sha256sum -c - >/dev/null 2>&1
}

download_checked() {
local url="$1"
local output="$2"
local expected_sha="$3"
local tmp="${output}.tmp"

if file_matches_sha256 "$output" "$expected_sha"; then
echo "$output already exists and matches expected SHA-256"
return 0
fi

echo "Downloading $output from $url"
rm -f "$tmp"
curl -fL --retry 3 --retry-delay 5 --connect-timeout 30 "$url" -o "$tmp"
printf '%s %s\\n' "$expected_sha" "$tmp" | sha256sum -c -
mv "$tmp" "$output"
}

download_checked "$ABIWORD_AUTO_URL" abiword_auto.zip "$ABIWORD_AUTO_SHA256"
download_checked "$BOXEDWINE_AUTO_URL" boxedwine.zip "$BOXEDWINE_AUTO_SHA256"

make clean
make automation
make automationMultiThreaded
make automationJit
make automationMultiThreadedJit

killall -9 python3 2>/dev/null || true
killall -9 chrome 2>/dev/null || true
'''
script {
parallel(
'Emscripten ST': {
runEmscriptenAbiWordAutomation('AbiWord Emscripten ST automation', 'Automation', '6931')
},
'Emscripten MT': {
runEmscriptenAbiWordAutomation('AbiWord Emscripten MT automation', 'AutomationMultiThreaded', '6932')
},
'Emscripten ST JIT': {
runEmscriptenAbiWordAutomation('AbiWord Emscripten ST JIT automation', 'AutomationJit', '6933')
},
'Emscripten MT JIT': {
runEmscriptenAbiWordAutomation('AbiWord Emscripten MT JIT automation', 'AutomationMultiThreadedJit', '6934')
}
)
}
}
}
stage ('Linux (x64) Automation') {
agent {
label "linux64"
Expand Down
13 changes: 11 additions & 2 deletions include/boxedwine.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
#ifndef __BOXEDWINE_H__
#define __BOXEDWINE_H__

#define BOXEDWINE_VERSION_STR "26R1"
#define BOXEDWINE_VERSION_DISPLAY "26.0.0"
#define BOXEDWINE_VERSION_STR "26R2"
#define BOXEDWINE_VERSION_DISPLAY "26.1.0"

#include <vector>
#include <memory>
Expand Down Expand Up @@ -52,6 +52,15 @@
#define ASMJIT_STATIC
#endif

// WASM JIT backend: emits WebAssembly bytecode for each compiled block.
// Enabled by passing -DBOXEDWINE_WASM_JIT to the Emscripten compiler.
// Implies BOXEDWINE_JIT (shared infrastructure) but does NOT use asmjit.
#ifdef BOXEDWINE_WASM_JIT
#define BOXEDWINE_JIT
// No BOXEDWINE_MULTI_THREADED: WASM is single-threaded by default
// No ASMJIT flags: the WASM backend bypasses asmjit entirely
#endif

#ifdef BOXEDWINE_MAC_JIT
#include "TargetConditionals.h"
#define BOXEDWINE_HOST_EXCEPTIONS
Expand Down
5 changes: 4 additions & 1 deletion include/kmemory.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,14 @@ class KMemory {
U64 readq(U32 address);
U32 readd(U32 address);
U32 readdInline(U32 address);
void writedInline(U32 address, U32 value);
U16 readw(U32 address);
U8 readb(U32 address);
void writeq(U32 address, U64 value);
void writed(U32 address, U32 value);
void writedInline(U32 address, U32 value);
void writew(U32 address, U16 value);
void writeb(U32 address, U8 value);
void preflightWrite(U32 address, U32 len);

BString readString(U32 address);
BString readStringW(U32 address);
Expand Down Expand Up @@ -161,6 +162,8 @@ class KMemory {
void* allocCodeMemory(U32 len);
bool isCode(void* p);

KMemoryData* getData() { return data; }

BOXEDWINE_MUTEX mutex;
KMemoryData* deleteOnNextLoop = nullptr;
private:
Expand Down
10 changes: 7 additions & 3 deletions include/kprocess.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2012-2025 The BoxedWine Team
* Copyright (C) 2012-2026 The BoxedWine Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -136,8 +136,12 @@ class KProcess : public std::enable_shared_from_this<KProcess> {
void free(U32 address);
U32 createString(KThread* thread, const BString& str);

BString getModuleName(U32 eip);
U32 getModuleEip(U32 eip);
BString getModuleName(U32 eip);
U32 getModuleEip(U32 eip);
MappedFilePtr getMappedFileForRange(U32 address, U32 len);
#ifdef __TEST
static MappedFilePtr selectMappedFileForRangeForTest(const std::vector<MappedFilePtr>& mappings, U32 address, U32 len);
#endif
KFileDescriptorPtr allocFileDescriptor(const std::shared_ptr<KObject>& kobject, U32 accessFlags, U32 descriptorFlags, S32 handle, U32 afterHandle);
KFileDescriptorPtr getFileDescriptor(FD handle);
KFileDescriptor* getFileDescriptor_nolock(FD handle);
Expand Down
Loading