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/jsruntime/qv4lookup_p.h | 62 ++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'src/qml/jsruntime/qv4lookup_p.h') diff --git a/src/qml/jsruntime/qv4lookup_p.h b/src/qml/jsruntime/qv4lookup_p.h index a46e712606..d491a62ddc 100644 --- a/src/qml/jsruntime/qv4lookup_p.h +++ b/src/qml/jsruntime/qv4lookup_p.h @@ -49,9 +49,9 @@ struct Lookup { union { ReturnedValue (*indexedGetter)(Lookup *l, const ValueRef object, const ValueRef index); void (*indexedSetter)(Lookup *l, const ValueRef object, const ValueRef index, const ValueRef v); - ReturnedValue (*getter)(Lookup *l, const ValueRef object); + ReturnedValue (*getter)(Lookup *l, ExecutionEngine *engine, const ValueRef object); ReturnedValue (*globalGetter)(Lookup *l, ExecutionEngine *engine); - void (*setter)(Lookup *l, const ValueRef object, const ValueRef v); + void (*setter)(Lookup *l, ExecutionEngine *engine, const ValueRef object, const ValueRef v); }; union { ExecutionEngine *engine; @@ -68,7 +68,7 @@ struct Lookup { uint index2; }; uint index; - String *name; + uint nameIndex; static ReturnedValue indexedGetterGeneric(Lookup *l, const ValueRef object, const ValueRef index); static ReturnedValue indexedGetterFallback(Lookup *l, const ValueRef object, const ValueRef index); @@ -78,26 +78,26 @@ struct Lookup { static void indexedSetterFallback(Lookup *l, const ValueRef object, const ValueRef index, const ValueRef value); static void indexedSetterObjectInt(Lookup *l, const ValueRef object, const ValueRef index, const ValueRef v); - static ReturnedValue getterGeneric(Lookup *l, const ValueRef object); - static ReturnedValue getterTwoClasses(Lookup *l, const ValueRef object); - static ReturnedValue getterFallback(Lookup *l, const ValueRef object); - - static ReturnedValue getter0(Lookup *l, const ValueRef object); - static ReturnedValue getter1(Lookup *l, const ValueRef object); - static ReturnedValue getter2(Lookup *l, const ValueRef object); - static ReturnedValue getter0getter0(Lookup *l, const ValueRef object); - static ReturnedValue getter0getter1(Lookup *l, const ValueRef object); - static ReturnedValue getter1getter1(Lookup *l, const ValueRef object); - static ReturnedValue getterAccessor0(Lookup *l, const ValueRef object); - static ReturnedValue getterAccessor1(Lookup *l, const ValueRef object); - static ReturnedValue getterAccessor2(Lookup *l, const ValueRef object); - - static ReturnedValue primitiveGetter0(Lookup *l, const ValueRef object); - static ReturnedValue primitiveGetter1(Lookup *l, const ValueRef object); - static ReturnedValue primitiveGetterAccessor0(Lookup *l, const ValueRef object); - static ReturnedValue primitiveGetterAccessor1(Lookup *l, const ValueRef object); - static ReturnedValue stringLengthGetter(Lookup *l, const ValueRef object); - static ReturnedValue arrayLengthGetter(Lookup *l, const ValueRef object); + static ReturnedValue getterGeneric(Lookup *l, ExecutionEngine *engine, const ValueRef object); + static ReturnedValue getterTwoClasses(Lookup *l, ExecutionEngine *engine, const ValueRef object); + static ReturnedValue getterFallback(Lookup *l, ExecutionEngine *engine, const ValueRef object); + + static ReturnedValue getter0(Lookup *l, ExecutionEngine *engine, const ValueRef object); + static ReturnedValue getter1(Lookup *l, ExecutionEngine *engine, const ValueRef object); + static ReturnedValue getter2(Lookup *l, ExecutionEngine *engine, const ValueRef object); + static ReturnedValue getter0getter0(Lookup *l, ExecutionEngine *engine, const ValueRef object); + static ReturnedValue getter0getter1(Lookup *l, ExecutionEngine *engine, const ValueRef object); + static ReturnedValue getter1getter1(Lookup *l, ExecutionEngine *engine, const ValueRef object); + static ReturnedValue getterAccessor0(Lookup *l, ExecutionEngine *engine, const ValueRef object); + static ReturnedValue getterAccessor1(Lookup *l, ExecutionEngine *engine, const ValueRef object); + static ReturnedValue getterAccessor2(Lookup *l, ExecutionEngine *engine, const ValueRef object); + + static ReturnedValue primitiveGetter0(Lookup *l, ExecutionEngine *engine, const ValueRef object); + static ReturnedValue primitiveGetter1(Lookup *l, ExecutionEngine *engine, const ValueRef object); + static ReturnedValue primitiveGetterAccessor0(Lookup *l, ExecutionEngine *engine, const ValueRef object); + static ReturnedValue primitiveGetterAccessor1(Lookup *l, ExecutionEngine *engine, const ValueRef object); + static ReturnedValue stringLengthGetter(Lookup *l, ExecutionEngine *engine, const ValueRef object); + static ReturnedValue arrayLengthGetter(Lookup *l, ExecutionEngine *engine, const ValueRef object); static ReturnedValue globalGetterGeneric(Lookup *l, ExecutionEngine *engine); static ReturnedValue globalGetter0(Lookup *l, ExecutionEngine *engine); @@ -107,14 +107,14 @@ struct Lookup { static ReturnedValue globalGetterAccessor1(Lookup *l, ExecutionEngine *engine); static ReturnedValue globalGetterAccessor2(Lookup *l, ExecutionEngine *engine); - static void setterGeneric(Lookup *l, const ValueRef object, const ValueRef value); - static void setterTwoClasses(Lookup *l, const ValueRef object, const ValueRef value); - static void setterFallback(Lookup *l, const ValueRef object, const ValueRef value); - static void setter0(Lookup *l, const ValueRef object, const ValueRef value); - static void setterInsert0(Lookup *l, const ValueRef object, const ValueRef value); - static void setterInsert1(Lookup *l, const ValueRef object, const ValueRef value); - static void setterInsert2(Lookup *l, const ValueRef object, const ValueRef value); - static void setter0setter0(Lookup *l, const ValueRef object, const ValueRef value); + static void setterGeneric(Lookup *l, ExecutionEngine *engine, const ValueRef object, const ValueRef value); + static void setterTwoClasses(Lookup *l, ExecutionEngine *engine, const ValueRef object, const ValueRef value); + static void setterFallback(Lookup *l, ExecutionEngine *engine, const ValueRef object, const ValueRef value); + static void setter0(Lookup *l, ExecutionEngine *engine, const ValueRef object, const ValueRef value); + static void setterInsert0(Lookup *l, ExecutionEngine *engine, const ValueRef object, const ValueRef value); + static void setterInsert1(Lookup *l, ExecutionEngine *engine, const ValueRef object, const ValueRef value); + static void setterInsert2(Lookup *l, ExecutionEngine *engine, const ValueRef object, const ValueRef value); + static void setter0setter0(Lookup *l, ExecutionEngine *engine, const ValueRef object, const ValueRef value); ReturnedValue lookup(ValueRef thisObject, Object *obj, PropertyAttributes *attrs); ReturnedValue lookup(Object *obj, PropertyAttributes *attrs); -- cgit v1.2.3