diff --git a/src/compiler.js b/src/compiler.js index 0baec95ee6dc1..f2b0dcbd07658 100644 --- a/src/compiler.js +++ b/src/compiler.js @@ -213,6 +213,7 @@ load('intertyper.js'); load('analyzer.js'); load('jsifier.js'); if (RELOOP) { + RelooperModule = { TOTAL_MEMORY: ceilPowerOfTwo(2*RELOOPER_BUFFER_SIZE) }; load(RELOOPER); assert(typeof Relooper != 'undefined'); } diff --git a/src/library.js b/src/library.js index f414a05ff1f2b..aac5a9dacce4f 100644 --- a/src/library.js +++ b/src/library.js @@ -6584,10 +6584,6 @@ LibraryManager.library = { return me.ret; }, - _Z7catopenPKci: function() { throw 'catopen not implemented' }, - _Z7catgetsP8_nl_catdiiPKc: function() { throw 'catgets not implemented' }, - _Z8catcloseP8_nl_catd: function() { throw 'catclose not implemented' }, - // ========================================================================== // errno.h // ========================================================================== diff --git a/src/library_sdl.js b/src/library_sdl.js index 9383834fe368d..116bf547c4ec9 100644 --- a/src/library_sdl.js +++ b/src/library_sdl.js @@ -1009,7 +1009,10 @@ var LibrarySDL = { }, SDL_Delay: function(delay) { - abort('SDL_Delay called! Potential infinite loop, quitting.'); + if (!ENVIRONMENT_IS_WORKER) abort('SDL_Delay called on the main thread! Potential infinite loop, quitting.'); + // horrible busy-wait, but in a worker it at least does not block rendering + var now = Date.now(); + while (Date.now() - now < delay) {} }, SDL_WM_SetCaption: function(title, icon) { diff --git a/tools/shared.py b/tools/shared.py index 45551fec46bcb..a07bdeaf43ae0 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -304,7 +304,7 @@ def find_temp_directory(): # we re-check sanity when the settings are changed) # We also re-check sanity and clear the cache when the version changes -EMSCRIPTEN_VERSION = '1.5.8' +EMSCRIPTEN_VERSION = '1.5.9' def generate_sanity(): return EMSCRIPTEN_VERSION + '|' + get_llvm_target() + '|' + LLVM_ROOT @@ -1418,17 +1418,16 @@ def make(opt_level): Building.emcc(os.path.join('relooper', 'Relooper.cpp'), ['-I' + os.path.join('relooper'), '--post-js', os.path.join('relooper', 'emscripten', 'glue.js'), '--memory-init-file', '0', - '-s', 'TOTAL_MEMORY=67108864', '-s', 'EXPORTED_FUNCTIONS=["_rl_set_output_buffer","_rl_make_output_buffer","_rl_new_block","_rl_delete_block","_rl_block_add_branch_to","_rl_new_relooper","_rl_delete_relooper","_rl_relooper_add_block","_rl_relooper_calculate","_rl_relooper_render", "_rl_set_asm_js_mode"]', '-s', 'DEFAULT_LIBRARY_FUNCS_TO_INCLUDE=["memcpy", "memset", "malloc", "free", "puts"]', '-s', 'RELOOPER="' + relooper + '"', '-O' + str(opt_level), '--closure', '0'], raw) f = open(relooper, 'w') f.write("// Relooper, (C) 2012 Alon Zakai, MIT license, https://github.com/kripken/Relooper\n") - f.write("var Relooper = (function() {\n") + f.write("var Relooper = (function(Module) {\n") f.write(open(raw).read()) f.write('\n return Module.Relooper;\n') - f.write('})();\n') + f.write('})(RelooperModule);\n') f.close() # bootstrap phase 1: generate unrelooped relooper, for which we do not need a relooper (so we cannot recurse infinitely in this function)