Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Side by Side Diff: runtime/vm/unibrow.cc

Issue 754383002: Revert "Integrate the Irregexp Regular Expression Engine." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/unibrow.h ('k') | runtime/vm/unibrow-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // 4 //
5 // This file was generated at 2014-10-08 15:25:47.940335 (in v8, copied to dart) 5 // This file was generated at 2014-10-08 15:25:47.940335 (in v8, copied to dart)
6 6
7 #include "vm/unibrow-inl.h" 7 #include "vm/unicode-inl.h"
8 #include <stdio.h> 8 #include <stdio.h>
9 #include <stdlib.h> 9 #include <stdlib.h>
10 10
11 namespace unibrow { 11 namespace unibrow {
12 12
13 static const intptr_t kStartBit = (1 << 30); 13 static const int kStartBit = (1 << 30);
14 static const intptr_t kChunkBits = (1 << 13); 14 static const int kChunkBits = (1 << 13);
15 static const int32_t kSentinel = static_cast<int32_t>(-1); 15 static const uchar kSentinel = static_cast<uchar>(-1);
16 16
17 /** 17 /**
18 * \file 18 * \file
19 * Implementations of functions for working with unicode. 19 * Implementations of functions for working with unicode.
20 */ 20 */
21 21
22 // SNIP
23
22 // All access to the character table should go through this function. 24 // All access to the character table should go through this function.
23 template <intptr_t D> 25 template <int D>
24 static inline int32_t TableGet(const int32_t* table, intptr_t index) { 26 static inline uchar TableGet(const int32_t* table, int index) {
25 return table[D * index]; 27 return table[D * index];
26 } 28 }
27 29
28 30
29 static inline int32_t GetEntry(int32_t entry) { 31 static inline uchar GetEntry(int32_t entry) {
30 return entry & (kStartBit - 1); 32 return entry & (kStartBit - 1);
31 } 33 }
32 34
33 35
34 static inline bool IsStart(int32_t entry) { 36 static inline bool IsStart(int32_t entry) {
35 return (entry & kStartBit) != 0; 37 return (entry & kStartBit) != 0;
36 } 38 }
37 39
38 40
39 /** 41 /**
40 * Look up a character in the unicode table using a mix of binary and 42 * Look up a character in the unicode table using a mix of binary and
41 * interpolation search. For a uniformly distributed array 43 * interpolation search. For a uniformly distributed array
42 * interpolation search beats binary search by a wide margin. However, 44 * interpolation search beats binary search by a wide margin. However,
43 * in this case interpolation search degenerates because of some very 45 * in this case interpolation search degenerates because of some very
44 * high values in the lower end of the table so this function uses a 46 * high values in the lower end of the table so this function uses a
45 * combination. The average number of steps to look up the information 47 * combination. The average number of steps to look up the information
46 * about a character is around 10, slightly higher if there is no 48 * about a character is around 10, slightly higher if there is no
47 * information available about the character. 49 * information available about the character.
48 */ 50 */
49 static bool LookupPredicate(const int32_t* table, uint16_t size, int32_t chr) { 51 static bool LookupPredicate(const int32_t* table, uint16_t size, uchar chr) {
50 static const intptr_t kEntryDist = 1; 52 static const int kEntryDist = 1;
51 uint16_t value = chr & (kChunkBits - 1); 53 uint16_t value = chr & (kChunkBits - 1);
52 uint32_t low = 0; 54 unsigned int low = 0;
53 uint32_t high = size - 1; 55 unsigned int high = size - 1;
54 while (high != low) { 56 while (high != low) {
55 uint32_t mid = low + ((high - low) >> 1); 57 unsigned int mid = low + ((high - low) >> 1);
56 int32_t current_value = GetEntry(TableGet<kEntryDist>(table, mid)); 58 uchar current_value = GetEntry(TableGet<kEntryDist>(table, mid));
57 // If we've found an entry less than or equal to this one, and the 59 // If we've found an entry less than or equal to this one, and the
58 // next one is not also less than this one, we've arrived. 60 // next one is not also less than this one, we've arrived.
59 if ((current_value <= value) && 61 if ((current_value <= value) &&
60 (mid + 1 == size || 62 (mid + 1 == size ||
61 GetEntry(TableGet<kEntryDist>(table, mid + 1)) > value)) { 63 GetEntry(TableGet<kEntryDist>(table, mid + 1)) > value)) {
62 low = mid; 64 low = mid;
63 break; 65 break;
64 } else if (current_value < value) { 66 } else if (current_value < value) {
65 low = mid + 1; 67 low = mid + 1;
66 } else if (current_value > value) { 68 } else if (current_value > value) {
67 // If we've just checked the bottom-most value and it's not 69 // If we've just checked the bottom-most value and it's not
68 // the one we're looking for, we're done. 70 // the one we're looking for, we're done.
69 if (mid == 0) break; 71 if (mid == 0) break;
70 high = mid - 1; 72 high = mid - 1;
71 } 73 }
72 } 74 }
73 int32_t field = TableGet<kEntryDist>(table, low); 75 int32_t field = TableGet<kEntryDist>(table, low);
74 int32_t entry = GetEntry(field); 76 uchar entry = GetEntry(field);
75 bool is_start = IsStart(field); 77 bool is_start = IsStart(field);
76 return (entry == value) || (entry < value && is_start); 78 return (entry == value) || (entry < value && is_start);
77 } 79 }
78 80
79 template <intptr_t kW> 81 template <int kW>
80 struct MultiCharacterSpecialCase { 82 struct MultiCharacterSpecialCase {
81 static const int32_t kEndOfEncoding = kSentinel; 83 static const uchar kEndOfEncoding = kSentinel;
82 int32_t chars[kW]; 84 uchar chars[kW];
83 }; 85 };
84 86
85 87
86 // Look up the mapping for the given character in the specified table, 88 // Look up the mapping for the given character in the specified table,
87 // which is of the specified length and uses the specified special case 89 // which is of the specified length and uses the specified special case
88 // mapping for multi-char mappings. The next parameter is the character 90 // mapping for multi-char mappings. The next parameter is the character
89 // following the one to map. The result will be written in to the result 91 // following the one to map. The result will be written in to the result
90 // buffer and the number of characters written will be returned. Finally, 92 // buffer and the number of characters written will be returned. Finally,
91 // if the allow_caching_ptr is non-null then false will be stored in 93 // if the allow_caching_ptr is non-null then false will be stored in
92 // it if the result contains multiple characters or depends on the 94 // it if the result contains multiple characters or depends on the
93 // context. 95 // context.
94 // If ranges are linear, a match between a start and end point is 96 // If ranges are linear, a match between a start and end point is
95 // offset by the distance between the match and the start. Otherwise 97 // offset by the distance between the match and the start. Otherwise
96 // the result is the same as for the start point on the entire range. 98 // the result is the same as for the start point on the entire range.
97 template <bool ranges_are_linear, intptr_t kW> 99 template <bool ranges_are_linear, int kW>
98 static intptr_t LookupMapping(const int32_t* table, 100 static int LookupMapping(const int32_t* table,
99 uint16_t size, 101 uint16_t size,
100 const MultiCharacterSpecialCase<kW>* multi_chars, 102 const MultiCharacterSpecialCase<kW>* multi_chars,
101 int32_t chr, 103 uchar chr,
102 int32_t next, 104 uchar next,
103 int32_t* result, 105 uchar* result,
104 bool* allow_caching_ptr) { 106 bool* allow_caching_ptr) {
105 static const intptr_t kEntryDist = 2; 107 static const int kEntryDist = 2;
106 uint16_t key = chr & (kChunkBits - 1); 108 uint16_t key = chr & (kChunkBits - 1);
107 uint16_t chunk_start = chr - key; 109 uint16_t chunk_start = chr - key;
108 uint32_t low = 0; 110 unsigned int low = 0;
109 uint32_t high = size - 1; 111 unsigned int high = size - 1;
110 while (high != low) { 112 while (high != low) {
111 uint32_t mid = low + ((high - low) >> 1); 113 unsigned int mid = low + ((high - low) >> 1);
112 int32_t current_value = GetEntry(TableGet<kEntryDist>(table, mid)); 114 uchar current_value = GetEntry(TableGet<kEntryDist>(table, mid));
113 // If we've found an entry less than or equal to this one, and the next one 115 // If we've found an entry less than or equal to this one, and the next one
114 // is not also less than this one, we've arrived. 116 // is not also less than this one, we've arrived.
115 if ((current_value <= key) && 117 if ((current_value <= key) &&
116 (mid + 1 == size || 118 (mid + 1 == size ||
117 GetEntry(TableGet<kEntryDist>(table, mid + 1)) > key)) { 119 GetEntry(TableGet<kEntryDist>(table, mid + 1)) > key)) {
118 low = mid; 120 low = mid;
119 break; 121 break;
120 } else if (current_value < key) { 122 } else if (current_value < key) {
121 low = mid + 1; 123 low = mid + 1;
122 } else if (current_value > key) { 124 } else if (current_value > key) {
123 // If we've just checked the bottom-most value and it's not 125 // If we've just checked the bottom-most value and it's not
124 // the one we're looking for, we're done. 126 // the one we're looking for, we're done.
125 if (mid == 0) break; 127 if (mid == 0) break;
126 high = mid - 1; 128 high = mid - 1;
127 } 129 }
128 } 130 }
129 int32_t field = TableGet<kEntryDist>(table, low); 131 int32_t field = TableGet<kEntryDist>(table, low);
130 int32_t entry = GetEntry(field); 132 uchar entry = GetEntry(field);
131 bool is_start = IsStart(field); 133 bool is_start = IsStart(field);
132 bool found = (entry == key) || (entry < key && is_start); 134 bool found = (entry == key) || (entry < key && is_start);
133 if (found) { 135 if (found) {
134 int32_t value = table[2 * low + 1]; 136 int32_t value = table[2 * low + 1];
135 if (value == 0) { 137 if (value == 0) {
136 // 0 means not present 138 // 0 means not present
137 return 0; 139 return 0;
138 } else if ((value & 3) == 0) { 140 } else if ((value & 3) == 0) {
139 // Low bits 0 means a constant offset from the given character. 141 // Low bits 0 means a constant offset from the given character.
140 if (ranges_are_linear) { 142 if (ranges_are_linear) {
141 result[0] = chr + (value >> 2); 143 result[0] = chr + (value >> 2);
142 } else { 144 } else {
143 result[0] = entry + chunk_start + (value >> 2); 145 result[0] = entry + chunk_start + (value >> 2);
144 } 146 }
145 return 1; 147 return 1;
146 } else if ((value & 3) == 1) { 148 } else if ((value & 3) == 1) {
147 // Low bits 1 means a special case mapping 149 // Low bits 1 means a special case mapping
148 if (allow_caching_ptr) *allow_caching_ptr = false; 150 if (allow_caching_ptr) *allow_caching_ptr = false;
149 const MultiCharacterSpecialCase<kW>& mapping = multi_chars[value >> 2]; 151 const MultiCharacterSpecialCase<kW>& mapping = multi_chars[value >> 2];
150 intptr_t length = 0; 152 int length = 0;
151 for (length = 0; length < kW; length++) { 153 for (length = 0; length < kW; length++) {
152 int32_t mapped = mapping.chars[length]; 154 uchar mapped = mapping.chars[length];
153 if (mapped == MultiCharacterSpecialCase<kW>::kEndOfEncoding) break; 155 if (mapped == MultiCharacterSpecialCase<kW>::kEndOfEncoding) break;
154 if (ranges_are_linear) { 156 if (ranges_are_linear) {
155 result[length] = mapped + (key - entry); 157 result[length] = mapped + (key - entry);
156 } else { 158 } else {
157 result[length] = mapped; 159 result[length] = mapped;
158 } 160 }
159 } 161 }
160 return length; 162 return length;
161 } else { 163 } else {
162 // Low bits 2 means a really really special case 164 // Low bits 2 means a really really special case
(...skipping 15 matching lines...) Expand all
178 return 0; 180 return 0;
179 } 181 }
180 return -1; 182 return -1;
181 } 183 }
182 } else { 184 } else {
183 return 0; 185 return 0;
184 } 186 }
185 } 187 }
186 188
187 189
190 uchar Utf8::CalculateValue(const byte* str,
191 unsigned length,
192 unsigned* cursor) {
193 // We only get called for non-ASCII characters.
194 if (length == 1) {
195 *cursor += 1;
196 return kBadChar;
197 }
198 byte first = str[0];
199 byte second = str[1] ^ 0x80;
200 if (second & 0xC0) {
201 *cursor += 1;
202 return kBadChar;
203 }
204 if (first < 0xE0) {
205 if (first < 0xC0) {
206 *cursor += 1;
207 return kBadChar;
208 }
209 uchar code_point = ((first << 6) | second) & kMaxTwoByteChar;
210 if (code_point <= kMaxOneByteChar) {
211 *cursor += 1;
212 return kBadChar;
213 }
214 *cursor += 2;
215 return code_point;
216 }
217 if (length == 2) {
218 *cursor += 1;
219 return kBadChar;
220 }
221 byte third = str[2] ^ 0x80;
222 if (third & 0xC0) {
223 *cursor += 1;
224 return kBadChar;
225 }
226 if (first < 0xF0) {
227 uchar code_point = ((((first << 6) | second) << 6) | third)
228 & kMaxThreeByteChar;
229 if (code_point <= kMaxTwoByteChar) {
230 *cursor += 1;
231 return kBadChar;
232 }
233 *cursor += 3;
234 return code_point;
235 }
236 if (length == 3) {
237 *cursor += 1;
238 return kBadChar;
239 }
240 byte fourth = str[3] ^ 0x80;
241 if (fourth & 0xC0) {
242 *cursor += 1;
243 return kBadChar;
244 }
245 if (first < 0xF8) {
246 uchar code_point = (((((first << 6 | second) << 6) | third) << 6) | fourth)
247 & kMaxFourByteChar;
248 if (code_point <= kMaxThreeByteChar) {
249 *cursor += 1;
250 return kBadChar;
251 }
252 *cursor += 4;
253 return code_point;
254 }
255 *cursor += 1;
256 return kBadChar;
257 }
258
259
260 // Uppercase: point.category == 'Lu'
261
262 static const uint16_t kUppercaseTable0Size = 455;
263 static const int32_t kUppercaseTable0[455] = {
264 1073741889, 90, 1073742016, 214,
265 1073742040, 222, 256, 258, // NOLINT
266 260, 262, 264, 266,
267 268, 270, 272, 274, // NOLINT
268 276, 278, 280, 282,
269 284, 286, 288, 290, // NOLINT
270 292, 294, 296, 298,
271 300, 302, 304, 306, // NOLINT
272 308, 310, 313, 315,
273 317, 319, 321, 323, // NOLINT
274 325, 327, 330, 332,
275 334, 336, 338, 340, // NOLINT
276 342, 344, 346, 348,
277 350, 352, 354, 356, // NOLINT
278 358, 360, 362, 364,
279 366, 368, 370, 372, // NOLINT
280 374, 1073742200, 377, 379,
281 381, 1073742209, 386, 388, // NOLINT
282 1073742214, 391, 1073742217, 395,
283 1073742222, 401, 1073742227, 404, // NOLINT
284 1073742230, 408, 1073742236, 413,
285 1073742239, 416, 418, 420, // NOLINT
286 1073742246, 423, 425, 428,
287 1073742254, 431, 1073742257, 435, // NOLINT
288 437, 1073742263, 440, 444,
289 452, 455, 458, 461, // NOLINT
290 463, 465, 467, 469,
291 471, 473, 475, 478, // NOLINT
292 480, 482, 484, 486,
293 488, 490, 492, 494, // NOLINT
294 497, 500, 1073742326, 504,
295 506, 508, 510, 512, // NOLINT
296 514, 516, 518, 520,
297 522, 524, 526, 528, // NOLINT
298 530, 532, 534, 536,
299 538, 540, 542, 544, // NOLINT
300 546, 548, 550, 552,
301 554, 556, 558, 560, // NOLINT
302 562, 1073742394, 571, 1073742397,
303 574, 577, 1073742403, 582, // NOLINT
304 584, 586, 588, 590,
305 880, 882, 886, 895, // NOLINT
306 902, 1073742728, 906, 908,
307 1073742734, 911, 1073742737, 929, // NOLINT
308 1073742755, 939, 975, 1073742802,
309 980, 984, 986, 988, // NOLINT
310 990, 992, 994, 996,
311 998, 1000, 1002, 1004, // NOLINT
312 1006, 1012, 1015, 1073742841,
313 1018, 1073742845, 1071, 1120, // NOLINT
314 1122, 1124, 1126, 1128,
315 1130, 1132, 1134, 1136, // NOLINT
316 1138, 1140, 1142, 1144,
317 1146, 1148, 1150, 1152, // NOLINT
318 1162, 1164, 1166, 1168,
319 1170, 1172, 1174, 1176, // NOLINT
320 1178, 1180, 1182, 1184,
321 1186, 1188, 1190, 1192, // NOLINT
322 1194, 1196, 1198, 1200,
323 1202, 1204, 1206, 1208, // NOLINT
324 1210, 1212, 1214, 1073743040,
325 1217, 1219, 1221, 1223, // NOLINT
326 1225, 1227, 1229, 1232,
327 1234, 1236, 1238, 1240, // NOLINT
328 1242, 1244, 1246, 1248,
329 1250, 1252, 1254, 1256, // NOLINT
330 1258, 1260, 1262, 1264,
331 1266, 1268, 1270, 1272, // NOLINT
332 1274, 1276, 1278, 1280,
333 1282, 1284, 1286, 1288, // NOLINT
334 1290, 1292, 1294, 1296,
335 1298, 1300, 1302, 1304, // NOLINT
336 1306, 1308, 1310, 1312,
337 1314, 1316, 1318, 1320, // NOLINT
338 1322, 1324, 1326, 1073743153,
339 1366, 1073746080, 4293, 4295, // NOLINT
340 4301, 7680, 7682, 7684,
341 7686, 7688, 7690, 7692, // NOLINT
342 7694, 7696, 7698, 7700,
343 7702, 7704, 7706, 7708, // NOLINT
344 7710, 7712, 7714, 7716,
345 7718, 7720, 7722, 7724, // NOLINT
346 7726, 7728, 7730, 7732,
347 7734, 7736, 7738, 7740, // NOLINT
348 7742, 7744, 7746, 7748,
349 7750, 7752, 7754, 7756, // NOLINT
350 7758, 7760, 7762, 7764,
351 7766, 7768, 7770, 7772, // NOLINT
352 7774, 7776, 7778, 7780,
353 7782, 7784, 7786, 7788, // NOLINT
354 7790, 7792, 7794, 7796,
355 7798, 7800, 7802, 7804, // NOLINT
356 7806, 7808, 7810, 7812,
357 7814, 7816, 7818, 7820, // NOLINT
358 7822, 7824, 7826, 7828,
359 7838, 7840, 7842, 7844, // NOLINT
360 7846, 7848, 7850, 7852,
361 7854, 7856, 7858, 7860, // NOLINT
362 7862, 7864, 7866, 7868,
363 7870, 7872, 7874, 7876, // NOLINT
364 7878, 7880, 7882, 7884,
365 7886, 7888, 7890, 7892, // NOLINT
366 7894, 7896, 7898, 7900,
367 7902, 7904, 7906, 7908, // NOLINT
368 7910, 7912, 7914, 7916,
369 7918, 7920, 7922, 7924, // NOLINT
370 7926, 7928, 7930, 7932,
371 7934, 1073749768, 7951, 1073749784, // NOLINT
372 7965, 1073749800, 7983, 1073749816,
373 7999, 1073749832, 8013, 8025, // NOLINT
374 8027, 8029, 8031, 1073749864,
375 8047, 1073749944, 8123, 1073749960, // NOLINT
376 8139, 1073749976, 8155, 1073749992,
377 8172, 1073750008, 8187}; // NOLINT
378 static const uint16_t kUppercaseTable1Size = 86;
379 static const int32_t kUppercaseTable1[86] = {
380 258, 263, 1073742091, 269, 1073742096, 274, 277, 1073742105, // NOLINT
381 285, 292, 294, 296, 1073742122, 301, 1073742128, 307, // NOLINT
382 1073742142, 319, 325, 387, 1073744896, 3118, 3168, 1073744994, // NOLINT
383 3172, 3175, 3177, 3179, 1073745005, 3184, 3186, 3189, // NOLINT
384 1073745022, 3200, 3202, 3204, 3206, 3208, 3210, 3212, // NOLINT
385 3214, 3216, 3218, 3220, 3222, 3224, 3226, 3228, // NOLINT
386 3230, 3232, 3234, 3236, 3238, 3240, 3242, 3244, // NOLINT
387 3246, 3248, 3250, 3252, 3254, 3256, 3258, 3260, // NOLINT
388 3262, 3264, 3266, 3268, 3270, 3272, 3274, 3276, // NOLINT
389 3278, 3280, 3282, 3284, 3286, 3288, 3290, 3292, // NOLINT
390 3294, 3296, 3298, 3307, 3309, 3314 }; // NOLINT
391 static const uint16_t kUppercaseTable5Size = 101;
392 static const int32_t kUppercaseTable5[101] = {
393 1600, 1602, 1604, 1606, 1608, 1610, 1612, 1614, // NOLINT
394 1616, 1618, 1620, 1622, 1624, 1626, 1628, 1630, // NOLINT
395 1632, 1634, 1636, 1638, 1640, 1642, 1644, 1664, // NOLINT
396 1666, 1668, 1670, 1672, 1674, 1676, 1678, 1680, // NOLINT
397 1682, 1684, 1686, 1688, 1690, 1826, 1828, 1830, // NOLINT
398 1832, 1834, 1836, 1838, 1842, 1844, 1846, 1848, // NOLINT
399 1850, 1852, 1854, 1856, 1858, 1860, 1862, 1864, // NOLINT
400 1866, 1868, 1870, 1872, 1874, 1876, 1878, 1880, // NOLINT
401 1882, 1884, 1886, 1888, 1890, 1892, 1894, 1896, // NOLINT
402 1898, 1900, 1902, 1913, 1915, 1073743741, 1918, 1920, // NOLINT
403 1922, 1924, 1926, 1931, 1933, 1936, 1938, 1942, // NOLINT
404 1944, 1946, 1948, 1950, 1952, 1954, 1956, 1958, // NOLINT
405 1960, 1073743786, 1965, 1073743792, 1969}; // NOLINT
406 static const uint16_t kUppercaseTable7Size = 2;
407 static const int32_t kUppercaseTable7[2] = {
408 1073749793, 7994 }; // NOLINT
409 bool Uppercase::Is(uchar c) {
410 int chunk_index = c >> 13;
411 switch (chunk_index) {
412 case 0: return LookupPredicate(kUppercaseTable0,
413 kUppercaseTable0Size,
414 c);
415 case 1: return LookupPredicate(kUppercaseTable1,
416 kUppercaseTable1Size,
417 c);
418 case 5: return LookupPredicate(kUppercaseTable5,
419 kUppercaseTable5Size,
420 c);
421 case 7: return LookupPredicate(kUppercaseTable7,
422 kUppercaseTable7Size,
423 c);
424 default: return false;
425 }
426 }
427
428
429 // Lowercase: point.category == 'Ll'
430
431 static const uint16_t kLowercaseTable0Size = 467;
432 static const int32_t kLowercaseTable0[467] = {
433 1073741921, 122, 181, 1073742047,
434 246, 1073742072, 255, 257, // NOLINT
435 259, 261, 263, 265,
436 267, 269, 271, 273, // NOLINT
437 275, 277, 279, 281,
438 283, 285, 287, 289, // NOLINT
439 291, 293, 295, 297,
440 299, 301, 303, 305, // NOLINT
441 307, 309, 1073742135, 312,
442 314, 316, 318, 320, // NOLINT
443 322, 324, 326, 1073742152,
444 329, 331, 333, 335, // NOLINT
445 337, 339, 341, 343,
446 345, 347, 349, 351, // NOLINT
447 353, 355, 357, 359,
448 361, 363, 365, 367, // NOLINT
449 369, 371, 373, 375,
450 378, 380, 1073742206, 384, // NOLINT
451 387, 389, 392, 1073742220,
452 397, 402, 405, 1073742233, // NOLINT
453 411, 414, 417, 419,
454 421, 424, 1073742250, 427, // NOLINT
455 429, 432, 436, 438,
456 1073742265, 442, 1073742269, 447, // NOLINT
457 454, 457, 460, 462,
458 464, 466, 468, 470, // NOLINT
459 472, 474, 1073742300, 477,
460 479, 481, 483, 485, // NOLINT
461 487, 489, 491, 493,
462 1073742319, 496, 499, 501, // NOLINT
463 505, 507, 509, 511,
464 513, 515, 517, 519, // NOLINT
465 521, 523, 525, 527,
466 529, 531, 533, 535, // NOLINT
467 537, 539, 541, 543,
468 545, 547, 549, 551, // NOLINT
469 553, 555, 557, 559,
470 561, 1073742387, 569, 572, // NOLINT
471 1073742399, 576, 578, 583,
472 585, 587, 589, 1073742415, // NOLINT
473 659, 1073742485, 687, 881,
474 883, 887, 1073742715, 893, // NOLINT
475 912, 1073742764, 974, 1073742800,
476 977, 1073742805, 983, 985, // NOLINT
477 987, 989, 991, 993,
478 995, 997, 999, 1001, // NOLINT
479 1003, 1005, 1073742831, 1011,
480 1013, 1016, 1073742843, 1020, // NOLINT
481 1073742896, 1119, 1121, 1123,
482 1125, 1127, 1129, 1131, // NOLINT
483 1133, 1135, 1137, 1139,
484 1141, 1143, 1145, 1147, // NOLINT
485 1149, 1151, 1153, 1163,
486 1165, 1167, 1169, 1171, // NOLINT
487 1173, 1175, 1177, 1179,
488 1181, 1183, 1185, 1187, // NOLINT
489 1189, 1191, 1193, 1195,
490 1197, 1199, 1201, 1203, // NOLINT
491 1205, 1207, 1209, 1211,
492 1213, 1215, 1218, 1220, // NOLINT
493 1222, 1224, 1226, 1228,
494 1073743054, 1231, 1233, 1235, // NOLINT
495 1237, 1239, 1241, 1243,
496 1245, 1247, 1249, 1251, // NOLINT
497 1253, 1255, 1257, 1259,
498 1261, 1263, 1265, 1267, // NOLINT
499 1269, 1271, 1273, 1275,
500 1277, 1279, 1281, 1283, // NOLINT
501 1285, 1287, 1289, 1291,
502 1293, 1295, 1297, 1299, // NOLINT
503 1301, 1303, 1305, 1307,
504 1309, 1311, 1313, 1315, // NOLINT
505 1317, 1319, 1321, 1323,
506 1325, 1327, 1073743201, 1415, // NOLINT
507 1073749248, 7467, 1073749355, 7543,
508 1073749369, 7578, 7681, 7683, // NOLINT
509 7685, 7687, 7689, 7691,
510 7693, 7695, 7697, 7699, // NOLINT
511 7701, 7703, 7705, 7707,
512 7709, 7711, 7713, 7715, // NOLINT
513 7717, 7719, 7721, 7723,
514 7725, 7727, 7729, 7731, // NOLINT
515 7733, 7735, 7737, 7739,
516 7741, 7743, 7745, 7747, // NOLINT
517 7749, 7751, 7753, 7755,
518 7757, 7759, 7761, 7763, // NOLINT
519 7765, 7767, 7769, 7771,
520 7773, 7775, 7777, 7779, // NOLINT
521 7781, 7783, 7785, 7787,
522 7789, 7791, 7793, 7795, // NOLINT
523 7797, 7799, 7801, 7803,
524 7805, 7807, 7809, 7811, // NOLINT
525 7813, 7815, 7817, 7819,
526 7821, 7823, 7825, 7827, // NOLINT
527 1073749653, 7837, 7839, 7841,
528 7843, 7845, 7847, 7849, // NOLINT
529 7851, 7853, 7855, 7857,
530 7859, 7861, 7863, 7865, // NOLINT
531 7867, 7869, 7871, 7873,
532 7875, 7877, 7879, 7881, // NOLINT
533 7883, 7885, 7887, 7889,
534 7891, 7893, 7895, 7897, // NOLINT
535 7899, 7901, 7903, 7905,
536 7907, 7909, 7911, 7913, // NOLINT
537 7915, 7917, 7919, 7921,
538 7923, 7925, 7927, 7929, // NOLINT
539 7931, 7933, 1073749759, 7943,
540 1073749776, 7957, 1073749792, 7975, // NOLINT
541 1073749808, 7991, 1073749824, 8005,
542 1073749840, 8023, 1073749856, 8039, // NOLINT
543 1073749872, 8061, 1073749888, 8071,
544 1073749904, 8087, 1073749920, 8103, // NOLINT
545 1073749936, 8116, 1073749942, 8119,
546 8126, 1073749954, 8132, 1073749958, // NOLINT
547 8135, 1073749968, 8147, 1073749974,
548 8151, 1073749984, 8167, 1073750002, // NOLINT
549 8180, 1073750006, 8183}; // NOLINT
550 static const uint16_t kLowercaseTable1Size = 84;
551 static const int32_t kLowercaseTable1[84] = {
552 266, 1073742094, 271, 275, 303, 308, 313, 1073742140, // NOLINT
553 317, 1073742150, 329, 334, 388, 1073744944, 3166, 3169, // NOLINT
554 1073744997, 3174, 3176, 3178, 3180, 3185, 1073745011, 3188, // NOLINT
555 1073745014, 3195, 3201, 3203, 3205, 3207, 3209, 3211, // NOLINT
556 3213, 3215, 3217, 3219, 3221, 3223, 3225, 3227, // NOLINT
557 3229, 3231, 3233, 3235, 3237, 3239, 3241, 3243, // NOLINT
558 3245, 3247, 3249, 3251, 3253, 3255, 3257, 3259, // NOLINT
559 3261, 3263, 3265, 3267, 3269, 3271, 3273, 3275, // NOLINT
560 3277, 3279, 3281, 3283, 3285, 3287, 3289, 3291, // NOLINT
561 3293, 3295, 3297, 1073745123, 3300, 3308, 3310, 3315, // NOLINT
562 1073745152, 3365, 3367, 3373 }; // NOLINT
563 static const uint16_t kLowercaseTable5Size = 105;
564 static const int32_t kLowercaseTable5[105] = {
565 1601, 1603, 1605, 1607,
566 1609, 1611, 1613, 1615, // NOLINT
567 1617, 1619, 1621, 1623,
568 1625, 1627, 1629, 1631, // NOLINT
569 1633, 1635, 1637, 1639,
570 1641, 1643, 1645, 1665, // NOLINT
571 1667, 1669, 1671, 1673,
572 1675, 1677, 1679, 1681, // NOLINT
573 1683, 1685, 1687, 1689,
574 1691, 1827, 1829, 1831, // NOLINT
575 1833, 1835, 1837, 1073743663,
576 1841, 1843, 1845, 1847, // NOLINT
577 1849, 1851, 1853, 1855,
578 1857, 1859, 1861, 1863, // NOLINT
579 1865, 1867, 1869, 1871,
580 1873, 1875, 1877, 1879, // NOLINT
581 1881, 1883, 1885, 1887,
582 1889, 1891, 1893, 1895, // NOLINT
583 1897, 1899, 1901, 1903,
584 1073743729, 1912, 1914, 1916, // NOLINT
585 1919, 1921, 1923, 1925,
586 1927, 1932, 1934, 1937, // NOLINT
587 1073743763, 1941, 1943, 1945,
588 1947, 1949, 1951, 1953, // NOLINT
589 1955, 1957, 1959, 1961,
590 2042, 1073744688, 2906, 1073744740, // NOLINT
591 2917}; // NOLINT
592 static const uint16_t kLowercaseTable7Size = 6;
593 static const int32_t kLowercaseTable7[6] = {
594 1073748736, 6918, 1073748755, 6935, 1073749825, 8026 }; // NOLINT
595 bool Lowercase::Is(uchar c) {
596 int chunk_index = c >> 13;
597 switch (chunk_index) {
598 case 0: return LookupPredicate(kLowercaseTable0,
599 kLowercaseTable0Size,
600 c);
601 case 1: return LookupPredicate(kLowercaseTable1,
602 kLowercaseTable1Size,
603 c);
604 case 5: return LookupPredicate(kLowercaseTable5,
605 kLowercaseTable5Size,
606 c);
607 case 7: return LookupPredicate(kLowercaseTable7,
608 kLowercaseTable7Size,
609 c);
610 default: return false;
611 }
612 }
613
614
188 // Letter: point.category in ['Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl'] 615 // Letter: point.category in ['Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl']
189 616
190 static const uint16_t kLetterTable0Size = 431; 617 static const uint16_t kLetterTable0Size = 431;
191 static const int32_t kLetterTable0[431] = { 618 static const int32_t kLetterTable0[431] = {
192 1073741889, 90, 1073741921, 122, 619 1073741889, 90, 1073741921, 122,
193 170, 181, 186, 1073742016, // NOLINT 620 170, 181, 186, 1073742016, // NOLINT
194 214, 1073742040, 246, 1073742072, 621 214, 1073742040, 246, 1073742072,
195 705, 1073742534, 721, 1073742560, // NOLINT 622 705, 1073742534, 721, 1073742560, // NOLINT
196 740, 748, 750, 1073742704, 623 740, 748, 750, 1073742704,
197 884, 1073742710, 887, 1073742714, // NOLINT 624 884, 1073742710, 887, 1073742714, // NOLINT
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 static const int32_t kLetterTable6[6] = { 777 static const int32_t kLetterTable6[6] = {
351 1073741824, 6051, 1073747888, 6086, 1073747915, 6139 }; // NOLINT 778 1073741824, 6051, 1073747888, 6086, 1073747915, 6139 }; // NOLINT
352 static const uint16_t kLetterTable7Size = 48; 779 static const uint16_t kLetterTable7Size = 48;
353 static const int32_t kLetterTable7[48] = { 780 static const int32_t kLetterTable7[48] = {
354 1073748224, 6765, 1073748592, 6873, 1073748736, 6918, 1073748755, 6935, // NO LINT 781 1073748224, 6765, 1073748592, 6873, 1073748736, 6918, 1073748755, 6935, // NO LINT
355 6941, 1073748767, 6952, 1073748778, 6966, 1073748792, 6972, 6974, // NOLINT 782 6941, 1073748767, 6952, 1073748778, 6966, 1073748792, 6972, 6974, // NOLINT
356 1073748800, 6977, 1073748803, 6980, 1073748806, 7089, 1073748947, 7485, // NO LINT 783 1073748800, 6977, 1073748803, 6980, 1073748806, 7089, 1073748947, 7485, // NO LINT
357 1073749328, 7567, 1073749394, 7623, 1073749488, 7675, 1073749616, 7796, // NO LINT 784 1073749328, 7567, 1073749394, 7623, 1073749488, 7675, 1073749616, 7796, // NO LINT
358 1073749622, 7932, 1073749793, 7994, 1073749825, 8026, 1073749862, 8126, // NO LINT 785 1073749622, 7932, 1073749793, 7994, 1073749825, 8026, 1073749862, 8126, // NO LINT
359 1073749954, 8135, 1073749962, 8143, 1073749970, 8151, 1073749978, 8156 }; // NOLINT 786 1073749954, 8135, 1073749962, 8143, 1073749970, 8151, 1073749978, 8156 }; // NOLINT
360 bool Letter::Is(int32_t c) { 787 bool Letter::Is(uchar c) {
361 intptr_t chunk_index = c >> 13; 788 int chunk_index = c >> 13;
362 switch (chunk_index) { 789 switch (chunk_index) {
363 case 0: return LookupPredicate(kLetterTable0, 790 case 0: return LookupPredicate(kLetterTable0,
364 kLetterTable0Size, 791 kLetterTable0Size,
365 c); 792 c);
366 case 1: return LookupPredicate(kLetterTable1, 793 case 1: return LookupPredicate(kLetterTable1,
367 kLetterTable1Size, 794 kLetterTable1Size,
368 c); 795 c);
369 case 2: return LookupPredicate(kLetterTable2, 796 case 2: return LookupPredicate(kLetterTable2,
370 kLetterTable2Size, 797 kLetterTable2Size,
371 c); 798 c);
(...skipping 10 matching lines...) Expand all
382 kLetterTable6Size, 809 kLetterTable6Size,
383 c); 810 c);
384 case 7: return LookupPredicate(kLetterTable7, 811 case 7: return LookupPredicate(kLetterTable7,
385 kLetterTable7Size, 812 kLetterTable7Size,
386 c); 813 c);
387 default: return false; 814 default: return false;
388 } 815 }
389 } 816 }
390 817
391 818
819 // ID_Start: ((point.category in ['Lu', 'Ll', 'Lt', 'Lm', 'Lo',
820 // 'Nl'] or 'Other_ID_Start' in point.properties) and ('Pattern_Syntax' not in
821 // point.properties) and ('Pattern_White_Space' not in point.properties)) or
822 // ('JS_ID_Start' in point.properties)
823
824 static const uint16_t kID_StartTable0Size = 434;
825 static const int32_t kID_StartTable0[434] = {
826 36, 1073741889, 90, 92,
827 95, 1073741921, 122, 170, // NOLINT
828 181, 186, 1073742016, 214,
829 1073742040, 246, 1073742072, 705, // NOLINT
830 1073742534, 721, 1073742560, 740,
831 748, 750, 1073742704, 884, // NOLINT
832 1073742710, 887, 1073742714, 893,
833 895, 902, 1073742728, 906, // NOLINT
834 908, 1073742734, 929, 1073742755,
835 1013, 1073742839, 1153, 1073742986, // NOLINT
836 1327, 1073743153, 1366, 1369,
837 1073743201, 1415, 1073743312, 1514, // NOLINT
838 1073743344, 1522, 1073743392, 1610,
839 1073743470, 1647, 1073743473, 1747, // NOLINT
840 1749, 1073743589, 1766, 1073743598,
841 1775, 1073743610, 1788, 1791, // NOLINT
842 1808, 1073743634, 1839, 1073743693,
843 1957, 1969, 1073743818, 2026, // NOLINT
844 1073743860, 2037, 2042, 1073743872,
845 2069, 2074, 2084, 2088, // NOLINT
846 1073743936, 2136, 1073744032, 2226,
847 1073744132, 2361, 2365, 2384, // NOLINT
848 1073744216, 2401, 1073744241, 2432,
849 1073744261, 2444, 1073744271, 2448, // NOLINT
850 1073744275, 2472, 1073744298, 2480,
851 2482, 1073744310, 2489, 2493, // NOLINT
852 2510, 1073744348, 2525, 1073744351,
853 2529, 1073744368, 2545, 1073744389, // NOLINT
854 2570, 1073744399, 2576, 1073744403,
855 2600, 1073744426, 2608, 1073744434, // NOLINT
856 2611, 1073744437, 2614, 1073744440,
857 2617, 1073744473, 2652, 2654, // NOLINT
858 1073744498, 2676, 1073744517, 2701,
859 1073744527, 2705, 1073744531, 2728, // NOLINT
860 1073744554, 2736, 1073744562, 2739,
861 1073744565, 2745, 2749, 2768, // NOLINT
862 1073744608, 2785, 1073744645, 2828,
863 1073744655, 2832, 1073744659, 2856, // NOLINT
864 1073744682, 2864, 1073744690, 2867,
865 1073744693, 2873, 2877, 1073744732, // NOLINT
866 2909, 1073744735, 2913, 2929,
867 2947, 1073744773, 2954, 1073744782, // NOLINT
868 2960, 1073744786, 2965, 1073744793,
869 2970, 2972, 1073744798, 2975, // NOLINT
870 1073744803, 2980, 1073744808, 2986,
871 1073744814, 3001, 3024, 1073744901, // NOLINT
872 3084, 1073744910, 3088, 1073744914,
873 3112, 1073744938, 3129, 3133, // NOLINT
874 1073744984, 3161, 1073744992, 3169,
875 1073745029, 3212, 1073745038, 3216, // NOLINT
876 1073745042, 3240, 1073745066, 3251,
877 1073745077, 3257, 3261, 3294, // NOLINT
878 1073745120, 3297, 1073745137, 3314,
879 1073745157, 3340, 1073745166, 3344, // NOLINT
880 1073745170, 3386, 3389, 3406,
881 1073745248, 3425, 1073745274, 3455, // NOLINT
882 1073745285, 3478, 1073745306, 3505,
883 1073745331, 3515, 3517, 1073745344, // NOLINT
884 3526, 1073745409, 3632, 1073745458,
885 3635, 1073745472, 3654, 1073745537, // NOLINT
886 3714, 3716, 1073745543, 3720,
887 3722, 3725, 1073745556, 3735, // NOLINT
888 1073745561, 3743, 1073745569, 3747,
889 3749, 3751, 1073745578, 3755, // NOLINT
890 1073745581, 3760, 1073745586, 3763,
891 3773, 1073745600, 3780, 3782, // NOLINT
892 1073745628, 3807, 3840, 1073745728,
893 3911, 1073745737, 3948, 1073745800, // NOLINT
894 3980, 1073745920, 4138, 4159,
895 1073746000, 4181, 1073746010, 4189, // NOLINT
896 4193, 1073746021, 4198, 1073746030,
897 4208, 1073746037, 4225, 4238, // NOLINT
898 1073746080, 4293, 4295, 4301,
899 1073746128, 4346, 1073746172, 4680, // NOLINT
900 1073746506, 4685, 1073746512, 4694,
901 4696, 1073746522, 4701, 1073746528, // NOLINT
902 4744, 1073746570, 4749, 1073746576,
903 4784, 1073746610, 4789, 1073746616, // NOLINT
904 4798, 4800, 1073746626, 4805,
905 1073746632, 4822, 1073746648, 4880, // NOLINT
906 1073746706, 4885, 1073746712, 4954,
907 1073746816, 5007, 1073746848, 5108, // NOLINT
908 1073746945, 5740, 1073747567, 5759,
909 1073747585, 5786, 1073747616, 5866, // NOLINT
910 1073747694, 5880, 1073747712, 5900,
911 1073747726, 5905, 1073747744, 5937, // NOLINT
912 1073747776, 5969, 1073747808, 5996,
913 1073747822, 6000, 1073747840, 6067, // NOLINT
914 6103, 6108, 1073748000, 6263,
915 1073748096, 6312, 6314, 1073748144, // NOLINT
916 6389, 1073748224, 6430, 1073748304,
917 6509, 1073748336, 6516, 1073748352, // NOLINT
918 6571, 1073748417, 6599, 1073748480,
919 6678, 1073748512, 6740, 6823, // NOLINT
920 1073748741, 6963, 1073748805, 6987,
921 1073748867, 7072, 1073748910, 7087, // NOLINT
922 1073748922, 7141, 1073748992, 7203,
923 1073749069, 7247, 1073749082, 7293, // NOLINT
924 1073749225, 7404, 1073749230, 7409,
925 1073749237, 7414, 1073749248, 7615, // NOLINT
926 1073749504, 7957, 1073749784, 7965,
927 1073749792, 8005, 1073749832, 8013, // NOLINT
928 1073749840, 8023, 8025, 8027,
929 8029, 1073749855, 8061, 1073749888, // NOLINT
930 8116, 1073749942, 8124, 8126,
931 1073749954, 8132, 1073749958, 8140, // NOLINT
932 1073749968, 8147, 1073749974, 8155,
933 1073749984, 8172, 1073750002, 8180, // NOLINT
934 1073750006, 8188}; // NOLINT
935 static const uint16_t kID_StartTable1Size = 84;
936 static const int32_t kID_StartTable1[84] = {
937 113, 127, 1073741968, 156,
938 258, 263, 1073742090, 275, // NOLINT
939 277, 1073742104, 285, 292,
940 294, 296, 1073742122, 313, // NOLINT
941 1073742140, 319, 1073742149, 329,
942 334, 1073742176, 392, 1073744896, // NOLINT
943 3118, 1073744944, 3166, 1073744992,
944 3300, 1073745131, 3310, 1073745138, // NOLINT
945 3315, 1073745152, 3365, 3367,
946 3373, 1073745200, 3431, 3439, // NOLINT
947 1073745280, 3478, 1073745312, 3494,
948 1073745320, 3502, 1073745328, 3510, // NOLINT
949 1073745336, 3518, 1073745344, 3526,
950 1073745352, 3534, 1073745360, 3542, // NOLINT
951 1073745368, 3550, 1073745925, 4103,
952 1073745953, 4137, 1073745969, 4149, // NOLINT
953 1073745976, 4156, 1073745985, 4246,
954 1073746075, 4255, 1073746081, 4346, // NOLINT
955 1073746172, 4351, 1073746181, 4397,
956 1073746225, 4494, 1073746336, 4538, // NOLINT
957 1073746416, 4607, 1073746944, 8191}; // NOLINT
958 static const uint16_t kID_StartTable2Size = 4;
959 static const int32_t kID_StartTable2[4] = {1073741824, 3509, 1073745408,
960 8191}; // NOLINT
961 static const uint16_t kID_StartTable3Size = 2;
962 static const int32_t kID_StartTable3[2] = {1073741824, 8191}; // NOLINT
963 static const uint16_t kID_StartTable4Size = 2;
964 static const int32_t kID_StartTable4[2] = {1073741824, 8140}; // NOLINT
965 static const uint16_t kID_StartTable5Size = 100;
966 static const int32_t kID_StartTable5[100] = {
967 1073741824, 1164, 1073743056, 1277,
968 1073743104, 1548, 1073743376, 1567, // NOLINT
969 1073743402, 1579, 1073743424, 1646,
970 1073743487, 1693, 1073743520, 1775, // NOLINT
971 1073743639, 1823, 1073743650, 1928,
972 1073743755, 1934, 1073743760, 1965, // NOLINT
973 1073743792, 1969, 1073743863, 2049,
974 1073743875, 2053, 1073743879, 2058, // NOLINT
975 1073743884, 2082, 1073743936, 2163,
976 1073744002, 2227, 1073744114, 2295, // NOLINT
977 2299, 1073744138, 2341, 1073744176,
978 2374, 1073744224, 2428, 1073744260, // NOLINT
979 2482, 2511, 1073744352, 2532,
980 1073744358, 2543, 1073744378, 2558, // NOLINT
981 1073744384, 2600, 1073744448, 2626,
982 1073744452, 2635, 1073744480, 2678, // NOLINT
983 2682, 1073744510, 2735, 2737,
984 1073744565, 2742, 1073744569, 2749, // NOLINT
985 2752, 2754, 1073744603, 2781,
986 1073744608, 2794, 1073744626, 2804, // NOLINT
987 1073744641, 2822, 1073744649, 2830,
988 1073744657, 2838, 1073744672, 2854, // NOLINT
989 1073744680, 2862, 1073744688, 2906,
990 1073744732, 2911, 1073744740, 2917, // NOLINT
991 1073744832, 3042, 1073744896, 8191}; // NOLINT
992 static const uint16_t kID_StartTable6Size = 6;
993 static const int32_t kID_StartTable6[6] = {1073741824, 6051, 1073747888, 6086,
994 1073747915, 6139}; // NOLINT
995 static const uint16_t kID_StartTable7Size = 48;
996 static const int32_t kID_StartTable7[48] = {
997 1073748224, 6765, 1073748592, 6873,
998 1073748736, 6918, 1073748755, 6935, // NOLINT
999 6941, 1073748767, 6952, 1073748778,
1000 6966, 1073748792, 6972, 6974, // NOLINT
1001 1073748800, 6977, 1073748803, 6980,
1002 1073748806, 7089, 1073748947, 7485, // NOLINT
1003 1073749328, 7567, 1073749394, 7623,
1004 1073749488, 7675, 1073749616, 7796, // NOLINT
1005 1073749622, 7932, 1073749793, 7994,
1006 1073749825, 8026, 1073749862, 8126, // NOLINT
1007 1073749954, 8135, 1073749962, 8143,
1008 1073749970, 8151, 1073749978, 8156}; // NOLINT
1009 bool ID_Start::Is(uchar c) {
1010 int chunk_index = c >> 13;
1011 switch (chunk_index) {
1012 case 0:
1013 return LookupPredicate(kID_StartTable0, kID_StartTable0Size, c);
1014 case 1:
1015 return LookupPredicate(kID_StartTable1, kID_StartTable1Size, c);
1016 case 2:
1017 return LookupPredicate(kID_StartTable2, kID_StartTable2Size, c);
1018 case 3:
1019 return LookupPredicate(kID_StartTable3, kID_StartTable3Size, c);
1020 case 4:
1021 return LookupPredicate(kID_StartTable4, kID_StartTable4Size, c);
1022 case 5:
1023 return LookupPredicate(kID_StartTable5, kID_StartTable5Size, c);
1024 case 6:
1025 return LookupPredicate(kID_StartTable6, kID_StartTable6Size, c);
1026 case 7:
1027 return LookupPredicate(kID_StartTable7, kID_StartTable7Size, c);
1028 default:
1029 return false;
1030 }
1031 }
1032
1033
1034 // ID_Continue: point.category in ['Nd', 'Mn', 'Mc', 'Pc'] or
1035 // 'Other_ID_Continue' in point.properties or 'JS_ID_Continue' in
1036 // point.properties
1037
1038 static const uint16_t kID_ContinueTable0Size = 315;
1039 static const int32_t kID_ContinueTable0[315] = {
1040 1073741872, 57, 95, 183,
1041 1073742592, 879, 903, 1073742979, // NOLINT
1042 1159, 1073743249, 1469, 1471,
1043 1073743297, 1474, 1073743300, 1477, // NOLINT
1044 1479, 1073743376, 1562, 1073743435,
1045 1641, 1648, 1073743574, 1756, // NOLINT
1046 1073743583, 1764, 1073743591, 1768,
1047 1073743594, 1773, 1073743600, 1785, // NOLINT
1048 1809, 1073743664, 1866, 1073743782,
1049 1968, 1073743808, 1993, 1073743851, // NOLINT
1050 2035, 1073743894, 2073, 1073743899,
1051 2083, 1073743909, 2087, 1073743913, // NOLINT
1052 2093, 1073743961, 2139, 1073744100,
1053 2307, 1073744186, 2364, 1073744190, // NOLINT
1054 2383, 1073744209, 2391, 1073744226,
1055 2403, 1073744230, 2415, 1073744257, // NOLINT
1056 2435, 2492, 1073744318, 2500,
1057 1073744327, 2504, 1073744331, 2509, // NOLINT
1058 2519, 1073744354, 2531, 1073744358,
1059 2543, 1073744385, 2563, 2620, // NOLINT
1060 1073744446, 2626, 1073744455, 2632,
1061 1073744459, 2637, 2641, 1073744486, // NOLINT
1062 2673, 2677, 1073744513, 2691,
1063 2748, 1073744574, 2757, 1073744583, // NOLINT
1064 2761, 1073744587, 2765, 1073744610,
1065 2787, 1073744614, 2799, 1073744641, // NOLINT
1066 2819, 2876, 1073744702, 2884,
1067 1073744711, 2888, 1073744715, 2893, // NOLINT
1068 1073744726, 2903, 1073744738, 2915,
1069 1073744742, 2927, 2946, 1073744830, // NOLINT
1070 3010, 1073744838, 3016, 1073744842,
1071 3021, 3031, 1073744870, 3055, // NOLINT
1072 1073744896, 3075, 1073744958, 3140,
1073 1073744966, 3144, 1073744970, 3149, // NOLINT
1074 1073744981, 3158, 1073744994, 3171,
1075 1073744998, 3183, 1073745025, 3203, // NOLINT
1076 3260, 1073745086, 3268, 1073745094,
1077 3272, 1073745098, 3277, 1073745109, // NOLINT
1078 3286, 1073745122, 3299, 1073745126,
1079 3311, 1073745153, 3331, 1073745214, // NOLINT
1080 3396, 1073745222, 3400, 1073745226,
1081 3405, 3415, 1073745250, 3427, // NOLINT
1082 1073745254, 3439, 1073745282, 3459,
1083 3530, 1073745359, 3540, 3542, // NOLINT
1084 1073745368, 3551, 1073745382, 3567,
1085 1073745394, 3571, 3633, 1073745460, // NOLINT
1086 3642, 1073745479, 3662, 1073745488,
1087 3673, 3761, 1073745588, 3769, // NOLINT
1088 1073745595, 3772, 1073745608, 3789,
1089 1073745616, 3801, 1073745688, 3865, // NOLINT
1090 1073745696, 3881, 3893, 3895,
1091 3897, 1073745726, 3903, 1073745777, // NOLINT
1092 3972, 1073745798, 3975, 1073745805,
1093 3991, 1073745817, 4028, 4038, // NOLINT
1094 1073745963, 4158, 1073745984, 4169,
1095 1073746006, 4185, 1073746014, 4192, // NOLINT
1096 1073746018, 4196, 1073746023, 4205,
1097 1073746033, 4212, 1073746050, 4237, // NOLINT
1098 1073746063, 4253, 1073746781, 4959,
1099 1073746793, 4977, 1073747730, 5908, // NOLINT
1100 1073747762, 5940, 1073747794, 5971,
1101 1073747826, 6003, 1073747892, 6099, // NOLINT
1102 6109, 1073747936, 6121, 1073747979,
1103 6157, 1073747984, 6169, 6313, // NOLINT
1104 1073748256, 6443, 1073748272, 6459,
1105 1073748294, 6479, 1073748400, 6592, // NOLINT
1106 1073748424, 6601, 1073748432, 6618,
1107 1073748503, 6683, 1073748565, 6750, // NOLINT
1108 1073748576, 6780, 1073748607, 6793,
1109 1073748624, 6809, 1073748656, 6845, // NOLINT
1110 1073748736, 6916, 1073748788, 6980,
1111 1073748816, 7001, 1073748843, 7027, // NOLINT
1112 1073748864, 7042, 1073748897, 7085,
1113 1073748912, 7097, 1073748966, 7155, // NOLINT
1114 1073749028, 7223, 1073749056, 7241,
1115 1073749072, 7257, 1073749200, 7378, // NOLINT
1116 1073749204, 7400, 7405, 1073749234,
1117 7412, 1073749240, 7417, 1073749440, // NOLINT
1118 7669, 1073749500, 7679}; // NOLINT
1119 static const uint16_t kID_ContinueTable1Size = 19;
1120 static const int32_t kID_ContinueTable1[19] = {
1121 1073741836, 13, 1073741887, 64,
1122 84, 1073742032, 220, 225, // NOLINT
1123 1073742053, 240, 1073745135, 3313,
1124 3455, 1073745376, 3583, 1073745962, // NOLINT
1125 4143, 1073746073, 4250}; // NOLINT
1126 static const uint16_t kID_ContinueTable5Size = 63;
1127 static const int32_t kID_ContinueTable5[63] = {
1128 1073743392, 1577, 1647, 1073743476,
1129 1661, 1695, 1073743600, 1777, // NOLINT
1130 2050, 2054, 2059, 1073743907,
1131 2087, 1073744000, 2177, 1073744052, // NOLINT
1132 2244, 1073744080, 2265, 1073744096,
1133 2289, 1073744128, 2313, 1073744166, // NOLINT
1134 2349, 1073744199, 2387, 1073744256,
1135 2435, 1073744307, 2496, 1073744336, // NOLINT
1136 2521, 2533, 1073744368, 2553,
1137 1073744425, 2614, 2627, 1073744460, // NOLINT
1138 2637, 1073744464, 2649, 1073744507,
1139 2685, 2736, 1073744562, 2740, // NOLINT
1140 1073744567, 2744, 1073744574, 2751,
1141 2753, 1073744619, 2799, 1073744629, // NOLINT
1142 2806, 1073744867, 3050, 1073744876,
1143 3053, 1073744880, 3065}; // NOLINT
1144 static const uint16_t kID_ContinueTable7Size = 12;
1145 static const int32_t kID_ContinueTable7[12] = {
1146 6942, 1073749504, 7695, 1073749536,
1147 7725, 1073749555, 7732, 1073749581, // NOLINT
1148 7759, 1073749776, 7961, 7999}; // NOLINT
1149 bool ID_Continue::Is(uchar c) {
1150 int chunk_index = c >> 13;
1151 switch (chunk_index) {
1152 case 0:
1153 return LookupPredicate(kID_ContinueTable0, kID_ContinueTable0Size, c);
1154 case 1:
1155 return LookupPredicate(kID_ContinueTable1, kID_ContinueTable1Size, c);
1156 case 5:
1157 return LookupPredicate(kID_ContinueTable5, kID_ContinueTable5Size, c);
1158 case 7:
1159 return LookupPredicate(kID_ContinueTable7, kID_ContinueTable7Size, c);
1160 default: return false;
1161 }
1162 }
1163
1164
1165 // WhiteSpace: (point.category == 'Zs') or ('JS_White_Space' in
1166 // point.properties)
1167
1168 static const uint16_t kWhiteSpaceTable0Size = 7;
1169 static const int32_t kWhiteSpaceTable0[7] = {9, 1073741835, 12, 32,
1170 160, 5760, 6158}; // NOLINT
1171 static const uint16_t kWhiteSpaceTable1Size = 5;
1172 static const int32_t kWhiteSpaceTable1[5] = {
1173 1073741824, 10, 47, 95, 4096 }; // NOLINT
1174 static const uint16_t kWhiteSpaceTable7Size = 1;
1175 static const int32_t kWhiteSpaceTable7[1] = {7935}; // NOLINT
1176 bool WhiteSpace::Is(uchar c) {
1177 int chunk_index = c >> 13;
1178 switch (chunk_index) {
1179 case 0: return LookupPredicate(kWhiteSpaceTable0,
1180 kWhiteSpaceTable0Size,
1181 c);
1182 case 1: return LookupPredicate(kWhiteSpaceTable1,
1183 kWhiteSpaceTable1Size,
1184 c);
1185 case 7:
1186 return LookupPredicate(kWhiteSpaceTable7, kWhiteSpaceTable7Size, c);
1187 default: return false;
1188 }
1189 }
1190
1191
1192 // LineTerminator: 'JS_Line_Terminator' in point.properties
1193
1194 static const uint16_t kLineTerminatorTable0Size = 2;
1195 static const int32_t kLineTerminatorTable0[2] = {
1196 10, 13 }; // NOLINT
1197 static const uint16_t kLineTerminatorTable1Size = 2;
1198 static const int32_t kLineTerminatorTable1[2] = {
1199 1073741864, 41 }; // NOLINT
1200 bool LineTerminator::Is(uchar c) {
1201 int chunk_index = c >> 13;
1202 switch (chunk_index) {
1203 case 0: return LookupPredicate(kLineTerminatorTable0,
1204 kLineTerminatorTable0Size,
1205 c);
1206 case 1: return LookupPredicate(kLineTerminatorTable1,
1207 kLineTerminatorTable1Size,
1208 c);
1209 default: return false;
1210 }
1211 }
1212
1213 static const MultiCharacterSpecialCase<2> kToLowercaseMultiStrings0[2] = { // N OLINT
1214 {{105, 775}}, {{kSentinel}} }; // NOLINT
1215 static const uint16_t kToLowercaseTable0Size = 488; // NOLINT
1216 static const int32_t kToLowercaseTable0[976] = {
1217 1073741889, 128, 90, 128, 1073742016, 128,
1218 214, 128, 1073742040, 128, 222, 128,
1219 256, 4, 258, 4, // NOLINT
1220 260, 4, 262, 4, 264, 4,
1221 266, 4, 268, 4, 270, 4,
1222 272, 4, 274, 4, // NOLINT
1223 276, 4, 278, 4, 280, 4,
1224 282, 4, 284, 4, 286, 4,
1225 288, 4, 290, 4, // NOLINT
1226 292, 4, 294, 4, 296, 4,
1227 298, 4, 300, 4, 302, 4,
1228 304, 1, 306, 4, // NOLINT
1229 308, 4, 310, 4, 313, 4,
1230 315, 4, 317, 4, 319, 4,
1231 321, 4, 323, 4, // NOLINT
1232 325, 4, 327, 4, 330, 4,
1233 332, 4, 334, 4, 336, 4,
1234 338, 4, 340, 4, // NOLINT
1235 342, 4, 344, 4, 346, 4,
1236 348, 4, 350, 4, 352, 4,
1237 354, 4, 356, 4, // NOLINT
1238 358, 4, 360, 4, 362, 4,
1239 364, 4, 366, 4, 368, 4,
1240 370, 4, 372, 4, // NOLINT
1241 374, 4, 376, -484, 377, 4,
1242 379, 4, 381, 4, 385, 840,
1243 386, 4, 388, 4, // NOLINT
1244 390, 824, 391, 4, 1073742217, 820,
1245 394, 820, 395, 4, 398, 316,
1246 399, 808, 400, 812, // NOLINT
1247 401, 4, 403, 820, 404, 828,
1248 406, 844, 407, 836, 408, 4,
1249 412, 844, 413, 852, // NOLINT
1250 415, 856, 416, 4, 418, 4,
1251 420, 4, 422, 872, 423, 4,
1252 425, 872, 428, 4, // NOLINT
1253 430, 872, 431, 4, 1073742257, 868,
1254 434, 868, 435, 4, 437, 4,
1255 439, 876, 440, 4, // NOLINT
1256 444, 4, 452, 8, 453, 4,
1257 455, 8, 456, 4, 458, 8,
1258 459, 4, 461, 4, // NOLINT
1259 463, 4, 465, 4, 467, 4,
1260 469, 4, 471, 4, 473, 4,
1261 475, 4, 478, 4, // NOLINT
1262 480, 4, 482, 4, 484, 4,
1263 486, 4, 488, 4, 490, 4,
1264 492, 4, 494, 4, // NOLINT
1265 497, 8, 498, 4, 500, 4,
1266 502, -388, 503, -224, 504, 4,
1267 506, 4, 508, 4, // NOLINT
1268 510, 4, 512, 4, 514, 4,
1269 516, 4, 518, 4, 520, 4,
1270 522, 4, 524, 4, // NOLINT
1271 526, 4, 528, 4, 530, 4,
1272 532, 4, 534, 4, 536, 4,
1273 538, 4, 540, 4, // NOLINT
1274 542, 4, 544, -520, 546, 4,
1275 548, 4, 550, 4, 552, 4,
1276 554, 4, 556, 4, // NOLINT
1277 558, 4, 560, 4, 562, 4,
1278 570, 43180, 571, 4, 573, -652,
1279 574, 43168, 577, 4, // NOLINT
1280 579, -780, 580, 276, 581, 284,
1281 582, 4, 584, 4, 586, 4,
1282 588, 4, 590, 4, // NOLINT
1283 880, 4, 882, 4, 886, 4,
1284 895, 464, 902, 152, 1073742728, 148,
1285 906, 148, 908, 256, // NOLINT
1286 1073742734, 252, 911, 252, 1073742737, 128,
1287 929, 128, 931, 6, 1073742756, 128,
1288 939, 128, 975, 32, // NOLINT
1289 984, 4, 986, 4, 988, 4,
1290 990, 4, 992, 4, 994, 4,
1291 996, 4, 998, 4, // NOLINT
1292 1000, 4, 1002, 4, 1004, 4,
1293 1006, 4, 1012, -240, 1015, 4,
1294 1017, -28, 1018, 4, // NOLINT
1295 1073742845, -520, 1023, -520, 1073742848, 320,
1296 1039, 320, 1073742864, 128, 1071, 128,
1297 1120, 4, 1122, 4, // NOLINT
1298 1124, 4, 1126, 4, 1128, 4,
1299 1130, 4, 1132, 4, 1134, 4,
1300 1136, 4, 1138, 4, // NOLINT
1301 1140, 4, 1142, 4, 1144, 4,
1302 1146, 4, 1148, 4, 1150, 4,
1303 1152, 4, 1162, 4, // NOLINT
1304 1164, 4, 1166, 4, 1168, 4,
1305 1170, 4, 1172, 4, 1174, 4,
1306 1176, 4, 1178, 4, // NOLINT
1307 1180, 4, 1182, 4, 1184, 4,
1308 1186, 4, 1188, 4, 1190, 4,
1309 1192, 4, 1194, 4, // NOLINT
1310 1196, 4, 1198, 4, 1200, 4,
1311 1202, 4, 1204, 4, 1206, 4,
1312 1208, 4, 1210, 4, // NOLINT
1313 1212, 4, 1214, 4, 1216, 60,
1314 1217, 4, 1219, 4, 1221, 4,
1315 1223, 4, 1225, 4, // NOLINT
1316 1227, 4, 1229, 4, 1232, 4,
1317 1234, 4, 1236, 4, 1238, 4,
1318 1240, 4, 1242, 4, // NOLINT
1319 1244, 4, 1246, 4, 1248, 4,
1320 1250, 4, 1252, 4, 1254, 4,
1321 1256, 4, 1258, 4, // NOLINT
1322 1260, 4, 1262, 4, 1264, 4,
1323 1266, 4, 1268, 4, 1270, 4,
1324 1272, 4, 1274, 4, // NOLINT
1325 1276, 4, 1278, 4, 1280, 4,
1326 1282, 4, 1284, 4, 1286, 4,
1327 1288, 4, 1290, 4, // NOLINT
1328 1292, 4, 1294, 4, 1296, 4,
1329 1298, 4, 1300, 4, 1302, 4,
1330 1304, 4, 1306, 4, // NOLINT
1331 1308, 4, 1310, 4, 1312, 4,
1332 1314, 4, 1316, 4, 1318, 4,
1333 1320, 4, 1322, 4, // NOLINT
1334 1324, 4, 1326, 4, 1073743153, 192,
1335 1366, 192, 1073746080, 29056, 4293, 29056,
1336 4295, 29056, 4301, 29056, // NOLINT
1337 7680, 4, 7682, 4, 7684, 4,
1338 7686, 4, 7688, 4, 7690, 4,
1339 7692, 4, 7694, 4, // NOLINT
1340 7696, 4, 7698, 4, 7700, 4,
1341 7702, 4, 7704, 4, 7706, 4,
1342 7708, 4, 7710, 4, // NOLINT
1343 7712, 4, 7714, 4, 7716, 4,
1344 7718, 4, 7720, 4, 7722, 4,
1345 7724, 4, 7726, 4, // NOLINT
1346 7728, 4, 7730, 4, 7732, 4,
1347 7734, 4, 7736, 4, 7738, 4,
1348 7740, 4, 7742, 4, // NOLINT
1349 7744, 4, 7746, 4, 7748, 4,
1350 7750, 4, 7752, 4, 7754, 4,
1351 7756, 4, 7758, 4, // NOLINT
1352 7760, 4, 7762, 4, 7764, 4,
1353 7766, 4, 7768, 4, 7770, 4,
1354 7772, 4, 7774, 4, // NOLINT
1355 7776, 4, 7778, 4, 7780, 4,
1356 7782, 4, 7784, 4, 7786, 4,
1357 7788, 4, 7790, 4, // NOLINT
1358 7792, 4, 7794, 4, 7796, 4,
1359 7798, 4, 7800, 4, 7802, 4,
1360 7804, 4, 7806, 4, // NOLINT
1361 7808, 4, 7810, 4, 7812, 4,
1362 7814, 4, 7816, 4, 7818, 4,
1363 7820, 4, 7822, 4, // NOLINT
1364 7824, 4, 7826, 4, 7828, 4,
1365 7838, -30460, 7840, 4, 7842, 4,
1366 7844, 4, 7846, 4, // NOLINT
1367 7848, 4, 7850, 4, 7852, 4,
1368 7854, 4, 7856, 4, 7858, 4,
1369 7860, 4, 7862, 4, // NOLINT
1370 7864, 4, 7866, 4, 7868, 4,
1371 7870, 4, 7872, 4, 7874, 4,
1372 7876, 4, 7878, 4, // NOLINT
1373 7880, 4, 7882, 4, 7884, 4,
1374 7886, 4, 7888, 4, 7890, 4,
1375 7892, 4, 7894, 4, // NOLINT
1376 7896, 4, 7898, 4, 7900, 4,
1377 7902, 4, 7904, 4, 7906, 4,
1378 7908, 4, 7910, 4, // NOLINT
1379 7912, 4, 7914, 4, 7916, 4,
1380 7918, 4, 7920, 4, 7922, 4,
1381 7924, 4, 7926, 4, // NOLINT
1382 7928, 4, 7930, 4, 7932, 4,
1383 7934, 4, 1073749768, -32, 7951, -32,
1384 1073749784, -32, 7965, -32, // NOLINT
1385 1073749800, -32, 7983, -32, 1073749816, -32,
1386 7999, -32, 1073749832, -32, 8013, -32,
1387 8025, -32, 8027, -32, // NOLINT
1388 8029, -32, 8031, -32, 1073749864, -32,
1389 8047, -32, 1073749896, -32, 8079, -32,
1390 1073749912, -32, 8095, -32, // NOLINT
1391 1073749928, -32, 8111, -32, 1073749944, -32,
1392 8121, -32, 1073749946, -296, 8123, -296,
1393 8124, -36, 1073749960, -344, // NOLINT
1394 8139, -344, 8140, -36, 1073749976, -32,
1395 8153, -32, 1073749978, -400, 8155, -400,
1396 1073749992, -32, 8169, -32, // NOLINT
1397 1073749994, -448, 8171, -448, 8172, -28,
1398 1073750008, -512, 8185, -512, 1073750010, -504,
1399 8187, -504, 8188, -36}; // NOLINT
1400 static const uint16_t kToLowercaseMultiStrings0Size = 2; // NOLINT
1401 static const MultiCharacterSpecialCase<1> kToLowercaseMultiStrings1[1] = { // N OLINT
1402 {{kSentinel}} }; // NOLINT
1403 static const uint16_t kToLowercaseTable1Size = 79; // NOLINT
1404 static const int32_t kToLowercaseTable1[158] = {
1405 294, -30068, 298, -33532, 299, -33048, 306, 112, 1073742176, 64, 367, 64, 387, 4, 1073743030, 104, // NOLINT
1406 1231, 104, 1073744896, 192, 3118, 192, 3168, 4, 3170, -42972, 3171, -15256, 31 72, -42908, 3175, 4, // NOLINT
1407 3177, 4, 3179, 4, 3181, -43120, 3182, -42996, 3183, -43132, 3184, -43128, 3186 , 4, 3189, 4, // NOLINT
1408 1073745022, -43260, 3199, -43260, 3200, 4, 3202, 4, 3204, 4, 3206, 4, 3208, 4, 3210, 4, // NOLINT
1409 3212, 4, 3214, 4, 3216, 4, 3218, 4, 3220, 4, 3222, 4, 3224, 4, 3226, 4, // NO LINT
1410 3228, 4, 3230, 4, 3232, 4, 3234, 4, 3236, 4, 3238, 4, 3240, 4, 3242, 4, // NO LINT
1411 3244, 4, 3246, 4, 3248, 4, 3250, 4, 3252, 4, 3254, 4, 3256, 4, 3258, 4, // NO LINT
1412 3260, 4, 3262, 4, 3264, 4, 3266, 4, 3268, 4, 3270, 4, 3272, 4, 3274, 4, // NO LINT
1413 3276, 4, 3278, 4, 3280, 4, 3282, 4, 3284, 4, 3286, 4, 3288, 4, 3290, 4, // NO LINT
1414 3292, 4, 3294, 4, 3296, 4, 3298, 4, 3307, 4, 3309, 4, 3314, 4 }; // NOLINT
1415 static const uint16_t kToLowercaseMultiStrings1Size = 1; // NOLINT
1416 static const MultiCharacterSpecialCase<1> kToLowercaseMultiStrings5[1] = { // N OLINT
1417 {{kSentinel}} }; // NOLINT
1418 static const uint16_t kToLowercaseTable5Size = 103; // NOLINT
1419 static const int32_t kToLowercaseTable5[206] = {
1420 1600, 4, 1602, 4, 1604, 4, 1606, 4,
1421 1608, 4, 1610, 4, 1612, 4, 1614, 4, // NOLINT
1422 1616, 4, 1618, 4, 1620, 4, 1622, 4,
1423 1624, 4, 1626, 4, 1628, 4, 1630, 4, // NOLINT
1424 1632, 4, 1634, 4, 1636, 4, 1638, 4,
1425 1640, 4, 1642, 4, 1644, 4, 1664, 4, // NOLINT
1426 1666, 4, 1668, 4, 1670, 4, 1672, 4,
1427 1674, 4, 1676, 4, 1678, 4, 1680, 4, // NOLINT
1428 1682, 4, 1684, 4, 1686, 4, 1688, 4,
1429 1690, 4, 1826, 4, 1828, 4, 1830, 4, // NOLINT
1430 1832, 4, 1834, 4, 1836, 4, 1838, 4,
1431 1842, 4, 1844, 4, 1846, 4, 1848, 4, // NOLINT
1432 1850, 4, 1852, 4, 1854, 4, 1856, 4,
1433 1858, 4, 1860, 4, 1862, 4, 1864, 4, // NOLINT
1434 1866, 4, 1868, 4, 1870, 4, 1872, 4,
1435 1874, 4, 1876, 4, 1878, 4, 1880, 4, // NOLINT
1436 1882, 4, 1884, 4, 1886, 4, 1888, 4,
1437 1890, 4, 1892, 4, 1894, 4, 1896, 4, // NOLINT
1438 1898, 4, 1900, 4, 1902, 4, 1913, 4,
1439 1915, 4, 1917, -141328, 1918, 4, 1920, 4, // NOLINT
1440 1922, 4, 1924, 4, 1926, 4, 1931, 4,
1441 1933, -169120, 1936, 4, 1938, 4, 1942, 4, // NOLINT
1442 1944, 4, 1946, 4, 1948, 4, 1950, 4,
1443 1952, 4, 1954, 4, 1956, 4, 1958, 4, // NOLINT
1444 1960, 4, 1962, -169232, 1963, -169276, 1964, -169260,
1445 1965, -169220, 1968, -169032, 1969, -169128}; // NOLINT
1446 static const uint16_t kToLowercaseMultiStrings5Size = 1; // NOLINT
1447 static const MultiCharacterSpecialCase<1> kToLowercaseMultiStrings7[1] = { // N OLINT
1448 {{kSentinel}} }; // NOLINT
1449 static const uint16_t kToLowercaseTable7Size = 2; // NOLINT
1450 static const int32_t kToLowercaseTable7[4] = {
1451 1073749793, 128, 7994, 128 }; // NOLINT
1452 static const uint16_t kToLowercaseMultiStrings7Size = 1; // NOLINT
1453 int ToLowercase::Convert(uchar c,
1454 uchar n,
1455 uchar* result,
1456 bool* allow_caching_ptr) {
1457 int chunk_index = c >> 13;
1458 switch (chunk_index) {
1459 case 0: return LookupMapping<true>(kToLowercaseTable0,
1460 kToLowercaseTable0Size,
1461 kToLowercaseMultiStrings0,
1462 c,
1463 n,
1464 result,
1465 allow_caching_ptr);
1466 case 1: return LookupMapping<true>(kToLowercaseTable1,
1467 kToLowercaseTable1Size,
1468 kToLowercaseMultiStrings1,
1469 c,
1470 n,
1471 result,
1472 allow_caching_ptr);
1473 case 5: return LookupMapping<true>(kToLowercaseTable5,
1474 kToLowercaseTable5Size,
1475 kToLowercaseMultiStrings5,
1476 c,
1477 n,
1478 result,
1479 allow_caching_ptr);
1480 case 7: return LookupMapping<true>(kToLowercaseTable7,
1481 kToLowercaseTable7Size,
1482 kToLowercaseMultiStrings7,
1483 c,
1484 n,
1485 result,
1486 allow_caching_ptr);
1487 default: return 0;
1488 }
1489 }
1490
1491 static const MultiCharacterSpecialCase<3> kToUppercaseMultiStrings0[62] = { // NOLINT
1492 {{83, 83, kSentinel}}, {{700, 78, kSentinel}}, {{74, 780, kSentinel}}, {{921, 776, 769}}, // NOLINT
1493 {{933, 776, 769}}, {{1333, 1362, kSentinel}}, {{72, 817, kSentinel}}, {{84, 77 6, kSentinel}}, // NOLINT
1494 {{87, 778, kSentinel}}, {{89, 778, kSentinel}}, {{65, 702, kSentinel}}, {{933, 787, kSentinel}}, // NOLINT
1495 {{933, 787, 768}}, {{933, 787, 769}}, {{933, 787, 834}}, {{7944, 921, kSentine l}}, // NOLINT
1496 {{7945, 921, kSentinel}}, {{7946, 921, kSentinel}}, {{7947, 921, kSentinel}}, {{7948, 921, kSentinel}}, // NOLINT
1497 {{7949, 921, kSentinel}}, {{7950, 921, kSentinel}}, {{7951, 921, kSentinel}}, {{7976, 921, kSentinel}}, // NOLINT
1498 {{7977, 921, kSentinel}}, {{7978, 921, kSentinel}}, {{7979, 921, kSentinel}}, {{7980, 921, kSentinel}}, // NOLINT
1499 {{7981, 921, kSentinel}}, {{7982, 921, kSentinel}}, {{7983, 921, kSentinel}}, {{8040, 921, kSentinel}}, // NOLINT
1500 {{8041, 921, kSentinel}}, {{8042, 921, kSentinel}}, {{8043, 921, kSentinel}}, {{8044, 921, kSentinel}}, // NOLINT
1501 {{8045, 921, kSentinel}}, {{8046, 921, kSentinel}}, {{8047, 921, kSentinel}}, {{8122, 921, kSentinel}}, // NOLINT
1502 {{913, 921, kSentinel}}, {{902, 921, kSentinel}}, {{913, 834, kSentinel}}, {{9 13, 834, 921}}, // NOLINT
1503 {{8138, 921, kSentinel}}, {{919, 921, kSentinel}}, {{905, 921, kSentinel}}, {{ 919, 834, kSentinel}}, // NOLINT
1504 {{919, 834, 921}}, {{921, 776, 768}}, {{921, 834, kSentinel}}, {{921, 776, 834 }}, // NOLINT
1505 {{933, 776, 768}}, {{929, 787, kSentinel}}, {{933, 834, kSentinel}}, {{933, 77 6, 834}}, // NOLINT
1506 {{8186, 921, kSentinel}}, {{937, 921, kSentinel}}, {{911, 921, kSentinel}}, {{ 937, 834, kSentinel}}, // NOLINT
1507 {{937, 834, 921}}, {{kSentinel}} }; // NOLINT
1508 static const uint16_t kToUppercaseTable0Size = 590; // NOLINT
1509 static const int32_t kToUppercaseTable0[1180] = {
1510 1073741921, -128, 122, -128, 181, 2972,
1511 223, 1, 1073742048, -128, 246, -128,
1512 1073742072, -128, 254, -128, // NOLINT
1513 255, 484, 257, -4, 259, -4,
1514 261, -4, 263, -4, 265, -4,
1515 267, -4, 269, -4, // NOLINT
1516 271, -4, 273, -4, 275, -4,
1517 277, -4, 279, -4, 281, -4,
1518 283, -4, 285, -4, // NOLINT
1519 287, -4, 289, -4, 291, -4,
1520 293, -4, 295, -4, 297, -4,
1521 299, -4, 301, -4, // NOLINT
1522 303, -4, 305, -928, 307, -4,
1523 309, -4, 311, -4, 314, -4,
1524 316, -4, 318, -4, // NOLINT
1525 320, -4, 322, -4, 324, -4,
1526 326, -4, 328, -4, 329, 5,
1527 331, -4, 333, -4, // NOLINT
1528 335, -4, 337, -4, 339, -4,
1529 341, -4, 343, -4, 345, -4,
1530 347, -4, 349, -4, // NOLINT
1531 351, -4, 353, -4, 355, -4,
1532 357, -4, 359, -4, 361, -4,
1533 363, -4, 365, -4, // NOLINT
1534 367, -4, 369, -4, 371, -4,
1535 373, -4, 375, -4, 378, -4,
1536 380, -4, 382, -4, // NOLINT
1537 383, -1200, 384, 780, 387, -4,
1538 389, -4, 392, -4, 396, -4,
1539 402, -4, 405, 388, // NOLINT
1540 409, -4, 410, 652, 414, 520,
1541 417, -4, 419, -4, 421, -4,
1542 424, -4, 429, -4, // NOLINT
1543 432, -4, 436, -4, 438, -4,
1544 441, -4, 445, -4, 447, 224,
1545 453, -4, 454, -8, // NOLINT
1546 456, -4, 457, -8, 459, -4,
1547 460, -8, 462, -4, 464, -4,
1548 466, -4, 468, -4, // NOLINT
1549 470, -4, 472, -4, 474, -4,
1550 476, -4, 477, -316, 479, -4,
1551 481, -4, 483, -4, // NOLINT
1552 485, -4, 487, -4, 489, -4,
1553 491, -4, 493, -4, 495, -4,
1554 496, 9, 498, -4, // NOLINT
1555 499, -8, 501, -4, 505, -4,
1556 507, -4, 509, -4, 511, -4,
1557 513, -4, 515, -4, // NOLINT
1558 517, -4, 519, -4, 521, -4,
1559 523, -4, 525, -4, 527, -4,
1560 529, -4, 531, -4, // NOLINT
1561 533, -4, 535, -4, 537, -4,
1562 539, -4, 541, -4, 543, -4,
1563 547, -4, 549, -4, // NOLINT
1564 551, -4, 553, -4, 555, -4,
1565 557, -4, 559, -4, 561, -4,
1566 563, -4, 572, -4, // NOLINT
1567 1073742399, 43260, 576, 43260, 578, -4,
1568 583, -4, 585, -4, 587, -4,
1569 589, -4, 591, -4, // NOLINT
1570 592, 43132, 593, 43120, 594, 43128,
1571 595, -840, 596, -824, 1073742422, -820,
1572 599, -820, 601, -808, // NOLINT
1573 603, -812, 604, 169276, 608, -820,
1574 609, 169260, 611, -828, 613, 169120,
1575 614, 169232, 616, -836, // NOLINT
1576 617, -844, 619, 42972, 620, 169220,
1577 623, -844, 625, 42996, 626, -852,
1578 629, -856, 637, 42908, // NOLINT
1579 640, -872, 643, -872, 647, 169128,
1580 648, -872, 649, -276, 1073742474, -868,
1581 651, -868, 652, -284, // NOLINT
1582 658, -876, 670, 169032, 837, 336,
1583 881, -4, 883, -4, 887, -4,
1584 1073742715, 520, 893, 520, // NOLINT
1585 912, 13, 940, -152, 1073742765, -148,
1586 943, -148, 944, 17, 1073742769, -128,
1587 961, -128, 962, -124, // NOLINT
1588 1073742787, -128, 971, -128, 972, -256,
1589 1073742797, -252, 974, -252, 976, -248,
1590 977, -228, 981, -188, // NOLINT
1591 982, -216, 983, -32, 985, -4,
1592 987, -4, 989, -4, 991, -4,
1593 993, -4, 995, -4, // NOLINT
1594 997, -4, 999, -4, 1001, -4,
1595 1003, -4, 1005, -4, 1007, -4,
1596 1008, -344, 1009, -320, // NOLINT
1597 1010, 28, 1011, -464, 1013, -384,
1598 1016, -4, 1019, -4, 1073742896, -128,
1599 1103, -128, 1073742928, -320, // NOLINT
1600 1119, -320, 1121, -4, 1123, -4,
1601 1125, -4, 1127, -4, 1129, -4,
1602 1131, -4, 1133, -4, // NOLINT
1603 1135, -4, 1137, -4, 1139, -4,
1604 1141, -4, 1143, -4, 1145, -4,
1605 1147, -4, 1149, -4, // NOLINT
1606 1151, -4, 1153, -4, 1163, -4,
1607 1165, -4, 1167, -4, 1169, -4,
1608 1171, -4, 1173, -4, // NOLINT
1609 1175, -4, 1177, -4, 1179, -4,
1610 1181, -4, 1183, -4, 1185, -4,
1611 1187, -4, 1189, -4, // NOLINT
1612 1191, -4, 1193, -4, 1195, -4,
1613 1197, -4, 1199, -4, 1201, -4,
1614 1203, -4, 1205, -4, // NOLINT
1615 1207, -4, 1209, -4, 1211, -4,
1616 1213, -4, 1215, -4, 1218, -4,
1617 1220, -4, 1222, -4, // NOLINT
1618 1224, -4, 1226, -4, 1228, -4,
1619 1230, -4, 1231, -60, 1233, -4,
1620 1235, -4, 1237, -4, // NOLINT
1621 1239, -4, 1241, -4, 1243, -4,
1622 1245, -4, 1247, -4, 1249, -4,
1623 1251, -4, 1253, -4, // NOLINT
1624 1255, -4, 1257, -4, 1259, -4,
1625 1261, -4, 1263, -4, 1265, -4,
1626 1267, -4, 1269, -4, // NOLINT
1627 1271, -4, 1273, -4, 1275, -4,
1628 1277, -4, 1279, -4, 1281, -4,
1629 1283, -4, 1285, -4, // NOLINT
1630 1287, -4, 1289, -4, 1291, -4,
1631 1293, -4, 1295, -4, 1297, -4,
1632 1299, -4, 1301, -4, // NOLINT
1633 1303, -4, 1305, -4, 1307, -4,
1634 1309, -4, 1311, -4, 1313, -4,
1635 1315, -4, 1317, -4, // NOLINT
1636 1319, -4, 1321, -4, 1323, -4,
1637 1325, -4, 1327, -4, 1073743201, -192,
1638 1414, -192, 1415, 21, // NOLINT
1639 7545, 141328, 7549, 15256, 7681, -4,
1640 7683, -4, 7685, -4, 7687, -4,
1641 7689, -4, 7691, -4, // NOLINT
1642 7693, -4, 7695, -4, 7697, -4,
1643 7699, -4, 7701, -4, 7703, -4,
1644 7705, -4, 7707, -4, // NOLINT
1645 7709, -4, 7711, -4, 7713, -4,
1646 7715, -4, 7717, -4, 7719, -4,
1647 7721, -4, 7723, -4, // NOLINT
1648 7725, -4, 7727, -4, 7729, -4,
1649 7731, -4, 7733, -4, 7735, -4,
1650 7737, -4, 7739, -4, // NOLINT
1651 7741, -4, 7743, -4, 7745, -4,
1652 7747, -4, 7749, -4, 7751, -4,
1653 7753, -4, 7755, -4, // NOLINT
1654 7757, -4, 7759, -4, 7761, -4,
1655 7763, -4, 7765, -4, 7767, -4,
1656 7769, -4, 7771, -4, // NOLINT
1657 7773, -4, 7775, -4, 7777, -4,
1658 7779, -4, 7781, -4, 7783, -4,
1659 7785, -4, 7787, -4, // NOLINT
1660 7789, -4, 7791, -4, 7793, -4,
1661 7795, -4, 7797, -4, 7799, -4,
1662 7801, -4, 7803, -4, // NOLINT
1663 7805, -4, 7807, -4, 7809, -4,
1664 7811, -4, 7813, -4, 7815, -4,
1665 7817, -4, 7819, -4, // NOLINT
1666 7821, -4, 7823, -4, 7825, -4,
1667 7827, -4, 7829, -4, 7830, 25,
1668 7831, 29, 7832, 33, // NOLINT
1669 7833, 37, 7834, 41, 7835, -236,
1670 7841, -4, 7843, -4, 7845, -4,
1671 7847, -4, 7849, -4, // NOLINT
1672 7851, -4, 7853, -4, 7855, -4,
1673 7857, -4, 7859, -4, 7861, -4,
1674 7863, -4, 7865, -4, // NOLINT
1675 7867, -4, 7869, -4, 7871, -4,
1676 7873, -4, 7875, -4, 7877, -4,
1677 7879, -4, 7881, -4, // NOLINT
1678 7883, -4, 7885, -4, 7887, -4,
1679 7889, -4, 7891, -4, 7893, -4,
1680 7895, -4, 7897, -4, // NOLINT
1681 7899, -4, 7901, -4, 7903, -4,
1682 7905, -4, 7907, -4, 7909, -4,
1683 7911, -4, 7913, -4, // NOLINT
1684 7915, -4, 7917, -4, 7919, -4,
1685 7921, -4, 7923, -4, 7925, -4,
1686 7927, -4, 7929, -4, // NOLINT
1687 7931, -4, 7933, -4, 7935, -4,
1688 1073749760, 32, 7943, 32, 1073749776, 32,
1689 7957, 32, 1073749792, 32, // NOLINT
1690 7975, 32, 1073749808, 32, 7991, 32,
1691 1073749824, 32, 8005, 32, 8016, 45,
1692 8017, 32, 8018, 49, // NOLINT
1693 8019, 32, 8020, 53, 8021, 32,
1694 8022, 57, 8023, 32, 1073749856, 32,
1695 8039, 32, 1073749872, 296, // NOLINT
1696 8049, 296, 1073749874, 344, 8053, 344,
1697 1073749878, 400, 8055, 400, 1073749880, 512,
1698 8057, 512, 1073749882, 448, // NOLINT
1699 8059, 448, 1073749884, 504, 8061, 504,
1700 8064, 61, 8065, 65, 8066, 69,
1701 8067, 73, 8068, 77, // NOLINT
1702 8069, 81, 8070, 85, 8071, 89,
1703 8072, 61, 8073, 65, 8074, 69,
1704 8075, 73, 8076, 77, // NOLINT
1705 8077, 81, 8078, 85, 8079, 89,
1706 8080, 93, 8081, 97, 8082, 101,
1707 8083, 105, 8084, 109, // NOLINT
1708 8085, 113, 8086, 117, 8087, 121,
1709 8088, 93, 8089, 97, 8090, 101,
1710 8091, 105, 8092, 109, // NOLINT
1711 8093, 113, 8094, 117, 8095, 121,
1712 8096, 125, 8097, 129, 8098, 133,
1713 8099, 137, 8100, 141, // NOLINT
1714 8101, 145, 8102, 149, 8103, 153,
1715 8104, 125, 8105, 129, 8106, 133,
1716 8107, 137, 8108, 141, // NOLINT
1717 8109, 145, 8110, 149, 8111, 153,
1718 1073749936, 32, 8113, 32, 8114, 157,
1719 8115, 161, 8116, 165, // NOLINT
1720 8118, 169, 8119, 173, 8124, 161,
1721 8126, -28820, 8130, 177, 8131, 181,
1722 8132, 185, 8134, 189, // NOLINT
1723 8135, 193, 8140, 181, 1073749968, 32,
1724 8145, 32, 8146, 197, 8147, 13,
1725 8150, 201, 8151, 205, // NOLINT
1726 1073749984, 32, 8161, 32, 8162, 209,
1727 8163, 17, 8164, 213, 8165, 28,
1728 8166, 217, 8167, 221, // NOLINT
1729 8178, 225, 8179, 229, 8180, 233,
1730 8182, 237, 8183, 241, 8188, 229}; // NOLINT
1731 static const uint16_t kToUppercaseMultiStrings0Size = 62; // NOLINT
1732 static const MultiCharacterSpecialCase<1> kToUppercaseMultiStrings1[1] = { // N OLINT
1733 {{kSentinel}} }; // NOLINT
1734 static const uint16_t kToUppercaseTable1Size = 73; // NOLINT
1735 static const int32_t kToUppercaseTable1[146] = {
1736 334, -112, 1073742192, -64, 383, -64, 388, -4, 1073743056, -104, 1257, -104, 1 073744944, -192, 3166, -192, // NOLINT
1737 3169, -4, 3173, -43180, 3174, -43168, 3176, -4, 3178, -4, 3180, -4, 3187, -4, 3190, -4, // NOLINT
1738 3201, -4, 3203, -4, 3205, -4, 3207, -4, 3209, -4, 3211, -4, 3213, -4, 3215, -4 , // NOLINT
1739 3217, -4, 3219, -4, 3221, -4, 3223, -4, 3225, -4, 3227, -4, 3229, -4, 3231, -4 , // NOLINT
1740 3233, -4, 3235, -4, 3237, -4, 3239, -4, 3241, -4, 3243, -4, 3245, -4, 3247, -4 , // NOLINT
1741 3249, -4, 3251, -4, 3253, -4, 3255, -4, 3257, -4, 3259, -4, 3261, -4, 3263, -4 , // NOLINT
1742 3265, -4, 3267, -4, 3269, -4, 3271, -4, 3273, -4, 3275, -4, 3277, -4, 3279, -4 , // NOLINT
1743 3281, -4, 3283, -4, 3285, -4, 3287, -4, 3289, -4, 3291, -4, 3293, -4, 3295, -4 , // NOLINT
1744 3297, -4, 3299, -4, 3308, -4, 3310, -4, 3315, -4, 1073745152, -29056, 3365, -2 9056, 3367, -29056, // NOLINT
1745 3373, -29056 }; // NOLINT
1746 static const uint16_t kToUppercaseMultiStrings1Size = 1; // NOLINT
1747 static const MultiCharacterSpecialCase<1> kToUppercaseMultiStrings5[1] = { // N OLINT
1748 {{kSentinel}} }; // NOLINT
1749 static const uint16_t kToUppercaseTable5Size = 95; // NOLINT
1750 static const int32_t
1751 kToUppercaseTable5[190] = {1601, -4, 1603, -4, 1605, -4, 1607, -4, 1609, -4,
1752 1611, -4, 1613, -4, 1615, -4, // NOLINT
1753 1617, -4, 1619, -4, 1621, -4, 1623, -4, 1625, -4,
1754 1627, -4, 1629, -4, 1631, -4, // NOLINT
1755 1633, -4, 1635, -4, 1637, -4, 1639, -4, 1641, -4,
1756 1643, -4, 1645, -4, 1665, -4, // NOLINT
1757 1667, -4, 1669, -4, 1671, -4, 1673, -4, 1675, -4,
1758 1677, -4, 1679, -4, 1681, -4, // NOLINT
1759 1683, -4, 1685, -4, 1687, -4, 1689, -4, 1691, -4,
1760 1827, -4, 1829, -4, 1831, -4, // NOLINT
1761 1833, -4, 1835, -4, 1837, -4, 1839, -4, 1843, -4,
1762 1845, -4, 1847, -4, 1849, -4, // NOLINT
1763 1851, -4, 1853, -4, 1855, -4, 1857, -4, 1859, -4,
1764 1861, -4, 1863, -4, 1865, -4, // NOLINT
1765 1867, -4, 1869, -4, 1871, -4, 1873, -4, 1875, -4,
1766 1877, -4, 1879, -4, 1881, -4, // NOLINT
1767 1883, -4, 1885, -4, 1887, -4, 1889, -4, 1891, -4,
1768 1893, -4, 1895, -4, 1897, -4, // NOLINT
1769 1899, -4, 1901, -4, 1903, -4, 1914, -4, 1916, -4,
1770 1919, -4, 1921, -4, 1923, -4, // NOLINT
1771 1925, -4, 1927, -4, 1932, -4, 1937, -4, 1939, -4,
1772 1943, -4, 1945, -4, 1947, -4, // NOLINT
1773 1949, -4, 1951, -4, 1953, -4, 1955, -4, 1957, -4,
1774 1959, -4, 1961, -4}; // NOLINT
1775 static const uint16_t kToUppercaseMultiStrings5Size = 1; // NOLINT
1776 static const MultiCharacterSpecialCase<3> kToUppercaseMultiStrings7[12] = { // NOLINT
1777 {{70, 70, kSentinel}}, {{70, 73, kSentinel}}, {{70, 76, kSentinel}}, {{70, 70, 73}}, // NOLINT
1778 {{70, 70, 76}}, {{83, 84, kSentinel}}, {{1348, 1350, kSentinel}}, {{1348, 1333 , kSentinel}}, // NOLINT
1779 {{1348, 1339, kSentinel}}, {{1358, 1350, kSentinel}}, {{1348, 1341, kSentinel} }, {{kSentinel}} }; // NOLINT
1780 static const uint16_t kToUppercaseTable7Size = 14; // NOLINT
1781 static const int32_t kToUppercaseTable7[28] = {
1782 6912, 1, 6913, 5, 6914, 9, 6915, 13, 6916, 17, 6917, 21, 6918, 21, 6931, 25, // NOLINT
1783 6932, 29, 6933, 33, 6934, 37, 6935, 41, 1073749825, -128, 8026, -128 }; // NO LINT
1784 static const uint16_t kToUppercaseMultiStrings7Size = 12; // NOLINT
1785 int ToUppercase::Convert(uchar c,
1786 uchar n,
1787 uchar* result,
1788 bool* allow_caching_ptr) {
1789 int chunk_index = c >> 13;
1790 switch (chunk_index) {
1791 case 0: return LookupMapping<true>(kToUppercaseTable0,
1792 kToUppercaseTable0Size,
1793 kToUppercaseMultiStrings0,
1794 c,
1795 n,
1796 result,
1797 allow_caching_ptr);
1798 case 1: return LookupMapping<true>(kToUppercaseTable1,
1799 kToUppercaseTable1Size,
1800 kToUppercaseMultiStrings1,
1801 c,
1802 n,
1803 result,
1804 allow_caching_ptr);
1805 case 5: return LookupMapping<true>(kToUppercaseTable5,
1806 kToUppercaseTable5Size,
1807 kToUppercaseMultiStrings5,
1808 c,
1809 n,
1810 result,
1811 allow_caching_ptr);
1812 case 7: return LookupMapping<true>(kToUppercaseTable7,
1813 kToUppercaseTable7Size,
1814 kToUppercaseMultiStrings7,
1815 c,
1816 n,
1817 result,
1818 allow_caching_ptr);
1819 default: return 0;
1820 }
1821 }
1822
392 static const MultiCharacterSpecialCase<1> kEcma262CanonicalizeMultiStrings0[1] = { // NOLINT 1823 static const MultiCharacterSpecialCase<1> kEcma262CanonicalizeMultiStrings0[1] = { // NOLINT
393 {{kSentinel}} }; // NOLINT 1824 {{kSentinel}} }; // NOLINT
394 static const uint16_t kEcma262CanonicalizeTable0Size = 498; // NOLINT 1825 static const uint16_t kEcma262CanonicalizeTable0Size = 498; // NOLINT
395 static const int32_t kEcma262CanonicalizeTable0[996] = { 1826 static const int32_t kEcma262CanonicalizeTable0[996] = {
396 1073741921, -128, 122, -128, 181, 2972, 1827 1073741921, -128, 122, -128, 181, 2972,
397 1073742048, -128, 246, -128, 1073742072, -128, 1828 1073742048, -128, 246, -128, 1073742072, -128,
398 254, -128, 255, 484, // NOLINT 1829 254, -128, 255, 484, // NOLINT
399 257, -4, 259, -4, 261, -4, 1830 257, -4, 259, -4, 261, -4,
400 263, -4, 265, -4, 267, -4, 1831 263, -4, 265, -4, 267, -4,
401 269, -4, 271, -4, // NOLINT 1832 269, -4, 271, -4, // NOLINT
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 1939, -4, 1943, -4, 1945, -4, 1947, -4, // NOLINT 2055 1939, -4, 1943, -4, 1945, -4, 1947, -4, // NOLINT
625 1949, -4, 1951, -4, 1953, -4, 1955, -4, 2056 1949, -4, 1951, -4, 1953, -4, 1955, -4,
626 1957, -4, 1959, -4, 1961, -4}; // NOLINT 2057 1957, -4, 1959, -4, 1961, -4}; // NOLINT
627 static const uint16_t kEcma262CanonicalizeMultiStrings5Size = 1; // NOLINT 2058 static const uint16_t kEcma262CanonicalizeMultiStrings5Size = 1; // NOLINT
628 static const MultiCharacterSpecialCase<1> kEcma262CanonicalizeMultiStrings7[1] = { // NOLINT 2059 static const MultiCharacterSpecialCase<1> kEcma262CanonicalizeMultiStrings7[1] = { // NOLINT
629 {{kSentinel}} }; // NOLINT 2060 {{kSentinel}} }; // NOLINT
630 static const uint16_t kEcma262CanonicalizeTable7Size = 2; // NOLINT 2061 static const uint16_t kEcma262CanonicalizeTable7Size = 2; // NOLINT
631 static const int32_t kEcma262CanonicalizeTable7[4] = { 2062 static const int32_t kEcma262CanonicalizeTable7[4] = {
632 1073749825, -128, 8026, -128 }; // NOLINT 2063 1073749825, -128, 8026, -128 }; // NOLINT
633 static const uint16_t kEcma262CanonicalizeMultiStrings7Size = 1; // NOLINT 2064 static const uint16_t kEcma262CanonicalizeMultiStrings7Size = 1; // NOLINT
634 intptr_t Ecma262Canonicalize::Convert(int32_t c, 2065 int Ecma262Canonicalize::Convert(uchar c,
635 int32_t n, 2066 uchar n,
636 int32_t* result, 2067 uchar* result,
637 bool* allow_caching_ptr) { 2068 bool* allow_caching_ptr) {
638 intptr_t chunk_index = c >> 13; 2069 int chunk_index = c >> 13;
639 switch (chunk_index) { 2070 switch (chunk_index) {
640 case 0: return LookupMapping<true>(kEcma262CanonicalizeTable0, 2071 case 0: return LookupMapping<true>(kEcma262CanonicalizeTable0,
641 kEcma262CanonicalizeTable0Size, 2072 kEcma262CanonicalizeTable0Size,
642 kEcma262CanonicalizeMultiStrings0, 2073 kEcma262CanonicalizeMultiStrings0,
643 c, 2074 c,
644 n, 2075 n,
645 result, 2076 result,
646 allow_caching_ptr); 2077 allow_caching_ptr);
647 case 1: return LookupMapping<true>(kEcma262CanonicalizeTable1, 2078 case 1: return LookupMapping<true>(kEcma262CanonicalizeTable1,
648 kEcma262CanonicalizeTable1Size, 2079 kEcma262CanonicalizeTable1Size,
(...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after
1760 1958, 381, 1959, 381, 1960, 385, 1961, 385, // NOLINT 3191 1958, 381, 1959, 381, 1960, 385, 1961, 385, // NOLINT
1761 1962, 389, 1963, 393, 1964, 397, 1965, 401, 3192 1962, 389, 1963, 393, 1964, 397, 1965, 401,
1762 1968, 405, 1969, 409}; // NOLINT 3193 1968, 405, 1969, 409}; // NOLINT
1763 static const uint16_t kEcma262UnCanonicalizeMultiStrings5Size = 104; // NOLINT 3194 static const uint16_t kEcma262UnCanonicalizeMultiStrings5Size = 104; // NOLINT
1764 static const MultiCharacterSpecialCase<2> kEcma262UnCanonicalizeMultiStrings7[3] = { // NOLINT 3195 static const MultiCharacterSpecialCase<2> kEcma262UnCanonicalizeMultiStrings7[3] = { // NOLINT
1765 {{65313, 65345}}, {{65338, 65370}}, {{kSentinel}} }; // NOLINT 3196 {{65313, 65345}}, {{65338, 65370}}, {{kSentinel}} }; // NOLINT
1766 static const uint16_t kEcma262UnCanonicalizeTable7Size = 4; // NOLINT 3197 static const uint16_t kEcma262UnCanonicalizeTable7Size = 4; // NOLINT
1767 static const int32_t kEcma262UnCanonicalizeTable7[8] = { 3198 static const int32_t kEcma262UnCanonicalizeTable7[8] = {
1768 1073749793, 1, 7994, 5, 1073749825, 1, 8026, 5 }; // NOLINT 3199 1073749793, 1, 7994, 5, 1073749825, 1, 8026, 5 }; // NOLINT
1769 static const uint16_t kEcma262UnCanonicalizeMultiStrings7Size = 3; // NOLINT 3200 static const uint16_t kEcma262UnCanonicalizeMultiStrings7Size = 3; // NOLINT
1770 intptr_t Ecma262UnCanonicalize::Convert(int32_t c, 3201 int Ecma262UnCanonicalize::Convert(uchar c,
1771 int32_t n, 3202 uchar n,
1772 int32_t* result, 3203 uchar* result,
1773 bool* allow_caching_ptr) { 3204 bool* allow_caching_ptr) {
1774 intptr_t chunk_index = c >> 13; 3205 int chunk_index = c >> 13;
1775 switch (chunk_index) { 3206 switch (chunk_index) {
1776 case 0: return LookupMapping<true>(kEcma262UnCanonicalizeTable0, 3207 case 0: return LookupMapping<true>(kEcma262UnCanonicalizeTable0,
1777 kEcma262UnCanonicalizeTable0Size, 3208 kEcma262UnCanonicalizeTable0Size,
1778 kEcma262UnCanonicalizeMultiStrings0, 3209 kEcma262UnCanonicalizeMultiStrings0,
1779 c, 3210 c,
1780 n, 3211 n,
1781 result, 3212 result,
1782 allow_caching_ptr); 3213 allow_caching_ptr);
1783 case 1: return LookupMapping<true>(kEcma262UnCanonicalizeTable1, 3214 case 1: return LookupMapping<true>(kEcma262UnCanonicalizeTable1,
1784 kEcma262UnCanonicalizeTable1Size, 3215 kEcma262UnCanonicalizeTable1Size,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
1825 static const int32_t kCanonicalizationRangeTable1[28] = { 3256 static const int32_t kCanonicalizationRangeTable1[28] = {
1826 1073742176, 60, 367, 0, 1073742192, 60, 383, 0, 1073743030, 100, 1231, 0, 1073 743056, 100, 1257, 0, // NOLINT 3257 1073742176, 60, 367, 0, 1073742192, 60, 383, 0, 1073743030, 100, 1231, 0, 1073 743056, 100, 1257, 0, // NOLINT
1827 1073744896, 184, 3118, 0, 1073744944, 184, 3166, 0, 1073745152, 148, 3365, 0 } ; // NOLINT 3258 1073744896, 184, 3118, 0, 1073744944, 184, 3166, 0, 1073745152, 148, 3365, 0 } ; // NOLINT
1828 static const uint16_t kCanonicalizationRangeMultiStrings1Size = 1; // NOLINT 3259 static const uint16_t kCanonicalizationRangeMultiStrings1Size = 1; // NOLINT
1829 static const MultiCharacterSpecialCase<1> kCanonicalizationRangeMultiStrings7[1] = { // NOLINT 3260 static const MultiCharacterSpecialCase<1> kCanonicalizationRangeMultiStrings7[1] = { // NOLINT
1830 {{kSentinel}} }; // NOLINT 3261 {{kSentinel}} }; // NOLINT
1831 static const uint16_t kCanonicalizationRangeTable7Size = 4; // NOLINT 3262 static const uint16_t kCanonicalizationRangeTable7Size = 4; // NOLINT
1832 static const int32_t kCanonicalizationRangeTable7[8] = { 3263 static const int32_t kCanonicalizationRangeTable7[8] = {
1833 1073749793, 100, 7994, 0, 1073749825, 100, 8026, 0 }; // NOLINT 3264 1073749793, 100, 7994, 0, 1073749825, 100, 8026, 0 }; // NOLINT
1834 static const uint16_t kCanonicalizationRangeMultiStrings7Size = 1; // NOLINT 3265 static const uint16_t kCanonicalizationRangeMultiStrings7Size = 1; // NOLINT
1835 intptr_t CanonicalizationRange::Convert(int32_t c, 3266 int CanonicalizationRange::Convert(uchar c,
1836 int32_t n, 3267 uchar n,
1837 int32_t* result, 3268 uchar* result,
1838 bool* allow_caching_ptr) { 3269 bool* allow_caching_ptr) {
1839 intptr_t chunk_index = c >> 13; 3270 int chunk_index = c >> 13;
1840 switch (chunk_index) { 3271 switch (chunk_index) {
1841 case 0: return LookupMapping<false>(kCanonicalizationRangeTable0, 3272 case 0: return LookupMapping<false>(kCanonicalizationRangeTable0,
1842 kCanonicalizationRangeTable0Size, 3273 kCanonicalizationRangeTable0Size,
1843 kCanonicalizationRangeMultiStrings0, 3274 kCanonicalizationRangeMultiStrings0,
1844 c, 3275 c,
1845 n, 3276 n,
1846 result, 3277 result,
1847 allow_caching_ptr); 3278 allow_caching_ptr);
1848 case 1: return LookupMapping<false>(kCanonicalizationRangeTable1, 3279 case 1: return LookupMapping<false>(kCanonicalizationRangeTable1,
1849 kCanonicalizationRangeTable1Size, 3280 kCanonicalizationRangeTable1Size,
1850 kCanonicalizationRangeMultiStrings1, 3281 kCanonicalizationRangeMultiStrings1,
1851 c, 3282 c,
1852 n, 3283 n,
1853 result, 3284 result,
1854 allow_caching_ptr); 3285 allow_caching_ptr);
1855 case 7: return LookupMapping<false>(kCanonicalizationRangeTable7, 3286 case 7: return LookupMapping<false>(kCanonicalizationRangeTable7,
1856 kCanonicalizationRangeTable7Size, 3287 kCanonicalizationRangeTable7Size,
1857 kCanonicalizationRangeMultiStrings7, 3288 kCanonicalizationRangeMultiStrings7,
1858 c, 3289 c,
1859 n, 3290 n,
1860 result, 3291 result,
1861 allow_caching_ptr); 3292 allow_caching_ptr);
1862 default: return 0; 3293 default: return 0;
1863 } 3294 }
1864 } 3295 }
1865 3296
3297
3298 const uchar UnicodeData::kMaxCodePoint = 65533;
3299
3300 int UnicodeData::GetByteCount() {
3301 return kUppercaseTable0Size * sizeof(int32_t) // NOLINT
3302 + kUppercaseTable1Size * sizeof(int32_t) // NOLINT
3303 + kUppercaseTable5Size * sizeof(int32_t) // NOLINT
3304 + kUppercaseTable7Size * sizeof(int32_t) // NOLINT
3305 + kLowercaseTable0Size * sizeof(int32_t) // NOLINT
3306 + kLowercaseTable1Size * sizeof(int32_t) // NOLINT
3307 + kLowercaseTable5Size * sizeof(int32_t) // NOLINT
3308 + kLowercaseTable7Size * sizeof(int32_t) // NOLINT
3309 + kLetterTable0Size * sizeof(int32_t) // NOLINT
3310 + kLetterTable1Size * sizeof(int32_t) // NOLINT
3311 + kLetterTable2Size * sizeof(int32_t) // NOLINT
3312 + kLetterTable3Size * sizeof(int32_t) // NOLINT
3313 + kLetterTable4Size * sizeof(int32_t) // NOLINT
3314 + kLetterTable5Size * sizeof(int32_t) // NOLINT
3315 + kLetterTable6Size * sizeof(int32_t) // NOLINT
3316 + kLetterTable7Size * sizeof(int32_t) // NOLINT
3317 + kID_StartTable0Size * sizeof(int32_t) // NOLINT
3318 + kID_StartTable1Size * sizeof(int32_t) // NOLINT
3319 + kID_StartTable2Size * sizeof(int32_t) // NOLINT
3320 + kID_StartTable3Size * sizeof(int32_t) // NOLINT
3321 + kID_StartTable4Size * sizeof(int32_t) // NOLINT
3322 + kID_StartTable5Size * sizeof(int32_t) // NOLINT
3323 + kID_StartTable6Size * sizeof(int32_t) // NOLINT
3324 + kID_StartTable7Size * sizeof(int32_t) // NOLINT
3325 + kID_ContinueTable0Size * sizeof(int32_t) // NOLINT
3326 + kID_ContinueTable1Size * sizeof(int32_t) // NOLINT
3327 + kID_ContinueTable5Size * sizeof(int32_t) // NOLINT
3328 + kID_ContinueTable7Size * sizeof(int32_t) // NOLINT
3329 + kWhiteSpaceTable0Size * sizeof(int32_t) // NOLINT
3330 + kWhiteSpaceTable1Size * sizeof(int32_t) // NOLINT
3331 + kWhiteSpaceTable7Size * sizeof(int32_t) // NOLINT
3332 + kLineTerminatorTable0Size * sizeof(int32_t) // NOLINT
3333 + kLineTerminatorTable1Size * sizeof(int32_t) // NOLINT
3334 +
3335 kToLowercaseMultiStrings0Size *
3336 sizeof(MultiCharacterSpecialCase<2>) // NOLINT
3337 +
3338 kToLowercaseMultiStrings1Size *
3339 sizeof(MultiCharacterSpecialCase<1>) // NOLINT
3340 +
3341 kToLowercaseMultiStrings5Size *
3342 sizeof(MultiCharacterSpecialCase<1>) // NOLINT
3343 +
3344 kToLowercaseMultiStrings7Size *
3345 sizeof(MultiCharacterSpecialCase<1>) // NOLINT
3346 +
3347 kToUppercaseMultiStrings0Size *
3348 sizeof(MultiCharacterSpecialCase<3>) // NOLINT
3349 +
3350 kToUppercaseMultiStrings1Size *
3351 sizeof(MultiCharacterSpecialCase<1>) // NOLINT
3352 +
3353 kToUppercaseMultiStrings5Size *
3354 sizeof(MultiCharacterSpecialCase<1>) // NOLINT
3355 +
3356 kToUppercaseMultiStrings7Size *
3357 sizeof(MultiCharacterSpecialCase<3>) // NOLINT
3358 +
3359 kEcma262CanonicalizeMultiStrings0Size *
3360 sizeof(MultiCharacterSpecialCase<1>) // NOLINT
3361 +
3362 kEcma262CanonicalizeMultiStrings1Size *
3363 sizeof(MultiCharacterSpecialCase<1>) // NOLINT
3364 +
3365 kEcma262CanonicalizeMultiStrings5Size *
3366 sizeof(MultiCharacterSpecialCase<1>) // NOLINT
3367 +
3368 kEcma262CanonicalizeMultiStrings7Size *
3369 sizeof(MultiCharacterSpecialCase<1>) // NOLINT
3370 +
3371 kEcma262UnCanonicalizeMultiStrings0Size *
3372 sizeof(MultiCharacterSpecialCase<4>) // NOLINT
3373 +
3374 kEcma262UnCanonicalizeMultiStrings1Size *
3375 sizeof(MultiCharacterSpecialCase<2>) // NOLINT
3376 +
3377 kEcma262UnCanonicalizeMultiStrings5Size *
3378 sizeof(MultiCharacterSpecialCase<2>) // NOLINT
3379 +
3380 kEcma262UnCanonicalizeMultiStrings7Size *
3381 sizeof(MultiCharacterSpecialCase<2>) // NOLINT
3382 +
3383 kCanonicalizationRangeMultiStrings0Size *
3384 sizeof(MultiCharacterSpecialCase<1>) // NOLINT
3385 +
3386 kCanonicalizationRangeMultiStrings1Size *
3387 sizeof(MultiCharacterSpecialCase<1>) // NOLINT
3388 +
3389 kCanonicalizationRangeMultiStrings7Size *
3390 sizeof(MultiCharacterSpecialCase<1>); // NOLINT
3391 }
3392
1866 } // namespace unibrow 3393 } // namespace unibrow
OLDNEW
« no previous file with comments | « runtime/vm/unibrow.h ('k') | runtime/vm/unibrow-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698