Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] DOM API #49

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sudo: required
services:
- docker
before_install:
- docker run -dit --name emscripten -v $(pwd):/src trzeci/emscripten:sdk-incoming-64bit bash
- docker run -dit --name emscripten -v $(pwd):/src emscripten/emsdk bash
script:
- npm install --ignore-scripts
- docker exec -it emscripten make
Expand Down
24 changes: 11 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ FILES = \
src/cpp/asm-dom.cpp \
src/cpp/asm-dom-server.cpp

BC = compiled/asm-dom.bc

CFLAGS = \
-O3 \
--bind \
Expand All @@ -56,7 +54,6 @@ WASM_OPTIONS = \
--llvm-lto 3 \
--llvm-opts 3 \
--js-opts 1 \
--closure 1 \
-s ENVIRONMENT=node \
-s MODULARIZE=1 \
-s ALLOW_MEMORY_GROWTH=1 \
Expand All @@ -66,8 +63,7 @@ WASM_OPTIONS = \
-s NO_FILESYSTEM=1 \
-s DISABLE_EXCEPTION_CATCHING=2 \
-s BINARYEN=1 \
-s EXPORTED_RUNTIME_METHODS=[\'UTF8ToString\'] \
-s BINARYEN_TRAP_MODE=\'allow\'
-s EXPORTED_RUNTIME_METHODS=[\'UTF8ToString\']

ASMJS_OPTIONS = \
-O3 \
Expand All @@ -76,7 +72,6 @@ ASMJS_OPTIONS = \
--llvm-lto 3 \
--llvm-opts 3 \
--js-opts 1 \
--closure 1 \
-s ENVIRONMENT=node \
-s MODULARIZE=1 \
-s AGGRESSIVE_VARIABLE_ELIMINATION=1 \
Expand Down Expand Up @@ -108,7 +103,7 @@ test_js:
npx cross-env BABEL_ENV=commonjs TEST_ENV=node mocha --require babel-register test/js/toHTML.spec.js
npx cross-env BABEL_ENV=commonjs nyc --require babel-register mocha --recursive

build: compiled/asm-dom.a $(BC) compiled/asm-dom.o $(COMPILEDASMJS)/asm-dom.asm.js $(COMPILEDWASM)/asm-dom.js $(TESTCPP) $(LIBS) $(ES) $(UMDJS)
build: $(COMPILED)/asm-dom.a $(COMPILEDASMJS)/asm-dom.asm.js $(COMPILEDWASM)/asm-dom.js $(TESTCPP) $(LIBS) $(ES) $(UMDJS)
npx ncp $(SRCDIR)/cpp $(CPPDIR)

$(TESTCPP): $(SRCSCPP) $(TEST_FILES)
Expand All @@ -121,24 +116,27 @@ $(TESTCPP): $(SRCSCPP) $(TEST_FILES)
-o $@

.SECONDEXPANSION:
$(COMPILED)/asm-dom.%: $(SRCSCPP) | $$(@D)
$(COMPILED)/asm-dom.a: $(SRCSCPP) | $$(@D)
emcc \
-DASMDOM_JS_SIDE \
$(CFLAGS) \
$(FILES) \
src/js/index.cpp \
-o $@

$(COMPILEDASMJS)/asm-dom.asm.js: $(BC) | $$(@D)
$(COMPILEDASMJS)/asm-dom.asm.js: $(FILES) | $$(@D)
emcc \
-DASMDOM_JS_SIDE \
$(ASMJS_OPTIONS) \
$(BC) \
$(FILES) \
src/js/index.cpp \
-o $@

$(COMPILEDWASM)/asm-dom.js: $(BC) | $$(@D)
$(COMPILEDWASM)/asm-dom.js: $(FILES) | $$(@D)
emcc \
-DASMDOM_JS_SIDE \
$(WASM_OPTIONS) \
$(BC) \
$(FILES) \
src/js/index.cpp \
-o $@

$(ESDIR)/%: $(SRCDIR)/% | $$(@D)
Expand Down
Binary file removed benchmarks/compiled/app.bc
Binary file not shown.
Binary file modified benchmarks/compiled/app.o
Binary file not shown.
83 changes: 14 additions & 69 deletions benchmarks/compiled/asmjs/app.asm.js

Large diffs are not rendered by default.

62 changes: 3 additions & 59 deletions benchmarks/compiled/wasm/app.js

Large diffs are not rendered by default.

Binary file modified benchmarks/compiled/wasm/app.wasm
100644 → 100755
Binary file not shown.
Loading