Commit 9c9e36b3 authored by Russ Cox's avatar Russ Cox

cmd/internal/gc: sync nowritebarrier checks and write barrier insertion

Change-Id: I348223d0336e28d95b8e68d7653aa547acc7c9c3
Reviewed-on: https://go-review.googlesource.com/10262Reviewed-by: 's avatarAustin Clements <austin@google.com>
parent c735064c
......@@ -785,6 +785,9 @@ abop: // asymmetric binary
var sys_wbptr *Node
func cgen_wbptr(n, res *Node) {
if Curfn != nil && Curfn.Func.Nowritebarrier {
Yyerror("write barrier prohibited")
}
if Debug_wb > 0 {
Warn("write barrier")
}
......@@ -828,6 +831,9 @@ func cgen_wbptr(n, res *Node) {
}
func cgen_wbfat(n, res *Node) {
if Curfn != nil && Curfn.Func.Nowritebarrier {
Yyerror("write barrier prohibited")
}
if Debug_wb > 0 {
Warn("write barrier")
}
......
......@@ -2217,6 +2217,9 @@ func applywritebarrier(n *Node, init **NodeList) *Node {
return n
}
// Use slow path always for race detector.
if Curfn != nil && Curfn.Func.Nowritebarrier {
Yyerror("write barrier prohibited")
}
if Debug_wb > 0 {
Warnl(int(n.Lineno), "write barrier")
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment