]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/obj/x86: clean up "is leaf?" check
authorJosh Bleecher Snyder <josharian@gmail.com>
Thu, 7 Jul 2016 23:21:53 +0000 (16:21 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Thu, 25 Aug 2016 16:36:18 +0000 (16:36 +0000)
Minor code cleanup. No functional changes.

Change-Id: I2e631b43b122174302a182a1a286c0f873851ce6
Reviewed-on: https://go-review.googlesource.com/24813
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/internal/obj/x86/obj6.go

index 512342550bdfbdadc2f34a561422c7000087efe7..5e432774a72ee68fd635d68c4ee6bd92c76f5432 100644 (file)
@@ -655,17 +655,24 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym) {
 
        // TODO(rsc): Remove 'p.Mode == 64 &&'.
        if p.Mode == 64 && autoffset < obj.StackSmall && p.From3Offset()&obj.NOSPLIT == 0 {
+               leaf := true
+       LeafSearch:
                for q := p; q != nil; q = q.Link {
-                       if q.As == obj.ACALL {
-                               goto noleaf
-                       }
-                       if (q.As == obj.ADUFFCOPY || q.As == obj.ADUFFZERO) && autoffset >= obj.StackSmall-8 {
-                               goto noleaf
+                       switch q.As {
+                       case obj.ACALL:
+                               leaf = false
+                               break LeafSearch
+                       case obj.ADUFFCOPY, obj.ADUFFZERO:
+                               if autoffset >= obj.StackSmall-8 {
+                                       leaf = false
+                                       break LeafSearch
+                               }
                        }
                }
 
-               p.From3.Offset |= obj.NOSPLIT
-       noleaf:
+               if leaf {
+                       p.From3.Offset |= obj.NOSPLIT
+               }
        }
 
        if p.From3Offset()&obj.NOSPLIT == 0 || p.From3Offset()&obj.WRAPPER != 0 {