diff options
| author | Austin Clements <austin@google.com> | 2015-11-23 11:34:16 -0500 |
|---|---|---|
| committer | Austin Clements <austin@google.com> | 2016-02-28 04:19:01 +0000 |
| commit | d62d8318826e17fff09fb2188dcb22fbb121fb19 (patch) | |
| tree | 5329244a754888646633777f00c3e07f5691a86f /src/runtime/stack.go | |
| parent | 71cc445cf92dd3014e8b382809ed1b9c077e7973 (diff) | |
| download | go-d62d8318826e17fff09fb2188dcb22fbb121fb19.tar.xz | |
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>
Diffstat (limited to 'src/runtime/stack.go')
| -rw-r--r-- | src/runtime/stack.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/runtime/stack.go b/src/runtime/stack.go index 81059965d9..d2466de653 100644 --- a/src/runtime/stack.go +++ b/src/runtime/stack.go @@ -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") } } } |
