aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4isel_moth.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2014-03-03 14:41:31 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-07 16:55:12 +0100
commit245f5ce7bb194438fc643e5c928382f47556e2f2 (patch)
tree73d82c57dddf8e8e0c206cd50fe8af4542d3f299 /src/qml/compiler/qv4isel_moth.cpp
parent4c4bddb0254acbc53b80e804bbbc26cfdd4e87a1 (diff)
Add a Line instruction to the interpreter
This unifies the way we handle line numbers in the JIT and Interpreter. Remove the now unused lineNumberMapping code and data. Change-Id: I1d60b1fbb77e70b531fa73d93410683e84dd1e3c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4isel_moth.cpp')
-rw-r--r--src/qml/compiler/qv4isel_moth.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/qml/compiler/qv4isel_moth.cpp b/src/qml/compiler/qv4isel_moth.cpp
index 7f2af0829c..3993bc9acc 100644
--- a/src/qml/compiler/qv4isel_moth.cpp
+++ b/src/qml/compiler/qv4isel_moth.cpp
@@ -385,9 +385,6 @@ void InstructionSelection::run(int functionIndex)
push.value = quint32(locals);
addInstruction(push);
- QVector<uint> lineNumberMappings;
- lineNumberMappings.reserve(_function->basicBlocks.size() * 2);
-
uint currentLine = -1;
for (int i = 0, ei = _function->basicBlocks.size(); i != ei; ++i) {
_block = _function->basicBlocks[i];
@@ -410,12 +407,17 @@ void InstructionSelection::run(int functionIndex)
_currentStatement = s;
if (s->location.isValid()) {
- lineNumberMappings << _codeNext - _codeStart << s->location.startLine;
- if (irModule->debugMode && s->location.startLine != currentLine) {
+ if (s->location.startLine != currentLine) {
currentLine = s->location.startLine;
- Instruction::Debug debug;
- debug.lineNumber = currentLine;
- addInstruction(debug);
+ if (irModule->debugMode) {
+ Instruction::Debug debug;
+ debug.lineNumber = currentLine;
+ addInstruction(debug);
+ } else {
+ Instruction::Line line;
+ line.lineNumber = currentLine;
+ addInstruction(line);
+ }
}
}
@@ -428,8 +430,6 @@ void InstructionSelection::run(int functionIndex)
}
}
- jsGenerator->registerLineNumberMapping(_function, lineNumberMappings);
-
// TODO: patch stack size (the push instruction)
patchJumpAddresses();