diff options
-rw-r--r-- | src/jsifier.js | 7 | ||||
-rw-r--r-- | src/parseTools.js | 6 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index 7bffb583..f6a3647b 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -551,7 +551,7 @@ function JSify(data, functionsOnly, givenFunctions) { var vars = values(func.variables); if (vars.length) { func.JS += ' var ' + vars.filter(function(v) { return v.origin != 'funcparam' }).map(function(v) { - return v.ident + ' = ' + asmInitializer(v.type); + return v.ident + ' = ' + asmInitializer(v.type); //, func.variables[v.ident].impl); }).join(', ') + ';\n'; } } @@ -772,8 +772,9 @@ function JSify(data, functionsOnly, givenFunctions) { var valueJS = item.JS; item.JS = ''; if (CLOSURE_ANNOTATIONS) item.JS += '/** @type {number} */ '; - item.JS += ((item.overrideSSA || ASM_JS) ? '' : 'var ') + toNiceIdent(item.assignTo); - + if (!ASM_JS || item.intertype != 'alloca' || item.funcData.variables[item.assignTo].impl == VAR_EMULATED) { // asm only needs non-allocas + item.JS += ((ASM_JS || item.overrideSSA) ? '' : 'var ') + toNiceIdent(item.assignTo); + } var value = parseNumerical(valueJS); var impl = getVarImpl(item.funcData, item.assignTo); switch (impl) { diff --git a/src/parseTools.js b/src/parseTools.js index bd3109e7..eaf0b91e 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -949,8 +949,8 @@ function getHeapOffset(offset, type) { } } -function asmInitializer(type) { - if (type in Runtime.INT_TYPES) { +function asmInitializer(type, impl) { + if (isIntImplemented(type)) {// || (impl && impl == 'VAR_EMULATED')) { return '0'; } else { return '+0'; @@ -958,7 +958,7 @@ function asmInitializer(type) { } function asmCoercion(value, type) { - if (type in Runtime.INT_TYPES) { + if (isIntImplemented(type)) { return value + '|0'; } else { return '+' + value; |