aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2014-11-11 17:27:49 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2014-11-14 13:00:51 +0100
commit353402344d0bbf20bc0003324ab6e8d7f67ee90d (patch)
tree2ca98c94c37ed26cd9b94c03a92913f0bafac840 /src/qml
parentafbf1f74af678af0eda76035133406aa8883408a (diff)
Replaced more usages of Returned<T> with Heap::T*
Change-Id: I451128ee71610bfeb71139c28da89a00a8209ec6 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml')
-rw-r--r--src/qml/jsruntime/qv4context.cpp12
-rw-r--r--src/qml/jsruntime/qv4context_p.h6
-rw-r--r--src/qml/jsruntime/qv4functionobject.cpp6
-rw-r--r--src/qml/jsruntime/qv4functionobject_p.h10
-rw-r--r--src/qml/jsruntime/qv4objectproto.cpp4
-rw-r--r--src/qml/jsruntime/qv4objectproto_p.h2
-rw-r--r--src/qml/jsruntime/qv4regexp.cpp6
-rw-r--r--src/qml/jsruntime/qv4regexp_p.h2
-rw-r--r--src/qml/jsruntime/qv4regexpobject.cpp4
-rw-r--r--src/qml/jsruntime/qv4runtime.cpp2
-rw-r--r--src/qml/jsruntime/qv4script.cpp8
-rw-r--r--src/qml/jsruntime/qv4script_p.h4
-rw-r--r--src/qml/types/qqmldelegatemodel.cpp12
13 files changed, 39 insertions, 39 deletions
diff --git a/src/qml/jsruntime/qv4context.cpp b/src/qml/jsruntime/qv4context.cpp
index d360ccdc57..86a5535d04 100644
--- a/src/qml/jsruntime/qv4context.cpp
+++ b/src/qml/jsruntime/qv4context.cpp
@@ -81,22 +81,22 @@ Returned<CallContext> *ExecutionContext::newCallContext(FunctionObject *function
return Returned<CallContext>::create(c);
}
-Returned<WithContext> *ExecutionContext::newWithContext(Object *with)
+Heap::WithContext *ExecutionContext::newWithContext(Object *with)
{
- return d()->engine->memoryManager->alloc<WithContext>(d()->engine, with);
+ return d()->engine->memoryManager->alloc<WithContext>(d()->engine, with)->getPointer()->d();
}
-Returned<CatchContext> *ExecutionContext::newCatchContext(String *exceptionVarName, const ValueRef exceptionValue)
+Heap::CatchContext *ExecutionContext::newCatchContext(String *exceptionVarName, const ValueRef exceptionValue)
{
- return d()->engine->memoryManager->alloc<CatchContext>(d()->engine, exceptionVarName, exceptionValue);
+ return d()->engine->memoryManager->alloc<CatchContext>(d()->engine, exceptionVarName, exceptionValue)->getPointer()->d();
}
-Returned<CallContext> *ExecutionContext::newQmlContext(FunctionObject *f, Object *qml)
+Heap::CallContext *ExecutionContext::newQmlContext(FunctionObject *f, Object *qml)
{
Scope scope(this);
Scoped<CallContext> c(scope, static_cast<CallContext*>(d()->engine->memoryManager->allocManaged(requiredMemoryForExecutionContect(f, 0))));
new (c->d()) Heap::CallContext(d()->engine, qml, f);
- return c.asReturned();
+ return c->d();
}
diff --git a/src/qml/jsruntime/qv4context_p.h b/src/qml/jsruntime/qv4context_p.h
index a883e1c6b6..9b5c4b0d87 100644
--- a/src/qml/jsruntime/qv4context_p.h
+++ b/src/qml/jsruntime/qv4context_p.h
@@ -131,9 +131,9 @@ struct Q_QML_EXPORT ExecutionContext : public Managed
Q_MANAGED_TYPE(ExecutionContext)
Returned<CallContext> *newCallContext(FunctionObject *f, CallData *callData);
- Returned<WithContext> *newWithContext(Object *with);
- Returned<CatchContext> *newCatchContext(String *exceptionVarName, const ValueRef exceptionValue);
- Returned<CallContext> *newQmlContext(FunctionObject *f, Object *qml);
+ Heap::WithContext *newWithContext(Object *with);
+ Heap::CatchContext *newCatchContext(String *exceptionVarName, const ValueRef exceptionValue);
+ Heap::CallContext *newQmlContext(FunctionObject *f, Object *qml);
void createMutableBinding(String *name, bool deletable);
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp
index 79f179760d..b6e766e568 100644
--- a/src/qml/jsruntime/qv4functionobject.cpp
+++ b/src/qml/jsruntime/qv4functionobject.cpp
@@ -183,14 +183,14 @@ void FunctionObject::markObjects(Heap::Base *that, ExecutionEngine *e)
Object::markObjects(that, e);
}
-Returned<FunctionObject> *FunctionObject::createScriptFunction(ExecutionContext *scope, Function *function, bool createProto)
+Heap::FunctionObject *FunctionObject::createScriptFunction(ExecutionContext *scope, Function *function, bool createProto)
{
if (function->needsActivation() ||
function->compiledFunction->flags & CompiledData::Function::HasCatchOrWith ||
function->compiledFunction->nFormals > QV4::Global::ReservedArgumentCount ||
function->isNamedExpression())
- return scope->d()->engine->memoryManager->alloc<ScriptFunction>(scope, function)->as<FunctionObject>();
- return scope->d()->engine->memoryManager->alloc<SimpleScriptFunction>(scope, function, createProto)->as<FunctionObject>();
+ return scope->d()->engine->memoryManager->alloc<ScriptFunction>(scope, function)->getPointer()->d();
+ return scope->d()->engine->memoryManager->alloc<SimpleScriptFunction>(scope, function, createProto)->getPointer()->d();
}
DEFINE_OBJECT_VTABLE(FunctionCtor);
diff --git a/src/qml/jsruntime/qv4functionobject_p.h b/src/qml/jsruntime/qv4functionobject_p.h
index 2d8b31bc0b..3b6294f559 100644
--- a/src/qml/jsruntime/qv4functionobject_p.h
+++ b/src/qml/jsruntime/qv4functionobject_p.h
@@ -138,7 +138,7 @@ struct Q_QML_EXPORT FunctionObject: Object {
return v.asFunctionObject();
}
- static Returned<FunctionObject> *createScriptFunction(ExecutionContext *scope, Function *function, bool createProto = true);
+ static Heap::FunctionObject *createScriptFunction(ExecutionContext *scope, Function *function, bool createProto = true);
ReturnedValue protoProperty() { return memberData()->data()[Heap::FunctionObject::Index_Prototype].asReturnedValue(); }
@@ -177,9 +177,9 @@ struct FunctionPrototype: FunctionObject
struct Q_QML_EXPORT BuiltinFunction: FunctionObject {
V4_OBJECT2(BuiltinFunction, FunctionObject)
- static Returned<BuiltinFunction> *create(ExecutionContext *scope, String *name, ReturnedValue (*code)(CallContext *))
+ static Heap::BuiltinFunction *create(ExecutionContext *scope, String *name, ReturnedValue (*code)(CallContext *))
{
- return scope->engine()->memoryManager->alloc<BuiltinFunction>(scope, name, code);
+ return scope->engine()->memoryManager->alloc<BuiltinFunction>(scope, name, code)->getPointer()->d();
}
static ReturnedValue construct(Managed *, CallData *);
@@ -228,9 +228,9 @@ struct ScriptFunction: SimpleScriptFunction {
struct BoundFunction: FunctionObject {
V4_OBJECT2(BoundFunction, FunctionObject)
- static Returned<BoundFunction> *create(ExecutionContext *scope, FunctionObject *target, const ValueRef boundThis, QV4::MemberData *boundArgs)
+ static Heap::BoundFunction *create(ExecutionContext *scope, FunctionObject *target, const ValueRef boundThis, QV4::MemberData *boundArgs)
{
- return scope->engine()->memoryManager->alloc<BoundFunction>(scope, target, boundThis, boundArgs);
+ return scope->engine()->memoryManager->alloc<BoundFunction>(scope, target, boundThis, boundArgs)->getPointer()->d();
}
Heap::FunctionObject *target() { return d()->target; }
diff --git a/src/qml/jsruntime/qv4objectproto.cpp b/src/qml/jsruntime/qv4objectproto.cpp
index 686d17877a..4615a48a6a 100644
--- a/src/qml/jsruntime/qv4objectproto.cpp
+++ b/src/qml/jsruntime/qv4objectproto.cpp
@@ -670,7 +670,7 @@ ReturnedValue ObjectPrototype::fromPropertyDescriptor(ExecutionContext *ctx, con
}
-Returned<ArrayObject> *ObjectPrototype::getOwnPropertyNames(ExecutionEngine *v4, const ValueRef o)
+Heap::ArrayObject *ObjectPrototype::getOwnPropertyNames(ExecutionEngine *v4, const ValueRef o)
{
Scope scope(v4);
Scoped<ArrayObject> array(scope, v4->newArrayObject());
@@ -685,5 +685,5 @@ Returned<ArrayObject> *ObjectPrototype::getOwnPropertyNames(ExecutionEngine *v4,
array->push_back(name);
}
}
- return array->asReturned<ArrayObject>();
+ return array->d();
}
diff --git a/src/qml/jsruntime/qv4objectproto_p.h b/src/qml/jsruntime/qv4objectproto_p.h
index ba61d452f5..e58ef10492 100644
--- a/src/qml/jsruntime/qv4objectproto_p.h
+++ b/src/qml/jsruntime/qv4objectproto_p.h
@@ -91,7 +91,7 @@ struct ObjectPrototype: Object
static void toPropertyDescriptor(ExecutionContext *ctx, const ValueRef v, Property *desc, PropertyAttributes *attrs);
static ReturnedValue fromPropertyDescriptor(ExecutionContext *ctx, const Property *desc, PropertyAttributes attrs);
- static Returned<ArrayObject> *getOwnPropertyNames(ExecutionEngine *v4, const ValueRef o);
+ static Heap::ArrayObject *getOwnPropertyNames(ExecutionEngine *v4, const ValueRef o);
};
diff --git a/src/qml/jsruntime/qv4regexp.cpp b/src/qml/jsruntime/qv4regexp.cpp
index 36d3c707eb..631003cbe1 100644
--- a/src/qml/jsruntime/qv4regexp.cpp
+++ b/src/qml/jsruntime/qv4regexp.cpp
@@ -63,14 +63,14 @@ uint RegExp::match(const QString &string, int start, uint *matchOffsets)
return JSC::Yarr::interpret(byteCode().get(), s.characters16(), string.length(), start, matchOffsets);
}
-Returned<RegExp> *RegExp::create(ExecutionEngine* engine, const QString& pattern, bool ignoreCase, bool multiline)
+Heap::RegExp *RegExp::create(ExecutionEngine* engine, const QString& pattern, bool ignoreCase, bool multiline)
{
RegExpCacheKey key(pattern, ignoreCase, multiline);
RegExpCache *cache = engine->regExpCache;
if (cache) {
if (RegExp *result = cache->value(key))
- return Returned<RegExp>::create(result);
+ return result->d();
}
Scope scope(engine);
@@ -82,7 +82,7 @@ Returned<RegExp> *RegExp::create(ExecutionEngine* engine, const QString& pattern
result->d()->cache = cache;
cache->insert(key, result);
- return result.asReturned();
+ return result->d();
}
Heap::RegExp::RegExp(ExecutionEngine* engine, const QString &pattern, bool ignoreCase, bool multiline)
diff --git a/src/qml/jsruntime/qv4regexp_p.h b/src/qml/jsruntime/qv4regexp_p.h
index a7827542ef..a91d1331c8 100644
--- a/src/qml/jsruntime/qv4regexp_p.h
+++ b/src/qml/jsruntime/qv4regexp_p.h
@@ -91,7 +91,7 @@ struct RegExp : public Managed
bool ignoreCase() const { return d()->ignoreCase; }
bool multiLine() const { return d()->multiLine; }
- static Returned<RegExp> *create(ExecutionEngine* engine, const QString& pattern, bool ignoreCase = false, bool multiline = false);
+ static Heap::RegExp *create(ExecutionEngine* engine, const QString& pattern, bool ignoreCase = false, bool multiline = false);
bool isValid() const { return d()->byteCode.get(); }
diff --git a/src/qml/jsruntime/qv4regexpobject.cpp b/src/qml/jsruntime/qv4regexpobject.cpp
index a73c25c567..ce9970459c 100644
--- a/src/qml/jsruntime/qv4regexpobject.cpp
+++ b/src/qml/jsruntime/qv4regexpobject.cpp
@@ -71,7 +71,7 @@ Heap::RegExpObject::RegExpObject(InternalClass *ic)
Scope scope(ic->engine);
Scoped<QV4::RegExpObject> o(scope, this);
- o->d()->value = QV4::RegExp::create(ic->engine, QString(), false, false)->getPointer()->d();
+ o->d()->value = QV4::RegExp::create(ic->engine, QString(), false, false);
o->d()->global = false;
o->init(ic->engine);
}
@@ -139,7 +139,7 @@ Heap::RegExpObject::RegExpObject(QV4::ExecutionEngine *engine, const QRegExp &re
Scope scope(engine);
Scoped<QV4::RegExpObject> o(scope, this);
- o->d()->value = QV4::RegExp::create(engine, pattern, re.caseSensitivity() == Qt::CaseInsensitive, false)->getPointer()->d();
+ o->d()->value = QV4::RegExp::create(engine, pattern, re.caseSensitivity() == Qt::CaseInsensitive, false);
o->init(engine);
}
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp
index 57a6524515..db82efa087 100644
--- a/src/qml/jsruntime/qv4runtime.cpp
+++ b/src/qml/jsruntime/qv4runtime.cpp
@@ -1133,7 +1133,7 @@ void Runtime::pushCatchScope(NoThrowEngine *engine, String *exceptionVarName)
{
Scope scope(engine);
ScopedValue v(scope, engine->catchException(engine->currentContext(), 0));
- engine->currentContext()->newCatchContext(exceptionVarName, v)->getPointer();
+ engine->currentContext()->newCatchContext(exceptionVarName, v);
}
void Runtime::popScope(ExecutionEngine *engine)
diff --git a/src/qml/jsruntime/qv4script.cpp b/src/qml/jsruntime/qv4script.cpp
index 956c48e74b..e261cda414 100644
--- a/src/qml/jsruntime/qv4script.cpp
+++ b/src/qml/jsruntime/qv4script.cpp
@@ -109,7 +109,7 @@ Heap::QmlBindingWrapper::QmlBindingWrapper(QV4::ExecutionContext *scope, Functio
o->defineReadonlyProperty(scope->d()->engine->id_length, Primitive::fromInt32(1));
- o->d()->qmlContext = s.engine->currentContext()->newQmlContext(o, qml)->getPointer()->d();
+ o->d()->qmlContext = s.engine->currentContext()->newQmlContext(o, qml);
s.engine->popContext();
}
@@ -127,7 +127,7 @@ Heap::QmlBindingWrapper::QmlBindingWrapper(QV4::ExecutionContext *scope, QV4::Ob
o->defineReadonlyProperty(scope->d()->engine->id_length, Primitive::fromInt32(1));
- o->d()->qmlContext = s.engine->currentContext()->newQmlContext(o, qml)->getPointer()->d();
+ o->d()->qmlContext = s.engine->currentContext()->newQmlContext(o, qml);
s.engine->popContext();
}
@@ -168,7 +168,7 @@ static ReturnedValue signalParameterGetter(QV4::CallContext *ctx, uint parameter
return signalEmittingContext->argument(parameterIndex);
}
-Returned<FunctionObject> *QmlBindingWrapper::createQmlCallableForFunction(QQmlContextData *qmlContext, QObject *scopeObject, Function *runtimeFunction, const QList<QByteArray> &signalParameters, QString *error)
+Heap::FunctionObject *QmlBindingWrapper::createQmlCallableForFunction(QQmlContextData *qmlContext, QObject *scopeObject, Function *runtimeFunction, const QList<QByteArray> &signalParameters, QString *error)
{
ExecutionEngine *engine = QQmlEnginePrivate::getV4Engine(qmlContext->engine);
QV4::Scope valueScope(engine);
@@ -192,7 +192,7 @@ Returned<FunctionObject> *QmlBindingWrapper::createQmlCallableForFunction(QQmlCo
}
QV4::ScopedFunctionObject function(valueScope, QV4::FunctionObject::createScriptFunction(wrapperContext, runtimeFunction));
- return function->asReturned<FunctionObject>();
+ return function->d();
}
Script::Script(ExecutionEngine *v4, Object *qml, CompiledData::CompilationUnit *compilationUnit)
diff --git a/src/qml/jsruntime/qv4script_p.h b/src/qml/jsruntime/qv4script_p.h
index 3da8cf0269..0c54c24f8e 100644
--- a/src/qml/jsruntime/qv4script_p.h
+++ b/src/qml/jsruntime/qv4script_p.h
@@ -90,8 +90,8 @@ struct Q_QML_EXPORT QmlBindingWrapper : FunctionObject {
Heap::CallContext *context() const { return d()->qmlContext; }
- static Returned<FunctionObject> *createQmlCallableForFunction(QQmlContextData *qmlContext, QObject *scopeObject, QV4::Function *runtimeFunction,
- const QList<QByteArray> &signalParameters = QList<QByteArray>(), QString *error = 0);
+ static Heap::FunctionObject *createQmlCallableForFunction(QQmlContextData *qmlContext, QObject *scopeObject, QV4::Function *runtimeFunction,
+ const QList<QByteArray> &signalParameters = QList<QByteArray>(), QString *error = 0);
private:
};
diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp
index 383379295f..be99c56076 100644
--- a/src/qml/types/qqmldelegatemodel.cpp
+++ b/src/qml/types/qqmldelegatemodel.cpp
@@ -81,9 +81,9 @@ struct DelegateModelGroupFunction : QV4::FunctionObject
{
V4_OBJECT2(DelegateModelGroupFunction, FunctionObject)
- static QV4::Returned<DelegateModelGroupFunction> *create(QV4::ExecutionContext *scope, uint flag, QV4::ReturnedValue (*code)(QQmlDelegateModelItem *item, uint flag, const QV4::ValueRef arg))
+ static Heap::DelegateModelGroupFunction *create(QV4::ExecutionContext *scope, uint flag, QV4::ReturnedValue (*code)(QQmlDelegateModelItem *item, uint flag, const QV4::ValueRef arg))
{
- return scope->engine()->memoryManager->alloc<DelegateModelGroupFunction>(scope, flag, code);
+ return scope->engine()->memoryManager->alloc<DelegateModelGroupFunction>(scope, flag, code)->getPointer()->d();
}
static QV4::ReturnedValue construct(QV4::Managed *m, QV4::CallData *)
@@ -3236,8 +3236,8 @@ struct QQmlDelegateModelGroupChange : QV4::Object
{
V4_OBJECT2(QQmlDelegateModelGroupChange, QV4::Object)
- static QV4::Returned<QQmlDelegateModelGroupChange> *create(QV4::ExecutionEngine *e) {
- return e->memoryManager->alloc<QQmlDelegateModelGroupChange>(e);
+ static QV4::Heap::QQmlDelegateModelGroupChange *create(QV4::ExecutionEngine *e) {
+ return e->memoryManager->alloc<QQmlDelegateModelGroupChange>(e)->getPointer()->d();
}
static QV4::ReturnedValue method_get_index(QV4::CallContext *ctx) {
@@ -3277,9 +3277,9 @@ struct QQmlDelegateModelGroupChangeArray : public QV4::Object
{
V4_OBJECT2(QQmlDelegateModelGroupChangeArray, QV4::Object)
public:
- static QV4::Returned<QQmlDelegateModelGroupChangeArray> *create(QV4::ExecutionEngine *engine, const QVector<QQmlChangeSet::Change> &changes)
+ static QV4::Heap::QQmlDelegateModelGroupChangeArray *create(QV4::ExecutionEngine *engine, const QVector<QQmlChangeSet::Change> &changes)
{
- return engine->memoryManager->alloc<QQmlDelegateModelGroupChangeArray>(engine, changes);
+ return engine->memoryManager->alloc<QQmlDelegateModelGroupChangeArray>(engine, changes)->getPointer()->d();
}
quint32 count() const { return d()->changes.count(); }