1 // GENERATED FILE - DO NOT EDIT.
2 // Generated by gen_builtin_symbols.py using data from builtin_variables.json and
3 // builtin_function_declarations.txt.
4 //
5 // Copyright 2020 The ANGLE Project Authors. All rights reserved.
6 // Use of this source code is governed by a BSD-style license that can be
7 // found in the LICENSE file.
8 //
9 // ImmutableString_autogen.cpp: Wrapper for static or pool allocated char arrays, that are
10 // guaranteed to be valid and unchanged for the duration of the compilation. Implements
11 // mangledNameHash using perfect hash function from gen_builtin_symbols.py
12
13 #include "compiler/translator/ImmutableString.h"
14
operator <<(std::ostream & os,const sh::ImmutableString & str)15 std::ostream &operator<<(std::ostream &os, const sh::ImmutableString &str)
16 {
17 return os.write(str.data(), str.length());
18 }
19
20 #if defined(_MSC_VER)
21 # pragma warning(disable : 4309) // truncation of constant value
22 #endif
23
24 namespace
25 {
26
27 constexpr int mangledkT1[] = {2743, 4229, 3268, 910, 860, 1581, 1730, 2644, 3296, 1182,
28 336, 1125, 2239, 1930, 1402, 1665, 93, 4278, 2298, 3429,
29 2058, 1912, 4086, 886, 2174, 306, 818, 938, 2318, 2482,
30 531, 792, 3207, 1068, 1949, 1129, 324, 3475, 1781, 797};
31 constexpr int mangledkT2[] = {680, 267, 2903, 1702, 3372, 949, 3371, 1697, 2772, 741,
32 844, 1764, 3151, 3565, 1630, 1762, 4174, 833, 2973, 2727,
33 4172, 1737, 419, 3540, 831, 2685, 2708, 801, 1970, 3933,
34 1222, 2659, 1843, 443, 3831, 3904, 1926, 2027, 2723, 1430};
35 constexpr int mangledkG[] = {
36 0, 0, 0, 0, 0, 0, 0, 2775, 0, 0, 0, 0, 0, 1401, 2314, 0,
37 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3539, 0, 0, 4069, 0, 0,
38 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
39 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4147, 0, 0, 1434, 0,
40 0, 0, 0, 0, 0, 2775, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
41 1918, 0, 0, 0, 0, 228, 0, 0, 1334, 2967, 0, 0, 0, 0, 0, 0,
42 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
43 0, 0, 0, 0, 0, 0, 1638, 1276, 0, 0, 0, 1307, 0, 1868, 0, 0,
44 0, 2373, 0, 0, 0, 0, 618, 0, 3041, 0, 0, 2542, 408, 0, 78, 3685,
45 0, 0, 0, 3895, 0, 0, 1445, 0, 0, 0, 0, 0, 0, 4125, 813, 0,
46 0, 410, 0, 367, 0, 0, 0, 0, 0, 0, 0, 4024, 0, 2429, 516, 0,
47 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4221, 139, 0, 0, 0, 0,
48 0, 0, 2307, 802, 0, 0, 2413, 0, 0, 0, 0, 949, 0, 0, 0, 0,
49 0, 0, 0, 0, 0, 0, 0, 4092, 0, 0, 0, 2452, 2441, 0, 0, 1984,
50 0, 0, 1700, 2464, 0, 0, 0, 3230, 0, 0, 2423, 0, 496, 0, 0, 0,
51 0, 0, 2875, 0, 0, 0, 0, 0, 1056, 1356, 525, 1334, 0, 0, 0, 3367,
52 0, 0, 0, 0, 0, 0, 0, 0, 0, 2057, 0, 0, 0, 0, 0, 0,
53 0, 0, 702, 662, 0, 887, 0, 0, 1976, 1347, 0, 0, 0, 2653, 0, 0,
54 2986, 0, 0, 0, 0, 0, 0, 3259, 0, 0, 3127, 0, 0, 3966, 0, 223,
55 0, 0, 603, 1374, 712, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2410,
56 0, 0, 389, 0, 0, 3676, 0, 0, 3460, 0, 0, 0, 0, 0, 1447, 0,
57 1441, 1653, 0, 0, 1112, 0, 0, 0, 0, 1091, 283, 0, 33, 0, 0, 0,
58 0, 0, 852, 0, 0, 0, 2908, 230, 0, 0, 0, 0, 2812, 0, 0, 0,
59 0, 0, 0, 4253, 0, 0, 0, 0, 626, 0, 1650, 0, 0, 1199, 0, 0,
60 0, 0, 0, 0, 3697, 3032, 0, 0, 0, 3754, 3747, 0, 0, 3586, 0, 968,
61 3907, 0, 0, 1607, 0, 0, 0, 0, 0, 3273, 0, 0, 3839, 0, 0, 0,
62 3159, 0, 504, 0, 0, 0, 0, 2337, 0, 430, 0, 0, 1902, 0, 0, 0,
63 0, 0, 2373, 0, 0, 546, 0, 0, 0, 0, 377, 0, 0, 0, 0, 0,
64 0, 538, 0, 0, 1078, 0, 695, 1910, 849, 208, 4063, 1145, 0, 0, 0, 0,
65 0, 2597, 0, 0, 0, 0, 0, 2164, 0, 0, 0, 3612, 0, 0, 0, 4103,
66 0, 0, 0, 0, 0, 1821, 766, 350, 400, 0, 0, 0, 0, 0, 0, 10,
67 3031, 2862, 2613, 0, 724, 0, 0, 0, 0, 0, 1006, 0, 3337, 0, 0, 0,
68 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1296, 0,
69 0, 2420, 0, 4277, 3458, 0, 0, 0, 0, 0, 0, 462, 0, 1491, 1720, 0,
70 0, 1690, 0, 0, 0, 2786, 1590, 3852, 3726, 0, 361, 1563, 0, 0, 3371, 4259,
71 1235, 0, 0, 783, 0, 0, 141, 164, 55, 0, 0, 2042, 3049, 0, 0, 0,
72 1188, 0, 0, 1262, 0, 0, 0, 0, 0, 329, 0, 0, 0, 0, 1059, 0,
73 0, 3895, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3802, 1272, 0, 0, 0,
74 0, 4279, 152, 0, 0, 1318, 0, 1103, 2001, 0, 2513, 0, 0, 0, 0, 524,
75 0, 0, 415, 0, 3081, 2569, 0, 0, 164, 0, 0, 0, 0, 0, 0, 3880,
76 0, 328, 0, 0, 0, 0, 0, 0, 0, 0, 1271, 0, 0, 0, 0, 0,
77 0, 2663, 0, 2951, 3334, 2832, 1054, 945, 0, 1175, 2669, 3868, 0, 0, 3873, 0,
78 2252, 4012, 3870, 0, 0, 0, 0, 162, 0, 0, 0, 0, 0, 0, 0, 0,
79 461, 0, 962, 3875, 0, 0, 0, 1762, 665, 3951, 0, 0, 0, 2007, 3731, 1986,
80 0, 0, 0, 1690, 0, 1597, 0, 1082, 4280, 0, 1531, 0, 0, 33, 0, 0,
81 0, 0, 0, 0, 1273, 0, 0, 952, 0, 0, 0, 0, 1025, 174, 0, 0,
82 0, 0, 0, 1511, 220, 0, 0, 0, 0, 0, 0, 772, 2603, 363, 0, 0,
83 0, 0, 0, 0, 0, 1457, 0, 0, 1492, 3298, 0, 1015, 0, 0, 2516, 39,
84 0, 1621, 282, 3845, 4229, 0, 1841, 0, 0, 0, 0, 854, 2217, 0, 0, 4222,
85 0, 928, 0, 0, 0, 1497, 0, 87, 0, 1814, 0, 2009, 0, 0, 0, 1943,
86 3767, 2080, 0, 0, 0, 0, 890, 3718, 0, 0, 0, 0, 0, 122, 0, 557,
87 3246, 3879, 726, 2140, 0, 0, 0, 0, 0, 1342, 0, 0, 640, 0, 0, 0,
88 0, 3488, 75, 455, 1633, 3886, 0, 0, 450, 276, 635, 4303, 0, 902, 0, 4224,
89 3563, 0, 0, 0, 167, 0, 0, 0, 618, 0, 0, 0, 2264, 0, 1840, 0,
90 0, 0, 79, 0, 0, 0, 0, 1911, 0, 0, 1985, 2542, 0, 0, 0, 0,
91 629, 0, 1060, 4165, 3516, 1371, 294, 0, 0, 0, 0, 0, 3197, 3505, 0, 0,
92 0, 2496, 0, 0, 0, 577, 0, 129, 4201, 0, 0, 3032, 0, 1191, 0, 3255,
93 0, 1822, 0, 1759, 0, 0, 704, 0, 0, 0, 2693, 3956, 0, 976, 0, 0,
94 3146, 0, 661, 467, 295, 0, 0, 3930, 2685, 0, 1443, 0, 0, 1064, 799, 0,
95 0, 0, 0, 0, 313, 271, 1814, 0, 264, 1578, 0, 0, 0, 119, 0, 2704,
96 0, 0, 3846, 513, 0, 0, 0, 0, 0, 0, 0, 0, 3986, 2208, 989, 0,
97 1208, 3028, 0, 0, 3738, 0, 3933, 0, 0, 0, 160, 1689, 0, 4258, 0, 2732,
98 531, 0, 0, 179, 0, 0, 0, 2896, 2326, 0, 1124, 0, 4216, 2033, 0, 0,
99 1979, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 943, 0, 0, 586,
100 0, 1069, 980, 3259, 0, 598, 0, 0, 606, 1847, 0, 420, 0, 0, 0, 0,
101 0, 0, 0, 0, 0, 0, 4289, 3572, 0, 669, 0, 0, 0, 2071, 0, 0,
102 0, 0, 1045, 2161, 0, 180, 0, 91, 0, 583, 0, 1210, 76, 0, 0, 0,
103 134, 0, 3808, 371, 0, 743, 0, 0, 0, 0, 0, 329, 1558, 0, 515, 0,
104 1897, 1517, 0, 0, 0, 4247, 1406, 3798, 2347, 1886, 1971, 0, 0, 0, 0, 0,
105 2150, 0, 357, 0, 0, 0, 127, 0, 0, 0, 889, 3318, 370, 0, 0, 4187,
106 0, 0, 311, 0, 0, 0, 0, 0, 3932, 0, 0, 3692, 0, 334, 0, 0,
107 0, 799, 0, 1774, 0, 3743, 3573, 0, 0, 0, 0, 0, 1790, 0, 4140, 0,
108 545, 0, 0, 683, 0, 649, 3684, 0, 0, 956, 0, 0, 0, 1454, 0, 0,
109 0, 0, 1294, 1350, 0, 1141, 0, 608, 0, 506, 0, 0, 1100, 879, 0, 0,
110 699, 459, 2256, 772, 690, 0, 0, 0, 2892, 0, 0, 1488, 219, 0, 848, 240,
111 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 833, 1555, 0, 3696, 0,
112 0, 572, 0, 279, 0, 0, 0, 2668, 0, 2117, 0, 0, 0, 0, 0, 3401,
113 3933, 0, 1969, 0, 0, 0, 0, 70, 0, 0, 917, 0, 0, 0, 1109, 0,
114 0, 1708, 1459, 0, 1742, 0, 0, 0, 1246, 0, 0, 0, 0, 1565, 0, 0,
115 0, 0, 3489, 1923, 1587, 0, 0, 374, 0, 3728, 0, 0, 0, 1444, 2351, 0,
116 550, 184, 0, 0, 0, 0, 3176, 0, 0, 0, 1055, 0, 1051, 0, 1559, 0,
117 464, 3426, 0, 0, 4281, 0, 0, 0, 0, 0, 0, 1393, 0, 124, 0, 190,
118 0, 0, 3772, 0, 0, 0, 0, 0, 0, 0, 0, 483, 0, 0, 578, 1203,
119 0, 0, 2191, 0, 1564, 0, 0, 0, 0, 0, 2662, 0, 724, 0, 6, 203,
120 0, 1985, 0, 1418, 500, 0, 2216, 556, 2144, 763, 0, 0, 469, 594, 1664, 0,
121 607, 0, 3288, 2626, 0, 2427, 0, 0, 152, 0, 0, 3655, 3588, 0, 0, 0,
122 0, 0, 0, 3966, 0, 2408, 4227, 1093, 0, 1838, 0, 0, 0, 1278, 0, 0,
123 2130, 3949, 3123, 3627, 0, 1421, 0, 1926, 0, 0, 0, 0, 0, 0, 2859, 2609,
124 2102, 3973, 1993, 460, 0, 0, 0, 1613, 0, 734, 1302, 0, 0, 3084, 0, 0,
125 0, 377, 341, 0, 0, 1560, 0, 1127, 0, 542, 248, 3643, 145, 0, 0, 235,
126 1788, 1508, 0, 0, 0, 3445, 0, 1150, 0, 2063, 0, 0, 386, 2022, 0, 0,
127 236, 752, 3339, 57, 2534, 28, 0, 36, 0, 2881, 80, 556, 0, 0, 0, 2502,
128 0, 3590, 0, 0, 630, 0, 0, 611, 3695, 0, 3922, 1224, 458, 0, 542, 0,
129 0, 0, 64, 1038, 0, 0, 2993, 0, 0, 0, 2592, 0, 0, 0, 1376, 0,
130 0, 3490, 1289, 0, 106, 615, 3616, 0, 3083, 0, 4040, 0, 0, 0, 0, 0,
131 0, 1958, 1634, 2040, 3673, 1421, 0, 452, 1457, 1612, 0, 0, 1268, 2391, 0, 0,
132 0, 1398, 421, 0, 0, 0, 0, 0, 859, 0, 0, 1028, 3496, 3479, 0, 0,
133 0, 284, 0, 1885, 1043, 3591, 0, 0, 0, 0, 569, 0, 3251, 3152, 471, 3576,
134 0, 1808, 948, 1966, 0, 0, 0, 0, 0, 2466, 598, 183, 0, 0, 0, 1139,
135 0, 0, 0, 0, 0, 661, 0, 2060, 386, 3989, 3792, 601, 496, 1777, 1477, 1345,
136 1886, 0, 0, 0, 0, 1151, 0, 149, 0, 2055, 3801, 0, 2042, 1782, 0, 2089,
137 0, 0, 1047, 1198, 1234, 0, 0, 1082, 1408, 1500, 0, 0, 234, 2332, 3403, 3837,
138 1597, 0, 0, 1270, 1229, 1541, 89, 1344, 0, 0, 0, 3828, 908, 0, 0, 2408,
139 1442, 853, 0, 4093, 0, 759, 0, 0, 1446, 3811, 989, 0, 4191, 1960, 0, 495,
140 891, 0, 741, 3641, 0, 3372, 1267, 1758, 0, 0, 3830, 4222, 0, 606, 0, 0,
141 0, 2442, 0, 894, 1310, 963, 0, 0, 0, 2927, 1919, 356, 0, 18, 0, 0,
142 4293, 4149, 2320, 3203, 0, 3160, 3911, 0, 3697, 2012, 2705, 0, 0, 0, 4011, 0,
143 0, 0, 4157, 1717, 0, 0, 1080, 1400, 388, 471, 2098, 0, 133, 1369, 0, 0,
144 446, 592, 0, 0, 1761, 575, 1889, 0, 0, 0, 1489, 3050, 0, 0, 73, 3729,
145 493, 34, 328, 2899, 207, 550, 2305, 579, 0, 0, 3208, 1335, 1370, 4187, 263, 799,
146 0, 0, 3807, 1527, 0, 3046, 0, 385, 0, 93, 0, 539, 2492, 314, 2134, 949,
147 2393, 3700, 885, 20, 0, 0, 2856, 1153, 0, 0, 0, 0, 1063, 0, 0, 0,
148 2434, 4294, 0, 1034, 0, 0, 0, 0, 0, 0, 678, 1342, 2931, 1261, 0, 0,
149 1916, 0, 0, 1588, 0, 736, 37, 808, 1062, 846, 264, 1242, 3458, 0, 355, 678,
150 767, 0, 3953, 3897, 0, 0, 0, 0, 1979, 0, 0, 399, 0, 0, 0, 1169,
151 946, 0, 0, 0, 2265, 1354, 1237, 0, 0, 0, 0, 0, 2775, 0, 254, 2877,
152 0, 3765, 0, 0, 466, 3396, 0, 0, 1460, 171, 3031, 1337, 1691, 0, 0, 3662,
153 1601, 0, 2852, 3592, 373, 1115, 0, 588, 0, 0, 0, 1468, 0, 3886, 3674, 173,
154 3592, 0, 0, 1819, 0, 3991, 3633, 0, 0, 4153, 2986, 0, 0, 105, 2659, 0,
155 0, 1694, 0, 900, 0, 1200, 0, 0, 952, 1731, 0, 2963, 0, 1811, 0, 619,
156 0, 3951, 0, 453, 0, 555, 639, 2060, 3284, 1334, 0, 381, 3300, 0, 0, 0,
157 618, 263, 3996, 1189, 0, 0, 2500, 0, 394, 0, 0, 1740, 0, 3158, 3281, 975,
158 0, 421, 3933, 909, 801, 0, 0, 321, 0, 1526, 0, 1389, 0, 2195, 0, 4296,
159 734, 0, 0, 3984, 536, 752, 4213, 156, 134, 0, 3669, 0, 0, 3061, 0, 0,
160 0, 2245, 0, 0, 564, 3225, 3181, 448, 0, 0, 2997, 0, 0, 0, 0, 3188,
161 0, 1834, 0, 0, 2372, 0, 26, 358, 582, 1401, 0, 0, 0, 1540, 1424, 1865,
162 0, 4269, 673, 2536, 576, 1287, 899, 1174, 0, 0, 909, 0, 694, 0, 0, 3271,
163 3350, 211, 0, 0, 1798, 993, 0, 3216, 3503, 0, 1879, 0, 0, 158, 1817, 0,
164 0, 0, 582, 94, 1265, 4250, 0, 2486, 3792, 0, 0, 0, 0, 3992, 0, 4028,
165 3379, 0, 0, 252, 3874, 2446, 2284, 3556, 0, 0, 0, 1338, 0, 266, 0, 0,
166 0, 0, 571, 3464, 0, 0, 168, 0, 0, 1687, 1135, 0, 0, 551, 0, 1383,
167 1303, 340, 0, 1898, 1092, 0, 204, 0, 2128, 0, 1428, 773, 4245, 94, 874, 1329,
168 1970, 2420, 0, 0, 0, 500, 1751, 1884, 1152, 543, 0, 1708, 121, 994, 12, 0,
169 0, 2293, 0, 0, 0, 0, 0, 0, 611, 2119, 0, 0, 116, 0, 518, 0,
170 3599, 855, 0, 781, 0, 2049, 3285, 586, 0, 1034, 419, 965, 3050, 901, 954, 1303,
171 0, 102, 1162, 1405, 456, 1791, 0, 3778, 0, 0, 1864, 1773, 0, 1120, 0, 0,
172 2244, 3393, 3098, 4259, 0, 246, 0, 0, 131, 0, 3154, 0, 814, 0, 0, 1976,
173 0, 558, 0, 256, 0, 1932, 4240, 0, 398, 0, 2703, 1657, 0, 1863, 1210, 0,
174 1563, 1503, 0, 0, 2719, 2435, 3696, 273, 0, 2068, 0, 4168, 3922, 1757, 1108, 0,
175 1773, 18, 0, 3625, 495, 786, 0, 0, 1765, 0, 0, 0, 1664, 0, 783, 2591,
176 0, 43, 0, 1426, 1129, 559, 0, 0, 1296, 929, 283, 0, 0, 1092, 967, 137,
177 3824, 3951, 2101, 0, 1002, 0, 687, 1752, 2506, 0, 97, 0, 0, 2138, 0, 2856,
178 1556, 0, 0, 36, 1283, 0, 1356, 0, 1116, 1706, 0, 0, 3266, 2724, 196, 3946,
179 0, 31, 3972, 0, 0, 399, 4195, 2626, 0, 390, 0, 100, 812, 0, 1834, 1514,
180 0, 1360, 0, 0, 0, 631, 1102, 0, 4190, 149, 0, 1717, 1445, 0, 215, 0,
181 41, 0, 0, 243, 0, 0, 0, 1712, 0, 3405, 0, 1255, 518, 3794, 4279, 464,
182 810, 2146, 4134, 1040, 0, 0, 2320, 0, 0, 0, 1024, 0, 1536, 0, 710, 0,
183 0, 904, 0, 0, 932, 0, 1385, 3806, 0, 1486, 2431, 0, 0, 153, 0, 575,
184 0, 2156, 4178, 0, 4107, 228, 3780, 3356, 0, 1895, 818, 0, 1454, 0, 3604, 697,
185 0, 0, 1116, 1327, 1792, 3695, 2368, 1472, 0, 2007, 0, 456, 1883, 1732, 0, 1151,
186 1571, 0, 0, 0, 964, 797, 0, 1239, 3425, 0, 0, 63, 1750, 0, 0, 0,
187 0, 0, 3923, 0, 1131, 403, 1575, 1081, 871, 1825, 3911, 0, 746, 424, 0, 1,
188 0, 949, 4056, 0, 0, 1214, 0, 2429, 0, 0, 0, 1536, 3298, 1155, 1851, 1312,
189 0, 1795, 1906, 0, 0, 2993, 0, 82, 0, 0, 1967, 0, 0, 0, 1233, 363,
190 832, 1676, 0, 0, 3653, 1931, 879, 1213, 2048, 1714, 0, 1568, 0, 0, 1062, 4059,
191 0, 2404, 3069, 0, 0, 0, 0, 0, 0, 365, 0, 0, 184, 2028, 1337, 0,
192 0, 0, 4091, 950, 2053, 2042, 541, 2938, 1603, 1725, 0, 0, 2573, 0, 1086, 550,
193 1206, 934, 0, 0, 1613, 3691, 2023, 1393, 828, 149, 0, 2069, 0, 1326, 2605, 0,
194 0, 0, 1575, 0, 1113, 0, 0, 1071, 0, 1943, 3820, 0, 130, 0, 0, 891,
195 0, 3988, 0, 3287, 0, 0, 570, 0, 0, 1332, 1056, 0, 0, 3315, 983, 404,
196 5, 451, 686, 0, 0, 3542, 0, 563, 0, 0, 817, 4134, 2845, 3460, 0, 224,
197 2173, 428, 392, 3334, 181, 0, 0, 1453, 0, 0, 1152, 1431, 2287, 347, 0, 3980,
198 1299, 0, 0, 2965, 0, 2019, 0, 1995, 121, 925, 0, 0, 0, 1062, 4220, 838,
199 3388, 809, 0, 0, 0, 0, 1208, 1826, 0, 0, 503, 530, 0, 0, 1309, 0,
200 0, 742, 4201, 0, 0, 0, 709, 2651, 0, 803, 96, 0, 1112, 2573, 0, 0,
201 0, 1745, 1120, 2844, 0, 0, 2871, 0, 123, 0, 2104, 721, 0, 0, 0, 1657,
202 0, 3350, 110, 0, 2909, 623, 205, 0, 2817, 1711, 1864, 2706, 0, 0, 0, 0,
203 0, 3637, 0, 0, 0, 0, 0, 155, 1420, 1464, 0, 152, 0, 0, 0, 533,
204 1907, 181, 0, 217, 2325, 0, 0, 11, 3800, 1753, 0, 1744, 0, 2810, 2021, 0,
205 1009, 0, 0, 0, 0, 112, 0, 3071, 0, 2592, 574, 0, 0, 0, 603, 1789,
206 3165, 0, 3402, 0, 0, 0, 0, 911, 1100, 0, 261, 1635, 2047, 1373, 2499, 0,
207 0, 0, 160, 0, 11, 0, 0, 1815, 0, 0, 54, 711, 0, 109, 0, 0,
208 1184, 1834, 3799, 1985, 0, 0, 0, 1436, 4134, 1355, 2681, 1825, 0, 0, 0, 0,
209 127, 341, 112, 1999, 3801, 3414, 1290, 0, 0, 1548, 0, 0, 1134, 0, 0, 4206,
210 0, 86, 1445, 0, 0, 76, 0, 1789, 0, 0, 1611, 4189, 1153, 77, 3174, 0,
211 0, 1912, 0, 1406, 0, 0, 683, 936, 0, 0, 0, 0, 600, 0, 48, 726,
212 0, 0, 1258, 2024, 2882, 0, 1248, 0, 1617, 1898, 4193, 0, 1580, 837, 0, 0,
213 2826, 1033, 2523, 4226, 212, 0, 0, 3920, 126, 984, 116, 0, 0, 4082, 0, 814,
214 4214, 2603, 1042, 0, 24, 0, 229, 1210, 0, 0, 913, 3566, 3809, 1214, 0, 1500,
215 821, 770, 0, 0, 0, 0, 2348, 1482, 0, 104, 2014, 508, 3207, 2668, 409, 0,
216 1581, 0, 3900, 0, 1865, 1379, 1458, 0, 0, 0, 3955, 1462, 652, 2444, 4230, 0,
217 327, 885, 0, 1873, 90, 1198, 0, 637, 1553, 1027, 0, 913, 297, 0, 1914, 695,
218 0, 0, 2435, 2135, 983, 0, 0, 0, 0, 0, 3472, 1022, 0, 1748, 0, 3195,
219 0, 0, 1477, 0, 482, 0, 0, 0, 0, 0, 1396, 0, 0, 0, 0, 1157,
220 1780, 0, 1220, 3381, 0, 1534, 1115, 642, 1579, 1333, 0, 0, 2555, 0, 800, 3846,
221 0, 0, 4065, 1107, 0, 0, 0, 695, 0, 3889, 1542, 3897, 0, 1582, 0, 146,
222 0, 1380, 0, 2558, 0, 0, 1513, 0, 1458, 1704, 1709, 0, 4308, 1256, 898, 0,
223 0, 1177, 159, 0, 1792, 1773, 2254, 0, 0, 0, 1314, 2788, 0, 0, 0, 1454,
224 1776, 2574, 2011, 2056, 1519, 3731, 693, 0, 0, 791, 0, 929, 556, 2867, 1315, 0,
225 0, 914, 2817, 0, 0, 0, 1977, 932, 0, 3231, 0, 0, 0, 202, 2547, 1852,
226 1348, 4286, 0, 402, 0, 1319, 0, 3102, 0, 481, 875, 0, 0, 1450, 3973, 1379,
227 0, 0, 0, 638, 0, 573, 0, 2417, 1543, 0, 0, 0, 115, 171, 0, 0,
228 1505, 1218, 3571, 1759, 0, 3450, 1038, 198, 439, 0, 6, 3697, 906, 3460, 0, 120,
229 2175, 1919, 1653, 0, 1736, 2116, 121, 4147, 1391, 0, 30, 101, 106, 3753, 3957, 0,
230 378, 2410, 0, 1582, 0, 0, 0, 0, 0, 733, 0, 3453, 2651, 0, 3976, 0,
231 1899, 0, 2425, 616, 4127, 0, 1728, 3580, 2415, 0, 0, 0, 0, 1447, 1797, 1750,
232 0, 0, 0, 0, 385, 0, 0, 725, 1698, 0, 708, 855, 54, 874, 1500, 923,
233 2067, 3403, 0, 0, 4264, 239, 712, 2639, 3843, 0, 0, 897, 1294, 1849, 978, 3470,
234 0, 0, 1029, 0, 1209, 895, 0, 475, 0, 0, 0, 0, 810, 0, 2388, 922,
235 3241, 1745, 0, 3957, 0, 0, 13, 0, 0, 1087, 1774, 0, 1320, 409, 1804, 2883,
236 0, 532, 0, 1987, 2166, 0, 1126, 0, 4078, 0, 4147, 354, 3332, 0, 4114, 0,
237 3557, 0, 0, 0, 0, 1767, 79, 1666, 288, 2059, 0, 857, 2460, 2065, 0, 953,
238 259, 0, 390, 572, 0, 0, 0, 671, 232, 589, 0, 3712, 726, 1927, 0, 0,
239 0, 0, 0, 418, 0, 3536, 1547, 566, 1552, 191, 3836, 0, 0, 3494, 717, 0,
240 0, 0, 269, 0, 847, 0, 3519, 0, 651, 2459, 2031, 0, 647, 0, 1113, 4298,
241 511, 485, 0, 903, 1679, 3829, 3731, 0, 0, 3049, 415, 0, 1313, 2005, 813, 0,
242 2235, 0, 1523, 0, 1204, 0, 0, 534, 1171, 1195, 3966, 0, 3143, 0, 1656, 3888,
243 0, 1216, 2066, 966, 1769, 0, 0, 1361, 0, 1869, 0, 2110, 0, 0, 1057, 2581,
244 1270, 1978, 0, 4180, 888, 0, 1075, 4051, 4222, 1612, 2011, 1562, 0, 0, 0, 2377,
245 1292, 0, 4106, 954, 498, 4189, 1321, 783, 583, 0, 281, 1050, 0, 165, 0, 1096,
246 733, 0, 0, 1930, 0, 0, 0, 171, 2114, 2421, 2800, 1958, 1649, 0, 0, 1220,
247 1561, 614, 0, 242, 0, 66, 0, 2131, 0, 3670, 1563, 0, 0, 41, 0, 0,
248 4132, 0, 0, 0, 0, 0, 1225, 0, 0, 852, 1661, 0, 83, 2101, 1652, 3259,
249 4187, 1778, 0, 0, 607, 0, 4202, 4255, 3933, 205, 0, 4282, 0, 885, 0, 0,
250 950, 149, 1345, 1011, 0, 731, 1016, 0, 3807, 3912, 3512, 4196, 0, 894, 0, 319,
251 0, 0, 2032, 0, 687, 1949, 1117, 60, 0, 0, 1322, 0, 620, 243, 3314, 0,
252 0, 0, 827, 657, 1374, 0, 0, 1956, 716, 3273, 0, 3442, 599, 0, 187, 0,
253 0, 1721, 933, 2038, 0, 3807, 1061, 653, 0, 2464, 1614, 0, 0, 0, 634, 4054,
254 582, 4259, 0, 656, 4084, 1953, 0, 0, 533, 0, 0, 0, 1652, 3693, 1341, 1266,
255 4279, 1599, 0, 3614, 0, 0, 0, 0, 1608, 4177, 0, 4120, 0, 771, 724, 1672,
256 0, 3890, 0, 0, 0, 2234, 161, 0, 0, 3658, 1041, 371, 218, 0, 2103, 0,
257 1259, 1303, 3940, 501, 2086, 785, 0, 990, 0, 2736, 121, 0, 0, 182, 0, 2486,
258 3502, 4141, 1675, 1520, 0, 961, 0, 0, 2172, 1603, 0, 0, 199, 333, 1642, 1700,
259 0, 1688, 2881, 600, 0, 1131, 4, 4227, 0, 0, 0, 0, 1116, 1659, 1152, 4190,
260 3952, 0, 3301, 2348, 4073, 0, 343, 4040, 0, 0, 2533, 2896, 1917, 1258, 0, 0,
261 0, 4297, 0, 0, 0, 3057, 1546, 0, 427, 0, 2129, 0, 0, 1525, 0, 0,
262 0, 2299, 0, 828, 3382, 2657, 15, 3142, 308, 1332, 0, 1699, 1377, 0, 515, 0,
263 0, 1807, 0, 4225, 1516, 3476, 1537, 2385, 1755, 477, 0, 0, 0, 654, 2377, 958,
264 0, 3739, 9, 63, 0, 1161, 1706, 0, 604, 3941, 0, 108, 0, 764, 364, 2120,
265 4217, 3155, 2010, 3249, 460, 584, 1516, 3527, 4191, 998, 626, 3063, 0, 0, 1110, 3608,
266 379, 0, 4058, 0, 1449, 1229, 1344, 3075, 3088, 3487, 1018, 3992, 886, 0, 532, 0,
267 0, 2232, 0, 0, 1510, 0, 252, 4262, 0, 3431, 1407, 1897, 640, 153, 0, 3758,
268 39, 4194, 0, 0, 3878, 0, 4143, 1937, 3329, 3528, 3566, 4074, 499, 332, 1497, 1674,
269 4135, 854, 397, 3371, 0, 0, 594, 0, 2994, 776, 0, 1114, 1336, 3259, 0, 1338,
270 0, 3262, 78, 4238, 328, 3357, 2085, 0, 364, 3639, 0, 0, 534, 0, 566, 0,
271 1023, 0, 2973, 0, 2157, 0, 1667, 0, 356, 0, 147, 1916, 4087, 4095, 33, 1871,
272 0, 1130, 3091, 919, 1168, 1403, 370, 779, 4026, 0, 3401, 649, 0, 3426, 0, 0,
273 0, 0, 2282, 1654, 3177, 253, 4125, 0, 717, 4235, 146, 0, 1397, 445, 3074, 0,
274 0, 3320, 0, 1974, 0, 3775, 0, 1523, 0, 1637, 973, 1159, 0, 0, 1948, 3690,
275 0, 749, 0, 3830, 756, 389, 1412, 0, 900, 0, 0, 0, 0, 0, 842, 58,
276 3903, 0, 1200, 0, 0, 1148, 970, 1224, 1720, 1547, 0, 567, 0, 1840, 2084, 850,
277 0, 0, 3261, 0, 1154, 357, 0, 0, 0, 0, 0, 0, 2988, 3614, 2065, 471,
278 0, 3102, 1794, 0, 0, 792, 0, 492, 1613, 0, 807, 0, 1133, 0, 1658, 395,
279 2100, 2022, 3419, 352, 1853, 2082, 4251, 487, 378, 0, 0, 2534, 3014, 1501, 578, 3413,
280 0, 1424, 413, 4140, 402, 1854, 0, 1649, 944, 0, 3748, 0, 4137, 3167, 362, 998,
281 969, 2267, 0, 0, 107, 0, 278, 3416, 2542, 2436, 623, 796, 0, 0, 0, 3734,
282 1068, 0, 0, 0, 2253, 0, 4161, 451, 4260, 2544, 4101, 1914, 536, 866, 0, 1290,
283 1111, 0, 3321, 1045, 0, 801, 1869, 895, 3277, 671, 0, 0, 2523, 4145, 1950, 0,
284 1837, 1, 0, 0, 634, 0, 0, 0, 0, 1215, 1613, 0, 0, 0, 36, 0,
285 2200, 0, 427, 0, 2771, 856, 3304, 0, 0, 1699, 450, 3592, 4245, 0, 52, 792,
286 1431, 0, 0, 897, 1405, 969, 201, 2992, 0, 935, 0, 0, 2083, 0, 4158, 291,
287 1013, 732, 0, 0, 93, 3753, 0, 0, 0, 1615, 3887, 3705, 2000, 0, 2646, 0,
288 1703, 4046, 0, 1965, 867, 100, 722, 1757, 2783, 4024, 0, 691, 0, 0, 2646, 359,
289 198, 760, 0, 3956, 0, 4295, 1754, 1531, 361, 0, 0, 0, 0, 491, 0, 3482,
290 1652, 0, 0, 0, 9, 262, 570, 230, 1682, 0, 1364, 1465, 1639, 0, 188, 0,
291 138, 0, 0, 1911, 3323, 639, 0, 0, 1022, 435, 444, 3813, 1589, 3636, 2140, 3106,
292 0, 1463, 0, 1868, 0, 4180, 2094, 982, 0, 2259, 0, 2813, 3142, 1178, 3427, 0,
293 0, 3932, 1618, 913, 0, 0, 1401, 0, 0, 4111, 0, 0, 0, 3392, 0, 2559,
294 0, 1306, 2081, 1328, 2272, 0, 0, 0, 1270, 1085, 642, 0, 3915, 616, 92, 391,
295 0, 218, 330, 500, 0, 374, 3505, 1118, 331, 0, 3211, 2384, 0, 0, 186, 4045,
296 0, 4288, 623, 735, 0, 483, 0, 1130, 0, 2617, 1606, 747, 269, 3098, 539, 0,
297 2762, 0, 3536, 4142, 2917, 1039, 2460, 1049, 760, 0, 0, 0, 0, 0, 1435, 1369,
298 3828, 0, 0, 0, 0, 283, 0, 2020, 2046, 0, 3519, 1499, 1583, 0, 943, 778,
299 2064, 0, 3318, 2677, 4269, 0, 1681, 644, 613, 1768, 2877, 1392, 3590, 0, 0, 2035,
300 754, 671, 0, 0, 0, 0, 0, 3230, 494, 1690, 1577, 3604, 0, 321, 940, 111,
301 585, 0, 0, 1882, 0, 0, 1360, 0, 2888, 0, 0, 0, 2036, 4296, 1173, 3597,
302 4069, 536, 1616, 1528, 0, 801, 0, 0, 0, 1951, 869, 431, 3921, 223, 3411, 0,
303 320, 0, 2409, 745, 696, 478, 763, 0, 98, 1530, 1279, 1059, 1195, 2054, 0, 540,
304 1096, 2508, 0, 219, 1619, 0, 0, 2443, 0, 0, 1714, 1016, 1393, 1735, 0, 777,
305 132, 0, 0, 3372, 514, 370};
306
MangledHashG(const char * key,const int * T)307 int MangledHashG(const char *key, const int *T)
308 {
309 int sum = 0;
310
311 for (int i = 0; key[i] != '\0'; i++)
312 {
313 sum += T[i] * key[i];
314 sum %= 4310;
315 }
316 return mangledkG[sum];
317 }
318
MangledPerfectHash(const char * key)319 int MangledPerfectHash(const char *key)
320 {
321 if (strlen(key) > 40)
322 return 0;
323
324 return (MangledHashG(key, mangledkT1) + MangledHashG(key, mangledkT2)) % 4310;
325 }
326
327 constexpr int unmangledkT1[] = {207, 155, 313, 341, 135, 9, 177, 167, 360, 307, 114, 9, 262,
328 85, 106, 135, 125, 176, 277, 193, 223, 149, 331, 274, 358, 54};
329 constexpr int unmangledkT2[] = {55, 288, 187, 350, 175, 265, 361, 369, 259, 121, 129, 161, 363,
330 266, 318, 176, 200, 164, 169, 340, 207, 119, 142, 43, 174, 235};
331 constexpr int unmangledkG[] = {
332 0, 0, 0, 0, 0, 0, 0, 304, 0, 0, 0, 69, 0, 13, 0, 0, 0, 0, 0,
333 0, 0, 328, 0, 0, 134, 0, 122, 0, 161, 0, 332, 0, 0, 0, 0, 0, 0, 177,
334 0, 138, 0, 0, 198, 0, 42, 157, 0, 0, 332, 0, 229, 248, 76, 238, 111, 0, 0,
335 104, 0, 0, 164, 369, 0, 57, 0, 0, 112, 0, 146, 141, 0, 0, 342, 0, 0, 209,
336 0, 0, 0, 314, 0, 185, 0, 218, 232, 302, 213, 0, 316, 268, 362, 23, 201, 0, 0,
337 29, 0, 0, 0, 182, 0, 0, 206, 0, 221, 367, 0, 0, 0, 0, 268, 127, 90, 211,
338 0, 137, 0, 0, 0, 140, 0, 0, 172, 0, 294, 0, 28, 0, 73, 0, 36, 69, 315,
339 308, 209, 0, 0, 0, 0, 0, 23, 112, 0, 0, 0, 0, 5, 19, 306, 153, 0, 361,
340 0, 188, 0, 349, 0, 101, 181, 323, 125, 156, 71, 0, 242, 20, 0, 0, 356, 152, 147,
341 301, 348, 0, 53, 254, 103, 0, 0, 134, 38, 0, 182, 0, 0, 0, 166, 37, 115, 16,
342 0, 0, 47, 15, 0, 30, 0, 0, 0, 248, 244, 145, 0, 31, 0, 0, 0, 6, 69,
343 281, 58, 20, 12, 164, 131, 33, 0, 346, 164, 19, 11, 120, 197, 247, 30, 153, 84, 137,
344 75, 343, 137, 5, 167, 74, 0, 193, 0, 358, 0, 5, 0, 164, 209, 0, 0, 102, 117,
345 183, 0, 0, 0, 0, 0, 0, 94, 128, 0, 114, 31, 0, 0, 0, 106, 283, 151, 0,
346 224, 91, 0, 369, 168, 195, 105, 53, 0, 0, 57, 47, 17, 0, 0, 0, 17, 155, 133,
347 279, 0, 277, 0, 328, 344, 0, 109, 204, 0, 146, 241, 149, 290, 159, 87, 0, 0, 0,
348 361, 240, 14, 353, 169, 213, 0, 0, 363, 176, 251, 342, 0, 99, 258, 0, 208, 291, 1,
349 79, 0, 0, 0, 66, 32, 0, 266, 191, 116, 0, 0, 150, 21, 0, 240, 163, 46, 0,
350 74, 96, 208, 0, 179, 0, 309, 193, 53, 24, 0, 58, 146, 0, 317, 126, 119, 135, 0,
351 0, 21, 0, 263, 179, 62, 302, 138, 0};
352
UnmangledHashG(const char * key,const int * T)353 int UnmangledHashG(const char *key, const int *T)
354 {
355 int sum = 0;
356
357 for (int i = 0; key[i] != '\0'; i++)
358 {
359 sum += T[i] * key[i];
360 sum %= 370;
361 }
362 return unmangledkG[sum];
363 }
364
UnmangledPerfectHash(const char * key)365 int UnmangledPerfectHash(const char *key)
366 {
367 if (strlen(key) > 26)
368 return 0;
369
370 return (UnmangledHashG(key, unmangledkT1) + UnmangledHashG(key, unmangledkT2)) % 370;
371 }
372
373 } // namespace
374
375 namespace sh
376 {
377
378 template <>
379 const size_t ImmutableString::FowlerNollVoHash<4>::kFnvPrime = 16777619u;
380
381 template <>
382 const size_t ImmutableString::FowlerNollVoHash<4>::kFnvOffsetBasis = 0x811c9dc5u;
383
384 template <>
385 const size_t ImmutableString::FowlerNollVoHash<8>::kFnvPrime =
386 static_cast<size_t>(1099511628211ull);
387
388 template <>
389 const size_t ImmutableString::FowlerNollVoHash<8>::kFnvOffsetBasis =
390 static_cast<size_t>(0xcbf29ce484222325ull);
391
mangledNameHash() const392 uint32_t ImmutableString::mangledNameHash() const
393 {
394 return MangledPerfectHash(data());
395 }
396
unmangledNameHash() const397 uint32_t ImmutableString::unmangledNameHash() const
398 {
399 return UnmangledPerfectHash(data());
400 }
401
402 } // namespace sh
403