Skip to content

Commit e58a662

Browse files
committed
Update
1 parent f78d6bc commit e58a662

5 files changed

Lines changed: 94 additions & 20 deletions

File tree

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
emsdk-portable/
2-
cmake*
31
node_modules/
42
npm-debug.*
3+
rebuild.*

.travis.yml

Lines changed: 76 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,76 @@
1-
dist: trusty
2-
language: node_js
3-
install:
4-
- wget -qO- https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz | tar xvz
5-
- wget -qO- https://cmake.org/files/v3.9/cmake-3.9.0-rc2-Linux-x86_64.tar.gz | tar xvz && ln -s cmake-3.9.0-rc2-Linux-x86_64 cmake
6-
- export PATH=$(pwd)/cmake/bin:$PATH
7-
- ./emsdk-portable/emsdk install sdk-incoming-64bit
8-
script:
9-
- ./emsdk-portable/emsdk activate sdk-incoming-64bit
10-
- ./binaryen/build-js.sh && cp ./binaryen/bin/binaryen.js ./index.js
11-
# TODO: update version and publish to npm
1+
language: cpp
2+
dist: trusty # Note that a trusty instance is limited to 2 cores, max. 4 gb of memory and 20 gb of hard disk space.
3+
compiler: clang-5.0
4+
addons:
5+
apt:
6+
sources:
7+
- llvm-toolchain-trusty
8+
packages:
9+
- clang-5.0
10+
- lld-5.0
11+
git:
12+
submodules: false
13+
cache:
14+
ccache: true
15+
directories:
16+
- $HOME/.emscripten_cache
17+
notifications:
18+
email:
19+
on_failure: change
20+
env:
21+
global:
22+
- MAKEFLAGS="-j2"
23+
- CFLAGS="-Qunused-arguments -fcolor-diagnostics -fuse-ld=lld-5.0 -O0"
24+
- CXXFLAGS="-Qunused-arguments -fcolor-diagnostics -fuse-ld=lld-5.0 -O0"
25+
- CCACHE_SLOPPINESS="pch_defines,time_macros"
26+
- CCACHE_COMPRESS=1
27+
- CCACHE_HARDLINK=1
28+
- CCACHE_MAXSIZE="256m"
29+
- EMSDK="$HOME/emsdk-portable"
30+
- EMSCRIPTEN="$EMSDK/emscripten/incoming"
31+
- PATH="$HOME/cmake-3.8.2-Linux-x86_64/bin:$EMSDK:$PATH"
32+
- GIT_NAME="Travis CI"
33+
- GIT_EMAIL="travis@travis-ci.org"
34+
35+
install: # install a recent cmake and emsdk-portable
36+
- wget --no-check-certificate -qO- https://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.tar.gz | tar -xzC $HOME &&
37+
wget --no-check-certificate -qO- https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz | tar -xzC $HOME
38+
39+
before_script: # setup emscripten
40+
- ccache -z -M ${CCACHE_MAXSIZE} &&
41+
ccache -s
42+
- export CC="ccache clang-5.0" &&
43+
export CXX="ccache clang++-5.0" &&
44+
export LD="ld.lld-5.0" &&
45+
export RC=1 &&
46+
timeout 40m emsdk install -j2 --build=Release --disable-assertions clang-incoming-64bit &&
47+
emsdk install -j2 emscripten-incoming-64bit &&
48+
emsdk install node-4.1.1-64bit > /dev/null &&
49+
emsdk activate --build=Release clang-incoming-64bit &&
50+
emsdk activate emscripten-incoming-64bit &&
51+
emsdk activate node-4.1.1-64bit &&
52+
git submodule update --init --remote --merge;
53+
export RC=$?;
54+
$(exit 0)
55+
56+
script: # build binaryen.js
57+
- if [ $RC -eq 0 ]; then
58+
source $EMSDK/emsdk_env.sh &&
59+
cd ./binaryen &&
60+
./build-js.sh &&
61+
cp ./bin/binaryen.js ../index.js &&
62+
cd ..;
63+
else
64+
$(exit $RC);
65+
fi
66+
67+
before_cache:
68+
- ccache -s
69+
70+
after_success: # push back to github
71+
- git checkout master &&
72+
git config credential.helper "store --file=.git/credentials" &&
73+
echo "https://${GH_TOKEN}:@github.com" > .git/credentials &&
74+
git add ./index.js &&
75+
git commit -m "Travis CI build ${TRAVIS_BUILD_NUMBER} [travis skip]" &&
76+
git push -u origin master

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
binaryen
2-
========
1+
[![Build Status](https://travis-ci.org/dcodeIO/binaryen.js.svg?branch=master)](https://travis-ci.org/dcodeIO/binaryen.js)
32

4-
Compiler infrastructure and toolchain library for WebAssembly.
3+
binaryen.js
4+
===========
55

6-
Overview
7-
--------
6+
**binaryen.js** is a port of [Binaryen](https://github.com/WebAssembly/binaryen) to the Web, allowing you to generate WebAssembly using a JavaScript API.
87

9-
binaryen.js is a port of [Binaryen](https://github.com/WebAssembly/binaryen) to the Web, allowing you to generate WebAssembly using a JavaScript API.
8+
```
9+
$> npm install binaryen
10+
```
1011

1112
The API is documented in the rest of this document.
1213

binaryen

Submodule binaryen updated 154 files

index.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,14 @@ declare module binaryen {
240240

241241
}
242242

243+
class Relooper {
244+
addBlock(expression: Expression): RelooperBlock;
245+
addBranch(from: RelooperBlock, to: RelooperBlock, condition: Expression, code: Expression): void;
246+
addBlockWithSwitch(code: Expression, condition: Expression): RelooperBlock;
247+
addBranchForSwitch(from: RelooperBlock, to: RelooperBlock, indexes: number[], code: Expression): void;
248+
renderAndDispose(entry: RelooperBlock, labelHelper: number, module: Module): Expression;
249+
}
250+
243251
function readBinary(data: Uint8Array): Module;
244252

245253
// These are actually pointers internally
@@ -252,6 +260,7 @@ declare module binaryen {
252260
abstract class I64Expression extends Expression {}
253261
abstract class F32Expression extends Expression {}
254262
abstract class F64Expression extends Expression {}
263+
abstract class RelooperBlock {}
255264
}
256265

257266
export = binaryen;

0 commit comments

Comments
 (0)