aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4functionobject.cpp
diff options
context:
space:
mode:
authorLars Knoll <[email protected]>2014-04-29 10:48:39 +0200
committerSimon Hausmann <[email protected]>2014-07-22 13:49:00 +0200
commitc4dee17a32ea4e5737ef20f942442bcadad77829 (patch)
tree910de6d6491787f9e566d16cc1cb5ff8ff05701a /src/qml/jsruntime/qv4functionobject.cpp
parent36dd5d597bf126223e3728806cbcf4682301b18f (diff)
Convert FunctionObject to new storage scheme
Change-Id: Ida213b4684c4d7c4c64e75999cbc87987d9894c8 Reviewed-by: Simon Hausmann <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4functionobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4functionobject.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp
index ba73615cc2..36bc22b1e3 100644
--- a/src/qml/jsruntime/qv4functionobject.cpp
+++ b/src/qml/jsruntime/qv4functionobject.cpp
@@ -77,16 +77,16 @@ DEFINE_OBJECT_VTABLE(FunctionObject);
FunctionObject::FunctionObject(ExecutionContext *scope, const StringRef name, bool createProto)
: Object(scope->engine->functionClass)
{
- data.scope = scope;
- data.function = 0;
+ d()->scope = scope;
+ d()->function = 0;
init(name, createProto);
}
FunctionObject::FunctionObject(ExecutionContext *scope, const QString &name, bool createProto)
: Object(scope->engine->functionClass)
{
- data.scope = scope;
- data.function = 0;
+ d()->scope = scope;
+ d()->function = 0;
Scope s(scope);
ScopedValue protectThis(s, this);
@@ -97,8 +97,8 @@ FunctionObject::FunctionObject(ExecutionContext *scope, const QString &name, boo
FunctionObject::FunctionObject(ExecutionContext *scope, const ReturnedValue name)
: Object(scope->engine->functionClass)
{
- data.scope = scope;
- data.function = 0;
+ d()->scope = scope;
+ d()->function = 0;
Scope s(scope);
ScopedValue protectThis(s, this);
@@ -109,8 +109,8 @@ FunctionObject::FunctionObject(ExecutionContext *scope, const ReturnedValue name
FunctionObject::FunctionObject(InternalClass *ic)
: Object(ic)
{
- data.scope = ic->engine->rootContext;
- data.function = 0;
+ d()->scope = ic->engine->rootContext;
+ d()->function = 0;
managedData()->needsActivation = false;
managedData()->strictMode = false;
@@ -439,8 +439,8 @@ SimpleScriptFunction::SimpleScriptFunction(ExecutionContext *scope, Function *fu
Scope s(scope);
ScopedValue protectThis(s, this);
- data.function = function;
- data.function->compilationUnit->ref();
+ d()->function = function;
+ d()->function->compilationUnit->ref();
Q_ASSERT(function);
Q_ASSERT(function->code);
@@ -558,7 +558,7 @@ DEFINE_OBJECT_VTABLE(BuiltinFunction);
BuiltinFunction::BuiltinFunction(ExecutionContext *scope, const StringRef name, ReturnedValue (*code)(CallContext *))
: FunctionObject(scope, name)
{
- data.code = code;
+ d()->code = code;
setVTable(staticVTable());
}
@@ -583,7 +583,7 @@ ReturnedValue BuiltinFunction::call(Managed *that, CallData *callData)
ctx.callData = callData;
Q_ASSERT(v4->currentContext() == &ctx);
- return f->data.code(&ctx);
+ return f->d()->code(&ctx);
}
ReturnedValue IndexedBuiltinFunction::call(Managed *that, CallData *callData)
@@ -602,7 +602,7 @@ ReturnedValue IndexedBuiltinFunction::call(Managed *that, CallData *callData)
ctx.callData = callData;
Q_ASSERT(v4->currentContext() == &ctx);
- return f->data.code(&ctx, f->data.index);
+ return f->d()->code(&ctx, f->d()->index);
}
DEFINE_OBJECT_VTABLE(IndexedBuiltinFunction);
@@ -612,9 +612,9 @@ DEFINE_OBJECT_VTABLE(BoundFunction);
BoundFunction::BoundFunction(ExecutionContext *scope, FunctionObjectRef target, const ValueRef boundThis, const Members &boundArgs)
: FunctionObject(scope, QStringLiteral("__bound function__"))
{
- data.target = target;
- data.boundThis = boundThis;
- data.boundArgs = boundArgs;
+ d()->target = target;
+ d()->boundThis = boundThis;
+ d()->boundArgs = boundArgs;
setVTable(staticVTable());
setSubtype(FunctionObject::BoundFunction);