aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-12-05 12:24:37 -0800
committerAlon Zakai <alonzakai@gmail.com>2012-12-07 14:23:23 -0800
commitb68810bdeed7f07c6d7787e2b5c8e50eed1406c4 (patch)
tree7d7278ca7db54c28337d9248b24c51e9e4ac0752
parent8c675d37efd94ebfffcf02557b645c7745f6a30e (diff)
emit phis properly for asm
-rw-r--r--src/jsifier.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index bc502867..791f342c 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -836,7 +836,7 @@ function JSify(data, functionsOnly, givenFunctions) {
return ';';
});
makeFuncLineActor('var', function(item) { // assigns into phis become simple vars
- return 'var ' + item.ident + ';';
+ return ASM_JS ? ';' : ('var ' + item.ident + ';');
});
makeFuncLineActor('store', function(item) {
var value = finalizeLLVMParameter(item.value);
@@ -930,7 +930,7 @@ function JSify(data, functionsOnly, givenFunctions) {
var labelSets = phiSets[label];
// FIXME: Many of the |var |s here are not needed, but without them we get slowdowns with closure compiler. TODO: remove this workaround.
if (labelSets.length == 1) {
- return 'var ' + labelSets[0].ident + ' = ' + labelSets[0].valueJS + ';';
+ return (ASM_JS ? '' : 'var ') + labelSets[0].ident + ' = ' + labelSets[0].valueJS + ';';
}
// TODO: eliminate unneeded sets (to undefined etc.)
var deps = {}; // for each ident we will set, which others it depends on