//src/cmd/compile/internal/gc/walk.go
ifw:=t.Elem().Width;w<=1024{// 1024 must match runtime/map.go:maxZero
n=mkcall1(mapfn(mapaccess1[fast],t),types.NewPtr(t.Elem()),init,typename(t),map_,key)}else{z:=zeroaddr(w)n=mkcall1(mapfn("mapaccess1_fat",t),types.NewPtr(t.Elem()),init,typename(t),map_,key,z)}
funcmapaccess2(t*maptype,h*hmap,keyunsafe.Pointer)(unsafe.Pointer,bool){// 竟态分析 && 内存扫描
// ...
ifh==nil||h.count==0{// map 为空,或者size 为 0, 直接返回
}ifh.flags&hashWriting!=0{// 这里会检查是否在写,如果在写直接panic
throw("concurrent map read and map write")}// 拿到对应key 的hash,以及 bucket
alg:=t.key.alghash:=alg.hash(key,uintptr(h.hash0))m:=bucketMask(h.B)b:=(*bmap)(unsafe.Pointer(uintptr(h.buckets)+(hash&m)*uintptr(t.bucketsize)))ifc:=h.oldbuckets;c!=nil{if!h.sameSizeGrow(){// There used to be half as many buckets; mask down one more power of two.
m>>=1}oldb:=(*bmap)(unsafe.Pointer(uintptr(c)+(hash&m)*uintptr(t.bucketsize)))if!evacuated(oldb){b=oldb}}// 获取tophash 值
top:=tophash(hash)bucketloop:// 遍历解决冲突的链表
for;b!=nil;b=b.overflow(t){// 遍历每个bucket 上的kv
fori:=uintptr(0);i<bucketCnt;i++{// 先匹配 tophash
// ...
// 获取k
k:=add(unsafe.Pointer(b),dataOffset+i*uintptr(t.keysize))ift.indirectkey(){k=*((*unsafe.Pointer)(k))}// 判断k是否相等,如果相等直接返回,否则继续遍历
ifalg.equal(key,k){v:=add(unsafe.Pointer(b),dataOffset+bucketCnt*uintptr(t.keysize)+i*uintptr(t.valuesize))ift.indirectvalue(){v=*((*unsafe.Pointer)(v))}returnv,true}}}returnunsafe.Pointer(&zeroVal[0]),false}