OpenCoverage

YarrInterpreter.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/3rdparty/masm/yarr/YarrInterpreter.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8using namespace WTF;-
9-
10namespace JSC { namespace Yarr {-
11-
12template<typename CharType>-
13class Interpreter {-
14public:-
15 struct ParenthesesDisjunctionContext;-
16-
17 struct BackTrackInfoPatternCharacter {-
18 uintptr_t matchAmount;-
19 };-
20 struct BackTrackInfoCharacterClass {-
21 uintptr_t matchAmount;-
22 };-
23 struct BackTrackInfoBackReference {-
24 uintptr_t begin;-
25 uintptr_t matchAmount;-
26 };-
27 struct BackTrackInfoAlternative {-
28 uintptr_t offset;-
29 };-
30 struct BackTrackInfoParentheticalAssertion {-
31 uintptr_t begin;-
32 };-
33 struct BackTrackInfoParenthesesOnce {-
34 uintptr_t begin;-
35 };-
36 struct BackTrackInfoParenthesesTerminal {-
37 uintptr_t begin;-
38 };-
39 struct BackTrackInfoParentheses {-
40 uintptr_t matchAmount;-
41 ParenthesesDisjunctionContext* lastContext;-
42 };-
43-
44 static inline void appendParenthesesDisjunctionContext(BackTrackInfoParentheses* backTrack, ParenthesesDisjunctionContext* context)-
45 {-
46 context->next = backTrack->lastContext;-
47 backTrack->lastContext = context;-
48 ++backTrack->matchAmount;-
49 }
executed 504 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
504
50-
51 static inline void popParenthesesDisjunctionContext(BackTrackInfoParentheses* backTrack)-
52 {-
53 (!(backTrack->matchAmount) ? (qmlWTFReportAssertionFailure(__FILE__, 86, __PRETTY_FUNCTION__, "backTrack->matchAmount"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
54 (!(backTrack->lastContext) ? (qmlWTFReportAssertionFailure(__FILE__, 87, __PRETTY_FUNCTION__, "backTrack->lastContext"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
55 backTrack->lastContext = backTrack->lastContext->next;-
56 --backTrack->matchAmount;-
57 }
executed 24 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
24
58-
59 struct DisjunctionContext-
60 {-
61 DisjunctionContext()-
62 : term(0)-
63 {-
64 }
executed 2972 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
2972
65-
66 void* operator new(size_t, void* where)-
67 {-
68 return
executed 2972 times by 1 test: return where;
Executed by:
  • tst_ecmascripttests
where;
executed 2972 times by 1 test: return where;
Executed by:
  • tst_ecmascripttests
2972
69 }-
70-
71 int term;-
72 unsigned matchBegin;-
73 unsigned matchEnd;-
74 uintptr_t frame[1];-
75 };-
76-
77 DisjunctionContext* allocDisjunctionContext(ByteDisjunction* disjunction)-
78 {-
79 size_t size = sizeof(DisjunctionContext) - sizeof(uintptr_t) + disjunction->m_frameSize * sizeof(uintptr_t);-
80 allocatorPool = allocatorPool->ensureCapacity(size);-
81 (!(allocatorPool) ? (qmlWTFReportAssertionFailure(__FILE__, 114, __PRETTY_FUNCTION__, "allocatorPool"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
82 return
executed 216 times by 1 test: return new (allocatorPool->alloc(size)) DisjunctionContext();
Executed by:
  • tst_ecmascripttests
new (allocatorPool->alloc(size)) DisjunctionContext();
executed 216 times by 1 test: return new (allocatorPool->alloc(size)) DisjunctionContext();
Executed by:
  • tst_ecmascripttests
216
83 }-
84-
85 void freeDisjunctionContext(DisjunctionContext* context)-
86 {-
87 allocatorPool = allocatorPool->dealloc(context);-
88 }
executed 216 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
216
89-
90 struct ParenthesesDisjunctionContext-
91 {-
92 ParenthesesDisjunctionContext(unsigned* output, ByteTerm& term)-
93 : next(0)-
94 {-
95 unsigned firstSubpatternId = term.atom.subpatternId;-
96 unsigned numNestedSubpatterns = term.atom.parenthesesDisjunction->m_numSubpatterns;-
97-
98 for (unsigned i = 0; i < (numNestedSubpatterns << 1)
i < (numNested...patterns << 1)Description
TRUEevaluated 6350 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 2756 times by 1 test
Evaluated by:
  • tst_ecmascripttests
; ++i) {
2756-6350
99 subpatternBackup[i] = output[(firstSubpatternId << 1) + i];-
100 output[(firstSubpatternId << 1) + i] = offsetNoMatch;-
101 }
executed 6350 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
6350
102-
103 new (getDisjunctionContext(term)) DisjunctionContext();-
104 }
executed 2756 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
2756
105-
106 void* operator new(size_t, void* where)-
107 {-
108 return
executed 2756 times by 1 test: return where;
Executed by:
  • tst_ecmascripttests
where;
executed 2756 times by 1 test: return where;
Executed by:
  • tst_ecmascripttests
2756
109 }-
110-
111 void restoreOutput(unsigned* output, unsigned firstSubpatternId, unsigned numNestedSubpatterns)-
112 {-
113 for (unsigned i = 0; i < (numNestedSubpatterns << 1)
i < (numNested...patterns << 1)Description
TRUEevaluated 4840 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 2276 times by 1 test
Evaluated by:
  • tst_ecmascripttests
; ++i)
2276-4840
114 output[(firstSubpatternId << 1) + i] = subpatternBackup[i];
executed 4840 times by 1 test: output[(firstSubpatternId << 1) + i] = subpatternBackup[i];
Executed by:
  • tst_ecmascripttests
4840
115 }
executed 2276 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
2276
116-
117 DisjunctionContext* getDisjunctionContext(ByteTerm& term)-
118 {-
119 return
executed 5961 times by 1 test: return reinterpret_cast<DisjunctionContext*>(&(subpatternBackup[term.atom.parenthesesDisjunction->m_numSubpatterns << 1]));
Executed by:
  • tst_ecmascripttests
reinterpret_cast<DisjunctionContext*>(&(subpatternBackup[term.atom.parenthesesDisjunction->m_numSubpatterns << 1]));
executed 5961 times by 1 test: return reinterpret_cast<DisjunctionContext*>(&(subpatternBackup[term.atom.parenthesesDisjunction->m_numSubpatterns << 1]));
Executed by:
  • tst_ecmascripttests
5961
120 }-
121-
122 ParenthesesDisjunctionContext* next;-
123 unsigned subpatternBackup[1];-
124 };-
125-
126 ParenthesesDisjunctionContext* allocParenthesesDisjunctionContext(ByteDisjunction* disjunction, unsigned* output, ByteTerm& term)-
127 {-
128 size_t size = sizeof(ParenthesesDisjunctionContext) - sizeof(unsigned) + (term.atom.parenthesesDisjunction->m_numSubpatterns << 1) * sizeof(unsigned) + sizeof(DisjunctionContext) - sizeof(uintptr_t) + disjunction->m_frameSize * sizeof(uintptr_t);-
129 allocatorPool = allocatorPool->ensureCapacity(size);-
130 (!(allocatorPool) ? (qmlWTFReportAssertionFailure(__FILE__, 163, __PRETTY_FUNCTION__, "allocatorPool"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
131 return
executed 2756 times by 1 test: return new (allocatorPool->alloc(size)) ParenthesesDisjunctionContext(output, term);
Executed by:
  • tst_ecmascripttests
new (allocatorPool->alloc(size)) ParenthesesDisjunctionContext(output, term);
executed 2756 times by 1 test: return new (allocatorPool->alloc(size)) ParenthesesDisjunctionContext(output, term);
Executed by:
  • tst_ecmascripttests
2756
132 }-
133-
134 void freeParenthesesDisjunctionContext(ParenthesesDisjunctionContext* context)-
135 {-
136 allocatorPool = allocatorPool->dealloc(context);-
137 }
executed 2276 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
2276
138-
139 class InputStream {-
140 public:-
141 InputStream(const CharType* input, unsigned start, unsigned length)-
142 : input(input)-
143 , pos(start)-
144 , length(length)-
145 {-
146 }
executed 216 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
216
147-
148 void next()-
149 {-
150 ++pos;-
151 }
executed 16236 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
16236
152-
153 void rewind(unsigned amount)-
154 {-
155 (!(pos >= amount) ? (qmlWTFReportAssertionFailure(__FILE__, 188, __PRETTY_FUNCTION__, "pos >= amount"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
156 pos -= amount;-
157 }
never executed: end of block
0
158-
159 int read()-
160 {-
161 (!(pos < length) ? (qmlWTFReportAssertionFailure(__FILE__, 194, __PRETTY_FUNCTION__, "pos < length"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
162 if (pos < length
pos < lengthDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
)
0-4
163 return
executed 4 times by 1 test: return input[pos];
Executed by:
  • tst_ecmascripttests
input[pos];
executed 4 times by 1 test: return input[pos];
Executed by:
  • tst_ecmascripttests
4
164 return
never executed: return -1;
-1;
never executed: return -1;
0
165 }-
166-
167 int readPair()-
168 {-
169 (!(pos + 1 < length) ? (qmlWTFReportAssertionFailure(__FILE__, 202, __PRETTY_FUNCTION__, "pos + 1 < length"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
170 return
never executed: return input[pos] | input[pos + 1] << 16;
input[pos] | input[pos + 1] << 16;
never executed: return input[pos] | input[pos + 1] << 16;
0
171 }-
172-
173 int readChecked(unsigned negativePositionOffest)-
174 {-
175 (!(pos >= negativePositionOffest) ? (qmlWTFReportAssertionFailure(__FILE__, 208, __PRETTY_FUNCTION__, "pos >= negativePositionOffest"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
176 unsigned p = pos - negativePositionOffest;-
177 (!(p < length) ? (qmlWTFReportAssertionFailure(__FILE__, 210, __PRETTY_FUNCTION__, "p < length"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
178 return
executed 7386841 times by 1 test: return input[p];
Executed by:
  • tst_ecmascripttests
input[p];
executed 7386841 times by 1 test: return input[p];
Executed by:
  • tst_ecmascripttests
7386841
179 }-
180-
181 int reread(unsigned from)-
182 {-
183 (!(from < length) ? (qmlWTFReportAssertionFailure(__FILE__, 216, __PRETTY_FUNCTION__, "from < length"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
184 return
executed 516 times by 1 test: return input[from];
Executed by:
  • tst_ecmascripttests
input[from];
executed 516 times by 1 test: return input[from];
Executed by:
  • tst_ecmascripttests
516
185 }-
186-
187 int prev()-
188 {-
189 (!(!(pos > length)) ? (qmlWTFReportAssertionFailure(__FILE__, 222, __PRETTY_FUNCTION__, "!(pos > length)"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
190 if (pos
posDescription
TRUEnever evaluated
FALSEnever evaluated
&& length
lengthDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
191 return
never executed: return input[pos - 1];
input[pos - 1];
never executed: return input[pos - 1];
0
192 return
never executed: return -1;
-1;
never executed: return -1;
0
193 }-
194-
195 unsigned getPos()-
196 {-
197 return
executed 21774 times by 1 test: return pos;
Executed by:
  • tst_ecmascripttests
pos;
executed 21774 times by 1 test: return pos;
Executed by:
  • tst_ecmascripttests
21774
198 }-
199-
200 void setPos(unsigned p)-
201 {-
202 pos = p;-
203 }
executed 116 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
116
204-
205 bool atStart()-
206 {-
207 return
never executed: return pos == 0;
pos == 0;
never executed: return pos == 0;
0
208 }-
209-
210 bool atEnd()-
211 {-
212 return
executed 16292 times by 1 test: return pos == length;
Executed by:
  • tst_ecmascripttests
pos == length;
executed 16292 times by 1 test: return pos == length;
Executed by:
  • tst_ecmascripttests
16292
213 }-
214-
215 unsigned end()-
216 {-
217 return
never executed: return length;
length;
never executed: return length;
0
218 }-
219-
220 bool checkInput(unsigned count)-
221 {-
222 if (((
((pos + count) <= length)Description
TRUEevaluated 3706514 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 11504 times by 1 test
Evaluated by:
  • tst_ecmascripttests
pos + count) <= length)
((pos + count) <= length)Description
TRUEevaluated 3706514 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 11504 times by 1 test
Evaluated by:
  • tst_ecmascripttests
&& ((
((pos + count) >= pos)Description
TRUEevaluated 3706513 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
pos + count) >= pos)
((pos + count) >= pos)Description
TRUEevaluated 3706513 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
) {
0-3706514
223 pos += count;-
224 return
executed 3706514 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
true;
executed 3706514 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
3706514
225 }-
226 return
executed 11504 times by 1 test: return false;
Executed by:
  • tst_ecmascripttests
false;
executed 11504 times by 1 test: return false;
Executed by:
  • tst_ecmascripttests
11504
227 }-
228-
229 void uncheckInput(unsigned count)-
230 {-
231 (!(pos >= count) ? (qmlWTFReportAssertionFailure(__FILE__, 264, __PRETTY_FUNCTION__, "pos >= count"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
232 pos -= count;-
233 }
executed 3703919 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
3703919
234-
235 bool atStart(unsigned negativePositionOffest)-
236 {-
237 return
executed 88 times by 1 test: return pos == negativePositionOffest;
Executed by:
  • tst_ecmascripttests
pos == negativePositionOffest;
executed 88 times by 1 test: return pos == negativePositionOffest;
Executed by:
  • tst_ecmascripttests
88
238 }-
239-
240 bool atEnd(unsigned negativePositionOffest)-
241 {-
242 (!(pos >= negativePositionOffest) ? (qmlWTFReportAssertionFailure(__FILE__, 275, __PRETTY_FUNCTION__, "pos >= negativePositionOffest"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
243 return
executed 60 times by 1 test: return (pos - negativePositionOffest) == length;
Executed by:
  • tst_ecmascripttests
(pos - negativePositionOffest) == length;
executed 60 times by 1 test: return (pos - negativePositionOffest) == length;
Executed by:
  • tst_ecmascripttests
60
244 }-
245-
246 bool isAvailableInput(unsigned offset)-
247 {-
248 return
executed 216 times by 1 test: return (((pos + offset) <= length) && ((pos + offset) >= pos));
Executed by:
  • tst_ecmascripttests
(((pos + offset) <= length) && ((pos + offset) >= pos));
executed 216 times by 1 test: return (((pos + offset) <= length) && ((pos + offset) >= pos));
Executed by:
  • tst_ecmascripttests
216
249 }-
250-
251 private:-
252 const CharType* input;-
253 unsigned pos;-
254 unsigned length;-
255 };-
256-
257 bool testCharacterClass(CharacterClass* characterClass, int ch)-
258 {-
259 if (ch & 0xFF80
ch & 0xFF80Description
TRUEnever evaluated
FALSEevaluated 3684556 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
0-3684556
260 for (unsigned i = 0; i < characterClass->m_matchesUnicode.size()
i < characterC...Unicode.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
261 if (ch == characterClass->m_matchesUnicode[i]
ch == characte...chesUnicode[i]Description
TRUEnever evaluated
FALSEnever evaluated
)
0
262 return
never executed: return true;
true;
never executed: return true;
0
263 for (unsigned i = 0; i < characterClass->m_rangesUnicode.size()
i < characterC...Unicode.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
264 if ((
(ch >= charact...code[i].begin)Description
TRUEnever evaluated
FALSEnever evaluated
ch >= characterClass->m_rangesUnicode[i].begin)
(ch >= charact...code[i].begin)Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(ch <= charact...nicode[i].end)Description
TRUEnever evaluated
FALSEnever evaluated
ch <= characterClass->m_rangesUnicode[i].end)
(ch <= charact...nicode[i].end)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
265 return
never executed: return true;
true;
never executed: return true;
0
266 }
never executed: end of block
else {
0
267 for (unsigned i = 0; i < characterClass->m_matches.size()
i < characterC...matches.size()Description
TRUEevaluated 3695540 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 3681720 times by 1 test
Evaluated by:
  • tst_ecmascripttests
; ++i)
3681720-3695540
268 if (ch == characterClass->m_matches[i]
ch == characte...->m_matches[i]Description
TRUEevaluated 2836 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 3692704 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
2836-3692704
269 return
executed 2836 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
true;
executed 2836 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
2836
270 for (unsigned i = 0; i < characterClass->m_ranges.size()
i < characterC..._ranges.size()Description
TRUEevaluated 2412 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 3680832 times by 1 test
Evaluated by:
  • tst_ecmascripttests
; ++i)
2412-3680832
271 if ((
(ch >= charact...nges[i].begin)Description
TRUEevaluated 2012 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 400 times by 1 test
Evaluated by:
  • tst_ecmascripttests
ch >= characterClass->m_ranges[i].begin)
(ch >= charact...nges[i].begin)Description
TRUEevaluated 2012 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 400 times by 1 test
Evaluated by:
  • tst_ecmascripttests
&& (
(ch <= charact...ranges[i].end)Description
TRUEevaluated 888 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1124 times by 1 test
Evaluated by:
  • tst_ecmascripttests
ch <= characterClass->m_ranges[i].end)
(ch <= charact...ranges[i].end)Description
TRUEevaluated 888 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1124 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
400-2012
272 return
executed 888 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
true;
executed 888 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
888
273 }
executed 3680832 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
3680832
274-
275 return
executed 3680832 times by 1 test: return false;
Executed by:
  • tst_ecmascripttests
false;
executed 3680832 times by 1 test: return false;
Executed by:
  • tst_ecmascripttests
3680832
276 }-
277-
278 bool checkCharacter(int testChar, unsigned negativeInputOffset)-
279 {-
280 return
executed 3702252 times by 1 test: return testChar == input.readChecked(negativeInputOffset);
Executed by:
  • tst_ecmascripttests
testChar == input.readChecked(negativeInputOffset);
executed 3702252 times by 1 test: return testChar == input.readChecked(negativeInputOffset);
Executed by:
  • tst_ecmascripttests
3702252
281 }-
282-
283 bool checkCasedCharacter(int loChar, int hiChar, unsigned negativeInputOffset)-
284 {-
285 int ch = input.readChecked(negativeInputOffset);-
286 return
executed 36 times by 1 test: return (loChar == ch) || (hiChar == ch);
Executed by:
  • tst_ecmascripttests
(loChar == ch) || (hiChar == ch);
executed 36 times by 1 test: return (loChar == ch) || (hiChar == ch);
Executed by:
  • tst_ecmascripttests
36
287 }-
288-
289 bool checkCharacterClass(CharacterClass* characterClass, bool invert, unsigned negativeInputOffset)-
290 {-
291 bool match = testCharacterClass(characterClass, input.readChecked(negativeInputOffset));-
292 return
executed 3684432 times by 1 test: return invert ? !match : match;
Executed by:
  • tst_ecmascripttests
invert ? !match : match;
executed 3684432 times by 1 test: return invert ? !match : match;
Executed by:
  • tst_ecmascripttests
3684432
293 }-
294-
295 bool tryConsumeBackReference(int matchBegin, int matchEnd, unsigned negativeInputOffset)-
296 {-
297 unsigned matchSize = (unsigned)(matchEnd - matchBegin);-
298-
299 if (!input.checkInput(matchSize)
!input.checkInput(matchSize)Description
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 260 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
28-260
300 return
executed 28 times by 1 test: return false;
Executed by:
  • tst_ecmascripttests
false;
executed 28 times by 1 test: return false;
Executed by:
  • tst_ecmascripttests
28
301-
302 if (pattern->m_ignoreCase
pattern->m_ignoreCaseDescription
TRUEnever evaluated
FALSEevaluated 260 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
0-260
303 for (unsigned i = 0; i < matchSize
i < matchSizeDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
304 int oldCh = input.reread(matchBegin + i);-
305 int ch = input.readChecked(negativeInputOffset + matchSize - i);-
306-
307 if (oldCh == ch
oldCh == chDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
308 continue;
never executed: continue;
0
309-
310-
311-
312 if (isASCII(oldCh)
isASCII(oldCh)Description
TRUEnever evaluated
FALSEnever evaluated
|| isASCII(ch)
isASCII(ch)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
313 if (toASCIIUpper(oldCh) == toASCIIUpper(ch)
toASCIIUpper(o...ASCIIUpper(ch)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
314 continue;
never executed: continue;
0
315 }
never executed: end of block
else if (areCanonicallyEquivalent(oldCh, ch)
areCanonically...ent(oldCh, ch)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
316 continue;
never executed: continue;
0
317-
318 input.uncheckInput(matchSize);-
319 return
never executed: return false;
false;
never executed: return false;
0
320 }-
321 }
never executed: end of block
else {
0
322 for (unsigned i = 0; i < matchSize
i < matchSizeDescription
TRUEevaluated 516 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 172 times by 1 test
Evaluated by:
  • tst_ecmascripttests
; ++i) {
172-516
323 if (!checkCharacter(input.reread(matchBegin + i), negativeInputOffset + matchSize - i)
!checkCharacte...matchSize - i)Description
TRUEevaluated 88 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 428 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
88-428
324 input.uncheckInput(matchSize);-
325 return
executed 88 times by 1 test: return false;
Executed by:
  • tst_ecmascripttests
false;
executed 88 times by 1 test: return false;
Executed by:
  • tst_ecmascripttests
88
326 }-
327 }
executed 428 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
428
328 }
executed 172 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
172
329-
330 return
executed 172 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
true;
executed 172 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
172
331 }-
332-
333 bool matchAssertionBOL(ByteTerm& term)-
334 {-
335 return
executed 24 times by 1 test: return (input.atStart(term.inputPosition)) || (pattern->m_multiline && testCharacterClass(pattern->newlineCharacterClass, input.readChecked(term.inputPosition + 1)));
Executed by:
  • tst_ecmascripttests
(input.atStart(term.inputPosition)) || (pattern->m_multiline && testCharacterClass(pattern->newlineCharacterClass, input.readChecked(term.inputPosition + 1)));
executed 24 times by 1 test: return (input.atStart(term.inputPosition)) || (pattern->m_multiline && testCharacterClass(pattern->newlineCharacterClass, input.readChecked(term.inputPosition + 1)));
Executed by:
  • tst_ecmascripttests
24
336 }-
337-
338 bool matchAssertionEOL(ByteTerm& term)-
339 {-
340 if (term.inputPosition
term.inputPositionDescription
TRUEnever evaluated
FALSEevaluated 28 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
0-28
341 return
never executed: return (input.atEnd(term.inputPosition)) || (pattern->m_multiline && testCharacterClass(pattern->newlineCharacterClass, input.readChecked(term.inputPosition)));
(input.atEnd(term.inputPosition)) || (pattern->m_multiline && testCharacterClass(pattern->newlineCharacterClass, input.readChecked(term.inputPosition)));
never executed: return (input.atEnd(term.inputPosition)) || (pattern->m_multiline && testCharacterClass(pattern->newlineCharacterClass, input.readChecked(term.inputPosition)));
0
342-
343 return
executed 28 times by 1 test: return (input.atEnd()) || (pattern->m_multiline && testCharacterClass(pattern->newlineCharacterClass, input.read()));
Executed by:
  • tst_ecmascripttests
(input.atEnd()) || (pattern->m_multiline && testCharacterClass(pattern->newlineCharacterClass, input.read()));
executed 28 times by 1 test: return (input.atEnd()) || (pattern->m_multiline && testCharacterClass(pattern->newlineCharacterClass, input.read()));
Executed by:
  • tst_ecmascripttests
28
344 }-
345-
346 bool matchAssertionWordBoundary(ByteTerm& term)-
347 {-
348 bool prevIsWordchar = !input.atStart(term.inputPosition)
!input.atStart...inputPosition)Description
TRUEevaluated 60 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
&& testCharacterClass(pattern->wordcharCharacterClass, input.readChecked(term.inputPosition + 1))
testCharacterC...Position + 1))Description
TRUEevaluated 48 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
;
4-60
349 bool readIsWordchar;-
350 if (term.inputPosition
term.inputPositionDescription
TRUEevaluated 60 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
4-60
351 readIsWordchar = !input.atEnd(term.inputPosition)
!input.atEnd(t...inputPosition)Description
TRUEevaluated 60 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
&& testCharacterClass(pattern->wordcharCharacterClass, input.readChecked(term.inputPosition))
testCharacterC...nputPosition))Description
TRUEevaluated 48 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
;
executed 60 times by 1 test: readIsWordchar = !input.atEnd(term.inputPosition) && testCharacterClass(pattern->wordcharCharacterClass, input.readChecked(term.inputPosition));
Executed by:
  • tst_ecmascripttests
0-60
352 else-
353 readIsWordchar = !input.atEnd()
!input.atEnd()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
&& testCharacterClass(pattern->wordcharCharacterClass, input.read())
testCharacterC... input.read())Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
;
executed 4 times by 1 test: readIsWordchar = !input.atEnd() && testCharacterClass(pattern->wordcharCharacterClass, input.read());
Executed by:
  • tst_ecmascripttests
0-4
354-
355 bool wordBoundary = prevIsWordchar != readIsWordchar;-
356 return
executed 64 times by 1 test: return term.invert() ? !wordBoundary : wordBoundary;
Executed by:
  • tst_ecmascripttests
term.invert() ? !wordBoundary : wordBoundary;
executed 64 times by 1 test: return term.invert() ? !wordBoundary : wordBoundary;
Executed by:
  • tst_ecmascripttests
64
357 }-
358-
359 bool backtrackPatternCharacter(ByteTerm& term, DisjunctionContext* context)-
360 {-
361 BackTrackInfoPatternCharacter* backTrack = reinterpret_cast<BackTrackInfoPatternCharacter*>(context->frame + term.frameLocation);-
362-
363 switch (term.atom.quantityType) {-
364 case
executed 2136 times by 1 test: case QuantifierFixedCount:
Executed by:
  • tst_ecmascripttests
QuantifierFixedCount:
executed 2136 times by 1 test: case QuantifierFixedCount:
Executed by:
  • tst_ecmascripttests
2136
365 break;
executed 2136 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
2136
366-
367 case
executed 52 times by 1 test: case QuantifierGreedy:
Executed by:
  • tst_ecmascripttests
QuantifierGreedy:
executed 52 times by 1 test: case QuantifierGreedy:
Executed by:
  • tst_ecmascripttests
52
368 if (backTrack->matchAmount
backTrack->matchAmountDescription
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
12-40
369 --backTrack->matchAmount;-
370 input.uncheckInput(1);-
371 return
executed 40 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
true;
executed 40 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
40
372 }-
373 break;
executed 12 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
12
374-
375 case
never executed: case QuantifierNonGreedy:
QuantifierNonGreedy:
never executed: case QuantifierNonGreedy:
0
376 if ((
(backTrack->ma...quantityCount)Description
TRUEnever evaluated
FALSEnever evaluated
backTrack->matchAmount < term.atom.quantityCount)
(backTrack->ma...quantityCount)Description
TRUEnever evaluated
FALSEnever evaluated
&& input.checkInput(1)
input.checkInput(1)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
377 ++backTrack->matchAmount;-
378 if (checkCharacter(term.atom.patternCharacter, term.inputPosition + 1)
checkCharacter...tPosition + 1)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
379 return
never executed: return true;
true;
never executed: return true;
0
380 }
never executed: end of block
0
381 input.uncheckInput(backTrack->matchAmount);-
382 break;
never executed: break;
0
383 }-
384-
385 return
executed 2148 times by 1 test: return false;
Executed by:
  • tst_ecmascripttests
false;
executed 2148 times by 1 test: return false;
Executed by:
  • tst_ecmascripttests
2148
386 }-
387-
388 bool backtrackPatternCasedCharacter(ByteTerm& term, DisjunctionContext* context)-
389 {-
390 BackTrackInfoPatternCharacter* backTrack = reinterpret_cast<BackTrackInfoPatternCharacter*>(context->frame + term.frameLocation);-
391-
392 switch (term.atom.quantityType) {-
393 case
never executed: case QuantifierFixedCount:
QuantifierFixedCount:
never executed: case QuantifierFixedCount:
0
394 break;
never executed: break;
0
395-
396 case
never executed: case QuantifierGreedy:
QuantifierGreedy:
never executed: case QuantifierGreedy:
0
397 if (backTrack->matchAmount
backTrack->matchAmountDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
398 --backTrack->matchAmount;-
399 input.uncheckInput(1);-
400 return
never executed: return true;
true;
never executed: return true;
0
401 }-
402 break;
never executed: break;
0
403-
404 case
never executed: case QuantifierNonGreedy:
QuantifierNonGreedy:
never executed: case QuantifierNonGreedy:
0
405 if ((
(backTrack->ma...quantityCount)Description
TRUEnever evaluated
FALSEnever evaluated
backTrack->matchAmount < term.atom.quantityCount)
(backTrack->ma...quantityCount)Description
TRUEnever evaluated
FALSEnever evaluated
&& input.checkInput(1)
input.checkInput(1)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
406 ++backTrack->matchAmount;-
407 if (checkCasedCharacter(term.atom.casedCharacter.lo, term.atom.casedCharacter.hi, term.inputPosition + 1)
checkCasedChar...tPosition + 1)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
408 return
never executed: return true;
true;
never executed: return true;
0
409 }
never executed: end of block
0
410 input.uncheckInput(backTrack->matchAmount);-
411 break;
never executed: break;
0
412 }-
413-
414 return
never executed: return false;
false;
never executed: return false;
0
415 }-
416-
417 bool matchCharacterClass(ByteTerm& term, DisjunctionContext* context)-
418 {-
419 (!(term.type == ByteTerm::TypeCharacterClass) ? (qmlWTFReportAssertionFailure(__FILE__, 452, __PRETTY_FUNCTION__, "term.type == ByteTerm::TypeCharacterClass"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
420 BackTrackInfoPatternCharacter* backTrack = reinterpret_cast<BackTrackInfoPatternCharacter*>(context->frame + term.frameLocation);-
421-
422 switch (term.atom.quantityType) {-
423 case
executed 5776 times by 1 test: case QuantifierFixedCount:
Executed by:
  • tst_ecmascripttests
QuantifierFixedCount:
executed 5776 times by 1 test: case QuantifierFixedCount:
Executed by:
  • tst_ecmascripttests
{
5776
424 for (unsigned matchAmount = 0; matchAmount < term.atom.quantityCount
matchAmount < ....quantityCountDescription
TRUEevaluated 5840 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 3200 times by 1 test
Evaluated by:
  • tst_ecmascripttests
; ++matchAmount) {
3200-5840
425 if (!checkCharacterClass(term.atom.characterClass, term.invert(), term.inputPosition - matchAmount)
!checkCharacte...- matchAmount)Description
TRUEevaluated 2576 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 3264 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
2576-3264
426 return
executed 2576 times by 1 test: return false;
Executed by:
  • tst_ecmascripttests
false;
executed 2576 times by 1 test: return false;
Executed by:
  • tst_ecmascripttests
2576
427 }
executed 3264 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
3264
428 return
executed 3200 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
true;
executed 3200 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
3200
429 }-
430-
431 case
executed 13440 times by 1 test: case QuantifierGreedy:
Executed by:
  • tst_ecmascripttests
QuantifierGreedy:
executed 13440 times by 1 test: case QuantifierGreedy:
Executed by:
  • tst_ecmascripttests
{
13440
432 unsigned matchAmount = 0;-
433 while ((
(matchAmount <...quantityCount)Description
TRUEevaluated 3689800 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
matchAmount < term.atom.quantityCount)
(matchAmount <...quantityCount)Description
TRUEevaluated 3689800 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
&& input.checkInput(1)
input.checkInput(1)Description
TRUEevaluated 3678584 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 11216 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
0-3689800
434 if (!checkCharacterClass(term.atom.characterClass, term.invert(), term.inputPosition + 1)
!checkCharacte...tPosition + 1)Description
TRUEevaluated 2224 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 3676360 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
2224-3676360
435 input.uncheckInput(1);-
436 break;
executed 2224 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
2224
437 }-
438 ++matchAmount;-
439 }
executed 3676360 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
3676360
440 backTrack->matchAmount = matchAmount;-
441-
442 return
executed 13440 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
true;
executed 13440 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
13440
443 }-
444-
445 case
executed 4 times by 1 test: case QuantifierNonGreedy:
Executed by:
  • tst_ecmascripttests
QuantifierNonGreedy:
executed 4 times by 1 test: case QuantifierNonGreedy:
Executed by:
  • tst_ecmascripttests
4
446 backTrack->matchAmount = 0;-
447 return
executed 4 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
true;
executed 4 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
4
448 }-
449-
450 do { qmlWTFReportAssertionFailure(__FILE__, 483, __PRETTY_FUNCTION__, 0); (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap()); } while (0);-
451 return
never executed: return false;
false;
never executed: return false;
0
452 }-
453-
454 bool backtrackCharacterClass(ByteTerm& term, DisjunctionContext* context)-
455 {-
456 (!(term.type == ByteTerm::TypeCharacterClass) ? (qmlWTFReportAssertionFailure(__FILE__, 489, __PRETTY_FUNCTION__, "term.type == ByteTerm::TypeCharacterClass"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
457 BackTrackInfoPatternCharacter* backTrack = reinterpret_cast<BackTrackInfoPatternCharacter*>(context->frame + term.frameLocation);-
458-
459 switch (term.atom.quantityType) {-
460 case
executed 2676 times by 1 test: case QuantifierFixedCount:
Executed by:
  • tst_ecmascripttests
QuantifierFixedCount:
executed 2676 times by 1 test: case QuantifierFixedCount:
Executed by:
  • tst_ecmascripttests
2676
461 break;
executed 2676 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
2676
462-
463 case
executed 3688032 times by 1 test: case QuantifierGreedy:
Executed by:
  • tst_ecmascripttests
QuantifierGreedy:
executed 3688032 times by 1 test: case QuantifierGreedy:
Executed by:
  • tst_ecmascripttests
3688032
464 if (backTrack->matchAmount
backTrack->matchAmountDescription
TRUEevaluated 3674756 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 13276 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
13276-3674756
465 --backTrack->matchAmount;-
466 input.uncheckInput(1);-
467 return
executed 3674756 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
true;
executed 3674756 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
3674756
468 }-
469 break;
executed 13276 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
13276
470-
471 case
executed 8 times by 1 test: case QuantifierNonGreedy:
Executed by:
  • tst_ecmascripttests
QuantifierNonGreedy:
executed 8 times by 1 test: case QuantifierNonGreedy:
Executed by:
  • tst_ecmascripttests
8
472 if ((
(backTrack->ma...quantityCount)Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
backTrack->matchAmount < term.atom.quantityCount)
(backTrack->ma...quantityCount)Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
&& input.checkInput(1)
input.checkInput(1)Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
) {
0-8
473 ++backTrack->matchAmount;-
474 if (checkCharacterClass(term.atom.characterClass, term.invert(), term.inputPosition + 1)
checkCharacter...tPosition + 1)Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
)
0-8
475 return
executed 8 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
true;
executed 8 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
8
476 }
never executed: end of block
0
477 input.uncheckInput(backTrack->matchAmount);-
478 break;
never executed: break;
0
479 }-
480-
481 return
executed 15952 times by 1 test: return false;
Executed by:
  • tst_ecmascripttests
false;
executed 15952 times by 1 test: return false;
Executed by:
  • tst_ecmascripttests
15952
482 }-
483-
484 bool matchBackReference(ByteTerm& term, DisjunctionContext* context)-
485 {-
486 (!(term.type == ByteTerm::TypeBackReference) ? (qmlWTFReportAssertionFailure(__FILE__, 519, __PRETTY_FUNCTION__, "term.type == ByteTerm::TypeBackReference"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
487 BackTrackInfoBackReference* backTrack = reinterpret_cast<BackTrackInfoBackReference*>(context->frame + term.frameLocation);-
488-
489 unsigned matchBegin = output[(term.atom.subpatternId << 1)];-
490 unsigned matchEnd = output[(term.atom.subpatternId << 1) + 1];-
491-
492-
493-
494-
495 if (matchEnd == offsetNoMatch
matchEnd == offsetNoMatchDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 304 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
4-304
496 return
executed 4 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
true;
executed 4 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
4
497-
498 if (matchBegin == offsetNoMatch
matchBegin == offsetNoMatchDescription
TRUEnever evaluated
FALSEevaluated 304 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
0-304
499 return
never executed: return true;
true;
never executed: return true;
0
500-
501 (!(matchBegin <= matchEnd) ? (qmlWTFReportAssertionFailure(__FILE__, 534, __PRETTY_FUNCTION__, "matchBegin <= matchEnd"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
502-
503 if (matchBegin == matchEnd
matchBegin == matchEndDescription
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 276 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
28-276
504 return
executed 28 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
true;
executed 28 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
28
505-
506 switch (term.atom.quantityType) {-
507 case
executed 244 times by 1 test: case QuantifierFixedCount:
Executed by:
  • tst_ecmascripttests
QuantifierFixedCount:
executed 244 times by 1 test: case QuantifierFixedCount:
Executed by:
  • tst_ecmascripttests
{
244
508 backTrack->begin = input.getPos();-
509 for (unsigned matchAmount = 0; matchAmount < term.atom.quantityCount
matchAmount < ....quantityCountDescription
TRUEevaluated 244 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 160 times by 1 test
Evaluated by:
  • tst_ecmascripttests
; ++matchAmount) {
160-244
510 if (!tryConsumeBackReference(matchBegin, matchEnd, term.inputPosition)
!tryConsumeBac...inputPosition)Description
TRUEevaluated 84 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 160 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
84-160
511 input.setPos(backTrack->begin);-
512 return
executed 84 times by 1 test: return false;
Executed by:
  • tst_ecmascripttests
false;
executed 84 times by 1 test: return false;
Executed by:
  • tst_ecmascripttests
84
513 }-
514 }
executed 160 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
160
515 return
executed 160 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
true;
executed 160 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
160
516 }-
517-
518 case
executed 32 times by 1 test: case QuantifierGreedy:
Executed by:
  • tst_ecmascripttests
QuantifierGreedy:
executed 32 times by 1 test: case QuantifierGreedy:
Executed by:
  • tst_ecmascripttests
{
32
519 unsigned matchAmount = 0;-
520 while ((
(matchAmount <...quantityCount)Description
TRUEevaluated 44 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
matchAmount < term.atom.quantityCount)
(matchAmount <...quantityCount)Description
TRUEevaluated 44 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
&& tryConsumeBackReference(matchBegin, matchEnd, term.inputPosition)
tryConsumeBack...inputPosition)Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 32 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
0-44
521 ++
executed 12 times by 1 test: ++matchAmount;
Executed by:
  • tst_ecmascripttests
matchAmount;
executed 12 times by 1 test: ++matchAmount;
Executed by:
  • tst_ecmascripttests
12
522 backTrack->matchAmount = matchAmount;-
523 return
executed 32 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
true;
executed 32 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
32
524 }-
525-
526 case
never executed: case QuantifierNonGreedy:
QuantifierNonGreedy:
never executed: case QuantifierNonGreedy:
0
527 backTrack->begin = input.getPos();-
528 backTrack->matchAmount = 0;-
529 return
never executed: return true;
true;
never executed: return true;
0
530 }-
531-
532 do { qmlWTFReportAssertionFailure(__FILE__, 565, __PRETTY_FUNCTION__, 0); (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap()); } while (0);-
533 return
never executed: return false;
false;
never executed: return false;
0
534 }-
535-
536 bool backtrackBackReference(ByteTerm& term, DisjunctionContext* context)-
537 {-
538 (!(term.type == ByteTerm::TypeBackReference) ? (qmlWTFReportAssertionFailure(__FILE__, 571, __PRETTY_FUNCTION__, "term.type == ByteTerm::TypeBackReference"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
539 BackTrackInfoBackReference* backTrack = reinterpret_cast<BackTrackInfoBackReference*>(context->frame + term.frameLocation);-
540-
541 unsigned matchBegin = output[(term.atom.subpatternId << 1)];-
542 unsigned matchEnd = output[(term.atom.subpatternId << 1) + 1];-
543-
544 if (matchBegin == offsetNoMatch
matchBegin == offsetNoMatchDescription
TRUEnever evaluated
FALSEevaluated 32 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
0-32
545 return
never executed: return false;
false;
never executed: return false;
0
546-
547 (!(matchBegin <= matchEnd) ? (qmlWTFReportAssertionFailure(__FILE__, 580, __PRETTY_FUNCTION__, "matchBegin <= matchEnd"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
548-
549 if (matchBegin == matchEnd
matchBegin == matchEndDescription
TRUEnever evaluated
FALSEevaluated 32 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
0-32
550 return
never executed: return false;
false;
never executed: return false;
0
551-
552 switch (term.atom.quantityType) {-
553 case
executed 8 times by 1 test: case QuantifierFixedCount:
Executed by:
  • tst_ecmascripttests
QuantifierFixedCount:
executed 8 times by 1 test: case QuantifierFixedCount:
Executed by:
  • tst_ecmascripttests
8
554-
555 input.setPos(backTrack->begin);-
556 break;
executed 8 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
8
557-
558 case
executed 24 times by 1 test: case QuantifierGreedy:
Executed by:
  • tst_ecmascripttests
QuantifierGreedy:
executed 24 times by 1 test: case QuantifierGreedy:
Executed by:
  • tst_ecmascripttests
24
559 if (backTrack->matchAmount
backTrack->matchAmountDescription
TRUEnever evaluated
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
0-24
560 --backTrack->matchAmount;-
561 input.rewind(matchEnd - matchBegin);-
562 return
never executed: return true;
true;
never executed: return true;
0
563 }-
564 break;
executed 24 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
24
565-
566 case
never executed: case QuantifierNonGreedy:
QuantifierNonGreedy:
never executed: case QuantifierNonGreedy:
0
567 if ((
(backTrack->ma...quantityCount)Description
TRUEnever evaluated
FALSEnever evaluated
backTrack->matchAmount < term.atom.quantityCount)
(backTrack->ma...quantityCount)Description
TRUEnever evaluated
FALSEnever evaluated
&& tryConsumeBackReference(matchBegin, matchEnd, term.inputPosition)
tryConsumeBack...inputPosition)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
568 ++backTrack->matchAmount;-
569 return
never executed: return true;
true;
never executed: return true;
0
570 }-
571 input.setPos(backTrack->begin);-
572 break;
never executed: break;
0
573 }-
574-
575 return
executed 32 times by 1 test: return false;
Executed by:
  • tst_ecmascripttests
false;
executed 32 times by 1 test: return false;
Executed by:
  • tst_ecmascripttests
32
576 }-
577-
578 void recordParenthesesMatch(ByteTerm& term, ParenthesesDisjunctionContext* context)-
579 {-
580 if (term.capture()
term.capture()Description
TRUEevaluated 204 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
) {
0-204
581 unsigned subpatternId = term.atom.subpatternId;-
582 output[(subpatternId << 1)] = context->getDisjunctionContext(term)->matchBegin + term.inputPosition;-
583 output[(subpatternId << 1) + 1] = context->getDisjunctionContext(term)->matchEnd + term.inputPosition;-
584 }
executed 204 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
204
585 }
executed 204 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
204
586 void resetMatches(ByteTerm& term, ParenthesesDisjunctionContext* context)-
587 {-
588 unsigned firstSubpatternId = term.atom.subpatternId;-
589 unsigned count = term.atom.parenthesesDisjunction->m_numSubpatterns;-
590 context->restoreOutput(output, firstSubpatternId, count);-
591 }
executed 2276 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
2276
592 JSRegExpResult parenthesesDoBacktrack(ByteTerm& term, BackTrackInfoParentheses* backTrack)-
593 {-
594 while (backTrack->matchAmount
backTrack->matchAmountDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
595 ParenthesesDisjunctionContext* context = backTrack->lastContext;-
596-
597 JSRegExpResult result = matchDisjunction(term.atom.parenthesesDisjunction, context->getDisjunctionContext(term), true);-
598 if (result == JSRegExpMatch
result == JSRegExpMatchDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
599 return
never executed: return JSRegExpMatch;
JSRegExpMatch;
never executed: return JSRegExpMatch;
0
600-
601 resetMatches(term, context);-
602 popParenthesesDisjunctionContext(backTrack);-
603 freeParenthesesDisjunctionContext(context);-
604-
605 if (result != JSRegExpNoMatch
result != JSRegExpNoMatchDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
606 return
never executed: return result;
result;
never executed: return result;
0
607 }
never executed: end of block
0
608-
609 return
never executed: return JSRegExpNoMatch;
JSRegExpNoMatch;
never executed: return JSRegExpNoMatch;
0
610 }-
611-
612 bool matchParenthesesOnceBegin(ByteTerm& term, DisjunctionContext* context)-
613 {-
614 (!(term.type == ByteTerm::TypeParenthesesSubpatternOnceBegin) ? (qmlWTFReportAssertionFailure(__FILE__, 647, __PRETTY_FUNCTION__, "term.type == ByteTerm::TypeParenthesesSubpatternOnceBegin"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
615 (!(term.atom.quantityCount == 1) ? (qmlWTFReportAssertionFailure(__FILE__, 648, __PRETTY_FUNCTION__, "term.atom.quantityCount == 1"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
616-
617 BackTrackInfoParenthesesOnce* backTrack = reinterpret_cast<BackTrackInfoParenthesesOnce*>(context->frame + term.frameLocation);-
618-
619 switch (term.atom.quantityType) {-
620 case
executed 212 times by 1 test: case QuantifierGreedy:
Executed by:
  • tst_ecmascripttests
QuantifierGreedy:
executed 212 times by 1 test: case QuantifierGreedy:
Executed by:
  • tst_ecmascripttests
{
212
621-
622 backTrack->begin = input.getPos();-
623 break;
executed 212 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
212
624 }-
625 case
never executed: case QuantifierNonGreedy:
QuantifierNonGreedy:
never executed: case QuantifierNonGreedy:
{
0
626 backTrack->begin = notFound;-
627 context->term += term.atom.parenthesesWidth;-
628 return
never executed: return true;
true;
never executed: return true;
0
629 }-
630 case
executed 527 times by 1 test: case QuantifierFixedCount:
Executed by:
  • tst_ecmascripttests
QuantifierFixedCount:
executed 527 times by 1 test: case QuantifierFixedCount:
Executed by:
  • tst_ecmascripttests
527
631 break;
executed 527 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
527
632 }-
633-
634 if (term.capture()
term.capture()Description
TRUEevaluated 739 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
) {
0-739
635 unsigned subpatternId = term.atom.subpatternId;-
636 output[(subpatternId << 1)] = input.getPos() - term.inputPosition;-
637 }
executed 739 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
739
638-
639 return
executed 739 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
true;
executed 739 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
739
640 }-
641-
642 bool matchParenthesesOnceEnd(ByteTerm& term, DisjunctionContext* context)-
643 {-
644 (!(term.type == ByteTerm::TypeParenthesesSubpatternOnceEnd) ? (qmlWTFReportAssertionFailure(__FILE__, 677, __PRETTY_FUNCTION__, "term.type == ByteTerm::TypeParenthesesSubpatternOnceEnd"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
645 (!(term.atom.quantityCount == 1) ? (qmlWTFReportAssertionFailure(__FILE__, 678, __PRETTY_FUNCTION__, "term.atom.quantityCount == 1"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
646-
647 if (term.capture()
term.capture()Description
TRUEevaluated 572 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
) {
0-572
648 unsigned subpatternId = term.atom.subpatternId;-
649 output[(subpatternId << 1) + 1] = input.getPos() + term.inputPosition;-
650 }
executed 572 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
572
651-
652 if (term.atom.quantityType == QuantifierFixedCount
term.atom.quan...fierFixedCountDescription
TRUEevaluated 507 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 64 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
64-507
653 return
executed 508 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
true;
executed 508 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
508
654-
655 BackTrackInfoParenthesesOnce* backTrack = reinterpret_cast<BackTrackInfoParenthesesOnce*>(context->frame + term.frameLocation);-
656 return
executed 64 times by 1 test: return backTrack->begin != input.getPos();
Executed by:
  • tst_ecmascripttests
backTrack->begin != input.getPos();
executed 64 times by 1 test: return backTrack->begin != input.getPos();
Executed by:
  • tst_ecmascripttests
64
657 }-
658-
659 bool backtrackParenthesesOnceBegin(ByteTerm& term, DisjunctionContext* context)-
660 {-
661 (!(term.type == ByteTerm::TypeParenthesesSubpatternOnceBegin) ? (qmlWTFReportAssertionFailure(__FILE__, 694, __PRETTY_FUNCTION__, "term.type == ByteTerm::TypeParenthesesSubpatternOnceBegin"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
662 (!(term.atom.quantityCount == 1) ? (qmlWTFReportAssertionFailure(__FILE__, 695, __PRETTY_FUNCTION__, "term.atom.quantityCount == 1"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
663-
664 BackTrackInfoParenthesesOnce* backTrack = reinterpret_cast<BackTrackInfoParenthesesOnce*>(context->frame + term.frameLocation);-
665-
666 if (term.capture()
term.capture()Description
TRUEevaluated 292 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
) {
0-292
667 unsigned subpatternId = term.atom.subpatternId;-
668 output[(subpatternId << 1)] = offsetNoMatch;-
669 output[(subpatternId << 1) + 1] = offsetNoMatch;-
670 }
executed 292 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
292
671-
672 switch (term.atom.quantityType) {-
673 case
executed 148 times by 1 test: case QuantifierGreedy:
Executed by:
  • tst_ecmascripttests
QuantifierGreedy:
executed 148 times by 1 test: case QuantifierGreedy:
Executed by:
  • tst_ecmascripttests
148
674-
675 (!(backTrack->begin != notFound) ? (qmlWTFReportAssertionFailure(__FILE__, 708, __PRETTY_FUNCTION__, "backTrack->begin != notFound"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
676 backTrack->begin = notFound;-
677 context->term += term.atom.parenthesesWidth;-
678 return
executed 148 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
true;
executed 148 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
148
679 case
never executed: case QuantifierNonGreedy:
QuantifierNonGreedy:
never executed: case QuantifierNonGreedy:
0
680 (!(backTrack->begin != notFound) ? (qmlWTFReportAssertionFailure(__FILE__, 713, __PRETTY_FUNCTION__, "backTrack->begin != notFound"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
681 case
executed 144 times by 1 test: case QuantifierFixedCount:
Executed by:
  • tst_ecmascripttests
code before this statement never executed: case QuantifierFixedCount:
executed 144 times by 1 test: case QuantifierFixedCount:
Executed by:
  • tst_ecmascripttests
QuantifierFixedCount:
code before this statement never executed: case QuantifierFixedCount:
executed 144 times by 1 test: case QuantifierFixedCount:
Executed by:
  • tst_ecmascripttests
0-144
682 break;
executed 144 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
144
683 }-
684-
685 return
executed 144 times by 1 test: return false;
Executed by:
  • tst_ecmascripttests
false;
executed 144 times by 1 test: return false;
Executed by:
  • tst_ecmascripttests
144
686 }-
687-
688 bool backtrackParenthesesOnceEnd(ByteTerm& term, DisjunctionContext* context)-
689 {-
690 (!(term.type == ByteTerm::TypeParenthesesSubpatternOnceEnd) ? (qmlWTFReportAssertionFailure(__FILE__, 723, __PRETTY_FUNCTION__, "term.type == ByteTerm::TypeParenthesesSubpatternOnceEnd"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
691 (!(term.atom.quantityCount == 1) ? (qmlWTFReportAssertionFailure(__FILE__, 724, __PRETTY_FUNCTION__, "term.atom.quantityCount == 1"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
692-
693 BackTrackInfoParenthesesOnce* backTrack = reinterpret_cast<BackTrackInfoParenthesesOnce*>(context->frame + term.frameLocation);-
694-
695 switch (term.atom.quantityType) {-
696 case
executed 24 times by 1 test: case QuantifierGreedy:
Executed by:
  • tst_ecmascripttests
QuantifierGreedy:
executed 24 times by 1 test: case QuantifierGreedy:
Executed by:
  • tst_ecmascripttests
24
697 if (backTrack->begin == notFound
backTrack->begin == notFoundDescription
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
) {
0-24
698 context->term -= term.atom.parenthesesWidth;-
699 return
executed 24 times by 1 test: return false;
Executed by:
  • tst_ecmascripttests
false;
executed 24 times by 1 test: return false;
Executed by:
  • tst_ecmascripttests
24
700 }-
701 (void)0;-
702 case
never executed: case QuantifierNonGreedy:
QuantifierNonGreedy:
never executed: case QuantifierNonGreedy:
code before this statement never executed: case QuantifierNonGreedy:
0
703 if (backTrack->begin == notFound
backTrack->begin == notFoundDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
704 backTrack->begin = input.getPos();-
705 if (term.capture()
term.capture()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
706-
707-
708-
709 (!((&term - term.atom.parenthesesWidth)->type == ByteTerm::TypeParenthesesSubpatternOnceBegin) ? (qmlWTFReportAssertionFailure(__FILE__, 742, __PRETTY_FUNCTION__, "(&term - term.atom.parenthesesWidth)->type == ByteTerm::TypeParenthesesSubpatternOnceBegin"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
710 (!((&term - term.atom.parenthesesWidth)->inputPosition == term.inputPosition) ? (qmlWTFReportAssertionFailure(__FILE__, 743, __PRETTY_FUNCTION__, "(&term - term.atom.parenthesesWidth)->inputPosition == term.inputPosition"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
711 unsigned subpatternId = term.atom.subpatternId;-
712 output[subpatternId << 1] = input.getPos() + term.inputPosition;-
713 }
never executed: end of block
0
714 context->term -= term.atom.parenthesesWidth;-
715 return
never executed: return true;
true;
never executed: return true;
0
716 }-
717 case
executed 124 times by 1 test: case QuantifierFixedCount:
Executed by:
  • tst_ecmascripttests
code before this statement never executed: case QuantifierFixedCount:
executed 124 times by 1 test: case QuantifierFixedCount:
Executed by:
  • tst_ecmascripttests
QuantifierFixedCount:
code before this statement never executed: case QuantifierFixedCount:
executed 124 times by 1 test: case QuantifierFixedCount:
Executed by:
  • tst_ecmascripttests
0-124
718 break;
executed 124 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
124
719 }-
720-
721 return
executed 124 times by 1 test: return false;
Executed by:
  • tst_ecmascripttests
false;
executed 124 times by 1 test: return false;
Executed by:
  • tst_ecmascripttests
124
722 }-
723-
724 bool matchParenthesesTerminalBegin(ByteTerm& term, DisjunctionContext* context)-
725 {-
726 (!(term.type == ByteTerm::TypeParenthesesSubpatternTerminalBegin) ? (qmlWTFReportAssertionFailure(__FILE__, 759, __PRETTY_FUNCTION__, "term.type == ByteTerm::TypeParenthesesSubpatternTerminalBegin"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
727 (!(term.atom.quantityType == QuantifierGreedy) ? (qmlWTFReportAssertionFailure(__FILE__, 760, __PRETTY_FUNCTION__, "term.atom.quantityType == QuantifierGreedy"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
728 (!(term.atom.quantityCount == quantifyInfinite) ? (qmlWTFReportAssertionFailure(__FILE__, 761, __PRETTY_FUNCTION__, "term.atom.quantityCount == quantifyInfinite"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
729 (!(!term.capture()) ? (qmlWTFReportAssertionFailure(__FILE__, 762, __PRETTY_FUNCTION__, "!term.capture()"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
730-
731 BackTrackInfoParenthesesTerminal* backTrack = reinterpret_cast<BackTrackInfoParenthesesTerminal*>(context->frame + term.frameLocation);-
732 backTrack->begin = input.getPos();-
733 return
never executed: return true;
true;
never executed: return true;
0
734 }-
735-
736 bool matchParenthesesTerminalEnd(ByteTerm& term, DisjunctionContext* context)-
737 {-
738 (!(term.type == ByteTerm::TypeParenthesesSubpatternTerminalEnd) ? (qmlWTFReportAssertionFailure(__FILE__, 771, __PRETTY_FUNCTION__, "term.type == ByteTerm::TypeParenthesesSubpatternTerminalEnd"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
739-
740 BackTrackInfoParenthesesTerminal* backTrack = reinterpret_cast<BackTrackInfoParenthesesTerminal*>(context->frame + term.frameLocation);-
741-
742 if (backTrack->begin == input.getPos()
backTrack->beg...input.getPos()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
743 return
never executed: return false;
false;
never executed: return false;
0
744-
745-
746 context->term -= (term.atom.parenthesesWidth + 1);-
747 return
never executed: return true;
true;
never executed: return true;
0
748 }-
749-
750 bool backtrackParenthesesTerminalBegin(ByteTerm& term, DisjunctionContext* context)-
751 {-
752 (!(term.type == ByteTerm::TypeParenthesesSubpatternTerminalBegin) ? (qmlWTFReportAssertionFailure(__FILE__, 785, __PRETTY_FUNCTION__, "term.type == ByteTerm::TypeParenthesesSubpatternTerminalBegin"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
753 (!(term.atom.quantityType == QuantifierGreedy) ? (qmlWTFReportAssertionFailure(__FILE__, 786, __PRETTY_FUNCTION__, "term.atom.quantityType == QuantifierGreedy"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
754 (!(term.atom.quantityCount == quantifyInfinite) ? (qmlWTFReportAssertionFailure(__FILE__, 787, __PRETTY_FUNCTION__, "term.atom.quantityCount == quantifyInfinite"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
755 (!(!term.capture()) ? (qmlWTFReportAssertionFailure(__FILE__, 788, __PRETTY_FUNCTION__, "!term.capture()"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
756-
757-
758-
759 context->term += term.atom.parenthesesWidth;-
760 return
never executed: return true;
true;
never executed: return true;
0
761 }-
762-
763 bool backtrackParenthesesTerminalEnd(ByteTerm&, DisjunctionContext*)-
764 {-
765-
766-
767 do { qmlWTFReportAssertionFailure(__FILE__, 800, __PRETTY_FUNCTION__, 0); (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap()); } while (0);-
768 return
never executed: return false;
false;
never executed: return false;
0
769 }-
770-
771 bool matchParentheticalAssertionBegin(ByteTerm& term, DisjunctionContext* context)-
772 {-
773 (!(term.type == ByteTerm::TypeParentheticalAssertionBegin) ? (qmlWTFReportAssertionFailure(__FILE__, 806, __PRETTY_FUNCTION__, "term.type == ByteTerm::TypeParentheticalAssertionBegin"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
774 (!(term.atom.quantityCount == 1) ? (qmlWTFReportAssertionFailure(__FILE__, 807, __PRETTY_FUNCTION__, "term.atom.quantityCount == 1"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
775-
776 BackTrackInfoParentheticalAssertion* backTrack = reinterpret_cast<BackTrackInfoParentheticalAssertion*>(context->frame + term.frameLocation);-
777-
778 backTrack->begin = input.getPos();-
779 return
executed 24 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
true;
executed 24 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
24
780 }-
781-
782 bool matchParentheticalAssertionEnd(ByteTerm& term, DisjunctionContext* context)-
783 {-
784 (!(term.type == ByteTerm::TypeParentheticalAssertionEnd) ? (qmlWTFReportAssertionFailure(__FILE__, 817, __PRETTY_FUNCTION__, "term.type == ByteTerm::TypeParentheticalAssertionEnd"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
785 (!(term.atom.quantityCount == 1) ? (qmlWTFReportAssertionFailure(__FILE__, 818, __PRETTY_FUNCTION__, "term.atom.quantityCount == 1"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
786-
787 BackTrackInfoParentheticalAssertion* backTrack = reinterpret_cast<BackTrackInfoParentheticalAssertion*>(context->frame + term.frameLocation);-
788-
789 input.setPos(backTrack->begin);-
790-
791-
792 if (term.invert()
term.invert()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
4-12
793 context->term -= term.atom.parenthesesWidth;-
794 return
executed 4 times by 1 test: return false;
Executed by:
  • tst_ecmascripttests
false;
executed 4 times by 1 test: return false;
Executed by:
  • tst_ecmascripttests
4
795 }-
796-
797 return
executed 12 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
true;
executed 12 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
12
798 }-
799-
800 bool backtrackParentheticalAssertionBegin(ByteTerm& term, DisjunctionContext* context)-
801 {-
802 (!(term.type == ByteTerm::TypeParentheticalAssertionBegin) ? (qmlWTFReportAssertionFailure(__FILE__, 835, __PRETTY_FUNCTION__, "term.type == ByteTerm::TypeParentheticalAssertionBegin"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
803 (!(term.atom.quantityCount == 1) ? (qmlWTFReportAssertionFailure(__FILE__, 836, __PRETTY_FUNCTION__, "term.atom.quantityCount == 1"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
804-
805-
806 if (term.invert()
term.invert()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
4
807 context->term += term.atom.parenthesesWidth;-
808 return
executed 4 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
true;
executed 4 times by 1 test: return true;
Executed by:
  • tst_ecmascripttests
4
809 }-
810-
811 return
executed 4 times by 1 test: return false;
Executed by:
  • tst_ecmascripttests
false;
executed 4 times by 1 test: return false;
Executed by:
  • tst_ecmascripttests
4
812 }-
813-
814 bool backtrackParentheticalAssertionEnd(ByteTerm& term, DisjunctionContext* context)-
815 {-
816 (!(term.type == ByteTerm::TypeParentheticalAssertionEnd) ? (qmlWTFReportAssertionFailure(__FILE__, 849, __PRETTY_FUNCTION__, "term.type == ByteTerm::TypeParentheticalAssertionEnd"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
817 (!(term.atom.quantityCount == 1) ? (qmlWTFReportAssertionFailure(__FILE__, 850, __PRETTY_FUNCTION__, "term.atom.quantityCount == 1"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
818-
819 BackTrackInfoParentheticalAssertion* backTrack = reinterpret_cast<BackTrackInfoParentheticalAssertion*>(context->frame + term.frameLocation);-
820-
821 input.setPos(backTrack->begin);-
822-
823 context->term -= term.atom.parenthesesWidth;-
824 return
executed 8 times by 1 test: return false;
Executed by:
  • tst_ecmascripttests
false;
executed 8 times by 1 test: return false;
Executed by:
  • tst_ecmascripttests
8
825 }-
826-
827 JSRegExpResult matchParentheses(ByteTerm& term, DisjunctionContext* context)-
828 {-
829 (!(term.type == ByteTerm::TypeParenthesesSubpattern) ? (qmlWTFReportAssertionFailure(__FILE__, 862, __PRETTY_FUNCTION__, "term.type == ByteTerm::TypeParenthesesSubpattern"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
830-
831 BackTrackInfoParentheses* backTrack = reinterpret_cast<BackTrackInfoParentheses*>(context->frame + term.frameLocation);-
832 ByteDisjunction* disjunctionBody = term.atom.parenthesesDisjunction;-
833-
834 backTrack->matchAmount = 0;-
835 backTrack->lastContext = 0;-
836-
837 switch (term.atom.quantityType) {-
838 case
never executed: case QuantifierFixedCount:
QuantifierFixedCount:
never executed: case QuantifierFixedCount:
{
0
839-
840 while (backTrack->matchAmount < term.atom.quantityCount
backTrack->mat....quantityCountDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
841-
842 ParenthesesDisjunctionContext* context = allocParenthesesDisjunctionContext(disjunctionBody, output, term);-
843 JSRegExpResult result = matchDisjunction(disjunctionBody, context->getDisjunctionContext(term));-
844 if (result == JSRegExpMatch
result == JSRegExpMatchDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
845 appendParenthesesDisjunctionContext(backTrack, context);
never executed: appendParenthesesDisjunctionContext(backTrack, context);
0
846 else {-
847-
848 resetMatches(term, context);-
849 freeParenthesesDisjunctionContext(context);-
850-
851 if (result != JSRegExpNoMatch
result != JSRegExpNoMatchDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
852 return
never executed: return result;
result;
never executed: return result;
0
853 JSRegExpResult backtrackResult = parenthesesDoBacktrack(term, backTrack);-
854 if (backtrackResult != JSRegExpMatch
backtrackResul... JSRegExpMatchDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
855 return
never executed: return backtrackResult;
backtrackResult;
never executed: return backtrackResult;
0
856 }
never executed: end of block
0
857 }-
858-
859 (!(backTrack->matchAmount == term.atom.quantityCount) ? (qmlWTFReportAssertionFailure(__FILE__, 892, __PRETTY_FUNCTION__, "backTrack->matchAmount == term.atom.quantityCount"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
860 ParenthesesDisjunctionContext* context = backTrack->lastContext;-
861 recordParenthesesMatch(term, context);-
862 return
never executed: return JSRegExpMatch;
JSRegExpMatch;
never executed: return JSRegExpMatch;
0
863 }-
864-
865 case
executed 2232 times by 1 test: case QuantifierGreedy:
Executed by:
  • tst_ecmascripttests
QuantifierGreedy:
executed 2232 times by 1 test: case QuantifierGreedy:
Executed by:
  • tst_ecmascripttests
{
2232
866 while (backTrack->matchAmount < term.atom.quantityCount
backTrack->mat....quantityCountDescription
TRUEevaluated 2708 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
) {
0-2708
867 ParenthesesDisjunctionContext* context = allocParenthesesDisjunctionContext(disjunctionBody, output, term);-
868 JSRegExpResult result = matchNonZeroDisjunction(disjunctionBody, context->getDisjunctionContext(term));-
869 if (result == JSRegExpMatch
result == JSRegExpMatchDescription
TRUEevaluated 476 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 2232 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
476-2232
870 appendParenthesesDisjunctionContext(backTrack, context);
executed 476 times by 1 test: appendParenthesesDisjunctionContext(backTrack, context);
Executed by:
  • tst_ecmascripttests
476
871 else {-
872 resetMatches(term, context);-
873 freeParenthesesDisjunctionContext(context);-
874-
875 if (result != JSRegExpNoMatch
result != JSRegExpNoMatchDescription
TRUEnever evaluated
FALSEevaluated 2232 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
0-2232
876 return
never executed: return result;
result;
never executed: return result;
0
877-
878 break;
executed 2232 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
2232
879 }-
880 }-
881-
882 if (backTrack->matchAmount
backTrack->matchAmountDescription
TRUEevaluated 152 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 2080 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
152-2080
883 ParenthesesDisjunctionContext* context = backTrack->lastContext;-
884 recordParenthesesMatch(term, context);-
885 }
executed 152 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
152
886 return
executed 2232 times by 1 test: return JSRegExpMatch;
Executed by:
  • tst_ecmascripttests
JSRegExpMatch;
executed 2232 times by 1 test: return JSRegExpMatch;
Executed by:
  • tst_ecmascripttests
2232
887 }-
888-
889 case
executed 4 times by 1 test: case QuantifierNonGreedy:
Executed by:
  • tst_ecmascripttests
QuantifierNonGreedy:
executed 4 times by 1 test: case QuantifierNonGreedy:
Executed by:
  • tst_ecmascripttests
4
890 return
executed 4 times by 1 test: return JSRegExpMatch;
Executed by:
  • tst_ecmascripttests
JSRegExpMatch;
executed 4 times by 1 test: return JSRegExpMatch;
Executed by:
  • tst_ecmascripttests
4
891 }-
892-
893 do { qmlWTFReportAssertionFailure(__FILE__, 926, __PRETTY_FUNCTION__, 0); (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap()); } while (0);-
894 return
never executed: return JSRegExpErrorNoMatch;
JSRegExpErrorNoMatch;
never executed: return JSRegExpErrorNoMatch;
0
895 }-
896 JSRegExpResult backtrackParentheses(ByteTerm& term, DisjunctionContext* context)-
897 {-
898 (!(term.type == ByteTerm::TypeParenthesesSubpattern) ? (qmlWTFReportAssertionFailure(__FILE__, 942, __PRETTY_FUNCTION__, "term.type == ByteTerm::TypeParenthesesSubpattern"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
899-
900 BackTrackInfoParentheses* backTrack = reinterpret_cast<BackTrackInfoParentheses*>(context->frame + term.frameLocation);-
901 ByteDisjunction* disjunctionBody = term.atom.parenthesesDisjunction;-
902-
903 switch (term.atom.quantityType) {-
904 case
never executed: case QuantifierFixedCount:
QuantifierFixedCount:
never executed: case QuantifierFixedCount:
{
0
905 (!(backTrack->matchAmount == term.atom.quantityCount) ? (qmlWTFReportAssertionFailure(__FILE__, 949, __PRETTY_FUNCTION__, "backTrack->matchAmount == term.atom.quantityCount"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
906-
907 ParenthesesDisjunctionContext* context = 0;-
908 JSRegExpResult result = parenthesesDoBacktrack(term, backTrack);-
909-
910 if (result != JSRegExpMatch
result != JSRegExpMatchDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
911 return
never executed: return result;
result;
never executed: return result;
0
912-
913-
914 while (backTrack->matchAmount < term.atom.quantityCount
backTrack->mat....quantityCountDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
915-
916 context = allocParenthesesDisjunctionContext(disjunctionBody, output, term);-
917 result = matchDisjunction(disjunctionBody, context->getDisjunctionContext(term));-
918-
919 if (result == JSRegExpMatch
result == JSRegExpMatchDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
920 appendParenthesesDisjunctionContext(backTrack, context);
never executed: appendParenthesesDisjunctionContext(backTrack, context);
0
921 else {-
922-
923 resetMatches(term, context);-
924 freeParenthesesDisjunctionContext(context);-
925-
926 if (result != JSRegExpNoMatch
result != JSRegExpNoMatchDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
927 return
never executed: return result;
result;
never executed: return result;
0
928 JSRegExpResult backtrackResult = parenthesesDoBacktrack(term, backTrack);-
929 if (backtrackResult != JSRegExpMatch
backtrackResul... JSRegExpMatchDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
930 return
never executed: return backtrackResult;
backtrackResult;
never executed: return backtrackResult;
0
931 }
never executed: end of block
0
932 }-
933-
934 (!(backTrack->matchAmount == term.atom.quantityCount) ? (qmlWTFReportAssertionFailure(__FILE__, 978, __PRETTY_FUNCTION__, "backTrack->matchAmount == term.atom.quantityCount"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
935 context = backTrack->lastContext;-
936 recordParenthesesMatch(term, context);-
937 return
never executed: return JSRegExpMatch;
JSRegExpMatch;
never executed: return JSRegExpMatch;
0
938 }-
939-
940 case
executed 2112 times by 1 test: case QuantifierGreedy:
Executed by:
  • tst_ecmascripttests
QuantifierGreedy:
executed 2112 times by 1 test: case QuantifierGreedy:
Executed by:
  • tst_ecmascripttests
{
2112
941 if (!backTrack->matchAmount
!backTrack->matchAmountDescription
TRUEevaluated 2068 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 44 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
44-2068
942 return
executed 2068 times by 1 test: return JSRegExpNoMatch;
Executed by:
  • tst_ecmascripttests
JSRegExpNoMatch;
executed 2068 times by 1 test: return JSRegExpNoMatch;
Executed by:
  • tst_ecmascripttests
2068
943-
944 ParenthesesDisjunctionContext* context = backTrack->lastContext;-
945 JSRegExpResult result = matchNonZeroDisjunction(disjunctionBody, context->getDisjunctionContext(term), true);-
946 if (result == JSRegExpMatch
result == JSRegExpMatchDescription
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
20-24
947 while (backTrack->matchAmount < term.atom.quantityCount
backTrack->mat....quantityCountDescription
TRUEevaluated 36 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
) {
0-36
948 ParenthesesDisjunctionContext* context = allocParenthesesDisjunctionContext(disjunctionBody, output, term);-
949 JSRegExpResult parenthesesResult = matchNonZeroDisjunction(disjunctionBody, context->getDisjunctionContext(term));-
950 if (parenthesesResult == JSRegExpMatch
parenthesesRes... JSRegExpMatchDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
16-20
951 appendParenthesesDisjunctionContext(backTrack, context);
executed 16 times by 1 test: appendParenthesesDisjunctionContext(backTrack, context);
Executed by:
  • tst_ecmascripttests
16
952 else {-
953 resetMatches(term, context);-
954 freeParenthesesDisjunctionContext(context);-
955-
956 if (parenthesesResult != JSRegExpNoMatch
parenthesesRes...SRegExpNoMatchDescription
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
0-20
957 return
never executed: return parenthesesResult;
parenthesesResult;
never executed: return parenthesesResult;
0
958-
959 break;
executed 20 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
20
960 }-
961 }-
962 }
executed 20 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
else {
20
963 resetMatches(term, context);-
964 popParenthesesDisjunctionContext(backTrack);-
965 freeParenthesesDisjunctionContext(context);-
966-
967 if (result != JSRegExpNoMatch
result != JSRegExpNoMatchDescription
TRUEnever evaluated
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
0-24
968 return
never executed: return result;
result;
never executed: return result;
0
969 }
executed 24 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
24
970-
971 if (backTrack->matchAmount
backTrack->matchAmountDescription
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
4-40
972 ParenthesesDisjunctionContext* context = backTrack->lastContext;-
973 recordParenthesesMatch(term, context);-
974 }
executed 40 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
40
975 return
executed 44 times by 1 test: return JSRegExpMatch;
Executed by:
  • tst_ecmascripttests
JSRegExpMatch;
executed 44 times by 1 test: return JSRegExpMatch;
Executed by:
  • tst_ecmascripttests
44
976 }-
977-
978 case
executed 12 times by 1 test: case QuantifierNonGreedy:
Executed by:
  • tst_ecmascripttests
QuantifierNonGreedy:
executed 12 times by 1 test: case QuantifierNonGreedy:
Executed by:
  • tst_ecmascripttests
{
12
979-
980 if (backTrack->matchAmount < term.atom.quantityCount
backTrack->mat....quantityCountDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
) {
0-12
981 ParenthesesDisjunctionContext* context = allocParenthesesDisjunctionContext(disjunctionBody, output, term);-
982 JSRegExpResult result = matchNonZeroDisjunction(disjunctionBody, context->getDisjunctionContext(term));-
983 if (result == JSRegExpMatch
result == JSRegExpMatchDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
) {
0-12
984 appendParenthesesDisjunctionContext(backTrack, context);-
985 recordParenthesesMatch(term, context);-
986 return
executed 12 times by 1 test: return JSRegExpMatch;
Executed by:
  • tst_ecmascripttests
JSRegExpMatch;
executed 12 times by 1 test: return JSRegExpMatch;
Executed by:
  • tst_ecmascripttests
12
987 }-
988-
989 resetMatches(term, context);-
990 freeParenthesesDisjunctionContext(context);-
991-
992 if (result != JSRegExpNoMatch
result != JSRegExpNoMatchDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
993 return
never executed: return result;
result;
never executed: return result;
0
994 }
never executed: end of block
0
995-
996-
997 while (backTrack->matchAmount
backTrack->matchAmountDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
998 ParenthesesDisjunctionContext* context = backTrack->lastContext;-
999 JSRegExpResult result = matchNonZeroDisjunction(disjunctionBody, context->getDisjunctionContext(term), true);-
1000 if (result == JSRegExpMatch
result == JSRegExpMatchDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1001-
1002 if (backTrack->matchAmount
backTrack->matchAmountDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1003 context = backTrack->lastContext;-
1004 recordParenthesesMatch(term, context);-
1005 }
never executed: end of block
0
1006 return
never executed: return JSRegExpMatch;
JSRegExpMatch;
never executed: return JSRegExpMatch;
0
1007 }-
1008-
1009-
1010 resetMatches(term, context);-
1011 popParenthesesDisjunctionContext(backTrack);-
1012 freeParenthesesDisjunctionContext(context);-
1013-
1014 if (result != JSRegExpNoMatch
result != JSRegExpNoMatchDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1015 return
never executed: return result;
result;
never executed: return result;
0
1016 }
never executed: end of block
0
1017-
1018 return
never executed: return JSRegExpNoMatch;
JSRegExpNoMatch;
never executed: return JSRegExpNoMatch;
0
1019 }-
1020 }-
1021-
1022 do { qmlWTFReportAssertionFailure(__FILE__, 1066, __PRETTY_FUNCTION__, 0); (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap()); } while (0);-
1023 return
never executed: return JSRegExpErrorNoMatch;
JSRegExpErrorNoMatch;
never executed: return JSRegExpErrorNoMatch;
0
1024 }-
1025-
1026 bool matchDotStarEnclosure(ByteTerm& term, DisjunctionContext* context)-
1027 {-
1028 (void)term;;-
1029 unsigned matchBegin = context->matchBegin;-
1030-
1031 if (matchBegin
matchBeginDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1032 for (matchBegin--; true
trueDescription
TRUEnever evaluated
FALSEnever evaluated
; matchBegin--) {
0
1033 if (testCharacterClass(pattern->newlineCharacterClass, input.reread(matchBegin))
testCharacterC...d(matchBegin))Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1034 ++matchBegin;-
1035 break;
never executed: break;
0
1036 }-
1037-
1038 if (!matchBegin
!matchBeginDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1039 break;
never executed: break;
0
1040 }
never executed: end of block
0
1041 }
never executed: end of block
0
1042-
1043 unsigned matchEnd = input.getPos();-
1044-
1045 for (; (
(matchEnd != input.end())Description
TRUEnever evaluated
FALSEnever evaluated
matchEnd != input.end())
(matchEnd != input.end())Description
TRUEnever evaluated
FALSEnever evaluated
0
1046 && (
(!testCharacte...ad(matchEnd)))Description
TRUEnever evaluated
FALSEnever evaluated
!testCharacterClass(pattern->newlineCharacterClass, input.reread(matchEnd)))
(!testCharacte...ad(matchEnd)))Description
TRUEnever evaluated
FALSEnever evaluated
; matchEnd++) { }
never executed: end of block
0
1047-
1048 if (((matchBegin
matchBeginDescription
TRUEnever evaluated
FALSEnever evaluated
&& term.anchors.m_bol
term.anchors.m_bolDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1049 || ((
(matchEnd != input.end())Description
TRUEnever evaluated
FALSEnever evaluated
matchEnd != input.end())
(matchEnd != input.end())Description
TRUEnever evaluated
FALSEnever evaluated
&& term.anchors.m_eol
term.anchors.m_eolDescription
TRUEnever evaluated
FALSEnever evaluated
))
0
1050 && !pattern->m_multiline
!pattern->m_multilineDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1051 return
never executed: return false;
false;
never executed: return false;
0
1052-
1053 context->matchBegin = matchBegin;-
1054 context->matchEnd = matchEnd;-
1055 return
never executed: return true;
true;
never executed: return true;
0
1056 }-
1057-
1058-
1059-
1060-
1061 JSRegExpResult matchDisjunction(ByteDisjunction* disjunction, DisjunctionContext* context, bool btrack = false)-
1062 {-
1063 if (!--remainingMatchCount
!--remainingMatchCountDescription
TRUEnever evaluated
FALSEevaluated 3016 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
0-3016
1064 return
never executed: return JSRegExpErrorHitLimit;
JSRegExpErrorHitLimit;
never executed: return JSRegExpErrorHitLimit;
0
1065-
1066 if (btrack
btrackDescription
TRUEevaluated 44 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 2972 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
44-2972
1067 { --context->term; goto
executed 44 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
backtrack;
executed 44 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
};
44
1068-
1069 context->matchBegin = input.getPos();-
1070 context->term = 0;-
1071-
1072 matchAgain:
code before this statement executed 2972 times by 1 test: matchAgain:
Executed by:
  • tst_ecmascripttests
2972
1073 (!(context->term < static_cast<int>(disjunction->terms.size())) ? (qmlWTFReportAssertionFailure(__FILE__, 1117, __PRETTY_FUNCTION__, "context->term < static_cast<int>(disjunction->terms.size())"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
1074-
1075 switch ((disjunction->terms[context->term]).type) {-
1076 case
executed 2756 times by 1 test: case ByteTerm::TypeSubpatternBegin:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypeSubpatternBegin:
executed 2756 times by 1 test: case ByteTerm::TypeSubpatternBegin:
Executed by:
  • tst_ecmascripttests
2756
1077 { ++context->term; goto
executed 2756 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
matchAgain;
executed 2756 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
};
2756
1078 case
executed 524 times by 1 test: case ByteTerm::TypeSubpatternEnd:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypeSubpatternEnd:
executed 524 times by 1 test: case ByteTerm::TypeSubpatternEnd:
Executed by:
  • tst_ecmascripttests
524
1079 context->matchEnd = input.getPos();-
1080 return
executed 524 times by 1 test: return JSRegExpMatch;
Executed by:
  • tst_ecmascripttests
JSRegExpMatch;
executed 524 times by 1 test: return JSRegExpMatch;
Executed by:
  • tst_ecmascripttests
524
1081-
1082 case
executed 215 times by 1 test: case ByteTerm::TypeBodyAlternativeBegin:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypeBodyAlternativeBegin:
executed 215 times by 1 test: case ByteTerm::TypeBodyAlternativeBegin:
Executed by:
  • tst_ecmascripttests
215
1083 { ++context->term; goto
executed 215 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
matchAgain;
executed 215 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
};
215
1084 case
never executed: case ByteTerm::TypeBodyAlternativeDisjunction:
ByteTerm::TypeBodyAlternativeDisjunction:
never executed: case ByteTerm::TypeBodyAlternativeDisjunction:
0
1085 case
executed 192 times by 1 test: case ByteTerm::TypeBodyAlternativeEnd:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypeBodyAlternativeEnd:
executed 192 times by 1 test: case ByteTerm::TypeBodyAlternativeEnd:
Executed by:
  • tst_ecmascripttests
192
1086 context->matchEnd = input.getPos();-
1087 return
executed 192 times by 1 test: return JSRegExpMatch;
Executed by:
  • tst_ecmascripttests
JSRegExpMatch;
executed 192 times by 1 test: return JSRegExpMatch;
Executed by:
  • tst_ecmascripttests
192
1088-
1089 case
executed 552 times by 1 test: case ByteTerm::TypeAlternativeBegin:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypeAlternativeBegin:
executed 552 times by 1 test: case ByteTerm::TypeAlternativeBegin:
Executed by:
  • tst_ecmascripttests
552
1090 { ++context->term; goto
executed 552 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
matchAgain;
executed 552 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
};
552
1091 case
executed 436 times by 1 test: case ByteTerm::TypeAlternativeDisjunction:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypeAlternativeDisjunction:
executed 436 times by 1 test: case ByteTerm::TypeAlternativeDisjunction:
Executed by:
  • tst_ecmascripttests
436
1092 case
executed 8 times by 1 test: case ByteTerm::TypeAlternativeEnd:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypeAlternativeEnd:
executed 8 times by 1 test: case ByteTerm::TypeAlternativeEnd:
Executed by:
  • tst_ecmascripttests
{
8
1093 int offset = (disjunction->terms[context->term]).alternative.end;-
1094 BackTrackInfoAlternative* backTrack = reinterpret_cast<BackTrackInfoAlternative*>(context->frame + (disjunction->terms[context->term]).frameLocation);-
1095 backTrack->offset = offset;-
1096 context->term += offset;-
1097 { ++context->term; goto
executed 444 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
matchAgain;
executed 444 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
};
444
1098 }-
1099-
1100 case
executed 24 times by 1 test: case ByteTerm::TypeAssertionBOL:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypeAssertionBOL:
executed 24 times by 1 test: case ByteTerm::TypeAssertionBOL:
Executed by:
  • tst_ecmascripttests
24
1101 if (matchAssertionBOL((disjunction->terms[context->term]))
matchAssertion...ntext->term]))Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
)
0-24
1102 { ++context->term; goto
executed 24 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
matchAgain;
executed 24 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
};
24
1103 { --context->term; goto
never executed: goto backtrack;
backtrack;
never executed: goto backtrack;
};
0
1104 case
executed 28 times by 1 test: case ByteTerm::TypeAssertionEOL:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypeAssertionEOL:
executed 28 times by 1 test: case ByteTerm::TypeAssertionEOL:
Executed by:
  • tst_ecmascripttests
28
1105 if (matchAssertionEOL((disjunction->terms[context->term]))
matchAssertion...ntext->term]))Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
4-24
1106 { ++context->term; goto
executed 24 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
matchAgain;
executed 24 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
};
24
1107 { --context->term; goto
executed 4 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
backtrack;
executed 4 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
};
4
1108 case
executed 64 times by 1 test: case ByteTerm::TypeAssertionWordBoundary:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypeAssertionWordBoundary:
executed 64 times by 1 test: case ByteTerm::TypeAssertionWordBoundary:
Executed by:
  • tst_ecmascripttests
64
1109 if (matchAssertionWordBoundary((disjunction->terms[context->term]))
matchAssertion...ntext->term]))Description
TRUEevaluated 32 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 32 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
32
1110 { ++context->term; goto
executed 32 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
matchAgain;
executed 32 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
};
32
1111 { --context->term; goto
executed 32 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
backtrack;
executed 32 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
};
32
1112-
1113 case
executed 3701495 times by 1 test: case ByteTerm::TypePatternCharacterOnce:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypePatternCharacterOnce:
executed 3701495 times by 1 test: case ByteTerm::TypePatternCharacterOnce:
Executed by:
  • tst_ecmascripttests
3701495
1114 case
never executed: case ByteTerm::TypePatternCharacterFixed:
ByteTerm::TypePatternCharacterFixed:
never executed: case ByteTerm::TypePatternCharacterFixed:
{
0
1115 for (unsigned matchAmount = 0; matchAmount < (disjunction->terms[context->term]).atom.quantityCount
matchAmount < ....quantityCountDescription
TRUEevaluated 3701495 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 2654 times by 1 test
Evaluated by:
  • tst_ecmascripttests
; ++matchAmount) {
2654-3701495
1116 if (!checkCharacter((disjunction->terms[context->term]).atom.patternCharacter, (disjunction->terms[context->term]).inputPosition - matchAmount)
!checkCharacte...- matchAmount)Description
TRUEevaluated 3698843 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 2654 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
2654-3698843
1117 { --context->term; goto
executed 3698843 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
backtrack;
executed 3698843 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
};
3698843
1118 }
executed 2654 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
2654
1119 { ++context->term; goto
executed 2653 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
matchAgain;
executed 2653 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
};
2653
1120 }-
1121 case
executed 136 times by 1 test: case ByteTerm::TypePatternCharacterGreedy:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypePatternCharacterGreedy:
executed 136 times by 1 test: case ByteTerm::TypePatternCharacterGreedy:
Executed by:
  • tst_ecmascripttests
{
136
1122 BackTrackInfoPatternCharacter* backTrack = reinterpret_cast<BackTrackInfoPatternCharacter*>(context->frame + (disjunction->terms[context->term]).frameLocation);-
1123 unsigned matchAmount = 0;-
1124 while ((
(matchAmount <...quantityCount)Description
TRUEevaluated 260 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
matchAmount < (disjunction->terms[context->term]).atom.quantityCount)
(matchAmount <...quantityCount)Description
TRUEevaluated 260 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
&& input.checkInput(1)
input.checkInput(1)Description
TRUEevaluated 244 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
16-260
1125 if (!checkCharacter((disjunction->terms[context->term]).atom.patternCharacter, (disjunction->terms[context->term]).inputPosition + 1)
!checkCharacte...tPosition + 1)Description
TRUEevaluated 96 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 148 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
96-148
1126 input.uncheckInput(1);-
1127 break;
executed 96 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
96
1128 }-
1129 ++matchAmount;-
1130 }
executed 148 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
148
1131 backTrack->matchAmount = matchAmount;-
1132-
1133 { ++context->term; goto
executed 136 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
matchAgain;
executed 136 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
};
136
1134 }-
1135 case
never executed: case ByteTerm::TypePatternCharacterNonGreedy:
ByteTerm::TypePatternCharacterNonGreedy:
never executed: case ByteTerm::TypePatternCharacterNonGreedy:
{
0
1136 BackTrackInfoPatternCharacter* backTrack = reinterpret_cast<BackTrackInfoPatternCharacter*>(context->frame + (disjunction->terms[context->term]).frameLocation);-
1137 backTrack->matchAmount = 0;-
1138 { ++context->term; goto
never executed: goto matchAgain;
matchAgain;
never executed: goto matchAgain;
};
0
1139 }-
1140-
1141 case
executed 36 times by 1 test: case ByteTerm::TypePatternCasedCharacterOnce:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypePatternCasedCharacterOnce:
executed 36 times by 1 test: case ByteTerm::TypePatternCasedCharacterOnce:
Executed by:
  • tst_ecmascripttests
36
1142 case
never executed: case ByteTerm::TypePatternCasedCharacterFixed:
ByteTerm::TypePatternCasedCharacterFixed:
never executed: case ByteTerm::TypePatternCasedCharacterFixed:
{
0
1143 for (unsigned matchAmount = 0; matchAmount < (disjunction->terms[context->term]).atom.quantityCount
matchAmount < ....quantityCountDescription
TRUEevaluated 36 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 32 times by 1 test
Evaluated by:
  • tst_ecmascripttests
; ++matchAmount) {
32-36
1144 if (!checkCasedCharacter((disjunction->terms[context->term]).atom.casedCharacter.lo, (disjunction->terms[context->term]).atom.casedCharacter.hi, (disjunction->terms[context->term]).inputPosition - matchAmount)
!checkCasedCha...- matchAmount)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 32 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
4-32
1145 { --context->term; goto
executed 4 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
backtrack;
executed 4 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
};
4
1146 }
executed 32 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
32
1147 { ++context->term; goto
executed 32 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
matchAgain;
executed 32 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
};
32
1148 }-
1149 case
never executed: case ByteTerm::TypePatternCasedCharacterGreedy:
ByteTerm::TypePatternCasedCharacterGreedy:
never executed: case ByteTerm::TypePatternCasedCharacterGreedy:
{
0
1150 BackTrackInfoPatternCharacter* backTrack = reinterpret_cast<BackTrackInfoPatternCharacter*>(context->frame + (disjunction->terms[context->term]).frameLocation);-
1151 unsigned matchAmount = 0;-
1152 while ((
(matchAmount <...quantityCount)Description
TRUEnever evaluated
FALSEnever evaluated
matchAmount < (disjunction->terms[context->term]).atom.quantityCount)
(matchAmount <...quantityCount)Description
TRUEnever evaluated
FALSEnever evaluated
&& input.checkInput(1)
input.checkInput(1)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1153 if (!checkCasedCharacter((disjunction->terms[context->term]).atom.casedCharacter.lo, (disjunction->terms[context->term]).atom.casedCharacter.hi, (disjunction->terms[context->term]).inputPosition + 1)
!checkCasedCha...tPosition + 1)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1154 input.uncheckInput(1);-
1155 break;
never executed: break;
0
1156 }-
1157 ++matchAmount;-
1158 }
never executed: end of block
0
1159 backTrack->matchAmount = matchAmount;-
1160-
1161 { ++context->term; goto
never executed: goto matchAgain;
matchAgain;
never executed: goto matchAgain;
};
0
1162 }-
1163 case
never executed: case ByteTerm::TypePatternCasedCharacterNonGreedy:
ByteTerm::TypePatternCasedCharacterNonGreedy:
never executed: case ByteTerm::TypePatternCasedCharacterNonGreedy:
{
0
1164 BackTrackInfoPatternCharacter* backTrack = reinterpret_cast<BackTrackInfoPatternCharacter*>(context->frame + (disjunction->terms[context->term]).frameLocation);-
1165 backTrack->matchAmount = 0;-
1166 { ++context->term; goto
never executed: goto matchAgain;
matchAgain;
never executed: goto matchAgain;
};
0
1167 }-
1168-
1169 case
executed 19220 times by 1 test: case ByteTerm::TypeCharacterClass:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypeCharacterClass:
executed 19220 times by 1 test: case ByteTerm::TypeCharacterClass:
Executed by:
  • tst_ecmascripttests
19220
1170 if (matchCharacterClass((disjunction->terms[context->term]), context)
matchCharacter...rm]), context)Description
TRUEevaluated 16644 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 2576 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
2576-16644
1171 { ++context->term; goto
executed 16644 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
matchAgain;
executed 16644 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
};
16644
1172 { --context->term; goto
executed 2576 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
backtrack;
executed 2576 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
};
2576
1173 case
executed 308 times by 1 test: case ByteTerm::TypeBackReference:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypeBackReference:
executed 308 times by 1 test: case ByteTerm::TypeBackReference:
Executed by:
  • tst_ecmascripttests
308
1174 if (matchBackReference((disjunction->terms[context->term]), context)
matchBackRefer...rm]), context)Description
TRUEevaluated 224 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 84 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
84-224
1175 { ++context->term; goto
executed 224 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
matchAgain;
executed 224 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
};
224
1176 { --context->term; goto
executed 84 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
backtrack;
executed 84 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
};
84
1177 case
executed 2236 times by 1 test: case ByteTerm::TypeParenthesesSubpattern:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypeParenthesesSubpattern:
executed 2236 times by 1 test: case ByteTerm::TypeParenthesesSubpattern:
Executed by:
  • tst_ecmascripttests
{
2236
1178 JSRegExpResult result = matchParentheses((disjunction->terms[context->term]), context);-
1179-
1180 if (result == JSRegExpMatch
result == JSRegExpMatchDescription
TRUEevaluated 2236 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
) {
0-2236
1181 { ++context->term; goto
executed 2236 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
matchAgain;
executed 2236 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
};
2236
1182 } else if (result != JSRegExpNoMatch
result != JSRegExpNoMatchDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1183 return
never executed: return result;
result;
never executed: return result;
0
1184-
1185 { --context->term; goto
never executed: goto backtrack;
backtrack;
never executed: goto backtrack;
};
0
1186 }-
1187 case
executed 739 times by 1 test: case ByteTerm::TypeParenthesesSubpatternOnceBegin:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypeParenthesesSubpatternOnceBegin:
executed 739 times by 1 test: case ByteTerm::TypeParenthesesSubpatternOnceBegin:
Executed by:
  • tst_ecmascripttests
739
1188 if (matchParenthesesOnceBegin((disjunction->terms[context->term]), context)
matchParenthes...rm]), context)Description
TRUEevaluated 739 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
)
0-739
1189 { ++context->term; goto
executed 739 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
matchAgain;
executed 739 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
};
739
1190 { --context->term; goto
never executed: goto backtrack;
backtrack;
never executed: goto backtrack;
};
0
1191 case
executed 572 times by 1 test: case ByteTerm::TypeParenthesesSubpatternOnceEnd:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypeParenthesesSubpatternOnceEnd:
executed 572 times by 1 test: case ByteTerm::TypeParenthesesSubpatternOnceEnd:
Executed by:
  • tst_ecmascripttests
572
1192 if (matchParenthesesOnceEnd((disjunction->terms[context->term]), context)
matchParenthes...rm]), context)Description
TRUEevaluated 572 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
)
0-572
1193 { ++context->term; goto
executed 572 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
matchAgain;
executed 572 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
};
572
1194 { --context->term; goto
never executed: goto backtrack;
backtrack;
never executed: goto backtrack;
};
0
1195 case
never executed: case ByteTerm::TypeParenthesesSubpatternTerminalBegin:
ByteTerm::TypeParenthesesSubpatternTerminalBegin:
never executed: case ByteTerm::TypeParenthesesSubpatternTerminalBegin:
0
1196 if (matchParenthesesTerminalBegin((disjunction->terms[context->term]), context)
matchParenthes...rm]), context)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1197 { ++context->term; goto
never executed: goto matchAgain;
matchAgain;
never executed: goto matchAgain;
};
0
1198 { --context->term; goto
never executed: goto backtrack;
backtrack;
never executed: goto backtrack;
};
0
1199 case
never executed: case ByteTerm::TypeParenthesesSubpatternTerminalEnd:
ByteTerm::TypeParenthesesSubpatternTerminalEnd:
never executed: case ByteTerm::TypeParenthesesSubpatternTerminalEnd:
0
1200 if (matchParenthesesTerminalEnd((disjunction->terms[context->term]), context)
matchParenthes...rm]), context)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1201 { ++context->term; goto
never executed: goto matchAgain;
matchAgain;
never executed: goto matchAgain;
};
0
1202 { --context->term; goto
never executed: goto backtrack;
backtrack;
never executed: goto backtrack;
};
0
1203 case
executed 24 times by 1 test: case ByteTerm::TypeParentheticalAssertionBegin:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypeParentheticalAssertionBegin:
executed 24 times by 1 test: case ByteTerm::TypeParentheticalAssertionBegin:
Executed by:
  • tst_ecmascripttests
24
1204 if (matchParentheticalAssertionBegin((disjunction->terms[context->term]), context)
matchParenthet...rm]), context)Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
)
0-24
1205 { ++context->term; goto
executed 24 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
matchAgain;
executed 24 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
};
24
1206 { --context->term; goto
never executed: goto backtrack;
backtrack;
never executed: goto backtrack;
};
0
1207 case
executed 16 times by 1 test: case ByteTerm::TypeParentheticalAssertionEnd:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypeParentheticalAssertionEnd:
executed 16 times by 1 test: case ByteTerm::TypeParentheticalAssertionEnd:
Executed by:
  • tst_ecmascripttests
16
1208 if (matchParentheticalAssertionEnd((disjunction->terms[context->term]), context)
matchParenthet...rm]), context)Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
4-12
1209 { ++context->term; goto
executed 12 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
matchAgain;
executed 12 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
};
12
1210 { --context->term; goto
executed 4 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
backtrack;
executed 4 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
};
4
1211-
1212 case
executed 27664 times by 1 test: case ByteTerm::TypeCheckInput:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypeCheckInput:
executed 27664 times by 1 test: case ByteTerm::TypeCheckInput:
Executed by:
  • tst_ecmascripttests
27664
1213 if (input.checkInput((disjunction->terms[context->term]).checkInputCount)
input.checkInp...eckInputCount)Description
TRUEevaluated 27422 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 244 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
244-27422
1214 { ++context->term; goto
executed 27422 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
matchAgain;
executed 27422 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
};
27422
1215 { --context->term; goto
executed 244 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
backtrack;
executed 244 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
};
244
1216-
1217 case
never executed: case ByteTerm::TypeUncheckInput:
ByteTerm::TypeUncheckInput:
never executed: case ByteTerm::TypeUncheckInput:
0
1218 input.uncheckInput((disjunction->terms[context->term]).checkInputCount);-
1219 { ++context->term; goto
never executed: goto matchAgain;
matchAgain;
never executed: goto matchAgain;
};
0
1220-
1221 case
never executed: case ByteTerm::TypeDotStarEnclosure:
ByteTerm::TypeDotStarEnclosure:
never executed: case ByteTerm::TypeDotStarEnclosure:
0
1222 if (matchDotStarEnclosure((disjunction->terms[context->term]), context)
matchDotStarEn...rm]), context)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1223 return
never executed: return JSRegExpMatch;
JSRegExpMatch;
never executed: return JSRegExpMatch;
0
1224 { --context->term; goto
never executed: goto backtrack;
backtrack;
never executed: goto backtrack;
};
0
1225 }-
1226-
1227-
1228 do { qmlWTFReportAssertionFailure(__FILE__, 1272, __PRETTY_FUNCTION__, 0); (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap()); } while (0);-
1229-
1230 backtrack:
code before this statement never executed: backtrack:
0
1231 (!(context->term < static_cast<int>(disjunction->terms.size())) ? (qmlWTFReportAssertionFailure(__FILE__, 1275, __PRETTY_FUNCTION__, "context->term < static_cast<int>(disjunction->terms.size())"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
1232-
1233 switch ((disjunction->terms[context->term]).type) {-
1234 case
executed 2276 times by 1 test: case ByteTerm::TypeSubpatternBegin:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypeSubpatternBegin:
executed 2276 times by 1 test: case ByteTerm::TypeSubpatternBegin:
Executed by:
  • tst_ecmascripttests
2276
1235 return
executed 2276 times by 1 test: return JSRegExpNoMatch;
Executed by:
  • tst_ecmascripttests
JSRegExpNoMatch;
executed 2276 times by 1 test: return JSRegExpNoMatch;
Executed by:
  • tst_ecmascripttests
2276
1236 case
never executed: case ByteTerm::TypeSubpatternEnd:
ByteTerm::TypeSubpatternEnd:
never executed: case ByteTerm::TypeSubpatternEnd:
0
1237 do { qmlWTFReportAssertionFailure(__FILE__, 1281, __PRETTY_FUNCTION__, 0); (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap()); } while (0);-
1238-
1239 case
executed 16268 times by 1 test: case ByteTerm::TypeBodyAlternativeBegin:
Executed by:
  • tst_ecmascripttests
code before this statement never executed: case ByteTerm::TypeBodyAlternativeBegin:
executed 16268 times by 1 test: case ByteTerm::TypeBodyAlternativeBegin:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypeBodyAlternativeBegin:
code before this statement never executed: case ByteTerm::TypeBodyAlternativeBegin:
executed 16268 times by 1 test: case ByteTerm::TypeBodyAlternativeBegin:
Executed by:
  • tst_ecmascripttests
0-16268
1240 case
executed 8048 times by 1 test: case ByteTerm::TypeBodyAlternativeDisjunction:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypeBodyAlternativeDisjunction:
executed 8048 times by 1 test: case ByteTerm::TypeBodyAlternativeDisjunction:
Executed by:
  • tst_ecmascripttests
{
8048
1241 int offset = (disjunction->terms[context->term]).alternative.next;-
1242 context->term += offset;-
1243 if (offset > 0
offset > 0Description
TRUEevaluated 8056 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 16260 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
8056-16260
1244 { ++context->term; goto
executed 8056 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
matchAgain;
executed 8056 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
};
8056
1245-
1246 if (input.atEnd()
input.atEnd()Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 16236 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
24-16236
1247 return
executed 24 times by 1 test: return JSRegExpNoMatch;
Executed by:
  • tst_ecmascripttests
JSRegExpNoMatch;
executed 24 times by 1 test: return JSRegExpNoMatch;
Executed by:
  • tst_ecmascripttests
24
1248-
1249 input.next();-
1250-
1251 context->matchBegin = input.getPos();-
1252-
1253 if ((
(disjunction->...ve.onceThroughDescription
TRUEnever evaluated
FALSEevaluated 16236 times by 1 test
Evaluated by:
  • tst_ecmascripttests
disjunction->terms[context->term]).alternative.onceThrough
(disjunction->...ve.onceThroughDescription
TRUEnever evaluated
FALSEevaluated 16236 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
0-16236
1254 context->term += (disjunction->terms[context->term]).alternative.next;
never executed: context->term += (disjunction->terms[context->term]).alternative.next;
0
1255-
1256 { ++context->term; goto
executed 16236 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
matchAgain;
executed 16236 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
};
16236
1257 }-
1258 case
never executed: case ByteTerm::TypeBodyAlternativeEnd:
ByteTerm::TypeBodyAlternativeEnd:
never executed: case ByteTerm::TypeBodyAlternativeEnd:
0
1259 do { qmlWTFReportAssertionFailure(__FILE__, 1303, __PRETTY_FUNCTION__, 0); (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap()); } while (0);-
1260-
1261 case
executed 140 times by 1 test: case ByteTerm::TypeAlternativeBegin:
Executed by:
  • tst_ecmascripttests
code before this statement never executed: case ByteTerm::TypeAlternativeBegin:
executed 140 times by 1 test: case ByteTerm::TypeAlternativeBegin:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypeAlternativeBegin:
code before this statement never executed: case ByteTerm::TypeAlternativeBegin:
executed 140 times by 1 test: case ByteTerm::TypeAlternativeBegin:
Executed by:
  • tst_ecmascripttests
0-140
1262 case
executed 200 times by 1 test: case ByteTerm::TypeAlternativeDisjunction:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypeAlternativeDisjunction:
executed 200 times by 1 test: case ByteTerm::TypeAlternativeDisjunction:
Executed by:
  • tst_ecmascripttests
{
200
1263 int offset = (disjunction->terms[context->term]).alternative.next;-
1264 context->term += offset;-
1265 if (offset > 0
offset > 0Description
TRUEevaluated 232 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 108 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
108-232
1266 { ++context->term; goto
executed 232 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
matchAgain;
executed 232 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
};
232
1267 { --context->term; goto
executed 108 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
backtrack;
executed 108 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
};
108
1268 }-
1269 case
never executed: case ByteTerm::TypeAlternativeEnd:
ByteTerm::TypeAlternativeEnd:
never executed: case ByteTerm::TypeAlternativeEnd:
{
0
1270-
1271 BackTrackInfoAlternative* backTrack = reinterpret_cast<BackTrackInfoAlternative*>(context->frame + (disjunction->terms[context->term]).frameLocation);-
1272 unsigned offset = backTrack->offset;-
1273 context->term -= offset;-
1274 { --context->term; goto
never executed: goto backtrack;
backtrack;
never executed: goto backtrack;
};
0
1275 }-
1276-
1277 case
never executed: case ByteTerm::TypeAssertionBOL:
ByteTerm::TypeAssertionBOL:
never executed: case ByteTerm::TypeAssertionBOL:
0
1278 case
never executed: case ByteTerm::TypeAssertionEOL:
ByteTerm::TypeAssertionEOL:
never executed: case ByteTerm::TypeAssertionEOL:
0
1279 case
executed 24 times by 1 test: case ByteTerm::TypeAssertionWordBoundary:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypeAssertionWordBoundary:
executed 24 times by 1 test: case ByteTerm::TypeAssertionWordBoundary:
Executed by:
  • tst_ecmascripttests
24
1280 { --context->term; goto
executed 24 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
backtrack;
executed 24 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
};
24
1281-
1282 case
executed 2136 times by 1 test: case ByteTerm::TypePatternCharacterOnce:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypePatternCharacterOnce:
executed 2136 times by 1 test: case ByteTerm::TypePatternCharacterOnce:
Executed by:
  • tst_ecmascripttests
2136
1283 case
never executed: case ByteTerm::TypePatternCharacterFixed:
ByteTerm::TypePatternCharacterFixed:
never executed: case ByteTerm::TypePatternCharacterFixed:
0
1284 case
executed 52 times by 1 test: case ByteTerm::TypePatternCharacterGreedy:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypePatternCharacterGreedy:
executed 52 times by 1 test: case ByteTerm::TypePatternCharacterGreedy:
Executed by:
  • tst_ecmascripttests
52
1285 case
never executed: case ByteTerm::TypePatternCharacterNonGreedy:
ByteTerm::TypePatternCharacterNonGreedy:
never executed: case ByteTerm::TypePatternCharacterNonGreedy:
0
1286 if (backtrackPatternCharacter((disjunction->terms[context->term]), context)
backtrackPatte...rm]), context)Description
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 2148 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
40-2148
1287 { ++context->term; goto
executed 40 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
matchAgain;
executed 40 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
};
40
1288 { --context->term; goto
executed 2148 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
backtrack;
executed 2148 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
};
2148
1289 case
never executed: case ByteTerm::TypePatternCasedCharacterOnce:
ByteTerm::TypePatternCasedCharacterOnce:
never executed: case ByteTerm::TypePatternCasedCharacterOnce:
0
1290 case
never executed: case ByteTerm::TypePatternCasedCharacterFixed:
ByteTerm::TypePatternCasedCharacterFixed:
never executed: case ByteTerm::TypePatternCasedCharacterFixed:
0
1291 case
never executed: case ByteTerm::TypePatternCasedCharacterGreedy:
ByteTerm::TypePatternCasedCharacterGreedy:
never executed: case ByteTerm::TypePatternCasedCharacterGreedy:
0
1292 case
never executed: case ByteTerm::TypePatternCasedCharacterNonGreedy:
ByteTerm::TypePatternCasedCharacterNonGreedy:
never executed: case ByteTerm::TypePatternCasedCharacterNonGreedy:
0
1293 if (backtrackPatternCasedCharacter((disjunction->terms[context->term]), context)
backtrackPatte...rm]), context)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1294 { ++context->term; goto
never executed: goto matchAgain;
matchAgain;
never executed: goto matchAgain;
};
0
1295 { --context->term; goto
never executed: goto backtrack;
backtrack;
never executed: goto backtrack;
};
0
1296 case
executed 3690716 times by 1 test: case ByteTerm::TypeCharacterClass:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypeCharacterClass:
executed 3690716 times by 1 test: case ByteTerm::TypeCharacterClass:
Executed by:
  • tst_ecmascripttests
3690716
1297 if (backtrackCharacterClass((disjunction->terms[context->term]), context)
backtrackChara...rm]), context)Description
TRUEevaluated 3674764 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 15952 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
15952-3674764
1298 { ++context->term; goto
executed 3674764 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
matchAgain;
executed 3674764 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
};
3674764
1299 { --context->term; goto
executed 15952 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
backtrack;
executed 15952 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
};
15952
1300 case
executed 32 times by 1 test: case ByteTerm::TypeBackReference:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypeBackReference:
executed 32 times by 1 test: case ByteTerm::TypeBackReference:
Executed by:
  • tst_ecmascripttests
32
1301 if (backtrackBackReference((disjunction->terms[context->term]), context)
backtrackBackR...rm]), context)Description
TRUEnever evaluated
FALSEevaluated 32 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
0-32
1302 { ++context->term; goto
never executed: goto matchAgain;
matchAgain;
never executed: goto matchAgain;
};
0
1303 { --context->term; goto
executed 32 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
backtrack;
executed 32 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
};
32
1304 case
executed 2124 times by 1 test: case ByteTerm::TypeParenthesesSubpattern:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypeParenthesesSubpattern:
executed 2124 times by 1 test: case ByteTerm::TypeParenthesesSubpattern:
Executed by:
  • tst_ecmascripttests
{
2124
1305 JSRegExpResult result = backtrackParentheses((disjunction->terms[context->term]), context);-
1306-
1307 if (result == JSRegExpMatch
result == JSRegExpMatchDescription
TRUEevaluated 56 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 2068 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
56-2068
1308 { ++context->term; goto
executed 56 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
matchAgain;
executed 56 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
};
56
1309 } else if (result != JSRegExpNoMatch
result != JSRegExpNoMatchDescription
TRUEnever evaluated
FALSEevaluated 2068 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
0-2068
1310 return
never executed: return result;
result;
never executed: return result;
0
1311-
1312 { --context->term; goto
executed 2068 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
backtrack;
executed 2068 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
};
2068
1313 }-
1314 case
executed 292 times by 1 test: case ByteTerm::TypeParenthesesSubpatternOnceBegin:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypeParenthesesSubpatternOnceBegin:
executed 292 times by 1 test: case ByteTerm::TypeParenthesesSubpatternOnceBegin:
Executed by:
  • tst_ecmascripttests
292
1315 if (backtrackParenthesesOnceBegin((disjunction->terms[context->term]), context)
backtrackParen...rm]), context)Description
TRUEevaluated 148 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 144 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
144-148
1316 { ++context->term; goto
executed 148 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
matchAgain;
executed 148 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
};
148
1317 { --context->term; goto
executed 144 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
backtrack;
executed 144 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
};
144
1318 case
executed 148 times by 1 test: case ByteTerm::TypeParenthesesSubpatternOnceEnd:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypeParenthesesSubpatternOnceEnd:
executed 148 times by 1 test: case ByteTerm::TypeParenthesesSubpatternOnceEnd:
Executed by:
  • tst_ecmascripttests
148
1319 if (backtrackParenthesesOnceEnd((disjunction->terms[context->term]), context)
backtrackParen...rm]), context)Description
TRUEnever evaluated
FALSEevaluated 148 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
0-148
1320 { ++context->term; goto
never executed: goto matchAgain;
matchAgain;
never executed: goto matchAgain;
};
0
1321 { --context->term; goto
executed 148 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
backtrack;
executed 148 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
};
148
1322 case
never executed: case ByteTerm::TypeParenthesesSubpatternTerminalBegin:
ByteTerm::TypeParenthesesSubpatternTerminalBegin:
never executed: case ByteTerm::TypeParenthesesSubpatternTerminalBegin:
0
1323 if (backtrackParenthesesTerminalBegin((disjunction->terms[context->term]), context)
backtrackParen...rm]), context)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1324 { ++context->term; goto
never executed: goto matchAgain;
matchAgain;
never executed: goto matchAgain;
};
0
1325 { --context->term; goto
never executed: goto backtrack;
backtrack;
never executed: goto backtrack;
};
0
1326 case
never executed: case ByteTerm::TypeParenthesesSubpatternTerminalEnd:
ByteTerm::TypeParenthesesSubpatternTerminalEnd:
never executed: case ByteTerm::TypeParenthesesSubpatternTerminalEnd:
0
1327 if (backtrackParenthesesTerminalEnd((disjunction->terms[context->term]), context)
backtrackParen...rm]), context)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1328 { ++context->term; goto
never executed: goto matchAgain;
matchAgain;
never executed: goto matchAgain;
};
0
1329 { --context->term; goto
never executed: goto backtrack;
backtrack;
never executed: goto backtrack;
};
0
1330 case
executed 8 times by 1 test: case ByteTerm::TypeParentheticalAssertionBegin:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypeParentheticalAssertionBegin:
executed 8 times by 1 test: case ByteTerm::TypeParentheticalAssertionBegin:
Executed by:
  • tst_ecmascripttests
8
1331 if (backtrackParentheticalAssertionBegin((disjunction->terms[context->term]), context)
backtrackParen...rm]), context)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
4
1332 { ++context->term; goto
executed 4 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
matchAgain;
executed 4 times by 1 test: goto matchAgain;
Executed by:
  • tst_ecmascripttests
};
4
1333 { --context->term; goto
executed 4 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
backtrack;
executed 4 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
};
4
1334 case
executed 8 times by 1 test: case ByteTerm::TypeParentheticalAssertionEnd:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypeParentheticalAssertionEnd:
executed 8 times by 1 test: case ByteTerm::TypeParentheticalAssertionEnd:
Executed by:
  • tst_ecmascripttests
8
1335 if (backtrackParentheticalAssertionEnd((disjunction->terms[context->term]), context)
backtrackParen...rm]), context)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
0-8
1336 { ++context->term; goto
never executed: goto matchAgain;
matchAgain;
never executed: goto matchAgain;
};
0
1337 { --context->term; goto
executed 8 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
backtrack;
executed 8 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
};
8
1338-
1339 case
executed 26715 times by 1 test: case ByteTerm::TypeCheckInput:
Executed by:
  • tst_ecmascripttests
ByteTerm::TypeCheckInput:
executed 26715 times by 1 test: case ByteTerm::TypeCheckInput:
Executed by:
  • tst_ecmascripttests
26715
1340 input.uncheckInput((disjunction->terms[context->term]).checkInputCount);-
1341 { --context->term; goto
executed 26715 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
backtrack;
executed 26715 times by 1 test: goto backtrack;
Executed by:
  • tst_ecmascripttests
};
26715
1342-
1343 case
never executed: case ByteTerm::TypeUncheckInput:
ByteTerm::TypeUncheckInput:
never executed: case ByteTerm::TypeUncheckInput:
0
1344 input.checkInput((disjunction->terms[context->term]).checkInputCount);-
1345 { --context->term; goto
never executed: goto backtrack;
backtrack;
never executed: goto backtrack;
};
0
1346-
1347 case
never executed: case ByteTerm::TypeDotStarEnclosure:
ByteTerm::TypeDotStarEnclosure:
never executed: case ByteTerm::TypeDotStarEnclosure:
0
1348 do { qmlWTFReportAssertionFailure(__FILE__, 1392, __PRETTY_FUNCTION__, 0); (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap()); } while (0);-
1349 }
never executed: end of block
0
1350-
1351 do { qmlWTFReportAssertionFailure(__FILE__, 1395, __PRETTY_FUNCTION__, 0); (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap()); } while (0);-
1352 return
never executed: return JSRegExpErrorNoMatch;
JSRegExpErrorNoMatch;
never executed: return JSRegExpErrorNoMatch;
0
1353 }-
1354-
1355 JSRegExpResult matchNonZeroDisjunction(ByteDisjunction* disjunction, DisjunctionContext* context, bool btrack = false)-
1356 {-
1357 JSRegExpResult result = matchDisjunction(disjunction, context, btrack);-
1358-
1359 if (result == JSRegExpMatch
result == JSRegExpMatchDescription
TRUEevaluated 524 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 2276 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
524-2276
1360 while (context->matchBegin == context->matchEnd
context->match...text->matchEndDescription
TRUEnever evaluated
FALSEevaluated 524 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
0-524
1361 result = matchDisjunction(disjunction, context, true);-
1362 if (result != JSRegExpMatch
result != JSRegExpMatchDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1363 return
never executed: return result;
result;
never executed: return result;
0
1364 }
never executed: end of block
0
1365 return
executed 524 times by 1 test: return JSRegExpMatch;
Executed by:
  • tst_ecmascripttests
JSRegExpMatch;
executed 524 times by 1 test: return JSRegExpMatch;
Executed by:
  • tst_ecmascripttests
524
1366 }-
1367-
1368 return
executed 2276 times by 1 test: return result;
Executed by:
  • tst_ecmascripttests
result;
executed 2276 times by 1 test: return result;
Executed by:
  • tst_ecmascripttests
2276
1369 }-
1370-
1371 unsigned interpret()-
1372 {-
1373 if (!input.isAvailableInput(0)
!input.isAvailableInput(0)Description
TRUEnever evaluated
FALSEevaluated 215 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
0-215
1374 return
never executed: return offsetNoMatch;
offsetNoMatch;
never executed: return offsetNoMatch;
0
1375-
1376 for (unsigned i = 0; i < pattern->m_body->m_numSubpatterns + 1
i < pattern->m...ubpatterns + 1Description
TRUEevaluated 1310 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 216 times by 1 test
Evaluated by:
  • tst_ecmascripttests
; ++i)
216-1310
1377 output[i << 1] = offsetNoMatch;
executed 1311 times by 1 test: output[i << 1] = offsetNoMatch;
Executed by:
  • tst_ecmascripttests
1311
1378-
1379 allocatorPool = pattern->m_allocator->startAllocator();-
1380 (!(allocatorPool) ? (qmlWTFReportAssertionFailure(__FILE__, 1424, __PRETTY_FUNCTION__, "allocatorPool"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
1381-
1382 DisjunctionContext* context = allocDisjunctionContext(pattern->m_body.get());-
1383-
1384 JSRegExpResult result = matchDisjunction(pattern->m_body.get(), context, false);-
1385 if (result == JSRegExpMatch
result == JSRegExpMatchDescription
TRUEevaluated 192 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
24-192
1386 output[0] = context->matchBegin;-
1387 output[1] = context->matchEnd;-
1388 }
executed 192 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
192
1389-
1390 freeDisjunctionContext(context);-
1391-
1392 pattern->m_allocator->stopAllocator();-
1393-
1394 (!((result == JSRegExpMatch) == (output[0] != offsetNoMatch)) ? (qmlWTFReportAssertionFailure(__FILE__, 1438, __PRETTY_FUNCTION__, "(result == JSRegExpMatch) == (output[0] != offsetNoMatch)"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
1395 return
executed 216 times by 1 test: return output[0];
Executed by:
  • tst_ecmascripttests
output[0];
executed 216 times by 1 test: return output[0];
Executed by:
  • tst_ecmascripttests
216
1396 }-
1397-
1398 Interpreter(BytecodePattern* pattern, unsigned* output, const CharType* input, unsigned length, unsigned start)-
1399 : pattern(pattern)-
1400 , output(output)-
1401 , input(input, start, length)-
1402 , allocatorPool(0)-
1403 , remainingMatchCount(matchLimit)-
1404 {-
1405 }
executed 216 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
216
1406-
1407private:-
1408 BytecodePattern* pattern;-
1409 unsigned* output;-
1410 InputStream input;-
1411 BumpPointerPool* allocatorPool;-
1412 unsigned remainingMatchCount;-
1413};-
1414-
1415class ByteCompiler {-
1416 struct ParenthesesStackEntry {-
1417 unsigned beginTerm;-
1418 unsigned savedAlternativeIndex;-
1419 ParenthesesStackEntry(unsigned beginTerm, unsigned savedAlternativeIndex )-
1420 : beginTerm(beginTerm)-
1421 , savedAlternativeIndex(savedAlternativeIndex)-
1422 {-
1423 }
executed 1108 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
1108
1424 };-
1425-
1426public:-
1427 ByteCompiler(YarrPattern& pattern)-
1428 : m_pattern(pattern)-
1429 {-
1430 m_currentAlternativeIndex = 0;-
1431 }
executed 208 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
208
1432-
1433 PassOwnPtr<BytecodePattern> compile(BumpPointerAllocator* allocator)-
1434 {-
1435 regexBegin(m_pattern.m_numSubpatterns, m_pattern.m_body->m_callFrameSize, m_pattern.m_body->m_alternatives[0]->onceThrough());-
1436 emitDisjunction(m_pattern.m_body);-
1437 regexEnd();-
1438-
1439 return
executed 208 times by 1 test: return adoptPtr(new BytecodePattern(m_bodyDisjunction.release(), m_allParenthesesInfo, m_pattern, allocator));
Executed by:
  • tst_ecmascripttests
adoptPtr(new BytecodePattern(m_bodyDisjunction.release(), m_allParenthesesInfo, m_pattern, allocator));
executed 208 times by 1 test: return adoptPtr(new BytecodePattern(m_bodyDisjunction.release(), m_allParenthesesInfo, m_pattern, allocator));
Executed by:
  • tst_ecmascripttests
208
1440 }-
1441-
1442 void checkInput(unsigned count)-
1443 {-
1444 m_bodyDisjunction->terms.append(ByteTerm::CheckInput(count));-
1445 }
executed 1255 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
1255
1446-
1447 void uncheckInput(unsigned count)-
1448 {-
1449 m_bodyDisjunction->terms.append(ByteTerm::UncheckInput(count));-
1450 }
never executed: end of block
0
1451-
1452 void assertionBOL(unsigned inputPosition)-
1453 {-
1454 m_bodyDisjunction->terms.append(ByteTerm::BOL(inputPosition));-
1455 }
executed 24 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
24
1456-
1457 void assertionEOL(unsigned inputPosition)-
1458 {-
1459 m_bodyDisjunction->terms.append(ByteTerm::EOL(inputPosition));-
1460 }
executed 24 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
24
1461-
1462 void assertionWordBoundary(bool invert, unsigned inputPosition)-
1463 {-
1464 m_bodyDisjunction->terms.append(ByteTerm::WordBoundary(invert, inputPosition));-
1465 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
8
1466-
1467 void atomPatternCharacter(UChar ch, unsigned inputPosition, unsigned frameLocation, Checked<unsigned> quantityCount, QuantifierType quantityType)-
1468 {-
1469 if (m_pattern.m_ignoreCase
m_pattern.m_ignoreCaseDescription
TRUEevaluated 56 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1738 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
56-1738
1470 UChar lo = Unicode::toLower(ch);-
1471 UChar hi = Unicode::toUpper(ch);-
1472-
1473 if (lo != hi
lo != hiDescription
TRUEevaluated 32 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
24-32
1474 m_bodyDisjunction->terms.append(ByteTerm(lo, hi, inputPosition, frameLocation, quantityCount, quantityType));-
1475 return;
executed 32 times by 1 test: return;
Executed by:
  • tst_ecmascripttests
32
1476 }-
1477 }
executed 24 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
24
1478-
1479 m_bodyDisjunction->terms.append(ByteTerm(ch, inputPosition, frameLocation, quantityCount, quantityType));-
1480 }
executed 1764 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
1764
1481-
1482 void atomCharacterClass(CharacterClass* characterClass, bool invert, unsigned inputPosition, unsigned frameLocation, Checked<unsigned> quantityCount, QuantifierType quantityType)-
1483 {-
1484 m_bodyDisjunction->terms.append(ByteTerm(characterClass, invert, inputPosition));-
1485-
1486 m_bodyDisjunction->terms[m_bodyDisjunction->terms.size() - 1].atom.quantityCount = quantityCount.unsafeGet();-
1487 m_bodyDisjunction->terms[m_bodyDisjunction->terms.size() - 1].atom.quantityType = quantityType;-
1488 m_bodyDisjunction->terms[m_bodyDisjunction->terms.size() - 1].frameLocation = frameLocation;-
1489 }
executed 1632 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
1632
1490-
1491 void atomBackReference(unsigned subpatternId, unsigned inputPosition, unsigned frameLocation, Checked<unsigned> quantityCount, QuantifierType quantityType)-
1492 {-
1493 (!(subpatternId) ? (qmlWTFReportAssertionFailure(__FILE__, 1537, __PRETTY_FUNCTION__, "subpatternId"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
1494-
1495 m_bodyDisjunction->terms.append(ByteTerm::BackReference(subpatternId, inputPosition));-
1496-
1497 m_bodyDisjunction->terms[m_bodyDisjunction->terms.size() - 1].atom.quantityCount = quantityCount.unsafeGet();-
1498 m_bodyDisjunction->terms[m_bodyDisjunction->terms.size() - 1].atom.quantityType = quantityType;-
1499 m_bodyDisjunction->terms[m_bodyDisjunction->terms.size() - 1].frameLocation = frameLocation;-
1500 }
executed 192 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
192
1501-
1502 void atomParenthesesOnceBegin(unsigned subpatternId, bool capture, unsigned inputPosition, unsigned frameLocation, unsigned alternativeFrameLocation)-
1503 {-
1504 (!(m_bodyDisjunction->terms.size() <= 0x7fffffff) ? (qmlWTFReportAssertionFailure(__FILE__, 1548, __PRETTY_FUNCTION__, "m_bodyDisjunction->terms.size() <= INT_MAX"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
1505 int beginTerm = static_cast<int>(m_bodyDisjunction->terms.size());-
1506-
1507 m_bodyDisjunction->terms.append(ByteTerm(ByteTerm::TypeParenthesesSubpatternOnceBegin, subpatternId, capture, false, inputPosition));-
1508 m_bodyDisjunction->terms[m_bodyDisjunction->terms.size() - 1].frameLocation = frameLocation;-
1509 m_bodyDisjunction->terms.append(ByteTerm::AlternativeBegin());-
1510 m_bodyDisjunction->terms[m_bodyDisjunction->terms.size() - 1].frameLocation = alternativeFrameLocation;-
1511-
1512 m_parenthesesStack.append(ParenthesesStackEntry(beginTerm, m_currentAlternativeIndex));-
1513 m_currentAlternativeIndex = beginTerm + 1;-
1514 }
executed 688 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
688
1515-
1516 void atomParenthesesTerminalBegin(unsigned subpatternId, bool capture, unsigned inputPosition, unsigned frameLocation, unsigned alternativeFrameLocation)-
1517 {-
1518 (!(m_bodyDisjunction->terms.size() <= 0x7fffffff) ? (qmlWTFReportAssertionFailure(__FILE__, 1562, __PRETTY_FUNCTION__, "m_bodyDisjunction->terms.size() <= INT_MAX"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
1519 int beginTerm = static_cast<int>(m_bodyDisjunction->terms.size());-
1520-
1521 m_bodyDisjunction->terms.append(ByteTerm(ByteTerm::TypeParenthesesSubpatternTerminalBegin, subpatternId, capture, false, inputPosition));-
1522 m_bodyDisjunction->terms[m_bodyDisjunction->terms.size() - 1].frameLocation = frameLocation;-
1523 m_bodyDisjunction->terms.append(ByteTerm::AlternativeBegin());-
1524 m_bodyDisjunction->terms[m_bodyDisjunction->terms.size() - 1].frameLocation = alternativeFrameLocation;-
1525-
1526 m_parenthesesStack.append(ParenthesesStackEntry(beginTerm, m_currentAlternativeIndex));-
1527 m_currentAlternativeIndex = beginTerm + 1;-
1528 }
never executed: end of block
0
1529-
1530 void atomParenthesesSubpatternBegin(unsigned subpatternId, bool capture, unsigned inputPosition, unsigned frameLocation, unsigned alternativeFrameLocation)-
1531 {-
1532-
1533-
1534-
1535-
1536 (!(m_bodyDisjunction->terms.size() <= 0x7fffffff) ? (qmlWTFReportAssertionFailure(__FILE__, 1580, __PRETTY_FUNCTION__, "m_bodyDisjunction->terms.size() <= INT_MAX"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
1537 int beginTerm = static_cast<int>(m_bodyDisjunction->terms.size());-
1538-
1539 m_bodyDisjunction->terms.append(ByteTerm(ByteTerm::TypeParenthesesSubpatternOnceBegin, subpatternId, capture, false, inputPosition));-
1540 m_bodyDisjunction->terms[m_bodyDisjunction->terms.size() - 1].frameLocation = frameLocation;-
1541 m_bodyDisjunction->terms.append(ByteTerm::AlternativeBegin());-
1542 m_bodyDisjunction->terms[m_bodyDisjunction->terms.size() - 1].frameLocation = alternativeFrameLocation;-
1543-
1544 m_parenthesesStack.append(ParenthesesStackEntry(beginTerm, m_currentAlternativeIndex));-
1545 m_currentAlternativeIndex = beginTerm + 1;-
1546 }
executed 412 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
412
1547-
1548 void atomParentheticalAssertionBegin(unsigned subpatternId, bool invert, unsigned frameLocation, unsigned alternativeFrameLocation)-
1549 {-
1550 (!(m_bodyDisjunction->terms.size() <= 0x7fffffff) ? (qmlWTFReportAssertionFailure(__FILE__, 1594, __PRETTY_FUNCTION__, "m_bodyDisjunction->terms.size() <= INT_MAX"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
1551 int beginTerm = static_cast<int>(m_bodyDisjunction->terms.size());-
1552-
1553 m_bodyDisjunction->terms.append(ByteTerm(ByteTerm::TypeParentheticalAssertionBegin, subpatternId, false, invert, 0));-
1554 m_bodyDisjunction->terms[m_bodyDisjunction->terms.size() - 1].frameLocation = frameLocation;-
1555 m_bodyDisjunction->terms.append(ByteTerm::AlternativeBegin());-
1556 m_bodyDisjunction->terms[m_bodyDisjunction->terms.size() - 1].frameLocation = alternativeFrameLocation;-
1557-
1558 m_parenthesesStack.append(ParenthesesStackEntry(beginTerm, m_currentAlternativeIndex));-
1559 m_currentAlternativeIndex = beginTerm + 1;-
1560 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
8
1561-
1562 void atomParentheticalAssertionEnd(unsigned inputPosition, unsigned frameLocation, Checked<unsigned> quantityCount, QuantifierType quantityType)-
1563 {-
1564 unsigned beginTerm = popParenthesesStack();-
1565 closeAlternative(beginTerm + 1);-
1566 (!(m_bodyDisjunction->terms.size() <= 0x7fffffff) ? (qmlWTFReportAssertionFailure(__FILE__, 1610, __PRETTY_FUNCTION__, "m_bodyDisjunction->terms.size() <= INT_MAX"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
1567 unsigned endTerm = static_cast<int>(m_bodyDisjunction->terms.size());-
1568-
1569 (!(m_bodyDisjunction->terms[beginTerm].type == ByteTerm::TypeParentheticalAssertionBegin) ? (qmlWTFReportAssertionFailure(__FILE__, 1613, __PRETTY_FUNCTION__, "m_bodyDisjunction->terms[beginTerm].type == ByteTerm::TypeParentheticalAssertionBegin"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
1570-
1571 bool invert = m_bodyDisjunction->terms[beginTerm].invert();-
1572 unsigned subpatternId = m_bodyDisjunction->terms[beginTerm].atom.subpatternId;-
1573-
1574 m_bodyDisjunction->terms.append(ByteTerm(ByteTerm::TypeParentheticalAssertionEnd, subpatternId, false, invert, inputPosition));-
1575 m_bodyDisjunction->terms[beginTerm].atom.parenthesesWidth = endTerm - beginTerm;-
1576 m_bodyDisjunction->terms[endTerm].atom.parenthesesWidth = endTerm - beginTerm;-
1577 m_bodyDisjunction->terms[endTerm].frameLocation = frameLocation;-
1578-
1579 m_bodyDisjunction->terms[beginTerm].atom.quantityCount = quantityCount.unsafeGet();-
1580 m_bodyDisjunction->terms[beginTerm].atom.quantityType = quantityType;-
1581 m_bodyDisjunction->terms[endTerm].atom.quantityCount = quantityCount.unsafeGet();-
1582 m_bodyDisjunction->terms[endTerm].atom.quantityType = quantityType;-
1583 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
8
1584-
1585 void assertionDotStarEnclosure(bool bolAnchored, bool eolAnchored)-
1586 {-
1587 m_bodyDisjunction->terms.append(ByteTerm::DotStarEnclosure(bolAnchored, eolAnchored));-
1588 }
never executed: end of block
0
1589-
1590 unsigned popParenthesesStack()-
1591 {-
1592 (!(m_parenthesesStack.size()) ? (qmlWTFReportAssertionFailure(__FILE__, 1636, __PRETTY_FUNCTION__, "m_parenthesesStack.size()"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
1593 (!(m_parenthesesStack.size() <= 0x7fffffff) ? (qmlWTFReportAssertionFailure(__FILE__, 1637, __PRETTY_FUNCTION__, "m_parenthesesStack.size() <= INT_MAX"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
1594 int stackEnd = static_cast<int>(m_parenthesesStack.size()) - 1;-
1595 unsigned beginTerm = m_parenthesesStack[stackEnd].beginTerm;-
1596 m_currentAlternativeIndex = m_parenthesesStack[stackEnd].savedAlternativeIndex;-
1597 m_parenthesesStack.shrink(stackEnd);-
1598-
1599 (!(beginTerm < m_bodyDisjunction->terms.size()) ? (qmlWTFReportAssertionFailure(__FILE__, 1643, __PRETTY_FUNCTION__, "beginTerm < m_bodyDisjunction->terms.size()"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
1600 (!(m_currentAlternativeIndex < m_bodyDisjunction->terms.size()) ? (qmlWTFReportAssertionFailure(__FILE__, 1644, __PRETTY_FUNCTION__, "m_currentAlternativeIndex < m_bodyDisjunction->terms.size()"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
1601-
1602 return
executed 1108 times by 1 test: return beginTerm;
Executed by:
  • tst_ecmascripttests
beginTerm;
executed 1108 times by 1 test: return beginTerm;
Executed by:
  • tst_ecmascripttests
1108
1603 }-
1604-
1605-
1606 void dumpDisjunction(ByteDisjunction* disjunction)-
1607 {-
1608 dataLogF("ByteDisjunction(%p):\n\t", disjunction);-
1609 for (unsigned i = 0; i < disjunction->terms.size()
i < disjunction->terms.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
1610 dataLogF("{ %d } ", disjunction->terms[i].type);
never executed: dataLogF("{ %d } ", disjunction->terms[i].type);
0
1611 dataLogF("\n");-
1612 }
never executed: end of block
0
1613-
1614-
1615 void closeAlternative(int beginTerm)-
1616 {-
1617 int origBeginTerm = beginTerm;-
1618 (!(m_bodyDisjunction->terms[beginTerm].type == ByteTerm::TypeAlternativeBegin) ? (qmlWTFReportAssertionFailure(__FILE__, 1662, __PRETTY_FUNCTION__, "m_bodyDisjunction->terms[beginTerm].type == ByteTerm::TypeAlternativeBegin"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
1619 (!(m_bodyDisjunction->terms.size() <= 0x7fffffff) ? (qmlWTFReportAssertionFailure(__FILE__, 1663, __PRETTY_FUNCTION__, "m_bodyDisjunction->terms.size() <= INT_MAX"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
1620 int endIndex = static_cast<int>(m_bodyDisjunction->terms.size());-
1621-
1622 unsigned frameLocation = m_bodyDisjunction->terms[beginTerm].frameLocation;-
1623-
1624 if (!m_bodyDisjunction->terms[beginTerm].alternative.next
!m_bodyDisjunc...ternative.nextDescription
TRUEevaluated 668 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 440 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
440-668
1625 m_bodyDisjunction->terms.remove(beginTerm);
executed 668 times by 1 test: m_bodyDisjunction->terms.remove(beginTerm);
Executed by:
  • tst_ecmascripttests
668
1626 else {-
1627 while (m_bodyDisjunction->terms[beginTerm].alternative.next
m_bodyDisjunct...ternative.nextDescription
TRUEevaluated 564 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 440 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
440-564
1628 beginTerm += m_bodyDisjunction->terms[beginTerm].alternative.next;-
1629 (!(m_bodyDisjunction->terms[beginTerm].type == ByteTerm::TypeAlternativeDisjunction) ? (qmlWTFReportAssertionFailure(__FILE__, 1673, __PRETTY_FUNCTION__, "m_bodyDisjunction->terms[beginTerm].type == ByteTerm::TypeAlternativeDisjunction"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
1630 m_bodyDisjunction->terms[beginTerm].alternative.end = endIndex - beginTerm;-
1631 m_bodyDisjunction->terms[beginTerm].frameLocation = frameLocation;-
1632 }
executed 564 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
564
1633-
1634 m_bodyDisjunction->terms[beginTerm].alternative.next = origBeginTerm - beginTerm;-
1635-
1636 m_bodyDisjunction->terms.append(ByteTerm::AlternativeEnd());-
1637 m_bodyDisjunction->terms[endIndex].frameLocation = frameLocation;-
1638 }
executed 440 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
440
1639 }-
1640-
1641 void closeBodyAlternative()-
1642 {-
1643 int beginTerm = 0;-
1644 int origBeginTerm = 0;-
1645 (!(m_bodyDisjunction->terms[beginTerm].type == ByteTerm::TypeBodyAlternativeBegin) ? (qmlWTFReportAssertionFailure(__FILE__, 1689, __PRETTY_FUNCTION__, "m_bodyDisjunction->terms[beginTerm].type == ByteTerm::TypeBodyAlternativeBegin"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
1646 (!(m_bodyDisjunction->terms.size() <= 0x7fffffff) ? (qmlWTFReportAssertionFailure(__FILE__, 1690, __PRETTY_FUNCTION__, "m_bodyDisjunction->terms.size() <= INT_MAX"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
1647 int endIndex = static_cast<int>(m_bodyDisjunction->terms.size());-
1648-
1649 unsigned frameLocation = m_bodyDisjunction->terms[beginTerm].frameLocation;-
1650-
1651 while (m_bodyDisjunction->terms[beginTerm].alternative.next
m_bodyDisjunct...ternative.nextDescription
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 208 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
24-208
1652 beginTerm += m_bodyDisjunction->terms[beginTerm].alternative.next;-
1653 (!(m_bodyDisjunction->terms[beginTerm].type == ByteTerm::TypeBodyAlternativeDisjunction) ? (qmlWTFReportAssertionFailure(__FILE__, 1697, __PRETTY_FUNCTION__, "m_bodyDisjunction->terms[beginTerm].type == ByteTerm::TypeBodyAlternativeDisjunction"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
1654 m_bodyDisjunction->terms[beginTerm].alternative.end = endIndex - beginTerm;-
1655 m_bodyDisjunction->terms[beginTerm].frameLocation = frameLocation;-
1656 }
executed 24 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
24
1657-
1658 m_bodyDisjunction->terms[beginTerm].alternative.next = origBeginTerm - beginTerm;-
1659-
1660 m_bodyDisjunction->terms.append(ByteTerm::BodyAlternativeEnd());-
1661 m_bodyDisjunction->terms[endIndex].frameLocation = frameLocation;-
1662 }
executed 208 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
208
1663-
1664 void atomParenthesesSubpatternEnd(unsigned lastSubpatternId, int inputPosition, unsigned frameLocation, Checked<unsigned> quantityCount, QuantifierType quantityType, unsigned callFrameSize = 0)-
1665 {-
1666 unsigned beginTerm = popParenthesesStack();-
1667 closeAlternative(beginTerm + 1);-
1668 (!(m_bodyDisjunction->terms.size() <= 0x7fffffff) ? (qmlWTFReportAssertionFailure(__FILE__, 1712, __PRETTY_FUNCTION__, "m_bodyDisjunction->terms.size() <= INT_MAX"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
1669 unsigned endTerm = static_cast<int>(m_bodyDisjunction->terms.size());-
1670-
1671 (!(m_bodyDisjunction->terms[beginTerm].type == ByteTerm::TypeParenthesesSubpatternOnceBegin) ? (qmlWTFReportAssertionFailure(__FILE__, 1715, __PRETTY_FUNCTION__, "m_bodyDisjunction->terms[beginTerm].type == ByteTerm::TypeParenthesesSubpatternOnceBegin"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
1672-
1673 ByteTerm& parenthesesBegin = m_bodyDisjunction->terms[beginTerm];-
1674-
1675 bool capture = parenthesesBegin.capture();-
1676 unsigned subpatternId = parenthesesBegin.atom.subpatternId;-
1677-
1678 unsigned numSubpatterns = lastSubpatternId - subpatternId + 1;-
1679 OwnPtr<ByteDisjunction> parenthesesDisjunction = adoptPtr(new ByteDisjunction(numSubpatterns, callFrameSize));-
1680-
1681 unsigned firstTermInParentheses = beginTerm + 1;-
1682 parenthesesDisjunction->terms.reserveInitialCapacity(endTerm - firstTermInParentheses + 2);-
1683-
1684 parenthesesDisjunction->terms.append(ByteTerm::SubpatternBegin());-
1685 for (unsigned termInParentheses = firstTermInParentheses; termInParentheses < endTerm
termInParentheses < endTermDescription
TRUEevaluated 4500 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 412 times by 1 test
Evaluated by:
  • tst_ecmascripttests
; ++termInParentheses)
412-4500
1686 parenthesesDisjunction->terms.append(m_bodyDisjunction->terms[termInParentheses]);
executed 4500 times by 1 test: parenthesesDisjunction->terms.append(m_bodyDisjunction->terms[termInParentheses]);
Executed by:
  • tst_ecmascripttests
4500
1687 parenthesesDisjunction->terms.append(ByteTerm::SubpatternEnd());-
1688-
1689 m_bodyDisjunction->terms.shrink(beginTerm);-
1690-
1691 m_bodyDisjunction->terms.append(ByteTerm(ByteTerm::TypeParenthesesSubpattern, subpatternId, parenthesesDisjunction.get(), capture, inputPosition));-
1692 m_allParenthesesInfo.append(parenthesesDisjunction.release());-
1693-
1694 m_bodyDisjunction->terms[beginTerm].atom.quantityCount = quantityCount.unsafeGet();-
1695 m_bodyDisjunction->terms[beginTerm].atom.quantityType = quantityType;-
1696 m_bodyDisjunction->terms[beginTerm].frameLocation = frameLocation;-
1697 }
executed 412 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
412
1698-
1699 void atomParenthesesOnceEnd(int inputPosition, unsigned frameLocation, Checked<unsigned> quantityCount, QuantifierType quantityType)-
1700 {-
1701 unsigned beginTerm = popParenthesesStack();-
1702 closeAlternative(beginTerm + 1);-
1703 (!(m_bodyDisjunction->terms.size() <= 0x7fffffff) ? (qmlWTFReportAssertionFailure(__FILE__, 1747, __PRETTY_FUNCTION__, "m_bodyDisjunction->terms.size() <= INT_MAX"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
1704 unsigned endTerm = static_cast<int>(m_bodyDisjunction->terms.size());-
1705-
1706 (!(m_bodyDisjunction->terms[beginTerm].type == ByteTerm::TypeParenthesesSubpatternOnceBegin) ? (qmlWTFReportAssertionFailure(__FILE__, 1750, __PRETTY_FUNCTION__, "m_bodyDisjunction->terms[beginTerm].type == ByteTerm::TypeParenthesesSubpatternOnceBegin"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
1707-
1708 bool capture = m_bodyDisjunction->terms[beginTerm].capture();-
1709 unsigned subpatternId = m_bodyDisjunction->terms[beginTerm].atom.subpatternId;-
1710-
1711 m_bodyDisjunction->terms.append(ByteTerm(ByteTerm::TypeParenthesesSubpatternOnceEnd, subpatternId, capture, false, inputPosition));-
1712 m_bodyDisjunction->terms[beginTerm].atom.parenthesesWidth = endTerm - beginTerm;-
1713 m_bodyDisjunction->terms[endTerm].atom.parenthesesWidth = endTerm - beginTerm;-
1714 m_bodyDisjunction->terms[endTerm].frameLocation = frameLocation;-
1715-
1716 m_bodyDisjunction->terms[beginTerm].atom.quantityCount = quantityCount.unsafeGet();-
1717 m_bodyDisjunction->terms[beginTerm].atom.quantityType = quantityType;-
1718 m_bodyDisjunction->terms[endTerm].atom.quantityCount = quantityCount.unsafeGet();-
1719 m_bodyDisjunction->terms[endTerm].atom.quantityType = quantityType;-
1720 }
executed 688 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
688
1721-
1722 void atomParenthesesTerminalEnd(int inputPosition, unsigned frameLocation, Checked<unsigned> quantityCount, QuantifierType quantityType)-
1723 {-
1724 unsigned beginTerm = popParenthesesStack();-
1725 closeAlternative(beginTerm + 1);-
1726 (!(m_bodyDisjunction->terms.size() <= 0x7fffffff) ? (qmlWTFReportAssertionFailure(__FILE__, 1770, __PRETTY_FUNCTION__, "m_bodyDisjunction->terms.size() <= INT_MAX"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
1727 unsigned endTerm = static_cast<int>(m_bodyDisjunction->terms.size());-
1728-
1729 (!(m_bodyDisjunction->terms[beginTerm].type == ByteTerm::TypeParenthesesSubpatternTerminalBegin) ? (qmlWTFReportAssertionFailure(__FILE__, 1773, __PRETTY_FUNCTION__, "m_bodyDisjunction->terms[beginTerm].type == ByteTerm::TypeParenthesesSubpatternTerminalBegin"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
1730-
1731 bool capture = m_bodyDisjunction->terms[beginTerm].capture();-
1732 unsigned subpatternId = m_bodyDisjunction->terms[beginTerm].atom.subpatternId;-
1733-
1734 m_bodyDisjunction->terms.append(ByteTerm(ByteTerm::TypeParenthesesSubpatternTerminalEnd, subpatternId, capture, false, inputPosition));-
1735 m_bodyDisjunction->terms[beginTerm].atom.parenthesesWidth = endTerm - beginTerm;-
1736 m_bodyDisjunction->terms[endTerm].atom.parenthesesWidth = endTerm - beginTerm;-
1737 m_bodyDisjunction->terms[endTerm].frameLocation = frameLocation;-
1738-
1739 m_bodyDisjunction->terms[beginTerm].atom.quantityCount = quantityCount.unsafeGet();-
1740 m_bodyDisjunction->terms[beginTerm].atom.quantityType = quantityType;-
1741 m_bodyDisjunction->terms[endTerm].atom.quantityCount = quantityCount.unsafeGet();-
1742 m_bodyDisjunction->terms[endTerm].atom.quantityType = quantityType;-
1743 }
never executed: end of block
0
1744-
1745 void regexBegin(unsigned numSubpatterns, unsigned callFrameSize, bool onceThrough)-
1746 {-
1747 m_bodyDisjunction = adoptPtr(new ByteDisjunction(numSubpatterns, callFrameSize));-
1748 m_bodyDisjunction->terms.append(ByteTerm::BodyAlternativeBegin(onceThrough));-
1749 m_bodyDisjunction->terms[0].frameLocation = 0;-
1750 m_currentAlternativeIndex = 0;-
1751 }
executed 208 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
208
1752-
1753 void regexEnd()-
1754 {-
1755 closeBodyAlternative();-
1756 }
executed 208 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
208
1757-
1758 void alternativeBodyDisjunction(bool onceThrough)-
1759 {-
1760 (!(m_bodyDisjunction->terms.size() <= 0x7fffffff) ? (qmlWTFReportAssertionFailure(__FILE__, 1804, __PRETTY_FUNCTION__, "m_bodyDisjunction->terms.size() <= INT_MAX"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
1761 int newAlternativeIndex = static_cast<int>(m_bodyDisjunction->terms.size());-
1762 m_bodyDisjunction->terms[m_currentAlternativeIndex].alternative.next = newAlternativeIndex - m_currentAlternativeIndex;-
1763 m_bodyDisjunction->terms.append(ByteTerm::BodyAlternativeDisjunction(onceThrough));-
1764-
1765 m_currentAlternativeIndex = newAlternativeIndex;-
1766 }
executed 24 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
24
1767-
1768 void alternativeDisjunction()-
1769 {-
1770 (!(m_bodyDisjunction->terms.size() <= 0x7fffffff) ? (qmlWTFReportAssertionFailure(__FILE__, 1814, __PRETTY_FUNCTION__, "m_bodyDisjunction->terms.size() <= INT_MAX"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
1771 int newAlternativeIndex = static_cast<int>(m_bodyDisjunction->terms.size());-
1772 m_bodyDisjunction->terms[m_currentAlternativeIndex].alternative.next = newAlternativeIndex - m_currentAlternativeIndex;-
1773 m_bodyDisjunction->terms.append(ByteTerm::AlternativeDisjunction());-
1774-
1775 m_currentAlternativeIndex = newAlternativeIndex;-
1776 }
executed 564 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
564
1777-
1778 void emitDisjunction(PatternDisjunction* disjunction, unsigned inputCountAlreadyChecked = 0, unsigned parenthesesInputCountAlreadyChecked = 0)-
1779 {-
1780 for (unsigned alt = 0; alt < disjunction->m_alternatives.size()
alt < disjunct...natives.size()Description
TRUEevaluated 1903 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1316 times by 1 test
Evaluated by:
  • tst_ecmascripttests
; ++alt) {
1316-1903
1781 unsigned currentCountAlreadyChecked = inputCountAlreadyChecked;-
1782-
1783 PatternAlternative* alternative = disjunction->m_alternatives[alt].get();-
1784-
1785 if (alt
altDescription
TRUEevaluated 588 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1315 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
588-1315
1786 if (disjunction == m_pattern.m_body
disjunction ==...pattern.m_bodyDescription
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 564 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
24-564
1787 alternativeBodyDisjunction(alternative->onceThrough());
executed 24 times by 1 test: alternativeBodyDisjunction(alternative->onceThrough());
Executed by:
  • tst_ecmascripttests
24
1788 else-
1789 alternativeDisjunction();
executed 564 times by 1 test: alternativeDisjunction();
Executed by:
  • tst_ecmascripttests
564
1790 }-
1791-
1792 unsigned minimumSize = alternative->m_minimumSize;-
1793 (!(minimumSize >= parenthesesInputCountAlreadyChecked) ? (qmlWTFReportAssertionFailure(__FILE__, 1837, __PRETTY_FUNCTION__, "minimumSize >= parenthesesInputCountAlreadyChecked"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
1794 unsigned countToCheck = minimumSize - parenthesesInputCountAlreadyChecked;-
1795-
1796 if (countToCheck
countToCheckDescription
TRUEevaluated 1255 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 647 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
647-1255
1797 checkInput(countToCheck);-
1798 currentCountAlreadyChecked += countToCheck;-
1799 }
executed 1255 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
1255
1800-
1801 for (unsigned i = 0; i < alternative->m_terms.size()
i < alternativ...m_terms.size()Description
TRUEevaluated 4790 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1904 times by 1 test
Evaluated by:
  • tst_ecmascripttests
; ++i) {
1904-4790
1802 PatternTerm& term = alternative->m_terms[i];-
1803-
1804 switch (term.type) {-
1805 case
executed 24 times by 1 test: case PatternTerm::TypeAssertionBOL:
Executed by:
  • tst_ecmascripttests
PatternTerm::TypeAssertionBOL:
executed 24 times by 1 test: case PatternTerm::TypeAssertionBOL:
Executed by:
  • tst_ecmascripttests
24
1806 assertionBOL(currentCountAlreadyChecked - term.inputPosition);-
1807 break;
executed 24 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
24
1808-
1809 case
executed 24 times by 1 test: case PatternTerm::TypeAssertionEOL:
Executed by:
  • tst_ecmascripttests
PatternTerm::TypeAssertionEOL:
executed 24 times by 1 test: case PatternTerm::TypeAssertionEOL:
Executed by:
  • tst_ecmascripttests
24
1810 assertionEOL(currentCountAlreadyChecked - term.inputPosition);-
1811 break;
executed 24 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
24
1812-
1813 case
executed 8 times by 1 test: case PatternTerm::TypeAssertionWordBoundary:
Executed by:
  • tst_ecmascripttests
PatternTerm::TypeAssertionWordBoundary:
executed 8 times by 1 test: case PatternTerm::TypeAssertionWordBoundary:
Executed by:
  • tst_ecmascripttests
8
1814 assertionWordBoundary(term.invert(), currentCountAlreadyChecked - term.inputPosition);-
1815 break;
executed 8 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
8
1816-
1817 case
executed 1795 times by 1 test: case PatternTerm::TypePatternCharacter:
Executed by:
  • tst_ecmascripttests
PatternTerm::TypePatternCharacter:
executed 1795 times by 1 test: case PatternTerm::TypePatternCharacter:
Executed by:
  • tst_ecmascripttests
1795
1818 atomPatternCharacter(term.patternCharacter, currentCountAlreadyChecked - term.inputPosition, term.frameLocation, term.quantityCount, term.quantityType);-
1819 break;
executed 1796 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
1796
1820-
1821 case
executed 1632 times by 1 test: case PatternTerm::TypeCharacterClass:
Executed by:
  • tst_ecmascripttests
PatternTerm::TypeCharacterClass:
executed 1632 times by 1 test: case PatternTerm::TypeCharacterClass:
Executed by:
  • tst_ecmascripttests
1632
1822 atomCharacterClass(term.characterClass, term.invert(), currentCountAlreadyChecked- term.inputPosition, term.frameLocation, term.quantityCount, term.quantityType);-
1823 break;
executed 1632 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
1632
1824-
1825 case
executed 192 times by 1 test: case PatternTerm::TypeBackReference:
Executed by:
  • tst_ecmascripttests
PatternTerm::TypeBackReference:
executed 192 times by 1 test: case PatternTerm::TypeBackReference:
Executed by:
  • tst_ecmascripttests
192
1826 atomBackReference(term.backReferenceSubpatternId, currentCountAlreadyChecked - term.inputPosition, term.frameLocation, term.quantityCount, term.quantityType);-
1827 break;
executed 192 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
192
1828-
1829 case
executed 8 times by 1 test: case PatternTerm::TypeForwardReference:
Executed by:
  • tst_ecmascripttests
PatternTerm::TypeForwardReference:
executed 8 times by 1 test: case PatternTerm::TypeForwardReference:
Executed by:
  • tst_ecmascripttests
8
1830 break;
executed 8 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
8
1831-
1832 case
executed 1100 times by 1 test: case PatternTerm::TypeParenthesesSubpattern:
Executed by:
  • tst_ecmascripttests
PatternTerm::TypeParenthesesSubpattern:
executed 1100 times by 1 test: case PatternTerm::TypeParenthesesSubpattern:
Executed by:
  • tst_ecmascripttests
{
1100
1833 unsigned disjunctionAlreadyCheckedCount = 0;-
1834 if (term.quantityCount == 1
term.quantityCount == 1Description
TRUEevaluated 688 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 412 times by 1 test
Evaluated by:
  • tst_ecmascripttests
&& !term.parentheses.isCopy
!term.parentheses.isCopyDescription
TRUEevaluated 688 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
) {
0-688
1835 unsigned alternativeFrameLocation = term.frameLocation;-
1836-
1837 if (term.quantityType == QuantifierFixedCount
term.quantityT...fierFixedCountDescription
TRUEevaluated 480 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 208 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
208-480
1838 disjunctionAlreadyCheckedCount = term.parentheses.disjunction->m_minimumSize;
executed 480 times by 1 test: disjunctionAlreadyCheckedCount = term.parentheses.disjunction->m_minimumSize;
Executed by:
  • tst_ecmascripttests
480
1839 else-
1840 alternativeFrameLocation += 1;
executed 208 times by 1 test: alternativeFrameLocation += 1;
Executed by:
  • tst_ecmascripttests
208
1841 unsigned delegateEndInputOffset = term.inputPosition - currentCountAlreadyChecked;-
1842 atomParenthesesOnceBegin(term.parentheses.subpatternId, term.capture(), disjunctionAlreadyCheckedCount - delegateEndInputOffset, term.frameLocation, alternativeFrameLocation);-
1843 emitDisjunction(term.parentheses.disjunction, currentCountAlreadyChecked, disjunctionAlreadyCheckedCount);-
1844 atomParenthesesOnceEnd(delegateEndInputOffset, term.frameLocation, term.quantityCount, term.quantityType);-
1845 }
executed 688 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
else if (term.parentheses.isTerminal
term.parentheses.isTerminalDescription
TRUEnever evaluated
FALSEevaluated 412 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
0-688
1846 unsigned delegateEndInputOffset = term.inputPosition - currentCountAlreadyChecked;-
1847 atomParenthesesTerminalBegin(term.parentheses.subpatternId, term.capture(), disjunctionAlreadyCheckedCount - delegateEndInputOffset, term.frameLocation, term.frameLocation + 1);-
1848 emitDisjunction(term.parentheses.disjunction, currentCountAlreadyChecked, disjunctionAlreadyCheckedCount);-
1849 atomParenthesesTerminalEnd(delegateEndInputOffset, term.frameLocation, term.quantityCount, term.quantityType);-
1850 }
never executed: end of block
else {
0
1851 unsigned delegateEndInputOffset = term.inputPosition - currentCountAlreadyChecked;-
1852 atomParenthesesSubpatternBegin(term.parentheses.subpatternId, term.capture(), disjunctionAlreadyCheckedCount - delegateEndInputOffset, term.frameLocation, 0);-
1853 emitDisjunction(term.parentheses.disjunction, currentCountAlreadyChecked, 0);-
1854 atomParenthesesSubpatternEnd(term.parentheses.lastSubpatternId, delegateEndInputOffset, term.frameLocation, term.quantityCount, term.quantityType, term.parentheses.disjunction->m_callFrameSize);-
1855 }
executed 412 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
412
1856 break;
executed 1100 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
1100
1857 }-
1858-
1859 case
executed 8 times by 1 test: case PatternTerm::TypeParentheticalAssertion:
Executed by:
  • tst_ecmascripttests
PatternTerm::TypeParentheticalAssertion:
executed 8 times by 1 test: case PatternTerm::TypeParentheticalAssertion:
Executed by:
  • tst_ecmascripttests
{
8
1860 unsigned alternativeFrameLocation = term.frameLocation + 1;-
1861-
1862 (!(currentCountAlreadyChecked >= static_cast<unsigned>(term.inputPosition)) ? (qmlWTFReportAssertionFailure(__FILE__, 1906, __PRETTY_FUNCTION__, "currentCountAlreadyChecked >= static_cast<unsigned>(term.inputPosition)"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
1863 unsigned positiveInputOffset = currentCountAlreadyChecked - static_cast<unsigned>(term.inputPosition);-
1864 unsigned uncheckAmount = 0;-
1865 if (positiveInputOffset > term.parentheses.disjunction->m_minimumSize
positiveInputO...>m_minimumSizeDescription
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
0-8
1866 uncheckAmount = positiveInputOffset - term.parentheses.disjunction->m_minimumSize;-
1867 uncheckInput(uncheckAmount);-
1868 currentCountAlreadyChecked -= uncheckAmount;-
1869 }
never executed: end of block
0
1870-
1871 atomParentheticalAssertionBegin(term.parentheses.subpatternId, term.invert(), term.frameLocation, alternativeFrameLocation);-
1872 emitDisjunction(term.parentheses.disjunction, currentCountAlreadyChecked, positiveInputOffset - uncheckAmount);-
1873 atomParentheticalAssertionEnd(0, term.frameLocation, term.quantityCount, term.quantityType);-
1874 if (uncheckAmount
uncheckAmountDescription
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
0-8
1875 checkInput(uncheckAmount);-
1876 currentCountAlreadyChecked += uncheckAmount;-
1877 }
never executed: end of block
0
1878 break;
executed 8 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
8
1879 }-
1880-
1881 case
never executed: case PatternTerm::TypeDotStarEnclosure:
PatternTerm::TypeDotStarEnclosure:
never executed: case PatternTerm::TypeDotStarEnclosure:
0
1882 assertionDotStarEnclosure(term.anchors.bolAnchor, term.anchors.eolAnchor);-
1883 break;
never executed: break;
0
1884 }-
1885 }
executed 4791 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
4791
1886 }
executed 1904 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
1904
1887 }
executed 1316 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
1316
1888-
1889private:-
1890 YarrPattern& m_pattern;-
1891 OwnPtr<ByteDisjunction> m_bodyDisjunction;-
1892 unsigned m_currentAlternativeIndex;-
1893 Vector<ParenthesesStackEntry> m_parenthesesStack;-
1894 Vector<OwnPtr<ByteDisjunction> > m_allParenthesesInfo;-
1895};-
1896-
1897PassOwnPtr<BytecodePattern> byteCompile(YarrPattern& pattern, BumpPointerAllocator* allocator)-
1898{-
1899 return
executed 208 times by 1 test: return ByteCompiler(pattern).compile(allocator);
Executed by:
  • tst_ecmascripttests
ByteCompiler(pattern).compile(allocator);
executed 208 times by 1 test: return ByteCompiler(pattern).compile(allocator);
Executed by:
  • tst_ecmascripttests
208
1900}-
1901-
1902unsigned interpret(BytecodePattern* bytecode, const String& input, unsigned start, unsigned* output)-
1903{-
1904 if (input.is8Bit()
input.is8Bit()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1905 return
never executed: return Interpreter<LChar>(bytecode, output, input.characters8(), input.length(), start).interpret();
Interpreter<LChar>(bytecode, output, input.characters8(), input.length(), start).interpret();
never executed: return Interpreter<LChar>(bytecode, output, input.characters8(), input.length(), start).interpret();
0
1906 return
never executed: return Interpreter<UChar>(bytecode, output, input.characters16(), input.length(), start).interpret();
Interpreter<UChar>(bytecode, output, input.characters16(), input.length(), start).interpret();
never executed: return Interpreter<UChar>(bytecode, output, input.characters16(), input.length(), start).interpret();
0
1907}-
1908-
1909unsigned interpret(BytecodePattern* bytecode, const LChar* input, unsigned length, unsigned start, unsigned* output)-
1910{-
1911 return
never executed: return Interpreter<LChar>(bytecode, output, input, length, start).interpret();
Interpreter<LChar>(bytecode, output, input, length, start).interpret();
never executed: return Interpreter<LChar>(bytecode, output, input, length, start).interpret();
0
1912}-
1913-
1914unsigned interpret(BytecodePattern* bytecode, const UChar* input, unsigned length, unsigned start, unsigned* output)-
1915{-
1916 return
executed 216 times by 1 test: return Interpreter<UChar>(bytecode, output, input, length, start).interpret();
Executed by:
  • tst_ecmascripttests
Interpreter<UChar>(bytecode, output, input, length, start).interpret();
executed 216 times by 1 test: return Interpreter<UChar>(bytecode, output, input, length, start).interpret();
Executed by:
  • tst_ecmascripttests
216
1917}-
1918-
1919-
1920static_assert((sizeof(Interpreter<UChar>::BackTrackInfoPatternCharacter) == (1 * sizeof(uintptr_t))), "CheckYarrStackSpaceForBackTrackInfoPatternCharacter");-
1921static_assert((sizeof(Interpreter<UChar>::BackTrackInfoCharacterClass) == (1 * sizeof(uintptr_t))), "CheckYarrStackSpaceForBackTrackInfoCharacterClass");-
1922static_assert((sizeof(Interpreter<UChar>::BackTrackInfoBackReference) == (2 * sizeof(uintptr_t))), "CheckYarrStackSpaceForBackTrackInfoBackReference");-
1923static_assert((sizeof(Interpreter<UChar>::BackTrackInfoAlternative) == (1 * sizeof(uintptr_t))), "CheckYarrStackSpaceForBackTrackInfoAlternative");-
1924static_assert((sizeof(Interpreter<UChar>::BackTrackInfoParentheticalAssertion) == (1 * sizeof(uintptr_t))), "CheckYarrStackSpaceForBackTrackInfoParentheticalAssertion");-
1925static_assert((sizeof(Interpreter<UChar>::BackTrackInfoParenthesesOnce) == (1 * sizeof(uintptr_t))), "CheckYarrStackSpaceForBackTrackInfoParenthesesOnce");-
1926static_assert((sizeof(Interpreter<UChar>::BackTrackInfoParentheses) == (2 * sizeof(uintptr_t))), "CheckYarrStackSpaceForBackTrackInfoParentheses");-
1927-
1928-
1929} }-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0