aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AUTHORS2
-rw-r--r--em++.bat2
-rw-r--r--em-config.bat2
-rw-r--r--emar.bat2
-rwxr-xr-xemcc60
-rw-r--r--emcc.bat2
-rw-r--r--emconfigure.bat2
-rw-r--r--emlibtool.bat2
-rw-r--r--emmake.bat2
-rw-r--r--emranlib.bat2
-rwxr-xr-xemscripten.py86
-rw-r--r--src/compiler.js3
-rw-r--r--src/headless.js703
-rw-r--r--src/headlessCanvas.js618
-rw-r--r--src/jsifier.js83
-rw-r--r--src/library.js28
-rw-r--r--src/library_browser.js24
-rw-r--r--src/library_fs.js12
-rw-r--r--src/library_glut.js26
-rw-r--r--src/library_memfs.js51
-rw-r--r--src/library_openal.js33
-rw-r--r--src/library_sdl.js51
-rw-r--r--src/parseTools.js28
-rw-r--r--src/postamble.js8
-rw-r--r--src/preamble.js1
-rw-r--r--src/relooper/Relooper.cpp82
-rw-r--r--src/relooper/Relooper.h5
-rw-r--r--src/relooper/emscripten/glue.js11
-rw-r--r--src/relooper/fuzzer.py29
-rw-r--r--src/relooper/test.cpp100
-rw-r--r--src/relooper/test.txt177
-rw-r--r--src/relooper/test2.c26
-rw-r--r--src/relooper/test2.txt20
-rw-r--r--src/relooper/test3.c14
-rw-r--r--src/relooper/test3.txt43
-rw-r--r--src/relooper/test4.cpp14
-rw-r--r--src/relooper/test4.txt35
-rw-r--r--src/relooper/test5.cpp12
-rw-r--r--src/relooper/test5.txt44
-rw-r--r--src/relooper/test6.cpp8
-rw-r--r--src/relooper/test6.txt20
-rw-r--r--src/relooper/test_dead.cpp4
-rw-r--r--src/relooper/test_debug.cpp8
-rw-r--r--src/relooper/test_debug.txt20
-rw-r--r--src/relooper/test_fuzz1.cpp18
-rw-r--r--src/relooper/test_fuzz1.txt50
-rw-r--r--src/relooper/test_fuzz2.cpp8
-rw-r--r--src/relooper/test_fuzz2.txt19
-rw-r--r--src/relooper/test_fuzz3.cpp10
-rw-r--r--src/relooper/test_fuzz3.txt16
-rw-r--r--src/relooper/test_fuzz4.cpp10
-rw-r--r--src/relooper/test_fuzz4.txt28
-rw-r--r--src/relooper/test_fuzz5.cpp20
-rw-r--r--src/relooper/test_fuzz5.txt64
-rw-r--r--src/relooper/test_fuzz6.cpp184
-rw-r--r--src/relooper/test_fuzz6.txt219
-rw-r--r--src/relooper/test_inf.cpp368
-rw-r--r--src/relooper/test_inf.txt1410
-rw-r--r--src/runtime.js40
-rw-r--r--src/settings.js22
-rw-r--r--src/shell.html2
-rw-r--r--system/include/emscripten/emscripten.h16
-rw-r--r--tests/aniso.c1
-rw-r--r--tests/cubegeom_color.c1
-rw-r--r--tests/cubegeom_pre.c1
-rw-r--r--tests/cubegeom_pre2.c1
-rw-r--r--tests/cubegeom_pre2_vao.c1
-rw-r--r--tests/cubegeom_pre2_vao2.c1
-rw-r--r--tests/cubegeom_pre3.c1
-rw-r--r--tests/cubegeom_pre_vao.c1
-rw-r--r--tests/cubegeom_texturematrix.c1
-rw-r--r--tests/float_tex.cpp2
-rw-r--r--tests/gl_matrix_identity.c1
-rw-r--r--tests/glshaderinfo.cpp2
-rw-r--r--tests/glut_touchevents.c64
-rw-r--r--tests/http.h1
-rw-r--r--tests/pthread/specific.c60
-rw-r--r--tests/pthread/specific.c.txt8
-rwxr-xr-xtests/runner.py1
-rw-r--r--tests/s3tc.c1
-rw-r--r--tests/s3tc_crunch.c1
-rw-r--r--tests/sdl_canvas.c11
-rw-r--r--tests/sdl_headless.c65
-rw-r--r--tests/sdl_image_prepare_data.c2
-rw-r--r--tests/sdl_pumpevents.c16
-rw-r--r--tests/sockets/test_enet_client.c2
-rw-r--r--tests/sockets/test_sockets_echo_server.c2
-rw-r--r--tests/sockets/test_sockets_partial_server.c5
-rw-r--r--tests/sockets/test_sockets_select_server_down_client.c (renamed from tests/sockets/test_sockets_select_server_no_accept_client.c)0
-rw-r--r--tests/sockets/test_sockets_select_server_down_server.c (renamed from tests/sockets/test_sockets_select_server_no_accept_server.c)41
-rw-r--r--tests/test_browser.py23
-rw-r--r--tests/test_core.py149
-rw-r--r--tests/test_other.py29
-rw-r--r--tests/test_sanity.py27
-rw-r--r--tests/test_sockets.py9
-rw-r--r--tests/tex_nonbyte.c1
-rw-r--r--tests/unistd/misc.out7
-rw-r--r--tools/file_packager.py107
-rw-r--r--tools/js-optimizer.js95
-rw-r--r--tools/js_optimizer.py4
-rw-r--r--tools/jsrun.py2
-rw-r--r--tools/shared.py2
-rw-r--r--tools/test-js-optimizer-asm-outline1-output.js136
-rw-r--r--tools/test-js-optimizer-asm-outline1.js48
104 files changed, 4030 insertions, 1912 deletions
diff --git a/AUTHORS b/AUTHORS
index 5161f7ad..59eb27d3 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -93,4 +93,6 @@ a license to everyone to use it as detailed in LICENSE.)
* Yu Kobayashi <yukoba@accelart.jp>
* Pin Zhang <zhangpin04@gmail.com>
* Nick Bray <ncbray@chromium.org> (copyright owned by Google, Inc.)
+* Aidan Hobson Sayers <aidanhs@cantab.net>
+* Charlie Birks <admin@daftgames.net>
diff --git a/em++.bat b/em++.bat
index b639ff29..e486fcea 100644
--- a/em++.bat
+++ b/em++.bat
@@ -1,2 +1,2 @@
@echo off
-python %~dp0\em++ %* \ No newline at end of file
+python "%~dp0\em++" %* \ No newline at end of file
diff --git a/em-config.bat b/em-config.bat
index 63b15ea4..52d1af0e 100644
--- a/em-config.bat
+++ b/em-config.bat
@@ -1,2 +1,2 @@
@echo off
-python %~dp0\em-config %* \ No newline at end of file
+python "%~dp0\em-config" %* \ No newline at end of file
diff --git a/emar.bat b/emar.bat
index 2cfb0850..9ebc2d41 100644
--- a/emar.bat
+++ b/emar.bat
@@ -1,2 +1,2 @@
@echo off
-python %~dp0\emar %* \ No newline at end of file
+python "%~dp0\emar" %* \ No newline at end of file
diff --git a/emcc b/emcc
index df2ef38c..a07ce4f1 100755
--- a/emcc
+++ b/emcc
@@ -1577,6 +1577,35 @@ try:
js_transform_tempfiles = [final]
+ if memory_init_file:
+ if shared.Settings.USE_TYPED_ARRAYS != 2:
+ if type(memory_init_file) == int: logging.warning('memory init file requires typed arrays mode 2')
+ else:
+ memfile = target + '.mem'
+ shared.try_delete(memfile)
+ def repl(m):
+ # handle chunking of the memory initializer
+ s = re.sub('[\[\]\n\(\)\. ]', '', m.groups(0)[0])
+ s = s.replace('concat', ',')
+ if s[-1] == ',': s = s[:-1]
+ open(memfile, 'wb').write(''.join(map(lambda x: chr(int(x or '0')), s.split(','))))
+ if DEBUG:
+ # Copy into temp dir as well, so can be run there too
+ temp_memfile = os.path.join(shared.EMSCRIPTEN_TEMP_DIR, os.path.basename(memfile))
+ if os.path.abspath(memfile) != os.path.abspath(memfile):
+ shutil.copyfile(memfile, temp_memfile)
+ return 'loadMemoryInitializer("%s");' % os.path.basename(memfile)
+ src = re.sub(shared.JS.memory_initializer_pattern, repl, open(final).read(), count=1)
+ open(final + '.mem.js', 'w').write(src)
+ final += '.mem.js'
+ js_transform_tempfiles[-1] = final # simple text substitution preserves comment line number mappings
+ if DEBUG:
+ if os.path.exists(memfile):
+ save_intermediate('meminit')
+ logging.debug('wrote memory initialization to %s' % memfile)
+ else:
+ logging.debug('did not see memory initialization')
+
# It is useful to run several js optimizer passes together, to save on unneeded unparsing/reparsing
js_optimizer_queue = []
js_optimizer_extra_info = {}
@@ -1631,7 +1660,7 @@ try:
if DEBUG: save_intermediate('closure')
if js_opts:
- if shared.Settings.OUTLINING_LIMIT > 0:
+ if shared.Settings.OUTLINING_LIMIT > 0 and shared.Settings.ASM_JS:
js_optimizer_queue += ['outline']
js_optimizer_extra_info['sizeToOutline'] = shared.Settings.OUTLINING_LIMIT
@@ -1654,35 +1683,6 @@ try:
src = re.sub(r'\n+[ \n]*\n+', '\n', src)
open(final, 'w').write(src)
- if memory_init_file:
- if shared.Settings.USE_TYPED_ARRAYS != 2:
- if type(memory_init_file) == int: logging.warning('memory init file requires typed arrays mode 2')
- else:
- memfile = target + '.mem'
- shared.try_delete(memfile)
- def repl(m):
- # handle chunking of the memory initializer
- s = re.sub('[\[\]\n\(\)\. ]', '', m.groups(0)[0])
- s = s.replace('concat', ',')
- if s[-1] == ',': s = s[:-1]
- open(memfile, 'wb').write(''.join(map(lambda x: chr(int(x or '0')), s.split(','))))
- if DEBUG:
- # Copy into temp dir as well, so can be run there too
- temp_memfile = os.path.join(shared.EMSCRIPTEN_TEMP_DIR, os.path.basename(memfile))
- if os.path.abspath(memfile) != os.path.abspath(memfile):
- shutil.copyfile(memfile, temp_memfile)
- return 'loadMemoryInitializer("%s");' % os.path.basename(memfile)
- src = re.sub(shared.JS.memory_initializer_pattern, repl, src, count=1)
- open(final + '.mem.js', 'w').write(src)
- final += '.mem.js'
- js_transform_tempfiles[-1] = final # simple text substitution preserves comment line number mappings
- if DEBUG:
- if os.path.exists(memfile):
- save_intermediate('meminit')
- logging.debug('wrote memory initialization to %s' % memfile)
- else:
- logging.debug('did not see memory initialization')
-
def generate_source_map(map_file_base_name, offset=0):
jsrun.run_js(shared.path_from_root('tools', 'source-maps', 'sourcemapper.js'),
shared.NODE_JS, js_transform_tempfiles +
diff --git a/emcc.bat b/emcc.bat
index 2cb3a3e1..e1ca45c7 100644
--- a/emcc.bat
+++ b/emcc.bat
@@ -1,2 +1,2 @@
@echo off
-python %~dp0\emcc %* \ No newline at end of file
+python "%~dp0\emcc" %* \ No newline at end of file
diff --git a/emconfigure.bat b/emconfigure.bat
index f900f407..651ccf05 100644
--- a/emconfigure.bat
+++ b/emconfigure.bat
@@ -1,2 +1,2 @@
@echo off
-python %~dp0\emconfigure %* \ No newline at end of file
+python "%~dp0\emconfigure" %* \ No newline at end of file
diff --git a/emlibtool.bat b/emlibtool.bat
index 76ce48c3..4ea705be 100644
--- a/emlibtool.bat
+++ b/emlibtool.bat
@@ -1,2 +1,2 @@
@echo off
-python %~dp0\emlibtool %* \ No newline at end of file
+python "%~dp0\emlibtool" %* \ No newline at end of file
diff --git a/emmake.bat b/emmake.bat
index 2db09d07..a86ba6e2 100644
--- a/emmake.bat
+++ b/emmake.bat
@@ -1,2 +1,2 @@
@echo off
-python %~dp0\emmake %* \ No newline at end of file
+python "%~dp0\emmake" %* \ No newline at end of file
diff --git a/emranlib.bat b/emranlib.bat
index 69bf8aa4..a8af4ef7 100644
--- a/emranlib.bat</