aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qml/compiler/qv4compileddata.cpp2
-rw-r--r--src/qml/jsruntime/qv4context.cpp2
-rw-r--r--src/qml/jsruntime/qv4engine.cpp102
-rw-r--r--src/qml/jsruntime/qv4engine_p.h48
-rw-r--r--src/qml/jsruntime/qv4functionobject.cpp2
-rw-r--r--src/qml/jsruntime/qv4global_p.h1
-rw-r--r--src/qml/jsruntime/qv4runtime.cpp18
-rw-r--r--src/qml/jsruntime/qv4runtime_p.h2
-rw-r--r--src/qml/jsruntime/qv4value.cpp8
-rw-r--r--src/qml/jsruntime/qv4value_p.h9
-rw-r--r--src/qml/qml/qqmlcontextwrapper.cpp4
11 files changed, 103 insertions, 95 deletions
diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp
index fbef8b8566..c46392676b 100644
--- a/src/qml/compiler/qv4compileddata.cpp
+++ b/src/qml/compiler/qv4compileddata.cpp
@@ -83,7 +83,7 @@ QV4::Function *CompilationUnit::linkToEngine(ExecutionEngine *engine)
flags |= IR::RegExp::RegExp_IgnoreCase;
if (re->flags & CompiledData::RegExp::RegExp_Multiline)
flags |= IR::RegExp::RegExp_Multiline;
- runtimeRegularExpressions[i] = engine->newRegExpObject(data->stringAt(re->stringIndex), flags);
+ runtimeRegularExpressions[i] = QV4::Value::fromHeapObject(engine->newRegExpObject(data->stringAt(re->stringIndex), flags));
}
if (data->lookupTableSize) {
diff --git a/src/qml/jsruntime/qv4context.cpp b/src/qml/jsruntime/qv4context.cpp
index a73b85d580..d360ccdc57 100644
--- a/src/qml/jsruntime/qv4context.cpp
+++ b/src/qml/jsruntime/qv4context.cpp
@@ -112,7 +112,7 @@ void ExecutionContext::createMutableBinding(String *name, bool deletable)
if (ctx->d()->type >= Heap::ExecutionContext::Type_CallContext) {
CallContext *c = static_cast<CallContext *>(ctx.getPointer());
if (!c->d()->activation)
- c->d()->activation = d()->engine->newObject()->getPointer()->d();
+ c->d()->activation = d()->engine->newObject();
activation = c->d()->activation;
break;
}
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index 3ae19bb42a..164ad176f3 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -394,7 +394,8 @@ ExecutionEngine::ExecutionEngine(EvalISelFactory *factory)
//
// set up the global object
//
- globalObject = newObject()->getPointer();
+ ScopedObject global(scope, newObject());
+ globalObject = global;
rootContext->d()->global = globalObject->d();
rootContext->d()->callData->thisObject = globalObject;
Q_ASSERT(globalObject->internalClass()->vtable);
@@ -517,18 +518,18 @@ ExecutionContext *ExecutionEngine::pushGlobalContext()
}
-Returned<Object> *ExecutionEngine::newObject()
+Heap::Object *ExecutionEngine::newObject()
{
Scope scope(this);
ScopedObject object(scope, memoryManager->alloc<Object>(this));
- return object->asReturned<Object>();
+ return object->d();
}
-Returned<Object> *ExecutionEngine::newObject(InternalClass *internalClass)
+Heap::Object *ExecutionEngine::newObject(InternalClass *internalClass)
{
Scope scope(this);
ScopedObject object(scope, memoryManager->alloc<Object>(internalClass));
- return object->asReturned<Object>();
+ return object->d();
}
Returned<String> *ExecutionEngine::newString(const QString &s)
@@ -542,28 +543,28 @@ String *ExecutionEngine::newIdentifier(const QString &text)
return identifierTable->insertString(text);
}
-Returned<Object> *ExecutionEngine::newStringObject(const ValueRef value)
+Heap::Object *ExecutionEngine::newStringObject(const ValueRef value)
{
Scope scope(this);
Scoped<StringObject> object(scope, memoryManager->alloc<StringObject>(this, value));
- return object->asReturned<Object>();
+ return object->d();
}
-Returned<Object> *ExecutionEngine::newNumberObject(const ValueRef value)
+Heap::Object *ExecutionEngine::newNumberObject(const ValueRef value)
{
Scope scope(this);
Scoped<NumberObject> object(scope, memoryManager->alloc<NumberObject>(this, value));
- return object->asReturned<Object>();
+ return object->d();
}
-Returned<Object> *ExecutionEngine::newBooleanObject(const ValueRef value)
+Heap::Object *ExecutionEngine::newBooleanObject(const ValueRef value)
{
Scope scope(this);
ScopedObject object(scope, memoryManager->alloc<BooleanObject>(this, value));
- return object->asReturned<Object>();
+ return object->d();
}
-Returned<ArrayObject> *ExecutionEngine::newArrayObject(int count)
+Heap::ArrayObject *ExecutionEngine::newArrayObject(int count)
{
Scope scope(this);
ScopedArrayObject object(scope, memoryManager->alloc<ArrayObject>(this));
@@ -573,39 +574,39 @@ Returned<ArrayObject> *ExecutionEngine::newArrayObject(int count)
object->arrayReserve(count);
object->setArrayLengthUnchecked(count);
}
- return object->asReturned<ArrayObject>();
+ return object->d();
}
-Returned<ArrayObject> *ExecutionEngine::newArrayObject(const QStringList &list)
+Heap::ArrayObject *ExecutionEngine::newArrayObject(const QStringList &list)
{
Scope scope(this);
ScopedArrayObject object(scope, memoryManager->alloc<ArrayObject>(this, list));
- return object->asReturned<ArrayObject>();
+ return object->d();
}
-Returned<ArrayObject> *ExecutionEngine::newArrayObject(InternalClass *ic)
+Heap::ArrayObject *ExecutionEngine::newArrayObject(InternalClass *ic)
{
Scope scope(this);
ScopedArrayObject object(scope, memoryManager->alloc<ArrayObject>(ic));
- return object->asReturned<ArrayObject>();
+ return object->d();
}
-Returned<DateObject> *ExecutionEngine::newDateObject(const ValueRef value)
+Heap::DateObject *ExecutionEngine::newDateObject(const ValueRef value)
{
Scope scope(this);
Scoped<DateObject> object(scope, memoryManager->alloc<DateObject>(this, value));
- return object->asReturned<DateObject>();
+ return object->d();
}
-Returned<DateObject> *ExecutionEngine::newDateObject(const QDateTime &dt)
+Heap::DateObject *ExecutionEngine::newDateObject(const QDateTime &dt)
{
Scope scope(this);
Scoped<DateObject> object(scope, memoryManager->alloc<DateObject>(this, dt));
- return object->asReturned<DateObject>();
+ return object->d();
}
-Returned<RegExpObject> *ExecutionEngine::newRegExpObject(const QString &pattern, int flags)
+Heap::RegExpObject *ExecutionEngine::newRegExpObject(const QString &pattern, int flags)
{
bool global = (flags & IR::RegExp::RegExp_Global);
bool ignoreCase = false;
@@ -620,94 +621,94 @@ Returned<RegExpObject> *ExecutionEngine::newRegExpObject(const QString &pattern,
return newRegExpObject(re, global);
}
-Returned<RegExpObject> *ExecutionEngine::newRegExpObject(RegExp *re, bool global)
+Heap::RegExpObject *ExecutionEngine::newRegExpObject(RegExp *re, bool global)
{
Scope scope(this);
Scoped<RegExpObject> object(scope, memoryManager->alloc<RegExpObject>(this, re, global));
- return object->asReturned<RegExpObject>();
+ return object->d();
}
-Returned<RegExpObject> *ExecutionEngine::newRegExpObject(const QRegExp &re)
+Heap::RegExpObject *ExecutionEngine::newRegExpObject(const QRegExp &re)
{
Scope scope(this);
Scoped<RegExpObject> object(scope, memoryManager->alloc<RegExpObject>(this, re));
- return object->asReturned<RegExpObject>();
+ return object->d();
}
-Returned<Object> *ExecutionEngine::newErrorObject(const ValueRef value)
+Heap::Object *ExecutionEngine::newErrorObject(const ValueRef value)
{
Scope scope(this);
ScopedObject object(scope, memoryManager->alloc<ErrorObject>(errorClass, value));
- return object->asReturned<Object>();
+ return object->d();
}
-Returned<Object> *ExecutionEngine::newSyntaxErrorObject(const QString &message)
+Heap::Object *ExecutionEngine::newSyntaxErrorObject(const QString &message)
{
Scope scope(this);
ScopedString s(scope, newString(message));
ScopedObject error(scope, memoryManager->alloc<SyntaxErrorObject>(this, s));
- return error->asReturned<Object>();
+ return error->d();
}
-Returned<Object> *ExecutionEngine::newSyntaxErrorObject(const QString &message, const QString &fileName, int line, int column)
+Heap::Object *ExecutionEngine::newSyntaxErrorObject(const QString &message, const QString &fileName, int line, int column)
{
Scope scope(this);
ScopedObject error(scope, memoryManager->alloc<SyntaxErrorObject>(this, message, fileName, line, column));
- return error->asReturned<Object>();
+ return error->d();
}
-Returned<Object> *ExecutionEngine::newReferenceErrorObject(const QString &message)
+Heap::Object *ExecutionEngine::newReferenceErrorObject(const QString &message)
{
Scope scope(this);
ScopedObject o(scope, memoryManager->alloc<ReferenceErrorObject>(this, message));
- return o->asReturned<Object>();
+ return o->d();
}
-Returned<Object> *ExecutionEngine::newReferenceErrorObject(const QString &message, const QString &fileName, int lineNumber, int columnNumber)
+Heap::Object *ExecutionEngine::newReferenceErrorObject(const QString &message, const QString &fileName, int lineNumber, int columnNumber)
{
Scope scope(this);
ScopedObject o(scope, memoryManager->alloc<ReferenceErrorObject>(this, message, fileName, lineNumber, columnNumber));
- return o->asReturned<Object>();
+ return o->d();
}
-Returned<Object> *ExecutionEngine::newTypeErrorObject(const QString &message)
+Heap::Object *ExecutionEngine::newTypeErrorObject(const QString &message)
{
Scope scope(this);
ScopedObject o(scope, memoryManager->alloc<TypeErrorObject>(this, message));
- return o->asReturned<Object>();
+ return o->d();
}
-Returned<Object> *ExecutionEngine::newRangeErrorObject(const QString &message)
+Heap::Object *ExecutionEngine::newRangeErrorObject(const QString &message)
{
Scope scope(this);
ScopedObject o(scope, memoryManager->alloc<RangeErrorObject>(this, message));
- return o->asReturned<Object>();
+ return o->d();
}
-Returned<Object> *ExecutionEngine::newURIErrorObject(const ValueRef message)
+Heap::Object *ExecutionEngine::newURIErrorObject(const ValueRef message)
{
Scope scope(this);
ScopedObject o(scope, memoryManager->alloc<URIErrorObject>(this, message));
- return o->asReturned<Object>();
+ return o->d();
}
-Returned<Object> *ExecutionEngine::newVariantObject(const QVariant &v)
+Heap::Object *ExecutionEngine::newVariantObject(const QVariant &v)
{
Scope scope(this);
ScopedObject o(scope, memoryManager->alloc<VariantObject>(this, v));
- return o->asReturned<Object>();
+ return o->d();
}
-Returned<Object> *ExecutionEngine::newForEachIteratorObject(Object *o)
+Heap::Object *ExecutionEngine::newForEachIteratorObject(Object *o)
{
Scope scope(this);
ScopedObject obj(scope, memoryManager->alloc<ForEachIteratorObject>(this, o));
- return obj->asReturned<Object>();
+ return obj->d();
}
-Returned<Object> *ExecutionEngine::qmlContextObject() const
+Heap::Object *ExecutionEngine::qmlContextObject() const
{
Heap::ExecutionContext *ctx = currentContext()->d();
@@ -724,11 +725,8 @@ Returned<Object> *ExecutionEngine::qmlContextObject() const
if (ctx->type != Heap::ExecutionContext::Type_QmlContext)
return 0;
- Scope scope(currentContext());
- ScopedObject activation(scope, static_cast<Heap::CallContext *>(ctx)->activation);
- Q_ASSERT(activation);
-
- return activation->asReturned<Object>();
+ Q_ASSERT(static_cast<Heap::CallContext *>(ctx)->activation);
+ return static_cast<Heap::CallContext *>(ctx)->activation;
}
QVector<StackFrame> ExecutionEngine::stackTrace(int frameLimit) const
diff --git a/src/qml/jsruntime/qv4engine_p.h b/src/qml/jsruntime/qv4engine_p.h
index 203bfdb90c..5e2a6cb50b 100644
--- a/src/qml/jsruntime/qv4engine_p.h
+++ b/src/qml/jsruntime/qv4engine_p.h
@@ -305,41 +305,41 @@ public:
void pushContext(CallContext *context);
ExecutionContext *popContext();
- Returned<Object> *newObject();
- Returned<Object> *newObject(InternalClass *internalClass);
+ Heap::Object *newObject();
+ Heap::Object *newObject(InternalClass *internalClass);
Returned<String> *newString(const QString &s);
String *newIdentifier(const QString &text);
- Returned<Object> *newStringObject(const ValueRef value);
- Returned<Object> *newNumberObject(const ValueRef value);
- Returned<Object> *newBooleanObject(const ValueRef value);
+ Heap::Object *newStringObject(const ValueRef value);
+ Heap::Object *newNumberObject(const ValueRef value);
+ Heap::Object *newBooleanObject(const ValueRef value);
- Returned<ArrayObject> *newArrayObject(int count = 0);
- Returned<ArrayObject> *newArrayObject(const QStringList &list);
- Returned<ArrayObject> *newArrayObject(InternalClass *ic);
+ Heap::ArrayObject *newArrayObject(int count = 0);
+ Heap::ArrayObject *newArrayObject(const QStringList &list);
+ Heap::ArrayObject *newArrayObject(InternalClass *ic);
- Returned<DateObject> *newDateObject(const ValueRef value);
- Returned<DateObject> *newDateObject(const QDateTime &dt);
+ Heap::DateObject *newDateObject(const ValueRef value);
+ Heap::DateObject *newDateObject(const QDateTime &dt);
- Returned<RegExpObject> *newRegExpObject(const QString &pattern, int flags);
- Returned<RegExpObject> *newRegExpObject(RegExp *re, bool global);
- Returned<RegExpObject> *newRegExpObject(const QRegExp &re);
+ Heap::RegExpObject *newRegExpObject(const QString &pattern, int flags);
+ Heap::RegExpObject *newRegExpObject(RegExp *re, bool global);
+ Heap::RegExpObject *newRegExpObject(const QRegExp &re);
- Returned<Object> *newErrorObject(const ValueRef value);
- Returned<Object> *newSyntaxErrorObject(const QString &message, const QString &fileName, int line, int column);
- Returned<Object> *newSyntaxErrorObject(const QString &message);
- Returned<Object> *newReferenceErrorObject(const QString &message);
- Returned<Object> *newReferenceErrorObject(const QString &message, const QString &fileName, int lineNumber, int columnNumber);
- Returned<Object> *newTypeErrorObject(const QString &message);
- Returned<Object> *newRangeErrorObject(const QString &message);
- Returned<Object> *newURIErrorObject(const ValueRef message);
+ Heap::Object *newErrorObject(const ValueRef value);
+ Heap::Object *newSyntaxErrorObject(const QString &message, const QString &fileName, int line, int column);
+ Heap::Object *newSyntaxErrorObject(const QString &message);
+ Heap::Object *newReferenceErrorObject(const QString &message);
+ Heap::Object *newReferenceErrorObject(const QString &message, const QString &fileName, int lineNumber, int columnNumber);
+ Heap::Object *newTypeErrorObject(const QString &message);
+ Heap::Object *newRangeErrorObject(const QString &message);
+ Heap::Object *newURIErrorObject(const ValueRef message);
- Returned<Object> *newVariantObject(const QVariant &v);
+ Heap::Object *newVariantObject(const QVariant &v);
- Returned<Object> *newForEachIteratorObject(Object *o);
+ Heap::Object *newForEachIteratorObject(Object *o);
- Returned<Object> *qmlContextObject() const;
+ Heap::Object *qmlContextObject() const;
StackTrace stackTrace(int frameLimit = -1) const;
StackFrame currentStackFrame() const;
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp
index 622a2b8232..59c5c43ccb 100644
--- a/src/qml/jsruntime/qv4functionobject.cpp
+++ b/src/qml/jsruntime/qv4functionobject.cpp
@@ -468,7 +468,7 @@ ReturnedValue SimpleScriptFunction::construct(Managed *that, CallData *callData)
Scoped<SimpleScriptFunction> f(scope, static_cast<SimpleScriptFunction *>(that));
InternalClass *ic = f->internalClassForConstructor();
- callData->thisObject = v4->newObject(ic);
+ callData->thisObject = Value::fromHeapObject(v4->newObject(ic));
ExecutionContext *context = v4->currentContext();
ExecutionContextSaver ctxSaver(context);
diff --git a/src/qml/jsruntime/qv4global_p.h b/src/qml/jsruntime/qv4global_p.h
index 1127967b32..1c2b8af6bb 100644
--- a/src/qml/jsruntime/qv4global_p.h
+++ b/src/qml/jsruntime/qv4global_p.h
@@ -137,6 +137,7 @@ namespace Heap {
struct ErrorObject;
struct ArgumentsObject;
struct QObjectWrapper;
+ struct RegExpObject;
struct ArrayBuffer;
struct DataView;
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp
index 771c388870..f3e85933a1 100644
--- a/src/qml/jsruntime/qv4runtime.cpp
+++ b/src/qml/jsruntime/qv4runtime.cpp
@@ -411,7 +411,7 @@ ReturnedValue RuntimeHelpers::objectDefaultValue(Object *object, int typeHint)
-Returned<Object> *RuntimeHelpers::convertToObject(ExecutionEngine *engine, const ValueRef value)
+Heap::Object *RuntimeHelpers::convertToObject(ExecutionEngine *engine, const ValueRef value)
{
Q_ASSERT(!value->isObject());
switch (value->type()) {
@@ -1248,7 +1248,7 @@ QV4::ReturnedValue RuntimeHelpers::toObject(ExecutionEngine *engine, const QV4::
if (value->isObject())
return value.asReturnedValue();
- Returned<Object> *o = RuntimeHelpers::convertToObject(engine, value);
+ Heap::Object *o = RuntimeHelpers::convertToObject(engine, value);
if (!o) // type error
return Encode::undefined();
@@ -1296,8 +1296,10 @@ ReturnedValue Runtime::regexpLiteral(ExecutionEngine *engine, int id)
ReturnedValue Runtime::getQmlIdArray(NoThrowEngine *engine)
{
- Q_ASSERT(engine->qmlContextObject()->getPointer()->as<QmlContextWrapper>());
- return static_cast<QmlContextWrapper *>(engine->qmlContextObject()->getPointer())->idObjectsArray();
+ Q_ASSERT(engine->qmlContextObject());
+ Scope scope(engine);
+ Scoped<QmlContextWrapper> wrapper(scope, engine->qmlContextObject());
+ return wrapper->idObjectsArray();
}
ReturnedValue Runtime::getQmlContextObject(NoThrowEngine *engine)
@@ -1311,7 +1313,7 @@ ReturnedValue Runtime::getQmlContextObject(NoThrowEngine *engine)
ReturnedValue Runtime::getQmlScopeObject(NoThrowEngine *engine)
{
Scope scope(engine);
- QV4::Scoped<QmlContextWrapper> c(scope, engine->qmlContextObject(), Scoped<QmlContextWrapper>::Cast);
+ QV4::Scoped<QmlContextWrapper> c(scope, engine->qmlContextObject());
return QObjectWrapper::wrap(engine, c->getScopeObject());
}
@@ -1329,7 +1331,7 @@ ReturnedValue Runtime::getQmlQObjectProperty(ExecutionEngine *engine, const Valu
QV4::ReturnedValue Runtime::getQmlAttachedProperty(ExecutionEngine *engine, int attachedPropertiesId, int propertyIndex)
{
Scope scope(engine);
- QV4::Scoped<QmlContextWrapper> c(scope, engine->qmlContextObject(), Scoped<QmlContextWrapper>::Cast);
+ QV4::Scoped<QmlContextWrapper> c(scope, engine->qmlContextObject());
QObject *scopeObject = c->getScopeObject();
QObject *attachedObject = qmlAttachedPropertiesObjectById(attachedPropertiesId, scopeObject);
@@ -1370,7 +1372,9 @@ ReturnedValue Runtime::getQmlImportedScripts(NoThrowEngine *engine)
QV4::ReturnedValue Runtime::getQmlSingleton(QV4::NoThrowEngine *engine, String *name)
{
- return static_cast<QmlContextWrapper *>(engine->qmlContextObject()->getPointer())->qmlSingletonWrapper(engine->v8Engine, name);
+ Scope scope(engine);
+ Scoped<QmlContextWrapper> wrapper(scope, engine->qmlContextObject());
+ return wrapper->qmlSingletonWrapper(engine->v8Engine, name);
}
void Runtime::convertThisToObject(ExecutionEngine *engine)
diff --git a/src/qml/jsruntime/qv4runtime_p.h b/src/qml/jsruntime/qv4runtime_p.h
index ea76451760..24971c695a 100644
--- a/src/qml/jsruntime/qv4runtime_p.h
+++ b/src/qml/jsruntime/qv4runtime_p.h
@@ -229,7 +229,7 @@ struct Q_QML_PRIVATE_EXPORT RuntimeHelpers {
static Returned<String> *convertToString(ExecutionEngine *engine, const ValueRef value);
static ReturnedValue toObject(ExecutionEngine *engine, const ValueRef value);
- static Returned<Object> *convertToObject(ExecutionEngine *engine, const ValueRef value);
+ static Heap::Object *convertToObject(ExecutionEngine *engine, const ValueRef value);
static Bool equalHelper(const ValueRef x, const ValueRef y);
static Bool strictEqual(const ValueRef x, const ValueRef y);
diff --git a/src/qml/jsruntime/qv4value.cpp b/src/qml/jsruntime/qv4value.cpp
index 004f7cb6a3..410fa6482e 100644
--- a/src/qml/jsruntime/qv4value.cpp
+++ b/src/qml/jsruntime/qv4value.cpp
@@ -279,14 +279,14 @@ String *Value::toString(ExecutionContext *ctx) const
return toString(ctx->engine());
}
-Object *Value::toObject(ExecutionEngine *e) const
+Heap::Object *Value::toObject(ExecutionEngine *e) const
{
if (isObject())
- return objectValue();
- return RuntimeHelpers::convertToObject(e, ValueRef::fromRawValue(this))->getPointer();
+ return objectValue()->d();
+ return RuntimeHelpers::convertToObject(e, ValueRef::fromRawValue(this));
}
-Object *Value::toObject(ExecutionContext *ctx) const
+Heap::Object *Value::toObject(ExecutionContext *ctx) const
{
return toObject(ctx->engine());
}
diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h
index 6f62b1cc36..5126d4f0d7 100644
--- a/src/qml/jsruntime/qv4value_p.h
+++ b/src/qml/jsruntime/qv4value_p.h
@@ -345,8 +345,8 @@ struct Q_QML_PRIVATE_EXPORT Value
QString toQString() const;
String *toString(ExecutionEngine *e) const;
String *toString(ExecutionContext *ctx) const;
- Object *toObject(ExecutionEngine *e) const;
- Object *toObject(ExecutionContext *ctx) const;
+ Heap::Object *toObject(ExecutionEngine *e) const;
+ Heap::Object *toObject(ExecutionContext *ctx) const;
inline bool isPrimitive() const;
inline bool tryIntegerConversion() {
@@ -524,6 +524,11 @@ struct Encode {
val = t->getPointer()->asReturnedValue();
}
+ Encode(Heap::Base *o) {
+ Q_ASSERT(o);
+ val = Value::fromHeapObject(o).asReturnedValue();
+ }
+
operator ReturnedValue() const {
return val;
}
diff --git a/src/qml/qml/qqmlcontextwrapper.cpp b/src/qml/qml/qqmlcontextwrapper.cpp
index a7b5d58583..88a788f014 100644
--- a/src/qml/qml/qqmlcontextwrapper.cpp
+++ b/src/qml/qml/qqmlcontextwrapper.cpp
@@ -97,7 +97,7 @@ ReturnedValue QmlContextWrapper::urlScope(QV8Engine *v8, const QUrl &url)
QQmlContextData *QmlContextWrapper::callingContext(ExecutionEngine *v4)
{
Scope scope(v4);
- QV4::Scoped<QmlContextWrapper> c(scope, v4->qmlContextObject(), QV4::Scoped<QmlContextWrapper>::Cast);
+ QV4::Scoped<QmlContextWrapper> c(scope, v4->qmlContextObject());
return !!c ? c->getContext() : 0;
}
@@ -368,7 +368,7 @@ void QmlContextWrapper::registerQmlDependencies(ExecutionEngine *engine, const C
return;
QV4::Scope scope(engine);
- QV4::Scoped<QmlContextWrapper> contextWrapper(scope, engine->qmlContextObject(), QV4::Scoped<QmlContextWrapper>::Cast);
+ QV4::Scoped<QmlContextWrapper> contextWrapper(scope, engine->qmlContextObject());
QQmlContextData *qmlContext = contextWrapper->getContext();
const quint32 *idObjectDependency = compiledFunction->qmlIdObjectDependencyTable();