aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2014-05-07 15:36:38 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2014-07-22 13:49:12 +0200
commit2c7c791e3f0d801a8c1051b7da7b53cb4e50a017 (patch)
tree2d53d2d588fc1a19c5c409b52b06f46ed8d17a47 /src/qml/jsruntime
parent33593f00e84e6fb05191e9bb88000566c0c96426 (diff)
Remove the less often used Ref classes
Change-Id: I9ee531c903317a0f324671d98af1f967b684915c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r--src/qml/jsruntime/qv4engine.cpp4
-rw-r--r--src/qml/jsruntime/qv4engine_p.h4
-rw-r--r--src/qml/jsruntime/qv4functionobject.cpp2
-rw-r--r--src/qml/jsruntime/qv4functionobject_p.h4
-rw-r--r--src/qml/jsruntime/qv4global_p.h3
-rw-r--r--src/qml/jsruntime/qv4jsonobject.cpp10
-rw-r--r--src/qml/jsruntime/qv4jsonobject_p.h4
-rw-r--r--src/qml/jsruntime/qv4object_p.h2
-rw-r--r--src/qml/jsruntime/qv4qobjectwrapper.cpp4
-rw-r--r--src/qml/jsruntime/qv4qobjectwrapper_p.h2
-rw-r--r--src/qml/jsruntime/qv4regexpobject.cpp2
-rw-r--r--src/qml/jsruntime/qv4regexpobject_p.h4
-rw-r--r--src/qml/jsruntime/qv4scopedvalue_p.h1
-rw-r--r--src/qml/jsruntime/qv4sequenceobject.cpp2
-rw-r--r--src/qml/jsruntime/qv4variantobject_p.h2
15 files changed, 18 insertions, 32 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index a1c2b2042a..148e4fc214 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -487,7 +487,7 @@ Returned<FunctionObject> *ExecutionEngine::newBuiltinFunction(ExecutionContext *
return f->asReturned<FunctionObject>();
}
-Returned<BoundFunction> *ExecutionEngine::newBoundFunction(ExecutionContext *scope, FunctionObjectRef target, const ValueRef boundThis, const Members &boundArgs)
+Returned<BoundFunction> *ExecutionEngine::newBoundFunction(ExecutionContext *scope, FunctionObject *target, const ValueRef boundThis, const Members &boundArgs)
{
Q_ASSERT(target);
@@ -590,7 +590,7 @@ Returned<RegExpObject> *ExecutionEngine::newRegExpObject(const QString &pattern,
return newRegExpObject(re, global);
}
-Returned<RegExpObject> *ExecutionEngine::newRegExpObject(RegExpRef re, bool global)
+Returned<RegExpObject> *ExecutionEngine::newRegExpObject(RegExp *re, bool global)
{
RegExpObject *object = new (memoryManager) RegExpObject(this, re, global);
return object->asReturned<RegExpObject>();
diff --git a/src/qml/jsruntime/qv4engine_p.h b/src/qml/jsruntime/qv4engine_p.h
index 6ff10ae6b8..3ad25c0521 100644
--- a/src/qml/jsruntime/qv4engine_p.h
+++ b/src/qml/jsruntime/qv4engine_p.h
@@ -308,7 +308,7 @@ public:
ExecutionContext *popContext();
Returned<FunctionObject> *newBuiltinFunction(ExecutionContext *scope, String *name, ReturnedValue (*code)(CallContext *));
- Returned<BoundFunction> *newBoundFunction(ExecutionContext *scope, FunctionObjectRef target, const ValueRef boundThis, const QV4::Members &boundArgs);
+ Returned<BoundFunction> *newBoundFunction(ExecutionContext *scope, FunctionObject *target, const ValueRef boundThis, const QV4::Members &boundArgs);
Returned<Object> *newObject();
Returned<Object> *newObject(InternalClass *internalClass);
@@ -328,7 +328,7 @@ public:
Returned<DateObject> *newDateObject(const QDateTime &dt);
Returned<RegExpObject> *newRegExpObject(const QString &pattern, int flags);
- Returned<RegExpObject> *newRegExpObject(RegExpRef re, bool global);
+ Returned<RegExpObject> *newRegExpObject(RegExp *re, bool global);
Returned<RegExpObject> *newRegExpObject(const QRegExp &re);
Returned<Object> *newErrorObject(const ValueRef value);
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp
index bc6cd45f13..571a85de61 100644
--- a/src/qml/jsruntime/qv4functionobject.cpp
+++ b/src/qml/jsruntime/qv4functionobject.cpp
@@ -609,7 +609,7 @@ DEFINE_OBJECT_VTABLE(IndexedBuiltinFunction);
DEFINE_OBJECT_VTABLE(BoundFunction);
-BoundFunction::BoundFunction(ExecutionContext *scope, FunctionObjectRef target, const ValueRef boundThis, const Members &boundArgs)
+BoundFunction::BoundFunction(ExecutionContext *scope, FunctionObject *target, const ValueRef boundThis, const Members &boundArgs)
: FunctionObject(scope, QStringLiteral("__bound function__"))
{
d()->target = target;
diff --git a/src/qml/jsruntime/qv4functionobject_p.h b/src/qml/jsruntime/qv4functionobject_p.h
index ad1ebb468c..181125acbd 100644
--- a/src/qml/jsruntime/qv4functionobject_p.h
+++ b/src/qml/jsruntime/qv4functionobject_p.h
@@ -166,8 +166,6 @@ inline FunctionObject *value_cast(const Value &v) {
return v.asFunctionObject();
}
-DEFINE_REF(FunctionObject, Object);
-
struct FunctionCtor: FunctionObject
{
V4_OBJECT
@@ -268,7 +266,7 @@ struct BoundFunction: FunctionObject {
Value boundThis() const { return d()->boundThis; }
Members boundArgs() const { return d()->boundArgs; }
- BoundFunction(ExecutionContext *scope, FunctionObjectRef target, const ValueRef boundThis, const Members &boundArgs);
+ BoundFunction(ExecutionContext *scope, FunctionObject *target, const ValueRef boundThis, const Members &boundArgs);
~BoundFunction() {}
static ReturnedValue construct(Managed *, CallData *d);
diff --git a/src/qml/jsruntime/qv4global_p.h b/src/qml/jsruntime/qv4global_p.h
index 105ad93157..331b9a7245 100644
--- a/src/qml/jsruntime/qv4global_p.h
+++ b/src/qml/jsruntime/qv4global_p.h
@@ -165,9 +165,6 @@ typedef Returned<Object> ReturnedObject;
typedef Returned<FunctionObject> ReturnedFunctionObject;
struct ManagedRef;
struct ObjectRef;
-struct ArrayObjectRef;
-struct FunctionObjectRef;
-struct RegExpRef;
struct PersistentValuePrivate;
class PersistentValue;
diff --git a/src/qml/jsruntime/qv4jsonobject.cpp b/src/qml/jsruntime/qv4jsonobject.cpp
index f0f71523b7..752d647072 100644
--- a/src/qml/jsruntime/qv4jsonobject.cpp
+++ b/src/qml/jsruntime/qv4jsonobject.cpp
@@ -656,7 +656,7 @@ struct Stringify
Stringify(ExecutionContext *ctx) : ctx(ctx), replacerFunction(0) {}
QString Str(const QString &key, ValueRef v);
- QString JA(ArrayObjectRef a);
+ QString JA(ArrayObject *a);
QString JO(ObjectRef o);
QString makeMember(const QString &key, ValueRef v);
@@ -837,9 +837,9 @@ QString Stringify::JO(ObjectRef o)
return result;
}
-QString Stringify::JA(ArrayObjectRef a)
+QString Stringify::JA(ArrayObject *a)
{
- if (stack.contains(a.getPointer())) {
+ if (stack.contains(a)) {
ctx->throwTypeError();
return QString();
}
@@ -847,7 +847,7 @@ QString Stringify::JA(ArrayObjectRef a)
Scope scope(a->engine());
QString result;
- stack.push(a.getPointer());
+ stack.push(a);
QString stepback = indent;
indent += gap;
@@ -1061,7 +1061,7 @@ QV4::ReturnedValue JsonObject::fromJsonArray(ExecutionEngine *engine, const QJso
return a.asReturnedValue();
}
-QJsonArray JsonObject::toJsonArray(ArrayObjectRef a, V4ObjectSet &visitedObjects)
+QJsonArray JsonObject::toJsonArray(ArrayObject *a, V4ObjectSet &visitedObjects)
{
QJsonArray result;
if (!a)
diff --git a/src/qml/jsruntime/qv4jsonobject_p.h b/src/qml/jsruntime/qv4jsonobject_p.h
index 34a4f4dd4b..b42c63a9ce 100644
--- a/src/qml/jsruntime/qv4jsonobject_p.h
+++ b/src/qml/jsruntime/qv4jsonobject_p.h
@@ -69,13 +69,13 @@ public:
{ V4ObjectSet visitedObjects; return toJsonValue(value, visitedObjects); }
static inline QJsonObject toJsonObject(QV4::ObjectRef o)
{ V4ObjectSet visitedObjects; return toJsonObject(o, visitedObjects); }
- static inline QJsonArray toJsonArray(QV4::ArrayObjectRef a)
+ static inline QJsonArray toJsonArray(QV4::ArrayObject *a)
{ V4ObjectSet visitedObjects; return toJsonArray(a, visitedObjects); }
private:
static QJsonValue toJsonValue(const QV4::ValueRef value, V4ObjectSet &visitedObjects);
static QJsonObject toJsonObject(QV4::ObjectRef o, V4ObjectSet &visitedObjects);
- static QJsonArray toJsonArray(QV4::ArrayObjectRef a, V4ObjectSet &visitedObjects);
+ static QJsonArray toJsonArray(ArrayObject *a, V4ObjectSet &visitedObjects);
};
diff --git a/src/qml/jsruntime/qv4object_p.h b/src/qml/jsruntime/qv4object_p.h
index 3be5039548..b9a95c625b 100644
--- a/src/qml/jsruntime/qv4object_p.h
+++ b/src/qml/jsruntime/qv4object_p.h
@@ -468,8 +468,6 @@ struct ObjectRef : public ManagedRef
}
};
-DEFINE_REF(ArrayObject, Object);
-
}
QT_END_NAMESPACE
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp
index 791ea0efc9..aa3347a5fb 100644
--- a/src/qml/jsruntime/qv4qobjectwrapper.cpp
+++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp
@@ -87,7 +87,7 @@ QT_BEGIN_NAMESPACE
using namespace QV4;
-static QPair<QObject *, int> extractQtMethod(QV4::FunctionObjectRef function)
+static QPair<QObject *, int> extractQtMethod(QV4::FunctionObject *function)
{
QV4::ExecutionEngine *v4 = function->engine();
if (v4) {
@@ -1737,7 +1737,7 @@ QV4::ReturnedValue CallArgument::toValue(QV8Engine *engine)
} else if (type == -1 || type == qMetaTypeId<QVariant>()) {
QVariant value = *qvariantPtr;
QV4::ScopedValue rv(scope, engine->fromVariant(value));
- QV4::QObjectWrapperRef qobjectWrapper = rv;
+ QV4::Scoped<QV4::QObjectWrapper> qobjectWrapper(scope, rv);
if (!!qobjectWrapper) {
if (QObject *object = qobjectWrapper->object())
QQmlData::get(object, true)->setImplicitDestructible();
diff --git a/src/qml/jsruntime/qv4qobjectwrapper_p.h b/src/qml/jsruntime/qv4qobjectwrapper_p.h
index 3164eb78f3..bc89dcabf8 100644
--- a/src/qml/jsruntime/qv4qobjectwrapper_p.h
+++ b/src/qml/jsruntime/qv4qobjectwrapper_p.h
@@ -214,8 +214,6 @@ private Q_SLOTS:
void removeDestroyedObject(QObject*);
};
-DEFINE_REF(QObjectWrapper, Object);
-
}
QT_END_NAMESPACE
diff --git a/src/qml/jsruntime/qv4regexpobject.cpp b/src/qml/jsruntime/qv4regexpobject.cpp
index ab51ac7abd..5c6c067944 100644
--- a/src/qml/jsruntime/qv4regexpobject.cpp
+++ b/src/qml/jsruntime/qv4regexpobject.cpp
@@ -80,7 +80,7 @@ RegExpObject::RegExpObject(InternalClass *ic)
init(ic->engine);
}
-RegExpObject::RegExpObject(ExecutionEngine *engine, RegExpRef value, bool global)
+RegExpObject::RegExpObject(ExecutionEngine *engine, RegExp *value, bool global)
: Object(engine->regExpClass)
{
d()->value = value;
diff --git a/src/qml/jsruntime/qv4regexpobject_p.h b/src/qml/jsruntime/qv4regexpobject_p.h
index 96519f64c8..90827c1293 100644
--- a/src/qml/jsruntime/qv4regexpobject_p.h
+++ b/src/qml/jsruntime/qv4regexpobject_p.h
@@ -93,7 +93,7 @@ struct RegExpObject: Object {
RegExp *value() const { return d()->value; }
bool global() const { return d()->global; }
- RegExpObject(ExecutionEngine *engine, RegExpRef value, bool global);
+ RegExpObject(ExecutionEngine *engine, RegExp *value, bool global);
RegExpObject(ExecutionEngine *engine, const QRegExp &re);
void init(ExecutionEngine *engine);
@@ -109,8 +109,6 @@ protected:
static void markObjects(Managed *that, ExecutionEngine *e);
};
-DEFINE_REF(RegExp, Object);
-
struct RegExpCtor: FunctionObject
{
struct Data : FunctionObject::Data {
diff --git a/src/qml/jsruntime/qv4scopedvalue_p.h b/src/qml/jsruntime/qv4scopedvalue_p.h
index 97ad97b45f..82f7e1f17e 100644
--- a/src/qml/jsruntime/qv4scopedvalue_p.h
+++ b/src/qml/jsruntime/qv4scopedvalue_p.h
@@ -383,7 +383,6 @@ struct ScopedCallData {
struct ObjectRef;
-struct FunctionObjectRef;
template<typename T>
inline Scoped<T>::Scoped(const Scope &scope, const ValueRef &v)
diff --git a/src/qml/jsruntime/qv4sequenceobject.cpp b/src/qml/jsruntime/qv4sequenceobject.cpp
index 6c964adfe4..9842c063cf 100644
--- a/src/qml/jsruntime/qv4sequenceobject.cpp
+++ b/src/qml/jsruntime/qv4sequenceobject.cpp
@@ -479,7 +479,7 @@ public:
QVariant toVariant() const
{ return QVariant::fromValue<Container>(d()->container); }
- static QVariant toVariant(QV4::ArrayObjectRef array)
+ static QVariant toVariant(QV4::ArrayObject *array)
{
QV4::Scope scope(array->engine());
Container result;
diff --git a/src/qml/jsruntime/qv4variantobject_p.h b/src/qml/jsruntime/qv4variantobject_p.h
index e02b921b30..926aec11cf 100644
--- a/src/qml/jsruntime/qv4variantobject_p.h
+++ b/src/qml/jsruntime/qv4variantobject_p.h
@@ -90,8 +90,6 @@ struct VariantObject : Object
static bool isEqualTo(Managed *m, Managed *other);
};
-DEFINE_REF(VariantObject, Object);
-
struct VariantPrototype : VariantObject
{
public: