Commit 70ea70ec authored by Ian Lance Taylor's avatar Ian Lance Taylor

runtime: rename p racectx field to raceprocctx

Both g and p had a racectx field, but they held different kinds of values.
The g field held ThreadState values while the p field held Processor values
(to use the names used in the C++ code in the compiler_rt support library).
Rename the p field to raceprocctx to reduce potential confusion.

Change-Id: Iefba0e259d240171e973054c452c3c15bf3f8f8f
Reviewed-on: https://go-review.googlesource.com/c/go/+/169960Reviewed-by: default avatarDmitry Vyukov <dvyukov@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 154e5abf
...@@ -3956,12 +3956,12 @@ func procresize(nprocs int32) *p { ...@@ -3956,12 +3956,12 @@ func procresize(nprocs int32) *p {
pp.mcache = allocmcache() pp.mcache = allocmcache()
} }
} }
if raceenabled && pp.racectx == 0 { if raceenabled && pp.raceprocctx == 0 {
if old == 0 && i == 0 { if old == 0 && i == 0 {
pp.racectx = raceprocctx0 pp.raceprocctx = raceprocctx0
raceprocctx0 = 0 // bootstrap raceprocctx0 = 0 // bootstrap
} else { } else {
pp.racectx = raceproccreate() pp.raceprocctx = raceproccreate()
} }
} }
} }
...@@ -4019,8 +4019,8 @@ func procresize(nprocs int32) *p { ...@@ -4019,8 +4019,8 @@ func procresize(nprocs int32) *p {
gfpurge(p) gfpurge(p)
traceProcFree(p) traceProcFree(p)
if raceenabled { if raceenabled {
raceprocdestroy(p.racectx) raceprocdestroy(p.raceprocctx)
p.racectx = 0 p.raceprocctx = 0
} }
p.gcAssistTime = 0 p.gcAssistTime = 0
p.status = _Pdead p.status = _Pdead
......
...@@ -398,7 +398,7 @@ TEXT runtime·racecallbackthunk(SB), NOSPLIT, $56-8 ...@@ -398,7 +398,7 @@ TEXT runtime·racecallbackthunk(SB), NOSPLIT, $56-8
MOVQ g(RARG0), RARG0 MOVQ g(RARG0), RARG0
MOVQ g_m(RARG0), RARG0 MOVQ g_m(RARG0), RARG0
MOVQ m_p(RARG0), RARG0 MOVQ m_p(RARG0), RARG0
MOVQ p_racectx(RARG0), RARG0 MOVQ p_raceprocctx(RARG0), RARG0
MOVQ RARG0, (RARG1) MOVQ RARG0, (RARG1)
RET RET
......
...@@ -455,7 +455,7 @@ TEXT runtime·racecallbackthunk(SB), NOSPLIT, $-8 ...@@ -455,7 +455,7 @@ TEXT runtime·racecallbackthunk(SB), NOSPLIT, $-8
MOVD 0(R13)(R10*1), g MOVD 0(R13)(R10*1), g
MOVD g_m(g), R3 MOVD g_m(g), R3
MOVD m_p(R3), R3 MOVD m_p(R3), R3
MOVD p_racectx(R3), R3 MOVD p_raceprocctx(R3), R3
MOVD R3, (R4) MOVD R3, (R4)
MOVD R9, g // restore R30 ?? MOVD R9, g // restore R30 ??
RET RET
......
...@@ -482,7 +482,7 @@ type p struct { ...@@ -482,7 +482,7 @@ type p struct {
sysmontick sysmontick // last tick observed by sysmon sysmontick sysmontick // last tick observed by sysmon
m muintptr // back-link to associated m (nil if idle) m muintptr // back-link to associated m (nil if idle)
mcache *mcache mcache *mcache
racectx uintptr raceprocctx uintptr
deferpool [5][]*_defer // pool of available defer structs of different sizes (see panic.go) deferpool [5][]*_defer // pool of available defer structs of different sizes (see panic.go)
deferpoolbuf [5][32]*_defer deferpoolbuf [5][32]*_defer
......
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