mirror of
https://github.com/golang/go
synced 2024-11-18 18:44:42 -07:00
runtime: avoid unnecessary scanblock calls
This is the scanstack analog of CL 104737, which made a similar change for copystack. name old time/op new time/op delta ScanStack-8 41.1ms ± 6% 38.9ms ± 5% -5.52% (p=0.000 n=50+48) Change-Id: I7427151dea2895ed3934f8a0f61d96b568019217 Reviewed-on: https://go-review.googlesource.com/105536 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com>
This commit is contained in:
parent
dda4591c8c
commit
d91e9705f8
@ -839,9 +839,11 @@ func scanframeworker(frame *stkframe, cache *pcvalueCache, gcw *gcWork) {
|
||||
print("runtime: pcdata is ", pcdata, " and ", stkmap.n, " locals stack map entries for ", funcname(f), " (targetpc=", targetpc, ")\n")
|
||||
throw("scanframe: bad symbol table")
|
||||
}
|
||||
bv := stackmapdata(stkmap, pcdata)
|
||||
size = uintptr(bv.n) * sys.PtrSize
|
||||
scanblock(frame.varp-size, size, bv.bytedata, gcw)
|
||||
if stkmap.nbit > 0 {
|
||||
bv := stackmapdata(stkmap, pcdata)
|
||||
size = uintptr(bv.n) * sys.PtrSize
|
||||
scanblock(frame.varp-size, size, bv.bytedata, gcw)
|
||||
}
|
||||
}
|
||||
|
||||
// Scan arguments.
|
||||
@ -862,7 +864,9 @@ func scanframeworker(frame *stkframe, cache *pcvalueCache, gcw *gcWork) {
|
||||
}
|
||||
bv = stackmapdata(stkmap, pcdata)
|
||||
}
|
||||
scanblock(frame.argp, uintptr(bv.n)*sys.PtrSize, bv.bytedata, gcw)
|
||||
if bv.n > 0 {
|
||||
scanblock(frame.argp, uintptr(bv.n)*sys.PtrSize, bv.bytedata, gcw)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user