diff options
| author | Lars Knoll <lars.knoll@digia.com> | 2013-09-11 11:28:27 +0200 |
|---|---|---|
| committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-12 21:52:39 +0200 |
| commit | a30799396472f2db5978036a64dcb4a4a74cd0b3 (patch) | |
| tree | 667ac55038feaef3da0aeb18dba024221db2b1d1 /src/qml/jsruntime/qv4objectproto.cpp | |
| parent | c4b984d099b9653bfa0e282daed0bf466123c341 (diff) | |
Convert ReturnedValue into a primitive (typedef to quint64)
ReturnedValue is used to return values from runtime methods
The type has to be a primitive type (no struct or union), so that
the compiler will return it in a register on all platforms.
They will be returned in rax on x64, [eax,edx] on x86 and [r0,r1] on arm.
Change-Id: I38433e6fad252370dda5dc335d9c5be8f22e8c76
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4objectproto.cpp')
| -rw-r--r-- | src/qml/jsruntime/qv4objectproto.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4objectproto.cpp b/src/qml/jsruntime/qv4objectproto.cpp index fc6b30ef1f..cba8141257 100644 --- a/src/qml/jsruntime/qv4objectproto.cpp +++ b/src/qml/jsruntime/qv4objectproto.cpp @@ -90,14 +90,14 @@ Value ObjectCtor::construct(Managed *that, CallData *callData) obj->setPrototype(proto.objectValue()); return Value::fromObject(obj); } - return __qmljs_to_object(v4->current, ValueRef(&callData->args[0])).get(); + return Value::fromReturnedValue(__qmljs_to_object(v4->current, ValueRef(&callData->args[0]))); } Value ObjectCtor::call(Managed *m, CallData *callData) { if (!callData->argc || callData->args[0].isUndefined() || callData->args[0].isNull()) return Value::fromObject(m->engine()->newObject()); - return __qmljs_to_object(m->engine()->current, ValueRef(&callData->args[0])).get(); + return Value::fromReturnedValue(__qmljs_to_object(m->engine()->current, ValueRef(&callData->args[0]))); } void ObjectPrototype::init(ExecutionContext *ctx, const Value &ctor) @@ -373,7 +373,7 @@ Value ObjectPrototype::method_toString(SimpleCallContext *ctx) } else if (ctx->thisObject.isNull()) { return Value::fromString(ctx, QStringLiteral("[object Null]")); } else { - Value obj = __qmljs_to_object(ctx, ValueRef(&ctx->thisObject)).get(); + Value obj = Value::fromReturnedValue(__qmljs_to_object(ctx, ValueRef(&ctx->thisObject))); QString className = obj.objectValue()->className(); return Value::fromString(ctx, QString::fromUtf8("[object %1]").arg(className)); } |
