aboutsummaryrefslogtreecommitdiff
path: root/src/modules.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules.js')
-rw-r--r--src/modules.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/modules.js b/src/modules.js
index 53d97817..9f419234 100644
--- a/src/modules.js
+++ b/src/modules.js
@@ -252,12 +252,26 @@ var Functions = {
for (var i = 0; i < argTypes.length; i++) {
var type = argTypes[i];
if (!type) break; // varargs
- sig += isIntImplemented(type) ? (getBits(type) == 64 ? 'ii' : 'i') : 'f'; // legalized i64s will be i32s
+ if (type in Runtime.FLOAT_TYPES) {
+ sig += 'f';
+ } else {
+ var chunks = getNumIntChunks(type);
+ for (var j = 0; j < chunks; j++) sig += 'i';
+ }
}
if (hasVarArgs) sig += 'i';
return sig;
},
+ getSignatureReturnType: function(sig) {
+ switch(sig[0]) {
+ case 'v': return 'void';
+ case 'i': return 'i32';
+ case 'f': return 'double';
+ default: throw 'what is this sig? ' + sig;
+ }
+ },
+
// Mark a function as needing indexing. Python will coordinate them all
getIndex: function(ident, doNotCreate, sig) {
if (doNotCreate && !(ident in this.indexedFunctions)) {