aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlcompileddata.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-03-06 16:55:09 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-07 15:33:19 +0100
commit99efe4309379482fce5c231885883e359bf85290 (patch)
treedbb9333a547fa1939bd63bd64136611e9fe82968 /src/qml/qml/qqmlcompileddata.cpp
parent9fc17c08e5635cf112c6194e6c24af2a9c7caf00 (diff)
Remove old compiler and VME
This removes the bulk of the code. A few smaller cleanups remain, to be done in smaller changes as they move code around. Additionally the "optimize" option of qqmlbundle was removed. It called QQmlScript::Parser::preparseData, which however was not implemented and always returned an empty QByteArray. Therefore "optimize" would not do anything and the class is gone now :) Change-Id: I0c265e756704cb53c5250be1f69e4a3e1b6e64d5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlcompileddata.cpp')
-rw-r--r--src/qml/qml/qqmlcompileddata.cpp102
1 files changed, 0 insertions, 102 deletions
diff --git a/src/qml/qml/qqmlcompileddata.cpp b/src/qml/qml/qqmlcompileddata.cpp
index d20215c78a..59c56bf513 100644
--- a/src/qml/qml/qqmlcompileddata.cpp
+++ b/src/qml/qml/qqmlcompileddata.cpp
@@ -56,36 +56,6 @@
QT_BEGIN_NAMESPACE
-int QQmlCompiledData::indexForString(const QString &data)
-{
- int idx = primitives.indexOf(data);
- if (idx == -1) {
- idx = primitives.count();
- primitives << data;
- }
- return idx;
-}
-
-int QQmlCompiledData::indexForByteArray(const QByteArray &data)
-{
- int idx = datas.indexOf(data);
- if (idx == -1) {
- idx = datas.count();
- datas << data;
- }
- return idx;
-}
-
-int QQmlCompiledData::indexForUrl(const QUrl &data)
-{
- int idx = urls.indexOf(data);
- if (idx == -1) {
- idx = urls.count();
- urls << data;
- }
- return idx;
-}
-
QQmlCompiledData::QQmlCompiledData(QQmlEngine *engine)
: engine(engine), importCache(0), metaTypeId(-1), listMetaTypeId(-1), isRegisteredWithEngine(false),
rootPropertyCache(0), compilationUnit(0), qmlUnit(0), totalBindingsCount(0), totalParserStatusCount(0)
@@ -110,13 +80,6 @@ QQmlCompiledData::~QQmlCompiledData()
clear();
- for (int ii = 0; ii < types.count(); ++ii) {
- if (types.at(ii).component)
- types.at(ii).component->release();
- if (types.at(ii).typePropertyCache)
- types.at(ii).typePropertyCache->release();
- }
-
for (QHash<int, TypeReference*>::Iterator resolvedType = resolvedTypes.begin(), end = resolvedTypes.end();
resolvedType != end; ++resolvedType) {
if ((*resolvedType)->component)
@@ -199,71 +162,6 @@ void QQmlCompiledData::TypeReference::doDynamicTypeCheck()
isFullyDynamicType = qtTypeInherits<QQmlPropertyMap>(mo);
}
-void QQmlCompiledData::dumpInstructions()
-{
- if (!name.isEmpty())
- qWarning() << name;
- qWarning().nospace() << "Index\tOperation\t\tData1\tData2\tData3\tComments";
- qWarning().nospace() << "-------------------------------------------------------------------------------";
-
- const char *instructionStream = bytecode.constData();
- const char *endInstructionStream = bytecode.constData() + bytecode.size();
-
- int instructionCount = 0;
- while (instructionStream < endInstructionStream) {
- QQmlInstruction *instr = (QQmlInstruction *)instructionStream;
- dump(instr, instructionCount);
- instructionStream += QQmlInstruction::size(instructionType(instr));
- instructionCount++;
- }
-
- qWarning().nospace() << "-------------------------------------------------------------------------------";
-}
-
-int QQmlCompiledData::addInstructionHelper(QQmlInstruction::Type type, QQmlInstruction &instr)
-{
-#ifdef QML_THREADED_VME_INTERPRETER
- instr.common.code = QQmlVME::instructionJumpTable()[static_cast<int>(type)];
-#else
- instr.common.instructionType = type;
-#endif
- int ptrOffset = bytecode.size();
- int size = QQmlInstruction::size(type);
- if (bytecode.capacity() <= bytecode.size() + size)
- bytecode.reserve(bytecode.size() + size + 512);
- bytecode.append(reinterpret_cast<const char *>(&instr), size);
- return ptrOffset;
-}
-
-int QQmlCompiledData::nextInstructionIndex()
-{
- return bytecode.size();
-}
-
-QQmlInstruction *QQmlCompiledData::instruction(int index)
-{
- return (QQmlInstruction *)(bytecode.constData() + index);
-}
-
-QQmlInstruction::Type QQmlCompiledData::instructionType(const QQmlInstruction *instr)
-{
-#ifdef QML_THREADED_VME_INTERPRETER
- void *const *jumpTable = QQmlVME::instructionJumpTable();
- void *code = instr->common.code;
-
-# define QML_CHECK_INSTR_CODE(I, FMT) \
- if (jumpTable[static_cast<int>(QQmlInstruction::I)] == code) \
- return QQmlInstruction::I;
-
- FOR_EACH_QML_INSTR(QML_CHECK_INSTR_CODE)
- Q_ASSERT_X(false, Q_FUNC_INFO, "Invalid instruction address");
- return static_cast<QQmlInstruction::Type>(0);
-# undef QML_CHECK_INSTR_CODE
-#else
- return static_cast<QQmlInstruction::Type>(instr->common.instructionType);
-#endif
-}
-
void QQmlCompiledData::initialize(QQmlEngine *engine)
{
Q_ASSERT(!hasEngine());