aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/obj/x86/obj6.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/internal/obj/x86/obj6.go')
-rw-r--r--src/cmd/internal/obj/x86/obj6.go42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/cmd/internal/obj/x86/obj6.go b/src/cmd/internal/obj/x86/obj6.go
index c1ad6b7a42..0dc4c3a57e 100644
--- a/src/cmd/internal/obj/x86/obj6.go
+++ b/src/cmd/internal/obj/x86/obj6.go
@@ -38,14 +38,14 @@ import (
"math"
)
-func canuselocaltls(ctxt *obj.Link) int {
+func canuselocaltls(ctxt *obj.Link) bool {
switch ctxt.Headtype {
case obj.Hplan9,
obj.Hwindows:
- return 0
+ return false
}
- return 1
+ return true
}
func progedit(ctxt *obj.Link, p *obj.Prog) {
@@ -86,7 +86,7 @@ func progedit(ctxt *obj.Link, p *obj.Prog) {
// access TLS, and they are rewritten appropriately first here in
// liblink and then finally using relocations in the linker.
- if canuselocaltls(ctxt) != 0 {
+ if canuselocaltls(ctxt) {
// Reduce TLS initial exec model to TLS local exec model.
// Sequences like
// MOVQ TLS, BX
@@ -366,7 +366,7 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym) {
cursym.Args = int32(textarg)
cursym.Locals = int32(p.To.Offset)
- if autoffset < obj.StackSmall && !(p.From3.Offset&obj.NOSPLIT != 0) {
+ if autoffset < obj.StackSmall && p.From3.Offset&obj.NOSPLIT == 0 {
for q = p; q != nil; q = q.Link {
if q.As == obj.ACALL {
goto noleaf
@@ -381,13 +381,13 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym) {
}
q = nil
- if !(p.From3.Offset&obj.NOSPLIT != 0) || (p.From3.Offset&obj.WRAPPER != 0) {
+ if p.From3.Offset&obj.NOSPLIT == 0 || (p.From3.Offset&obj.WRAPPER != 0) {
p = obj.Appendp(ctxt, p)
p = load_g_cx(ctxt, p) // load g into CX
}
- if !(cursym.Text.From3.Offset&obj.NOSPLIT != 0) {
- p = stacksplit(ctxt, p, autoffset, int32(textarg), bool2int(!(cursym.Text.From3.Offset&obj.NEEDCTXT != 0)), &q) // emit split check
+ if cursym.Text.From3.Offset&obj.NOSPLIT == 0 {
+ p = stacksplit(ctxt, p, autoffset, int32(textarg), cursym.Text.From3.Offset&obj.NEEDCTXT == 0, &q) // emit split check
}
if autoffset != 0 {
@@ -540,7 +540,7 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym) {
p2.Pcond = p
}
- if ctxt.Debugzerostack != 0 && autoffset != 0 && !(cursym.Text.From3.Offset&obj.NOSPLIT != 0) {
+ if ctxt.Debugzerostack != 0 && autoffset != 0 && cursym.Text.From3.Offset&obj.NOSPLIT == 0 {
// 6l -Z means zero the stack frame on entry.
// This slows down function calls but can help avoid
// false positives in garbage collection.
@@ -722,7 +722,7 @@ func load_g_cx(ctxt *obj.Link, p *obj.Prog) *obj.Prog {
// Returns last new instruction.
// On return, *jmpok is the instruction that should jump
// to the stack frame allocation if no split is needed.
-func stacksplit(ctxt *obj.Link, p *obj.Prog, framesize int32, textarg int32, noctxt int, jmpok **obj.Prog) *obj.Prog {
+func stacksplit(ctxt *obj.Link, p *obj.Prog, framesize int32, textarg int32, noctxt bool, jmpok **obj.Prog) *obj.Prog {
var q *obj.Prog
var q1 *obj.Prog
var cmp int
@@ -853,7 +853,7 @@ func stacksplit(ctxt *obj.Link, p *obj.Prog, framesize int32, textarg int32, noc
if ctxt.Cursym.Cfunc != 0 {
p.To.Sym = obj.Linklookup(ctxt, "runtime.morestackc", 0)
} else {
- p.To.Sym = ctxt.Symmorestack[noctxt]
+ p.To.Sym = ctxt.Symmorestack[bool2int(noctxt)]
}
p = obj.Appendp(ctxt, p)
@@ -878,14 +878,14 @@ func follow(ctxt *obj.Link, s *obj.LSym) {
ctxt.Cursym = s
- firstp = new(obj.Prog)
+ firstp = ctxt.NewProg()
lastp = firstp
xfol(ctxt, s.Text, &lastp)
lastp.Link = nil
s.Text = firstp.Link
}
-func nofollow(a int) int {
+func nofollow(a int) bool {
switch a {
case obj.AJMP,
obj.ARET,
@@ -896,13 +896,13 @@ func nofollow(a int) int {
ARETFQ,
ARETFW,
obj.AUNDEF:
- return 1
+ return true
}
- return 0
+ return false
}
-func pushpop(a int) int {
+func pushpop(a int) bool {
switch a {
case APUSHL,
APUSHFL,
@@ -916,10 +916,10 @@ func pushpop(a int) int {
APOPFQ,
APOPW,
APOPFW:
- return 1
+ return true
}
- return 0
+ return false
}
func relinv(a int) int {
@@ -1004,7 +1004,7 @@ loop:
continue
}
- if nofollow(a) != 0 || pushpop(a) != 0 {
+ if nofollow(a) || pushpop(a) {
break // NOTE(rsc): arm does goto copy
}
if q.Pcond == nil || q.Pcond.Mark != 0 {
@@ -1041,7 +1041,7 @@ loop:
/* */
}
}
- q = new(obj.Prog)
+ q = ctxt.NewProg()
q.As = obj.AJMP
q.Lineno = p.Lineno
q.To.Type = obj.TYPE_BRANCH
@@ -1058,7 +1058,7 @@ loop:
a = int(p.As)
/* continue loop with what comes after p */
- if nofollow(a) != 0 {
+ if nofollow(a) {
return
}
if p.Pcond != nil && a != obj.ACALL {