mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: make getStackMap a method of stkframe
This places getStackMap alongside argBytes and argMapInternal as another method of stkframe. For #54466, albeit rather indirectly. Change-Id: I411dda3605dd7f996983706afcbefddf29a68a85 Reviewed-on: https://go-review.googlesource.com/c/go/+/424515 Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Austin Clements <austin@google.com> Auto-Submit: Austin Clements <austin@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
parent
dbf442b1b2
commit
b91e373729
3 changed files with 4 additions and 4 deletions
|
|
@ -1479,7 +1479,7 @@ func getgcmask(ep any) (mask []byte) {
|
||||||
frame.sp = uintptr(p)
|
frame.sp = uintptr(p)
|
||||||
gentraceback(gp.m.curg.sched.pc, gp.m.curg.sched.sp, 0, gp.m.curg, 0, nil, 1000, getgcmaskcb, noescape(unsafe.Pointer(&frame)), 0)
|
gentraceback(gp.m.curg.sched.pc, gp.m.curg.sched.sp, 0, gp.m.curg, 0, nil, 1000, getgcmaskcb, noescape(unsafe.Pointer(&frame)), 0)
|
||||||
if frame.fn.valid() {
|
if frame.fn.valid() {
|
||||||
locals, _, _ := getStackMap(&frame, nil, false)
|
locals, _, _ := frame.getStackMap(nil, false)
|
||||||
if locals.n == 0 {
|
if locals.n == 0 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -966,7 +966,7 @@ func scanframeworker(frame *stkframe, state *stackScanState, gcw *gcWork) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
locals, args, objs := getStackMap(frame, &state.cache, false)
|
locals, args, objs := frame.getStackMap(&state.cache, false)
|
||||||
|
|
||||||
// Scan local variables if stack frame has been allocated.
|
// Scan local variables if stack frame has been allocated.
|
||||||
if locals.n > 0 {
|
if locals.n > 0 {
|
||||||
|
|
|
||||||
|
|
@ -664,7 +664,7 @@ func adjustframe(frame *stkframe, arg unsafe.Pointer) bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
locals, args, objs := getStackMap(frame, &adjinfo.cache, true)
|
locals, args, objs := frame.getStackMap(&adjinfo.cache, true)
|
||||||
|
|
||||||
// Adjust local variables if stack frame has been allocated.
|
// Adjust local variables if stack frame has been allocated.
|
||||||
if locals.n > 0 {
|
if locals.n > 0 {
|
||||||
|
|
@ -1249,7 +1249,7 @@ func freeStackSpans() {
|
||||||
|
|
||||||
// getStackMap returns the locals and arguments live pointer maps, and
|
// getStackMap returns the locals and arguments live pointer maps, and
|
||||||
// stack object list for frame.
|
// stack object list for frame.
|
||||||
func getStackMap(frame *stkframe, cache *pcvalueCache, debug bool) (locals, args bitvector, objs []stackObjectRecord) {
|
func (frame *stkframe) getStackMap(cache *pcvalueCache, debug bool) (locals, args bitvector, objs []stackObjectRecord) {
|
||||||
targetpc := frame.continpc
|
targetpc := frame.continpc
|
||||||
if targetpc == 0 {
|
if targetpc == 0 {
|
||||||
// Frame is dead. Return empty bitvectors.
|
// Frame is dead. Return empty bitvectors.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue