]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: eliminate NoFramePointer
authorAustin Clements <austin@google.com>
Thu, 25 Jan 2018 16:41:41 +0000 (11:41 -0500)
committerAustin Clements <austin@google.com>
Mon, 12 Feb 2018 21:41:21 +0000 (21:41 +0000)
The NoFramePointer function flag is no longer used, so this CL
eliminates it. This cleans up some confusion between the compiler's
NoFramePointer flag and obj's NOFRAME flag. NoFramePointer was
intended to eliminate the saved base pointer on x86, but it was
translated into obj's NOFRAME flag. On x86, NOFRAME does mean to omit
the saved base pointer, but on ppc64 and s390x it has a more general
meaning of omitting *everything* from the frame, including the saved
LR and ppc64's "fixed frame". Hence, on ppc64 and s390x there are far
fewer situations where it is safe to set this flag.

Change-Id: If68991310b4d00638128c296bdd57f4ed731b46d
Reviewed-on: https://go-review.googlesource.com/92036
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/compile/internal/gc/gsubr.go
src/cmd/compile/internal/gc/syntax.go

index d074900d9831ff82fa21b841ea6163ecc3ebb348..0414d36157d53f1b67d852e74c6369d6db6ad3a1 100644 (file)
@@ -188,9 +188,6 @@ func (f *Func) initLSym() {
        if f.Wrapper() {
                flag |= obj.WRAPPER
        }
-       if f.NoFramePointer() {
-               flag |= obj.NOFRAME
-       }
        if f.Needctxt() {
                flag |= obj.NEEDCTXT
        }
index 5044ea0fe27b2241854bce6e337d0e1f62514915..5e301b6271fe2aff3c3f6ad272ce3c6946324536 100644 (file)
@@ -464,7 +464,6 @@ const (
        funcNeedctxt                  // function uses context register (has closure variables)
        funcReflectMethod             // function calls reflect.Type.Method or MethodByName
        funcIsHiddenClosure
-       funcNoFramePointer      // Must not use a frame pointer for this function
        funcHasDefer            // contains a defer statement
        funcNilCheckDisabled    // disable nil checks when compiling this function
        funcInlinabilityChecked // inliner has already determined whether the function is inlinable
@@ -476,7 +475,6 @@ func (f *Func) Wrapper() bool             { return f.flags&funcWrapper != 0 }
 func (f *Func) Needctxt() bool            { return f.flags&funcNeedctxt != 0 }
 func (f *Func) ReflectMethod() bool       { return f.flags&funcReflectMethod != 0 }
 func (f *Func) IsHiddenClosure() bool     { return f.flags&funcIsHiddenClosure != 0 }
-func (f *Func) NoFramePointer() bool      { return f.flags&funcNoFramePointer != 0 }
 func (f *Func) HasDefer() bool            { return f.flags&funcHasDefer != 0 }
 func (f *Func) NilCheckDisabled() bool    { return f.flags&funcNilCheckDisabled != 0 }
 func (f *Func) InlinabilityChecked() bool { return f.flags&funcInlinabilityChecked != 0 }
@@ -487,7 +485,6 @@ func (f *Func) SetWrapper(b bool)             { f.flags.set(funcWrapper, b) }
 func (f *Func) SetNeedctxt(b bool)            { f.flags.set(funcNeedctxt, b) }
 func (f *Func) SetReflectMethod(b bool)       { f.flags.set(funcReflectMethod, b) }
 func (f *Func) SetIsHiddenClosure(b bool)     { f.flags.set(funcIsHiddenClosure, b) }
-func (f *Func) SetNoFramePointer(b bool)      { f.flags.set(funcNoFramePointer, b) }
 func (f *Func) SetHasDefer(b bool)            { f.flags.set(funcHasDefer, b) }
 func (f *Func) SetNilCheckDisabled(b bool)    { f.flags.set(funcNilCheckDisabled, b) }
 func (f *Func) SetInlinabilityChecked(b bool) { f.flags.set(funcInlinabilityChecked, b) }