diff --git a/src/scripting/vm/jit.cpp b/src/scripting/vm/jit.cpp index 78deccae05..1e94e3adaf 100644 --- a/src/scripting/vm/jit.cpp +++ b/src/scripting/vm/jit.cpp @@ -98,7 +98,7 @@ asmjit::CCFunc *JitCompiler::Codegen() { Setup(); - LatestLine = { 0, (ptrdiff_t)0, -1, {} }; + int lastLine = -1; pc = sfunc->Code; auto end = pc + sfunc->CodeSize; @@ -108,14 +108,17 @@ asmjit::CCFunc *JitCompiler::Codegen() op = pc->op; int curLine = sfunc->PCToLine(pc); - auto label = cc.newLabel (); - cc.bind (label); - LatestLine.Label = label; - if (curLine != LatestLine.LineNumber) + if (curLine != lastLine) { - LatestLine.LineNumber = curLine; - LatestLine.VMInstructionIndex = i; - LineInfo.Push (LatestLine); + lastLine = curLine; + + auto label = cc.newLabel(); + cc.bind(label); + + JitLineInfo info; + info.Label = label; + info.LineNumber = curLine; + LineInfo.Push(info); } if (op != OP_PARAM && op != OP_PARAMI && op != OP_VTBL) diff --git a/src/scripting/vm/jitintern.h b/src/scripting/vm/jitintern.h index 8600486098..deb0378f06 100644 --- a/src/scripting/vm/jitintern.h +++ b/src/scripting/vm/jitintern.h @@ -27,9 +27,8 @@ extern int VMCalls[10]; struct JitLineInfo { - uint16_t VMInstructionIndex; - ptrdiff_t InstructionIndex; - int32_t LineNumber; + ptrdiff_t InstructionIndex = 0; + int32_t LineNumber = -1; asmjit::Label Label; }; @@ -270,8 +269,6 @@ private: TArray regA; TArray regS; - JitLineInfo LatestLine; - struct OpcodeLabel { asmjit::CBNode *cursor = nullptr;