1
2
3 package typecheck
4
5 import (
6 "cmd/compile/internal/types"
7 "cmd/internal/src"
8 )
9
10 var runtimeDecls = [...]struct {
11 name string
12 tag int
13 typ int
14 }{
15 {"newobject", funcTag, 4},
16 {"mallocgc", funcTag, 8},
17 {"panicdivide", funcTag, 9},
18 {"panicshift", funcTag, 9},
19 {"panicmakeslicelen", funcTag, 9},
20 {"panicmakeslicecap", funcTag, 9},
21 {"throwinit", funcTag, 9},
22 {"panicwrap", funcTag, 9},
23 {"gopanic", funcTag, 11},
24 {"gorecover", funcTag, 14},
25 {"goschedguarded", funcTag, 9},
26 {"goPanicIndex", funcTag, 16},
27 {"goPanicIndexU", funcTag, 18},
28 {"goPanicSliceAlen", funcTag, 16},
29 {"goPanicSliceAlenU", funcTag, 18},
30 {"goPanicSliceAcap", funcTag, 16},
31 {"goPanicSliceAcapU", funcTag, 18},
32 {"goPanicSliceB", funcTag, 16},
33 {"goPanicSliceBU", funcTag, 18},
34 {"goPanicSlice3Alen", funcTag, 16},
35 {"goPanicSlice3AlenU", funcTag, 18},
36 {"goPanicSlice3Acap", funcTag, 16},
37 {"goPanicSlice3AcapU", funcTag, 18},
38 {"goPanicSlice3B", funcTag, 16},
39 {"goPanicSlice3BU", funcTag, 18},
40 {"goPanicSlice3C", funcTag, 16},
41 {"goPanicSlice3CU", funcTag, 18},
42 {"goPanicSliceConvert", funcTag, 16},
43 {"printbool", funcTag, 19},
44 {"printfloat", funcTag, 21},
45 {"printint", funcTag, 23},
46 {"printhex", funcTag, 25},
47 {"printuint", funcTag, 25},
48 {"printcomplex", funcTag, 27},
49 {"printstring", funcTag, 29},
50 {"printpointer", funcTag, 30},
51 {"printuintptr", funcTag, 31},
52 {"printiface", funcTag, 30},
53 {"printeface", funcTag, 30},
54 {"printslice", funcTag, 30},
55 {"printnl", funcTag, 9},
56 {"printsp", funcTag, 9},
57 {"printlock", funcTag, 9},
58 {"printunlock", funcTag, 9},
59 {"concatstring2", funcTag, 34},
60 {"concatstring3", funcTag, 35},
61 {"concatstring4", funcTag, 36},
62 {"concatstring5", funcTag, 37},
63 {"concatstrings", funcTag, 39},
64 {"cmpstring", funcTag, 40},
65 {"intstring", funcTag, 43},
66 {"slicebytetostring", funcTag, 44},
67 {"slicebytetostringtmp", funcTag, 45},
68 {"slicerunetostring", funcTag, 48},
69 {"stringtoslicebyte", funcTag, 50},
70 {"stringtoslicerune", funcTag, 53},
71 {"slicecopy", funcTag, 54},
72 {"decoderune", funcTag, 55},
73 {"countrunes", funcTag, 56},
74 {"convI2I", funcTag, 58},
75 {"convT", funcTag, 59},
76 {"convTnoptr", funcTag, 59},
77 {"convT16", funcTag, 61},
78 {"convT32", funcTag, 63},
79 {"convT64", funcTag, 64},
80 {"convTstring", funcTag, 65},
81 {"convTslice", funcTag, 68},
82 {"assertE2I", funcTag, 69},
83 {"assertE2I2", funcTag, 70},
84 {"assertI2I", funcTag, 69},
85 {"assertI2I2", funcTag, 70},
86 {"panicdottypeE", funcTag, 71},
87 {"panicdottypeI", funcTag, 71},
88 {"panicnildottype", funcTag, 72},
89 {"ifaceeq", funcTag, 73},
90 {"efaceeq", funcTag, 73},
91 {"fastrand", funcTag, 74},
92 {"makemap64", funcTag, 76},
93 {"makemap", funcTag, 77},
94 {"makemap_small", funcTag, 78},
95 {"mapaccess1", funcTag, 79},
96 {"mapaccess1_fast32", funcTag, 80},
97 {"mapaccess1_fast64", funcTag, 81},
98 {"mapaccess1_faststr", funcTag, 82},
99 {"mapaccess1_fat", funcTag, 83},
100 {"mapaccess2", funcTag, 84},
101 {"mapaccess2_fast32", funcTag, 85},
102 {"mapaccess2_fast64", funcTag, 86},
103 {"mapaccess2_faststr", funcTag, 87},
104 {"mapaccess2_fat", funcTag, 88},
105 {"mapassign", funcTag, 79},
106 {"mapassign_fast32", funcTag, 80},
107 {"mapassign_fast32ptr", funcTag, 89},
108 {"mapassign_fast64", funcTag, 81},
109 {"mapassign_fast64ptr", funcTag, 89},
110 {"mapassign_faststr", funcTag, 82},
111 {"mapiterinit", funcTag, 90},
112 {"mapdelete", funcTag, 90},
113 {"mapdelete_fast32", funcTag, 91},
114 {"mapdelete_fast64", funcTag, 92},
115 {"mapdelete_faststr", funcTag, 93},
116 {"mapiternext", funcTag, 94},
117 {"mapclear", funcTag, 95},
118 {"makechan64", funcTag, 97},
119 {"makechan", funcTag, 98},
120 {"chanrecv1", funcTag, 100},
121 {"chanrecv2", funcTag, 101},
122 {"chansend1", funcTag, 103},
123 {"closechan", funcTag, 30},
124 {"writeBarrier", varTag, 105},
125 {"typedmemmove", funcTag, 106},
126 {"typedmemclr", funcTag, 107},
127 {"typedslicecopy", funcTag, 108},
128 {"selectnbsend", funcTag, 109},
129 {"selectnbrecv", funcTag, 110},
130 {"selectsetpc", funcTag, 111},
131 {"selectgo", funcTag, 112},
132 {"block", funcTag, 9},
133 {"makeslice", funcTag, 113},
134 {"makeslice64", funcTag, 114},
135 {"makeslicecopy", funcTag, 115},
136 {"growslice", funcTag, 117},
137 {"unsafeslice", funcTag, 118},
138 {"unsafeslice64", funcTag, 119},
139 {"unsafeslicecheckptr", funcTag, 119},
140 {"memmove", funcTag, 120},
141 {"memclrNoHeapPointers", funcTag, 121},
142 {"memclrHasPointers", funcTag, 121},
143 {"memequal", funcTag, 122},
144 {"memequal0", funcTag, 123},
145 {"memequal8", funcTag, 123},
146 {"memequal16", funcTag, 123},
147 {"memequal32", funcTag, 123},
148 {"memequal64", funcTag, 123},
149 {"memequal128", funcTag, 123},
150 {"f32equal", funcTag, 124},
151 {"f64equal", funcTag, 124},
152 {"c64equal", funcTag, 124},
153 {"c128equal", funcTag, 124},
154 {"strequal", funcTag, 124},
155 {"interequal", funcTag, 124},
156 {"nilinterequal", funcTag, 124},
157 {"memhash", funcTag, 125},
158 {"memhash0", funcTag, 126},
159 {"memhash8", funcTag, 126},
160 {"memhash16", funcTag, 126},
161 {"memhash32", funcTag, 126},
162 {"memhash64", funcTag, 126},
163 {"memhash128", funcTag, 126},
164 {"f32hash", funcTag, 126},
165 {"f64hash", funcTag, 126},
166 {"c64hash", funcTag, 126},
167 {"c128hash", funcTag, 126},
168 {"strhash", funcTag, 126},
169 {"interhash", funcTag, 126},
170 {"nilinterhash", funcTag, 126},
171 {"int64div", funcTag, 127},
172 {"uint64div", funcTag, 128},
173 {"int64mod", funcTag, 127},
174 {"uint64mod", funcTag, 128},
175 {"float64toint64", funcTag, 129},
176 {"float64touint64", funcTag, 130},
177 {"float64touint32", funcTag, 131},
178 {"int64tofloat64", funcTag, 132},
179 {"int64tofloat32", funcTag, 134},
180 {"uint64tofloat64", funcTag, 135},
181 {"uint64tofloat32", funcTag, 136},
182 {"uint32tofloat64", funcTag, 137},
183 {"complex128div", funcTag, 138},
184 {"getcallerpc", funcTag, 139},
185 {"getcallersp", funcTag, 139},
186 {"racefuncenter", funcTag, 31},
187 {"racefuncexit", funcTag, 9},
188 {"raceread", funcTag, 31},
189 {"racewrite", funcTag, 31},
190 {"racereadrange", funcTag, 140},
191 {"racewriterange", funcTag, 140},
192 {"msanread", funcTag, 140},
193 {"msanwrite", funcTag, 140},
194 {"msanmove", funcTag, 141},
195 {"asanread", funcTag, 140},
196 {"asanwrite", funcTag, 140},
197 {"checkptrAlignment", funcTag, 142},
198 {"checkptrArithmetic", funcTag, 144},
199 {"libfuzzerTraceCmp1", funcTag, 145},
200 {"libfuzzerTraceCmp2", funcTag, 146},
201 {"libfuzzerTraceCmp4", funcTag, 147},
202 {"libfuzzerTraceCmp8", funcTag, 148},
203 {"libfuzzerTraceConstCmp1", funcTag, 145},
204 {"libfuzzerTraceConstCmp2", funcTag, 146},
205 {"libfuzzerTraceConstCmp4", funcTag, 147},
206 {"libfuzzerTraceConstCmp8", funcTag, 148},
207 {"x86HasPOPCNT", varTag, 6},
208 {"x86HasSSE41", varTag, 6},
209 {"x86HasFMA", varTag, 6},
210 {"armHasVFPv4", varTag, 6},
211 {"arm64HasATOMICS", varTag, 6},
212 }
213
214
215
216 func newSig(params, results []*types.Field) *types.Type {
217 return types.NewSignature(types.NoPkg, nil, nil, params, results)
218 }
219
220 func params(tlist ...*types.Type) []*types.Field {
221 flist := make([]*types.Field, len(tlist))
222 for i, typ := range tlist {
223 flist[i] = types.NewField(src.NoXPos, nil, typ)
224 }
225 return flist
226 }
227
228 func runtimeTypes() []*types.Type {
229 var typs [149]*types.Type
230 typs[0] = types.ByteType
231 typs[1] = types.NewPtr(typs[0])
232 typs[2] = types.Types[types.TANY]
233 typs[3] = types.NewPtr(typs[2])
234 typs[4] = newSig(params(typs[1]), params(typs[3]))
235 typs[5] = types.Types[types.TUINTPTR]
236 typs[6] = types.Types[types.TBOOL]
237 typs[7] = types.Types[types.TUNSAFEPTR]
238 typs[8] = newSig(params(typs[5], typs[1], typs[6]), params(typs[7]))
239 typs[9] = newSig(nil, nil)
240 typs[10] = types.Types[types.TINTER]
241 typs[11] = newSig(params(typs[10]), nil)
242 typs[12] = types.Types[types.TINT32]
243 typs[13] = types.NewPtr(typs[12])
244 typs[14] = newSig(params(typs[13]), params(typs[10]))
245 typs[15] = types.Types[types.TINT]
246 typs[16] = newSig(params(typs[15], typs[15]), nil)
247 typs[17] = types.Types[types.TUINT]
248 typs[18] = newSig(params(typs[17], typs[15]), nil)
249 typs[19] = newSig(params(typs[6]), nil)
250 typs[20] = types.Types[types.TFLOAT64]
251 typs[21] = newSig(params(typs[20]), nil)
252 typs[22] = types.Types[types.TINT64]
253 typs[23] = newSig(params(typs[22]), nil)
254 typs[24] = types.Types[types.TUINT64]
255 typs[25] = newSig(params(typs[24]), nil)
256 typs[26] = types.Types[types.TCOMPLEX128]
257 typs[27] = newSig(params(typs[26]), nil)
258 typs[28] = types.Types[types.TSTRING]
259 typs[29] = newSig(params(typs[28]), nil)
260 typs[30] = newSig(params(typs[2]), nil)
261 typs[31] = newSig(params(typs[5]), nil)
262 typs[32] = types.NewArray(typs[0], 32)
263 typs[33] = types.NewPtr(typs[32])
264 typs[34] = newSig(params(typs[33], typs[28], typs[28]), params(typs[28]))
265 typs[35] = newSig(params(typs[33], typs[28], typs[28], typs[28]), params(typs[28]))
266 typs[36] = newSig(params(typs[33], typs[28], typs[28], typs[28], typs[28]), params(typs[28]))
267 typs[37] = newSig(params(typs[33], typs[28], typs[28], typs[28], typs[28], typs[28]), params(typs[28]))
268 typs[38] = types.NewSlice(typs[28])
269 typs[39] = newSig(params(typs[33], typs[38]), params(typs[28]))
270 typs[40] = newSig(params(typs[28], typs[28]), params(typs[15]))
271 typs[41] = types.NewArray(typs[0], 4)
272 typs[42] = types.NewPtr(typs[41])
273 typs[43] = newSig(params(typs[42], typs[22]), params(typs[28]))
274 typs[44] = newSig(params(typs[33], typs[1], typs[15]), params(typs[28]))
275 typs[45] = newSig(params(typs[1], typs[15]), params(typs[28]))
276 typs[46] = types.RuneType
277 typs[47] = types.NewSlice(typs[46])
278 typs[48] = newSig(params(typs[33], typs[47]), params(typs[28]))
279 typs[49] = types.NewSlice(typs[0])
280 typs[50] = newSig(params(typs[33], typs[28]), params(typs[49]))
281 typs[51] = types.NewArray(typs[46], 32)
282 typs[52] = types.NewPtr(typs[51])
283 typs[53] = newSig(params(typs[52], typs[28]), params(typs[47]))
284 typs[54] = newSig(params(typs[3], typs[15], typs[3], typs[15], typs[5]), params(typs[15]))
285 typs[55] = newSig(params(typs[28], typs[15]), params(typs[46], typs[15]))
286 typs[56] = newSig(params(typs[28]), params(typs[15]))
287 typs[57] = types.NewPtr(typs[5])
288 typs[58] = newSig(params(typs[1], typs[57]), params(typs[57]))
289 typs[59] = newSig(params(typs[1], typs[3]), params(typs[7]))
290 typs[60] = types.Types[types.TUINT16]
291 typs[61] = newSig(params(typs[60]), params(typs[7]))
292 typs[62] = types.Types[types.TUINT32]
293 typs[63] = newSig(params(typs[62]), params(typs[7]))
294 typs[64] = newSig(params(typs[24]), params(typs[7]))
295 typs[65] = newSig(params(typs[28]), params(typs[7]))
296 typs[66] = types.Types[types.TUINT8]
297 typs[67] = types.NewSlice(typs[66])
298 typs[68] = newSig(params(typs[67]), params(typs[7]))
299 typs[69] = newSig(params(typs[1], typs[1]), params(typs[1]))
300 typs[70] = newSig(params(typs[1], typs[2]), params(typs[2]))
301 typs[71] = newSig(params(typs[1], typs[1], typs[1]), nil)
302 typs[72] = newSig(params(typs[1]), nil)
303 typs[73] = newSig(params(typs[57], typs[7], typs[7]), params(typs[6]))
304 typs[74] = newSig(nil, params(typs[62]))
305 typs[75] = types.NewMap(typs[2], typs[2])
306 typs[76] = newSig(params(typs[1], typs[22], typs[3]), params(typs[75]))
307 typs[77] = newSig(params(typs[1], typs[15], typs[3]), params(typs[75]))
308 typs[78] = newSig(nil, params(typs[75]))
309 typs[79] = newSig(params(typs[1], typs[75], typs[3]), params(typs[3]))
310 typs[80] = newSig(params(typs[1], typs[75], typs[62]), params(typs[3]))
311 typs[81] = newSig(params(typs[1], typs[75], typs[24]), params(typs[3]))
312 typs[82] = newSig(params(typs[1], typs[75], typs[28]), params(typs[3]))
313 typs[83] = newSig(params(typs[1], typs[75], typs[3], typs[1]), params(typs[3]))
314 typs[84] = newSig(params(typs[1], typs[75], typs[3]), params(typs[3], typs[6]))
315 typs[85] = newSig(params(typs[1], typs[75], typs[62]), params(typs[3], typs[6]))
316 typs[86] = newSig(params(typs[1], typs[75], typs[24]), params(typs[3], typs[6]))
317 typs[87] = newSig(params(typs[1], typs[75], typs[28]), params(typs[3], typs[6]))
318 typs[88] = newSig(params(typs[1], typs[75], typs[3], typs[1]), params(typs[3], typs[6]))
319 typs[89] = newSig(params(typs[1], typs[75], typs[7]), params(typs[3]))
320 typs[90] = newSig(params(typs[1], typs[75], typs[3]), nil)
321 typs[91] = newSig(params(typs[1], typs[75], typs[62]), nil)
322 typs[92] = newSig(params(typs[1], typs[75], typs[24]), nil)
323 typs[93] = newSig(params(typs[1], typs[75], typs[28]), nil)
324 typs[94] = newSig(params(typs[3]), nil)
325 typs[95] = newSig(params(typs[1], typs[75]), nil)
326 typs[96] = types.NewChan(typs[2], types.Cboth)
327 typs[97] = newSig(params(typs[1], typs[22]), params(typs[96]))
328 typs[98] = newSig(params(typs[1], typs[15]), params(typs[96]))
329 typs[99] = types.NewChan(typs[2], types.Crecv)
330 typs[100] = newSig(params(typs[99], typs[3]), nil)
331 typs[101] = newSig(params(typs[99], typs[3]), params(typs[6]))
332 typs[102] = types.NewChan(typs[2], types.Csend)
333 typs[103] = newSig(params(typs[102], typs[3]), nil)
334 typs[104] = types.NewArray(typs[0], 3)
335 typs[105] = types.NewStruct(types.NoPkg, []*types.Field{types.NewField(src.NoXPos, Lookup("enabled"), typs[6]), types.NewField(src.NoXPos, Lookup("pad"), typs[104]), types.NewField(src.NoXPos, Lookup("needed"), typs[6]), types.NewField(src.NoXPos, Lookup("cgo"), typs[6]), types.NewField(src.NoXPos, Lookup("alignme"), typs[24])})
336 typs[106] = newSig(params(typs[1], typs[3], typs[3]), nil)
337 typs[107] = newSig(params(typs[1], typs[3]), nil)
338 typs[108] = newSig(params(typs[1], typs[3], typs[15], typs[3], typs[15]), params(typs[15]))
339 typs[109] = newSig(params(typs[102], typs[3]), params(typs[6]))
340 typs[110] = newSig(params(typs[3], typs[99]), params(typs[6], typs[6]))
341 typs[111] = newSig(params(typs[57]), nil)
342 typs[112] = newSig(params(typs[1], typs[1], typs[57], typs[15], typs[15], typs[6]), params(typs[15], typs[6]))
343 typs[113] = newSig(params(typs[1], typs[15], typs[15]), params(typs[7]))
344 typs[114] = newSig(params(typs[1], typs[22], typs[22]), params(typs[7]))
345 typs[115] = newSig(params(typs[1], typs[15], typs[15], typs[7]), params(typs[7]))
346 typs[116] = types.NewSlice(typs[2])
347 typs[117] = newSig(params(typs[1], typs[116], typs[15]), params(typs[116]))
348 typs[118] = newSig(params(typs[1], typs[7], typs[15]), nil)
349 typs[119] = newSig(params(typs[1], typs[7], typs[22]), nil)
350 typs[120] = newSig(params(typs[3], typs[3], typs[5]), nil)
351 typs[121] = newSig(params(typs[7], typs[5]), nil)
352 typs[122] = newSig(params(typs[3], typs[3], typs[5]), params(typs[6]))
353 typs[123] = newSig(params(typs[3], typs[3]), params(typs[6]))
354 typs[124] = newSig(params(typs[7], typs[7]), params(typs[6]))
355 typs[125] = newSig(params(typs[7], typs[5], typs[5]), params(typs[5]))
356 typs[126] = newSig(params(typs[7], typs[5]), params(typs[5]))
357 typs[127] = newSig(params(typs[22], typs[22]), params(typs[22]))
358 typs[128] = newSig(params(typs[24], typs[24]), params(typs[24]))
359 typs[129] = newSig(params(typs[20]), params(typs[22]))
360 typs[130] = newSig(params(typs[20]), params(typs[24]))
361 typs[131] = newSig(params(typs[20]), params(typs[62]))
362 typs[132] = newSig(params(typs[22]), params(typs[20]))
363 typs[133] = types.Types[types.TFLOAT32]
364 typs[134] = newSig(params(typs[22]), params(typs[133]))
365 typs[135] = newSig(params(typs[24]), params(typs[20]))
366 typs[136] = newSig(params(typs[24]), params(typs[133]))
367 typs[137] = newSig(params(typs[62]), params(typs[20]))
368 typs[138] = newSig(params(typs[26], typs[26]), params(typs[26]))
369 typs[139] = newSig(nil, params(typs[5]))
370 typs[140] = newSig(params(typs[5], typs[5]), nil)
371 typs[141] = newSig(params(typs[5], typs[5], typs[5]), nil)
372 typs[142] = newSig(params(typs[7], typs[1], typs[5]), nil)
373 typs[143] = types.NewSlice(typs[7])
374 typs[144] = newSig(params(typs[7], typs[143]), nil)
375 typs[145] = newSig(params(typs[66], typs[66]), nil)
376 typs[146] = newSig(params(typs[60], typs[60]), nil)
377 typs[147] = newSig(params(typs[62], typs[62]), nil)
378 typs[148] = newSig(params(typs[24], typs[24]), nil)
379 return typs[:]
380 }
381
View as plain text