From e473a81cb0781ede84f68d4543e5a8a0313a5c17 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Tue, 3 Apr 2012 16:12:19 +0200 Subject: [PATCH] Remove obsolete code Change-Id: I5812990703c4339018af4327cd7b44199a1705fd Reviewed-by: Aaron Kennedy --- src/qml/qml/v4/qv4bindings.cpp | 12 ------------ src/qml/qml/v4/qv4compiler.cpp | 32 +------------------------------- src/qml/qml/v4/qv4compiler_p_p.h | 4 ---- src/qml/qml/v4/qv4instruction.cpp | 3 --- src/qml/qml/v4/qv4instruction_p.h | 4 +--- src/qml/qml/v4/qv4program_p.h | 1 - 6 files changed, 2 insertions(+), 54 deletions(-) diff --git a/src/qml/qml/v4/qv4bindings.cpp b/src/qml/qml/v4/qv4bindings.cpp index 50b18cc..b875bcd 100644 --- a/src/qml/qml/v4/qv4bindings.cpp +++ b/src/qml/qml/v4/qv4bindings.cpp @@ -1680,18 +1680,6 @@ void QV4Bindings::run(int instrIndex, quint32 &executedBlocks, executedBlocks |= instr->blockop.block; QML_V4_END_INSTR(Block, blockop) - // XXX not applicable in v8 - QML_V4_BEGIN_INSTR(InitString, initstring) -// if (!identifiers[instr->initstring.offset].identifier) { -// quint32 len = *(quint32 *)(data + instr->initstring.dataIdx); -// QChar *strdata = (QChar *)(data + instr->initstring.dataIdx + sizeof(quint32)); - -// QString str = QString::fromRawData(strdata, len); - -// // identifiers[instr->initstring.offset] = engine->objectClass->createPersistentIdentifier(str); -// } - QML_V4_END_INSTR(InitString, initstring) - QML_V4_BEGIN_INSTR(CleanupRegister, cleanup) registers[instr->cleanup.reg].cleanup(); QML_V4_END_INSTR(CleanupRegister, cleanup) diff --git a/src/qml/qml/v4/qv4compiler.cpp b/src/qml/qml/v4/qv4compiler.cpp index e833aed..0759551 100644 --- a/src/qml/qml/v4/qv4compiler.cpp +++ b/src/qml/qml/v4/qv4compiler.cpp @@ -1173,7 +1173,6 @@ void QV4Compiler::dump(const QByteArray &programData) qWarning() << "Program.bindings:" << program->bindings; qWarning() << "Program.dataLength:" << program->dataLength; qWarning() << "Program.subscriptions:" << program->subscriptions; - qWarning() << "Program.indentifiers:" << program->identifiers; const int programSize = program->instructionCount; const char *start = program->instructions(); @@ -1192,7 +1191,6 @@ void QV4CompilerPrivate::resetInstanceState() exceptions = committed.exceptions; usedSubscriptionIds.clear(); subscriptionIds = committed.subscriptionIds; - registeredStrings = committed.registeredStrings; bytecode.clear(); patches.clear(); pool.clear(); @@ -1214,7 +1212,6 @@ int QV4CompilerPrivate::commitCompile() committed.data = data; committed.exceptions = exceptions; committed.subscriptionIds = subscriptionIds; - committed.registeredStrings = registeredStrings; return rv; } @@ -1266,7 +1263,7 @@ bool QV4CompilerPrivate::compile(QQmlJS::AST::Node *node) qerr << endl; } - if (discarded || subscriptionIds.count() > 0xFFFF || registeredStrings.count() > 0xFFFF || registerCount > 31) + if (discarded || subscriptionIds.count() > 0xFFFF || registerCount > 31) return false; return true; @@ -1290,32 +1287,6 @@ int QV4CompilerPrivate::registerLiteralString(quint8 reg, const QStringRef &str) return reg; } -// Returns an identifier offset -int QV4CompilerPrivate::registerString(const QString &string) -{ - Q_ASSERT(!string.isEmpty()); - - QPair *iter = registeredStrings.value(string); - - if (!iter) { - quint32 len = string.length(); - QByteArray lendata((const char *)&len, sizeof(quint32)); - QByteArray strdata((const char *)string.constData(), string.length() * sizeof(QChar)); - strdata.prepend(lendata); - int rv = data.count(); - data += strdata; - - iter = ®isteredStrings[string]; - *iter = qMakePair(registeredStrings.count(), rv); - } - - Instr::InitString reg; - reg.offset = iter->first; - reg.dataIdx = iter->second; - gen(reg); - return reg.offset; -} - /*! Returns true if the current expression has not already subscribed to \a sub in currentBlockMask. */ @@ -1498,7 +1469,6 @@ QByteArray QV4Compiler::program() const prog.dataLength = 4 * ((data.size() + 3) / 4); prog.subscriptions = d->committed.subscriptionIds.count(); - prog.identifiers = d->committed.registeredStrings.count(); prog.instructionCount = bytecode.count(); int size = sizeof(QV4Program) + bytecode.count(); size += prog.dataLength; diff --git a/src/qml/qml/v4/qv4compiler_p_p.h b/src/qml/qml/v4/qv4compiler_p_p.h index 782ca59..c4a81db 100644 --- a/src/qml/qml/v4/qv4compiler_p_p.h +++ b/src/qml/qml/v4/qv4compiler_p_p.h @@ -128,8 +128,6 @@ public: bool compile(QQmlJS::AST::Node *); int registerLiteralString(quint8 reg, const QStringRef &); - int registerString(const QString &); - QQmlAssociationList > registeredStrings; QByteArray data; bool blockNeedsSubscription(const QStringList &); @@ -166,8 +164,6 @@ public: QQmlAssociationList subscriptionIds; QVector exceptions; - QQmlAssociationList > registeredStrings; - int count() const { return offsets.count(); } } committed; diff --git a/src/qml/qml/v4/qv4instruction.cpp b/src/qml/qml/v4/qv4instruction.cpp index 4298be2..ecd4f01 100644 --- a/src/qml/qml/v4/qv4instruction.cpp +++ b/src/qml/qml/v4/qv4instruction.cpp @@ -376,9 +376,6 @@ void Bytecode::dump(const V4Instr *i, int address) const case V4Instr::Branch: INSTR_DUMP << "\t" << "Branch" << "\t\t\t" << "Address(" << (address + size() + i->branchop.offset) << ")"; break; - case V4Instr::InitString: - INSTR_DUMP << "\t" << "InitString" << "\t\t" << "String_DataIndex(" << i->initstring.dataIdx << ") -> String_Slot(" << i->initstring.offset << ")"; - break; case V4Instr::Block: INSTR_DUMP << "\t" << "Block" << "\t\t\t" << "Mask(" << QByteArray::number(i->blockop.block, 16).constData() << ")"; break; diff --git a/src/qml/qml/v4/qv4instruction_p.h b/src/qml/qml/v4/qv4instruction_p.h index 46a03b3..310bfba 100644 --- a/src/qml/qml/v4/qv4instruction_p.h +++ b/src/qml/qml/v4/qv4instruction_p.h @@ -160,9 +160,7 @@ QT_BEGIN_NAMESPACE F(BranchFalse, branchop) \ F(Branch, branchop) \ F(Block, blockop) \ - F(Throw, throwop) \ - /* Speculative property resolution */ \ - F(InitString, initstring) + F(Throw, throwop) #if defined(Q_CC_GNU) && (!defined(Q_CC_INTEL) || __INTEL_COMPILER >= 1200) # define QML_THREADED_INTERPRETER diff --git a/src/qml/qml/v4/qv4program_p.h b/src/qml/qml/v4/qv4program_p.h index 664ccde..c1dc392 100644 --- a/src/qml/qml/v4/qv4program_p.h +++ b/src/qml/qml/v4/qv4program_p.h @@ -65,7 +65,6 @@ struct QV4Program { quint32 signalTableOffset; quint32 exceptionDataOffset; quint16 subscriptions; - quint16 identifiers; quint16 instructionCount; struct BindingReference { -- 2.7.4