...
1
2
3
4
5 package abi
6
7 type InterfaceSwitch struct {
8 Cache *InterfaceSwitchCache
9 NCases int
10
11
12
13 Cases [1]*InterfaceType
14 }
15
16 type InterfaceSwitchCache struct {
17 Mask uintptr
18 Entries [1]InterfaceSwitchCacheEntry
19 }
20
21 type InterfaceSwitchCacheEntry struct {
22
23 Typ uintptr
24
25 Case int
26
27 Itab uintptr
28 }
29
30 const go122InterfaceSwitchCache = true
31
32 func UseInterfaceSwitchCache(goarch string) bool {
33 if !go122InterfaceSwitchCache {
34 return false
35 }
36
37
38 switch goarch {
39 case "amd64", "arm64", "loong64", "mips", "mipsle", "mips64", "mips64le", "ppc64", "ppc64le", "riscv64", "s390x":
40 return true
41 default:
42 return false
43 }
44 }
45
46 type TypeAssert struct {
47 Cache *TypeAssertCache
48 Inter *InterfaceType
49 CanFail bool
50 }
51 type TypeAssertCache struct {
52 Mask uintptr
53 Entries [1]TypeAssertCacheEntry
54 }
55 type TypeAssertCacheEntry struct {
56
57 Typ uintptr
58
59
60 Itab uintptr
61 }
62
View as plain text