Permalink
Browse files

runtime: remove getcallerpc argument

Now that getcallerpc is a compiler intrinsic on x86 and non-x86
platforms don't need the argument, we can drop it.

Sadly, this doesn't let us remove any dummy arguments since all of
those cases also use getcallersp, which still takes the argument
pointer, but this is at least an improvement.

Change-Id: I9c34a41cf2c18cba57f59938390bf9491efb22d2
Reviewed-on: https://go-review.googlesource.com/65474
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
  • Loading branch information...
aclements committed Sep 22, 2017
1 parent 8cb2952 commit 229aaac19e041ac74ab043d6ef09c8406bb0a9e7
View
@@ -677,9 +677,9 @@ TEXT setg<>(SB),NOSPLIT,$-4-0
MOVW g, R0
RET
TEXT runtime·getcallerpc(SB),NOSPLIT,$4-8
MOVW 8(R13), R0 // LR saved by caller
MOVW R0, ret+4(FP)
TEXT runtime·getcallerpc(SB),NOSPLIT,$-4-4
MOVW 0(R13), R0 // LR saved by caller
MOVW R0, ret+0(FP)
RET
TEXT runtime·emptyfunc(SB),0,$0-0
View
@@ -704,9 +704,9 @@ TEXT setg_gcc<>(SB),NOSPLIT,$8
MOVD savedR27-8(SP), R27
RET
TEXT runtime·getcallerpc(SB),NOSPLIT,$8-16
MOVD 16(RSP), R0 // LR saved by caller
MOVD R0, ret+8(FP)
TEXT runtime·getcallerpc(SB),NOSPLIT,$-8-8
MOVD 0(RSP), R0 // LR saved by caller
MOVD R0, ret+0(FP)
RET
TEXT runtime·abort(SB),NOSPLIT,$-8-0
@@ -616,9 +616,9 @@ TEXT setg_gcc<>(SB),NOSPLIT,$0-0
JAL runtime·save_g(SB)
RET
TEXT runtime·getcallerpc(SB),NOSPLIT,$8-16
MOVV 16(R29), R1 // LR saved by caller
MOVV R1, ret+8(FP)
TEXT runtime·getcallerpc(SB),NOSPLIT,$-8-8
MOVV 0(R29), R1 // LR saved by caller
MOVV R1, ret+0(FP)
RET
TEXT runtime·abort(SB),NOSPLIT,$-8-0
View
@@ -619,9 +619,9 @@ TEXT setg_gcc<>(SB),NOSPLIT,$0
JAL runtime·save_g(SB)
RET
TEXT runtime·getcallerpc(SB),NOSPLIT,$4-8
MOVW 8(R29), R1 // LR saved by caller
MOVW R1, ret+4(FP)
TEXT runtime·getcallerpc(SB),NOSPLIT,$-4-4
MOVW 0(R29), R1 // LR saved by caller
MOVW R1, ret+0(FP)
RET
TEXT runtime·abort(SB),NOSPLIT,$0-0
View
@@ -714,9 +714,9 @@ TEXT setg_gcc<>(SB),NOSPLIT|NOFRAME,$0-0
MOVD R4, LR
RET
TEXT runtime·getcallerpc(SB),NOSPLIT,$8-16
MOVD FIXED_FRAME+8(R1), R3 // LR saved by caller
MOVD R3, ret+8(FP)
TEXT runtime·getcallerpc(SB),NOSPLIT|NOFRAME,$0-8
MOVD 0(R1), R3 // LR saved by caller
MOVD R3, ret+0(FP)
RET
TEXT runtime·abort(SB),NOSPLIT|NOFRAME,$0-0
View
@@ -656,9 +656,9 @@ TEXT setg_gcc<>(SB),NOSPLIT|NOFRAME,$0-0
MOVD R1, LR
RET
TEXT runtime·getcallerpc(SB),NOSPLIT,$8-16
MOVD 16(R15), R3 // LR saved by caller
MOVD R3, ret+8(FP)
TEXT runtime·getcallerpc(SB),NOSPLIT|NOFRAME,$0-8
MOVD 0(R15), R3 // LR saved by caller
MOVD R3, ret+0(FP)
RET
TEXT runtime·abort(SB),NOSPLIT|NOFRAME,$0-0
View
@@ -122,7 +122,7 @@ func chanbuf(c *hchan, i uint) unsafe.Pointer {
// entry point for c <- x from compiled code
//go:nosplit
func chansend1(c *hchan, elem unsafe.Pointer) {
chansend(c, elem, true, getcallerpc(unsafe.Pointer(&c)))
chansend(c, elem, true, getcallerpc())
}
/*
@@ -334,7 +334,7 @@ func closechan(c *hchan) {
}
if raceenabled {
callerpc := getcallerpc(unsafe.Pointer(&c))
callerpc := getcallerpc()
racewritepc(unsafe.Pointer(c), callerpc, funcPC(closechan))
racerelease(unsafe.Pointer(c))
}
@@ -606,7 +606,7 @@ func recv(c *hchan, sg *sudog, ep unsafe.Pointer, unlockf func(), skip int) {
// }
//
func selectnbsend(c *hchan, elem unsafe.Pointer) (selected bool) {
return chansend(c, elem, false, getcallerpc(unsafe.Pointer(&c)))
return chansend(c, elem, false, getcallerpc())
}
// compiler implements
@@ -656,7 +656,7 @@ func selectnbrecv2(elem unsafe.Pointer, received *bool, c *hchan) (selected bool
//go:linkname reflect_chansend reflect.chansend
func reflect_chansend(c *hchan, elem unsafe.Pointer, nb bool) (selected bool) {
return chansend(c, elem, !nb, getcallerpc(unsafe.Pointer(&c)))
return chansend(c, elem, !nb, getcallerpc())
}
//go:linkname reflect_chanrecv reflect.chanrecv
View
@@ -333,7 +333,7 @@ func makemap(t *maptype, hint int, h *hmap) *hmap {
// hold onto it for very long.
func mapaccess1(t *maptype, h *hmap, key unsafe.Pointer) unsafe.Pointer {
if raceenabled && h != nil {
callerpc := getcallerpc(unsafe.Pointer(&t))
callerpc := getcallerpc()
pc := funcPC(mapaccess1)
racereadpc(unsafe.Pointer(h), callerpc, pc)
raceReadObjectPC(t.key, key, callerpc, pc)
@@ -385,7 +385,7 @@ func mapaccess1(t *maptype, h *hmap, key unsafe.Pointer) unsafe.Pointer {
func mapaccess2(t *maptype, h *hmap, key unsafe.Pointer) (unsafe.Pointer, bool) {
if raceenabled && h != nil {
callerpc := getcallerpc(unsafe.Pointer(&t))
callerpc := getcallerpc()
pc := funcPC(mapaccess2)
racereadpc(unsafe.Pointer(h), callerpc, pc)
raceReadObjectPC(t.key, key, callerpc, pc)
@@ -498,7 +498,7 @@ func mapassign(t *maptype, h *hmap, key unsafe.Pointer) unsafe.Pointer {
panic(plainError("assignment to entry in nil map"))
}
if raceenabled {
callerpc := getcallerpc(unsafe.Pointer(&t))
callerpc := getcallerpc()
pc := funcPC(mapassign)
racewritepc(unsafe.Pointer(h), callerpc, pc)
raceReadObjectPC(t.key, key, callerpc, pc)
@@ -606,7 +606,7 @@ done:
func mapdelete(t *maptype, h *hmap, key unsafe.Pointer) {
if raceenabled && h != nil {
callerpc := getcallerpc(unsafe.Pointer(&t))
callerpc := getcallerpc()
pc := funcPC(mapdelete)
racewritepc(unsafe.Pointer(h), callerpc, pc)
raceReadObjectPC(t.key, key, callerpc, pc)
@@ -681,7 +681,7 @@ search:
// Both need to have zeroed hiter since the struct contains pointers.
func mapiterinit(t *maptype, h *hmap, it *hiter) {
if raceenabled && h != nil {
callerpc := getcallerpc(unsafe.Pointer(&t))
callerpc := getcallerpc()
racereadpc(unsafe.Pointer(h), callerpc, funcPC(mapiterinit))
}
@@ -731,7 +731,7 @@ func mapiterinit(t *maptype, h *hmap, it *hiter) {
func mapiternext(it *hiter) {
h := it.h
if raceenabled {
callerpc := getcallerpc(unsafe.Pointer(&it))
callerpc := getcallerpc()
racereadpc(unsafe.Pointer(h), callerpc, funcPC(mapiternext))
}
if h.flags&hashWriting != 0 {
@@ -1225,7 +1225,7 @@ func reflect_maplen(h *hmap) int {
return 0
}
if raceenabled {
callerpc := getcallerpc(unsafe.Pointer(&h))
callerpc := getcallerpc()
racereadpc(unsafe.Pointer(h), callerpc, funcPC(reflect_maplen))
}
return h.count
@@ -11,7 +11,7 @@ import (
func mapaccess1_fast32(t *maptype, h *hmap, key uint32) unsafe.Pointer {
if raceenabled && h != nil {
callerpc := getcallerpc(unsafe.Pointer(&t))
callerpc := getcallerpc()
racereadpc(unsafe.Pointer(h), callerpc, funcPC(mapaccess1_fast32))
}
if h == nil || h.count == 0 {
@@ -51,7 +51,7 @@ func mapaccess1_fast32(t *maptype, h *hmap, key uint32) unsafe.Pointer {
func mapaccess2_fast32(t *maptype, h *hmap, key uint32) (unsafe.Pointer, bool) {
if raceenabled && h != nil {
callerpc := getcallerpc(unsafe.Pointer(&t))
callerpc := getcallerpc()
racereadpc(unsafe.Pointer(h), callerpc, funcPC(mapaccess2_fast32))
}
if h == nil || h.count == 0 {
@@ -91,7 +91,7 @@ func mapaccess2_fast32(t *maptype, h *hmap, key uint32) (unsafe.Pointer, bool) {
func mapaccess1_fast64(t *maptype, h *hmap, key uint64) unsafe.Pointer {
if raceenabled && h != nil {
callerpc := getcallerpc(unsafe.Pointer(&t))
callerpc := getcallerpc()
racereadpc(unsafe.Pointer(h), callerpc, funcPC(mapaccess1_fast64))
}
if h == nil || h.count == 0 {
@@ -131,7 +131,7 @@ func mapaccess1_fast64(t *maptype, h *hmap, key uint64) unsafe.Pointer {
func mapaccess2_fast64(t *maptype, h *hmap, key uint64) (unsafe.Pointer, bool) {
if raceenabled && h != nil {
callerpc := getcallerpc(unsafe.Pointer(&t))
callerpc := getcallerpc()
racereadpc(unsafe.Pointer(h), callerpc, funcPC(mapaccess2_fast64))
}
if h == nil || h.count == 0 {
@@ -171,7 +171,7 @@ func mapaccess2_fast64(t *maptype, h *hmap, key uint64) (unsafe.Pointer, bool) {
func mapaccess1_faststr(t *maptype, h *hmap, ky string) unsafe.Pointer {
if raceenabled && h != nil {
callerpc := getcallerpc(unsafe.Pointer(&t))
callerpc := getcallerpc()
racereadpc(unsafe.Pointer(h), callerpc, funcPC(mapaccess1_faststr))
}
if h == nil || h.count == 0 {
@@ -260,7 +260,7 @@ dohash:
func mapaccess2_faststr(t *maptype, h *hmap, ky string) (unsafe.Pointer, bool) {
if raceenabled && h != nil {
callerpc := getcallerpc(unsafe.Pointer(&t))
callerpc := getcallerpc()
racereadpc(unsafe.Pointer(h), callerpc, funcPC(mapaccess2_faststr))
}
if h == nil || h.count == 0 {
@@ -352,7 +352,7 @@ func mapassign_fast32(t *maptype, h *hmap, key uint32) unsafe.Pointer {
panic(plainError("assignment to entry in nil map"))
}
if raceenabled {
callerpc := getcallerpc(unsafe.Pointer(&t))
callerpc := getcallerpc()
racewritepc(unsafe.Pointer(h), callerpc, funcPC(mapassign_fast32))
}
if h.flags&hashWriting != 0 {
@@ -441,7 +441,7 @@ func mapassign_fast64(t *maptype, h *hmap, key uint64) unsafe.Pointer {
panic(plainError("assignment to entry in nil map"))
}
if raceenabled {
callerpc := getcallerpc(unsafe.Pointer(&t))
callerpc := getcallerpc()
racewritepc(unsafe.Pointer(h), callerpc, funcPC(mapassign_fast64))
}
if h.flags&hashWriting != 0 {
@@ -536,7 +536,7 @@ func mapassign_faststr(t *maptype, h *hmap, ky string) unsafe.Pointer {
panic(plainError("assignment to entry in nil map"))
}
if raceenabled {
callerpc := getcallerpc(unsafe.Pointer(&t))
callerpc := getcallerpc()
racewritepc(unsafe.Pointer(h), callerpc, funcPC(mapassign_faststr))
}
if h.flags&hashWriting != 0 {
@@ -623,7 +623,7 @@ done:
func mapdelete_fast32(t *maptype, h *hmap, key uint32) {
if raceenabled && h != nil {
callerpc := getcallerpc(unsafe.Pointer(&t))
callerpc := getcallerpc()
racewritepc(unsafe.Pointer(h), callerpc, funcPC(mapdelete_fast32))
}
if h == nil || h.count == 0 {
@@ -672,7 +672,7 @@ search:
func mapdelete_fast64(t *maptype, h *hmap, key uint64) {
if raceenabled && h != nil {
callerpc := getcallerpc(unsafe.Pointer(&t))
callerpc := getcallerpc()
racewritepc(unsafe.Pointer(h), callerpc, funcPC(mapdelete_fast64))
}
if h == nil || h.count == 0 {
@@ -721,7 +721,7 @@ search:
func mapdelete_faststr(t *maptype, h *hmap, ky string) {
if raceenabled && h != nil {
callerpc := getcallerpc(unsafe.Pointer(&t))
callerpc := getcallerpc()
racewritepc(unsafe.Pointer(h), callerpc, funcPC(mapdelete_faststr))
}
if h == nil || h.count == 0 {
Oops, something went wrong.

0 comments on commit 229aaac

Please sign in to comment.