Skip to content
Merged
Show file tree
Hide file tree
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
27 changes: 0 additions & 27 deletions .github/workflows/build-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -718,33 +718,6 @@ jobs:
while read -r name; do mv "dl/$name/bun-webkit.tar.gz" "out/$name.tar.gz"; done < artifacts.txt
ls -la out

# A bytecode cache payload written on one platform is read in place on the others (bun build --compile
# cross-compiles), so the records it is made of must be laid out identically everywhere. Every Docker-built
# archive carries its layouts (Tools/Scripts/dump-bytecode-cache-layout.ts); any difference from linux-amd64, or a
# missing dump, fails the release. The one native build (windows-arm64-debug) has no dump and is not compared.
- name: Bytecode cache layouts agree across platforms
if: false # each image still writes bytecode-cache-layout.txt; the cross-platform comparison moves to its own fast job in a follow-up
run: |
set -euo pipefail
mkdir -p layouts
status=0
while read -r name; do
[ "$name" = bun-webkit-windows-arm64-debug ] && continue
if ! tar -xzf "out/$name.tar.gz" -O bun-webkit/bytecode-cache-layout.txt > "layouts/$name.txt"; then
echo "::error::$name has no bytecode-cache-layout.txt"
status=1
fi
done < artifacts.txt
for f in layouts/*.txt; do
if ! diff -u layouts/bun-webkit-linux-amd64.txt "$f" > "$f.diff"; then
echo "::error::bytecode cache record layouts in $(basename "$f" .txt) differ from linux-amd64"
head -50 "$f.diff"
status=1
fi
done
echo "$(ls layouts/*.txt | wc -l) platforms compared"
exit $status

- name: Set release info
id: release_info
run: |
Expand Down
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,6 @@ RUN --mount=type=tmpfs,target=/webkitbuild \
cd /webkitbuild && \
cmake --build /webkitbuild --config $WEBKIT_RELEASE_TYPE --target "jsc" --target "testFFI" && \
python3 /webkit/Tools/Scripts/check-classinfo-uniqueness.py $WEBKIT_OUT_DIR/bin/jsc && \
node --experimental-strip-types /webkit/Tools/Scripts/dump-bytecode-cache-layout.ts /webkitbuild > /output/bytecode-cache-layout.txt && \
cp -r $WEBKIT_OUT_DIR/lib/*.a /output/lib && \
cp $WEBKIT_OUT_DIR/*.h /output/include && \
cp -r $WEBKIT_OUT_DIR/bin /output/bin && \
Expand Down
8 changes: 0 additions & 8 deletions Dockerfile.android
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,6 @@ RUN mkdir -p /output/lib /output/include /output/include/JavaScriptCore /output/
# etc.) at build time, so a host build is required first; the target build
# points at it via --with-cross-build.
# ───────────────────────────────────────────────────────────────────────────

# Node — only used to run Tools/Scripts/dump-bytecode-cache-layout.ts after the build.
ARG NODE_VERSION=24.16.0
RUN wget -qO- "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-$(uname -m | sed 's/x86_64/x64/;s/aarch64/arm64/').tar.xz" \
| tar -xJ -C /usr/local --strip-components=1 && \
node --version

FROM base AS build_icu

ARG MARCH_FLAG
Expand Down Expand Up @@ -214,7 +207,6 @@ RUN --mount=type=tmpfs,target=/webkitbuild \
/webkit && \
cmake --build /webkitbuild --config ${WEBKIT_RELEASE_TYPE} --target jsc --target testFFI && \
python3 /webkit/Tools/Scripts/check-classinfo-uniqueness.py $WEBKIT_OUT_DIR/bin/jsc && \
node --experimental-strip-types /webkit/Tools/Scripts/dump-bytecode-cache-layout.ts /webkitbuild > /output/bytecode-cache-layout.txt && \
cp -r $WEBKIT_OUT_DIR/lib/*.a /output/lib && \
cp $WEBKIT_OUT_DIR/*.h /output/include && \
cp -r $WEBKIT_OUT_DIR/bin /output/bin && \
Expand Down
8 changes: 0 additions & 8 deletions Dockerfile.freebsd
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,6 @@ RUN mkdir -p /output/lib /output/include /output/include/JavaScriptCore /output/
# ICU — cross-compiled. Same two-stage host/target build as Android: host
# tools first, then --with-cross-build.
# ───────────────────────────────────────────────────────────────────────────

# Node — only used to run Tools/Scripts/dump-bytecode-cache-layout.ts after the build.
ARG NODE_VERSION=24.16.0
RUN wget -qO- "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-$(uname -m | sed 's/x86_64/x64/;s/aarch64/arm64/').tar.xz" \
| tar -xJ -C /usr/local --strip-components=1 && \
node --version

FROM base AS build_icu

ARG MARCH_FLAG
Expand Down Expand Up @@ -206,7 +199,6 @@ RUN --mount=type=tmpfs,target=/webkitbuild \
/webkit && \
cmake --build /webkitbuild --config ${WEBKIT_RELEASE_TYPE} --target jsc --target testFFI && \
python3 /webkit/Tools/Scripts/check-classinfo-uniqueness.py $WEBKIT_OUT_DIR/bin/jsc && \
node --experimental-strip-types /webkit/Tools/Scripts/dump-bytecode-cache-layout.ts /webkitbuild > /output/bytecode-cache-layout.txt && \
cp -r $WEBKIT_OUT_DIR/lib/*.a /output/lib && \
cp $WEBKIT_OUT_DIR/*.h /output/include && \
cp -r $WEBKIT_OUT_DIR/bin /output/bin && \
Expand Down
1 change: 0 additions & 1 deletion Dockerfile.macos
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ RUN --mount=type=tmpfs,target=/webkitbuild \
/webkit && \
cmake --build /webkitbuild --config ${WEBKIT_RELEASE_TYPE} --target jsc --target testFFI && \
python3 /webkit/Tools/Scripts/check-classinfo-uniqueness.py $WEBKIT_OUT_DIR/bin/jsc && \
bun /webkit/Tools/Scripts/dump-bytecode-cache-layout.ts /webkitbuild > /output/bytecode-cache-layout.txt && \
# -L everywhere: WebKit's cmake stages the WTF/bmalloc framework headers
# as *symlinks* into the source tree when the host filesystem supports
# them. Copied verbatim they'd dangle outside this container (pointing at
Expand Down
3 changes: 1 addition & 2 deletions Dockerfile.musl
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ ARG DEFAULT_CFLAGS
ARG USE_MIMALLOC
ARG USE_EXTERNAL_MIMALLOC

RUN apk add --no-cache cpio curl file gnupg ninja nodejs ruby ruby-getoptlong unzip rsync perl python3 openssl-dev openssl linux-headers
RUN apk add --no-cache cpio curl file gnupg ninja ruby ruby-getoptlong unzip rsync perl python3 openssl-dev openssl linux-headers

ENV WEBKIT_OUT_DIR=/webkitbuild
# These are unnecessary on musl
Expand Down Expand Up @@ -143,7 +143,6 @@ RUN --mount=type=tmpfs,target=/webkitbuild \
cd /webkitbuild && \
cmake --build /webkitbuild --config ${WEBKIT_RELEASE_TYPE} --target "jsc" --target "testFFI" && \
python3 /webkit/Tools/Scripts/check-classinfo-uniqueness.py $WEBKIT_OUT_DIR/bin/jsc && \
node --experimental-strip-types /webkit/Tools/Scripts/dump-bytecode-cache-layout.ts /webkitbuild > /output/bytecode-cache-layout.txt && \
cp -r $WEBKIT_OUT_DIR/lib/*.a /output/lib && \
cp $WEBKIT_OUT_DIR/*.h /output/include && \
cp -r $WEBKIT_OUT_DIR/bin /output/bin && \
Expand Down
3 changes: 0 additions & 3 deletions Dockerfile.windows
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,6 @@ ARG USE_MIMALLOC
ARG USE_EXTERNAL_MIMALLOC

COPY --from=build_icu /icu-out /icu-out
COPY --from=build_icu /usr/local/bin/node /usr/local/bin/node
COPY . /webkit
WORKDIR /webkit

Expand Down Expand Up @@ -412,11 +411,9 @@ RUN --mount=type=tmpfs,target=/webkitbuild \
"-DCMAKE_CXX_FLAGS_RELEASE=/O2 /Ob2 /DNDEBUG ${LTO_FLAG}" \
"-DCMAKE_C_FLAGS_DEBUG=/FS /O0 /Ob0" \
"-DCMAKE_CXX_FLAGS_DEBUG=/FS /O0 /Ob0" \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-G Ninja \
/webkit && \
cmake --build /webkitbuild --config ${WEBKIT_RELEASE_TYPE} --target jsc --target testFFI && \
mkdir -p /output && node --experimental-strip-types /webkit/Tools/Scripts/dump-bytecode-cache-layout.ts /webkitbuild > /output/bytecode-cache-layout.txt && \
\
mkdir -p /output/lib /output/include/JavaScriptCore /output/include/wtf /output/include/bmalloc && \
cp -rL $WEBKIT_OUT_DIR/lib/* /output/lib/ && \
Expand Down
4 changes: 4 additions & 0 deletions Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1694,6 +1694,10 @@ RegisterID* BytecodeGenerator::addConstantValue(JSValue v, SourceCodeRepresentat

if (sourceCodeRepresentation == SourceCodeRepresentation::Double && v.isInt32())
v = jsDoubleNumber(v.asNumber());
// A NaN the parser folded (0 / 0) has whatever bits this CPU's arithmetic produces (the sign differs between x86 and
// ARM); the constant, and so the bytecode, should not depend on that.
if (v.isDouble() && std::isnan(v.asDouble()))
v = jsNaN();
EncodedJSValueWithRepresentation valueMapKey { JSValue::encode(v), sourceCodeRepresentation };
JSValueMap::AddResult result = m_jsValueMap.add(valueMapKey, m_nextConstantOffset);
if (result.isNewEntry) {
Expand Down
Loading
Loading