From: Josh Bleecher Snyder Date: Fri, 21 Apr 2017 20:59:51 +0000 (-0700) Subject: cmd/compile: rename dxxx -> dxxxLSym X-Git-Tag: go1.9beta1~548 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=a544df33fd24dc3c093594aafab917621f2c317d;p=gostls13.git cmd/compile: rename dxxx -> dxxxLSym Follow-up to previous CL. gorename -from '"cmd/compile/internal/gc".duintxxLSym' -to duintxx gorename -from '"cmd/compile/internal/gc".duint8LSym' -to duint8 gorename -from '"cmd/compile/internal/gc".duint16LSym' -to duint16 gorename -from '"cmd/compile/internal/gc".duint32LSym' -to duint32 gorename -from '"cmd/compile/internal/gc".duintptrLSym' -to duintptr gorename -from '"cmd/compile/internal/gc".dbvecLSym' -to dbvec gorename -from '"cmd/compile/internal/gc".dsnameLSym' -to dsname gorename -from '"cmd/compile/internal/gc".dsymptrLSym' -to dsymptr gorename -from '"cmd/compile/internal/gc".dsymptrOffLSym' -to dsymptrOff gorename -from '"cmd/compile/internal/gc".dsymptrWeakOffLSym' -to dsymptrWeakOff Passes toolstash-check. Change-Id: I007f57340f9e8b1468553242556ae25a71167e8c Reviewed-on: https://go-review.googlesource.com/41397 Run-TryBot: Josh Bleecher Snyder Reviewed-by: Matthew Dempsky --- diff --git a/src/cmd/compile/internal/gc/obj.go b/src/cmd/compile/internal/gc/obj.go index 7d94335679..85d2f5c62b 100644 --- a/src/cmd/compile/internal/gc/obj.go +++ b/src/cmd/compile/internal/gc/obj.go @@ -222,7 +222,7 @@ func dumpglobls() { for _, s := range funcsyms { sf := s.Pkg.Lookup(funcsymname(s)) - dsymptrLSym(sf.Linksym(), 0, s.Linksym(), 0) + dsymptr(sf.Linksym(), 0, s.Linksym(), 0) ggloblsym(sf, int32(Widthptr), obj.DUPOK|obj.RODATA) } @@ -251,7 +251,7 @@ func addGCLocals() { } } -func duintxxLSym(s *obj.LSym, off int, v uint64, wid int) int { +func duintxx(s *obj.LSym, off int, v uint64, wid int) int { if s.Type == 0 { // TODO(josharian): Do this in obj.prepwrite instead. s.Type = objabi.SDATA @@ -263,27 +263,27 @@ func duintxxLSym(s *obj.LSym, off int, v uint64, wid int) int { return off + wid } -func duint8LSym(s *obj.LSym, off int, v uint8) int { - return duintxxLSym(s, off, uint64(v), 1) +func duint8(s *obj.LSym, off int, v uint8) int { + return duintxx(s, off, uint64(v), 1) } -func duint16LSym(s *obj.LSym, off int, v uint16) int { - return duintxxLSym(s, off, uint64(v), 2) +func duint16(s *obj.LSym, off int, v uint16) int { + return duintxx(s, off, uint64(v), 2) } -func duint32LSym(s *obj.LSym, off int, v uint32) int { - return duintxxLSym(s, off, uint64(v), 4) +func duint32(s *obj.LSym, off int, v uint32) int { + return duintxx(s, off, uint64(v), 4) } -func duintptrLSym(s *obj.LSym, off int, v uint64) int { - return duintxxLSym(s, off, v, Widthptr) +func duintptr(s *obj.LSym, off int, v uint64) int { + return duintxx(s, off, v, Widthptr) } -func dbvecLSym(s *obj.LSym, off int, bv bvec) int { +func dbvec(s *obj.LSym, off int, bv bvec) int { // Runtime reads the bitmaps as byte arrays. Oblige. for j := 0; int32(j) < bv.n; j += 8 { word := bv.b[j/32] - off = duint8LSym(s, off, uint8(word>>(uint(j)%32))) + off = duint8(s, off, uint8(word>>(uint(j)%32))) } return off } @@ -309,7 +309,7 @@ func stringsym(s string) (data *obj.LSym) { if !symdata.SeenGlobl() { // string data - off := dsnameLSym(symdata, 0, s) + off := dsname(symdata, 0, s) ggloblLSym(symdata, int32(off), obj.DUPOK|obj.RODATA|obj.LOCAL) } @@ -324,37 +324,37 @@ func slicebytes(nam *Node, s string, len int) { sym := localpkg.Lookup(symname) sym.Def = asTypesNode(newname(sym)) - off := dsnameLSym(sym.Linksym(), 0, s) + off := dsname(sym.Linksym(), 0, s) ggloblsym(sym, int32(off), obj.NOPTR|obj.LOCAL) if nam.Op != ONAME { Fatalf("slicebytes %v", nam) } off = int(nam.Xoffset) - off = dsymptrLSym(nam.Sym.Linksym(), off, sym.Linksym(), 0) - off = duintxxLSym(nam.Sym.Linksym(), off, uint64(len), Widthint) - duintxxLSym(nam.Sym.Linksym(), off, uint64(len), Widthint) + off = dsymptr(nam.Sym.Linksym(), off, sym.Linksym(), 0) + off = duintxx(nam.Sym.Linksym(), off, uint64(len), Widthint) + duintxx(nam.Sym.Linksym(), off, uint64(len), Widthint) } -func dsnameLSym(s *obj.LSym, off int, t string) int { +func dsname(s *obj.LSym, off int, t string) int { s.WriteString(Ctxt, int64(off), len(t), t) return off + len(t) } -func dsymptrLSym(s *obj.LSym, off int, x *obj.LSym, xoff int) int { +func dsymptr(s *obj.LSym, off int, x *obj.LSym, xoff int) int { off = int(Rnd(int64(off), int64(Widthptr))) s.WriteAddr(Ctxt, int64(off), Widthptr, x, int64(xoff)) off += Widthptr return off } -func dsymptrOffLSym(s *obj.LSym, off int, x *obj.LSym, xoff int) int { +func dsymptrOff(s *obj.LSym, off int, x *obj.LSym, xoff int) int { s.WriteOff(Ctxt, int64(off), x, int64(xoff)) off += 4 return off } -func dsymptrWeakOffLSym(s *obj.LSym, off int, x *obj.LSym) int { +func dsymptrWeakOff(s *obj.LSym, off int, x *obj.LSym) int { s.WriteWeakOff(Ctxt, int64(off), x, 0) off += 4 return off diff --git a/src/cmd/compile/internal/gc/pgen.go b/src/cmd/compile/internal/gc/pgen.go index 9c67d624e5..7ae9816f9c 100644 --- a/src/cmd/compile/internal/gc/pgen.go +++ b/src/cmd/compile/internal/gc/pgen.go @@ -31,8 +31,8 @@ func emitptrargsmap() { if Curfn.Type.Results().NumFields() > 0 { nbitmap = 2 } - off := duint32LSym(lsym, 0, uint32(nbitmap)) - off = duint32LSym(lsym, off, uint32(bv.n)) + off := duint32(lsym, 0, uint32(nbitmap)) + off = duint32(lsym, off, uint32(bv.n)) var xoffset int64 if Curfn.IsMethod() { xoffset = 0 @@ -44,11 +44,11 @@ func emitptrargsmap() { onebitwalktype1(Curfn.Type.Params(), &xoffset, bv) } - off = dbvecLSym(lsym, off, bv) + off = dbvec(lsym, off, bv) if Curfn.Type.Results().NumFields() > 0 { xoffset = 0 onebitwalktype1(Curfn.Type.Results(), &xoffset, bv) - off = dbvecLSym(lsym, off, bv) + off = dbvec(lsym, off, bv) } ggloblLSym(lsym, int32(off), obj.RODATA|obj.LOCAL) diff --git a/src/cmd/compile/internal/gc/plive.go b/src/cmd/compile/internal/gc/plive.go index 96fbb327f2..ac2f91841a 100644 --- a/src/cmd/compile/internal/gc/plive.go +++ b/src/cmd/compile/internal/gc/plive.go @@ -1276,12 +1276,12 @@ func livenessprintdebug(lv *Liveness) { // remaining bytes are the raw bitmaps. func livenessemit(lv *Liveness, argssym, livesym *obj.LSym) { args := bvalloc(argswords(lv)) - aoff := duint32LSym(argssym, 0, uint32(len(lv.livevars))) // number of bitmaps - aoff = duint32LSym(argssym, aoff, uint32(args.n)) // number of bits in each bitmap + aoff := duint32(argssym, 0, uint32(len(lv.livevars))) // number of bitmaps + aoff = duint32(argssym, aoff, uint32(args.n)) // number of bits in each bitmap locals := bvalloc(localswords(lv)) - loff := duint32LSym(livesym, 0, uint32(len(lv.livevars))) // number of bitmaps - loff = duint32LSym(livesym, loff, uint32(locals.n)) // number of bits in each bitmap + loff := duint32(livesym, 0, uint32(len(lv.livevars))) // number of bitmaps + loff = duint32(livesym, loff, uint32(locals.n)) // number of bits in each bitmap for _, live := range lv.livevars { args.Clear() @@ -1289,8 +1289,8 @@ func livenessemit(lv *Liveness, argssym, livesym *obj.LSym) { onebitlivepointermap(lv, live, lv.vars, args, locals) - aoff = dbvecLSym(argssym, aoff, args) - loff = dbvecLSym(livesym, loff, locals) + aoff = dbvec(argssym, aoff, args) + loff = dbvec(livesym, loff, locals) } // Give these LSyms content-addressable names, diff --git a/src/cmd/compile/internal/gc/reflect.go b/src/cmd/compile/internal/gc/reflect.go index 23795b89b9..d954a899a9 100644 --- a/src/cmd/compile/internal/gc/reflect.go +++ b/src/cmd/compile/internal/gc/reflect.go @@ -459,7 +459,7 @@ func dgopkgpath(s *types.Sym, ot int, pkg *types.Pkg) int { func dgopkgpathLSym(s *obj.LSym, ot int, pkg *types.Pkg) int { if pkg == nil { - return duintxxLSym(s, ot, 0, Widthptr) + return duintxx(s, ot, 0, Widthptr) } if pkg == localpkg && myimportpath == "" { @@ -469,17 +469,17 @@ func dgopkgpathLSym(s *obj.LSym, ot int, pkg *types.Pkg) int { // Every package that imports this one directly defines the symbol. // See also https://groups.google.com/forum/#!topic/golang-dev/myb9s53HxGQ. ns := Ctxt.Lookup(`type..importpath."".`) - return dsymptrLSym(s, ot, ns, 0) + return dsymptr(s, ot, ns, 0) } dimportpath(pkg) - return dsymptrLSym(s, ot, pkg.Pathsym, 0) + return dsymptr(s, ot, pkg.Pathsym, 0) } // dgopkgpathOffLSym writes an offset relocation in s at offset ot to the pkg path symbol. func dgopkgpathOffLSym(s *obj.LSym, ot int, pkg *types.Pkg) int { if pkg == nil { - return duintxxLSym(s, ot, 0, 4) + return duintxx(s, ot, 0, 4) } if pkg == localpkg && myimportpath == "" { // If we don't know the full import path of the package being compiled @@ -488,11 +488,11 @@ func dgopkgpathOffLSym(s *obj.LSym, ot int, pkg *types.Pkg) int { // Every package that imports this one directly defines the symbol. // See also https://groups.google.com/forum/#!topic/golang-dev/myb9s53HxGQ. ns := Ctxt.Lookup(`type..importpath."".`) - return dsymptrOffLSym(s, ot, ns, 0) + return dsymptrOff(s, ot, ns, 0) } dimportpath(pkg) - return dsymptrOffLSym(s, ot, pkg.Pathsym, 0) + return dsymptrOff(s, ot, pkg.Pathsym, 0) } // isExportedField reports whether a struct field is exported. @@ -521,7 +521,7 @@ func dnameField(s *types.Sym, ot int, spkg *types.Pkg, ft *types.Field) int { fpkg = nil } nsym := dname(name, ft.Note, fpkg, isExported) - return dsymptrLSym(s.Linksym(), ot, nsym, 0) + return dsymptr(s.Linksym(), ot, nsym, 0) } // dnameData writes the contents of a reflect.name into s at offset ot. @@ -628,10 +628,10 @@ func dextratype(s *types.Sym, ot int, t *types.Type, dataAdd int) int { Fatalf("methods are too far away on %v: %d", t, dataAdd) } - ot = duint16LSym(s.Linksym(), ot, uint16(mcount)) - ot = duint16LSym(s.Linksym(), ot, 0) - ot = duint32LSym(s.Linksym(), ot, uint32(dataAdd)) - ot = duint32LSym(s.Linksym(), ot, 0) + ot = duint16(s.Linksym(), ot, uint16(mcount)) + ot = duint16(s.Linksym(), ot, 0) + ot = duint32(s.Linksym(), ot, uint32(dataAdd)) + ot = duint32(s.Linksym(), ot, 0) return ot } @@ -664,7 +664,7 @@ func dextratypeData(s *types.Sym, ot int, t *types.Type) int { } nsym := dname(a.name, "", pkg, exported) - ot = dsymptrOffLSym(lsym, ot, nsym, 0) + ot = dsymptrOff(lsym, ot, nsym, 0) ot = dmethodptrOffLSym(lsym, ot, dtypesym(a.mtype).Linksym()) ot = dmethodptrOffLSym(lsym, ot, a.isym.Linksym()) ot = dmethodptrOffLSym(lsym, ot, a.tsym.Linksym()) @@ -673,7 +673,7 @@ func dextratypeData(s *types.Sym, ot int, t *types.Type) int { } func dmethodptrOffLSym(s *obj.LSym, ot int, x *obj.LSym) int { - duintxxLSym(s, ot, 0, 4) + duintxx(s, ot, 0, 4) r := obj.Addrel(s) r.Off = int32(ot) r.Siz = 4 @@ -820,10 +820,10 @@ func dcommontype(s *types.Sym, ot int, t *types.Type) int { // str nameOff // ptrToThis typeOff // } - ot = duintptrLSym(s.Linksym(), ot, uint64(t.Width)) - ot = duintptrLSym(s.Linksym(), ot, uint64(ptrdata)) + ot = duintptr(s.Linksym(), ot, uint64(t.Width)) + ot = duintptr(s.Linksym(), ot, uint64(ptrdata)) - ot = duint32LSym(s.Linksym(), ot, typehash(t)) + ot = duint32(s.Linksym(), ot, typehash(t)) var tflag uint8 if uncommonSize(t) != 0 { @@ -852,7 +852,7 @@ func dcommontype(s *types.Sym, ot int, t *types.Type) int { } } - ot = duint8LSym(s.Linksym(), ot, tflag) + ot = duint8(s.Linksym(), ot, tflag) // runtime (and common sense) expects alignment to be a power of two. i := int(t.Align) @@ -863,8 +863,8 @@ func dcommontype(s *types.Sym, ot int, t *types.Type) int { if i&(i-1) != 0 { Fatalf("invalid alignment %d for %v", t.Align, t) } - ot = duint8LSym(s.Linksym(), ot, t.Align) // align - ot = duint8LSym(s.Linksym(), ot, t.Align) // fieldAlign + ot = duint8(s.Linksym(), ot, t.Align) // align + ot = duint8(s.Linksym(), ot, t.Align) // fieldAlign i = kinds[t.Etype] if !types.Haspointers(t) { @@ -876,23 +876,23 @@ func dcommontype(s *types.Sym, ot int, t *types.Type) int { if useGCProg { i |= objabi.KindGCProg } - ot = duint8LSym(s.Linksym(), ot, uint8(i)) // kind + ot = duint8(s.Linksym(), ot, uint8(i)) // kind if algsym == nil { - ot = dsymptrLSym(s.Linksym(), ot, dcommontype_algarray.Linksym(), int(alg)*sizeofAlg) + ot = dsymptr(s.Linksym(), ot, dcommontype_algarray.Linksym(), int(alg)*sizeofAlg) } else { - ot = dsymptrLSym(s.Linksym(), ot, algsym.Linksym(), 0) + ot = dsymptr(s.Linksym(), ot, algsym.Linksym(), 0) } - ot = dsymptrLSym(s.Linksym(), ot, gcsym.Linksym(), 0) // gcdata + ot = dsymptr(s.Linksym(), ot, gcsym.Linksym(), 0) // gcdata nsym := dname(p, "", nil, exported) - ot = dsymptrOffLSym(s.Linksym(), ot, nsym, 0) // str + ot = dsymptrOff(s.Linksym(), ot, nsym, 0) // str // ptrToThis if sptr == nil { - ot = duint32LSym(s.Linksym(), ot, 0) + ot = duint32(s.Linksym(), ot, 0) } else if sptrWeak { - ot = dsymptrWeakOffLSym(s.Linksym(), ot, sptr.Linksym()) + ot = dsymptrWeakOff(s.Linksym(), ot, sptr.Linksym()) } else { - ot = dsymptrOffLSym(s.Linksym(), ot, sptr.Linksym(), 0) + ot = dsymptrOff(s.Linksym(), ot, sptr.Linksym(), 0) } return ot @@ -1128,24 +1128,24 @@ ok: t2 := types.NewSlice(t.Elem()) s2 := dtypesym(t2) ot = dcommontype(s, ot, t) - ot = dsymptrLSym(s.Linksym(), ot, s1.Linksym(), 0) - ot = dsymptrLSym(s.Linksym(), ot, s2.Linksym(), 0) - ot = duintptrLSym(s.Linksym(), ot, uint64(t.NumElem())) + ot = dsymptr(s.Linksym(), ot, s1.Linksym(), 0) + ot = dsymptr(s.Linksym(), ot, s2.Linksym(), 0) + ot = duintptr(s.Linksym(), ot, uint64(t.NumElem())) ot = dextratype(s, ot, t, 0) case TSLICE: // ../../../../runtime/type.go:/sliceType s1 := dtypesym(t.Elem()) ot = dcommontype(s, ot, t) - ot = dsymptrLSym(s.Linksym(), ot, s1.Linksym(), 0) + ot = dsymptr(s.Linksym(), ot, s1.Linksym(), 0) ot = dextratype(s, ot, t, 0) case TCHAN: // ../../../../runtime/type.go:/chanType s1 := dtypesym(t.Elem()) ot = dcommontype(s, ot, t) - ot = dsymptrLSym(s.Linksym(), ot, s1.Linksym(), 0) - ot = duintptrLSym(s.Linksym(), ot, uint64(t.ChanDir())) + ot = dsymptr(s.Linksym(), ot, s1.Linksym(), 0) + ot = duintptr(s.Linksym(), ot, uint64(t.ChanDir())) ot = dextratype(s, ot, t, 0) case TFUNC: @@ -1167,8 +1167,8 @@ ok: if isddd { outCount |= 1 << 15 } - ot = duint16LSym(s.Linksym(), ot, uint16(inCount)) - ot = duint16LSym(s.Linksym(), ot, uint16(outCount)) + ot = duint16(s.Linksym(), ot, uint16(inCount)) + ot = duint16(s.Linksym(), ot, uint16(outCount)) if Widthptr == 8 { ot += 4 // align for *rtype } @@ -1178,13 +1178,13 @@ ok: // Array of rtype pointers follows funcType. for _, t1 := range t.Recvs().Fields().Slice() { - ot = dsymptrLSym(s.Linksym(), ot, dtypesym(t1.Type).Linksym(), 0) + ot = dsymptr(s.Linksym(), ot, dtypesym(t1.Type).Linksym(), 0) } for _, t1 := range t.Params().Fields().Slice() { - ot = dsymptrLSym(s.Linksym(), ot, dtypesym(t1.Type).Linksym(), 0) + ot = dsymptr(s.Linksym(), ot, dtypesym(t1.Type).Linksym(), 0) } for _, t1 := range t.Results().Fields().Slice() { - ot = dsymptrLSym(s.Linksym(), ot, dtypesym(t1.Type).Linksym(), 0) + ot = dsymptr(s.Linksym(), ot, dtypesym(t1.Type).Linksym(), 0) } case TINTER: @@ -1203,9 +1203,9 @@ ok: } ot = dgopkgpath(s, ot, tpkg) - ot = dsymptrLSym(s.Linksym(), ot, s.Linksym(), ot+Widthptr+2*Widthint+uncommonSize(t)) - ot = duintxxLSym(s.Linksym(), ot, uint64(n), Widthint) - ot = duintxxLSym(s.Linksym(), ot, uint64(n), Widthint) + ot = dsymptr(s.Linksym(), ot, s.Linksym(), ot+Widthptr+2*Widthint+uncommonSize(t)) + ot = duintxx(s.Linksym(), ot, uint64(n), Widthint) + ot = duintxx(s.Linksym(), ot, uint64(n), Widthint) dataAdd := imethodSize() * n ot = dextratype(s, ot, t, dataAdd) @@ -1219,8 +1219,8 @@ ok: } nsym := dname(a.name, "", pkg, exported) - ot = dsymptrOffLSym(lsym, ot, nsym, 0) - ot = dsymptrOffLSym(lsym, ot, dtypesym(a.type_).Linksym(), 0) + ot = dsymptrOff(lsym, ot, nsym, 0) + ot = dsymptrOff(lsym, ot, dtypesym(a.type_).Linksym(), 0) } // ../../../../runtime/type.go:/mapType @@ -1230,29 +1230,29 @@ ok: s3 := dtypesym(mapbucket(t)) s4 := dtypesym(hmap(t)) ot = dcommontype(s, ot, t) - ot = dsymptrLSym(s.Linksym(), ot, s1.Linksym(), 0) - ot = dsymptrLSym(s.Linksym(), ot, s2.Linksym(), 0) - ot = dsymptrLSym(s.Linksym(), ot, s3.Linksym(), 0) - ot = dsymptrLSym(s.Linksym(), ot, s4.Linksym(), 0) + ot = dsymptr(s.Linksym(), ot, s1.Linksym(), 0) + ot = dsymptr(s.Linksym(), ot, s2.Linksym(), 0) + ot = dsymptr(s.Linksym(), ot, s3.Linksym(), 0) + ot = dsymptr(s.Linksym(), ot, s4.Linksym(), 0) if t.Key().Width > MAXKEYSIZE { - ot = duint8LSym(s.Linksym(), ot, uint8(Widthptr)) - ot = duint8LSym(s.Linksym(), ot, 1) // indirect + ot = duint8(s.Linksym(), ot, uint8(Widthptr)) + ot = duint8(s.Linksym(), ot, 1) // indirect } else { - ot = duint8LSym(s.Linksym(), ot, uint8(t.Key().Width)) - ot = duint8LSym(s.Linksym(), ot, 0) // not indirect + ot = duint8(s.Linksym(), ot, uint8(t.Key().Width)) + ot = duint8(s.Linksym(), ot, 0) // not indirect } if t.Val().Width > MAXVALSIZE { - ot = duint8LSym(s.Linksym(), ot, uint8(Widthptr)) - ot = duint8LSym(s.Linksym(), ot, 1) // indirect + ot = duint8(s.Linksym(), ot, uint8(Widthptr)) + ot = duint8(s.Linksym(), ot, 1) // indirect } else { - ot = duint8LSym(s.Linksym(), ot, uint8(t.Val().Width)) - ot = duint8LSym(s.Linksym(), ot, 0) // not indirect + ot = duint8(s.Linksym(), ot, uint8(t.Val().Width)) + ot = duint8(s.Linksym(), ot, 0) // not indirect } - ot = duint16LSym(s.Linksym(), ot, uint16(mapbucket(t).Width)) - ot = duint8LSym(s.Linksym(), ot, uint8(obj.Bool2int(isreflexive(t.Key())))) - ot = duint8LSym(s.Linksym(), ot, uint8(obj.Bool2int(needkeyupdate(t.Key())))) + ot = duint16(s.Linksym(), ot, uint16(mapbucket(t).Width)) + ot = duint8(s.Linksym(), ot, uint8(obj.Bool2int(isreflexive(t.Key())))) + ot = duint8(s.Linksym(), ot, uint8(obj.Bool2int(needkeyupdate(t.Key())))) ot = dextratype(s, ot, t, 0) case TPTR32, TPTR64: @@ -1268,7 +1268,7 @@ ok: s1 := dtypesym(t.Elem()) ot = dcommontype(s, ot, t) - ot = dsymptrLSym(s.Linksym(), ot, s1.Linksym(), 0) + ot = dsymptr(s.Linksym(), ot, s1.Linksym(), 0) ot = dextratype(s, ot, t, 0) // ../../../../runtime/type.go:/structType @@ -1296,9 +1296,9 @@ ok: } } ot = dgopkgpath(s, ot, pkg) - ot = dsymptrLSym(s.Linksym(), ot, s.Linksym(), ot+Widthptr+2*Widthint+uncommonSize(t)) - ot = duintxxLSym(s.Linksym(), ot, uint64(n), Widthint) - ot = duintxxLSym(s.Linksym(), ot, uint64(n), Widthint) + ot = dsymptr(s.Linksym(), ot, s.Linksym(), ot+Widthptr+2*Widthint+uncommonSize(t)) + ot = duintxx(s.Linksym(), ot, uint64(n), Widthint) + ot = duintxx(s.Linksym(), ot, uint64(n), Widthint) dataAdd := n * structfieldSize() ot = dextratype(s, ot, t, dataAdd) @@ -1306,7 +1306,7 @@ ok: for _, f := range t.Fields().Slice() { // ../../../../runtime/type.go:/structField ot = dnameField(s, ot, pkg, f) - ot = dsymptrLSym(s.Linksym(), ot, dtypesym(f.Type).Linksym(), 0) + ot = dsymptr(s.Linksym(), ot, dtypesym(f.Type).Linksym(), 0) offsetAnon := uint64(f.Offset) << 1 if offsetAnon>>1 != uint64(f.Offset) { Fatalf("%v: bad field offset for %s", t, f.Sym.Name) @@ -1314,7 +1314,7 @@ ok: if f.Embedded != 0 { offsetAnon |= 1 } - ot = duintptrLSym(s.Linksym(), ot, offsetAnon) + ot = duintptr(s.Linksym(), ot, offsetAnon) } } @@ -1461,18 +1461,18 @@ func dumptypestructs() { // unused [2]byte // fun [1]uintptr // variable sized // } - o := dsymptrLSym(i.sym.Linksym(), 0, dtypesym(i.itype).Linksym(), 0) - o = dsymptrLSym(i.sym.Linksym(), o, dtypesym(i.t).Linksym(), 0) - o += Widthptr // skip link field - o = duint32LSym(i.sym.Linksym(), o, typehash(i.t)) // copy of type hash - o += 4 // skip bad/inhash/unused fields - o += len(imethods(i.itype)) * Widthptr // skip fun method pointers + o := dsymptr(i.sym.Linksym(), 0, dtypesym(i.itype).Linksym(), 0) + o = dsymptr(i.sym.Linksym(), o, dtypesym(i.t).Linksym(), 0) + o += Widthptr // skip link field + o = duint32(i.sym.Linksym(), o, typehash(i.t)) // copy of type hash + o += 4 // skip bad/inhash/unused fields + o += len(imethods(i.itype)) * Widthptr // skip fun method pointers // at runtime the itab will contain pointers to types, other itabs and // method functions. None are allocated on heap, so we can use obj.NOPTR. ggloblsym(i.sym, int32(o), int16(obj.DUPOK|obj.NOPTR)) ilink := itablinkpkg.Lookup(i.t.ShortString() + "," + i.itype.ShortString()) - dsymptrLSym(ilink.Linksym(), 0, i.sym.Linksym(), 0) + dsymptr(ilink.Linksym(), 0, i.sym.Linksym(), 0) ggloblsym(ilink, int32(Widthptr), int16(obj.DUPOK|obj.RODATA)) } @@ -1488,15 +1488,15 @@ func dumptypestructs() { // typ typeOff // pointer to symbol // } nsym := dname(p.s.Name, "", nil, true) - ot = dsymptrOffLSym(s, ot, nsym, 0) - ot = dsymptrOffLSym(s, ot, dtypesym(p.t).Linksym(), 0) + ot = dsymptrOff(s, ot, nsym, 0) + ot = dsymptrOff(s, ot, dtypesym(p.t).Linksym(), 0) } ggloblLSym(s, int32(ot), int16(obj.RODATA)) ot = 0 s = Ctxt.Lookup("go.plugin.exports") for _, p := range ptabs { - ot = dsymptrLSym(s, ot, p.s.Linksym(), 0) + ot = dsymptr(s, ot, p.s.Linksym(), 0) } ggloblLSym(s, int32(ot), int16(obj.RODATA)) } @@ -1574,8 +1574,8 @@ func dalgsym(t *types.Type) *types.Sym { hashfunc = types.TypePkgLookup(p) ot := 0 - ot = dsymptrLSym(hashfunc.Linksym(), ot, Runtimepkg.Lookup("memhash_varlen").Linksym(), 0) - ot = duintxxLSym(hashfunc.Linksym(), ot, uint64(t.Width), Widthptr) // size encoded in closure + ot = dsymptr(hashfunc.Linksym(), ot, Runtimepkg.Lookup("memhash_varlen").Linksym(), 0) + ot = duintxx(hashfunc.Linksym(), ot, uint64(t.Width), Widthptr) // size encoded in closure ggloblsym(hashfunc, int32(ot), obj.DUPOK|obj.RODATA) // make equality closure @@ -1584,8 +1584,8 @@ func dalgsym(t *types.Type) *types.Sym { eqfunc = types.TypePkgLookup(p) ot = 0 - ot = dsymptrLSym(eqfunc.Linksym(), ot, Runtimepkg.Lookup("memequal_varlen").Linksym(), 0) - ot = duintxxLSym(eqfunc.Linksym(), ot, uint64(t.Width), Widthptr) + ot = dsymptr(eqfunc.Linksym(), ot, Runtimepkg.Lookup("memequal_varlen").Linksym(), 0) + ot = duintxx(eqfunc.Linksym(), ot, uint64(t.Width), Widthptr) ggloblsym(eqfunc, int32(ot), obj.DUPOK|obj.RODATA) } else { // generate an alg table specific to this type @@ -1600,18 +1600,18 @@ func dalgsym(t *types.Type) *types.Sym { geneq(eq, t) // make Go funcs (closures) for calling hash and equal from Go - dsymptrLSym(hashfunc.Linksym(), 0, hash.Linksym(), 0) + dsymptr(hashfunc.Linksym(), 0, hash.Linksym(), 0) ggloblsym(hashfunc, int32(Widthptr), obj.DUPOK|obj.RODATA) - dsymptrLSym(eqfunc.Linksym(), 0, eq.Linksym(), 0) + dsymptr(eqfunc.Linksym(), 0, eq.Linksym(), 0) ggloblsym(eqfunc, int32(Widthptr), obj.DUPOK|obj.RODATA) } // ../../../../runtime/alg.go:/typeAlg ot := 0 - ot = dsymptrLSym(s.Linksym(), ot, hashfunc.Linksym(), 0) - ot = dsymptrLSym(s.Linksym(), ot, eqfunc.Linksym(), 0) + ot = dsymptr(s.Linksym(), ot, hashfunc.Linksym(), 0) + ot = dsymptr(s.Linksym(), ot, eqfunc.Linksym(), 0) ggloblsym(s, int32(ot), obj.DUPOK|obj.RODATA) return s } @@ -1675,7 +1675,7 @@ func dgcptrmask(t *types.Type) *types.Sym { if !sym.Uniq() { sym.SetUniq(true) for i, x := range ptrmask { - duint8LSym(sym.Linksym(), i, x) + duint8(sym.Linksym(), i, x) } ggloblsym(sym, int32(len(ptrmask)), obj.DUPOK|obj.RODATA|obj.LOCAL) } @@ -1745,12 +1745,12 @@ func (p *GCProg) init(sym *types.Sym) { } func (p *GCProg) writeByte(x byte) { - p.symoff = duint8LSym(p.sym.Linksym(), p.symoff, x) + p.symoff = duint8(p.sym.Linksym(), p.symoff, x) } func (p *GCProg) end() { p.w.End() - duint32LSym(p.sym.Linksym(), 0, uint32(p.symoff-4)) + duint32(p.sym.Linksym(), 0, uint32(p.symoff-4)) ggloblsym(p.sym, int32(p.symoff), obj.DUPOK|obj.RODATA|obj.LOCAL) if Debug_gcprog > 0 { fmt.Fprintf(os.Stderr, "compile: end GCProg for %v\n", p.sym)