diff options
author | Lars Knoll <[email protected]> | 2014-04-03 13:00:49 +0200 |
---|---|---|
committer | Simon Hausmann <[email protected]> | 2014-07-22 13:48:53 +0200 |
commit | 4427576fe548b6f9f8acba6a5ac3082fbbb99724 (patch) | |
tree | 309f80779da95f337dd869e1990ffd4f0bb9b724 /src/qml/jsruntime/qv4functionobject.cpp | |
parent | 08a3c0edeb3cdfa15a9fecdfb4c7c1ab82227437 (diff) |
Avoid calling destroy() on most objects
The method is now optional, and we can simply avoid
calling it if all members an object has are themselves
garbage collected.
Change-Id: If560fce051908bcc10409ead1a7d8a5bd5fa71d2
Reviewed-by: Simon Hausmann <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4functionobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4functionobject.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp index b5300f8799..1c6de05ff1 100644 --- a/src/qml/jsruntime/qv4functionobject.cpp +++ b/src/qml/jsruntime/qv4functionobject.cpp @@ -72,7 +72,7 @@ using namespace QV4; -DEFINE_OBJECT_VTABLE(FunctionObject); +DEFINE_OBJECT_VTABLE_NO_DESTROY(FunctionObject); FunctionObject::FunctionObject(ExecutionContext *scope, const StringRef name, bool createProto) : Object(scope->engine->functionClass) @@ -183,7 +183,7 @@ FunctionObject *FunctionObject::createScriptFunction(ExecutionContext *scope, Fu return new (scope->engine->memoryManager) SimpleScriptFunction(scope, function, createProto); } -DEFINE_OBJECT_VTABLE(FunctionCtor); +DEFINE_OBJECT_VTABLE_NO_DESTROY(FunctionCtor); FunctionCtor::FunctionCtor(ExecutionContext *scope) : FunctionObject(scope, QStringLiteral("Function")) @@ -348,7 +348,7 @@ ReturnedValue FunctionPrototype::method_bind(CallContext *ctx) return ctx->engine->newBoundFunction(ctx->engine->rootContext, target, boundThis, boundArgs)->asReturnedValue(); } -DEFINE_OBJECT_VTABLE(ScriptFunction); +DEFINE_OBJECT_VTABLE_NO_DESTROY(ScriptFunction); ScriptFunction::ScriptFunction(ExecutionContext *scope, Function *function) : SimpleScriptFunction(scope, function, true) @@ -421,7 +421,7 @@ ReturnedValue ScriptFunction::call(Managed *that, CallData *callData) return result.asReturnedValue(); } -DEFINE_OBJECT_VTABLE(SimpleScriptFunction); +DEFINE_OBJECT_VTABLE_NO_DESTROY(SimpleScriptFunction); SimpleScriptFunction::SimpleScriptFunction(ExecutionContext *scope, Function *function, bool createProto) : FunctionObject(scope, function->name(), createProto) @@ -545,7 +545,7 @@ InternalClass *SimpleScriptFunction::internalClassForConstructor() -DEFINE_OBJECT_VTABLE(BuiltinFunction); +DEFINE_OBJECT_VTABLE_NO_DESTROY(BuiltinFunction); BuiltinFunction::BuiltinFunction(ExecutionContext *scope, const StringRef name, ReturnedValue (*code)(CallContext *)) : FunctionObject(scope, name) @@ -597,7 +597,7 @@ ReturnedValue IndexedBuiltinFunction::call(Managed *that, CallData *callData) return f->code(&ctx, f->index); } -DEFINE_OBJECT_VTABLE(IndexedBuiltinFunction); +DEFINE_OBJECT_VTABLE_NO_DESTROY(IndexedBuiltinFunction); DEFINE_OBJECT_VTABLE(BoundFunction); |