From f58b5229a31e9fec49b4eb055c56f9a78e423866 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 12 Nov 2014 16:07:56 +0100 Subject: 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 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 --- src/qml/jit/qv4assembler_p.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/qml/jit/qv4assembler_p.h') diff --git a/src/qml/jit/qv4assembler_p.h b/src/qml/jit/qv4assembler_p.h index a4105550c6..a143690793 100644 --- a/src/qml/jit/qv4assembler_p.h +++ b/src/qml/jit/qv4assembler_p.h @@ -316,8 +316,8 @@ public: {} IR::Expr *value; }; - struct PointerToString { - explicit PointerToString(const QString &string) : string(string) {} + struct StringToIndex { + explicit StringToIndex(const QString &string) : string(string) {} QString string; }; struct Reference { @@ -446,7 +446,7 @@ public: loadArgumentInRegister(addr, dest, argumentNumber); } } - void loadArgumentInRegister(PointerToString temp, RegisterID dest, int argumentNumber) + void loadArgumentInRegister(StringToIndex temp, RegisterID dest, int argumentNumber) { Q_UNUSED(argumentNumber); loadStringRef(dest, temp.string); @@ -662,7 +662,7 @@ public: } template - void loadArgumentOnStack(PointerToString temp, int argumentNumber) + void loadArgumentOnStack(StringToIndex temp, int argumentNumber) { Q_UNUSED(argumentNumber); loadStringRef(ScratchRegister, temp.string); -- cgit v1.2.3