From 353402344d0bbf20bc0003324ab6e8d7f67ee90d Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 11 Nov 2014 17:27:49 +0100 Subject: Replaced more usages of Returned with Heap::T* Change-Id: I451128ee71610bfeb71139c28da89a00a8209ec6 Reviewed-by: Lars Knoll --- src/qml/jsruntime/qv4context.cpp | 12 ++++++------ src/qml/jsruntime/qv4context_p.h | 6 +++--- src/qml/jsruntime/qv4functionobject.cpp | 6 +++--- src/qml/jsruntime/qv4functionobject_p.h | 10 +++++----- src/qml/jsruntime/qv4objectproto.cpp | 4 ++-- src/qml/jsruntime/qv4objectproto_p.h | 2 +- src/qml/jsruntime/qv4regexp.cpp | 6 +++--- src/qml/jsruntime/qv4regexp_p.h | 2 +- src/qml/jsruntime/qv4regexpobject.cpp | 4 ++-- src/qml/jsruntime/qv4runtime.cpp | 2 +- src/qml/jsruntime/qv4script.cpp | 8 ++++---- src/qml/jsruntime/qv4script_p.h | 4 ++-- src/qml/types/qqmldelegatemodel.cpp | 12 ++++++------ src/quick/items/qquickview.cpp | 4 ++-- src/quick/items/qquickview_p.h | 2 +- 15 files changed, 42 insertions(+), 42 deletions(-) (limited to 'src') 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 *ExecutionContext::newCallContext(FunctionObject *function return Returned::create(c); } -Returned *ExecutionContext::newWithContext(Object *with) +Heap::WithContext *ExecutionContext::newWithContext(Object *with) { - return d()->engine->memoryManager->alloc(d()->engine, with); + return d()->engine->memoryManager->alloc(d()->engine, with)->getPointer()->d(); } -Returned *ExecutionContext::newCatchContext(String *exceptionVarName, const ValueRef exceptionValue) +Heap::CatchContext *ExecutionContext::newCatchContext(String *exceptionVarName, const ValueRef exceptionValue) { - return d()->engine->memoryManager->alloc(d()->engine, exceptionVarName, exceptionValue); + return d()->engine->memoryManager->alloc(d()->engine, exceptionVarName, exceptionValue)->getPointer()->d(); } -Returned *ExecutionContext::newQmlContext(FunctionObject *f, Object *qml) +Heap::CallContext *ExecutionContext::newQmlContext(FunctionObject *f, Object *qml) { Scope scope(this); Scoped c(scope, static_cast(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 *newCallContext(FunctionObject *f, CallData *callData); - Returned *newWithContext(Object *with); - Returned *newCatchContext(String *exceptionVarName, const ValueRef exceptionValue); - Returned *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::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(scope, function)->as(); - return scope->d()->engine->memoryManager->alloc(scope, function, createProto)->as(); + return scope->d()->engine->memoryManager->alloc(scope, function)->getPointer()->d(); + return scope->d()->engine->memoryManager->alloc(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 *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 *create(ExecutionContext *scope, String *name, ReturnedValue (*code)(CallContext *)) + static Heap::BuiltinFunction *create(ExecutionContext *scope, String *name, ReturnedValue (*code)(CallContext *)) { - return scope->engine()->memoryManager->alloc(scope, name, code); + return scope->engine()->memoryManager->alloc(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 *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(scope, target, boundThis, boundArgs); + return scope->engine()->memoryManager->alloc(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 *ObjectPrototype::getOwnPropertyNames(ExecutionEngine *v4, const ValueRef o) +Heap::ArrayObject *ObjectPrototype::getOwnPropertyNames(ExecutionEngine *v4, const ValueRef o) { Scope scope(v4); Scoped array(scope, v4->newArrayObject()); @@ -685,5 +685,5 @@ Returned *ObjectPrototype::getOwnPropertyNames(ExecutionEngine *v4, array->push_back(name); } } - return array->asReturned(); + 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 *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::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::create(result); + return result->d(); } Scope scope(engine); @@ -82,7 +82,7 @@ Returned *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 *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 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 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 *QmlBindingWrapper::createQmlCallableForFunction(QQmlContextData *qmlContext, QObject *scopeObject, Function *runtimeFunction, const QList &signalParameters, QString *error) +Heap::FunctionObject *QmlBindingWrapper::createQmlCallableForFunction(QQmlContextData *qmlContext, QObject *scopeObject, Function *runtimeFunction, const QList &signalParameters, QString *error) { ExecutionEngine *engine = QQmlEnginePrivate::getV4Engine(qmlContext->engine); QV4::Scope valueScope(engine); @@ -192,7 +192,7 @@ Returned *QmlBindingWrapper::createQmlCallableForFunction(QQmlCo } QV4::ScopedFunctionObject function(valueScope, QV4::FunctionObject::createScriptFunction(wrapperContext, runtimeFunction)); - return function->asReturned(); + 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 *createQmlCallableForFunction(QQmlContextData *qmlContext, QObject *scopeObject, QV4::Function *runtimeFunction, - const QList &signalParameters = QList(), QString *error = 0); + static Heap::FunctionObject *createQmlCallableForFunction(QQmlContextData *qmlContext, QObject *scopeObject, QV4::Function *runtimeFunction, + const QList &signalParameters = QList(), 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 *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(scope, flag, code); + return scope->engine()->memoryManager->alloc(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 *create(QV4::ExecutionEngine *e) { - return e->memoryManager->alloc(e); + static QV4::Heap::QQmlDelegateModelGroupChange *create(QV4::ExecutionEngine *e) { + return e->memoryManager->alloc(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 *create(QV4::ExecutionEngine *engine, const QVector &changes) + static QV4::Heap::QQmlDelegateModelGroupChangeArray *create(QV4::ExecutionEngine *engine, const QVector &changes) { - return engine->memoryManager->alloc(engine, changes); + return engine->memoryManager->alloc(engine, changes)->getPointer()->d(); } quint32 count() const { return d()->changes.count(); } diff --git a/src/quick/items/qquickview.cpp b/src/quick/items/qquickview.cpp index 004880b15c..9915c83059 100644 --- a/src/quick/items/qquickview.cpp +++ b/src/quick/items/qquickview.cpp @@ -50,10 +50,10 @@ QT_BEGIN_NAMESPACE DEFINE_OBJECT_VTABLE(QV4::QQuickRootItemMarker); -QV4::Returned *QV4::QQuickRootItemMarker::create(QQmlEngine *engine, QQuickWindow *window) +QV4::Heap::QQuickRootItemMarker *QV4::QQuickRootItemMarker::create(QQmlEngine *engine, QQuickWindow *window) { QV4::ExecutionEngine *e = QQmlEnginePrivate::getV4Engine(engine); - return e->memoryManager->alloc(e, window); + return e->memoryManager->alloc(e, window)->getPointer()->d(); } void QV4::QQuickRootItemMarker::markObjects(QV4::Heap::Base *that, QV4::ExecutionEngine *e) diff --git a/src/quick/items/qquickview_p.h b/src/quick/items/qquickview_p.h index f1927110ac..1017913469 100644 --- a/src/quick/items/qquickview_p.h +++ b/src/quick/items/qquickview_p.h @@ -109,7 +109,7 @@ struct QQuickRootItemMarker : public Object { V4_OBJECT2(QQuickRootItemMarker, Object) - static QV4::Returned *create(QQmlEngine *engine, QQuickWindow *window); + static Heap::QQuickRootItemMarker *create(QQmlEngine *engine, QQuickWindow *window); static void markObjects(QV4::Heap::Base *that, QV4::ExecutionEngine *e); -- cgit v1.2.3