aboutsummaryrefslogtreecommitdiff
path: root/src/library.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-08-28 18:12:53 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-09-03 14:41:29 -0700
commitc76946b2f3cebf00a5e24c9582eb9b59f1039a6d (patch)
tree26754c6f7429e6a502e222f5d44be31980a87503 /src/library.js
parentaa1c42a298a568f2910cb0a184824763016ce64f (diff)
support function pointer calls across asm modules by passing them all through invoke (for now), and have a global function table in the Runtime, which modules register their functions to
Diffstat (limited to 'src/library.js')
-rw-r--r--src/library.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/library.js b/src/library.js
index c160c785..25251299 100644
--- a/src/library.js
+++ b/src/library.js
@@ -5050,11 +5050,11 @@ LibraryManager.library = {
try {
var lib_module = eval(lib_data)(
#if ASM_JS
- asm.maxFunctionIndex,
- Module
+ Runtime.functionTable.length,
#else
- {{{ Functions.getTable('x') }}}.length
+ {{{ Functions.getTable('x') }}}.length,
#endif
+ Module
);
} catch (e) {
#if ASSERTIONS
@@ -5132,7 +5132,12 @@ LibraryManager.library = {
} else {
var result = lib.module[symbol];
if (typeof result == 'function') {
+#if ASM_JS
+ result = lib.module.SYMBOL_TABLE[symbol];
+ assert(result);
+#else
result = Runtime.addFunction(result);
+#endif
lib.cached_functions = result;
}
return result;