diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-11-14 15:58:39 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-22 14:54:36 +0100 |
commit | 85fea8a68b90c817c47022ca5157ff80cb497d4d (patch) | |
tree | a35010ed51fb282d4c727631cb9ce42603d26a80 /src/qml/compiler/qv4isel_masm.cpp | |
parent | bf173fe5da381c88343296ca33ef6b06389c6d20 (diff) |
Saner and simpler way to handle line numbers for JITed code
Instead of storing the current instruction pointer in the
ExecutionContext, we might as well directly store the current
line number there.
Leads to simpler code, works cross platform and should also
be faster.
Change-Id: Ifb7897cf8dbe8a962505fe876aa3ed43283ebb06
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4isel_masm.cpp')
-rw-r--r-- | src/qml/compiler/qv4isel_masm.cpp | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/src/qml/compiler/qv4isel_masm.cpp b/src/qml/compiler/qv4isel_masm.cpp index 91cc5a9b4e..aca28eac2c 100644 --- a/src/qml/compiler/qv4isel_masm.cpp +++ b/src/qml/compiler/qv4isel_masm.cpp @@ -439,15 +439,6 @@ static void printDisassembledOutputWithCalls(const char* output, const QHash<voi } #endif -void Assembler::recordLineNumber(int lineNumber) -{ - CodeLineNumerMapping mapping; - mapping.location = label(); - mapping.lineNumber = lineNumber; - codeLineNumberMappings << mapping; -} - - JSC::MacroAssemblerCodeRef Assembler::link(int *codeSize) { Label endOfCode = label(); @@ -467,14 +458,6 @@ JSC::MacroAssemblerCodeRef Assembler::link(int *codeSize) JSC::JSGlobalData dummy(_executableAllocator); JSC::LinkBuffer linkBuffer(dummy, this, 0); - QVector<uint> lineNumberMapping(codeLineNumberMappings.count() * 2); - - for (int i = 0; i < codeLineNumberMappings.count(); ++i) { - lineNumberMapping[i * 2] = linkBuffer.offsetOf(codeLineNumberMappings.at(i).location); - lineNumberMapping[i * 2 + 1] = codeLineNumberMappings.at(i).lineNumber; - } - _isel->jsUnitGenerator()->registerLineNumberMapping(_function, lineNumberMapping); - QHash<void*, const char*> functions; foreach (CallToLink ctl, _callsToLink) { linkBuffer.link(ctl.call, ctl.externalFunction); @@ -642,9 +625,9 @@ void InstructionSelection::run(int functionIndex) foreach (V4IR::Stmt *s, _block->statements) { if (s->location.isValid()) { - _as->recordLineNumber(s->location.startLine); if (int(s->location.startLine) != lastLine) { - _as->saveInstructionPointer(Assembler::ScratchRegister); + Assembler::Address lineAddr(Assembler::ContextRegister, qOffsetOf(QV4::ExecutionContext, lineNumber)); + _as->store32(Assembler::TrustedImm32(s->location.startLine), lineAddr); lastLine = s->location.startLine; } } |