本文整理汇总了Golang中rsc/io/tmp/slowgc/liblink.LSym.Leaf方法的典型用法代码示例。如果您正苦于以下问题:Golang LSym.Leaf方法的具体用法?Golang LSym.Leaf怎么用?Golang LSym.Leaf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rsc/io/tmp/slowgc/liblink.LSym
的用法示例。
在下文中一共展示了LSym.Leaf方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: addstacksplit
//.........这里部分代码省略.........
q1 = q1.Link
p.Pcond = q1
}
}
break
}
q = p
}
for p = cursym.Text; p != nil; p = p.Link {
o = int(p.As)
switch o {
case ATEXT:
autosize = int32(p.To.Offset + 4)
if autosize <= 4 {
if cursym.Text.Mark&LEAF != 0 {
p.To.Offset = -4
autosize = 0
}
}
if !(autosize != 0) && !(cursym.Text.Mark&LEAF != 0) {
if ctxt.Debugvlog != 0 {
fmt.Fprintf(ctxt.Bso, "save suppressed in: %s\n", cursym.Name)
liblink.Bflush(ctxt.Bso)
}
cursym.Text.Mark |= LEAF
}
if cursym.Text.Mark&LEAF != 0 {
cursym.Leaf = 1
if !(autosize != 0) {
break
}
}
if !(p.Reg&liblink.NOSPLIT != 0) {
p = stacksplit(ctxt, p, autosize, bool2int(!(cursym.Text.Reg&liblink.NEEDCTXT != 0))) // emit split check
}
// MOVW.W R14,$-autosize(SP)
p = liblink.Appendp(ctxt, p)
p.As = AMOVW
p.Scond |= C_WBIT
p.From.Type_ = D_REG
p.From.Reg = REGLINK
p.To.Type_ = D_OREG
p.To.Offset = int64(-autosize)
p.To.Reg = REGSP
p.Spadj = autosize
if cursym.Text.Reg&liblink.WRAPPER != 0 {
// if(g->panic != nil && g->panic->argp == FP) g->panic->argp = bottom-of-frame
//
// MOVW g_panic(g), R1
// CMP $0, R1
// B.EQ end
// MOVW panic_argp(R1), R2
// ADD $(autosize+4), R13, R3
// CMP R2, R3
// B.NE end
// ADD $4, R13, R4
示例2: readsym
func readsym(b *bufio.Reader, s *liblink.LSym) {
if !undef[s] {
panic("double-def")
}
delete(undef, s)
s.Name = rdstring(b)
s.Extname = rdstring(b)
s.Type_ = int16(rdint(b))
s.Version = int16(rdint(b))
s.Dupok = uint8(rdint(b))
s.External = uint8(rdint(b))
s.Nosplit = uint8(rdint(b))
s.Reachable = uint8(rdint(b))
s.Cgoexport = uint8(rdint(b))
s.Special = uint8(rdint(b))
s.Stkcheck = uint8(rdint(b))
s.Hide = uint8(rdint(b))
s.Leaf = uint8(rdint(b))
s.Fnptr = uint8(rdint(b))
s.Seenglobl = uint8(rdint(b))
s.Onlist = uint8(rdint(b))
s.Symid = int16(rdint(b))
s.Dynid = int32(rdint(b))
s.Sig = int32(rdint(b))
s.Plt = int32(rdint(b))
s.Got = int32(rdint(b))
s.Align = int32(rdint(b))
s.Elfsym = int32(rdint(b))
s.Args = int32(rdint(b))
s.Locals = int32(rdint(b))
s.Value = rdint(b)
s.Size = rdint(b)
hashed[rdsym(b)] = true
s.Allsym = rdsym(b)
s.Next = rdsym(b)
s.Sub = rdsym(b)
s.Outer = rdsym(b)
s.Gotype = rdsym(b)
s.Reachparent = rdsym(b)
s.Queue = rdsym(b)
s.File = rdstring(b)
s.Dynimplib = rdstring(b)
s.Dynimpvers = rdstring(b)
s.Text = rdprog(b)
s.Etext = rdprog(b)
n := int(rdint(b))
if n > 0 {
s.P = make([]byte, n)
io.ReadFull(b, s.P)
}
s.R = make([]liblink.Reloc, int(rdint(b)))
for i := range s.R {
r := &s.R[i]
r.Off = int32(rdint(b))
r.Siz = uint8(rdint(b))
r.Done = uint8(rdint(b))
r.Type_ = int32(rdint(b))
r.Add = rdint(b)
r.Xadd = rdint(b)
r.Sym = rdsym(b)
r.Xsym = rdsym(b)
}
}
示例3: addstacksplit
//.........这里部分代码省略.........
if !(p.Reg&liblink.NOSPLIT != 0) {
p = stacksplit(ctxt, p, autosize, bool2int(!(cursym.Text.Reg&liblink.NEEDCTXT != 0))) // emit split check
}
q = p
if autosize != 0 {
/* use MOVDU to adjust R1 when saving R31, if autosize is small */
if !(cursym.Text.Mark&LEAF != 0) && autosize >= -BIG && autosize <= BIG {
mov = AMOVDU
aoffset = int(-autosize)
} else {
q = liblink.Appendp(ctxt, p)
q.As = AADD
q.Lineno = p.Lineno
q.From.Type_ = D_CONST
q.From.Offset = int64(-autosize)
q.To.Type_ = D_REG
q.To.Reg = REGSP
q.Spadj = +autosize
}
} else if !(cursym.Text.Mark&LEAF != 0) {
if ctxt.Debugvlog != 0 {
fmt.Fprintf(ctxt.Bso, "save suppressed in: %s\n", cursym.Name)
liblink.Bflush(ctxt.Bso)
}
cursym.Text.Mark |= LEAF
}
if cursym.Text.Mark&LEAF != 0 {
cursym.Leaf = 1
break
}
q = liblink.Appendp(ctxt, q)
q.As = AMOVD
q.Lineno = p.Lineno
q.From.Type_ = D_SPR
q.From.Offset = D_LR
q.To.Type_ = D_REG
q.To.Reg = REGTMP
q = liblink.Appendp(ctxt, q)
q.As = int16(mov)
q.Lineno = p.Lineno
q.From.Type_ = D_REG
q.From.Reg = REGTMP
q.To.Type_ = D_OREG
q.To.Offset = int64(aoffset)
q.To.Reg = REGSP
if q.As == AMOVDU {
q.Spadj = int32(-aoffset)
}
if cursym.Text.Reg&liblink.WRAPPER != 0 {
// if(g->panic != nil && g->panic->argp == FP) g->panic->argp = bottom-of-frame
//
// MOVD g_panic(g), R3
// CMP R0, R3
// BEQ end
// MOVD panic_argp(R3), R4
// ADD $(autosize+8), R1, R5
// CMP R4, R5