aboutsummaryrefslogtreecommitdiff
path: root/src/analyzer.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-11-18 14:34:54 -0800
committerAlon Zakai <alonzakai@gmail.com>2011-11-18 14:34:54 -0800
commit42b3bb7206356f6543737696d3bbd75ebe2aad4f (patch)
tree6c5b3d2855f13f0084a3f972f029686c726bd1af /src/analyzer.js
parent7d95ee5784c4e1bd475aef46ebcdf4f4cac5cfbe (diff)
phi progress, almost all unoptimized tests pass
Diffstat (limited to 'src/analyzer.js')
-rw-r--r--src/analyzer.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/analyzer.js b/src/analyzer.js
index a3428250..c5d1d405 100644
--- a/src/analyzer.js
+++ b/src/analyzer.js
@@ -628,7 +628,7 @@ function analyzer(data) {
var sourceLabelId = phi.params[i].label;
var sourceLabel = func.labelsDict[sourceLabelId];
var lastLine = sourceLabel.lines.slice(-1)[0];
- assert(lastLine.intertype == 'branch', 'Only branches can lead to labels with phis');
+ assert(lastLine.intertype == 'branch', 'Only branches can lead to labels with phis, line ' + [func.ident, label.ident]);
lastLine.currLabelId = sourceLabelId;
}
phis.push(line);
@@ -671,7 +671,7 @@ function analyzer(data) {
var sourceLabelId = param.label;
var sourceLabel = func.labelsDict[sourceLabelId];
var lastLine = sourceLabel.lines.slice(-1)[0];
- assert(lastLine.intertype == 'branch', 'Only branches can lead to labels with phis');
+ assert(lastLine.intertype == 'branch', 'Only branches can lead to labels with phis, line ' + [func.ident, label.ident]);
if (!lastLine.phi) {
// We store the phi assignments in the branch's params (which are otherwise unused)
lastLine.phi = true;
@@ -681,7 +681,8 @@ function analyzer(data) {
lastLine.params.push({
intertype: 'phiassign',
ident: line.ident,
- value: param.value
+ value: param.value,
+ targetLabel: label.ident
});
}
// The assign to phi is now just a var