aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4managed_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-11-02 16:02:10 +0100
committerLars Knoll <lars.knoll@qt.io>2017-11-14 21:45:42 +0000
commit002fdc48d43e4fd67921e0cd46c28d28aee06848 (patch)
tree08fdc81dc91153649d8b6c6514ed3b49ad970064 /src/qml/jsruntime/qv4managed_p.h
parent010197a42150ee73a17cb53fbe397a6c55b2d342 (diff)
Bring back markObjects(), this time generated
Doing the marking of objects in a function instead of using the table seems to be somewhat faster. Change-Id: I9ec00cc0264f9a15c69b285db493bee31d99bf96 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4managed_p.h')
-rw-r--r--src/qml/jsruntime/qv4managed_p.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/qml/jsruntime/qv4managed_p.h b/src/qml/jsruntime/qv4managed_p.h
index 40dfc244ea..ea10f6f6d1 100644
--- a/src/qml/jsruntime/qv4managed_p.h
+++ b/src/qml/jsruntime/qv4managed_p.h
@@ -93,7 +93,6 @@ inline void qYouForgotTheQ_MANAGED_Macro(T1, T2) {}
dptr->_checkIsInitialized(); \
return dptr; \
} \
- static Q_CONSTEXPR quint64 markTable = QV4::Heap::DataClass::markTable; \
V4_ASSERT_IS_TRIVIAL(QV4::Heap::DataClass)
#define V4_MANAGED(DataClass, superClass) \
@@ -132,7 +131,6 @@ inline void qYouForgotTheQ_MANAGED_Macro(T1, T2) {}
#define DEFINE_MANAGED_VTABLE_INT(classname, parentVTable) \
{ \
parentVTable, \
- markTable, \
(sizeof(classname::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), \
(sizeof(classname::Data) + (std::is_same<classname, Object>::value ? 2*sizeof(QV4::Value) : 0) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) \
- (sizeof(classname::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), \
@@ -146,9 +144,9 @@ inline void qYouForgotTheQ_MANAGED_Macro(T1, T2) {}
classname::MyType, \
#classname, \
Q_VTABLE_FUNCTION(classname, destroy), \
- Q_VTABLE_FUNCTION(classname, markObjects), \
+ classname::Data::markObjects, \
isEqualTo \
-}
+} \
#define DEFINE_MANAGED_VTABLE(classname) \
QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_ON \
@@ -221,7 +219,6 @@ public:
inline void mark(MarkStack *markStack);
static void destroy(Heap::Base *) {}
- static void markObjects(Heap::Base *, MarkStack *) {}
Q_ALWAYS_INLINE Heap::Base *heapObject() const {
return m();
@@ -240,6 +237,11 @@ private:
friend struct ObjectIterator;
};
+inline void Managed::mark(MarkStack *markStack)
+{
+ Q_ASSERT(m());
+ m()->mark(markStack);
+}
template<>
inline const Managed *Value::as() const {