}
frame.fn = f
frame.argp = uintptr(deferArgs(d))
- frame.arglen, frame.argmap = getArgInfo(&frame, f, true, fn)
+ var ok bool
+ frame.arglen, frame.argmap, ok = getArgInfoFast(f, true)
+ if !ok {
+ frame.arglen, frame.argmap = getArgInfo(&frame, f, true, fn)
+ }
}
frame.continpc = frame.pc
if !callback((*stkframe)(noescape(unsafe.Pointer(&frame))), v) {
// metadata recorded by f's caller.
if callback != nil || printing {
frame.argp = frame.fp + sys.MinFrameSize
- frame.arglen, frame.argmap = getArgInfo(&frame, f, callback != nil, nil)
+ var ok bool
+ frame.arglen, frame.argmap, ok = getArgInfoFast(f, callback != nil)
+ if !ok {
+ frame.arglen, frame.argmap = getArgInfo(&frame, f, callback != nil, nil)
+ }
}
// Determine frame's 'continuation PC', where it can continue.
stack *bitvector // args bitmap
}
+// getArgInfoFast returns the argument frame information for a call to f.
+// It is short and inlineable. However, it does not handle all functions.
+// If ok reports false, you must call getArgInfo instead.
+// TODO(josharian): once we do mid-stack inlining,
+// call getArgInfo directly from getArgInfoFast and stop returning an ok bool.
+func getArgInfoFast(f funcInfo, needArgMap bool) (arglen uintptr, argmap *bitvector, ok bool) {
+ return uintptr(f.args), nil, !(needArgMap && f.args == _ArgsSizeUnknown)
+}
+
// getArgInfo returns the argument frame information for a call to f
// with call frame frame.
//