diff options
| author | Lars Knoll <lars.knoll@qt.io> | 2017-01-31 14:03:51 +0100 |
|---|---|---|
| committer | Lars Knoll <lars.knoll@qt.io> | 2017-03-09 08:58:34 +0000 |
| commit | 91714e004e0c91527e7049ff43565dda682fc2bd (patch) | |
| tree | bd5ff925acf6c8e1b98667c0b18028576cf94662 /src/qml/jsruntime/qv4functionobject.cpp | |
| parent | 518e258d59adc976e2e8aa9a7f9ef36d8b8cdb66 (diff) | |
Make all write operations to Pointer<> types go through a set() method
The new set() method also taked an ExecutionEngine pointer. This makes
it trivial to now add a write barrier for those operations.
Change-Id: I321eccfe6fb279cc240b5c84910e6854f71759f6
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4functionobject.cpp')
| -rw-r--r-- | src/qml/jsruntime/qv4functionobject.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp index 9afea01141..a2433e7471 100644 --- a/src/qml/jsruntime/qv4functionobject.cpp +++ b/src/qml/jsruntime/qv4functionobject.cpp @@ -75,7 +75,7 @@ void Heap::FunctionObject::init(QV4::ExecutionContext *scope, QV4::String *name, { Object::init(); function = nullptr; - this->scope = scope->d(); + this->scope.set(scope->engine(), scope->d()); Scope s(scope->engine()); ScopedFunctionObject f(s, this); f->init(name, createProto); @@ -86,7 +86,7 @@ void Heap::FunctionObject::init(QV4::ExecutionContext *scope, Function *function Object::init(); this->function = function; function->compilationUnit->addref(); - this->scope = scope->d(); + this->scope.set(scope->engine(), scope->d()); Scope s(scope->engine()); ScopedString name(s, function->name()); ScopedFunctionObject f(s, this); @@ -104,7 +104,7 @@ void Heap::FunctionObject::init() { Object::init(); function = nullptr; - this->scope = internalClass->engine->rootContext()->d(); + this->scope.set(internalClass->engine, internalClass->engine->rootContext()->d()); Q_ASSERT(internalClass && internalClass->find(internalClass->engine->id_prototype()) == Index_Prototype); *propertyData(Index_Prototype) = Encode::undefined(); } @@ -413,7 +413,7 @@ void ScriptFunction::call(const Managed *that, Scope &scope, CallData *callData) void Heap::ScriptFunction::init(QV4::ExecutionContext *scope, Function *function) { FunctionObject::init(); - this->scope = scope->d(); + this->scope.set(scope->engine(), scope->d()); this->function = function; function->compilationUnit->addref(); @@ -536,12 +536,12 @@ DEFINE_OBJECT_VTABLE(BoundFunction); void Heap::BoundFunction::init(QV4::ExecutionContext *scope, QV4::FunctionObject *target, const Value &boundThis, QV4::MemberData *boundArgs) { + Scope s(scope); Heap::FunctionObject::init(scope, QStringLiteral("__bound function__")); - this->target = target->d(); - this->boundArgs = boundArgs ? boundArgs->d() : 0; + this->target.set(s.engine, target->d()); + this->boundArgs.set(s.engine, boundArgs ? boundArgs->d() : 0); this->boundThis = boundThis; - Scope s(scope); ScopedObject f(s, this); ScopedValue l(s, target->get(s.engine->id_length())); |
