diff options
author | Lars Knoll <[email protected]> | 2013-09-16 22:02:27 +0200 |
---|---|---|
committer | The Qt Project <[email protected]> | 2013-09-22 01:06:20 +0200 |
commit | e441692b0b8f8fffdfdfa8a21c570adcd5cbae7a (patch) | |
tree | 9b764401d87682012328c46dc947721f47b428b2 /src/qml/jsruntime/qv4engine.cpp | |
parent | a0f8be4021caa9bb5055923f0eea3bee0e345235 (diff) |
Further work towards an exact GC
Add some more convenience in the helper classes
in qscopedvalue_p.h
Make accesses to CallData safer, and change
ExecutionEngine::newObject() to return a safe
pointer.
Change-Id: I980909754ce9681cf6faa1355bab3a1e5d6dd186
Reviewed-by: Simon Hausmann <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4engine.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index daa58d5e81..5bde6b8e46 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -248,7 +248,7 @@ ExecutionEngine::ExecutionEngine(QQmlJS::EvalISelFactory *factory) // // set up the global object // - globalObject = newObject(); + globalObject = newObject()->getPointer(); rootContext->global = globalObject; rootContext->thisObject = Value::fromObject(globalObject); @@ -350,25 +350,25 @@ FunctionObject *ExecutionEngine::newBuiltinFunction(ExecutionContext *scope, Str return f; } -BoundFunction *ExecutionEngine::newBoundFunction(ExecutionContext *scope, FunctionObject *target, Value boundThis, const QVector<Value> &boundArgs) +Returned<BoundFunction> *ExecutionEngine::newBoundFunction(ExecutionContext *scope, FunctionObject *target, Value boundThis, const QVector<Value> &boundArgs) { assert(target); BoundFunction *f = new (memoryManager) BoundFunction(scope, target, boundThis, boundArgs); - return f; + return f->asReturned<BoundFunction>(); } -Object *ExecutionEngine::newObject() +Returned<Object> *ExecutionEngine::newObject() { Object *object = new (memoryManager) Object(this); - return object; + return object->asReturned<Object>(); } -Object *ExecutionEngine::newObject(InternalClass *internalClass) +Returned<Object> *ExecutionEngine::newObject(InternalClass *internalClass) { Object *object = new (memoryManager) Object(internalClass); - return object; + return object->asReturned<Object>(); } String *ExecutionEngine::newString(const QString &s) |