mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Bug 1235636 - rewrite PCToLineNumber; r=fitzgen
This commit is contained in:
parent
6e577cf41f
commit
e385bd20d9
@ -51,7 +51,7 @@ add_task(function* runTest() {
|
||||
},
|
||||
{
|
||||
asyncCause: "promise callback",
|
||||
columnNumber: 1,
|
||||
columnNumber: 3,
|
||||
filename: TEST_URI,
|
||||
functionName: "time1",
|
||||
language: 2,
|
||||
|
@ -20,7 +20,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1107592
|
||||
/* Async parent frames from pushPrefEnv don't show up in e10s. */
|
||||
var isE10S = !SpecialPowers.isMainProcess();
|
||||
if (!isE10S && SpecialPowers.getBoolPref("javascript.options.asyncstack")) {
|
||||
asyncFrame = `Async*@${file}:153:1
|
||||
asyncFrame = `Async*@${file}:153:3
|
||||
`;
|
||||
} else {
|
||||
asyncFrame = "";
|
||||
|
@ -41,7 +41,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1107592
|
||||
var isE10S = !SpecialPowers.isMainProcess();
|
||||
var asyncStack = SpecialPowers.getBoolPref("javascript.options.asyncstack");
|
||||
var ourFile = location.href;
|
||||
var parentFrame = (asyncStack && !isE10S) ? `Async*@${ourFile}:121:1
|
||||
var parentFrame = (asyncStack && !isE10S) ? `Async*@${ourFile}:121:3
|
||||
` : "";
|
||||
|
||||
Promise.all([
|
||||
|
@ -3243,21 +3243,17 @@ js::PCToLineNumber(unsigned startLine, jssrcnote* notes, jsbytecode* code, jsbyt
|
||||
ptrdiff_t target = pc - code;
|
||||
for (jssrcnote* sn = notes; !SN_IS_TERMINATOR(sn); sn = SN_NEXT(sn)) {
|
||||
offset += SN_DELTA(sn);
|
||||
SrcNoteType type = (SrcNoteType) SN_TYPE(sn);
|
||||
if (type == SRC_SETLINE) {
|
||||
if (offset <= target)
|
||||
lineno = unsigned(GetSrcNoteOffset(sn, 0));
|
||||
column = 0;
|
||||
} else if (type == SRC_NEWLINE) {
|
||||
if (offset <= target)
|
||||
lineno++;
|
||||
column = 0;
|
||||
}
|
||||
|
||||
if (offset > target)
|
||||
break;
|
||||
|
||||
if (type == SRC_COLSPAN) {
|
||||
SrcNoteType type = (SrcNoteType) SN_TYPE(sn);
|
||||
if (type == SRC_SETLINE) {
|
||||
lineno = unsigned(GetSrcNoteOffset(sn, 0));
|
||||
column = 0;
|
||||
} else if (type == SRC_NEWLINE) {
|
||||
lineno++;
|
||||
column = 0;
|
||||
} else if (type == SRC_COLSPAN) {
|
||||
ptrdiff_t colspan = SN_OFFSET_TO_COLSPAN(GetSrcNoteOffset(sn, 0));
|
||||
MOZ_ASSERT(ptrdiff_t(column) + colspan >= 0);
|
||||
column += colspan;
|
||||
|
Loading…
Reference in New Issue
Block a user