diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-12-07 16:19:54 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-12-07 16:19:54 -0800 |
commit | 153638d05a56434ede6803c31566d97813f92c76 (patch) | |
tree | 10b872e0220192023e1a96b863e536784cb5527e /src/jsifier.js | |
parent | 3954f1d108105bcdd5411fe19abb8f068b22bd24 (diff) |
set asm function table sizes to power of two, and add proper masking
Diffstat (limited to 'src/jsifier.js')
-rw-r--r-- | src/jsifier.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index a83b2d3d..50824562 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -1278,10 +1278,12 @@ function JSify(data, functionsOnly, givenFunctions) { if (byPointer) { var returnType = type.split(' ')[0]; + var sig = Functions.getSignature(returnType, argsTypes); if (ASM_JS) { assert(returnType.search(/\("'\[,/) == -1); // XXX need isFunctionType(type, out) + ident = '(' + ident + ')&{{{ FTM_' + sig + ' }}}'; // the function table mask is set in emscripten.py } - ident = Functions.getTable(Functions.getSignature(returnType, argsTypes)) + '[' + ident + ']'; + ident = Functions.getTable(sig) + '[' + ident + ']'; } return ident + '(' + args.join(', ') + ')'; |