Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4regexpobject_p.h |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | - | |||||||
4 | - | |||||||
5 | namespace QV4 { | - | ||||||
6 | - | |||||||
7 | namespace Heap { | - | ||||||
8 | - | |||||||
9 | - | |||||||
10 | - | |||||||
11 | - | |||||||
12 | struct RegExpObjectOffsetStruct { Pointer<RegExp *, 0> value; }; struct RegExpObjectSizeStruct : Object, RegExpObjectOffsetStruct {}; struct RegExpObjectData { typedef Object SuperClass; static constexpr size_t baseOffset = sizeof(RegExpObjectSizeStruct) - sizeof(RegExpObjectOffsetStruct); Pointer<RegExp *, | - | ||||||
13 | __builtin_offsetof ( | - | ||||||
14 | RegExpObjectOffsetStruct | - | ||||||
15 | , | - | ||||||
16 | value | - | ||||||
17 | ) | - | ||||||
18 | + baseOffset> value; }; static_assert(bool(sizeof(RegExpObjectSizeStruct) == sizeof(RegExpObjectData) + RegExpObjectData::baseOffset), "sizeof(RegExpObjectSizeStruct) == sizeof(RegExpObjectData) + RegExpObjectData::baseOffset"); struct RegExpObject : Object, RegExpObjectData { | - | ||||||
19 | static void markObjects(Heap::Base *b, MarkStack *stack) { RegExpObject *o = static_cast<RegExpObject *>(b); RegExpObjectData::SuperClass::markObjects(o, stack); if (o->value
executed 9862 times by 26 tests: }o->value.heapObject()->mark(stack); Executed by:
executed 9862 times by 26 tests: ;end of block Executed by:
| 0-9862 | ||||||
20 | - | |||||||
21 | void init(); | - | ||||||
22 | void init(QV4::RegExp *value); | - | ||||||
23 | void init(const QRegExp &re); | - | ||||||
24 | }; | - | ||||||
25 | - | |||||||
26 | - | |||||||
27 | - | |||||||
28 | - | |||||||
29 | - | |||||||
30 | - | |||||||
31 | - | |||||||
32 | struct RegExpCtorOffsetStruct { HeapValue<0> lastMatch; Pointer<String *, 0> lastInput; int lastMatchStart; int lastMatchEnd; }; struct RegExpCtorSizeStruct : FunctionObject, RegExpCtorOffsetStruct {}; struct RegExpCtorData { typedef FunctionObject SuperClass; static constexpr size_t baseOffset = sizeof(RegExpCtorSizeStruct) - sizeof(RegExpCtorOffsetStruct); HeapValue< | - | ||||||
33 | __builtin_offsetof ( | - | ||||||
34 | RegExpCtorOffsetStruct | - | ||||||
35 | , | - | ||||||
36 | lastMatch | - | ||||||
37 | ) | - | ||||||
38 | + baseOffset> lastMatch; Pointer<String *, | - | ||||||
39 | __builtin_offsetof ( | - | ||||||
40 | RegExpCtorOffsetStruct | - | ||||||
41 | , | - | ||||||
42 | lastInput | - | ||||||
43 | ) | - | ||||||
44 | + baseOffset> lastInput; int lastMatchStart; int lastMatchEnd; }; static_assert(bool(sizeof(RegExpCtorSizeStruct) == sizeof(RegExpCtorData) + RegExpCtorData::baseOffset), "sizeof(RegExpCtorSizeStruct) == sizeof(RegExpCtorData) + RegExpCtorData::baseOffset"); struct RegExpCtor : FunctionObject, RegExpCtorData { | - | ||||||
45 | static void markObjects(Heap::Base *b, MarkStack *stack) { RegExpCtor *o = static_cast<RegExpCtor *>(b); RegExpCtorData::SuperClass::markObjects(o, stack); o->lastMatch.mark(stack); if (o->lastInput
executed 8854 times by 26 tests: }o->lastInput.heapObject()->mark(stack); Executed by:
executed 8854 times by 26 tests: ;end of block Executed by:
| 0-8854 | ||||||
46 | - | |||||||
47 | void init(QV4::ExecutionContext *scope); | - | ||||||
48 | void clearLastMatch(); | - | ||||||
49 | }; | - | ||||||
50 | - | |||||||
51 | } | - | ||||||
52 | - | |||||||
53 | struct RegExpObject: Object { | - | ||||||
54 | private: RegExpObject() = delete; RegExpObject(const RegExpObject &) = delete; RegExpObject &operator=(const RegExpObject &) = delete; public: template <typename Type> inline void qt_check_for_QMANAGED_macro(const Type *_q_argument) const { int i = qYouForgotTheQ_MANAGED_Macro(this, _q_argument); i = i + 1; } executed 41791 times by 42 tests: typedef QV4::Heap::RegExpObject Data; typedef Object SuperClass; static const QV4::VTable static_vtbl; static inline const QV4::VTable *staticVTable() { returnend of block Executed by:
executed 3505589 times by 153 tests: &static_vtbl;return &static_vtbl; Executed by:
executed 3505589 times by 153 tests: } void __dataTest() { static_assert (sizeof(*this) == sizeof(Managed), "Classes derived from Managed can't have own data members."); }return &static_vtbl; Executed by:
never executed: QV4::Heap::RegExpObject *d_unchecked() const { returnend of block executed 7929167 times by 153 tests: static_cast<QV4::Heap::RegExpObject *>(m());return static_cast<QV4::Heap::RegExpObject *>(m()); Executed by:
executed 7929167 times by 153 tests: } QV4::Heap::RegExpObject *d() const { QV4::Heap::RegExpObject *dptr = d_unchecked(); dptr->_checkIsInitialized(); returnreturn static_cast<QV4::Heap::RegExpObject *>(m()); Executed by:
executed 6874176 times by 153 tests: dptr;return dptr; Executed by:
executed 6874176 times by 153 tests: } static_assert(bool(std::is_trivial< QV4::Heap::RegExpObject >::value), "std::is_trivial< QV4::Heap::RegExpObject >::value");return dptr; Executed by:
| 0-7929167 | ||||||
55 | public: enum { MyType = Type_RegExpObject }; | - | ||||||
56 | static Heap::InternalClass *defaultInternalClass(QV4::EngineBase *e) { return executed 1054956 times by 9 tests: e->internalClasses(QV4::EngineBase::Class_RegExpObject);return e->internalClasses(QV4::EngineBase::Class_RegExpObject); Executed by:
executed 1054956 times by 9 tests: }return e->internalClasses(QV4::EngineBase::Class_RegExpObject); Executed by:
| 1054956 | ||||||
57 | static QV4::Object *defaultPrototype(QV4::ExecutionEngine *e) { return executed 1055133 times by 9 tests: e->regExpPrototype();return e->regExpPrototype(); Executed by:
executed 1055133 times by 9 tests: }return e->regExpPrototype(); Executed by:
| 1055133 | ||||||
58 | - | |||||||
59 | - | |||||||
60 | enum Flags { | - | ||||||
61 | RegExp_Global = 0x01, | - | ||||||
62 | RegExp_IgnoreCase = 0x02, | - | ||||||
63 | RegExp_Multiline = 0x04 | - | ||||||
64 | }; | - | ||||||
65 | - | |||||||
66 | enum { | - | ||||||
67 | Index_LastIndex = 0, | - | ||||||
68 | Index_Source = 1, | - | ||||||
69 | Index_Global = 2, | - | ||||||
70 | Index_IgnoreCase = 3, | - | ||||||
71 | Index_Multiline = 4, | - | ||||||
72 | Index_ArrayIndex = Heap::ArrayObject::LengthPropertyIndex + 1, | - | ||||||
73 | Index_ArrayInput = Index_ArrayIndex + 1 | - | ||||||
74 | }; | - | ||||||
75 | - | |||||||
76 | enum { NInlineProperties = 5 }; | - | ||||||
77 | - | |||||||
78 | Heap::RegExp *value() const { return executed 4647372 times by 153 tests: d()->value;return d()->value; Executed by:
executed 4647372 times by 153 tests: }return d()->value; Executed by:
| 4647372 | ||||||
79 | bool global() const { return executed 1171453 times by 153 tests: d()->value->global;return d()->value->global; Executed by:
executed 1171453 times by 153 tests: }return d()->value->global; Executed by:
| 1171453 | ||||||
80 | - | |||||||
81 | void initProperties(); | - | ||||||
82 | - | |||||||
83 | int lastIndex() const { | - | ||||||
84 | ((Index_LastIndex == internalClass()->find(engine()->id_lastIndex()->propertyKey())) ? static_cast<void>(0) : qt_assert("Index_LastIndex == internalClass()->find(engine()->id_lastIndex()->propertyKey())", __FILE__, 132)); | - | ||||||
85 | return executed 3226 times by 2 tests: propertyData(Index_LastIndex)->toInt32();return propertyData(Index_LastIndex)->toInt32(); Executed by:
executed 3226 times by 2 tests: return propertyData(Index_LastIndex)->toInt32(); Executed by:
| 3226 | ||||||
86 | } | - | ||||||
87 | void setLastIndex(int index) { | - | ||||||
88 | ((Index_LastIndex == internalClass()->find(engine()->id_lastIndex()->propertyKey())) ? static_cast<void>(0) : qt_assert("Index_LastIndex == internalClass()->find(engine()->id_lastIndex()->propertyKey())", __FILE__, 136)); | - | ||||||
89 | return executed 6632 times by 3 tests: setProperty(Index_LastIndex, Primitive::fromInt32(index));return setProperty(Index_LastIndex, Primitive::fromInt32(index)); Executed by:
executed 6632 times by 3 tests: return setProperty(Index_LastIndex, Primitive::fromInt32(index)); Executed by:
| 6632 | ||||||
90 | } | - | ||||||
91 | - | |||||||
92 | QRegExp toQRegExp() const; | - | ||||||
93 | QString toString() const; | - | ||||||
94 | QString source() const; | - | ||||||
95 | uint flags() const; | - | ||||||
96 | }; | - | ||||||
97 | - | |||||||
98 | struct RegExpCtor: FunctionObject | - | ||||||
99 | { | - | ||||||
100 | private: RegExpCtor() = delete; RegExpCtor(const RegExpCtor &) = delete; RegExpCtor &operator=(const RegExpCtor &) = delete; public: template <typename Type> inline void qt_check_for_QMANAGED_macro(const Type *_q_argument) const { int i = qYouForgotTheQ_MANAGED_Macro(this, _q_argument); i = i + 1; } executed 4 times by 1 test: typedef QV4::Heap::RegExpCtor Data; typedef FunctionObject SuperClass; static const QV4::VTable static_vtbl; static inline const QV4::VTable *staticVTable() { returnend of block Executed by:
executed 296997 times by 153 tests: &static_vtbl;return &static_vtbl; Executed by:
executed 296997 times by 153 tests: } void __dataTest() { static_assert (sizeof(*this) == sizeof(Managed), "Classes derived from Managed can't have own data members."); }return &static_vtbl; Executed by:
never executed: QV4::Heap::RegExpCtor *d_unchecked() const { returnend of block executed 212323 times by 153 tests: static_cast<QV4::Heap::RegExpCtor *>(m());return static_cast<QV4::Heap::RegExpCtor *>(m()); Executed by:
executed 212323 times by 153 tests: } QV4::Heap::RegExpCtor *d() const { QV4::Heap::RegExpCtor *dptr = d_unchecked(); dptr->_checkIsInitialized(); returnreturn static_cast<QV4::Heap::RegExpCtor *>(m()); Executed by:
executed 113361 times by 153 tests: dptr;return dptr; Executed by:
executed 113361 times by 153 tests: } static_assert(bool(std::is_trivial< QV4::Heap::RegExpCtor >::value), "std::is_trivial< QV4::Heap::RegExpCtor >::value");return dptr; Executed by:
| 0-296997 | ||||||
101 | - | |||||||
102 | Value lastMatch() { return executed 40 times by 1 test: d()->lastMatch;return d()->lastMatch; Executed by:
executed 40 times by 1 test: }return d()->lastMatch; Executed by:
| 40 | ||||||
103 | Heap::String *lastInput() { return executed 8 times by 1 test: d()->lastInput;return d()->lastInput; Executed by:
executed 8 times by 1 test: }return d()->lastInput; Executed by:
| 8 | ||||||
104 | int lastMatchStart() { return executed 2 times by 1 test: d()->lastMatchStart;return d()->lastMatchStart; Executed by:
executed 2 times by 1 test: }return d()->lastMatchStart; Executed by:
| 2 | ||||||
105 | int lastMatchEnd() { return executed 2 times by 1 test: d()->lastMatchEnd;return d()->lastMatchEnd; Executed by:
executed 2 times by 1 test: }return d()->lastMatchEnd; Executed by:
| 2 | ||||||
106 | - | |||||||
107 | static ReturnedValue virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *); | - | ||||||
108 | static ReturnedValue virtualCall(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc); | - | ||||||
109 | }; | - | ||||||
110 | - | |||||||
111 | struct RegExpPrototype: RegExpObject | - | ||||||
112 | { | - | ||||||
113 | void init(ExecutionEngine *engine, Object *ctor); | - | ||||||
114 | - | |||||||
115 | static ReturnedValue method_exec(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
116 | static ReturnedValue method_test(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
117 | static ReturnedValue method_toString(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
118 | static ReturnedValue method_compile(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
119 | - | |||||||
120 | template <uint index> | - | ||||||
121 | static ReturnedValue method_get_lastMatch_n(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
122 | static ReturnedValue method_get_lastParen(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
123 | static ReturnedValue method_get_input(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
124 | static ReturnedValue method_get_leftContext(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
125 | static ReturnedValue method_get_rightContext(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
126 | - | |||||||
127 | static ReturnedValue execFirstMatch(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc); | - | ||||||
128 | }; | - | ||||||
129 | - | |||||||
130 | } | - | ||||||
131 | - | |||||||
132 | - | |||||||
Switch to Source code | Preprocessed file |