aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-08-17 20:09:49 +0200
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-08-17 20:09:49 +0200
commit9c9fca5e27bd91da1ea07bebd7569049493c5ccf (patch)
treedd3b49b40ed01cad1c2cdc206ec73271bca6e942 /src/qml
parent94e337fa95425d259e81b4d21f4d0853108553bd (diff)
parent668ccf18dc8d5ddf403667f19a5b08f2b7c18639 (diff)
Merge dev into 5.6
Diffstat (limited to 'src/qml')
-rw-r--r--src/qml/compiler/qqmlirbuilder.cpp5
-rw-r--r--src/qml/compiler/qqmlirbuilder_p.h1
-rw-r--r--src/qml/compiler/qqmltypecompiler.cpp1
-rw-r--r--src/qml/compiler/qv4instr_moth_p.h14
-rw-r--r--src/qml/compiler/qv4isel_moth.cpp13
-rw-r--r--src/qml/compiler/qv4isel_moth_p.h1
-rw-r--r--src/qml/compiler/qv4isel_p.cpp14
-rw-r--r--src/qml/compiler/qv4isel_p.h1
-rw-r--r--src/qml/compiler/qv4jsir.cpp12
-rw-r--r--src/qml/compiler/qv4jsir_p.h20
-rw-r--r--src/qml/compiler/qv4ssa.cpp6
-rw-r--r--src/qml/debugger/qqmldebugconnector.cpp12
-rw-r--r--src/qml/debugger/qqmldebugconnector_p.h1
-rw-r--r--src/qml/jit/qv4isel_masm.cpp7
-rw-r--r--src/qml/jit/qv4isel_masm_p.h1
-rw-r--r--src/qml/jit/qv4regalloc.cpp6
-rw-r--r--src/qml/jsruntime/qv4context.cpp11
-rw-r--r--src/qml/jsruntime/qv4context_p.h6
-rw-r--r--src/qml/jsruntime/qv4errorobject.cpp4
-rw-r--r--src/qml/jsruntime/qv4numberobject.cpp4
-rw-r--r--src/qml/jsruntime/qv4objectproto.cpp2
-rw-r--r--src/qml/jsruntime/qv4qobjectwrapper.cpp6
-rw-r--r--src/qml/jsruntime/qv4runtime.cpp23
-rw-r--r--src/qml/jsruntime/qv4runtime_p.h3
-rw-r--r--src/qml/jsruntime/qv4value_p.h10
-rw-r--r--src/qml/jsruntime/qv4variantobject.cpp2
-rw-r--r--src/qml/jsruntime/qv4vme_moth.cpp8
-rw-r--r--src/qml/memory/qv4mm.cpp1
-rw-r--r--src/qml/qml/qqmlcontextwrapper.cpp32
-rw-r--r--src/qml/qml/qqmlcontextwrapper_p.h2
-rw-r--r--src/qml/qml/qqmldirparser.cpp26
-rw-r--r--src/qml/qml/qqmlengine.cpp2
-rw-r--r--src/qml/qml/qqmlglobal.cpp4
-rw-r--r--src/qml/qml/v8/qqmlbuiltinfunctions.cpp4
-rw-r--r--src/qml/types/qqmllistmodel.cpp6
35 files changed, 132 insertions, 139 deletions
diff --git a/src/qml/compiler/qqmlirbuilder.cpp b/src/qml/compiler/qqmlirbuilder.cpp
index 079ab95f00..4b1e3601dc 100644
--- a/src/qml/compiler/qqmlirbuilder.cpp
+++ b/src/qml/compiler/qqmlirbuilder.cpp
@@ -1458,7 +1458,6 @@ JSCodeGen::JSCodeGen(const QString &fileName, const QString &sourceCode, QV4::IR
, _scopeObject(0)
, _qmlContextTemp(-1)
, _importedScriptsTemp(-1)
- , _idArrayTemp(-1)
{
_module = jsModule;
_module->setFileName(fileName);
@@ -1765,14 +1764,12 @@ void JSCodeGen::beginFunctionBodyHook()
{
_qmlContextTemp = _block->newTemp();
_importedScriptsTemp = _block->newTemp();
- _idArrayTemp = _block->newTemp();
#ifndef V4_BOOTSTRAP
QV4::IR::Temp *temp = _block->TEMP(_qmlContextTemp);
move(temp, _block->NAME(QV4::IR::Name::builtin_qml_context, 0, 0));
move(_block->TEMP(_importedScriptsTemp), _block->NAME(QV4::IR::Name::builtin_qml_imported_scripts_object, 0, 0));
- move(_block->TEMP(_idArrayTemp), _block->NAME(QV4::IR::Name::builtin_qml_id_array, 0, 0));
#endif
}
@@ -1798,7 +1795,7 @@ QV4::IR::Expr *JSCodeGen::fallbackNameLookup(const QString &name, int line, int
foreach (const IdMapping &mapping, _idObjects)
if (name == mapping.name) {
_function->idObjectDependencies.insert(mapping.idIndex);
- QV4::IR::Expr *s = subscript(_block->TEMP(_idArrayTemp), _block->CONST(QV4::IR::SInt32Type, mapping.idIndex));
+ QV4::IR::Expr *s = _block->MEMBER(_block->TEMP(_qmlContextTemp), _function->newString(name), 0, QV4::IR::Member::MemberOfIdObjectsArray, mapping.idIndex);
QV4::IR::Temp *result = _block->TEMP(_block->newTemp());
_block->MOVE(result, s);
result = _block->TEMP(result->index);
diff --git a/src/qml/compiler/qqmlirbuilder_p.h b/src/qml/compiler/qqmlirbuilder_p.h
index 8d8978d947..5617912081 100644
--- a/src/qml/compiler/qqmlirbuilder_p.h
+++ b/src/qml/compiler/qqmlirbuilder_p.h
@@ -497,7 +497,6 @@ private:
QQmlPropertyCache *_scopeObject;
int _qmlContextTemp;
int _importedScriptsTemp;
- int _idArrayTemp;
};
} // namespace QmlIR
diff --git a/src/qml/compiler/qqmltypecompiler.cpp b/src/qml/compiler/qqmltypecompiler.cpp
index cf37806d7c..911be238b9 100644
--- a/src/qml/compiler/qqmltypecompiler.cpp
+++ b/src/qml/compiler/qqmltypecompiler.cpp
@@ -2624,7 +2624,6 @@ void QQmlJavaScriptBindingExpressionSimplificationPass::visitMove(QV4::IR::Move
if (QV4::IR::Name *n = move->source->asName()) {
if (n->builtin == QV4::IR::Name::builtin_qml_context
- || n->builtin == QV4::IR::Name::builtin_qml_id_array
|| n->builtin == QV4::IR::Name::builtin_qml_imported_scripts_object) {
// these are free of side-effects
return;
diff --git a/src/qml/compiler/qv4instr_moth_p.h b/src/qml/compiler/qv4instr_moth_p.h
index 886ff99ce7..6839c7f609 100644
--- a/src/qml/compiler/qv4instr_moth_p.h
+++ b/src/qml/compiler/qv4instr_moth_p.h
@@ -68,6 +68,7 @@ QT_BEGIN_NAMESPACE
F(StoreContextObjectProperty, storeContextObjectProperty) \
F(LoadScopeObjectProperty, loadScopeObjectProperty) \
F(LoadContextObjectProperty, loadContextObjectProperty) \
+ F(LoadIdObject, loadIdObject) \
F(LoadAttachedQObjectProperty, loadAttachedQObjectProperty) \
F(LoadSingletonQObjectProperty, loadQObjectProperty) \
F(Push, push) \
@@ -132,7 +133,6 @@ QT_BEGIN_NAMESPACE
F(BinopContext, binopContext) \
F(LoadThis, loadThis) \
F(LoadQmlContext, loadQmlContext) \
- F(LoadQmlIdArray, loadQmlIdArray) \
F(LoadQmlImportedScripts, loadQmlImportedScripts) \
F(LoadQmlSingleton, loadQmlSingleton)
@@ -310,6 +310,12 @@ union Instr
Param base;
Param result;
};
+ struct instr_loadIdObject {
+ MOTH_INSTR_HEADER
+ int index;
+ Param base;
+ Param result;
+ };
struct instr_loadQObjectProperty {
MOTH_INSTR_HEADER
int propertyIndex;
@@ -733,10 +739,6 @@ union Instr
MOTH_INSTR_HEADER
Param result;
};
- struct instr_loadQmlIdArray {
- MOTH_INSTR_HEADER
- Param result;
- };
struct instr_loadQmlImportedScripts {
MOTH_INSTR_HEADER
Param result;
@@ -768,6 +770,7 @@ union Instr
instr_getLookup getLookup;
instr_loadScopeObjectProperty loadScopeObjectProperty;
instr_loadContextObjectProperty loadContextObjectProperty;
+ instr_loadIdObject loadIdObject;
instr_loadQObjectProperty loadQObjectProperty;
instr_loadAttachedQObjectProperty loadAttachedQObjectProperty;
instr_storeProperty storeProperty;
@@ -837,7 +840,6 @@ union Instr
instr_binopContext binopContext;
instr_loadThis loadThis;
instr_loadQmlContext loadQmlContext;
- instr_loadQmlIdArray loadQmlIdArray;
instr_loadQmlImportedScripts loadQmlImportedScripts;
instr_loadQmlSingleton loadQmlSingleton;
diff --git a/src/qml/compiler/qv4isel_moth.cpp b/src/qml/compiler/qv4isel_moth.cpp
index 4830f01152..ede1e6938f 100644
--- a/src/qml/compiler/qv4isel_moth.cpp
+++ b/src/qml/compiler/qv4isel_moth.cpp
@@ -595,13 +595,6 @@ void InstructionSelection::loadQmlContext(IR::Expr *e)
addInstruction(load);
}
-void InstructionSelection::loadQmlIdArray(IR::Expr *e)
-{
- Instruction::LoadQmlIdArray load;
- load.result = getResultParam(e);
- addInstruction(load);
-}
-
void InstructionSelection::loadQmlImportedScripts(IR::Expr *e)
{
Instruction::LoadQmlImportedScripts load;
@@ -752,6 +745,12 @@ void InstructionSelection::getQmlContextProperty(IR::Expr *source, IR::Member::M
load.propertyIndex = index;
load.result = getResultParam(target);
addInstruction(load);
+ } else if (kind == IR::Member::MemberOfIdObjectsArray) {
+ Instruction::LoadIdObject load;
+ load.base = getParam(source);
+ load.index = index;
+ load.result = getResultParam(target);
+ addInstruction(load);
} else {
Q_ASSERT(false);
}
diff --git a/src/qml/compiler/qv4isel_moth_p.h b/src/qml/compiler/qv4isel_moth_p.h
index 64e12489ca..ac1eaba740 100644
--- a/src/qml/compiler/qv4isel_moth_p.h
+++ b/src/qml/compiler/qv4isel_moth_p.h
@@ -104,7 +104,6 @@ protected:
virtual void constructValue(IR::Expr *value, IR::ExprList *args, IR::Expr *result);
virtual void loadThisObject(IR::Expr *e);
virtual void loadQmlContext(IR::Expr *e);
- virtual void loadQmlIdArray(IR::Expr *e);
virtual void loadQmlImportedScripts(IR::Expr *e);
virtual void loadQmlSingleton(const QString &name, IR::Expr *e);
virtual void loadConst(IR::Const *sourceConst, IR::Expr *e);
diff --git a/src/qml/compiler/qv4isel_p.cpp b/src/qml/compiler/qv4isel_p.cpp
index 4ed321b006..9d172b1223 100644
--- a/src/qml/compiler/qv4isel_p.cpp
+++ b/src/qml/compiler/qv4isel_p.cpp
@@ -93,8 +93,6 @@ void IRDecoder::visitMove(IR::Move *s)
loadThisObject(s->target);
else if (n->builtin == IR::Name::builtin_qml_context)
loadQmlContext(s->target);
- else if (n->builtin == IR::Name::builtin_qml_id_array)
- loadQmlIdArray(s->target);
else if (n->builtin == IR::Name::builtin_qml_imported_scripts_object)
loadQmlImportedScripts(s->target);
else if (n->qmlSingleton)
@@ -138,8 +136,8 @@ void IRDecoder::visitMove(IR::Move *s)
#else
bool captureRequired = true;
- Q_ASSERT(m->kind != IR::Member::MemberOfEnum);
- const int attachedPropertiesId = m->attachedPropertiesIdOrEnumValue;
+ Q_ASSERT(m->kind != IR::Member::MemberOfEnum && m->kind != IR::Member::MemberOfIdObjectsArray);
+ const int attachedPropertiesId = m->attachedPropertiesId;
const bool isSingletonProperty = m->kind == IR::Member::MemberOfSingletonObject;
if (_function && attachedPropertiesId == 0 && !m->property->isConstant()) {
@@ -158,6 +156,9 @@ void IRDecoder::visitMove(IR::Move *s)
getQObjectProperty(m->base, m->property->coreIndex, captureRequired, isSingletonProperty, attachedPropertiesId, s->target);
#endif // V4_BOOTSTRAP
return;
+ } else if (m->kind == IR::Member::MemberOfIdObjectsArray) {
+ getQmlContextProperty(m->base, (IR::Member::MemberKind)m->kind, m->idIndex, s->target);
+ return;
} else if (m->base->asTemp() || m->base->asConst() || m->base->asArgLocal()) {
getProperty(m->base, *m->name, s->target);
return;
@@ -177,6 +178,7 @@ void IRDecoder::visitMove(IR::Move *s)
return;
} else if (Member *member = c->base->asMember()) {
#ifndef V4_BOOTSTRAP
+ Q_ASSERT(member->kind != IR::Member::MemberOfIdObjectsArray);
if (member->kind == IR::Member::MemberOfQmlScopeObject || member->kind == IR::Member::MemberOfQmlContextObject) {
callQmlContextProperty(member->base, (IR::Member::MemberKind)member->kind, member->property->coreIndex, c->args, s->target);
return;
@@ -200,7 +202,8 @@ void IRDecoder::visitMove(IR::Move *s)
if (m->base->asTemp() || m->base->asConst() || m->base->asArgLocal()) {
if (s->source->asTemp() || s->source->asConst() || s->source->asArgLocal()) {
Q_ASSERT(m->kind != IR::Member::MemberOfEnum);
- const int attachedPropertiesId = m->attachedPropertiesIdOrEnumValue;
+ Q_ASSERT(m->kind != IR::Member::MemberOfIdObjectsArray);
+ const int attachedPropertiesId = m->attachedPropertiesId;
if (m->property && attachedPropertiesId == 0) {
#ifdef V4_BOOTSTRAP
Q_UNIMPLEMENTED();
@@ -251,6 +254,7 @@ void IRDecoder::visitExp(IR::Exp *s)
} else if (Member *member = c->base->asMember()) {
Q_ASSERT(member->base->asTemp() || member->base->asArgLocal());
#ifndef V4_BOOTSTRAP
+ Q_ASSERT(member->kind != IR::Member::MemberOfIdObjectsArray);
if (member->kind == IR::Member::MemberOfQmlScopeObject || member->kind == IR::Member::MemberOfQmlContextObject) {
callQmlContextProperty(member->base, (IR::Member::MemberKind)member->kind, member->property->coreIndex, c->args, 0);
return;
diff --git a/src/qml/compiler/qv4isel_p.h b/src/qml/compiler/qv4isel_p.h
index 80040da185..2b8aa7eb33 100644
--- a/src/qml/compiler/qv4isel_p.h
+++ b/src/qml/compiler/qv4isel_p.h
@@ -138,7 +138,6 @@ public: // to implement by subclasses:
virtual void constructValue(IR::Expr *value, IR::ExprList *args, IR::Expr *result) = 0;
virtual void loadThisObject(IR::Expr *target) = 0;
virtual void loadQmlContext(IR::Expr *target) = 0;
- virtual void loadQmlIdArray(IR::Expr *target) = 0;
virtual void loadQmlImportedScripts(IR::Expr *target) = 0;
virtual void loadQmlSingleton(const QString &name, IR::Expr *target) = 0;
virtual void loadConst(IR::Const *sourceConst, IR::Expr *target) = 0;
diff --git a/src/qml/compiler/qv4jsir.cpp b/src/qml/compiler/qv4jsir.cpp
index 841a1aefcc..98b53c6b3b 100644
--- a/src/qml/compiler/qv4jsir.cpp
+++ b/src/qml/compiler/qv4jsir.cpp
@@ -343,8 +343,6 @@ const char *builtin_to_string(Name::Builtin b)
return "builtin_convert_this_to_object";
case IR::Name::builtin_qml_context:
return "builtin_qml_context";
- case IR::Name::builtin_qml_id_array:
- return "builtin_qml_id_array";
case IR::Name::builtin_qml_imported_scripts_object:
return "builtin_qml_imported_scripts_object";
}
@@ -933,7 +931,7 @@ void CloneExpr::visitSubscript(Subscript *e)
void CloneExpr::visitMember(Member *e)
{
Expr *clonedBase = clone(e->base);
- cloned = block->MEMBER(clonedBase, e->name, e->property, e->kind, e->attachedPropertiesIdOrEnumValue);
+ cloned = block->MEMBER(clonedBase, e->name, e->property, e->kind, e->idIndex);
}
IRPrinter::IRPrinter(QTextStream *out)
@@ -1237,9 +1235,9 @@ void IRPrinter::visitSubscript(Subscript *e)
void IRPrinter::visitMember(Member *e)
{
- if (e->kind != Member::MemberOfEnum
- && e->attachedPropertiesIdOrEnumValue != 0 && !e->base->asTemp())
- *out << "[[attached property from " << e->attachedPropertiesIdOrEnumValue << "]]";
+ if (e->kind != Member::MemberOfEnum && e->kind != Member::MemberOfIdObjectsArray
+ && e->attachedPropertiesId != 0 && !e->base->asTemp())
+ *out << "[[attached property from " << e->attachedPropertiesId << "]]";
else
e->base->accept(this);
*out << '.' << *e->name;
@@ -1248,6 +1246,8 @@ void IRPrinter::visitMember(Member *e)
*out << " (meta-property " << e->property->coreIndex
<< " <" << QMetaType::typeName(e->property->propType)
<< ">)";
+ else if (e->kind == Member::MemberOfIdObjectsArray)
+ *out << "(id object " << e->idIndex << ")";
#endif
}
diff --git a/src/qml/compiler/qv4jsir_p.h b/src/qml/compiler/qv4jsir_p.h
index a4fb5246d0..568ded5337 100644
--- a/src/qml/compiler/qv4jsir_p.h
+++ b/src/qml/compiler/qv4jsir_p.h
@@ -338,7 +338,6 @@ struct Name: Expr {
builtin_setup_argument_object,
builtin_convert_this_to_object,
builtin_qml_context,
- builtin_qml_id_array,
builtin_qml_imported_scripts_object
};
@@ -557,13 +556,18 @@ struct Member: Expr {
MemberOfEnum,
MemberOfQmlScopeObject,
MemberOfQmlContextObject,
- MemberOfSingletonObject
+ MemberOfIdObjectsArray,
+ MemberOfSingletonObject,
};
Expr *base;
const QString *name;
QQmlPropertyData *property;
- int attachedPropertiesIdOrEnumValue; // depending on kind
+ union { // depending on kind
+ int attachedPropertiesId;
+ int enumValue;
+ int idIndex;
+ };
uchar freeOfSideEffects : 1;
// This is set for example for for QObject properties. All sorts of extra behavior
@@ -576,20 +580,20 @@ struct Member: Expr {
void setEnumValue(int value) {
kind = MemberOfEnum;
- attachedPropertiesIdOrEnumValue = value;
+ enumValue = value;
}
void setAttachedPropertiesId(int id) {
- Q_ASSERT(kind != MemberOfEnum);
- attachedPropertiesIdOrEnumValue = id;
+ Q_ASSERT(kind != MemberOfEnum && kind != MemberOfIdObjectsArray);
+ attachedPropertiesId = id;
}
- void init(Expr *base, const QString *name, QQmlPropertyData *property = 0, uchar kind = UnspecifiedMember, int attachedPropertiesIdOrEnumValue = 0)
+ void init(Expr *base, const QString *name, QQmlPropertyData *property = 0, uchar kind = UnspecifiedMember, int index = 0)
{
this->base = base;
this->name = name;
this->property = property;
- this->attachedPropertiesIdOrEnumValue = attachedPropertiesIdOrEnumValue;
+ this->idIndex = index;
this->freeOfSideEffects = false;
this->inhibitTypeConversionOnWrite = property != 0;
this->kind = kind;
diff --git a/src/qml/compiler/qv4ssa.cpp b/src/qml/compiler/qv4ssa.cpp
index e61a602e64..62e661c98a 100644
--- a/src/qml/compiler/qv4ssa.cpp
+++ b/src/qml/compiler/qv4ssa.cpp
@@ -3912,7 +3912,7 @@ void cfg2dot(IR::Function *f, const QVector<LoopDetection::LoopInfo *> &loops =
QString name;
if (f->name) name = *f->name;
- else name = QString::fromLatin1("%1").arg((unsigned long long)f);
+ else name = QStringLiteral("%1").arg((unsigned long long)f);
qout << "digraph \"" << name << "\" { ordering=out;\n";
foreach (LoopDetection::LoopInfo *l, loops) {
@@ -4020,14 +4020,14 @@ void optimizeSSA(StatementWorklist &W, DefUses &defUses, DominatorTree &df)
if (Member *member = m->source->asMember()) {
if (member->kind == Member::MemberOfEnum) {
Const *c = function->New<Const>();
- const int enumValue = member->attachedPropertiesIdOrEnumValue;
+ const int enumValue = member->enumValue;
c->init(SInt32Type, enumValue);
replaceUses(targetTemp, c, W);
defUses.removeDef(*targetTemp);
W.remove(s);
defUses.removeUse(s, *member->base->asTemp());
continue;
- } else if (member->attachedPropertiesIdOrEnumValue != 0 && member->property && member->base->asTemp()) {
+ } else if (member->kind != IR::Member::MemberOfIdObjectsArray && member->attachedPropertiesId != 0 && member->property && member->base->asTemp()) {
// Attached properties have no dependency on their base. Isel doesn't
// need it and we can eliminate the temp used to initialize it.
defUses.removeUse(s, *member->base->asTemp());
diff --git a/src/qml/debugger/qqmldebugconnector.cpp b/src/qml/debugger/qqmldebugconnector.cpp
index 393185bf0d..8de734fa68 100644
--- a/src/qml/debugger/qqmldebugconnector.cpp
+++ b/src/qml/debugger/qqmldebugconnector.cpp
@@ -56,6 +56,7 @@ Q_QML_IMPORT_DEBUG_PLUGIN(QQmlDebuggerServiceFactory)
struct QQmlDebugConnectorParams {
QString pluginKey;
+ QStringList services;
QString arguments;
QQmlDebugConnector *instance;
@@ -83,6 +84,13 @@ void QQmlDebugConnector::setPluginKey(const QString &key)
}
}
+void QQmlDebugConnector::setServices(const QStringList &services)
+{
+ QQmlDebugConnectorParams *params = qmlDebugConnectorParams();
+ if (params)
+ params->services = services;
+}
+
QString QQmlDebugConnector::commandLineArguments()
{
QQmlDebugConnectorParams *params = qmlDebugConnectorParams();
@@ -119,7 +127,9 @@ QQmlDebugConnector *QQmlDebugConnector::instance()
foreach (const QJsonObject &object, metaDataForQQmlDebugService()) {
foreach (const QJsonValue &key, object.value(QLatin1String("MetaData")).toObject()
.value(QLatin1String("Keys")).toArray()) {
- loadQQmlDebugService(key.toString());
+ QString keyString = key.toString();
+ if (params->services.isEmpty() || params->services.contains(keyString))
+ loadQQmlDebugService(keyString);
}
}
}
diff --git a/src/qml/debugger/qqmldebugconnector_p.h b/src/qml/debugger/qqmldebugconnector_p.h
index 02e94811a6..f5f5a87b56 100644
--- a/src/qml/debugger/qqmldebugconnector_p.h
+++ b/src/qml/debugger/qqmldebugconnector_p.h
@@ -58,6 +58,7 @@ class Q_QML_PRIVATE_EXPORT QQmlDebugConnector : public QObject
Q_OBJECT
public:
static void setPluginKey(const QString &key);
+ static void setServices(const QStringList &services);
static QQmlDebugConnector *instance();
virtual bool blockingMode() const = 0;
diff --git a/src/qml/jit/qv4isel_masm.cpp b/src/qml/jit/qv4isel_masm.cpp
index 4bf2753ae4..acead2088b 100644
--- a/src/qml/jit/qv4isel_masm.cpp
+++ b/src/qml/jit/qv4isel_masm.cpp
@@ -579,11 +579,6 @@ void InstructionSelection::loadQmlContext(IR::Expr *temp)
generateFunctionCall(temp, Runtime::getQmlContext, Assembler::EngineRegister);
}
-void InstructionSelection::loadQmlIdArray(IR::Expr *temp)
-{
- generateFunctionCall(temp, Runtime::getQmlIdArray, Assembler::EngineRegister);
-}
-
void InstructionSelection::loadQmlImportedScripts(IR::Expr *temp)
{
generateFunctionCall(temp, Runtime::getQmlImportedScripts, Assembler::EngineRegister);
@@ -681,6 +676,8 @@ void InstructionSelection::getQmlContextProperty(IR::Expr *base, IR::Member::Mem
generateFunctionCall(target, Runtime::getQmlScopeObjectProperty, Assembler::EngineRegister, Assembler::PointerToValue(base), Assembler::TrustedImm32(index));
else if (kind == IR::Member::MemberOfQmlContextObject)
generateFunctionCall(target, Runtime::getQmlContextObjectProperty, Assembler::EngineRegister, Assembler::PointerToValue(base), Assembler::TrustedImm32(index));
+ else if (kind == IR::Member::MemberOfIdObjectsArray)
+ generateFunctionCall(target, Runtime::getQmlIdObject, Assembler::EngineRegister, Assembler::PointerToValue(base), Assembler::TrustedImm32(index));
else
Q_ASSERT(false);
}
diff --git a/src/qml/jit/qv4isel_masm_p.h b/src/qml/jit/qv4isel_masm_p.h
index 61aeb2025f..6e842f5fb4 100644
--- a/src/qml/jit/qv4isel_masm_p.h
+++ b/src/qml/jit/qv4isel_masm_p.h
@@ -97,7 +97,6 @@ protected:
virtual void convertType(IR::Expr *source, IR::Expr *target);
virtual void loadThisObject(IR::Expr *temp);
virtual void loadQmlContext(IR::Expr *target);
- virtual void loadQmlIdArray(IR::Expr *target);
virtual void loadQmlImportedScripts(IR::Expr *target);
virtual void loadQmlSingleton(const QString &name, IR::Expr *target);
virtual void loadConst(IR::Const *sourceConst, IR::Expr *target);
diff --git a/src/qml/jit/qv4regalloc.cpp b/src/qml/jit/qv4regalloc.cpp
index 2d85d2ccc4..b9178c0ea0 100644
--- a/src/qml/jit/qv4regalloc.cpp
+++ b/src/qml/jit/qv4regalloc.cpp
@@ -437,12 +437,6 @@ protected: // IRDecoder
addCall();
}
- virtual void loadQmlIdArray(IR::Expr *temp)
- {
- addDef(temp);
- addCall();
- }
-
virtual void loadQmlImportedScripts(IR::Expr *temp)
{
addDef(temp);
diff --git a/src/qml/jsruntime/qv4context.cpp b/src/qml/jsruntime/qv4context.cpp
index 667ea7025a..f50c5ab017 100644
--- a/src/qml/jsruntime/qv4context.cpp
+++ b/src/qml/jsruntime/qv4context.cpp
@@ -549,3 +549,14 @@ Heap::FunctionObject *ExecutionContext::getFunctionObject() const
return 0;
}
+
+
+QObject *QmlContext::qmlScope() const
+{
+ return d()->qml->scopeObject;
+}
+
+QQmlContextData *QmlContext::qmlContext() const
+{
+ return d()->qml->context;
+}
diff --git a/src/qml/jsruntime/qv4context_p.h b/src/qml/jsruntime/qv4context_p.h
index 1e051ed850..2667bbe0b2 100644
--- a/src/qml/jsruntime/qv4context_p.h
+++ b/src/qml/jsruntime/qv4context_p.h
@@ -38,6 +38,9 @@
QT_BEGIN_NAMESPACE
+class QQmlContextData;
+class QObject;
+
namespace QV4 {
namespace CompiledData {
@@ -218,6 +221,9 @@ struct WithContext : public ExecutionContext
struct QmlContext : public ExecutionContext
{
V4_MANAGED(QmlContext, ExecutionContext)
+
+ QObject *qmlScope() const;
+ QQmlContextData *qmlContext() const;
};
inline CallContext *ExecutionContext::asCallContext()
diff --git a/src/qml/jsruntime/qv4errorobject.cpp b/src/qml/jsruntime/qv4errorobject.cpp
index 3c0a05483c..a6c2a25b91 100644
--- a/src/qml/jsruntime/qv4errorobject.cpp
+++ b/src/qml/jsruntime/qv4errorobject.cpp
@@ -361,11 +361,11 @@ ReturnedValue ErrorPrototype::method_toString(CallContext *ctx)
ScopedValue name(scope, o->get(ctx->d()->engine->id_name()));
QString qname;
if (name->isUndefined())
- qname = QString::fromLatin1("Error");
+ qname = QStringLiteral("Error");
else
qname = name->toQString();
- ScopedString s(scope, ctx->d()->engine->newString(QString::fromLatin1("message")));
+ ScopedString s(scope, ctx->d()->engine->newString(QStringLiteral("message")));
ScopedValue message(scope, o->get(s));
QString qmessage;
if (!message->isUndefined())
diff --git a/src/qml/jsruntime/qv4numberobject.cpp b/src/qml/jsruntime/qv4numberobject.cpp
index 36b83090e1..096fe9fb4c 100644
--- a/src/qml/jsruntime/qv4numberobject.cpp
+++ b/src/qml/jsruntime/qv4numberobject.cpp
@@ -124,7 +124,7 @@ ReturnedValue NumberPrototype::method_toString(CallContext *ctx)
if (ctx->argc() && !ctx->args()[0].isUndefined()) {
int radix = ctx->args()[0].toInt32();
if (radix < 2 || radix > 36)
- return ctx->engine()->throwError(QString::fromLatin1("Number.prototype.toString: %0 is not a valid radix")
+ return ctx->engine()->throwError(QStringLiteral("Number.prototype.toString: %0 is not a valid radix")
.arg(radix));
if (std::isnan(num)) {
@@ -202,7 +202,7 @@ ReturnedValue NumberPrototype::method_toFixed(CallContext *ctx)
QString str;
if (std::isnan(v))
- str = QString::fromLatin1("NaN");
+ str = QStringLiteral("NaN");
else if (qIsInf(v))
str = QString::fromLatin1(v < 0 ? "-Infinity" : "Infinity");
else if (v < 1.e21) {
diff --git a/src/qml/jsruntime/qv4objectproto.cpp b/src/qml/jsruntime/qv4objectproto.cpp
index 41483e9ef5..1edf76e2de 100644
--- a/src/qml/jsruntime/qv4objectproto.cpp
+++ b/src/qml/jsruntime/qv4objectproto.cpp
@@ -392,7 +392,7 @@ ReturnedValue ObjectPrototype::method_toString(CallContext *ctx)
} else {
ScopedObject obj(scope, RuntimeHelpers::toObject(scope.engine, ctx->thisObject()));
QString className = obj->className();
- return ctx->d()->engine->newString(QString::fromLatin1("[object %1]").arg(className))->asReturnedValue();
+ return ctx->d()->engine->newString(QStringLiteral("[object %1]").arg(className))->asReturnedValue();
}
}
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp
index 31abab2e2f..529703bda4 100644
--- a/src/qml/jsruntime/qv4qobjectwrapper.cpp
+++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp
@@ -835,7 +835,7 @@ struct QObjectSlotDispatcher : public QtPrivate::QSlotObjectBase
QQmlError error = v4->catchExceptionAsQmlError();
if (error.description().isEmpty()) {
QV4::ScopedString name(scope, f->name());
- error.setDescription(QString::fromLatin1("Unknown exception occurred during evaluation of connected function: %1").arg(name->toQString()));
+ error.setDescription(QStringLiteral("Unknown exception occurred during evaluation of connected function: %1").arg(name->toQString()));
}
if (QQmlEngine *qmlEngine = v4->qmlEngine()) {
QQmlEnginePrivate::get(qmlEngine)->warning(error);
@@ -1371,7 +1371,7 @@ static QV4::ReturnedValue CallPrecise(const QQmlObjectOrGadget &object, const QQ
if (returnType == QMetaType::UnknownType) {
QString typeName = QString::fromLatin1(unknownTypeError);
- QString error = QString::fromLatin1("Unknown method return type: %1").arg(typeName);
+ QString error = QStringLiteral("Unknown method return type: %1").arg(typeName);
return engine->throwError(error);
}
@@ -1384,7 +1384,7 @@ static QV4::ReturnedValue CallPrecise(const QQmlObjectOrGadget &object, const QQ
if (!args) {
QString typeName = QString::fromLatin1(unknownTypeError);
- QString error = QString::fromLatin1("Unknown method parameter type: %1").arg(typeName);
+ QString error = QStringLiteral("Unknown method parameter type: %1").arg(typeName);
return engine->throwError(error);
}
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp
index e9311cf7f3..089922d03e 100644
--- a/src/qml/jsruntime/qv4runtime.cpp
+++ b/src/qml/jsruntime/qv4runtime.cpp
@@ -47,6 +47,8 @@
#include "qv4scopedvalue_p.h"
#include <private/qqmlcontextwrapper_p.h>
#include <private/qqmltypewrapper_p.h>
+#include <private/qqmlengine_p.h>
+#include <private/qqmljavascriptexpression_p.h>
#include "qv4qobjectwrapper_p.h"
#include <private/qv8engine_p.h>
#endif
@@ -1361,12 +1363,6 @@ ReturnedValue Runtime::regexpLiteral(ExecutionEngine *engine, int id)
return engine->currentContext()->compilationUnit->runtimeRegularExpressions[id].asReturnedValue();
}
-ReturnedValue Runtime::getQmlIdArray(NoThrowEngine *engine)
-{
- Q_ASSERT(engine->qmlContextObject());
- return engine->qmlContextObject()->asReturnedValue();
-}
-
ReturnedValue Runtime::getQmlQObjectProperty(ExecutionEngine *engine, const Value &object, int propertyIndex, bool captureRequired)
{
Scope scope(engine);
@@ -1411,6 +1407,21 @@ ReturnedValue Runtime::getQmlSingletonQObjectProperty(ExecutionEngine *engine, c
return QV4::QObjectWrapper::getProperty(scope.engine, wrapper->singletonObject(), propertyIndex, captureRequired);
}
+ReturnedValue Runtime::getQmlIdObject(ExecutionEngine *engine, const Value &c, uint index)
+{
+ Scope scope(engine);
+ const QmlContext &qmlContext = static_cast<const QmlContext &>(c);
+ QQmlContextData *context = qmlContext.d()->qml->context;
+ if (!context || index >= (uint)context->idValueCount)
+ return Encode::undefined();
+
+ QQmlEnginePrivate *ep = engine->qmlEngine() ? QQmlEnginePrivate::get(engine->qmlEngine()) : 0;
+ if (ep && ep->propertyCapture)
+ ep->propertyCapture->captureProperty(&context->idValues[index].bindings);
+
+ return QObjectWrapper::wrap(engine, context->idValues[index].data());
+}
+
void Runtime::setQmlScopeObjectProperty(ExecutionEngine *engine, const Value &context, int propertyIndex, const Value &value)
{
const QmlContext &c = static_cast<const QmlContext &>(context);
diff --git a/src/qml/jsruntime/qv4runtime_p.h b/src/qml/jsruntime/qv4runtime_p.h
index cdf7f018ff..f597e4b2e3 100644
--- a/src/qml/jsruntime/qv4runtime_p.h
+++ b/src/qml/jsruntime/qv4runtime_p.h
@@ -210,7 +210,6 @@ struct Q_QML_PRIVATE_EXPORT Runtime {
// qml
static ReturnedValue getQmlContext(NoThrowEngine *engine);
- static ReturnedValue getQmlIdArray(NoThrowEngine *engine);
static ReturnedValue getQmlImportedScripts(NoThrowEngine *engine);
static ReturnedValue getQmlSingleton(NoThrowEngine *engine, int nameIndex);
static ReturnedValue getQmlAttachedProperty(ExecutionEngine *engine, int attachedPropertiesId, int propertyIndex);
@@ -218,6 +217,8 @@ struct Q_QML_PRIVATE_EXPORT Runtime {
static ReturnedValue getQmlContextObjectProperty(ExecutionEngine *engine, const Value &context, int propertyIndex);
static ReturnedValue getQmlQObjectProperty(ExecutionEngine *engine, const Value &object, int propertyIndex, bool captureRequired);
static ReturnedValue getQmlSingletonQObjectProperty(ExecutionEngine *engine, const Value &object, int propertyIndex, bool captureRequired);
+ static ReturnedValue getQmlIdObject(ExecutionEngine *engine, const Value &context, uint index);
+
static void setQmlScopeObjectProperty(ExecutionEngine *engine, const Value &context, int propertyIndex, const Value &value);
static void setQmlContextObjectProperty(ExecutionEngine *engine, const Value &context, int propertyIndex, const Value &value);
static void setQmlQObjectProperty(ExecutionEngine *engine, const Value &object, int propertyIndex, const Value &value);
diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h
index 3aa1a6df39..c0420a38db 100644
--- a/src/qml/jsruntime/qv4value_p.h
+++ b/src/qml/jsruntime/qv4value_p.h
@@ -39,16 +39,6 @@
#include "qv4global_p.h"
#include <private/qv4heap_p.h>
-#ifndef Q_ALWAYS_INLINE
-#if defined(Q_CC_GNU)
-# define Q_ALWAYS_INLINE inline __attribute__((always_inline))
-#elif defined(Q_CC_MSVC)
-# define Q_ALWAYS_INLINE __forceinline
-#else
-# define Q_ALWAYS_INLINE inline
-#endif
-#endif // Q_ALWAYS_INLINE
-
QT_BEGIN_NAMESPACE
namespace QV4 {
diff --git a/src/qml/jsruntime/qv4variantobject.cpp b/src/qml/jsruntime/qv4variantobject.cpp
index c919d24461..f9e26efe71 100644
--- a/src/qml/jsruntime/qv4variantobject.cpp
+++ b/src/qml/jsruntime/qv4variantobject.cpp
@@ -129,7 +129,7 @@ QV4::ReturnedValue VariantPrototype::method_toString(CallContext *ctx)
return Encode::undefined();
QString result = o->d()->data.toString();
if (result.isEmpty() && !o->d()->data.canConvert(QVariant::String))
- result = QString::fromLatin1("QVariant(%0)").arg(QString::fromLatin1(o->d()->data.typeName()));
+ result = QStringLiteral("QVariant(%0)").arg(QString::fromLatin1(o->d()->data.typeName()));
return Encode(ctx->d()->engine->newString(result));
}
diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp
index 7caebe33b6..d0ae44ccea 100644
--- a/src/qml/jsruntime/qv4vme_moth.cpp
+++ b/src/qml/jsruntime/qv4vme_moth.cpp
@@ -531,6 +531,10 @@ QV4::ReturnedValue VME::run(ExecutionEngine *engine, const uchar *code
STOREVALUE(instr.result, Runtime::getQmlContextObjectProperty(engine, VALUE(instr.base), instr.propertyIndex));
MOTH_END_INSTR(LoadContextObjectProperty)
+ MOTH_BEGIN_INSTR(LoadIdObject)
+ STOREVALUE(instr.result, Runtime::getQmlIdObject(engine, VALUE(instr.base), instr.index));
+ MOTH_END_INSTR(LoadIdObject)
+
MOTH_BEGIN_INSTR(LoadAttachedQObjectProperty)
STOREVALUE(instr.result, Runtime::getQmlAttachedProperty(engine, instr.attachedPropertiesId, instr.propertyIndex));
MOTH_END_INSTR(LoadAttachedQObjectProperty)
@@ -907,10 +911,6 @@ QV4::ReturnedValue VME::run(ExecutionEngine *engine, const uchar *code
VALUE(instr.result) = Runtime::getQmlContext(static_cast<QV4::NoThrowEngine*>(engine));
MOTH_END_INSTR(LoadQmlContext)
- MOTH_BEGIN_INSTR(LoadQmlIdArray)
- VALUE(instr.result) = Runtime::getQmlIdArray(static_cast<QV4::NoThrowEngine*>(engine));
- MOTH_END_INSTR(LoadQmlIdArray)
-
MOTH_BEGIN_INSTR(LoadQmlImportedScripts)
VALUE(instr.result) = Runtime::getQmlImportedScripts(static_cast<QV4::NoThrowEngine*>(engine));
MOTH_END_INSTR(LoadQmlImportedScripts)
diff --git a/src/qml/memory/qv4mm.cpp b/src/qml/memory/qv4mm.cpp
index 24be663ed7..03e78df91a 100644
--- a/src/qml/memory/qv4mm.cpp
+++ b/src/qml/memory/qv4mm.cpp
@@ -275,7 +275,6 @@ Heap::Base *MemoryManager::allocData(std::size_t size)
Q_V4_PROFILE_ALLOC(m_d->engine, allocSize, Profiling::HeapPage),
OSAllocator::JSGCHeapPages);
m_d->heapChunks.append(allocation);
- std::sort(m_d->heapChunks.begin(), m_d->heapChunks.end());
header = reinterpret_cast<Data::ChunkHeader *>(allocation.base());
header->itemSize = int(size);
diff --git a/src/qml/qml/qqmlcontextwrapper.cpp b/src/qml/qml/qqmlcontextwrapper.cpp
index fd85b64ad1..23084fb202 100644
--- a/src/qml/qml/qqmlcontextwrapper.cpp
+++ b/src/qml/qml/qqmlcontextwrapper.cpp
@@ -336,8 +336,8 @@ void QmlContextWrapper::registerQmlDependencies(ExecutionEngine *engine, const C
return;
QV4::Scope scope(engine);
- QV4::Scoped<QmlContextWrapper> contextWrapper(scope, engine->qmlContextObject());
- QQmlContextData *qmlContext = contextWrapper->getContext();
+ QV4::Scoped<QmlContext> context(scope, engine->qmlContext());
+ QQmlContextData *qmlContext = context->qmlContext();
const quint32 *idObjectDependency = compiledFunction->qmlIdObjectDependencyTable();
const int idObjectDependencyCount = compiledFunction->nDependingIdObjects;
@@ -355,7 +355,7 @@ void QmlContextWrapper::registerQmlDependencies(ExecutionEngine *engine, const C
capture->captureProperty(qmlContext->contextObject, propertyIndex, notifyIndex);
}
- QObject *scopeObject = contextWrapper->getScopeObject();
+ QObject *scopeObject = context->qmlScope();
const quint32 *scopePropertyDependency = compiledFunction->qmlScopePropertiesDependencyTable();
const int scopePropertyDependencyCount = compiledFunction->nDependingScopeProperties;
for (int i = 0; i < scopePropertyDependencyCount; ++i) {
@@ -387,30 +387,4 @@ ReturnedValue QmlContextWrapper::qmlSingletonWrapper(ExecutionEngine *v4, String
return QJSValuePrivate::convertedToValue(engine(), siinfo->scriptApi(e));
}
-ReturnedValue QmlContextWrapper::getIndexed(const Managed *m, uint index, bool *hasProperty)
-{
- const QV4::QmlContextWrapper *This = static_cast<const QV4::QmlContextWrapper *>(m);
- Scope scope(This->engine());
- QQmlContextData *context = This->getContext();
- if (!context) {
- if (hasProperty)
- *hasProperty = false;
- return Encode::undefined();
- }
- if (index >= (uint)context->idValueCount) {
- if (hasProperty)
- *hasProperty = false;
- return Encode::undefined();
- }
-
- if (hasProperty)
- *hasProperty = true;
-
- QQmlEnginePrivate *ep = scope.engine->qmlEngine() ? QQmlEnginePrivate::get(scope.engine->qmlEngine()) : 0;
- if (ep && ep->propertyCapture)
- ep->propertyCapture->captureProperty(&context->idValues[index].bindings);
-
- return QObjectWrapper::wrap(This->engine(), context->idValues[index].data());
-}
-
QT_END_NAMESPACE
diff --git a/src/qml/qml/qqmlcontextwrapper_p.h b/src/qml/qml/qqmlcontextwrapper_p.h
index e806077326..7b5d3216df 100644
--- a/src/qml/qml/qqmlcontextwrapper_p.h
+++ b/src/qml/qml/qqmlcontextwrapper_p.h
@@ -102,8 +102,6 @@ struct Q_QML_EXPORT QmlContextWrapper : Object
static void registerQmlDependencies(ExecutionEngine *context, const CompiledData::Function *compiledFunction);
ReturnedValue qmlSingletonWrapper(ExecutionEngine *e, String *name);
-
- static ReturnedValue getIndexed(const Managed *m, uint index, bool *hasProperty);
};
}
diff --git a/src/qml/qml/qqmldirparser.cpp b/src/qml/qml/qqmldirparser.cpp
index a45152e0a0..57b50733ea 100644
--- a/src/qml/qml/qqmldirparser.cpp
+++ b/src/qml/qml/qqmldirparser.cpp
@@ -146,7 +146,7 @@ bool QQmlDirParser::parse(const QString &source)
if (invalidLine) {
reportError(lineNumber, 0,
- QString::fromLatin1("invalid qmldir directive contains too many tokens"));
+ QStringLiteral("invalid qmldir directive contains too many tokens"));
continue;
} else if (sectionCount == 0) {
continue; // no sections, no party.
@@ -154,17 +154,17 @@ bool QQmlDirParser::parse(const QString &source)
} else if (sections[0] == QLatin1String("module")) {
if (sectionCount != 2) {
reportError(lineNumber, 0,
- QString::fromLatin1("module identifier directive requires one argument, but %1 were provided").arg(sectionCount - 1));
+ QStringLiteral("module identifier directive requires one argument, but %1 were provided").arg(sectionCount - 1));
continue;
}
if (!_typeNamespace.isEmpty()) {
reportError(lineNumber, 0,
- QString::fromLatin1("only one module identifier directive may be defined in a qmldir file"));
+ QStringLiteral("only one module identifier directive may be defined in a qmldir file"));
continue;
}
if (!firstLine) {
reportError(lineNumber, 0,
- QString::fromLatin1("module identifier directive must be the first directive in a qmldir file"));
+ QStringLiteral("module identifier directive must be the first directive in a qmldir file"));
continue;
}
@@ -173,7 +173,7 @@ bool QQmlDirParser::parse(const QString &source)
} else if (sections[0] == QLatin1String("plugin")) {
if (sectionCount < 2 || sectionCount > 3) {
reportError(lineNumber, 0,
- QString::fromLatin1("plugin directive requires one or two arguments, but %1 were provided").arg(sectionCount - 1));
+ QStringLiteral("plugin directive requires one or two arguments, but %1 were provided").arg(sectionCount - 1));
continue;
}
@@ -185,7 +185,7 @@ bool QQmlDirParser::parse(const QString &source)
} else if (sections[0] == QLatin1String("internal")) {
if (sectionCount != 3) {
reportError(lineNumber, 0,
- QString::fromLatin1("internal types require 2 arguments, but %1 were provided").arg(sectionCount - 1));
+ QStringLiteral("internal types require 2 arguments, but %1 were provided").arg(sectionCount - 1));
continue;
}
Component entry(sections[1], sections[2], -1, -1);
@@ -194,7 +194,7 @@ bool QQmlDirParser::parse(const QString &source)
} else if (sections[0] == QLatin1String("singleton")) {
if (sectionCount < 3 || sectionCount > 4) {
reportError(lineNumber, 0,
- QString::fromLatin1("singleton types require 2 or 3 arguments, but %1 were provided").arg(sectionCount - 1));
+ QStringLiteral("singleton types require 2 or 3 arguments, but %1 were provided").arg(sectionCount - 1));
continue;
} else if (sectionCount == 3) {
// handle qmldir directory listing case where singleton is defined in the following pattern:
@@ -218,7 +218,7 @@ bool QQmlDirParser::parse(const QString &source)
} else if (sections[0] == QLatin1String("typeinfo")) {
if (sectionCount != 2) {
reportError(lineNumber, 0,
- QString::fromLatin1("typeinfo requires 1 argument, but %1 were provided").arg(sectionCount - 1));
+ QStringLiteral("typeinfo requires 1 argument, but %1 were provided").arg(sectionCount - 1));
continue;
}
#ifdef QT_CREATOR
@@ -228,13 +228,13 @@ bool QQmlDirParser::parse(const QString &source)
} else if (sections[0] == QLatin1String("designersupported")) {
if (sectionCount != 1)
- reportError(lineNumber, 0, QString::fromLatin1("designersupported does not expect any argument"));
+ reportError(lineNumber, 0, QStringLiteral("designersupported does not expect any argument"));
else
_designerSupported = true;
} else if (sections[0] == QLatin1String("depends")) {
if (sectionCount != 3) {
reportError(lineNumber, 0,
- QString::fromLatin1("depends requires 2 arguments, but %1 were provided").arg(sectionCount - 1));
+ QStringLiteral("depends requires 2 arguments, but %1 were provided").arg(sectionCount - 1));
continue;
}
@@ -268,7 +268,7 @@ bool QQmlDirParser::parse(const QString &source)
}
} else {
reportError(lineNumber, 0,
- QString::fromLatin1("a component declaration requires two or three arguments, but %1 were provided").arg(sectionCount));
+ QStringLiteral("a component declaration requires two or three arguments, but %1 were provided").arg(sectionCount));
}
firstLine = false;
@@ -364,14 +364,14 @@ bool QQmlDirParser::designerSupported() const
QDebug &operator<< (QDebug &debug, const QQmlDirParser::Component &component)
{
- const QString output = QString::fromLatin1("{%1 %2.%3}").
+ const QString output = QStringLiteral("{%1 %2.%3}").
arg(component.typeName).arg(component.majorVersion).arg(component.minorVersion);
return debug << qPrintable(output);
}
QDebug &operator<< (QDebug &debug, const QQmlDirParser::Script &script)
{
- const QString output = QString::fromLatin1("{%1 %2.%3}").
+ const QString output = QStringLiteral("{%1 %2.%3}").
arg(script.nameSpace).arg(script.majorVersion).arg(script.minorVersion);
return debug << qPrintable(output);
}
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index df5f50644c..70c682dedd 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -1638,7 +1638,7 @@ void QQmlData::destroyed(QObject *object)
if (location.sourceFile.isEmpty())
location.sourceFile = QStringLiteral("<Unknown File>");
locationString.append(location.sourceFile);
- locationString.append(QString::fromLatin1(":%0: ").arg(location.line));
+ locationString.append(QStringLiteral(":%0: ").arg(location.line));
QString source = expr->expression();
if (source.size() > 100) {
source.truncate(96);
diff --git a/src/qml/qml/qqmlglobal.cpp b/src/qml/qml/qqmlglobal.cpp
index d904242f93..0a2f4079c2 100644
--- a/src/qml/qml/qqmlglobal.cpp
+++ b/src/qml/qml/qqmlglobal.cpp
@@ -359,7 +359,7 @@ QObject *QQmlGuiProvider::inputMethod()
{
// We don't have any input method code by default
QObject *o = new QObject();
- o->setObjectName(QString::fromLatin1("No inputMethod available"));
+ o->setObjectName(QStringLiteral("No inputMethod available"));
QQmlEngine::setObjectOwnership(o, QQmlEngine::JavaScriptOwnership);
return o;
}
@@ -368,7 +368,7 @@ QObject *QQmlGuiProvider::inputMethod()
QObject *QQmlGuiProvider::styleHints()
{
QObject *o = new QObject();
- o->setObjectName(QString::fromLatin1("No styleHints available"));
+ o->setObjectName(QStringLiteral("No styleHints available"));
QQmlEngine::setObjectOwnership(o, QQmlEngine::JavaScriptOwnership);
return o;
}
diff --git a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
index c0e3b4129b..ce86fd3923 100644
--- a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
+++ b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
@@ -1355,12 +1355,12 @@ static QString jsStack(QV4::ExecutionEngine *engine) {
QString stackFrame;
if (frame.column >= 0)
- stackFrame = QString::fromLatin1("%1 (%2:%3:%4)").arg(frame.function,
+ stackFrame = QStringLiteral("%1 (%2:%3:%4)").arg(frame.function,
frame.source,
QString::number(frame.line),
QString::number(frame.column));
else
- stackFrame = QString::fromLatin1("%1 (%2:%3)").arg(frame.function,
+ stackFrame = QStringLiteral("%1 (%2:%3)").arg(frame.function,
frame.source,
QString::number(frame.line));
diff --git a/src/qml/types/qqmllistmodel.cpp b/src/qml/types/qqmllistmodel.cpp
index 6fc0e4a9d8..de46020ad8 100644
--- a/src/qml/types/qqmllistmodel.cpp
+++ b/src/qml/types/qqmllistmodel.cpp
@@ -88,7 +88,7 @@ const ListLayout::Role &ListLayout::getRoleOrCreate(const QString &key, Role::Da
if (node) {
const Role &r = *node->value;
if (type != r.type)
- qmlInfo(0) << QString::fromLatin1("Can't assign to existing role '%1' of different type [%2 -> %3]").arg(r.name).arg(roleTypeName(type)).arg(roleTypeName(r.type));
+ qmlInfo(0) << QStringLiteral("Can't assign to existing role '%1' of different type [%2 -> %3]").arg(r.name).arg(roleTypeName(type)).arg(roleTypeName(r.type));
return r;
}
@@ -101,7 +101,7 @@ const ListLayout::Role &ListLayout::getRoleOrCreate(QV4::String *key, Role::Data
if (node) {
const Role &r = *node->value;
if (type != r.type)
- qmlInfo(0) << QString::fromLatin1("Can't assign to existing role '%1' of different type [%2 -> %3]").arg(r.name).arg(roleTypeName(type)).arg(roleTypeName(r.type));
+ qmlInfo(0) << QStringLiteral("Can't assign to existing role '%1' of different type [%2 -> %3]").arg(r.name).arg(roleTypeName(type)).arg(roleTypeName(r.type));
return r;
}
@@ -1185,7 +1185,7 @@ int ListElement::setJsProperty(const ListLayout::Role &role, const QV4::Value &d
}
roleIndex = setListProperty(role, subModel);
} else {
- qmlInfo(0) << QString::fromLatin1("Can't assign to existing role '%1' of different type [%2 -> %3]").arg(role.name).arg(roleTypeName(role.type)).arg(roleTypeName(ListLayout::Role::List));
+ qmlInfo(0) << QStringLiteral("Can't assign to existing role '%1' of different type [%2 -> %3]").arg(role.name).arg(roleTypeName(role.type)).arg(roleTypeName(ListLayout::Role::List));
}
} else if (d.isBoolean()) {
roleIndex = setBoolProperty(role, d.booleanValue());