diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/jsifier.js | 1 | ||||
-rw-r--r-- | src/modules.js | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index 8270b443..3f52337f 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -1463,6 +1463,7 @@ function JSify(data, functionsOnly, givenFunctions) { if (!byPointerForced && !funcData.setjmpTable) { // normal asm function pointer call callIdent = '(' + callIdent + ')&{{{ FTM_' + sig + ' }}}'; // the function table mask is set in emscripten.py + Functions.neededTables[sig] = 1; } else { // This is a call through an invoke_*, either a forced one, or a setjmp-required one // note: no need to update argsTypes at this point diff --git a/src/modules.js b/src/modules.js index c5c0db88..bd453add 100644 --- a/src/modules.js +++ b/src/modules.js @@ -237,6 +237,8 @@ var Functions = { indexedFunctions: {}, nextIndex: (ASM_JS ? 2*RESERVED_FUNCTION_POINTERS : 0) + 2, // Start at a non-0 (even, see below) value + neededTables: set('v', 'vi', 'ii', 'iii'), // signatures that appeared (initialized with library stuff + // we always use), and we will need a function table for blockAddresses: {}, // maps functions to a map of block labels to label ids @@ -286,7 +288,7 @@ var Functions = { } var tables = { pre: '' }; if (ASM_JS) { - ['v', 'vi', 'ii', 'iii'].forEach(function(sig) { // add some default signatures that are used in the library + keys(Functions.neededTables).forEach(function(sig) { // add some default signatures that are used in the library tables[sig] = emptyTable(sig); // TODO: make them compact }); } @@ -429,6 +431,7 @@ var PassManager = { indexedFunctions: Functions.indexedFunctions, implementedFunctions: ASM_JS ? Functions.implementedFunctions : [], unimplementedFunctions: Functions.unimplementedFunctions, + neededTables: Functions.neededTables } })); } else if (phase == 'post') { |