From 3e67a40860e0cda4cf6118c97e47cbe55aa672d6 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 4 Jan 2017 15:58:58 +0100 Subject: Inline creation of simple call contexts And avoid zero initializing stuff that's already 0 Change-Id: If90a808815b2b735bab661d22cbd498acc96b029 Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4functionobject.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/qml/jsruntime/qv4functionobject.cpp') diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp index 1ac0e28a1b..3bbccdba2f 100644 --- a/src/qml/jsruntime/qv4functionobject.cpp +++ b/src/qml/jsruntime/qv4functionobject.cpp @@ -484,14 +484,14 @@ void BuiltinFunction::call(const Managed *that, Scope &scope, CallData *callData ExecutionContextSaver ctxSaver(scope); - CallContext::Data *ctx = CallContext::Data::createSimpleContext(v4); + CallContext::Data *ctx = v4->memoryManager->allocSimpleCallContext(v4); ctx->strictMode = f->scope()->strictMode; // ### needed? scope or parent context? ctx->callData = callData; v4->pushContext(ctx); Q_ASSERT(v4->current == ctx); scope.result = f->d()->code(static_cast(v4->currentContext)); - ctx->freeSimpleCallContext(); + v4->memoryManager->freeSimpleCallContext(); } void IndexedBuiltinFunction::call(const Managed *that, Scope &scope, CallData *callData) @@ -506,14 +506,14 @@ void IndexedBuiltinFunction::call(const Managed *that, Scope &scope, CallData *c ExecutionContextSaver ctxSaver(scope); - CallContext::Data *ctx = CallContext::Data::createSimpleContext(v4); + CallContext::Data *ctx = v4->memoryManager->allocSimpleCallContext(v4); ctx->strictMode = f->scope()->strictMode; // ### needed? scope or parent context? ctx->callData = callData; v4->pushContext(ctx); Q_ASSERT(v4->current == ctx); scope.result = f->d()->code(static_cast(v4->currentContext), f->d()->index); - ctx->freeSimpleCallContext(); + v4->memoryManager->freeSimpleCallContext(); } DEFINE_OBJECT_VTABLE(IndexedBuiltinFunction); -- cgit v1.2.3