From f2e44812a739b9f481213c67e7683b99676f2593 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 15 Jun 2017 11:38:35 +0200 Subject: Prospective build fix for Integrity OS If ExecutionEngine is forward declared and the compiler tries to instantiate the Value/Array/etc. templates early on, it may not be able to map ExecutionEngine to EngineBase. That is what the error message suggests. Since we don't need ExecutionEngine let's try EngineBase. Change-Id: Idd18dd431705cce8df79180e7ac08574bbe1170c Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4arraydata_p.h | 12 ++++++------ src/qml/jsruntime/qv4memberdata_p.h | 4 ++-- src/qml/memory/qv4writebarrier_p.h | 14 +++++++------- 3 files changed, 15 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/qml/jsruntime/qv4arraydata_p.h b/src/qml/jsruntime/qv4arraydata_p.h index 1d895c90c5..e1de2e82e6 100644 --- a/src/qml/jsruntime/qv4arraydata_p.h +++ b/src/qml/jsruntime/qv4arraydata_p.h @@ -107,7 +107,7 @@ DECLARE_HEAP_OBJECT(ArrayData, Base) { Heap::ArrayData *arrayData; uint index; - void set(ExecutionEngine *e, Value newVal) { + void set(EngineBase *e, Value newVal) { arrayData->values.set(e, index, newVal); } const Value *operator->() const { return &arrayData->values[index]; } @@ -123,7 +123,7 @@ DECLARE_HEAP_OBJECT(ArrayData, Base) { return vtable()->get(this, i); } inline bool getProperty(uint index, Property *p, PropertyAttributes *attrs); - inline void setProperty(ExecutionEngine *e, uint index, const Property *p); + inline void setProperty(EngineBase *e, uint index, const Property *p); inline Index getValueOrSetter(uint index, PropertyAttributes *attrs); inline PropertyAttributes attributes(uint i) const; @@ -135,7 +135,7 @@ DECLARE_HEAP_OBJECT(ArrayData, Base) { return vtable()->length(this); } - void setArrayData(ExecutionEngine *e, uint index, Value newVal) { + void setArrayData(EngineBase *e, uint index, Value newVal) { values.set(e, index, newVal); } @@ -146,7 +146,7 @@ V4_ASSERT_IS_TRIVIAL(ArrayData) struct SimpleArrayData : public ArrayData { uint mappedIndex(uint index) const { return (index + offset) % values.alloc; } const Value &data(uint index) const { return values[mappedIndex(index)]; } - void setData(ExecutionEngine *e, uint index, Value newVal) { + void setData(EngineBase *e, uint index, Value newVal) { values.set(e, mappedIndex(index), newVal); } @@ -197,7 +197,7 @@ struct Q_QML_EXPORT ArrayData : public Managed PropertyAttributes *attrs() const { return d()->attrs; } void setAttrs(PropertyAttributes *a) { d()->attrs = a; } const Value *arrayData() const { return d()->values.data(); } - void setArrayData(ExecutionEngine *e, uint index, Value newVal) { + void setArrayData(EngineBase *e, uint index, Value newVal) { d()->setArrayData(e, index, newVal); } @@ -310,7 +310,7 @@ bool ArrayData::getProperty(uint index, Property *p, PropertyAttributes *attrs) return true; } -void ArrayData::setProperty(QV4::ExecutionEngine *e, uint index, const Property *p) +void ArrayData::setProperty(QV4::EngineBase *e, uint index, const Property *p) { uint mapped = mappedIndex(index); Q_ASSERT(mapped != UINT_MAX); diff --git a/src/qml/jsruntime/qv4memberdata_p.h b/src/qml/jsruntime/qv4memberdata_p.h index 9d333011fc..bae524d088 100644 --- a/src/qml/jsruntime/qv4memberdata_p.h +++ b/src/qml/jsruntime/qv4memberdata_p.h @@ -88,8 +88,8 @@ struct MemberData : Managed const Value &operator[] (uint idx) const { return d()->values[idx]; } const Value *data() const { return d()->values.data(); } - void set(ExecutionEngine *e, uint index, Value v) { d()->values.set(e, index, v); } - void set(ExecutionEngine *e, uint index, Heap::Base *b) { d()->values.set(e, index, b); } + void set(EngineBase *e, uint index, Value v) { d()->values.set(e, index, v); } + void set(EngineBase *e, uint index, Heap::Base *b) { d()->values.set(e, index, b); } inline uint size() const { return d()->values.size; } diff --git a/src/qml/memory/qv4writebarrier_p.h b/src/qml/memory/qv4writebarrier_p.h index 3182fd2aa9..86fd28000d 100644 --- a/src/qml/memory/qv4writebarrier_p.h +++ b/src/qml/memory/qv4writebarrier_p.h @@ -123,7 +123,7 @@ struct Pointer { return base; } - void set(ExecutionEngine *e, T newVal) { + void set(EngineBase *e, T newVal) { WriteBarrier::write(e, base(), reinterpret_cast(&ptr), reinterpret_cast(newVal)); } @@ -146,10 +146,10 @@ struct HeapValue : Value { return base; } - void set(ExecutionEngine *e, const Value &newVal) { + void set(EngineBase *e, const Value &newVal) { WriteBarrier::write(e, base(), this, newVal); } - void set(ExecutionEngine *e, Heap::Base *b) { + void set(EngineBase *e, Heap::Base *b) { WriteBarrier::write(e, base(), this, b); } }; @@ -166,10 +166,10 @@ struct ValueArray { return base; } - void set(ExecutionEngine *e, uint index, Value v) { + void set(EngineBase *e, uint index, Value v) { WriteBarrier::write(e, base(), values + index, v); } - void set(ExecutionEngine *e, uint index, Heap::Base *b) { + void set(EngineBase *e, uint index, Heap::Base *b) { WriteBarrier::write(e, base(), values + index, b); } inline const Value &operator[] (uint index) const { @@ -180,13 +180,13 @@ struct ValueArray { return values; } - void insertData(ExecutionEngine *e, uint index, Value v) { + void insertData(EngineBase *e, uint index, Value v) { for (uint i = size - 1; i > index; --i) { values[i] = values[i - 1]; } set(e, index, v); } - void removeData(ExecutionEngine *e, uint index, int n = 1) { + void removeData(EngineBase *e, uint index, int n = 1) { Q_UNUSED(e); for (uint i = index; i < size - n; ++i) { values[i] = values[i + n]; -- cgit v1.2.3