diff options
author | Lars Knoll <lars.knoll@theqtcompany.com> | 2015-01-15 11:36:57 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@digia.com> | 2015-01-23 08:07:32 +0100 |
commit | 002a5d4303b3b182ae4abc4a752c49787c1c2821 (patch) | |
tree | 69c7666ed1061c7acacee1d76597c06405459c80 /src/qml/jsruntime/qv4context.cpp | |
parent | fddc75e862032163af36d2282051758647b62d15 (diff) |
Get rid of most uses of ValueRef
Instead pass a const Value & into the functions
With our new inheritance structure, we can get rid of ValueRef
and instead simply pass a pointer to a Value again. Pointers to
Values are safe to use again now, as they are now guaranteed to
be in a place where the GC knows about them.
Change-Id: I44c606fde764db3993b8128fd6fb781d3a298e53
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4context.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4context.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4context.cpp b/src/qml/jsruntime/qv4context.cpp index 29f4278879..3db957c9bb 100644 --- a/src/qml/jsruntime/qv4context.cpp +++ b/src/qml/jsruntime/qv4context.cpp @@ -87,7 +87,7 @@ Heap::WithContext *ExecutionContext::newWithContext(Object *with) return d()->engine->memoryManager->alloc<WithContext>(d()->engine, with); } -Heap::CatchContext *ExecutionContext::newCatchContext(String *exceptionVarName, const ValueRef exceptionValue) +Heap::CatchContext *ExecutionContext::newCatchContext(String *exceptionVarName, const Value &exceptionValue) { return d()->engine->memoryManager->alloc<CatchContext>(d()->engine, exceptionVarName, exceptionValue); } @@ -146,7 +146,7 @@ Heap::WithContext::WithContext(ExecutionEngine *engine, QV4::Object *with) withObject = with ? with->d() : 0; } -Heap::CatchContext::CatchContext(ExecutionEngine *engine, QV4::String *exceptionVarName, const ValueRef exceptionValue) +Heap::CatchContext::CatchContext(ExecutionEngine *engine, QV4::String *exceptionVarName, const Value &exceptionValue) : Heap::ExecutionContext(engine, Heap::ExecutionContext::Type_CatchContext) { strictMode = parent->strictMode; @@ -282,7 +282,7 @@ void ExecutionContext::markObjects(Heap::Base *m, ExecutionEngine *engine) } } -void ExecutionContext::setProperty(String *name, const ValueRef value) +void ExecutionContext::setProperty(String *name, const Value &value) { Scope scope(this); ScopedContext ctx(scope, this); @@ -294,7 +294,7 @@ void ExecutionContext::setProperty(String *name, const ValueRef value) return; } } else if (ctx->d()->type == Heap::ExecutionContext::Type_CatchContext && static_cast<Heap::CatchContext *>(ctx->d())->exceptionVarName->isEqualTo(name)) { - static_cast<Heap::CatchContext *>(ctx->d())->exceptionValue = *value; + static_cast<Heap::CatchContext *>(ctx->d())->exceptionValue = value; return; } else { ScopedObject activation(scope, (Object *)0); @@ -304,10 +304,10 @@ void ExecutionContext::setProperty(String *name, const ValueRef value) uint index = c->function->function->internalClass->find(name); if (index < UINT_MAX) { if (index < c->function->formalParameterCount()) { - c->callData->args[c->function->formalParameterCount() - index - 1] = *value; + c->callData->args[c->function->formalParameterCount() - index - 1] = value; } else { index -= c->function->formalParameterCount(); - c->locals[index] = *value; + c->locals[index] = value; } return; } |