mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: clean up adjustpointer and eliminate write barrier
Commit a5c3bbe modified adjustpointers to use *uintptrs instead of
*unsafe.Pointers for manipulating stack pointers for clarity and to
eliminate the unnecessary write barrier when writing the updated stack
pointer.
This commit makes the equivalent change to adjustpointer.
Change-Id: I6dc309590b298bdd86ecdc9737db848d6786c3f7
Reviewed-on: https://go-review.googlesource.com/17148
Reviewed-by: Rick Hudson <rlh@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
71cc445cf9
commit
d62d831882
1 changed files with 5 additions and 5 deletions
|
|
@ -521,15 +521,15 @@ type adjustinfo struct {
|
|||
// Adjustpointer checks whether *vpp is in the old stack described by adjinfo.
|
||||
// If so, it rewrites *vpp to point into the new stack.
|
||||
func adjustpointer(adjinfo *adjustinfo, vpp unsafe.Pointer) {
|
||||
pp := (*unsafe.Pointer)(vpp)
|
||||
pp := (*uintptr)(vpp)
|
||||
p := *pp
|
||||
if stackDebug >= 4 {
|
||||
print(" ", pp, ":", p, "\n")
|
||||
print(" ", pp, ":", hex(p), "\n")
|
||||
}
|
||||
if adjinfo.old.lo <= uintptr(p) && uintptr(p) < adjinfo.old.hi {
|
||||
*pp = add(p, adjinfo.delta)
|
||||
if adjinfo.old.lo <= p && p < adjinfo.old.hi {
|
||||
*pp = p + adjinfo.delta
|
||||
if stackDebug >= 3 {
|
||||
print(" adjust ptr ", pp, ":", p, " -> ", *pp, "\n")
|
||||
print(" adjust ptr ", pp, ":", hex(p), " -> ", hex(*pp), "\n")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue