2013-06-24 10:07:48 +00:00
|
|
|
/****************************************************************************
|
|
|
|
**
|
2016-01-19 09:38:36 +00:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2013-06-24 10:07:48 +00:00
|
|
|
**
|
2013-06-24 11:50:51 +00:00
|
|
|
** This file is part of the QtQml module of the Qt Toolkit.
|
2013-06-24 10:07:48 +00:00
|
|
|
**
|
2016-01-19 09:38:36 +00:00
|
|
|
** $QT_BEGIN_LICENSE:LGPL$
|
2013-06-24 10:07:48 +00:00
|
|
|
** Commercial License Usage
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2015-01-28 11:55:39 +00:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
2016-01-19 09:38:36 +00:00
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2013-06-24 10:07:48 +00:00
|
|
|
**
|
|
|
|
** GNU Lesser General Public License Usage
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
2016-01-19 09:38:36 +00:00
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
** Foundation and appearing in the file LICENSE.LGPL3 included in the
|
|
|
|
** packaging of this file. Please review the following information to
|
|
|
|
** ensure the GNU Lesser General Public License version 3 requirements
|
|
|
|
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
|
2013-06-24 10:07:48 +00:00
|
|
|
**
|
2016-01-19 09:38:36 +00:00
|
|
|
** GNU General Public License Usage
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
** General Public License version 2.0 or (at your option) the GNU General
|
|
|
|
** Public license version 3 or any later version approved by the KDE Free
|
|
|
|
** Qt Foundation. The licenses are as published by the Free Software
|
|
|
|
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
|
|
|
|
** https://www.gnu.org/licenses/gpl-3.0.html.
|
2013-06-24 10:07:48 +00:00
|
|
|
**
|
|
|
|
** $QT_END_LICENSE$
|
|
|
|
**
|
|
|
|
****************************************************************************/
|
|
|
|
|
2012-06-08 19:09:13 +00:00
|
|
|
#include "qv4instr_moth_p.h"
|
|
|
|
|
2014-02-14 12:58:40 +00:00
|
|
|
using namespace QV4;
|
|
|
|
using namespace QV4::Moth;
|
2012-06-08 19:09:13 +00:00
|
|
|
|
|
|
|
int Instr::size(Type type)
|
|
|
|
{
|
|
|
|
#define MOTH_RETURN_INSTR_SIZE(I, FMT) case I: return InstrMeta<(int)I>::Size;
|
|
|
|
switch (type) {
|
|
|
|
FOR_EACH_MOTH_INSTR(MOTH_RETURN_INSTR_SIZE)
|
|
|
|
default: return 0;
|
|
|
|
}
|
|
|
|
#undef MOTH_RETURN_INSTR_SIZE
|
|
|
|
}
|
|
|
|
|
2017-06-22 09:16:11 +00:00
|
|
|
static QByteArray alignedNumber(int n) {
|
2017-06-13 10:34:46 +00:00
|
|
|
QByteArray number = QByteArray::number(n);
|
|
|
|
while (number.size() < 12)
|
|
|
|
number.prepend(' ');
|
|
|
|
return number;
|
|
|
|
}
|
|
|
|
|
2017-06-22 09:16:11 +00:00
|
|
|
static QString toString(QV4::ReturnedValue v)
|
2017-06-13 20:51:51 +00:00
|
|
|
{
|
|
|
|
#ifdef V4_BOOTSTRAP
|
|
|
|
return QStringLiteral("string-const(%1)").arg(v);
|
|
|
|
#else // !V4_BOOTSTRAP
|
|
|
|
Value val = Value::fromReturnedValue(v);
|
2017-06-22 09:16:11 +00:00
|
|
|
QString result;
|
|
|
|
if (val.isInt32())
|
|
|
|
result = QLatin1String("int ");
|
|
|
|
else if (val.isDouble())
|
|
|
|
result = QLatin1String("double ");
|
|
|
|
if (val.isEmpty())
|
|
|
|
result += QLatin1String("empty");
|
|
|
|
else
|
|
|
|
result += val.toQStringNoThrow();
|
2017-06-22 12:28:47 +00:00
|
|
|
return result;
|
2017-06-13 20:51:51 +00:00
|
|
|
#endif // V4_BOOTSTRAP
|
|
|
|
}
|
|
|
|
|
2017-06-14 11:58:38 +00:00
|
|
|
template<typename T>
|
|
|
|
int absoluteInstructionOffset(const char *codeStart, const T &instr)
|
|
|
|
{
|
|
|
|
return reinterpret_cast<const char *>(&instr) - codeStart + offsetof(T, offset) + instr.offset;
|
|
|
|
}
|
|
|
|
|
2017-06-13 10:34:46 +00:00
|
|
|
#define MOTH_BEGIN_INSTR(I) \
|
|
|
|
case Instr::I: {\
|
2017-07-11 14:55:49 +00:00
|
|
|
const InstrMeta<int(Instr::I)>::DataType &instr = InstrMeta<int(Instr::I)>::data(*genericInstr); \
|
2017-06-13 10:34:46 +00:00
|
|
|
Q_UNUSED(instr); \
|
|
|
|
QDebug d = qDebug(); \
|
|
|
|
d.nospace(); \
|
2017-07-18 13:43:11 +00:00
|
|
|
d << alignedNumber(int(code - start)).constData() << ": " << #I << " "; \
|
2017-07-11 14:55:49 +00:00
|
|
|
code += InstrMeta<int(Instr::I)>::Size; \
|
2017-06-13 10:34:46 +00:00
|
|
|
|
|
|
|
#define MOTH_END_INSTR(I) } break;
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
namespace QV4 {
|
|
|
|
namespace Moth {
|
|
|
|
|
2017-07-11 14:55:49 +00:00
|
|
|
QDebug operator<<(QDebug dbg, const Temp &t)
|
2017-06-13 10:34:46 +00:00
|
|
|
{
|
2017-07-11 14:55:49 +00:00
|
|
|
dbg << "%" << t.index;
|
2017-06-13 10:34:46 +00:00
|
|
|
return dbg;
|
|
|
|
}
|
|
|
|
|
2017-06-22 12:28:47 +00:00
|
|
|
void dumpConstantTable(const Value *constants, uint count)
|
|
|
|
{
|
|
|
|
QDebug d = qDebug();
|
|
|
|
d.nospace();
|
|
|
|
for (uint i = 0; i < count; ++i)
|
|
|
|
d << alignedNumber(i).constData() << ": "
|
|
|
|
<< toString(constants[i].asReturnedValue()).toUtf8().constData() << "\n";
|
|
|
|
}
|
|
|
|
|
2017-06-13 10:34:46 +00:00
|
|
|
void dumpBytecode(const char *code, int len)
|
|
|
|
{
|
|
|
|
const char *start = code;
|
|
|
|
const char *end = code + len;
|
|
|
|
while (code < end) {
|
|
|
|
const Instr *genericInstr = reinterpret_cast<const Instr *>(code);
|
|
|
|
switch (genericInstr->common.instructionType) {
|
|
|
|
|
2017-07-18 13:48:21 +00:00
|
|
|
MOTH_BEGIN_INSTR(LoadReg)
|
|
|
|
d << instr.reg;
|
|
|
|
MOTH_END_INSTR(LoadReg)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(StoreReg)
|
|
|
|
d << instr.reg;
|
|
|
|
MOTH_END_INSTR(StoreReg)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(MoveReg)
|
|
|
|
d << instr.destReg << ", " << instr.srcReg;
|
|
|
|
MOTH_END_INSTR(MoveReg)
|
|
|
|
|
2017-07-11 14:55:49 +00:00
|
|
|
MOTH_BEGIN_INSTR(LoadConst)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << "C" << instr.index;
|
2017-07-11 14:55:49 +00:00
|
|
|
MOTH_END_INSTR(LoadConst)
|
|
|
|
|
2017-07-18 13:48:21 +00:00
|
|
|
MOTH_BEGIN_INSTR(MoveConst)
|
|
|
|
d << instr.destTemp << ", C" << instr.constIndex;
|
|
|
|
MOTH_END_INSTR(MoveConst)
|
|
|
|
|
2017-07-11 14:55:49 +00:00
|
|
|
MOTH_BEGIN_INSTR(LoadLocal)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << "$" << instr.index;
|
2017-07-11 14:55:49 +00:00
|
|
|
MOTH_END_INSTR(LoadLocal)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(StoreLocal)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << "$" << instr.index;
|
2017-07-11 14:55:49 +00:00
|
|
|
MOTH_END_INSTR(StoreLocal)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(LoadArg)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << "#" << instr.index;
|
2017-07-11 14:55:49 +00:00
|
|
|
MOTH_END_INSTR(LoadArg)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(StoreArg)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << "#" << instr.index;
|
2017-07-11 14:55:49 +00:00
|
|
|
MOTH_END_INSTR(StoreArg)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(LoadScopedLocal)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << "$" << instr.index << "@" << instr.scope;
|
2017-07-11 14:55:49 +00:00
|
|
|
MOTH_END_INSTR(LoadScopedLocal)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(StoreScopedLocal)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << ", " << "$" << instr.index << "@" << instr.scope;
|
2017-07-11 14:55:49 +00:00
|
|
|
MOTH_END_INSTR(StoreScopedLocal)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(LoadScopedArg)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << "#" << instr.index << "@" << instr.scope;
|
2017-07-11 14:55:49 +00:00
|
|
|
MOTH_END_INSTR(LoadScopedArg)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(StoreScopedArg)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << "#" << instr.index << "@" << instr.scope;
|
2017-07-11 14:55:49 +00:00
|
|
|
MOTH_END_INSTR(StoreScopedArg)
|
|
|
|
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_BEGIN_INSTR(LoadRuntimeString)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.stringId;
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(LoadRuntimeString)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(LoadRegExp)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.regExpId;
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(LoadRegExp)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(LoadClosure)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.value;
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(LoadClosure)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(LoadName)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.name;
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(LoadName)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(GetGlobalLookup)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.index;
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(GetGlobalLookup)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(StoreName)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.name;
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(StoreName)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(LoadElement)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.base << "[" << instr.index << "]";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(LoadElement)
|
|
|
|
|
2017-07-21 08:55:35 +00:00
|
|
|
MOTH_BEGIN_INSTR(LoadElementA)
|
|
|
|
d << instr.base << "[acc]";
|
|
|
|
MOTH_END_INSTR(LoadElement)
|
|
|
|
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_BEGIN_INSTR(LoadElementLookup)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.base << "[" << instr.index << "]";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(LoadElementLookup)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(StoreElement)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.base << "[" << instr.index << "]";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(StoreElement)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(StoreElementLookup)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.base << "[" << instr.index << "]";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(StoreElementLookup)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(LoadProperty)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.base << "[" << instr.name << "]";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(LoadProperty)
|
|
|
|
|
2017-07-21 08:55:35 +00:00
|
|
|
MOTH_BEGIN_INSTR(LoadPropertyA)
|
|
|
|
d << "acc[" << instr.name << "]";
|
|
|
|
MOTH_END_INSTR(LoadElementA)
|
|
|
|
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_BEGIN_INSTR(GetLookup)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.base << "(" << instr.index << ")";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(GetLookup)
|
|
|
|
|
2017-07-21 08:55:35 +00:00
|
|
|
MOTH_BEGIN_INSTR(GetLookupA)
|
|
|
|
d << "acc(" << instr.index << ")";
|
|
|
|
MOTH_END_INSTR(GetLookupA)
|
|
|
|
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_BEGIN_INSTR(StoreProperty)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.base << "[" << instr.name<< "]";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(StoreProperty)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(SetLookup)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.base;
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(SetLookup)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(StoreScopeObjectProperty)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.base << "[" << instr.propertyIndex << "]";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(StoreScopeObjectProperty)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(LoadScopeObjectProperty)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.base << "[" << instr.propertyIndex << "]";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(LoadScopeObjectProperty)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(StoreContextObjectProperty)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.base << "[" << instr.propertyIndex << "]";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(StoreContextObjectProperty)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(LoadContextObjectProperty)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.base << "[" << instr.propertyIndex << "]";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(LoadContextObjectProperty)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(LoadIdObject)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.base << "[" << instr.index << "]";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(LoadIdObject)
|
|
|
|
|
2017-06-21 09:53:59 +00:00
|
|
|
MOTH_BEGIN_INSTR(InitStackFrame)
|
2017-06-13 10:34:46 +00:00
|
|
|
d << instr.value;
|
2017-06-21 09:53:59 +00:00
|
|
|
MOTH_END_INSTR(InitStackFrame)
|
2017-06-13 10:34:46 +00:00
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(CallValue)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.dest << "(" << instr.callData << ")";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(CallValue)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(CallProperty)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.base<<"."<<instr.name << "(" << instr.callData << ")";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(CallProperty)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(CallPropertyLookup)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.lookupIndex << "(" << instr.callData << ")";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(CallPropertyLookup)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(CallElement)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.base << "[" << instr.index << "]" << "(" << instr.callData << ")";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(CallElement)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(CallActivationProperty)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.name << "(" << instr.callData << ")";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(CallActivationProperty)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(CallGlobalLookup)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.index << "(" << instr.callData << ")";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(CallGlobalLookup)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(SetExceptionHandler)
|
2017-06-29 09:14:36 +00:00
|
|
|
if (instr.offset)
|
|
|
|
d << absoluteInstructionOffset(start, instr);
|
|
|
|
else
|
|
|
|
d << "<null>";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(SetExceptionHandler)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(CallBuiltinThrow)
|
|
|
|
MOTH_END_INSTR(CallBuiltinThrow)
|
|
|
|
|
2017-06-20 12:30:03 +00:00
|
|
|
MOTH_BEGIN_INSTR(GetException)
|
2017-06-16 13:30:23 +00:00
|
|
|
MOTH_END_INSTR(HasException)
|
|
|
|
|
2017-06-20 12:30:03 +00:00
|
|
|
MOTH_BEGIN_INSTR(SetException)
|
2017-06-16 13:30:23 +00:00
|
|
|
MOTH_END_INSTR(SetExceptionFlag)
|
|
|
|
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_BEGIN_INSTR(CallBuiltinUnwindException)
|
|
|
|
MOTH_END_INSTR(CallBuiltinUnwindException)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(CallBuiltinPushCatchScope)
|
|
|
|
d << instr.name;
|
|
|
|
MOTH_END_INSTR(CallBuiltinPushCatchScope)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(CallBuiltinPushScope)
|
|
|
|
MOTH_END_INSTR(CallBuiltinPushScope)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(CallBuiltinPopScope)
|
|
|
|
MOTH_END_INSTR(CallBuiltinPopScope)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(CallBuiltinForeachIteratorObject)
|
|
|
|
MOTH_END_INSTR(CallBuiltinForeachIteratorObject)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(CallBuiltinForeachNextPropertyName)
|
|
|
|
MOTH_END_INSTR(CallBuiltinForeachNextPropertyName)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(CallBuiltinDeleteMember)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.base << "[" << instr.member << "]";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(CallBuiltinDeleteMember)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(CallBuiltinDeleteSubscript)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.base << "[" << instr.index << "]";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(CallBuiltinDeleteSubscript)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(CallBuiltinDeleteName)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.name;
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(CallBuiltinDeleteName)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(CallBuiltinTypeofName)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.name;
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(CallBuiltinTypeofName)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(CallBuiltinTypeofValue)
|
|
|
|
MOTH_END_INSTR(CallBuiltinTypeofValue)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(CallBuiltinDeclareVar)
|
|
|
|
d << instr.isDeletable << ", " << instr.varName;
|
|
|
|
MOTH_END_INSTR(CallBuiltinDeclareVar)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(CallBuiltinDefineArray)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.args << ", " << instr.argc;
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(CallBuiltinDefineArray)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(CallBuiltinDefineObjectLiteral)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.args
|
2017-06-22 09:17:48 +00:00
|
|
|
<< ", " << instr.internalClassId
|
|
|
|
<< ", " << instr.arrayValueCount
|
|
|
|
<< ", " << instr.arrayGetterSetterCountAndFlags;
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(CallBuiltinDefineObjectLiteral)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(CallBuiltinSetupArgumentsObject)
|
|
|
|
MOTH_END_INSTR(CallBuiltinSetupArgumentsObject)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(CallBuiltinConvertThisToObject)
|
|
|
|
MOTH_END_INSTR(CallBuiltinConvertThisToObject)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(CreateValue)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << "new" << instr.func << "(" << instr.callData << ")";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(CreateValue)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(CreateProperty)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << "new" << instr.name << "(" << instr.callData << instr.argc << ")";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(CreateProperty)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(ConstructPropertyLookup)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << "new" << instr.index << "(" << instr.callData << instr.argc << ")";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(ConstructPropertyLookup)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(CreateActivationProperty)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << "new" << instr.name << "(" << instr.callData << instr.argc << ")";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(CreateActivationProperty)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(ConstructGlobalLookup)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << "new" << instr.index << "(" << instr.callData << instr.argc << ")";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(ConstructGlobalLookup)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(Jump)
|
2017-06-14 11:58:38 +00:00
|
|
|
d << absoluteInstructionOffset(start, instr);
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(Jump)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(JumpEq)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << "acc " << absoluteInstructionOffset(start, instr);
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(JumpEq)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(JumpNe)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << "acc " << absoluteInstructionOffset(start, instr);
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(JumpNe)
|
|
|
|
|
2017-06-14 11:59:31 +00:00
|
|
|
MOTH_BEGIN_INSTR(JumpStrictEqual)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.lhs << " " << absoluteInstructionOffset(start, instr);
|
2017-06-14 11:59:31 +00:00
|
|
|
MOTH_END_INSTR(JumpStrictEqual)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(JumpStrictNotEqual)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.lhs << " " << absoluteInstructionOffset(start, instr);
|
2017-06-14 11:59:31 +00:00
|
|
|
MOTH_END_INSTR(JumpStrictNotEqual)
|
|
|
|
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_BEGIN_INSTR(UNot)
|
|
|
|
MOTH_END_INSTR(UNot)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(UPlus)
|
|
|
|
MOTH_END_INSTR(UPlus)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(UMinus)
|
|
|
|
MOTH_END_INSTR(UMinus)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(UCompl)
|
|
|
|
MOTH_END_INSTR(UCompl)
|
|
|
|
|
2017-07-18 13:48:21 +00:00
|
|
|
MOTH_BEGIN_INSTR(Increment)
|
2017-06-20 09:28:27 +00:00
|
|
|
MOTH_END_INSTR(PreIncrement)
|
2017-06-13 10:34:46 +00:00
|
|
|
|
2017-07-18 13:48:21 +00:00
|
|
|
MOTH_BEGIN_INSTR(Decrement)
|
2017-06-20 09:28:27 +00:00
|
|
|
MOTH_END_INSTR(PreDecrement)
|
|
|
|
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_BEGIN_INSTR(Binop)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.alu << ", " << instr.lhs << ", acc";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(Binop)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(Add)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.lhs;
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(Add)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(BitAnd)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.lhs << ", acc";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(BitAnd)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(BitOr)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.lhs << ", acc";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(BitOr)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(BitXor)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.lhs << ", acc";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(BitXor)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(Shr)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.lhs << ", acc";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(Shr)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(Shl)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.lhs << ", acc";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(Shl)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(BitAndConst)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << "acc, " << instr.rhs;
|
|
|
|
MOTH_END_INSTR(BitAndConst)
|
2017-06-13 10:34:46 +00:00
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(BitOrConst)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << "acc, " << instr.rhs;
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(BitOr)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(BitXorConst)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << "acc, " << instr.rhs;
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(BitXor)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(ShrConst)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << "acc, " << instr.rhs;
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(ShrConst)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(ShlConst)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << "acc, " << instr.rhs;
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(ShlConst)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(Mul)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.lhs << ", acc";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(Mul)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(Sub)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.lhs << ", acc";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(Sub)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(BinopContext)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.alu << " " << instr.lhs << ", acc";
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(BinopContext)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(Ret)
|
|
|
|
d << instr.result;
|
|
|
|
MOTH_END_INSTR(Ret)
|
|
|
|
|
|
|
|
#ifndef QT_NO_QML_DEBUGGER
|
|
|
|
MOTH_BEGIN_INSTR(Debug)
|
|
|
|
MOTH_END_INSTR(Debug)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(Line)
|
|
|
|
d << instr.lineNumber;
|
|
|
|
MOTH_END_INSTR(Line)
|
|
|
|
#endif // QT_NO_QML_DEBUGGER
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(LoadThis)
|
|
|
|
MOTH_END_INSTR(LoadThis)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(LoadQmlContext)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.result;
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(LoadQmlContext)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(LoadQmlImportedScripts)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.result;
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(LoadQmlImportedScripts)
|
|
|
|
|
|
|
|
MOTH_BEGIN_INSTR(LoadQmlSingleton)
|
2017-07-18 13:48:21 +00:00
|
|
|
d << instr.name;
|
2017-06-13 10:34:46 +00:00
|
|
|
MOTH_END_INSTR(LoadQmlSingleton)
|
|
|
|
|
2017-06-27 14:06:29 +00:00
|
|
|
default:
|
|
|
|
Q_UNREACHABLE();
|
|
|
|
}
|
2017-06-13 10:34:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
QT_END_NAMESPACE
|