diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-09-03 14:56:00 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-09-03 14:57:44 -0700 |
commit | f2783ad48564c706713b05bd9f4679340ce8bab4 (patch) | |
tree | c1c4c47055d7b8538a79f58f0d27248c6506909d /src/runtime.js | |
parent | dcf8f0c29c17dbe4cc2829573063996a04c54fee (diff) |
refactor dlfcn support into DLFCN
Diffstat (limited to 'src/runtime.js')
-rw-r--r-- | src/runtime.js | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/src/runtime.js b/src/runtime.js index ebf953ce..33088ad9 100644 --- a/src/runtime.js +++ b/src/runtime.js @@ -384,50 +384,6 @@ var Runtime = { return Runtime.funcWrappers[func]; }, -#if DLOPEN_SUPPORT - functionTable: [], // will contain objects mapping sigs to js functions that call into the right asm module with the right index - - registerFunctions: function(asm, num, sigs, jsModule) { - // use asm module dynCall_* from functionTable - if (num % 2 == 1) num++; // keep pointers even - var table = Runtime.functionTable; - var from = table.length; - assert(from % 2 == 0); - for (var i = 0; i < num; i++) { - table[from + i] = {}; - sigs.forEach(function(sig) { // TODO: new Function etc. - var full = 'dynCall_' + sig; - table[from + i][sig] = function() { - arguments[0] -= from; - return asm[full].apply(null, arguments); - } - }); - } - - if (jsModule.cleanups) { - var newLength = table.length; - jsModule.cleanups.push(function() { - if (table.length === newLength) { - table.length = from; // nothing added since, just shrink - } else { - // something was added above us, clear and leak the span - for (var i = 0; i < num; i++) { - table[from + i] = null; - } - } - while (table.length > 0 && table[table.length-1] === null) table.pop(); - }); - } - - // patch js module dynCall_* to use functionTable - sigs.forEach(function(sig) { - jsModule['dynCall_' + sig] = function() { - return table[arguments[0]][sig].apply(null, arguments); - }; - }); - }, -#endif - // Returns a processor of UTF. // processCChar() receives characters from a C-like UTF representation and returns JS string fragments. // See RFC3629 for details, the bytes are assumed to be valid UTF-8 |