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/qv4runtime_p.h | |
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/qv4runtime_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4runtime_p.h | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/src/qml/jsruntime/qv4runtime_p.h b/src/qml/jsruntime/qv4runtime_p.h index 6be64aa8ea..ee3aeb2392 100644 --- a/src/qml/jsruntime/qv4runtime_p.h +++ b/src/qml/jsruntime/qv4runtime_p.h @@ -89,50 +89,51 @@ struct NoThrowEngine : public ExecutionEngine struct Q_QML_PRIVATE_EXPORT Runtime { // call static ReturnedValue callGlobalLookup(ExecutionEngine *engine, uint index, CallData *callData); - static ReturnedValue callActivationProperty(ExecutionEngine *engine, String *name, CallData *callData); - static ReturnedValue callProperty(ExecutionEngine *engine, String *name, CallData *callData); + static ReturnedValue callActivationProperty(ExecutionEngine *engine, int nameIndex, CallData *callData); + static ReturnedValue callProperty(ExecutionEngine *engine, int nameIndex, CallData *callData); static ReturnedValue callPropertyLookup(ExecutionEngine *engine, uint index, CallData *callData); static ReturnedValue callElement(ExecutionEngine *engine, const ValueRef index, CallData *callData); static ReturnedValue callValue(ExecutionEngine *engine, const ValueRef func, CallData *callData); // construct static ReturnedValue constructGlobalLookup(ExecutionEngine *engine, uint index, CallData *callData); - static ReturnedValue constructActivationProperty(ExecutionEngine *engine, String *name, CallData *callData); - static ReturnedValue constructProperty(ExecutionEngine *engine, String *name, CallData *callData); + static ReturnedValue constructActivationProperty(ExecutionEngine *engine, int nameIndex, CallData *callData); + static ReturnedValue constructProperty(ExecutionEngine *engine, int nameIndex, CallData *callData); static ReturnedValue constructPropertyLookup(ExecutionEngine *engine, uint index, CallData *callData); static ReturnedValue constructValue(ExecutionEngine *engine, const ValueRef func, CallData *callData); // set & get - static void setActivationProperty(ExecutionEngine *engine, String *name, const ValueRef value); - static void setProperty(ExecutionEngine *engine, const ValueRef object, String *name, const ValueRef value); + static void setActivationProperty(ExecutionEngine *engine, int nameIndex, const ValueRef value); + static void setProperty(ExecutionEngine *engine, const ValueRef object, int nameIndex, const ValueRef value); static void setElement(ExecutionEngine *engine, const ValueRef object, const ValueRef index, const ValueRef value); - static ReturnedValue getProperty(ExecutionEngine *engine, const ValueRef object, String *name); - static ReturnedValue getActivationProperty(ExecutionEngine *engine, String *name); + static ReturnedValue getProperty(ExecutionEngine *engine, const ValueRef object, int nameIndex); + static ReturnedValue getActivationProperty(ExecutionEngine *engine, int nameIndex); static ReturnedValue getElement(ExecutionEngine *engine, const ValueRef object, const ValueRef index); // typeof static ReturnedValue typeofValue(ExecutionEngine *engine, const ValueRef val); - static ReturnedValue typeofName(ExecutionEngine *engine, String *name); - static ReturnedValue typeofMember(ExecutionEngine *engine, const ValueRef base, String *name); + static ReturnedValue typeofName(ExecutionEngine *engine, int nameIndex); + static ReturnedValue typeofMember(ExecutionEngine *engine, const ValueRef base, int nameIndex); static ReturnedValue typeofElement(ExecutionEngine *engine, const ValueRef base, const ValueRef index); // delete static ReturnedValue deleteElement(ExecutionEngine *engine, const ValueRef base, const ValueRef index); - static ReturnedValue deleteMember(ExecutionEngine *engine, const ValueRef base, String *name); - static ReturnedValue deleteName(ExecutionEngine *engine, String *name); + static ReturnedValue deleteMember(ExecutionEngine *engine, const ValueRef base, int nameIndex); + static ReturnedValue deleteMemberString(ExecutionEngine *engine, const ValueRef base, String *name); + static ReturnedValue deleteName(ExecutionEngine *engine, int nameIndex); // exceptions & scopes static void throwException(ExecutionEngine *engine, const ValueRef value); static ReturnedValue unwindException(ExecutionEngine *engine); static void pushWithScope(const ValueRef o, NoThrowEngine *engine); - static void pushCatchScope(NoThrowEngine *engine, String *exceptionVarName); + static void pushCatchScope(NoThrowEngine *engine, int exceptionVarNameIndex); static void popScope(ExecutionEngine *engine); // closures static ReturnedValue closure(ExecutionEngine *engine, int functionId); // function header - static void declareVar(ExecutionEngine *engine, bool deletable, String *name); + static void declareVar(ExecutionEngine *engine, bool deletable, int nameIndex); static ReturnedValue setupArgumentsObject(ExecutionEngine *engine); static void convertThisToObject(ExecutionEngine *engine); @@ -209,7 +210,7 @@ struct Q_QML_PRIVATE_EXPORT Runtime { static ReturnedValue getQmlImportedScripts(NoThrowEngine *ctx); static ReturnedValue getQmlContextObject(NoThrowEngine *ctx); static ReturnedValue getQmlScopeObject(NoThrowEngine *ctx); - static ReturnedValue getQmlSingleton(NoThrowEngine *ctx, String *name); + static ReturnedValue getQmlSingleton(NoThrowEngine *ctx, int nameIndex); static ReturnedValue getQmlAttachedProperty(ExecutionEngine *engine, int attachedPropertiesId, int propertyIndex); static ReturnedValue getQmlQObjectProperty(ExecutionEngine *engine, const ValueRef object, int propertyIndex, bool captureRequired); static ReturnedValue getQmlSingletonQObjectProperty(ExecutionEngine *engine, const ValueRef object, int propertyIndex, bool captureRequired); |