aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
diff options
context:
space:
mode:
authorJani Heikkinen <jani.heikkinen@digia.com>2014-04-23 12:44:13 +0300
committerJani Heikkinen <jani.heikkinen@digia.com>2014-04-23 12:44:14 +0300
commit7d16c2f40a2995c6bdff3a1999a7cb6100fdf301 (patch)
treefda2e8a1b363caae655ba1369e54ec0257c7d067 /src/qml
parentaedcd57c84ac9d6b74816c13bdf3fde31e1132b5 (diff)
parent937fdde5d3b26291d417f856ee05ba479a6ba730 (diff)
Merge remote-tracking branch 'origin/release' into stable
Diffstat (limited to 'src/qml')
-rw-r--r--src/qml/compiler/qv4codegen.cpp6
-rw-r--r--src/qml/compiler/qv4compileddata_p.h2
-rw-r--r--src/qml/jit/qv4assembler_p.h6
-rw-r--r--src/qml/jit/qv4isel_masm.cpp6
-rw-r--r--src/qml/jsruntime/qv4qobjectwrapper.cpp2
-rw-r--r--src/qml/qml/qqmlproperty.cpp6
-rw-r--r--src/qml/types/qqmldelegatemodel_p_p.h2
7 files changed, 18 insertions, 12 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp
index d1450f051c..1e067c8a1e 100644
--- a/src/qml/compiler/qv4codegen.cpp
+++ b/src/qml/compiler/qv4codegen.cpp
@@ -2212,8 +2212,6 @@ bool Codegen::visit(ForEachStatement *ast)
IR::BasicBlock *foreachbody = _function->newBasicBlock(foreachin, exceptionHandler());
IR::BasicBlock *foreachend = _function->newBasicBlock(groupStartBlock(), exceptionHandler());
- enterLoop(ast, foreachin, foreachend, foreachin);
-
int objectToIterateOn = _block->newTemp();
move(_block->TEMP(objectToIterateOn), *expression(ast->expression));
IR::ExprList *args = _function->New<IR::ExprList>();
@@ -2222,6 +2220,7 @@ bool Codegen::visit(ForEachStatement *ast)
int iterator = _block->newTemp();
move(_block->TEMP(iterator), _block->CALL(_block->NAME(IR::Name::builtin_foreach_iterator_object, 0, 0), args));
+ enterLoop(ast, foreachin, foreachend, foreachin);
_block->JUMP(foreachin);
_block = foreachbody;
@@ -2352,8 +2351,6 @@ bool Codegen::visit(LocalForEachStatement *ast)
IR::BasicBlock *foreachbody = _function->newBasicBlock(foreachin, exceptionHandler());
IR::BasicBlock *foreachend = _function->newBasicBlock(groupStartBlock(), exceptionHandler());
- enterLoop(ast, foreachin, foreachend, foreachin);
-
variableDeclaration(ast->declaration);
int iterator = _block->newTemp();
@@ -2363,6 +2360,7 @@ bool Codegen::visit(LocalForEachStatement *ast)
move(_block->TEMP(iterator), _block->CALL(_block->NAME(IR::Name::builtin_foreach_iterator_object, 0, 0), args));
_block->JUMP(foreachin);
+ enterLoop(ast, foreachin, foreachend, foreachin);
_block = foreachbody;
int temp = _block->newTemp();
diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h
index afcf2c6a24..a4dcfd9209 100644
--- a/src/qml/compiler/qv4compileddata_p.h
+++ b/src/qml/compiler/qv4compileddata_p.h
@@ -196,6 +196,8 @@ struct Unit
const uint *offsetTable = reinterpret_cast<const uint*>((reinterpret_cast<const char *>(this)) + offsetToStringTable);
const uint offset = offsetTable[idx];
const String *str = reinterpret_cast<const String*>(reinterpret_cast<const char *>(this) + offset);
+ if (str->str.size == 0)
+ return QString();
QStringDataPtr holder = { const_cast<QStringData *>(static_cast<const QStringData*>(&str->str)) };
QString qstr(holder);
if (flags & StaticData)
diff --git a/src/qml/jit/qv4assembler_p.h b/src/qml/jit/qv4assembler_p.h
index 19804e7293..6fde517e1f 100644
--- a/src/qml/jit/qv4assembler_p.h
+++ b/src/qml/jit/qv4assembler_p.h
@@ -219,12 +219,12 @@ public:
#define ARGUMENTS_IN_REGISTERS
#undef HAVE_ALU_OPS_WITH_MEM_OPERAND
- static const RegisterID StackFrameRegister = JSC::ARMRegisters::r4;
- static const RegisterID StackPointerRegister = JSC::ARMRegisters::sp;
+ static const RegisterID StackPointerRegister = JSC::ARMRegisters::sp; // r13
+ static const RegisterID StackFrameRegister = JSC::ARMRegisters::fp; // r11
static const RegisterID LocalsRegister = JSC::ARMRegisters::r7;
+ static const RegisterID ScratchRegister = JSC::ARMRegisters::r6;
static const RegisterID ContextRegister = JSC::ARMRegisters::r5;
static const RegisterID ReturnValueRegister = JSC::ARMRegisters::r0;
- static const RegisterID ScratchRegister = JSC::ARMRegisters::r6;
static const FPRegisterID FPGpr0 = JSC::ARMRegisters::d0;
static const FPRegisterID FPGpr1 = JSC::ARMRegisters::d1;
diff --git a/src/qml/jit/qv4isel_masm.cpp b/src/qml/jit/qv4isel_masm.cpp
index 74b404a793..3307fcc0d1 100644
--- a/src/qml/jit/qv4isel_masm.cpp
+++ b/src/qml/jit/qv4isel_masm.cpp
@@ -258,10 +258,10 @@ static QVector<int> getIntRegisters()
static const QVector<int> intRegisters = QVector<int>()
<< JSC::ARMRegisters::r1
<< JSC::ARMRegisters::r2
+ << JSC::ARMRegisters::r3
+ << JSC::ARMRegisters::r4
<< JSC::ARMRegisters::r8
- << JSC::ARMRegisters::r9
- << JSC::ARMRegisters::r10
- << JSC::ARMRegisters::r11;
+ << JSC::ARMRegisters::r9;
return intRegisters;
}
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp
index de556dc9ed..b61be913a6 100644
--- a/src/qml/jsruntime/qv4qobjectwrapper.cpp
+++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp
@@ -685,7 +685,7 @@ void QObjectWrapper::put(Managed *m, const StringRef name, const ValueRef value)
QQmlData *ddata = QQmlData::get(that->m_object);
// Types created by QML are not extensible at run-time, but for other QObjects we can store them
// as regular JavaScript properties, like on JavaScript objects.
- if (ddata && ddata->compiledData) {
+ if (ddata && ddata->context) {
QString error = QLatin1String("Cannot assign to non-existent property \"") +
name->toQString() + QLatin1Char('\"');
v4->currentContext()->throwError(error);
diff --git a/src/qml/qml/qqmlproperty.cpp b/src/qml/qml/qqmlproperty.cpp
index 0bbcafda54..1075b53c5e 100644
--- a/src/qml/qml/qqmlproperty.cpp
+++ b/src/qml/qml/qqmlproperty.cpp
@@ -1403,6 +1403,12 @@ bool QQmlPropertyPrivate::write(QObject *object,
v = value;
if (v.convert(propertyType)) {
ok = true;
+ } else if (v.isValid() && value.isNull()) {
+ // For historical reasons converting a null QVariant to another type will do the trick
+ // but return false anyway. This is caught with the above condition and considered a
+ // successful conversion.
+ Q_ASSERT(v.userType() == propertyType);
+ ok = true;
} else if ((uint)propertyType >= QVariant::UserType && variantType == QVariant::String) {
QQmlMetaType::StringConverter con = QQmlMetaType::customStringConverter(propertyType);
if (con) {
diff --git a/src/qml/types/qqmldelegatemodel_p_p.h b/src/qml/types/qqmldelegatemodel_p_p.h
index 32b1154d30..7da089c9b8 100644
--- a/src/qml/types/qqmldelegatemodel_p_p.h
+++ b/src/qml/types/qqmldelegatemodel_p_p.h
@@ -144,7 +144,7 @@ public:
QQmlDelegateModelItemMetaType * const metaType;
QQmlContextData *contextData;
QObject *object;
- QQmlDelegateModelAttached *attached;
+ QPointer<QQmlDelegateModelAttached> attached;
QQDMIncubationTask *incubationTask;
int objectRef;
int scriptRef;