From 2b0a4276cac1bb247e4f3a5e4333734a6e35794e Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 14 Nov 2016 15:40:42 -0800 Subject: use wasmMaxTableSize --- src/js/wasm.js-post.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/js/wasm.js-post.js b/src/js/wasm.js-post.js index 90c2f18b8..2b5ed69b2 100644 --- a/src/js/wasm.js-post.js +++ b/src/js/wasm.js-post.js @@ -298,8 +298,13 @@ 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 } -- cgit v1.2.3