diff options
author | Lars Knoll <lars.knoll@digia.com> | 2014-01-20 13:51:00 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-21 20:46:50 +0100 |
commit | 7d4fc70e70ca566900c01aa7c5e3ec4770d15933 (patch) | |
tree | 8b223bae1ab0604788abae489e87ec2fbd5298e8 /src/qml/jsruntime/qv4functionobject_p.h | |
parent | 3efae4fc7fff96f147f79013ef9fff9c31557229 (diff) |
Split ManagedVTable into two classes
Keep the basic methods in ManagedVTable, but have
the Object related stuff in an ObjectVTable class.
Change-Id: I9b068acf3caef813686227b8d935e7df1a7d1a6e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4functionobject_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4functionobject_p.h | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/qml/jsruntime/qv4functionobject_p.h b/src/qml/jsruntime/qv4functionobject_p.h index 0168e13a6f..64a1dc92d2 100644 --- a/src/qml/jsruntime/qv4functionobject_p.h +++ b/src/qml/jsruntime/qv4functionobject_p.h @@ -93,7 +93,7 @@ struct InternalClass; struct Lookup; struct Q_QML_EXPORT FunctionObject: Object { - Q_MANAGED + V4_OBJECT Q_MANAGED_TYPE(FunctionObject) enum { IsFunctionObject = true @@ -128,14 +128,10 @@ struct Q_QML_EXPORT FunctionObject: Object { ReturnedValue newInstance(); + using Object::construct; + using Object::call; static ReturnedValue construct(Managed *that, CallData *); static ReturnedValue call(Managed *that, CallData *d); - inline ReturnedValue construct(CallData *callData) { - return internalClass->vtable->construct(this, callData); - } - inline ReturnedValue call(CallData *callData) { - return internalClass->vtable->call(this, callData); - } static FunctionObject *cast(const Value &v) { return v.asFunctionObject(); @@ -161,7 +157,7 @@ inline FunctionObject *value_cast(const Value &v) { struct FunctionCtor: FunctionObject { - Q_MANAGED + V4_OBJECT FunctionCtor(ExecutionContext *scope); static ReturnedValue construct(Managed *that, CallData *callData); @@ -180,7 +176,7 @@ struct FunctionPrototype: FunctionObject }; struct BuiltinFunction: FunctionObject { - Q_MANAGED + V4_OBJECT ReturnedValue (*code)(CallContext *); BuiltinFunction(ExecutionContext *scope, const StringRef name, ReturnedValue (*code)(CallContext *)); @@ -191,7 +187,7 @@ struct BuiltinFunction: FunctionObject { struct IndexedBuiltinFunction: FunctionObject { - Q_MANAGED + V4_OBJECT ReturnedValue (*code)(CallContext *ctx, uint index); uint index; @@ -201,7 +197,7 @@ struct IndexedBuiltinFunction: FunctionObject , code(code) , index(index) { - setVTable(&static_vtbl); + setVTable(staticVTable()); } static ReturnedValue construct(Managed *m, CallData *) @@ -214,7 +210,7 @@ struct IndexedBuiltinFunction: FunctionObject struct ScriptFunction: FunctionObject { - Q_MANAGED + V4_OBJECT ScriptFunction(ExecutionContext *scope, Function *function); static ReturnedValue construct(Managed *, CallData *callData); @@ -222,7 +218,7 @@ struct ScriptFunction: FunctionObject { }; struct SimpleScriptFunction: FunctionObject { - Q_MANAGED + V4_OBJECT SimpleScriptFunction(ExecutionContext *scope, Function *function); static ReturnedValue construct(Managed *, CallData *callData); @@ -230,7 +226,7 @@ struct SimpleScriptFunction: FunctionObject { }; struct BoundFunction: FunctionObject { - Q_MANAGED + V4_OBJECT FunctionObject *target; SafeValue boundThis; QVector<SafeValue> boundArgs; |