aboutsummaryrefslogtreecommitdiff
path: root/src/analyzer.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-01-10 13:27:50 -0800
committerAlon Zakai <alonzakai@gmail.com>2012-01-10 13:27:50 -0800
commitb2827e02a2b996e501bf00fe884cd34370dbcca1 (patch)
treedb1359b1ce013f3344bd9cff5d39f3ed6459d4bd /src/analyzer.js
parent5beb9b6b1909da1c527ac5cd9601fdba82f39ad5 (diff)
align stack to QUANTUM_SIZE in ta2 properly, avoiding unnecessary checks and corrections
Diffstat (limited to 'src/analyzer.js')
-rw-r--r--src/analyzer.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/analyzer.js b/src/analyzer.js
index 7d99ab69..4aac53a8 100644
--- a/src/analyzer.js
+++ b/src/analyzer.js
@@ -774,12 +774,15 @@ function analyzer(data, sidePass) {
assert(isNumber(item.allocatedNum));
item.allocatedSize = func.variables[line.ident].impl === VAR_EMULATED ?
calcAllocatedSize(item.allocatedType)*item.allocatedNum: 0;
+ if (USE_TYPED_ARRAYS === 2) {
+ // We need to keep the stack aligned
+ item.allocatedSize = Runtime.forceAlign(item.allocatedSize, QUANTUM_SIZE);
+ }
}
var index = 0;
for (var i = 0; i < lines.length; i++) {
var item = lines[i].value;
if (!item || item.intertype != 'alloca') break;
- if (USE_TYPED_ARRAYS === 2) index = Runtime.forceAlign(index, Math.min(item.allocatedSize, QUANTUM_SIZE));
item.allocatedIndex = index;
index += item.allocatedSize;
delete item.allocatedSize;