This repository has been archived by the owner on Aug 29, 2023. It is now read-only.
forked from bytecodealliance/spidermonkey-wasi-embedding
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pull in weval branch of SpiderMonkey and add build. (#17)
This pulls in a new bytecodealliance/gecko-dev commit hash with weval support, and produces a new separate build of the engine with intrinsics added so that we can apply the [weval](https://github.com/cfallin/weval) tool to obtain speedups with AOT compilation/specialization. This is a re-do of #5, but with fixes from bytecodealliance/gecko-dev#5 applied. --------- Co-authored-by: Jake Champion <jchampion@fastly.com>
- Loading branch information
1 parent
53b00f7
commit 5ff4d4b
Showing
10 changed files
with
120 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
|
||
true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
https://github.com/bytecodealliance/gecko-dev | ||
https://github.com/bytecodealliance/gecko-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
69d3daaa3aa4589ac8e60a94c7c7e0592882d272 | ||
d29fd604c983d7267a322af9a7e1552debcc659f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
ac_add_options --enable-project=js | ||
ac_add_options --enable-application=js | ||
ac_add_options --target=wasm32-unknown-wasi | ||
ac_add_options --without-system-zlib | ||
ac_add_options --without-intl-api | ||
ac_add_options --disable-jit | ||
ac_add_options --disable-shared-js | ||
ac_add_options --disable-shared-memory | ||
ac_add_options --disable-tests | ||
ac_add_options --disable-clang-plugin | ||
ac_add_options --enable-jitspew | ||
ac_add_options --enable-optimize | ||
ac_add_options --enable-js-streams |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ac_add_options --enable-js-interp-native-callstack | ||
ac_add_options --enable-js-interp-specialization | ||
ac_add_options --enable-js-interp-weval |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,83 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
set -x | ||
|
||
working_dir="$(pwd)" | ||
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
|
||
mode="${1:-release}" | ||
mozconfig="${working_dir}/mozconfig-${mode}" | ||
objdir="obj-$mode" | ||
outdir="$mode" | ||
|
||
cat << EOF > "$mozconfig" | ||
ac_add_options --enable-project=js | ||
ac_add_options --enable-application=js | ||
ac_add_options --target=wasm32-unknown-wasi | ||
ac_add_options --without-system-zlib | ||
ac_add_options --without-intl-api | ||
ac_add_options --disable-jit | ||
ac_add_options --disable-shared-js | ||
ac_add_options --disable-shared-memory | ||
ac_add_options --disable-tests | ||
ac_add_options --disable-clang-plugin | ||
ac_add_options --enable-jitspew | ||
ac_add_options --enable-optimize | ||
ac_add_options --enable-js-streams | ||
ac_add_options --prefix=${working_dir}/${objdir}/dist | ||
mk_add_options MOZ_OBJDIR=${working_dir}/${objdir} | ||
mk_add_options AUTOCLOBBER=1 | ||
EOF | ||
|
||
target="$(uname)" | ||
case "$target" in | ||
Linux) | ||
echo "ac_add_options --disable-stdcxx-compat" >> "$mozconfig" | ||
;; | ||
|
||
Darwin) | ||
echo "ac_add_options --host=aarch64-apple-darwin" >> "$mozconfig" | ||
;; | ||
|
||
*) | ||
echo "Unsupported build target: $target" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
case "$mode" in | ||
release) | ||
echo "ac_add_options --disable-debug" >> "$mozconfig" | ||
;; | ||
|
||
debug) | ||
echo "ac_add_options --enable-debug" >> "$mozconfig" | ||
;; | ||
|
||
*) | ||
echo "Unknown build type: $mode" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
# Build SpiderMonkey for WASI | ||
MOZCONFIG="${mozconfig}" \ | ||
MOZ_FETCHES_DIR=~/.mozbuild \ | ||
CC=~/.mozbuild/clang/bin/clang \ | ||
python3 "${working_dir}/gecko-dev/mach" \ | ||
--no-interactive \ | ||
build | ||
|
||
# Copy header, object, and static lib files | ||
rm -rf "$outdir" | ||
mkdir -p "$outdir/lib" | ||
|
||
cd "$objdir" | ||
cp -Lr dist/include "../$outdir" | ||
|
||
while read -r file; do | ||
cp "$file" "../$outdir/lib" | ||
done < "$script_dir/object-files.list" | ||
variant="${2:-weval}" | ||
|
||
cp js/src/build/libjs_static.a "wasm32-wasi/${mode}/libjsrust.a" "../$outdir/lib" | ||
exec `dirname $0`/build-engine.sh $mode $variant rebuild |