aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <azakai@mozilla.com>2011-02-13 09:50:08 -0800
committerAlon Zakai <azakai@mozilla.com>2011-02-13 09:50:08 -0800
commit4c884d8526826ee15ba4475b7bc0c9acb4c609bb (patch)
tree14cc59c34ce4a9f6285bf478bf8048d83233a3fd /src
parent93d0b2f1d4ce34d68e1bd97e38414488bf937891 (diff)
debugging fixes
Diffstat (limited to 'src')
-rw-r--r--src/intertyper.js4
-rw-r--r--src/jsifier.js2
2 files changed, 5 insertions, 1 deletions
diff --git a/src/intertyper.js b/src/intertyper.js
index 3db09516..b181be61 100644
--- a/src/intertyper.js
+++ b/src/intertyper.js
@@ -47,6 +47,10 @@ var Debugging = {
return ret;
},
+
+ getComment: function(lineNum) {
+ return lineNum in this.llvmLineToSourceLine ? ' //@line ' + this.llvmLineToSourceLine[lineNum] : '';
+ }
};
//! @param parseFunctions We parse functions only on later passes, since we do not
diff --git a/src/jsifier.js b/src/jsifier.js
index 32cf263d..67c6ac06 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -436,7 +436,7 @@ function JSify(data, functionsOnly, givenTypes, givenFunctions, givenGlobalVaria
ret += indent + 'if (Date.now() - START_TIME >= ' + (EXECUTION_TIMEOUT*1000) + ') throw "Timed out!" + (new Error().stack);\n';
}
// for special labels we care about (for phi), mark that we visited them
- return ret + label.lines.map(function(line) { return line.JS + (Debugging.on ? ' //@line ' + Debugging.llvmLineToSourceLine[line.lineNum] : '') })
+ return ret + label.lines.map(function(line) { return line.JS + (Debugging.on ? Debugging.getComment(line.lineNum) : '') })
.join('\n')
.split('\n') // some lines include line breaks
.map(function(line) { return indent + line })