aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/obj/ppc64
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josharian@gmail.com>2017-04-11 15:15:04 -0700
committerJosh Bleecher Snyder <josharian@gmail.com>2017-04-12 21:53:39 +0000
commitce3ee7cdae9059a2cfb1a801a34712f413afb211 (patch)
treeec23161c4ba9d7a5fe95af90813569e2c983525a /src/cmd/internal/obj/ppc64
parent4eb48a336e5a7ac519611cf8360909e0ac37f018 (diff)
downloadgo-ce3ee7cdae9059a2cfb1a801a34712f413afb211.tar.xz
cmd/internal/obj: stop storing Text flags in From3
Prior to this CL, flags such as NOSPLIT on ATEXT Progs were stored in From3.Offset. Some but not all of those flags were also duplicated into From.Sym.Attribute. This CL migrates all of those flags into From.Sym.Attribute and stops creating a From3. A side-effect of this is that printing an ATEXT Prog can no longer simply dump From3.Offset. That's kind of good, since the raw flag value wasn't very informative anyway, but it did necessitate a bunch of updates to the cmd/asm tests. The reason I'm doing this work now is that avoiding storing flags in both From.Sym and From3.Offset simplifies some other changes to fix the data race first described in CL 40254. This CL almost passes toolstash-check -all. The only changes are in cases where the assembler has decided that a function's flags may be altered, e.g. to make a function with no calls in it NOSPLIT. Prior to this CL, that information was not printed. Sample before: "".Ctz64 t=1 size=63 args=0x10 locals=0x0 0x0000 00000 (/Users/josh/go/tip/src/runtime/internal/sys/intrinsics.go:35) TEXT "".Ctz64(SB), $0-16 0x0000 00000 (/Users/josh/go/tip/src/runtime/internal/sys/intrinsics.go:35) FUNCDATA $0, gclocals·f207267fbf96a0178e8758c6e3e0ce28(SB) Sample after: "".Ctz64 t=1 nosplit size=63 args=0x10 locals=0x0 0x0000 00000 (/Users/josh/go/tip/src/runtime/internal/sys/intrinsics.go:35) TEXT "".Ctz64(SB), NOSPLIT, $0-16 0x0000 00000 (/Users/josh/go/tip/src/runtime/internal/sys/intrinsics.go:35) FUNCDATA $0, gclocals·f207267fbf96a0178e8758c6e3e0ce28(SB) Observe the additional "nosplit" in the first line and the additional "NOSPLIT" in the second line. Updates #15756 Change-Id: I5c59bd8f3bdc7c780361f801d94a261f0aef3d13 Reviewed-on: https://go-review.googlesource.com/40495 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/cmd/internal/obj/ppc64')
-rw-r--r--src/cmd/internal/obj/ppc64/obj9.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/cmd/internal/obj/ppc64/obj9.go b/src/cmd/internal/obj/ppc64/obj9.go
index fb08b13fde..3e36ed16a7 100644
--- a/src/cmd/internal/obj/ppc64/obj9.go
+++ b/src/cmd/internal/obj/ppc64/obj9.go
@@ -240,13 +240,13 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
textstksiz := p.To.Offset
if textstksiz == -8 {
// Compatibility hack.
- p.From3.Offset |= obj.NOFRAME
+ p.From.Sym.Set(obj.AttrNoFrame, true)
textstksiz = 0
}
if textstksiz%8 != 0 {
c.ctxt.Diag("frame size %d not a multiple of 8", textstksiz)
}
- if p.From3.Offset&obj.NOFRAME != 0 {
+ if p.From.Sym.NoFrame() {
if textstksiz != 0 {
c.ctxt.Diag("NOFRAME functions must have a frame size of 0, not %d", textstksiz)
}
@@ -439,10 +439,10 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
if p.Mark&LEAF != 0 && autosize == 0 {
// A leaf function with no locals has no frame.
- p.From3.Offset |= obj.NOFRAME
+ p.From.Sym.Set(obj.AttrNoFrame, true)
}
- if p.From3.Offset&obj.NOFRAME == 0 {
+ if !p.From.Sym.NoFrame() {
// If there is a stack frame at all, it includes
// space to save the LR.
autosize += int32(c.ctxt.FixedFrameSize())
@@ -451,7 +451,7 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
if p.Mark&LEAF != 0 && autosize < obj.StackSmall {
// A leaf function with a small stack can be marked
// NOSPLIT, avoiding a stack check.
- p.From3.Offset |= obj.NOSPLIT
+ p.From.Sym.Set(obj.AttrNoSplit, true)
}
p.To.Offset = int64(autosize)
@@ -492,7 +492,7 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
rel.Type = obj.R_ADDRPOWER_PCREL
}
- if c.cursym.Text.From3.Offset&obj.NOSPLIT == 0 {
+ if !c.cursym.Text.From.Sym.NoSplit() {
q = c.stacksplit(q, autosize) // emit split check
}
@@ -572,7 +572,7 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
q.To.Offset = 24
}
- if c.cursym.Text.From3.Offset&obj.WRAPPER != 0 {
+ if c.cursym.Text.From.Sym.Wrapper() {
// if(g->panic != nil && g->panic->argp == FP) g->panic->argp = bottom-of-frame
//
// MOVD g_panic(g), R3
@@ -950,7 +950,7 @@ func (c *ctxt9) stacksplit(p *obj.Prog, framesize int32) *obj.Prog {
var morestacksym *obj.LSym
if c.cursym.CFunc() {
morestacksym = c.ctxt.Lookup("runtime.morestackc", 0)
- } else if c.cursym.Text.From3.Offset&obj.NEEDCTXT == 0 {
+ } else if !c.cursym.Text.From.Sym.NeedCtxt() {
morestacksym = c.ctxt.Lookup("runtime.morestack_noctxt", 0)
} else {
morestacksym = c.ctxt.Lookup("runtime.morestack", 0)