aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4errorobject.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-06-13 14:30:03 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2014-07-22 13:49:19 +0200
commitb393c405b7568e80628bc99501a9c53bbd0e678d (patch)
tree51280658b1ec97947a66c6afc503b23ae48f0d8d /src/qml/jsruntime/qv4errorobject.cpp
parent00a46fa07bf87c6ffa0d60b4a98b51685fdc1ef5 (diff)
Change the object allocation scheme
Instead of allocating the data directly, centralize the object and its ::Data allocation in one place in the memory manager. This is in preparation for additional pointer indirection later. Change-Id: I7880e1e7354b3258b6a8965be378cd09c9467d25 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4errorobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4errorobject.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4errorobject.cpp b/src/qml/jsruntime/qv4errorobject.cpp
index 83ef60efc3..b99a82a1f5 100644
--- a/src/qml/jsruntime/qv4errorobject.cpp
+++ b/src/qml/jsruntime/qv4errorobject.cpp
@@ -287,7 +287,7 @@ ReturnedValue EvalErrorCtor::construct(Managed *m, CallData *callData)
{
Scope scope(m->engine());
ScopedValue v(scope, callData->argument(0));
- return (new (m->engine()) EvalErrorObject::Data(m->engine(), v))->asReturnedValue();
+ return (m->engine()->memoryManager->alloc<EvalErrorObject>(m->engine(), v))->asReturnedValue();
}
RangeErrorCtor::Data::Data(ExecutionContext *scope)
@@ -300,7 +300,7 @@ ReturnedValue RangeErrorCtor::construct(Managed *m, CallData *callData)
{
Scope scope(m->engine());
ScopedValue v(scope, callData->argument(0));
- return (new (m->engine()) RangeErrorObject::Data(scope.engine, v))->asReturnedValue();
+ return (m->engine()->memoryManager->alloc<RangeErrorObject>(scope.engine, v))->asReturnedValue();
}
ReferenceErrorCtor::Data::Data(ExecutionContext *scope)
@@ -313,7 +313,7 @@ ReturnedValue ReferenceErrorCtor::construct(Managed *m, CallData *callData)
{
Scope scope(m->engine());
ScopedValue v(scope, callData->argument(0));
- return (new (m->engine()) ReferenceErrorObject::Data(scope.engine, v))->asReturnedValue();
+ return (m->engine()->memoryManager->alloc<ReferenceErrorObject>(scope.engine, v))->asReturnedValue();
}
SyntaxErrorCtor::Data::Data(ExecutionContext *scope)
@@ -326,7 +326,7 @@ ReturnedValue SyntaxErrorCtor::construct(Managed *m, CallData *callData)
{
Scope scope(m->engine());
ScopedValue v(scope, callData->argument(0));
- return (new (m->engine()) SyntaxErrorObject::Data(scope.engine, v))->asReturnedValue();
+ return (m->engine()->memoryManager->alloc<SyntaxErrorObject>(scope.engine, v))->asReturnedValue();
}
TypeErrorCtor::Data::Data(ExecutionContext *scope)
@@ -339,7 +339,7 @@ ReturnedValue TypeErrorCtor::construct(Managed *m, CallData *callData)
{
Scope scope(m->engine());
ScopedValue v(scope, callData->argument(0));
- return (new (m->engine()) TypeErrorObject::Data(scope.engine, v))->asReturnedValue();
+ return (m->engine()->memoryManager->alloc<TypeErrorObject>(scope.engine, v))->asReturnedValue();
}
URIErrorCtor::Data::Data(ExecutionContext *scope)
@@ -352,7 +352,7 @@ ReturnedValue URIErrorCtor::construct(Managed *m, CallData *callData)
{
Scope scope(m->engine());
ScopedValue v(scope, callData->argument(0));
- return (new (m->engine()) URIErrorObject::Data(scope.engine, v))->asReturnedValue();
+ return (m->engine()->memoryManager->alloc<URIErrorObject>(scope.engine, v))->asReturnedValue();
}
void ErrorPrototype::init(ExecutionEngine *engine, Object *ctor, Object *obj)