diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-12-27 21:42:44 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-27 21:42:44 -0500 |
commit | 575d695762f545e1c2784595d9c926488062f383 (patch) | |
tree | 5f18013a7cb2fa39c7a62aa11b2753e86725477c /src/js/wasm.js-post.js | |
parent | e5704f392404b1f69d762217b89e3b8736277f08 (diff) | |
parent | 97968a879d0b55baccb5f72627fca84a6a015356 (diff) | |
download | binaryen-575d695762f545e1c2784595d9c926488062f383.tar.gz binaryen-575d695762f545e1c2784595d9c926488062f383.tar.bz2 binaryen-575d695762f545e1c2784595d9c926488062f383.zip |
Merge pull request #859 from WebAssembly/linking
Dynamic linking
Diffstat (limited to 'src/js/wasm.js-post.js')
-rw-r--r-- | src/js/wasm.js-post.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/js/wasm.js-post.js b/src/js/wasm.js-post.js index 03543cbae..e7a10f49a 100644 --- a/src/js/wasm.js-post.js +++ b/src/js/wasm.js-post.js @@ -298,11 +298,17 @@ function integrateWasmJS(Module) { if (!env['table']) { var TABLE_SIZE = Module['wasmTableSize']; if (TABLE_SIZE === undefined) TABLE_SIZE = 1024; // works in binaryen interpreter at least + var MAX_TABLE_SIZE = Module['wasmMaxTableSize']; if (typeof WebAssembly === 'object' && typeof WebAssembly.Table === 'function') { - env['table'] = new WebAssembly.Table({ initial: TABLE_SIZE, maximum: TABLE_SIZE, element: 'anyfunc' }); + if (MAX_TABLE_SIZE !== undefined) { + env['table'] = new WebAssembly.Table({ initial: TABLE_SIZE, maximum: MAX_TABLE_SIZE, element: 'anyfunc' }); + } else { + env['table'] = new WebAssembly.Table({ initial: TABLE_SIZE, element: 'anyfunc' }); + } } else { env['table'] = new Array(TABLE_SIZE); // works in binaryen interpreter at least } + Module['wasmTable'] = env['table']; } if (!env['memoryBase']) { |