aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime
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/jsruntime
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/jsruntime')
-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
4 files changed, 12 insertions, 9 deletions
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;