mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: report typedslicecopy write barriers
Most write barrier calls are inserted by SSA, but copy and append are lowered to runtime.typedslicecopy during walk. Fix these to set Func.WBPos and emit the "write barrier" warning, as done for the write barriers inserted by SSA. As part of this, we refactor setting WBPos and emitting this warning into the frontend so it can be shared by both walk and SSA. Change-Id: I5fe9997d9bdb55e03e01dd58aee28908c35f606b Reviewed-on: https://go-review.googlesource.com/73411 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
507ca082d1
commit
afbe646ab4
7 changed files with 23 additions and 20 deletions
|
|
@ -226,12 +226,7 @@ func writebarrier(f *Func) {
|
|||
|
||||
if fn != nil {
|
||||
// Note that we set up a writebarrier function call.
|
||||
if !f.WBPos.IsKnown() {
|
||||
f.WBPos = pos
|
||||
}
|
||||
if f.fe.Debug_wb() {
|
||||
f.Warnl(pos, "write barrier")
|
||||
}
|
||||
f.fe.SetWBPos(pos)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue