aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-05-24 10:13:42 +0200
committerAlon Zakai <alonzakai@gmail.com>2012-05-24 10:13:42 +0200
commita6d312ccb942b50287777fc22dc69de926ea3412 (patch)
tree0acabef2e78a97e7cd1742b9d98acb2a1b496e72
parentc3570e254952ba0593038993674473e900ada9e0 (diff)
parentb7ce870dd4b1352e308e212e77cd6161c1ec904e (diff)
Merge branch 'master' into llvmsvn
-rw-r--r--AUTHORS2
-rwxr-xr-xem-config24
-rwxr-xr-xemcc53
-rwxr-xr-xemscripten.py2
-rw-r--r--settings.py2
-rw-r--r--src/analyzer.js128
-rw-r--r--src/compiler.js2
-rw-r--r--src/experimental/stringCache.diff147
-rw-r--r--src/intertyper.js4
-rw-r--r--src/jsifier.js47
-rw-r--r--src/library.js183
-rw-r--r--src/library_browser.js314
-rw-r--r--src/library_gc.js165
-rw-r--r--src/library_gl.js1114
-rw-r--r--src/library_glut.js20
-rw-r--r--src/library_sdl.js324
-rw-r--r--src/modules.js2
-rw-r--r--src/parseTools.js52
-rw-r--r--src/postamble.js46
-rw-r--r--src/preamble.js7
-rw-r--r--src/runtime.js71
-rw-r--r--src/settings.js21
-rw-r--r--src/shell.html48
-rw-r--r--src/utility.js4
-rw-r--r--system/include/emscripten.h35
-rw-r--r--system/include/features.h3
-rw-r--r--system/include/gc.h50
-rw-r--r--system/include/libc/sys/types.h8
-rw-r--r--system/include/net/netinet/in.h5
-rw-r--r--system/include/net/netinet/tcp.h246
-rw-r--r--system/include/sys/socket.h5
-rw-r--r--system/include/sys/socketvar.h3
-rw-r--r--system/lib/libcxx/Makefile1
-rw-r--r--tests/browser_gc.cpp96
-rw-r--r--tests/cases/phientryimplicitmoar.ll28
-rw-r--r--tests/cases/phientryimplicitmoar.txt6
-rw-r--r--tests/cases/phinonexist.ll25
-rw-r--r--tests/cube_explosion.c235
-rw-r--r--tests/cubegeom.c295
-rw-r--r--tests/cubegeom_color.c295
-rw-r--r--tests/cubegeom_color2.c299
-rw-r--r--tests/cubegeom_mt.c300
-rw-r--r--tests/cubegeom_normal.c295
-rw-r--r--tests/cubegeom_pre.c307
-rw-r--r--tests/cubegeom_pre2.c348
-rw-r--r--tests/cubegeom_pre3.c348
-rw-r--r--tests/cubegeom_texturematrix.c312
-rw-r--r--tests/emscripten_api_browser.cpp38
-rw-r--r--tests/gl_ps.c230
-rw-r--r--tests/gl_ps.pngbin0 -> 203535 bytes
-rw-r--r--tests/hello_world_gles.c63
-rw-r--r--tests/msvc10/README.txt5
-rw-r--r--tests/msvc10/dlmalloc_test.vcxproj89
-rw-r--r--tests/msvc10/emscripten_api_browser.vcxproj89
-rw-r--r--tests/msvc10/fannkuch.vcxproj89
-rw-r--r--tests/msvc10/fasta.vcxproj89
-rw-r--r--tests/msvc10/files.vcxproj89
-rw-r--r--tests/msvc10/glbook_10_MultiTexture.vcxproj110
-rw-r--r--tests/msvc10/glbook_11_Multisample.vcxproj106
-rw-r--r--tests/msvc10/glbook_11_Stencil_Test.vcxproj106
-rw-r--r--tests/msvc10/glbook_13_ParticleSystem.vcxproj109
-rw-r--r--tests/msvc10/glbook_15_Hello_Triangle_KD.vcxproj106
-rw-r--r--tests/msvc10/glbook_2_Hello_Triangle.vcxproj106
-rw-r--r--tests/msvc10/glbook_8_Simple_VertexShader.vcxproj106
-rw-r--r--tests/msvc10/glbook_9_MipMap2D.vcxproj106
-rw-r--r--tests/msvc10/glbook_9_Simple_Texture2D.vcxproj106
-rw-r--r--tests/msvc10/glbook_9_Simple_TextureCubemap.vcxproj106
-rw-r--r--tests/msvc10/glbook_9_TextureWrap.vcxproj106
-rw-r--r--tests/msvc10/hashtest.vcxproj89
-rw-r--r--tests/msvc10/hello_libcxx.vcxproj89
-rw-r--r--tests/msvc10/hello_malloc.vcxproj89
-rw-r--r--tests/msvc10/hello_world_c.vcxproj89
-rw-r--r--tests/msvc10/hello_world_cpp.vcxproj89
-rw-r--r--tests/msvc10/hello_world_file.vcxproj89
-rw-r--r--tests/msvc10/hello_world_gles.vcxproj89
-rw-r--r--tests/msvc10/hello_world_loop.vcxproj89
-rw-r--r--tests/msvc10/hello_world_loop_malloc.vcxproj89
-rw-r--r--tests/msvc10/hello_world_sdl.vcxproj89
-rw-r--r--tests/msvc10/new.vcxproj89
-rw-r--r--tests/msvc10/raytrace.vcxproj89
-rw-r--r--tests/msvc10/sdl_audio.vcxproj89
-rw-r--r--tests/msvc10/sdl_canvas.vcxproj89
-rw-r--r--tests/msvc10/sdl_gl_read.vcxproj89
-rw-r--r--tests/msvc10/sdl_image.vcxproj89
-rw-r--r--tests/msvc10/sdl_key.vcxproj89
-rw-r--r--tests/msvc10/sdl_mouse.vcxproj89
-rw-r--r--tests/msvc10/sdl_ogl.vcxproj89
-rw-r--r--tests/msvc10/skinning_test_no_simd.vcxproj89
-rw-r--r--tests/msvc10/tests_msvc10.sln286
-rw-r--r--tests/msvc10/tests_msvc10.vcxproj67
-rw-r--r--tests/msvc10/twopart.vcxproj90
-rw-r--r--tests/pre_run_deps.cpp10
-rwxr-xr-xtests/runner.py404
-rw-r--r--tests/screenshot-gray-purple.pngbin0 -> 242425 bytes
-rw-r--r--tests/sdl_audio.c16
-rw-r--r--tests/sdl_image.c26
-rw-r--r--tests/sdl_key.c17
-rw-r--r--tests/sdl_mouse.c10
-rw-r--r--tests/sdl_ogl.c22
-rw-r--r--tests/sdl_ogl_defaultMatrixMode.c176
-rw-r--r--tests/sdl_ogl_p.c8
-rw-r--r--tests/sdlglshader.c153
-rw-r--r--tests/sdlglshader.pngbin0 -> 36299 bytes
-rw-r--r--tests/sha1.c241
-rw-r--r--tests/sqlite/benchmark.c1
-rw-r--r--tests/sqlite/benchmark.txt2
-rwxr-xr-xthird_party/lzma.js/doit.sh8
-rw-r--r--tools/autodebugger.py65
-rw-r--r--tools/bisect_pair.py18
-rw-r--r--tools/clean_webconsole.py23
-rw-r--r--tools/eliminator/eliminator-test-output.js2722
-rw-r--r--tools/eliminator/eliminator-test.js3302
-rw-r--r--tools/eliminator/eliminator.coffee47
-rw-r--r--tools/js-optimizer.js177
-rw-r--r--tools/shared.py108
-rw-r--r--tools/test-js-optimizer-regs-output.js228
-rw-r--r--tools/test-js-optimizer-regs.js233
117 files changed, 17558 insertions, 963 deletions
diff --git a/AUTHORS b/AUTHORS
index 6a6db201..1dd6039a 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -20,3 +20,5 @@ under the licensing terms detailed in LICENSE.
* David Benjamin <davidben@mit.edu>
* Pierre Renaux <pierre@talansoft.com>
* Brian Anderson <banderson@mozilla.com>
+* Jon Bardin <diclophis@gmail.com>
+* Jukka Jylänki <jujjyl@gmail.com>
diff --git a/em-config b/em-config
new file mode 100755
index 00000000..dee399ed
--- /dev/null
+++ b/em-config
@@ -0,0 +1,24 @@
+#!/usr/bin/env python
+
+'''
+This is a helper tool which is designed to make it possible
+for other apps to read emscripten's configuration variables
+in a unified way. Usage:
+
+ em-config VAR_NAME
+
+This tool prints the value of the variable to stdout if one
+is found, or exits with 1 if the variable does not exist.
+'''
+
+import os, sys, re
+from tools import shared
+
+if len(sys.argv) != 2 or \
+ not re.match(r"^[\w\W_][\w\W_\d]*$", sys.argv[1]) or \
+ not (sys.argv[1] in dir(shared)):
+ print 'Usage: em-config VAR_NAME'
+ exit(1)
+
+print eval('shared.' + sys.argv[1])
+
diff --git a/emcc b/emcc
index a54b805b..635d6132 100755
--- a/emcc
+++ b/emcc
@@ -272,6 +272,10 @@ Options that are modified or new in %s include:
--js-library <lib> A JavaScript library to use in addition to
those in Emscripten's src/library_*
+ -v Turns on verbose output. This will pass
+ -v to Clang, and also enable EMCC_DEBUG
+ to details emcc's operations
+
The target file, if specified (-o <target>), defines what will
be generated:
@@ -293,6 +297,9 @@ the source of emcc (search for 'os.environ').
''' % (this, this, this)
exit(0)
+elif len(sys.argv) == 2 and sys.argv[1] == '-v': # -v with no inputs
+ print 'emcc (Emscripten GCC-like replacement) 2.0'
+ exit(subprocess.call([shared.CLANG, '-v']))
# If this is a configure-type thing, do not compile to JavaScript, instead use clang
# to compile to a native binary (using our headers, so things make sense later)
@@ -513,6 +520,10 @@ try:
elif newargs[i] == '--ignore-dynamic-linking':
ignore_dynamic_linking = True
newargs[i] = ''
+ elif newargs[i] == '-v':
+ shared.COMPILER_OPTS += ['-v']
+ DEBUG = 1
+ newargs[i] = ''
elif newargs[i].startswith('--shell-file'):
check_bad_eq(newargs[i])
shell_path = newargs[i+1]
@@ -700,17 +711,18 @@ try:
else:
assert not has_dash_c, 'fatal error: cannot specify -o with -c with multiple files' + str(sys.argv)
# We have a specified target (-o <target>), which is not JavaScript or HTML, and
- # we have multiple files: Link them TODO: llvm link-time opts?
- ld_args = temp_files + ['-b', specified_target]
- #[arg.split('-Wl,')[1] for arg in filter(lambda arg: arg.startswith('-Wl,'), sys.argv)]
- if DEBUG: print >> sys.stderr, 'emcc: link: ' + str(ld_args)
- execute([shared.LLVM_LD, '-disable-opt'] + ld_args)
+ # we have multiple files: Link them
+ if DEBUG: print >> sys.stderr, 'emcc: link: ' + str(temp_files)
+ shared.Building.link(temp_files, specified_target)
exit(0)
## Continue on to create JavaScript
if DEBUG: print >> sys.stderr, 'emcc: will generate JavaScript'
+ if final_suffix == 'html':
+ shared.Settings.GENERATING_HTML = 1
+
extra_files_to_link = []
if not LEAVE_INPUTS_RAW and not AUTODEBUG:
@@ -722,9 +734,9 @@ try:
# dlmalloc
def create_dlmalloc():
if DEBUG: print >> sys.stderr, 'emcc: building dlmalloc for cache'
- execute(['python', shared.EMCC, shared.path_from_root('system', 'lib', 'dlmalloc.c'), '-g', '-o', in_temp('dlmalloc.o')], stdout=stdout, stderr=stderr)
+ execute(shared.ENV_PREFIX + ['python', shared.EMCC, shared.path_from_root('system', 'lib', 'dlmalloc.c'), '-g', '-o', in_temp('dlmalloc.o')], stdout=stdout, stderr=stderr)
# we include the libc++ new stuff here, so that the common case of using just new/delete is quick to link
- execute(['python', shared.EMXX, shared.path_from_root('system', 'lib', 'libcxx', 'new.cpp'), '-g', '-o', in_temp('new.o')], stdout=stdout, stderr=stderr)
+ execute(shared.ENV_PREFIX + ['python', shared.EMXX, shared.path_from_root('system', 'lib', 'libcxx', 'new.cpp'), '-g', '-o', in_temp('new.o')], stdout=stdout, stderr=stderr)
shared.Building.link([in_temp('dlmalloc.o'), in_temp('new.o')], in_temp('dlmalloc_full.o'))
return in_temp('dlmalloc_full.o')
def fix_dlmalloc():
@@ -846,7 +858,7 @@ try:
if AUTODEBUG:
if DEBUG: print >> sys.stderr, 'emcc: autodebug'
- execute(['python', shared.AUTODEBUGGER, final, final + '.ad.ll'])
+ execute(shared.ENV_PREFIX + ['python', shared.AUTODEBUGGER, final, final + '.ad.ll'])
final += '.ad.ll'
if DEBUG: save_intermediate('autodebug', 'll')
@@ -900,7 +912,8 @@ try:
partial_dirs = []
for file_ in data_files:
dirname = os.path.dirname(file_['name'])
- if dirname != '' and dirname != '/':
+ dirname = dirname.lstrip('/') # absolute paths start with '/', remove that
+ if dirname != '':
parts = dirname.split('/')
for i in range(len(parts)):
partial = '/'.join(parts[:i+1])
@@ -979,14 +992,23 @@ try:
var b = new Blob([byteArray.buffer], { type: '%(mimetype)s' });
var url = URLObject.createObjectURL(b); // XXX we never revoke this!