mirror of
https://github.com/golang/go.git
synced 2025-05-25 01:11:23 +00:00
runtime: skip stack barrier copy when there are no pointers
After CL 31455, "go fun(n)" may put "n" to write barrier buffer when there are no pointers in fun's arguments. Fixes #29362 Change-Id: Icfa42b8759ce8ad9267dcb3859c626feb6fda381 Reviewed-on: https://go-review.googlesource.com/c/155779 Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
parent
30c0a0d33f
commit
5372257e60
@ -3303,11 +3303,13 @@ func newproc1(fn *funcval, argp *uint8, narg int32, callergp *g, callerpc uintpt
|
||||
if writeBarrier.needed && !_g_.m.curg.gcscandone {
|
||||
f := findfunc(fn.fn)
|
||||
stkmap := (*stackmap)(funcdata(f, _FUNCDATA_ArgsPointerMaps))
|
||||
if stkmap.nbit > 0 {
|
||||
// We're in the prologue, so it's always stack map index 0.
|
||||
bv := stackmapdata(stkmap, 0)
|
||||
bulkBarrierBitmap(spArg, spArg, uintptr(narg), 0, bv.bytedata)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
memclrNoHeapPointers(unsafe.Pointer(&newg.sched), unsafe.Sizeof(newg.sched))
|
||||
newg.sched.sp = sp
|
||||
|
Loading…
x
Reference in New Issue
Block a user