summaryrefslogtreecommitdiff
path: root/src/qml/jsruntime/qv4functionobject.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-07-23 13:56:43 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2014-11-04 14:58:30 +0100
commit3f1d0b27a11a1d560c11057d2a801224d1613d60 (patch)
treea35184460b77be487fa15aaa0e823334e406b833 /src/qml/jsruntime/qv4functionobject.cpp
parent8daace55a2c43ec354e5d778a42f9c421f9f9232 (diff)
downloadqtdeclarative-3f1d0b27a11a1d560c11057d2a801224d1613d60.tar.gz
Changed Value to store Managed::Data pointers directly
This is a step towards storing direct heap object pointers for the values on the JS stack, to avoid the costly indirection for data access. Change-Id: Ibb57ed6cf52a7088bbc95ee04ae3a4cb25b8c045 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4functionobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4functionobject.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp
index f3ad8ef892..ea87ff1f0f 100644
--- a/src/qml/jsruntime/qv4functionobject.cpp
+++ b/src/qml/jsruntime/qv4functionobject.cpp
@@ -165,14 +165,14 @@ void FunctionObject::markObjects(Managed *that, ExecutionEngine *e)
Object::markObjects(that, e);
}
-FunctionObject *FunctionObject::createScriptFunction(ExecutionContext *scope, Function *function, bool createProto)
+Returned<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<ScriptFunction>(scope, function);
- return scope->d()->engine->memoryManager->alloc<SimpleScriptFunction>(scope, function, createProto);
+ return scope->d()->engine->memoryManager->alloc<ScriptFunction>(scope, function)->as<FunctionObject>();
+ return scope->d()->engine->memoryManager->alloc<SimpleScriptFunction>(scope, function, createProto)->as<FunctionObject>();
}
DEFINE_OBJECT_VTABLE(FunctionCtor);