aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/analyzer.js10
-rw-r--r--src/intertyper.js6
-rw-r--r--src/jsifier.js2
-rw-r--r--src/parseTools.js8
4 files changed, 8 insertions, 18 deletions
diff --git a/src/analyzer.js b/src/analyzer.js
index 17ad26ad..898649d5 100644
--- a/src/analyzer.js
+++ b/src/analyzer.js
@@ -1117,7 +1117,7 @@ function analyzer(data, sidePass) {
rawLinesIndex: i
};
if (variable.origin === 'alloca') {
- variable.allocatedNum = item.allocatedNum;
+ variable.allocatedNum = item.ident;
}
if (variable.origin === 'call') {
variable.type = getReturnType(variable.type);
@@ -1608,9 +1608,9 @@ function analyzer(data, sidePass) {
var lines = func.labels[0].lines;
for (var i = 0; i < lines.length; i++) {
var item = lines[i];
- if (!item.assignTo || item.intertype != 'alloca' || !isNumber(item.allocatedNum)) break;
+ if (!item.assignTo || item.intertype != 'alloca' || !isNumber(item.ident)) break;
item.allocatedSize = func.variables[item.assignTo].impl === VAR_EMULATED ?
- calcAllocatedSize(item.allocatedType)*item.allocatedNum: 0;
+ calcAllocatedSize(item.allocatedType)*item.ident: 0;
if (USE_TYPED_ARRAYS === 2) {
// We need to keep the stack aligned
item.allocatedSize = Runtime.forceAlign(item.allocatedSize, Runtime.STACK_ALIGN);
@@ -1619,7 +1619,7 @@ function analyzer(data, sidePass) {
var index = 0;
for (var i = 0; i < lines.length; i++) {
var item = lines[i];
- if (!item.assignTo || item.intertype != 'alloca' || !isNumber(item.allocatedNum)) break;
+ if (!item.assignTo || item.intertype != 'alloca' || !isNumber(item.ident)) break;
item.allocatedIndex = index;
index += item.allocatedSize;
delete item.allocatedSize;
@@ -1647,7 +1647,7 @@ function analyzer(data, sidePass) {
for (var i = 0; i < lines.length; i++) {
var item = lines[i];
- if (!finishedInitial && (!item.assignTo || item.intertype != 'alloca' || !isNumber(item.allocatedNum))) {
+ if (!finishedInitial && (!item.assignTo || item.intertype != 'alloca' || !isNumber(item.ident))) {
finishedInitial = true;
}
if (item.intertype == 'alloca' && finishedInitial) {
diff --git a/src/intertyper.js b/src/intertyper.js
index 09bdaa33..9e5f33c8 100644
--- a/src/intertyper.js
+++ b/src/intertyper.js
@@ -766,15 +766,13 @@ function intertyper(lines, sidePass, baseLineNums) {
return item;
}
// 'alloca'
- var allocaPossibleVars = ['allocatedNum'];
function allocaHandler(item) {
item.intertype = 'alloca';
item.allocatedType = item.tokens[1].text;
if (item.tokens.length > 3 && Runtime.isNumberType(item.tokens[3].text)) {
- item.allocatedNum = toNiceIdent(item.tokens[4].text);
- item.possibleVars = allocaPossibleVars;
+ item.ident = toNiceIdent(item.tokens[4].text);
} else {
- item.allocatedNum = 1;
+ item.ident = 1;
}
item.type = addPointing(item.tokens[1].text); // type of pointer we will get
Types.needAnalysis[item.type] = 0;
diff --git a/src/jsifier.js b/src/jsifier.js
index 0e5f8ef3..e7cc3683 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -1361,7 +1361,7 @@ function JSify(data, functionsOnly, givenFunctions) {
if (item.allocatedSize === 0) return ''; // This will not actually be shown - it's nativized
return asmCoercion(getFastValue('sp', '+', item.allocatedIndex.toString()), 'i32');
} else {
- return RuntimeGenerator.stackAlloc(getFastValue(calcAllocatedSize(item.allocatedType), '*', item.allocatedNum));
+ return RuntimeGenerator.stackAlloc(getFastValue(calcAllocatedSize(item.allocatedType), '*', item.ident));
}
}
function va_argHandler(item) {
diff --git a/src/parseTools.js b/src/parseTools.js
index addf0f21..ca0d15c1 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -2474,13 +2474,6 @@ function walkInterdata(item, pre, post, obj) {
if (walkInterdata(item.params[i], pre, post, obj)) return true;
}
}
- if (item.possibleVars) { // other attributes that might contain interesting data; here, variables
- var box = { intertype: 'value', ident: '' };
- for (i = 0; i <= item.possibleVars.length; i++) {
- box.ident = item[item.possibleVars[i]];
- if (walkInterdata(box, pre, post, obj)) return true;
- }
- }
return post && post(item, originalObj, obj);
}
@@ -2500,7 +2493,6 @@ function walkAndModifyInterdata(item, pre) {
if (repl = walkAndModifyInterdata(item.params[i], pre)) item.params[i] = repl;
}
}
- // Ignore possibleVars because we can't replace them anyhow
}
function parseBlockAddress(segment) {