]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: drop redundant argument to getArgInfo
authorAustin Clements <austin@google.com>
Tue, 16 Aug 2022 17:04:16 +0000 (13:04 -0400)
committerGopher Robot <gobot@golang.org>
Fri, 2 Sep 2022 19:04:51 +0000 (19:04 +0000)
The f funcInfo argument is always the same as frame.fn, so we don't
need to pass it. I suspect that was there to make the signatures of
getArgInfoFast and getArgInfo more similar, but it's not necessary.

For #54466.

Change-Id: Idc717f4df09e97cad49d52c5b7edf28090908cba
Reviewed-on: https://go-review.googlesource.com/c/go/+/424255
Run-TryBot: Austin Clements <austin@google.com>
Auto-Submit: Austin Clements <austin@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/runtime/traceback.go

index 27ac7b097729285c5fa38231aa6f07f51feb340b..ed64343470b261774ad5239abbc7e6e3106ab760 100644 (file)
@@ -294,7 +294,7 @@ func gentraceback(pc0, sp0, lr0 uintptr, gp *g, skip int, pcbuf *uintptr, max in
                        var ok bool
                        frame.arglen, frame.argmap, ok = getArgInfoFast(f, callback != nil)
                        if !ok {
-                               frame.arglen, frame.argmap = getArgInfo(&frame, f, callback != nil)
+                               frame.arglen, frame.argmap = getArgInfo(&frame, callback != nil)
                        }
                }
 
@@ -679,7 +679,8 @@ func getArgInfoFast(f funcInfo, needArgMap bool) (arglen uintptr, argmap *bitvec
 
 // getArgInfo returns the argument frame information for a call to f
 // with call frame frame.
-func getArgInfo(frame *stkframe, f funcInfo, needArgMap bool) (arglen uintptr, argmap *bitvector) {
+func getArgInfo(frame *stkframe, needArgMap bool) (arglen uintptr, argmap *bitvector) {
+       f := frame.fn
        arglen = uintptr(f.args)
        if needArgMap && f.args == _ArgsSizeUnknown {
                // Extract argument bitmaps for reflect stubs from the calls they made to reflect.