aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-02-11 11:08:11 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2014-02-11 12:00:31 +0100
commit7c9497a6d47a02d961baef3993ba4cf4267ec607 (patch)
tree335fae3e9e3a84d33310efca23f1d6993265805b /src/qml
parent67ba88947f57ab2d1859bbeb96c6dcba020561b1 (diff)
parent6c840c70d61c3ae277b60a024a086215c743e5b3 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: src/qml/compiler/qv4ssa.cpp src/qml/jsruntime/qv4arrayobject.cpp src/qml/jsruntime/qv4context.cpp Change-Id: Ied5b23bec4dc14abe51127c507aed668f855c1e1
Diffstat (limited to 'src/qml')
-rw-r--r--src/qml/compiler/qv4isel_masm.cpp2
-rw-r--r--src/qml/compiler/qv4isel_masm_p.h4
-rw-r--r--src/qml/compiler/qv4regalloc.cpp34
-rw-r--r--src/qml/compiler/qv4ssa.cpp9
-rw-r--r--src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc2
-rw-r--r--src/qml/jsruntime/qv4arrayobject.cpp2
-rw-r--r--src/qml/jsruntime/qv4context.cpp2
-rw-r--r--src/qml/jsruntime/qv4context_p.h2
-rw-r--r--src/qml/jsruntime/qv4qobjectwrapper.cpp15
-rw-r--r--src/qml/qml/qqmlengine.cpp4
-rw-r--r--src/qml/qml/qqmllocale.cpp9
-rw-r--r--src/qml/qml/qqmlvme.cpp6
12 files changed, 65 insertions, 26 deletions
diff --git a/src/qml/compiler/qv4isel_masm.cpp b/src/qml/compiler/qv4isel_masm.cpp
index a1145c2f10..c89b108309 100644
--- a/src/qml/compiler/qv4isel_masm.cpp
+++ b/src/qml/compiler/qv4isel_masm.cpp
@@ -122,7 +122,7 @@ static const Assembler::RegisterID calleeSavedRegisters[] = {
#if CPU(X86)
static const Assembler::RegisterID calleeSavedRegisters[] = {
- // Not used: JSC::X86Registers::ebx,
+ JSC::X86Registers::ebx, // temporary register
JSC::X86Registers::esi, // ContextRegister
JSC::X86Registers::edi // LocalsRegister
};
diff --git a/src/qml/compiler/qv4isel_masm_p.h b/src/qml/compiler/qv4isel_masm_p.h
index b1e981533b..76fe6c6391 100644
--- a/src/qml/compiler/qv4isel_masm_p.h
+++ b/src/qml/compiler/qv4isel_masm_p.h
@@ -981,6 +981,10 @@ public:
prepareRelativeCall(function, this);
loadArgumentOnStackOrRegister<0>(arg1);
+#if OS(LINUX) && CPU(X86) && (defined(__PIC__) || defined(__PIE__))
+ load32(Address(StackFrameRegister, -sizeof(void*)), JSC::X86Registers::ebx); // restore the GOT ptr
+#endif
+
callAbsolute(functionName, function);
if (stackSpaceNeeded)
diff --git a/src/qml/compiler/qv4regalloc.cpp b/src/qml/compiler/qv4regalloc.cpp
index bc88d5849a..cc9ce4fc96 100644
--- a/src/qml/compiler/qv4regalloc.cpp
+++ b/src/qml/compiler/qv4regalloc.cpp
@@ -114,6 +114,13 @@ public:
return false;
}
+ bool isUsedAt(const Temp &t, int position) {
+ foreach (const Use &use, uses(t))
+ if (use.pos == position)
+ return true;
+ return false;
+ }
+
int def(const Temp &t) const {
Q_ASSERT(_defs[t].isValid());
return _defs[t].defStmt;
@@ -746,17 +753,17 @@ private:
os << "Intervals live at the start of L" << bb->index << ":" << endl;
if (_liveAtStart[bb].isEmpty())
os << "\t(none)" << endl;
- foreach (const LifeTimeInterval &i, _liveAtStart[bb]) {
+ foreach (const LifeTimeInterval *i, _liveAtStart[bb]) {
os << "\t";
- i.dump(os);
+ i->dump(os);
os << endl;
}
os << "Intervals live at the end of L" << bb->index << ":" << endl;
if (_liveAtEnd[bb].isEmpty())
os << "\t(none)" << endl;
- foreach (const LifeTimeInterval &i, _liveAtEnd[bb]) {
+ foreach (const LifeTimeInterval *i, _liveAtEnd[bb]) {
os << "\t";
- i.dump(os);
+ i->dump(os);
os << endl;
}
#endif
@@ -1069,6 +1076,8 @@ RegisterAllocator::RegisterAllocator(const QVector<int> &normalRegisters, const
: _normalRegisters(normalRegisters)
, _fpRegisters(fpRegisters)
{
+ Q_ASSERT(normalRegisters.size() >= 2);
+ Q_ASSERT(fpRegisters.size() >= 2);
}
RegisterAllocator::~RegisterAllocator()
@@ -1416,9 +1425,20 @@ void RegisterAllocator::allocateBlockedReg(LifeTimeInterval &current, const int
#endif // DEBUG_REGALLOC
current.setReg(reg);
_lastAssignedRegister.insert(current.temp(), reg);
- Q_ASSERT(nextUseRangeForReg[reg]);
- Q_ASSERT(!nextUseRangeForReg[reg]->isFixedInterval());
- split(*nextUseRangeForReg[reg], position);
+ LifeTimeInterval *nextUse = nextUseRangeForReg[reg];
+ Q_ASSERT(nextUse);
+ Q_ASSERT(!nextUse->isFixedInterval());
+
+ if (_info->isUsedAt(nextUse->temp(), position)) {
+ Q_ASSERT(!_info->isUsedAt(current.temp(), position));
+ // the register is used (as an incoming parameter) at the current position, so split
+ // the interval immediately after the (use at the) current position
+ split(*nextUse, position + 1);
+ } else {
+ // the register was used before the current position
+ split(*nextUse, position);
+ }
+
splitInactiveAtEndOfLifetimeHole(reg, needsFPReg, position);
// make sure that current does not intersect with the fixed interval for reg
diff --git a/src/qml/compiler/qv4ssa.cpp b/src/qml/compiler/qv4ssa.cpp
index 3ffaca5134..8f3e186cc7 100644
--- a/src/qml/compiler/qv4ssa.cpp
+++ b/src/qml/compiler/qv4ssa.cpp
@@ -3711,9 +3711,12 @@ void LifeTimeInterval::dump(QTextStream &out) const {
}
bool LifeTimeInterval::lessThan(const LifeTimeInterval &r1, const LifeTimeInterval &r2) {
- if (r1._ranges.first().start == r2._ranges.first().start)
- return r1._ranges.last().end < r2._ranges.last().end;
- else
+ if (r1._ranges.first().start == r2._ranges.first().start) {
+ if (r1.isSplitFromInterval() == r2.isSplitFromInterval())
+ return r1._ranges.last().end < r2._ranges.last().end;
+ else
+ return r1.isSplitFromInterval();
+ } else
return r1._ranges.first().start < r2._ranges.first().start;
}
diff --git a/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc b/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc
index f336d14b14..2a9c94d22e 100644
--- a/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc
+++ b/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc
@@ -568,7 +568,7 @@ any items added to this list for an \l Item are automatically added to its
list of \l {Item::children}{children}.
Default properties can be useful for reassigning the children of an item. See
-the \l{declarative/ui-components/tabwidget}{TabWidget example}, which uses a
+the \l{declarative/customitems/tabwidget}{TabWidget example}, which uses a
default property to automatically reassign children of the TabWidget as
children of an inner ListView.
diff --git a/src/qml/jsruntime/qv4arrayobject.cpp b/src/qml/jsruntime/qv4arrayobject.cpp
index 652c0f00ac..efe1dff19c 100644
--- a/src/qml/jsruntime/qv4arrayobject.cpp
+++ b/src/qml/jsruntime/qv4arrayobject.cpp
@@ -304,7 +304,7 @@ ReturnedValue ArrayPrototype::method_push(CallContext *ctx)
if (!ctx->callData->argc) {
;
- } else if (!instance->protoHasArray() && instance->arrayData->length() <= len) {
+ } else if (!instance->protoHasArray() && instance->arrayData->length() <= len && instance->arrayType() == ArrayData::Simple) {
instance->arrayData->vtable()->putArray(instance.getPointer(), len, ctx->callData->args, ctx->callData->argc);
len = instance->arrayData->length();
} else {
diff --git a/src/qml/jsruntime/qv4context.cpp b/src/qml/jsruntime/qv4context.cpp
index 15fea72b25..cec42e87aa 100644
--- a/src/qml/jsruntime/qv4context.cpp
+++ b/src/qml/jsruntime/qv4context.cpp
@@ -71,7 +71,7 @@ CallContext *ExecutionContext::newCallContext(FunctionObject *function, CallData
c->lookups = c->compilationUnit->runtimeLookups;
}
- c->locals = (Value *)(c + 1);
+ c->locals = (Value *)((quintptr(c + 1) + 7) & ~7);
if (function->varCount)
std::fill(c->locals, c->locals + function->varCount, Primitive::undefinedValue());
diff --git a/src/qml/jsruntime/qv4context_p.h b/src/qml/jsruntime/qv4context_p.h
index 5904d0b638..f9511d98e3 100644
--- a/src/qml/jsruntime/qv4context_p.h
+++ b/src/qml/jsruntime/qv4context_p.h
@@ -258,7 +258,7 @@ inline Scope::Scope(ExecutionContext *ctx)
/* Function *f, int argc */
#define requiredMemoryForExecutionContect(f, argc) \
- sizeof(CallContext) + sizeof(Value) * (f->varCount + qMax((uint)argc, f->formalParameterCount)) + sizeof(CallData)
+ ((sizeof(CallContext) + 7) & ~7) + sizeof(Value) * (f->varCount + qMax((uint)argc, f->formalParameterCount)) + sizeof(CallData)
} // namespace QV4
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp
index 9bc01d12cc..7f4ac22377 100644
--- a/src/qml/jsruntime/qv4qobjectwrapper.cpp
+++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp
@@ -317,7 +317,6 @@ ReturnedValue QObjectWrapper::getQmlProperty(ExecutionContext *ctx, QQmlContextD
return QV4::Object::get(this, name, hasProperty);
}
- QQmlData::flushPendingBinding(m_object, result->coreIndex);
QQmlData *ddata = QQmlData::get(m_object, false);
if (revisionMode == QV4::QObjectWrapper::CheckRevision && result->hasRevision()) {
@@ -338,6 +337,8 @@ ReturnedValue QObjectWrapper::getProperty(QObject *object, ExecutionContext *ctx
{
QV4::Scope scope(ctx);
+ QQmlData::flushPendingBinding(object, property->coreIndex);
+
if (property->isFunction() && !property->isVarProperty()) {
if (property->isVMEFunction()) {
QQmlVMEMetaObject *vmemo = QQmlVMEMetaObject::get(object);
@@ -774,11 +775,13 @@ struct QObjectSlotDispatcher : public QtPrivate::QSlotObjectBase
}
f->call(callData);
- if (scope.hasException()) {
- QQmlError error = QV4::ExecutionEngine::catchExceptionAsQmlError(ctx);
- if (error.description().isEmpty())
- error.setDescription(QString(QLatin1String("Unknown exception occurred during evaluation of connected function: %1")).arg(f->name->toQString()));
- QQmlEnginePrivate::get(v4->v8Engine->engine())->warning(error);
+ if (scope.hasException() && v4->v8Engine) {
+ if (QQmlEngine *qmlEngine = v4->v8Engine->engine()) {
+ QQmlError error = QV4::ExecutionEngine::catchExceptionAsQmlError(ctx);
+ if (error.description().isEmpty())
+ error.setDescription(QString(QLatin1String("Unknown exception occurred during evaluation of connected function: %1")).arg(f->name->toQString()));
+ QQmlEnginePrivate::get(qmlEngine)->warning(error);
+ }
}
}
break;
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index 8e61ba61cc..68d021b5cb 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -779,8 +779,8 @@ void QQmlData::flushPendingBindingImpl(int coreIndex)
while (b && *b->m_mePtr && b->propertyIndex() != coreIndex)
b = b->nextBinding();
- if (b) {
- b->m_mePtr = 0;
+ if (b && b->propertyIndex() == coreIndex) {
+ b->clear();
b->setEnabled(true, QQmlPropertyPrivate::BypassInterceptor |
QQmlPropertyPrivate::DontRemoveBinding);
}
diff --git a/src/qml/qml/qqmllocale.cpp b/src/qml/qml/qqmllocale.cpp
index 0ea9785673..fc9e2fc42a 100644
--- a/src/qml/qml/qqmllocale.cpp
+++ b/src/qml/qml/qqmllocale.cpp
@@ -1066,9 +1066,12 @@ QV4::ReturnedValue QQmlLocale::method_localeCompare(QV4::CallContext *ctx)
\list
\li Locale.MetricSystem This value indicates metric units, such as meters,
centimeters and millimeters.
- \li Locale.ImperialSystem This value indicates imperial units, such as inches and
- miles. There are several distinct imperial systems in the world; this
- value stands for the official United States imperial units.
+ \li Locale.ImperialUSSystem This value indicates imperial units, such as
+ inches and miles as they are used in the United States.
+ \li Locale.ImperialUKSystem This value indicates imperial units, such as
+ inches and miles as they are used in the United Kingdom.
+ \li Locale.ImperialSystem Provided for compatibility. The same as
+ Locale.ImperialUSSystem.
\endlist
*/
diff --git a/src/qml/qml/qqmlvme.cpp b/src/qml/qml/qqmlvme.cpp
index 7d1e8cc8f0..54c70feecc 100644
--- a/src/qml/qml/qqmlvme.cpp
+++ b/src/qml/qml/qqmlvme.cpp
@@ -871,6 +871,12 @@ QObject *QQmlVME::run(QList<QQmlError> *errors,
CLEAN_PROPERTY(target, QDPP::bindingIndex(instr.property));
bind->addToObject();
+
+ if (!instr.property.isValueTypeVirtual()) {
+ QQmlData *data = QQmlData::get(target);
+ Q_ASSERT(data);
+ data->setPendingBindingBit(target, instr.property.coreIndex);
+ }
}
QML_END_INSTR(StoreBinding)