aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4bytecodegenerator_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-08-24 16:33:27 +0200
committerLars Knoll <lars.knoll@qt.io>2017-08-28 13:19:09 +0000
commit41a4e387222a117e1cb47c119858c69e0d193e4f (patch)
treee905125c51543fd10608a088e56dc17a61ed1eb5 /src/qml/compiler/qv4bytecodegenerator_p.h
parent2951f6105ad3851b38fa66348a4edd3fe7cfa47e (diff)
Compress all non jump instructions
Change-Id: I90daee5388f5aba5a5c1cd643379adc9a8e05039 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4bytecodegenerator_p.h')
-rw-r--r--src/qml/compiler/qv4bytecodegenerator_p.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/qml/compiler/qv4bytecodegenerator_p.h b/src/qml/compiler/qv4bytecodegenerator_p.h
index 3483565fb0..d6b4d1b06e 100644
--- a/src/qml/compiler/qv4bytecodegenerator_p.h
+++ b/src/qml/compiler/qv4bytecodegenerator_p.h
@@ -149,7 +149,7 @@ public:
{
Instr genericInstr;
InstrMeta<InstrT>::setData(genericInstr, data);
- addInstructionHelper(Moth::Instr::Type(InstrT), InstrMeta<InstrT>::Size, genericInstr);
+ addInstructionHelper(Moth::Instr::Type(InstrT), genericInstr);
}
Q_REQUIRED_RESULT Jump jump()
@@ -228,7 +228,7 @@ public:
{
Instr genericInstr;
InstrMeta<InstrT>::setData(genericInstr, data);
- return Jump(this, addInstructionHelper(Moth::Instr::Type(InstrT), InstrMeta<InstrT>::Size, genericInstr, offsetof(InstrData<InstrT>, offset)));
+ return Jump(this, addInstructionHelper(Moth::Instr::Type(InstrT), genericInstr, offsetof(InstrData<InstrT>, offset)));
}
private:
@@ -236,12 +236,11 @@ private:
friend struct Label;
friend struct ExceptionHandler;
- int addInstructionHelper(Moth::Instr::Type type, uint size, const Instr &i, int offsetOfOffset = -1) {
+ int addInstructionHelper(Moth::Instr::Type type, const Instr &i, int offsetOfOffset = -1) {
int pos = instructions.size();
- instructions.append({type, size, 0, currentLine, offsetOfOffset, -1, { i } });
+ instructions.append({type, 0, 0, currentLine, offsetOfOffset, -1, { i } });
return pos;
}
- void compressInstructions();
struct I {
Moth::Instr::Type type;
@@ -256,6 +255,9 @@ private:
};
};
+ void compressInstructions();
+ void packInstruction(I &i);
+
QVector<I> instructions;
QVector<int> labels;
ExceptionHandler *currentExceptionHandler;