Loading js/src/frontend/SourceNotes.h +10 −1 Original line number Diff line number Diff line Loading @@ -90,6 +90,15 @@ class SrcNote { Count }; }; // SRC_SETLINE: Source note for arbitrary ops. class SetLine { public: enum Fields { // The file-absolute source line number of the current op. Line, Count }; }; }; #define FOR_EACH_SRC_NOTE_TYPE(M) \ Loading Loading @@ -118,7 +127,7 @@ class SrcNote { /* All notes above here are "gettable". See SN_IS_GETTABLE below. */ \ M(SRC_COLSPAN, "colspan", SrcNote::ColSpan::Count) \ M(SRC_NEWLINE, "newline", 0) /* Bytecode follows a source newline. */ \ M(SRC_SETLINE, "setline", 1) /* A file-absolute source line number note. */ \ M(SRC_SETLINE, "setline", SrcNote::SetLine::Count) \ M(SRC_UNUSED21, "unused21", 0) /* Unused. */ \ M(SRC_UNUSED22, "unused22", 0) /* Unused. */ \ M(SRC_UNUSED23, "unused23", 0) /* Unused. */ \ Loading js/src/shell/js.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -2731,7 +2731,7 @@ SrcNotes(JSContext* cx, HandleScript script, Sprinter* sp) break; case SRC_SETLINE: lineno = GetSrcNoteOffset(sn, 0); lineno = GetSrcNoteOffset(sn, SrcNote::SetLine::Line); if (!sp->jsprintf(" lineno %u", lineno)) return false; break; Loading js/src/vm/BytecodeUtil-inl.h +1 −1 Original line number Diff line number Diff line Loading @@ -184,7 +184,7 @@ class BytecodeRangeWithPosition : private BytecodeRange column += colspan; lastLinePC = snpc; } else if (type == SRC_SETLINE) { lineno = size_t(GetSrcNoteOffset(sn, 0)); lineno = size_t(GetSrcNoteOffset(sn, SrcNote::SetLine::Line)); column = 0; lastLinePC = snpc; } else if (type == SRC_NEWLINE) { Loading js/src/vm/CodeCoverage.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -196,7 +196,7 @@ LCovSource::writeScript(JSScript* script) while (!SN_IS_TERMINATOR(sn) && snpc <= pc) { SrcNoteType type = SN_TYPE(sn); if (type == SRC_SETLINE) lineno = size_t(GetSrcNoteOffset(sn, 0)); lineno = size_t(GetSrcNoteOffset(sn, SrcNote::SetLine::Line)); else if (type == SRC_NEWLINE) lineno++; else if (type == SRC_TABLESWITCH) Loading js/src/vm/JSScript.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -3271,7 +3271,7 @@ js::PCToLineNumber(unsigned startLine, jssrcnote* notes, jsbytecode* code, jsbyt SrcNoteType type = SN_TYPE(sn); if (type == SRC_SETLINE) { lineno = unsigned(GetSrcNoteOffset(sn, 0)); lineno = unsigned(GetSrcNoteOffset(sn, SrcNote::SetLine::Line)); column = 0; } else if (type == SRC_NEWLINE) { lineno++; Loading Loading @@ -3323,7 +3323,7 @@ js::LineNumberToPC(JSScript* script, unsigned target) offset += SN_DELTA(sn); SrcNoteType type = SN_TYPE(sn); if (type == SRC_SETLINE) { lineno = unsigned(GetSrcNoteOffset(sn, 0)); lineno = unsigned(GetSrcNoteOffset(sn, SrcNote::SetLine::Line)); } else if (type == SRC_NEWLINE) { lineno++; } Loading @@ -3342,7 +3342,7 @@ js::GetScriptLineExtent(JSScript* script) for (jssrcnote* sn = script->notes(); !SN_IS_TERMINATOR(sn); sn = SN_NEXT(sn)) { SrcNoteType type = SN_TYPE(sn); if (type == SRC_SETLINE) lineno = unsigned(GetSrcNoteOffset(sn, 0)); lineno = unsigned(GetSrcNoteOffset(sn, SrcNote::SetLine::Line)); else if (type == SRC_NEWLINE) lineno++; Loading Loading
js/src/frontend/SourceNotes.h +10 −1 Original line number Diff line number Diff line Loading @@ -90,6 +90,15 @@ class SrcNote { Count }; }; // SRC_SETLINE: Source note for arbitrary ops. class SetLine { public: enum Fields { // The file-absolute source line number of the current op. Line, Count }; }; }; #define FOR_EACH_SRC_NOTE_TYPE(M) \ Loading Loading @@ -118,7 +127,7 @@ class SrcNote { /* All notes above here are "gettable". See SN_IS_GETTABLE below. */ \ M(SRC_COLSPAN, "colspan", SrcNote::ColSpan::Count) \ M(SRC_NEWLINE, "newline", 0) /* Bytecode follows a source newline. */ \ M(SRC_SETLINE, "setline", 1) /* A file-absolute source line number note. */ \ M(SRC_SETLINE, "setline", SrcNote::SetLine::Count) \ M(SRC_UNUSED21, "unused21", 0) /* Unused. */ \ M(SRC_UNUSED22, "unused22", 0) /* Unused. */ \ M(SRC_UNUSED23, "unused23", 0) /* Unused. */ \ Loading
js/src/shell/js.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -2731,7 +2731,7 @@ SrcNotes(JSContext* cx, HandleScript script, Sprinter* sp) break; case SRC_SETLINE: lineno = GetSrcNoteOffset(sn, 0); lineno = GetSrcNoteOffset(sn, SrcNote::SetLine::Line); if (!sp->jsprintf(" lineno %u", lineno)) return false; break; Loading
js/src/vm/BytecodeUtil-inl.h +1 −1 Original line number Diff line number Diff line Loading @@ -184,7 +184,7 @@ class BytecodeRangeWithPosition : private BytecodeRange column += colspan; lastLinePC = snpc; } else if (type == SRC_SETLINE) { lineno = size_t(GetSrcNoteOffset(sn, 0)); lineno = size_t(GetSrcNoteOffset(sn, SrcNote::SetLine::Line)); column = 0; lastLinePC = snpc; } else if (type == SRC_NEWLINE) { Loading
js/src/vm/CodeCoverage.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -196,7 +196,7 @@ LCovSource::writeScript(JSScript* script) while (!SN_IS_TERMINATOR(sn) && snpc <= pc) { SrcNoteType type = SN_TYPE(sn); if (type == SRC_SETLINE) lineno = size_t(GetSrcNoteOffset(sn, 0)); lineno = size_t(GetSrcNoteOffset(sn, SrcNote::SetLine::Line)); else if (type == SRC_NEWLINE) lineno++; else if (type == SRC_TABLESWITCH) Loading
js/src/vm/JSScript.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -3271,7 +3271,7 @@ js::PCToLineNumber(unsigned startLine, jssrcnote* notes, jsbytecode* code, jsbyt SrcNoteType type = SN_TYPE(sn); if (type == SRC_SETLINE) { lineno = unsigned(GetSrcNoteOffset(sn, 0)); lineno = unsigned(GetSrcNoteOffset(sn, SrcNote::SetLine::Line)); column = 0; } else if (type == SRC_NEWLINE) { lineno++; Loading Loading @@ -3323,7 +3323,7 @@ js::LineNumberToPC(JSScript* script, unsigned target) offset += SN_DELTA(sn); SrcNoteType type = SN_TYPE(sn); if (type == SRC_SETLINE) { lineno = unsigned(GetSrcNoteOffset(sn, 0)); lineno = unsigned(GetSrcNoteOffset(sn, SrcNote::SetLine::Line)); } else if (type == SRC_NEWLINE) { lineno++; } Loading @@ -3342,7 +3342,7 @@ js::GetScriptLineExtent(JSScript* script) for (jssrcnote* sn = script->notes(); !SN_IS_TERMINATOR(sn); sn = SN_NEXT(sn)) { SrcNoteType type = SN_TYPE(sn); if (type == SRC_SETLINE) lineno = unsigned(GetSrcNoteOffset(sn, 0)); lineno = unsigned(GetSrcNoteOffset(sn, SrcNote::SetLine::Line)); else if (type == SRC_NEWLINE) lineno++; Loading