diff options
Diffstat (limited to 'src/qml/jsruntime/qv4functionobject_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4functionobject_p.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/qml/jsruntime/qv4functionobject_p.h b/src/qml/jsruntime/qv4functionobject_p.h index d691b869fe..6ce5734b6d 100644 --- a/src/qml/jsruntime/qv4functionobject_p.h +++ b/src/qml/jsruntime/qv4functionobject_p.h @@ -65,7 +65,12 @@ struct BuiltinFunction; namespace Heap { -struct Q_QML_PRIVATE_EXPORT FunctionObject : Object { +#define FunctionObjectMembers(class, Member) \ + Member(class, Pointer, ExecutionContext *, scope) \ + Member(class, NoMark, Function *, function) + +DECLARE_HEAP_OBJECT(FunctionObject, Object) { + DECLARE_MARK_TABLE(FunctionObject); enum { Index_Prototype = 0, Index_ProtoConstructor = 0 @@ -79,12 +84,8 @@ struct Q_QML_PRIVATE_EXPORT FunctionObject : Object { unsigned int formalParameterCount() { return function ? function->nFormals : 0; } unsigned int varCount() { return function ? function->compiledFunction->nLocals : 0; } - bool needsActivation() const { return function ? function->needsActivation() : false; } const QV4::Object *protoProperty() const { return propertyData(Index_Prototype)->as<QV4::Object>(); } - - Pointer<ExecutionContext> scope; - Function *function; }; struct FunctionCtor : FunctionObject { @@ -121,11 +122,15 @@ struct ScriptFunction : FunctionObject { QV4::InternalClass *cachedClassForConstructor; }; -struct BoundFunction : FunctionObject { +#define BoundFunctionMembers(class, Member) \ + Member(class, Pointer, FunctionObject *, target) \ + Member(class, HeapValue, HeapValue, boundThis) \ + Member(class, Pointer, MemberData *, boundArgs) + +DECLARE_HEAP_OBJECT(BoundFunction, FunctionObject) { + DECLARE_MARK_TABLE(BoundFunction); + void init(QV4::ExecutionContext *scope, QV4::FunctionObject *target, const Value &boundThis, QV4::MemberData *boundArgs); - Pointer<FunctionObject> target; - Value boundThis; - Pointer<MemberData> boundArgs; }; } @@ -156,14 +161,11 @@ struct Q_QML_EXPORT FunctionObject: Object { static Heap::FunctionObject *createScriptFunction(ExecutionContext *scope, Function *function); - bool needsActivation() const { return d()->needsActivation(); } bool strictMode() const { return d()->function ? d()->function->isStrict() : false; } bool isBinding() const; bool isBoundFunction() const; QQmlSourceLocation sourceLocation() const; - - static void markObjects(Heap::Base *that, ExecutionEngine *e); }; template<> @@ -251,8 +253,6 @@ struct BoundFunction: FunctionObject { static void construct(const Managed *, Scope &scope, CallData *d); static void call(const Managed *that, Scope &scope, CallData *dd); - - static void markObjects(Heap::Base *that, ExecutionEngine *e); }; } |