diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2014-11-12 16:07:56 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-11-21 13:08:28 +0100 |
commit | f58b5229a31e9fec49b4eb055c56f9a78e423866 (patch) | |
tree | 6214fb89929fd9482c2154b0fe17c7cba0f509cb /src/qml/jsruntime/qv4jsonobject.cpp | |
parent | e6db292366fa6ad25536fee08b2a972ea617d968 (diff) |
Fix run-time string handling with regards to the new heap
Changed runtimeStrings to be an array of Heap::String pointers instead of
indirect String pointers. Later that member along with other GC related members
will go into a managed subclass. Meanwhile the generated code no more loads
String pointers directly but just passes the index into the run-time strings to
the run-time functions, which in turn will load the heap string into a scoped
string.
Also replaced the template<T> Value::operator=(T *m) with a non-template
overload that takes a Managed *, in order to help the compiler choose the
non-template operator=(Heap::Base *) overload. This allows removing a bunch
of Value::fromHeapObject calls.
Change-Id: I20415c0549d33cca6813441a2495976b66d4c00e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4jsonobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4jsonobject.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4jsonobject.cpp b/src/qml/jsruntime/qv4jsonobject.cpp index e7490d2214..76bc757a8c 100644 --- a/src/qml/jsruntime/qv4jsonobject.cpp +++ b/src/qml/jsruntime/qv4jsonobject.cpp @@ -709,7 +709,7 @@ QString Stringify::Str(const QString &key, ValueRef v) if (!!toJSON) { ScopedCallData callData(scope, 1); callData->thisObject = value; - callData->args[0] = Value::fromHeapObject(ctx->d()->engine->newString(key)); + callData->args[0] = ctx->d()->engine->newString(key); value = toJSON->call(callData); } } @@ -718,7 +718,7 @@ QString Stringify::Str(const QString &key, ValueRef v) ScopedObject holder(scope, ctx->d()->engine->newObject()); holder->put(scope.engine, QString(), value); ScopedCallData callData(scope, 2); - callData->args[0] = Value::fromHeapObject(ctx->d()->engine->newString(key)); + callData->args[0] = ctx->d()->engine->newString(key); callData->args[1] = value; callData->thisObject = holder; value = replacerFunction->call(callData); |