diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-08-24 14:18:01 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-08-28 13:18:40 +0000 |
commit | 7ea183a1125df153082f116eaa5e73fb9a68088e (patch) | |
tree | 82c4441f9347b369bce57bd0927cdd32bec71fa3 /src/qml | |
parent | a4f8b9ae6dfacf9ad5c190cde6098ebf13102f41 (diff) |
Rename the Common instruction to Nop
And add Wide and XWide instructions that will get used
as prefixes later on.
Change-Id: I993865395ee2ac7d30eba2e41e7b437bfdb54391
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/compiler/qv4bytecodegenerator_p.h | 4 | ||||
-rw-r--r-- | src/qml/compiler/qv4instr_moth.cpp | 14 | ||||
-rw-r--r-- | src/qml/compiler/qv4instr_moth_p.h | 14 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4vme_moth.cpp | 12 |
4 files changed, 31 insertions, 13 deletions
diff --git a/src/qml/compiler/qv4bytecodegenerator_p.h b/src/qml/compiler/qv4bytecodegenerator_p.h index 594c97790b..c00c80f0f4 100644 --- a/src/qml/compiler/qv4bytecodegenerator_p.h +++ b/src/qml/compiler/qv4bytecodegenerator_p.h @@ -149,7 +149,7 @@ public: void addInstruction(const InstrData<InstrT> &data) { Instr genericInstr; - genericInstr.Common.instructionType = InstrT; + genericInstr.Nop.instructionType = InstrT; InstrMeta<InstrT>::setDataNoCommon(genericInstr, data); addInstructionHelper(InstrMeta<InstrT>::Size, genericInstr); } @@ -229,7 +229,7 @@ public: Jump addJumpInstruction(const InstrData<InstrT> &data) { Instr genericInstr; - genericInstr.Common.instructionType = InstrT; + genericInstr.Nop.instructionType = InstrT; InstrMeta<InstrT>::setDataNoCommon(genericInstr, data); return Jump(this, addInstructionHelper(InstrMeta<InstrT>::Size, genericInstr), offsetof(InstrData<InstrT>, offset)); } diff --git a/src/qml/compiler/qv4instr_moth.cpp b/src/qml/compiler/qv4instr_moth.cpp index ba52fc5f9a..eccbf07461 100644 --- a/src/qml/compiler/qv4instr_moth.cpp +++ b/src/qml/compiler/qv4instr_moth.cpp @@ -126,7 +126,16 @@ void dumpBytecode(const char *code, int len, int nLocals, int nFormals, int star lastLine = line; else line = -1; - switch (Instr::Type(genericInstr->Common.instructionType)) { + switch (Instr::Type(genericInstr->Nop.instructionType)) { + + MOTH_BEGIN_INSTR(Nop) + MOTH_END_INSTR(Nop) + + MOTH_BEGIN_INSTR(Wide) + MOTH_END_INSTR(Wide) + + MOTH_BEGIN_INSTR(XWide) + MOTH_END_INSTR(XWide) MOTH_BEGIN_INSTR(LoadReg) d << StackSlot::createRegister(instr.reg).dump(nFormals); @@ -543,9 +552,6 @@ void dumpBytecode(const char *code, int len, int nLocals, int nFormals, int star MOTH_BEGIN_INSTR(LoadQmlSingleton) d << instr.name; MOTH_END_INSTR(LoadQmlSingleton) - - default: - Q_UNREACHABLE(); } } } diff --git a/src/qml/compiler/qv4instr_moth_p.h b/src/qml/compiler/qv4instr_moth_p.h index 6af80689a6..022009eab5 100644 --- a/src/qml/compiler/qv4instr_moth_p.h +++ b/src/qml/compiler/qv4instr_moth_p.h @@ -70,7 +70,9 @@ QT_BEGIN_NAMESPACE #define INSTRUCTION(op, name, nargs, ...) \ op##_INSTRUCTION(name, nargs, __VA_ARGS__) -#define INSTR_Common(op) INSTRUCTION(op, Common, 0) +#define INSTR_Nop(op) INSTRUCTION(op, Nop, 0) +#define INSTR_Wide(op) INSTRUCTION(op, Wide, 0) +#define INSTR_XWide(op) INSTRUCTION(op, XWide, 0) #define INSTR_Ret(op) INSTRUCTION(op, Ret, 0) #define INSTR_Debug(op) INSTRUCTION(op, Debug, 0) #define INSTR_LoadConst(op) INSTRUCTION(op, LoadConst, 1, index) @@ -183,7 +185,9 @@ QT_BEGIN_NAMESPACE #define FOR_EACH_MOTH_INSTR(F) \ - F(Common) \ + F(Nop) \ + F(Wide) \ + F(XWide) \ F(Ret) \ F(Debug) \ F(LoadConst) \ @@ -452,9 +456,9 @@ QT_WARNING_DISABLE_GCC("-Wuninitialized") static const DataType &data(const Instr &instr) { return instr.I; } \ static void setData(Instr &instr, const DataType &v) { instr.I = v; } \ static void setDataNoCommon(Instr &instr, const DataType &v) \ - { memcpy(reinterpret_cast<char *>(&instr.I) + sizeof(Instr::instr_Common), \ - reinterpret_cast<const char *>(&v) + sizeof(Instr::instr_Common), \ - Size - sizeof(Instr::instr_Common)); } \ + { memcpy(reinterpret_cast<char *>(&instr.I) + sizeof(Instr::instr_Nop), \ + reinterpret_cast<const char *>(&v) + sizeof(Instr::instr_Nop), \ + Size - sizeof(Instr::instr_Nop)); } \ }; FOR_EACH_MOTH_INSTR(MOTH_INSTR_META_TEMPLATE); #undef MOTH_INSTR_META_TEMPLATE diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp index fb9c1eb555..78970ef10d 100644 --- a/src/qml/jsruntime/qv4vme_moth.cpp +++ b/src/qml/jsruntime/qv4vme_moth.cpp @@ -560,9 +560,17 @@ QV4::ReturnedValue VME::exec(const FunctionObject *jsFunction, CallData *callDat MOTH_DISPATCH() for (;;) { - MOTH_BEGIN_INSTR(Common) + MOTH_BEGIN_INSTR(Nop) ; // nop - MOTH_END_INSTR(Common) + MOTH_END_INSTR(Nop) + + MOTH_BEGIN_INSTR(Wide) + ; // nop + MOTH_END_INSTR(Wide) + + MOTH_BEGIN_INSTR(XWide) + ; // nop + MOTH_END_INSTR(XWide) MOTH_BEGIN_INSTR(LoadConst) accumulator = constant(function, index); |