| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsapi/qjsengine_p.h |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||
| 2 | - | |||||||||||||||||||
| 3 | - | |||||||||||||||||||
| 4 | class QQmlPropertyCache; | - | ||||||||||||||||||
| 5 | - | |||||||||||||||||||
| 6 | namespace QV4 { | - | ||||||||||||||||||
| 7 | struct ExecutionEngine; | - | ||||||||||||||||||
| 8 | } | - | ||||||||||||||||||
| 9 | - | |||||||||||||||||||
| 10 | class __attribute__((visibility("default"))) QJSEnginePrivate : public QObjectPrivate | - | ||||||||||||||||||
| 11 | { | - | ||||||||||||||||||
| 12 | inline QJSEngine* q_func() { return static_cast<QJSEngine *>(q_ptr); } inline const QJSEngine* q_func() const { return static_cast<const QJSEngine *>(q_ptr); } friend class QJSEngine; | - | ||||||||||||||||||
| 13 | - | |||||||||||||||||||
| 14 | public: | - | ||||||||||||||||||
| 15 | static QJSEnginePrivate* get(QJSEngine*e) { return executed 103146 times by 35 tests: e->d_func();return e->d_func();Executed by:
executed 103146 times by 35 tests: }return e->d_func();Executed by:
| 103146 | ||||||||||||||||||
| 16 | static const QJSEnginePrivate* get(const QJSEngine*e) { return never executed: e->d_func();return e->d_func();never executed: }return e->d_func(); | 0 | ||||||||||||||||||
| 17 | static QJSEnginePrivate* get(QV4::ExecutionEngine *e); | - | ||||||||||||||||||
| 18 | - | |||||||||||||||||||
| 19 | QJSEnginePrivate() : mutex(QMutex::Recursive) {} executed 2664 times by 8 tests: end of blockExecuted by:
| 2664 | ||||||||||||||||||
| 20 | ~QJSEnginePrivate() override; | - | ||||||||||||||||||
| 21 | - | |||||||||||||||||||
| 22 | static void addToDebugServer(QJSEngine *q); | - | ||||||||||||||||||
| 23 | static void removeFromDebugServer(QJSEngine *q); | - | ||||||||||||||||||
| 24 | class Locker | - | ||||||||||||||||||
| 25 | { | - | ||||||||||||||||||
| 26 | public: | - | ||||||||||||||||||
| 27 | inline Locker(const QJSEngine *); | - | ||||||||||||||||||
| 28 | inline Locker(const QJSEnginePrivate *); | - | ||||||||||||||||||
| 29 | inline ~Locker(); | - | ||||||||||||||||||
| 30 | - | |||||||||||||||||||
| 31 | inline void unlock(); | - | ||||||||||||||||||
| 32 | inline void relock(); | - | ||||||||||||||||||
| 33 | - | |||||||||||||||||||
| 34 | private: | - | ||||||||||||||||||
| 35 | const QJSEnginePrivate *m_ep; | - | ||||||||||||||||||
| 36 | quint32 m_locked:1; | - | ||||||||||||||||||
| 37 | }; | - | ||||||||||||||||||
| 38 | - | |||||||||||||||||||
| 39 | - | |||||||||||||||||||
| 40 | mutable QMutex mutex; | - | ||||||||||||||||||
| 41 | - | |||||||||||||||||||
| 42 | - | |||||||||||||||||||
| 43 | - | |||||||||||||||||||
| 44 | inline QQmlPropertyCache *cache(QObject *obj); | - | ||||||||||||||||||
| 45 | inline QQmlPropertyCache *cache(const QMetaObject *); | - | ||||||||||||||||||
| 46 | }; | - | ||||||||||||||||||
| 47 | - | |||||||||||||||||||
| 48 | QJSEnginePrivate::Locker::Locker(const QJSEngine *e) | - | ||||||||||||||||||
| 49 | : m_ep(QJSEnginePrivate::get(e)) | - | ||||||||||||||||||
| 50 | { | - | ||||||||||||||||||
| 51 | relock(); | - | ||||||||||||||||||
| 52 | } never executed: end of block | 0 | ||||||||||||||||||
| 53 | - | |||||||||||||||||||
| 54 | QJSEnginePrivate::Locker::Locker(const QJSEnginePrivate *e) | - | ||||||||||||||||||
| 55 | : m_ep(e), m_locked(false) | - | ||||||||||||||||||
| 56 | { | - | ||||||||||||||||||
| 57 | relock(); | - | ||||||||||||||||||
| 58 | } executed 600132 times by 142 tests: end of blockExecuted by:
| 600132 | ||||||||||||||||||
| 59 | - | |||||||||||||||||||
| 60 | QJSEnginePrivate::Locker::~Locker() | - | ||||||||||||||||||
| 61 | { | - | ||||||||||||||||||
| 62 | unlock(); | - | ||||||||||||||||||
| 63 | } executed 600132 times by 142 tests: end of blockExecuted by:
| 600132 | ||||||||||||||||||
| 64 | - | |||||||||||||||||||
| 65 | void QJSEnginePrivate::Locker::unlock() | - | ||||||||||||||||||
| 66 | { | - | ||||||||||||||||||
| 67 | if (m_locked
| 0-600132 | ||||||||||||||||||
| 68 | m_ep->mutex.unlock(); | - | ||||||||||||||||||
| 69 | m_locked = false; | - | ||||||||||||||||||
| 70 | } executed 600132 times by 142 tests: end of blockExecuted by:
| 600132 | ||||||||||||||||||
| 71 | } executed 600132 times by 142 tests: end of blockExecuted by:
| 600132 | ||||||||||||||||||
| 72 | - | |||||||||||||||||||
| 73 | void QJSEnginePrivate::Locker::relock() | - | ||||||||||||||||||
| 74 | { | - | ||||||||||||||||||
| 75 | ((!m_locked) ? static_cast<void>(0) : qt_assert("!m_locked", __FILE__, 143)); | - | ||||||||||||||||||
| 76 | m_ep->mutex.lock(); | - | ||||||||||||||||||
| 77 | m_locked = true; | - | ||||||||||||||||||
| 78 | } executed 600132 times by 142 tests: end of blockExecuted by:
| 600132 | ||||||||||||||||||
| 79 | QQmlPropertyCache *QJSEnginePrivate::cache(QObject *obj) | - | ||||||||||||||||||
| 80 | { | - | ||||||||||||||||||
| 81 | if (!obj
| 0-103148 | ||||||||||||||||||
| 82 | return executed 26962 times by 10 tests: nullptr;return nullptr;Executed by:
executed 26962 times by 10 tests: return nullptr;Executed by:
| 26962 | ||||||||||||||||||
| 83 | - | |||||||||||||||||||
| 84 | Locker locker(this); | - | ||||||||||||||||||
| 85 | const QMetaObject *mo = obj->metaObject(); | - | ||||||||||||||||||
| 86 | return executed 76186 times by 31 tests: QQmlMetaType::propertyCache(mo);return QQmlMetaType::propertyCache(mo);Executed by:
executed 76186 times by 31 tests: return QQmlMetaType::propertyCache(mo);Executed by:
| 76186 | ||||||||||||||||||
| 87 | } | - | ||||||||||||||||||
| 88 | QQmlPropertyCache *QJSEnginePrivate::cache(const QMetaObject *metaObject) | - | ||||||||||||||||||
| 89 | { | - | ||||||||||||||||||
| 90 | ((metaObject) ? static_cast<void>(0) : qt_assert("metaObject", __FILE__, 184)); | - | ||||||||||||||||||
| 91 | - | |||||||||||||||||||
| 92 | Locker locker(this); | - | ||||||||||||||||||
| 93 | return executed 460881 times by 137 tests: QQmlMetaType::propertyCache(metaObject);return QQmlMetaType::propertyCache(metaObject);Executed by:
executed 460881 times by 137 tests: return QQmlMetaType::propertyCache(metaObject);Executed by:
| 460881 | ||||||||||||||||||
| 94 | } | - | ||||||||||||||||||
| 95 | - | |||||||||||||||||||
| 96 | - | |||||||||||||||||||
| 97 | - | |||||||||||||||||||
| Switch to Source code | Preprocessed file |