...
1
2
3
4
5 package goobj
6
7 import "internal/buildcfg"
8
9
10
11
12
13
14
15 func NBuiltin() int {
16 return len(builtins)
17 }
18
19
20
21 func BuiltinName(i int) (string, int) {
22 return builtins[i].name, builtins[i].abi
23 }
24
25
26
27 func BuiltinIdx(name string, abi int) int {
28 i, ok := builtinMap[name]
29 if !ok {
30 return -1
31 }
32 if buildcfg.Experiment.RegabiWrappers && builtins[i].abi != abi {
33 return -1
34 }
35 return i
36 }
37
38
39
40 var builtinMap map[string]int
41
42 func init() {
43 builtinMap = make(map[string]int, len(builtins))
44 for i, b := range builtins {
45 builtinMap[b.name] = i
46 }
47 }
48
View as plain text