aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorNicolas Hillegeer <aktau@google.com>2022-03-28 17:40:23 -0700
committerNicolas Hillegeer <aktau@google.com>2022-03-29 06:58:14 -0700
commit50b8f490e1701773254fdbfe0e3fea00ff1f2a68 (patch)
tree04ec11644acabbc5a1c78cb261891334a788ea05 /src/runtime
parent0af0e193680d4688e1f09c5ca315740571b03eea (diff)
parentc3fcd0117784ac05e35120ac0de6c960b400a31e (diff)
downloadgo-50b8f490e1701773254fdbfe0e3fea00ff1f2a68.tar.xz
[dev.boringcrypto] all: merge master into dev.boringcrypto
Change-Id: I04d511ed8e3e7ca4a3267f226a0c3e248c0f84a9
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/abi_test.go2
-rw-r--r--src/runtime/asm_arm64.s155
-rw-r--r--src/runtime/asm_ppc64x.s92
-rw-r--r--src/runtime/cgo/gcc_freebsd_arm.c6
-rw-r--r--src/runtime/crash_cgo_test.go2
-rw-r--r--src/runtime/crash_test.go2
-rw-r--r--src/runtime/debug/stack_test.go112
-rw-r--r--src/runtime/debug_test.go5
-rw-r--r--src/runtime/duff_riscv64.s1536
-rw-r--r--src/runtime/memclr_arm64.s5
-rw-r--r--src/runtime/memclr_ppc64x.s6
-rw-r--r--src/runtime/memmove_arm64.s5
-rw-r--r--src/runtime/memmove_ppc64x.s8
-rw-r--r--src/runtime/mgcwork.go9
-rw-r--r--src/runtime/mkduff.go22
-rw-r--r--src/runtime/os3_solaris.go3
-rw-r--r--src/runtime/pprof/mprof_test.go18
-rw-r--r--src/runtime/pprof/pprof_norusage.go2
-rw-r--r--src/runtime/pprof/pprof_rusage.go8
-rw-r--r--src/runtime/pprof/pprof_test.go108
-rw-r--r--src/runtime/pprof/proto.go52
-rw-r--r--src/runtime/pprof/rusage_test.go10
-rw-r--r--src/runtime/race/README2
-rw-r--r--src/runtime/race/race_linux_amd64.sysobin525176 -> 552768 bytes
-rw-r--r--src/runtime/race/testdata/mop_test.go14
-rw-r--r--src/runtime/race_arm64.s22
-rw-r--r--src/runtime/race_ppc64le.s30
-rw-r--r--src/runtime/rt0_linux_ppc64le.s30
-rw-r--r--src/runtime/runtime-gdb_test.go18
-rw-r--r--src/runtime/runtime2.go2
-rw-r--r--src/runtime/signal_windows_test.go34
-rw-r--r--src/runtime/stubs.go3
-rw-r--r--src/runtime/sys_solaris_amd64.s12
-rw-r--r--src/runtime/syscall_solaris.go18
-rw-r--r--src/runtime/testdata/testwinsignal/main.go36
-rw-r--r--src/runtime/tls_arm64.h5
-rw-r--r--src/runtime/traceback.go4
-rw-r--r--src/runtime/traceback_test.go4
38 files changed, 1109 insertions, 1293 deletions
diff --git a/src/runtime/abi_test.go b/src/runtime/abi_test.go
index f9e8d701ce..0c9488a5f4 100644
--- a/src/runtime/abi_test.go
+++ b/src/runtime/abi_test.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build goexperiment.regabireflect
+//go:build goexperiment.regabiargs
// This file contains tests specific to making sure the register ABI
// works in a bunch of contexts in the runtime.
diff --git a/src/runtime/asm_arm64.s b/src/runtime/asm_arm64.s
index 9e9d9314ef..62deb070aa 100644
--- a/src/runtime/asm_arm64.s
+++ b/src/runtime/asm_arm64.s
@@ -150,11 +150,7 @@ TEXT gogo<>(SB), NOSPLIT|NOFRAME, $0
// Fn must never return. It should gogo(&g->sched)
// to keep running g.
TEXT runtime·mcall<ABIInternal>(SB), NOSPLIT|NOFRAME, $0-8
-#ifdef GOEXPERIMENT_regabiargs
MOVD R0, R26 // context
-#else
- MOVD fn+0(FP), R26 // context
-#endif
// Save caller state in g->sched
MOVD RSP, R0
@@ -175,11 +171,7 @@ TEXT runtime·mcall<ABIInternal>(SB), NOSPLIT|NOFRAME, $0-8
MOVD (g_sched+gobuf_sp)(g), R0
MOVD R0, RSP // sp = m->g0->sched.sp
MOVD (g_sched+gobuf_bp)(g), R29
-#ifdef GOEXPERIMENT_regabiargs
MOVD R3, R0 // arg = g
-#else
- MOVD R3, -8(RSP) // arg = g
-#endif
MOVD $0, -16(RSP) // dummy LR
SUB $16, RSP
MOVD 0(R26), R4 // code pointer
@@ -317,7 +309,6 @@ TEXT runtime·morestack_noctxt(SB),NOSPLIT|NOFRAME,$0-0
MOVW $0, R26
B runtime·morestack(SB)
-#ifdef GOEXPERIMENT_regabireflect
// spillArgs stores return values from registers to a *internal/abi.RegArgs in R20.
TEXT ·spillArgs(SB),NOSPLIT,$0-0
MOVD R0, (0*8)(R20)
@@ -389,13 +380,6 @@ TEXT ·unspillArgs(SB),NOSPLIT,$0-0
FMOVD (30*8)(R20), F14
FMOVD (31*8)(R20), F15
RET
-#else
-TEXT ·spillArgs(SB),NOSPLIT,$0-0
- RET
-
-TEXT ·unspillArgs(SB),NOSPLIT,$0-0
- RET
-#endif
// reflectcall: call a function with the given argument list
// func call(stackArgsType *_type, f *FuncVal, stackArgs *byte, stackArgsSize, stackRetOffset, frameSize uint32, regArgs *abi.RegArgs).
@@ -536,11 +520,6 @@ CALLFN(·call1073741824, 1073741824)
TEXT runtime·memhash32<ABIInternal>(SB),NOSPLIT|NOFRAME,$0-24
MOVB runtime·useAeshash(SB), R10
CBZ R10, noaes
-#ifndef GOEXPERIMENT_regabiargs
- MOVD p+0(FP), R0
- MOVD h+8(FP), R1
- MOVD $ret+16(FP), R2
-#endif
MOVD $runtime·aeskeysched+0(SB), R3
VEOR V0.B16, V0.B16, V0.B16
@@ -554,11 +533,7 @@ TEXT runtime·memhash32<ABIInternal>(SB),NOSPLIT|NOFRAME,$0-24
AESMC V0.B16, V0.B16
AESE V2.B16, V0.B16
-#ifdef GOEXPERIMENT_regabiargs
VMOV V0.D[0], R0
-#else
- VST1 [V0.D1], (R2)
-#endif
RET
noaes:
B runtime·memhash32Fallback<ABIInternal>(SB)
@@ -567,11 +542,6 @@ noaes:
TEXT runtime·memhash64<ABIInternal>(SB),NOSPLIT|NOFRAME,$0-24
MOVB runtime·useAeshash(SB), R10
CBZ R10, noaes
-#ifndef GOEXPERIMENT_regabiargs
- MOVD p+0(FP), R0
- MOVD h+8(FP), R1
- MOVD $ret+16(FP), R2
-#endif
MOVD $runtime·aeskeysched+0(SB), R3
VEOR V0.B16, V0.B16, V0.B16
@@ -585,11 +555,7 @@ TEXT runtime·memhash64<ABIInternal>(SB),NOSPLIT|NOFRAME,$0-24
AESMC V0.B16, V0.B16
AESE V2.B16, V0.B16
-#ifdef GOEXPERIMENT_regabiargs
VMOV V0.D[0], R0
-#else
- VST1 [V0.D1], (R2)
-#endif
RET
noaes:
B runtime·memhash64Fallback<ABIInternal>(SB)
@@ -598,12 +564,6 @@ noaes:
TEXT runtime·memhash<ABIInternal>(SB),NOSPLIT|NOFRAME,$0-32
MOVB runtime·useAeshash(SB), R10
CBZ R10, noaes
-#ifndef GOEXPERIMENT_regabiargs
- MOVD p+0(FP), R0
- MOVD h+8(FP), R1
- MOVD s+16(FP), R2
- MOVD $ret+24(FP), R8
-#endif
B aeshashbody<>(SB)
noaes:
B runtime·memhashFallback<ABIInternal>(SB)
@@ -612,14 +572,7 @@ noaes:
TEXT runtime·strhash<ABIInternal>(SB),NOSPLIT|NOFRAME,$0-24
MOVB runtime·useAeshash(SB), R10
CBZ R10, noaes
-#ifdef GOEXPERIMENT_regabiargs
LDP (R0), (R0, R2) // string data / length
-#else
- MOVD p+0(FP), R10 // string pointer
- LDP (R10), (R0, R2) // string data / length
- MOVD h+8(FP), R1
- MOVD $ret+16(FP), R8 // return adddress
-#endif
B aeshashbody<>(SB)
noaes:
B runtime·strhashFallback<ABIInternal>(SB)
@@ -627,11 +580,7 @@ noaes:
// R0: data
// R1: seed data
// R2: length
-#ifdef GOEXPERIMENT_regabiargs
// At return, R0 = return value
-#else
-// R8: address to put return value
-#endif
TEXT aeshashbody<>(SB),NOSPLIT|NOFRAME,$0
VEOR V30.B16, V30.B16, V30.B16
VMOV R1, V30.D[0]
@@ -676,19 +625,11 @@ done:
AESMC V2.B16, V2.B16
AESE V0.B16, V2.B16
-#ifdef GOEXPERIMENT_regabiargs
VMOV V2.D[0], R0
-#else
- VST1 [V2.D1], (R8)
-#endif
RET
aes0:
-#ifdef GOEXPERIMENT_regabiargs
VMOV V0.D[0], R0
-#else
- VST1 [V0.D1], (R8)
-#endif
RET
aes16:
@@ -718,11 +659,8 @@ aes17to32:
AESE V1.B16, V3.B16
VEOR V3.B16, V2.B16, V2.B16
-#ifdef GOEXPERIMENT_regabiargs
+
VMOV V2.D[0], R0
-#else
- VST1 [V2.D1], (R8)
-#endif
RET
aes33to64:
@@ -765,11 +703,7 @@ aes33to64:
VEOR V7.B16, V5.B16, V5.B16
VEOR V5.B16, V4.B16, V4.B16
-#ifdef GOEXPERIMENT_regabiargs
VMOV V4.D[0], R0
-#else
- VST1 [V4.D1], (R8)
-#endif
RET
aes65to128:
@@ -844,11 +778,7 @@ aes65to128:
VEOR V11.B16, V9.B16, V9.B16
VEOR V9.B16, V8.B16, V8.B16
-#ifdef GOEXPERIMENT_regabiargs
VMOV V8.D[0], R0
-#else
- VST1 [V8.D1], (R8)
-#endif
RET
aes129plus:
@@ -967,11 +897,7 @@ aesloop:
VEOR V4.B16, V6.B16, V4.B16
VEOR V4.B16, V0.B16, V0.B16
-#ifdef GOEXPERIMENT_regabiargs
VMOV V0.D[0], R0
-#else
- VST1 [V0.D1], (R8)
-#endif
RET
TEXT runtime·procyield(SB),NOSPLIT,$0-0
@@ -1383,137 +1309,58 @@ flush:
// Defined as ABIInternal since the compiler generates ABIInternal
// calls to it directly and it does not use the stack-based Go ABI.
TEXT runtime·panicIndex<ABIInternal>(SB),NOSPLIT,$0-16
-#ifndef GOEXPERIMENT_regabiargs
- MOVD R0, x+0(FP)
- MOVD R1, y+8(FP)
-#endif
JMP runtime·goPanicIndex<ABIInternal>(SB)
TEXT runtime·panicIndexU<ABIInternal>(SB),NOSPLIT,$0-16
-#ifndef GOEXPERIMENT_regabiargs
- MOVD R0, x+0(FP)
- MOVD R1, y+8(FP)
-#endif
JMP runtime·goPanicIndexU<ABIInternal>(SB)
TEXT runtime·panicSliceAlen<ABIInternal>(SB),NOSPLIT,$0-16
-#ifdef GOEXPERIMENT_regabiargs
MOVD R1, R0
MOVD R2, R1
-#else
- MOVD R1, x+0(FP)
- MOVD R2, y+8(FP)
-#endif
JMP runtime·goPanicSliceAlen<ABIInternal>(SB)
TEXT runtime·panicSliceAlenU<ABIInternal>(SB),NOSPLIT,$0-16
-#ifdef GOEXPERIMENT_regabiargs
MOVD R1, R0
MOVD R2, R1
-#else
- MOVD R1, x+0(FP)
- MOVD R2, y+8(FP)
-#endif
JMP runtime·goPanicSliceAlenU<ABIInternal>(SB)
TEXT runtime·panicSliceAcap<ABIInternal>(SB),NOSPLIT,$0-16
-#ifdef GOEXPERIMENT_regabiargs
MOVD R1, R0
MOVD R2, R1
-#else
- MOVD R1, x+0(FP)
- MOVD R2, y+8(FP)
-#endif
JMP runtime·goPanicSliceAcap<ABIInternal>(SB)
TEXT runtime·panicSliceAcapU<ABIInternal>(SB),NOSPLIT,$0-16
-#ifdef GOEXPERIMENT_regabiargs
MOVD R1, R0
MOVD R2, R1
-#else
- MOVD R1, x+0(FP)
- MOVD R2, y+8(FP)
-#endif
JMP runtime·goPanicSliceAcapU<ABIInternal>(SB)
TEXT runtime·panicSliceB<ABIInternal>(SB),NOSPLIT,$0-16
-#ifndef GOEXPERIMENT_regabiargs
- MOVD R0, x+0(FP)
- MOVD R1, y+8(FP)
-#endif
JMP runtime·goPanicSliceB<ABIInternal>(SB)
TEXT runtime·panicSliceBU<ABIInternal>(SB),NOSPLIT,$0-16
-#ifndef GOEXPERIMENT_regabiargs
- MOVD R0, x+0(FP)
- MOVD R1, y+8(FP)
-#endif
JMP runtime·goPanicSliceBU<ABIInternal>(SB)
TEXT runtime·panicSlice3Alen<ABIInternal>(SB),NOSPLIT,$0-16
-#ifdef GOEXPERIMENT_regabiargs
MOVD R2, R0
MOVD R3, R1
-#else
- MOVD R2, x+0(FP)
- MOVD R3, y+8(FP)
-#endif
JMP runtime·goPanicSlice3Alen<ABIInternal>(SB)
TEXT runtime·panicSlice3AlenU<ABIInternal>(SB),NOSPLIT,$0-16
-#ifdef GOEXPERIMENT_regabiargs
MOVD R2, R0
MOVD R3, R1
-#else
- MOVD R2, x+0(FP)
- MOVD R3, y+8(FP)
-#endif
JMP runtime·goPanicSlice3AlenU<ABIInternal>(SB)
TEXT runtime·panicSlice3Acap<ABIInternal>(SB),NOSPLIT,$0-16
-#ifdef GOEXPERIMENT_regabiargs
MOVD R2, R0
MOVD R3, R1
-#else
- MOVD R2, x+0(FP)
- MOVD R3, y+8(FP)
-#endif
JMP runtime·goPanicSlice3Acap<ABIInternal>(SB)
TEXT runtime·panicSlice3AcapU<ABIInternal>(SB),NOSPLIT,$0-16
-#ifdef GOEXPERIMENT_regabiargs
MOVD R2, R0
MOVD R3, R1
-#else
- MOVD R2, x+0(FP)
- MOVD R3, y+8(FP)
-#endif
JMP runtime·goPanicSlice3AcapU<ABIInternal>(SB)
TEXT runtime·panicSlice3B<ABIInternal>(SB),NOSPLIT,$0-16
-#ifdef GOEXPERIMENT_regabiargs
MOVD R1, R0
MOVD R2, R1
-#else
- MOVD R1, x+0(FP)
- MOVD R2, y+8(FP)
-#endif
JMP runtime·goPanicSlice3B<ABIInternal>(SB)
TEXT runtime·panicSlice3BU<ABIInternal>(SB),NOSPLIT,$0-16
-#ifdef GOEXPERIMENT_regabiargs
MOVD R1, R0
MOVD R2, R1
-#else
- MOVD R1, x+0(FP)
- MOVD R2, y+8(FP)
-#endif
JMP runtime·goPanicSlice3BU<ABIInternal>(SB)
TEXT runtime·panicSlice3C<ABIInternal>(SB),NOSPLIT,$0-16
-#ifndef GOEXPERIMENT_regabiargs
- MOVD R0, x+0(FP)
- MOVD R1, y+8(FP)
-#endif
JMP runtime·goPanicSlice3C<ABIInternal>(SB)
TEXT runtime·panicSlice3CU<ABIInternal>(SB),NOSPLIT,$0-16
-#ifndef GOEXPERIMENT_regabiargs
- MOVD R0, x+0(FP)
- MOVD R1, y+8(FP)
-#endif
JMP runtime·goPanicSlice3CU<ABIInternal>(SB)
TEXT runtime·panicSliceConvert<ABIInternal>(SB),NOSPLIT,$0-16
-#ifdef GOEXPERIMENT_regabiargs
MOVD R2, R0
MOVD R3, R1
-#else
- MOVD R2, x+0(FP)
- MOVD R3, y+8(FP)
-#endif
JMP runtime·goPanicSliceConvert<ABIInternal>(SB)
diff --git a/src/runtime/asm_ppc64x.s b/src/runtime/asm_ppc64x.s
index ae14213999..1d292b4e60 100644
--- a/src/runtime/asm_ppc64x.s
+++ b/src/runtime/asm_ppc64x.s
@@ -167,11 +167,7 @@ TEXT gogo<>(SB), NOSPLIT|NOFRAME, $0
TEXT runtime·mcall<ABIInternal>(SB), NOSPLIT|NOFRAME, $0-8
// Save caller state in g->sched
// R11 should be safe across save_g??
-#ifdef GOEXPERIMENT_regabiargs
MOVD R3, R11
-#else
- MOVD fn+0(FP), R11
-#endif
MOVD R1, (g_sched+gobuf_sp)(g)
MOVD LR, R31
MOVD R31, (g_sched+gobuf_pc)(g)
@@ -788,7 +784,6 @@ TEXT runtime·cputicks(SB),NOSPLIT,$0-8
MOVD R3, ret+0(FP)
RET
-#ifdef GOEXPERIMENT_regabireflect
// spillArgs stores return values from registers to a *internal/abi.RegArgs in R20.
TEXT runtime·spillArgs(SB),NOSPLIT,$0-0
MOVD R3, 0(R20)
@@ -844,14 +839,6 @@ TEXT runtime·unspillArgs(SB),NOSPLIT,$0-0
FMOVD 176(R20), F11
FMOVD 184(R20), F12
RET
-#else
-
-TEXT runtime·spillArgs(SB),NOSPLIT,$0-0
- RET
-
-TEXT runtime·unspillArgs(SB),NOSPLIT,$0-0
- RET
-#endif
// AES hashing not implemented for ppc64
TEXT runtime·memhash<ABIInternal>(SB),NOSPLIT|NOFRAME,$0-32
@@ -1009,137 +996,58 @@ flush:
// then tail call to the corresponding runtime handler.
// The tail call makes these stubs disappear in backtraces.
TEXT runtime·panicIndex<ABIInternal>(SB),NOSPLIT,$0-16
-#ifndef GOEXPERIMENT_regabiargs
- MOVD R3, x+0(FP)
- MOVD R4, y+8(FP)
-#endif
JMP runtime·goPanicIndex<ABIInternal>(SB)
TEXT runtime·panicIndexU<ABIInternal>(SB),NOSPLIT,$0-16
-#ifndef GOEXPERIMENT_regabiargs
- MOVD R3, x+0(FP)
- MOVD R4, y+8(FP)
-#endif
JMP runtime·goPanicIndexU<ABIInternal>(SB)
TEXT runtime·panicSliceAlen<ABIInternal>(SB),NOSPLIT,$0-16
-#ifdef GOEXPERIMENT_regabiargs
MOVD R4, R3
MOVD R5, R4
-#else
- MOVD R4, x+0(FP)
- MOVD R5, y+8(FP)
-#endif
JMP runtime·goPanicSliceAlen<ABIInternal>(SB)
TEXT runtime·panicSliceAlenU<ABIInternal>(SB),NOSPLIT,$0-16
-#ifdef GOEXPERIMENT_regabiargs
MOVD R4, R3
MOVD R5, R4
-#else
- MOVD R4, x+0(FP)
- MOVD R5, y+8(FP)
-#endif
JMP runtime·goPanicSliceAlenU<ABIInternal>(SB)
TEXT runtime·panicSliceAcap<ABIInternal>(SB),NOSPLIT,$0-16
-#ifdef GOEXPERIMENT_regabiargs
MOVD R4, R3
MOVD R5, R4
-#else
- MOVD R4, x+0(FP)
- MOVD R5, y+8(FP)
-#endif
JMP runtime·goPanicSliceAcap<ABIInternal>(SB)
TEXT runtime·panicSliceAcapU<ABIInternal>(SB),NOSPLIT,$0-16
-#ifdef GOEXPERIMENT_regabiargs
MOVD R4, R3
MOVD R5, R4
-#else
- MOVD R4, x+0(FP)
- MOVD R5, y+8(FP)
-#endif
JMP runtime·goPanicSliceAcapU<ABIInternal>(SB)
TEXT runtime·panicSliceB<ABIInternal>(SB),NOSPLIT,$0-16
-#ifndef GOEXPERIMENT_regabiargs
- MOVD R3, x+0(FP)
- MOVD R4, y+8(FP)
-#endif
JMP runtime·goPanicSliceB<ABIInternal>(SB)
TEXT runtime·panicSliceBU<ABIInternal>(SB),NOSPLIT,$0-16
-#ifndef GOEXPERIMENT_regabiargs
- MOVD R3, x+0(FP)
- MOVD R4, y+8(FP)
-#endif
JMP runtime·goPanicSliceBU<ABIInternal>(SB)
TEXT runtime·panicSlice3Alen<ABIInternal>(SB),NOSPLIT,$0-16
-#ifdef GOEXPERIMENT_regabiargs
MOVD R5, R3
MOVD R6, R4
-#else
- MOVD R5, x+0(FP)
- MOVD R6, y+8(FP)
-#endif
JMP runtime·goPanicSlice3Alen<ABIInternal>(SB)
TEXT runtime·panicSlice3AlenU<ABIInternal>(SB),NOSPLIT,$0-16
-#ifdef GOEXPERIMENT_regabiargs
MOVD R5, R3
MOVD R6, R4
-#else
- MOVD R5, x+0(FP)
- MOVD R6, y+8(FP)
-#endif
JMP runtime·goPanicSlice3AlenU<ABIInternal>(SB)
TEXT runtime·panicSlice3Acap<ABIInternal>(SB),NOSPLIT,$0-16
-#ifdef GOEXPERIMENT_regabiargs
MOVD R5, R3
MOVD R6, R4
-#else
- MOVD R5, x+0(FP)
- MOVD R6, y+8(FP)
-#endif
JMP runtime·goPanicSlice3Acap<ABIInternal>(SB)
TEXT runtime·panicSlice3AcapU<ABIInternal>(SB),NOSPLIT,$0-16
-#ifdef GOEXPERIMENT_regabiargs
MOVD R5, R3
MOVD R6, R4
-#else
- MOVD R5, x+0(FP)
- MOVD R6, y+8(FP)
-#endif
JMP runtime·goPanicSlice3AcapU<ABIInternal>(SB)
TEXT runtime·panicSlice3B<ABIInternal>(SB),NOSPLIT,$0-16
-#ifdef GOEXPERIMENT_regabiargs
MOVD R4, R3
MOVD R5, R4
-#else
- MOVD R4, x+0(FP)
- MOVD R5, y+8(FP)
-#endif
JMP runtime·goPanicSlice3B<ABIInternal>(SB)
TEXT runtime·panicSlice3BU<ABIInternal>(SB),NOSPLIT,$0-16
-#ifdef GOEXPERIMENT_regabiargs
MOVD R4, R3
MOVD R5, R4
-#else
- MOVD R4, x+0(FP)
- MOVD R5, y+8(FP)
-#endif
JMP runtime·goPanicSlice3BU<ABIInternal>(SB)
TEXT runtime·panicSlice3C<ABIInternal>(SB),NOSPLIT,$0-16
-#ifndef GOEXPERIMENT_regabiargs
- MOVD R3, x+0(FP)
- MOVD R4, y+8(FP)
-#endif
JMP runtime·goPanicSlice3C<ABIInternal>(SB)
TEXT runtime·panicSlice3CU<ABIInternal>(SB),NOSPLIT,$0-16
-#ifndef GOEXPERIMENT_regabiargs
- MOVD R3, x+0(FP)
- MOVD R4, y+8(FP)
-#endif
JMP runtime·goPanicSlice3CU<ABIInternal>(SB)
TEXT runtime·panicSliceConvert<ABIInternal>(SB),NOSPLIT,$0-16
-#ifdef GOEXPERIMENT_regabiargs
MOVD R5, R3
MOVD R6, R4
-#else
- MOVD R5, x+0(FP)
- MOVD R6, y+8(FP)
-#endif
JMP runtime·goPanicSliceConvert<ABIInternal>(SB)
diff --git a/src/runtime/cgo/gcc_freebsd_arm.c b/src/runtime/cgo/gcc_freebsd_arm.c
index 74f2e0ede5..5f89978379 100644
--- a/src/runtime/cgo/gcc_freebsd_arm.c
+++ b/src/runtime/cgo/gcc_freebsd_arm.c
@@ -37,7 +37,6 @@ x_cgo_init(G *g, void (*setg)(void*))
pthread_attr_destroy(&attr);
}
-
void
_cgo_sys_thread_start(ThreadStart *ts)
{
@@ -50,12 +49,7 @@ _cgo_sys_thread_start(ThreadStart *ts)
SIGFILLSET(ign);
pthread_sigmask(SIG_SETMASK, &ign, &oset);
- // Not sure why the memset is necessary here,
- // but without it, we get a bogus stack size
- // out of pthread_attr_getstacksize. C'est la Linux.
- memset(&attr, 0, sizeof attr);
pthread_attr_init(&attr);
- size = 0;
pthread_attr_getstacksize(&attr, &size);
// Leave stacklo=0 and set stackhi=size; mstart will do the rest.
ts->g->stackhi = size;
diff --git a/src/runtime/crash_cgo_test.go b/src/runtime/crash_cgo_test.go
index 37509b1292..5e58712297 100644
--- a/src/runtime/crash_cgo_test.go
+++ b/src/runtime/crash_cgo_test.go
@@ -629,7 +629,7 @@ func TestSegv(t *testing.T) {
testenv.SkipFlaky(t, 50504)
}
}
- if test == "SegvInCgo" && strings.Contains(got, "runtime: unknown pc") {
+ if test == "SegvInCgo" && strings.Contains(got, "unknown pc") {
testenv.SkipFlaky(t, 50979)
}
diff --git a/src/runtime/crash_test.go b/src/runtime/crash_test.go
index 9b9ab4f3e1..d8cabcdda2 100644
--- a/src/runtime/crash_test.go
+++ b/src/runtime/crash_test.go
@@ -665,7 +665,7 @@ retry:
func TestBadTraceback(t *testing.T) {
output := runTestProg(t, "testprog", "BadTraceback")
for _, want := range []string{
- "runtime: unexpected return pc",
+ "unexpected return pc",
"called from 0xbad",
"00000bad", // Smashed LR in hex dump
"<main.badLR", // Symbolization in hex dump (badLR1 or badLR2)
diff --git a/src/runtime/debug/stack_test.go b/src/runtime/debug/stack_test.go
index 9376e82b84..671057c3a0 100644
--- a/src/runtime/debug/stack_test.go
+++ b/src/runtime/debug/stack_test.go
@@ -5,11 +5,26 @@
package debug_test
import (
+ "bytes"
+ "fmt"
+ "internal/testenv"
+ "os"
+ "os/exec"
+ "path/filepath"
+ "runtime"
. "runtime/debug"
"strings"
"testing"
)
+func TestMain(m *testing.M) {
+ if os.Getenv("GO_RUNTIME_DEBUG_TEST_DUMP_GOROOT") != "" {
+ fmt.Println(runtime.GOROOT())
+ os.Exit(0)
+ }
+ os.Exit(m.Run())
+}
+
type T int
func (t *T) ptrmethod() []byte {
@@ -20,22 +35,22 @@ func (t T) method() []byte {
}
/*
- The traceback should look something like this, modulo line numbers and hex constants.
- Don't worry much about the base levels, but check the ones in our own package.
+The traceback should look something like this, modulo line numbers and hex constants.
+Don't worry much about the base levels, but check the ones in our own package.
- goroutine 10 [running]:
- runtime/debug.Stack(0x0, 0x0, 0x0)
- /Users/r/go/src/runtime/debug/stack.go:28 +0x80
- runtime/debug.(*T).ptrmethod(0xc82005ee70, 0x0, 0x0, 0x0)
- /Users/r/go/src/runtime/debug/stack_test.go:15 +0x29
- runtime/debug.T.method(0x0, 0x0, 0x0, 0x0)
- /Users/r/go/src/runtime/debug/stack_test.go:18 +0x32
- runtime/debug.TestStack(0xc8201ce000)
- /Users/r/go/src/runtime/debug/stack_test.go:37 +0x38
- testing.tRunner(0xc8201ce000, 0x664b58)
- /Users/r/go/src/testing/testing.go:456 +0x98
- created by testing.RunTests
- /Users/r/go/src/testing/testing.go:561 +0x86d
+ goroutine 10 [running]:
+ runtime/debug.Stack(0x0, 0x0, 0x0)
+ /Users/r/go/src/runtime/debug/stack.go:28 +0x80
+ runtime/debug.(*T).ptrmethod(0xc82005ee70, 0x0, 0x0, 0x0)
+ /Users/r/go/src/runtime/debug/stack_test.go:15 +0x29
+ runtime/debug.T.method(0x0, 0x0, 0x0, 0x0)
+ /Users/r/go/src/runtime/debug/stack_test.go:18 +0x32
+ runtime/debug.TestStack(0xc8201ce000)
+ /Users/r/go/src/runtime/debug/stack_test.go:37 +0x38
+ testing.tRunner(0xc8201ce000, 0x664b58)
+ /Users/r/go/src/testing/testing.go:456 +0x98
+ created by testing.RunTests
+ /Users/r/go/src/testing/testing.go:561 +0x86d
*/
func TestStack(t *testing.T) {
b := T(0).method()
@@ -43,23 +58,64 @@ func TestStack(t *testing.T) {
if len(lines) < 6 {
t.Fatal("too few lines")
}
+
+ // If built with -trimpath, file locations should start with package paths.
+ // Otherwise, file locations should start with a GOROOT/src prefix
+ // (for whatever value of GOROOT is baked into the binary, not the one
+ // that may be set in the environment).
+ fileGoroot := ""
+ if envGoroot := os.Getenv("GOROOT"); envGoroot != "" {
+ // Since GOROOT is set explicitly in the environment, we can't be certain
+ // that it is the same GOROOT value baked into the binary, and we can't
+ // change the value in-process because runtime.GOROOT uses the value from
+ // initial (not current) environment. Spawn a subprocess to determine the
+ // real baked-in GOROOT.
+ t.Logf("found GOROOT %q from environment; checking embedded GOROOT value", envGoroot)
+ testenv.MustHaveExec(t)
+ exe, err := os.Executable()
+ if err != nil {
+ t.Fatal(err)
+ }
+ cmd := exec.Command(exe)
+ cmd.Env = append(os.Environ(), "GOROOT=", "GO_RUNTIME_DEBUG_TEST_DUMP_GOROOT=1")
+ out, err := cmd.Output()
+ if err != nil {
+ t.Fatal(err)
+ }
+ fileGoroot = string(bytes.TrimSpace(out))
+ } else {
+ // Since GOROOT is not set in the environment, its value (if any) must come
+ // from the path embedded in the binary.
+ fileGoroot = runtime.GOROOT()
+ }
+ filePrefix := ""
+ if fileGoroot != "" {
+ filePrefix = filepath.ToSlash(fileGoroot) + "/src/"
+ }
+
n := 0
- frame := func(line, code string) {
- check(t, lines[n], code)
+ frame := func(file, code string) {
+ t.Helper()
+
+ line := lines[n]
+ if !strings.Contains(line, code) {
+ t.Errorf("expected %q in %q", code, line)
+ }
n++
- check(t, lines[n], line)
+
+ line = lines[n]
+
+ wantPrefix := "\t" + filePrefix + file
+ if !strings.HasPrefix(line, wantPrefix) {
+ t.Errorf("in line %q, expected prefix %q", line, wantPrefix)
+ }
n++
}
n++
- frame("src/runtime/debug/stack.go", "runtime/debug.Stack")
- frame("src/runtime/debug/stack_test.go", "runtime/debug_test.(*T).ptrmethod")
- frame("src/runtime/debug/stack_test.go", "runtime/debug_test.T.method")
- frame("src/runtime/debug/stack_test.go", "runtime/debug_test.TestStack")
- frame("src/testing/testing.go", "")
-}
-func check(t *testing.T, line, has string) {
- if !strings.Contains(line, has) {
- t.Errorf("expected %q in %q", has, line)
- }
+ frame("runtime/debug/stack.go", "runtime/debug.Stack")
+ frame("runtime/debug/stack_test.go", "runtime/debug_test.(*T).ptrmethod")
+ frame("runtime/debug/stack_test.go", "runtime/debug_test.T.method")
+ frame("runtime/debug/stack_test.go", "runtime/debug_test.TestStack")
+ frame("testing/testing.go", "")
}
diff --git a/src/runtime/debug_test.go b/src/runtime/debug_test.go
index 5bb0c5cee3..7698eacb59 100644
--- a/src/runtime/debug_test.go
+++ b/src/runtime/debug_test.go
@@ -16,7 +16,6 @@ package runtime_test
import (
"fmt"
"internal/abi"
- "internal/goexperiment"
"math"
"os"
"regexp"
@@ -144,7 +143,7 @@ func TestDebugCall(t *testing.T) {
intRegs := regs.Ints[:]
floatRegs := regs.Floats[:]
fval := float64(42.0)
- if goexperiment.RegabiArgs {
+ if len(intRegs) > 0 {
intRegs[0] = 42
floatRegs[0] = math.Float64bits(fval)
} else {
@@ -159,7 +158,7 @@ func TestDebugCall(t *testing.T) {
}
var result0 int
var result1 float64
- if goexperiment.RegabiArgs {
+ if len(intRegs) > 0 {
result0 = int(intRegs[0])
result1 = math.Float64frombits(floatRegs[0])
} else {
diff --git a/src/runtime/duff_riscv64.s b/src/runtime/duff_riscv64.s
index f7bd3f326e..9d7f0031a3 100644
--- a/src/runtime/duff_riscv64.s
+++ b/src/runtime/duff_riscv64.s
@@ -5,903 +5,903 @@
#include "textflag.h"
TEXT runtime·duffzero(SB), NOSPLIT|NOFRAME, $0-0
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
- MOV ZERO, (X10)
- ADD $8, X10
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
+ MOV ZERO, (X25)
+ ADD $8, X25
RET
TEXT runtime·duffcopy(SB), NOSPLIT|NOFRAME, $0-0
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
- MOV (X10), X31
- ADD $8, X10
- MOV X31, (X11)
- ADD $8, X11
+ MOV (X24), X31
+ ADD $8, X24
+ MOV X31, (X25)
+ ADD $8, X25
RET
diff --git a/src/runtime/memclr_arm64.s b/src/runtime/memclr_arm64.s
index b80cca6a1c..1c35dfe0cf 100644
--- a/src/runtime/memclr_arm64.s
+++ b/src/runtime/memclr_arm64.s
@@ -9,11 +9,6 @@
// func memclrNoHeapPointers(ptr unsafe.Pointer, n uintptr)
// Also called from assembly in sys_windows_arm64.s without g (but using Go stack convention).
TEXT runtime·memclrNoHeapPointers<ABIInternal>(SB),NOSPLIT,$0-16
-#ifndef GOEXPERIMENT_regabiargs
- MOVD ptr+0(FP), R0
- MOVD n+8(FP), R1
-#endif
-
CMP $16, R1
// If n is equal to 16 bytes, use zero_exact_16 to zero
BEQ zero_exact_16
diff --git a/src/runtime/memclr_ppc64x.s b/src/runtime/memclr_ppc64x.s
index 64132cee96..ad84ea9600 100644
--- a/src/runtime/memclr_ppc64x.s
+++ b/src/runtime/memclr_ppc64x.s
@@ -10,10 +10,8 @@
// func memclrNoHeapPointers(ptr unsafe.Pointer, n uintptr)
TEXT runtime·memclrNoHeapPointers<ABIInternal>(SB), NOSPLIT|NOFRAME, $0-16
-#ifndef GOEXPERIMENT_regabiargs
- MOVD ptr+0(FP), R3
- MOVD n+8(FP), R4
-#endif
+ // R3 = ptr
+ // R4 = n
// Determine if there are doublewords to clear
check:
diff --git a/src/runtime/memmove_arm64.s b/src/runtime/memmove_arm64.s
index bee3b00c47..8ec3ed86b9 100644
--- a/src/runtime/memmove_arm64.s
+++ b/src/runtime/memmove_arm64.s
@@ -27,11 +27,6 @@
// func memmove(to, from unsafe.Pointer, n uintptr)
TEXT runtime·memmove<ABIInternal>(SB), NOSPLIT|NOFRAME, $0-24
-#ifndef GOEXPERIMENT_regabiargs
- MOVD to+0(FP), R0
- MOVD from+8(FP), R1
- MOVD n+16(FP), R2
-#endif
CBZ R2, copy0
// Small copies: 1..16 bytes
diff --git a/src/runtime/memmove_ppc64x.s b/src/runtime/memmove_ppc64x.s
index 2152fb4f69..25101a28c7 100644
--- a/src/runtime/memmove_ppc64x.s
+++ b/src/runtime/memmove_ppc64x.s
@@ -28,11 +28,9 @@
#define QWORDS R10
TEXT runtime·memmove<ABIInternal>(SB), NOSPLIT|NOFRAME, $0-24
-#ifndef GOEXPERIMENT_regabiargs
- MOVD to+0(FP), TGT
- MOVD from+8(FP), SRC
- MOVD n+16(FP), LEN
-#endif
+ // R3 = TGT = to
+ // R4 = SRC = from
+ // R5 = LEN = n
// Determine if there are doublewords to
// copy so a more efficient move can be done
diff --git a/src/runtime/mgcwork.go b/src/runtime/mgcwork.go
index 9c3f7fd223..56d0b1cd62 100644
--- a/src/runtime/mgcwork.go
+++ b/src/runtime/mgcwork.go
@@ -148,9 +148,7 @@ func (w *gcWork) put(obj uintptr) {
//go:nowritebarrierrec
func (w *gcWork) putFast(obj uintptr) bool {
wbuf := w.wbuf1
- if wbuf == nil {
- return false
- } else if wbuf.nobj == len(wbuf.obj) {
+ if wbuf == nil || wbuf.nobj == len(wbuf.obj) {
return false
}
@@ -230,10 +228,7 @@ func (w *gcWork) tryGet() uintptr {
//go:nowritebarrierrec
func (w *gcWork) tryGetFast() uintptr {
wbuf := w.wbuf1
- if wbuf == nil {
- return 0
- }
- if wbuf.nobj == 0 {
+ if wbuf == nil || wbuf.nobj == 0 {
return 0
}
diff --git a/src/runtime/mkduff.go b/src/runtime/mkduff.go
index e8a85702c6..e1c01fffce 100644
--- a/src/runtime/mkduff.go
+++ b/src/runtime/mkduff.go
@@ -235,26 +235,26 @@ func copyMIPS64x(w io.Writer) {
func zeroRISCV64(w io.Writer) {
// ZERO: always zero
- // X10: ptr to memory to be zeroed
- // X10 is updated as a side effect.
+ // X25: ptr to memory to be zeroed
+ // X25 is updated as a side effect.
fmt.Fprintln(w, "TEXT runtime·duffzero(SB), NOSPLIT|NOFRAME, $0-0")
for i := 0; i < 128; i++ {
- fmt.Fprintln(w, "\tMOV\tZERO, (X10)")
- fmt.Fprintln(w, "\tADD\t$8, X10")
+ fmt.Fprintln(w, "\tMOV\tZERO, (X25)")
+ fmt.Fprintln(w, "\tADD\t$8, X25")
}
fmt.Fprintln(w, "\tRET")
}
func copyRISCV64(w io.Writer) {
- // X10: ptr to source memory
- // X11: ptr to destination memory
- // X10 and X11 are updated as a side effect
+ // X24: ptr to source memory
+ // X25: ptr to destination memory
+ // X24 and X25 are updated as a side effect
fmt.Fprintln(w, "TEXT runtime·duffcopy(SB), NOSPLIT|NOFRAME, $0-0")
for i := 0; i < 128; i++ {
- fmt.Fprintln(w, "\tMOV\t(X10), X31")
- fmt.Fprintln(w, "\tADD\t$8, X10")
- fmt.Fprintln(w, "\tMOV\tX31, (X11)")
- fmt.Fprintln(w, "\tADD\t$8, X11")
+ fmt.Fprintln(w, "\tMOV\t(X24), X31")
+ fmt.Fprintln(w, "\tADD\t$8, X24")
+ fmt.Fprintln(w, "\tMOV\tX31, (X25)")
+ fmt.Fprintln(w, "\tADD\t$8, X25")
fmt.Fprintln(w)
}
fmt.Fprintln(w, "\tRET")
diff --git a/src/runtime/os3_solaris.go b/src/runtime/os3_solaris.go
index 5aee04d5a8..f465a3aa3f 100644
--- a/src/runtime/os3_solaris.go
+++ b/src/runtime/os3_solaris.go
@@ -47,7 +47,6 @@ import (
//go:cgo_import_dynamic libc_sysconf sysconf "libc.so"
//go:cgo_import_dynamic libc_usleep usleep "libc.so"
//go:cgo_import_dynamic libc_write write "libc.so"
-//go:cgo_import_dynamic libc_pipe pipe "libc.so"
//go:cgo_import_dynamic libc_pipe2 pipe2 "libc.so"
//go:linkname libc____errno libc____errno
@@ -83,7 +82,6 @@ import (
//go:linkname libc_sysconf libc_sysconf
//go:linkname libc_usleep libc_usleep
//go:linkname libc_write libc_write
-//go:linkname libc_pipe libc_pipe
//go:linkname libc_pipe2 libc_pipe2
var (
@@ -120,7 +118,6 @@ var (
libc_sysconf,
libc_usleep,
libc_write,
- libc_pipe,
libc_pipe2 libcFunc
)
diff --git a/src/runtime/pprof/mprof_test.go b/src/runtime/pprof/mprof_test.go
index 665487a7c4..391588d4ac 100644
--- a/src/runtime/pprof/mprof_test.go
+++ b/src/runtime/pprof/mprof_test.go
@@ -93,31 +93,31 @@ func TestMemoryProfiler(t *testing.T) {
}{{
stk: []string{"runtime/pprof.allocatePersistent1K", "runtime/pprof.TestMemoryProfiler"},
legacy: fmt.Sprintf(`%v: %v \[%v: %v\] @ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+
-# 0x[0-9,a-f]+ runtime/pprof\.allocatePersistent1K\+0x[0-9,a-f]+ .*/runtime/pprof/mprof_test\.go:47
-# 0x[0-9,a-f]+ runtime/pprof\.TestMemoryProfiler\+0x[0-9,a-f]+ .*/runtime/pprof/mprof_test\.go:82
+# 0x[0-9,a-f]+ runtime/pprof\.allocatePersistent1K\+0x[0-9,a-f]+ .*runtime/pprof/mprof_test\.go:47
+# 0x[0-9,a-f]+ runtime/pprof\.TestMemoryProfiler\+0x[0-9,a-f]+ .*runtime/pprof/mprof_test\.go:82
`, 32*memoryProfilerRun, 1024*memoryProfilerRun, 32*memoryProfilerRun, 1024*memoryProfilerRun),
}, {
stk: []string{"runtime/pprof.allocateTransient1M", "runtime/pprof.TestMemoryProfiler"},
legacy: fmt.Sprintf(`0: 0 \[%v: %v\] @ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+
-# 0x[0-9,a-f]+ runtime/pprof\.allocateTransient1M\+0x[0-9,a-f]+ .*/runtime/pprof/mprof_test.go:24
-# 0x[0-9,a-f]+ runtime/pprof\.TestMemoryProfiler\+0x[0-9,a-f]+ .*/runtime/pprof/mprof_test.go:79
+# 0x[0-9,a-f]+ runtime/pprof\.allocateTransient1M\+0x[0-9,a-f]+ .*runtime/pprof/mprof_test.go:24
+# 0x[0-9,a-f]+ runtime/pprof\.TestMemoryProfiler\+0x[0-9,a-f]+ .*runtime/pprof/mprof_test.go:79
`, (1<<10)*memoryProfilerRun, (1<<20)*memoryProfilerRun),
}, {
stk: []string{"runtime/pprof.allocateTransient2M", "runtime/pprof.TestMemoryProfiler"},
legacy: fmt.Sprintf(`0: 0 \[%v: %v\] @ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+
-# 0x[0-9,a-f]+ runtime/pprof\.allocateTransient2M\+0x[0-9,a-f]+ .*/runtime/pprof/mprof_test.go:30
-# 0x[0-9,a-f]+ runtime/pprof\.TestMemoryProfiler\+0x[0-9,a-f]+ .*/runtime/pprof/mprof_test.go:80
+# 0x[0-9,a-f]+ runtime/pprof\.allocateTransient2M\+0x[0-9,a-f]+ .*runtime/pprof/mprof_test.go:30
+# 0x[0-9,a-f]+ runtime/pprof\.TestMemoryProfiler\+0x[0-9,a-f]+ .*runtime/pprof/mprof_test.go:80
`, memoryProfilerRun, (2<<20)*memoryProfilerRun),
}, {
stk: []string{"runtime/pprof.allocateTransient2MInline", "runtime/pprof.TestMemoryProfiler"},
legacy: fmt.Sprintf(`0: 0 \[%v: %v\] @ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+
-# 0x[0-9,a-f]+ runtime/pprof\.allocateTransient2MInline\+0x[0-9,a-f]+ .*/runtime/pprof/mprof_test.go:34
-# 0x[0-9,a-f]+ runtime/pprof\.TestMemoryProfiler\+0x[0-9,a-f]+ .*/runtime/pprof/mprof_test.go:81
+# 0x[0-9,a-f]+ runtime/pprof\.allocateTransient2MInline\+0x[0-9,a-f]+ .*runtime/pprof/mprof_test.go:34
+# 0x[0-9,a-f]+ runtime/pprof\.TestMemoryProfiler\+0x[0-9,a-f]+ .*runtime/pprof/mprof_test.go:81
`, memoryProfilerRun, (2<<20)*memoryProfilerRun),
}, {
stk: []string{"runtime/pprof.allocateReflectTransient"},
legacy: fmt.Sprintf(`0: 0 \[%v: %v\] @( 0x[0-9,a-f]+)+
-# 0x[0-9,a-f]+ runtime/pprof\.allocateReflectTransient\+0x[0-9,a-f]+ .*/runtime/pprof/mprof_test.go:55
+# 0x[0-9,a-f]+ runtime/pprof\.allocateReflectTransient\+0x[0-9,a-f]+ .*runtime/pprof/mprof_test.go:55
`, memoryProfilerRun, (2<<20)*memoryProfilerRun),
}}
diff --git a/src/runtime/pprof/pprof_norusage.go b/src/runtime/pprof/pprof_norusage.go
index cbc5176cfa..3d6052519c 100644
--- a/src/runtime/pprof/pprof_norusage.go
+++ b/src/runtime/pprof/pprof_norusage.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build !darwin && !linux
+//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris
package pprof
diff --git a/src/runtime/pprof/pprof_rusage.go b/src/runtime/pprof/pprof_rusage.go
index 46263fedd9..984a32e79d 100644
--- a/src/runtime/pprof/pprof_rusage.go
+++ b/src/runtime/pprof/pprof_rusage.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build darwin || linux
+//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
package pprof
@@ -17,15 +17,17 @@ import (
func addMaxRSS(w io.Writer) {
var rssToBytes uintptr
switch runtime.GOOS {
- case "linux", "android":
+ case "aix", "android", "dragonfly", "freebsd", "linux", "netbsd", "openbsd":
rssToBytes = 1024
case "darwin", "ios":
rssToBytes = 1
+ case "illumos", "solaris":
+ rssToBytes = uintptr(syscall.Getpagesize())
default:
panic("unsupported OS")
}
var rusage syscall.Rusage
- syscall.Getrusage(0, &rusage)
+ syscall.Getrusage(syscall.RUSAGE_SELF, &rusage)
fmt.Fprintf(w, "# MaxRSS = %d\n", uintptr(rusage.Maxrss)*rssToBytes)
}
diff --git a/src/runtime/pprof/pprof_test.go b/src/runtime/pprof/pprof_test.go
index 322579cdc4..ff4ecb4c68 100644
--- a/src/runtime/pprof/pprof_test.go
+++ b/src/runtime/pprof/pprof_test.go
@@ -188,10 +188,43 @@ func TestCPUProfileMultithreadMagnitude(t *testing.T) {
t.Run(tc.name, func(t *testing.T) {
t.Logf("Running with %d workers", tc.workers)
- var cpuTime time.Duration
+ var userTime, systemTime time.Duration
matches := matchAndAvoidStacks(stackContains, []string{"runtime/pprof.cpuHog1"}, avoidFunctions())
- p := testCPUProfile(t, matches, func(dur time.Duration) {
- cpuTime = diffCPUTime(t, func() {
+ acceptProfile := func(t *testing.T, p *profile.Profile) bool {
+ if !matches(t, p) {
+ return false
+ }
+
+ ok := true
+ for i, unit := range []string{"count", "nanoseconds"} {
+ if have, want := p.SampleType[i].Unit, unit; have != want {
+ t.Logf("pN SampleType[%d]; %q != %q", i, have, want)
+ ok = false
+ }
+ }
+
+ // cpuHog1 called below is the primary source of CPU
+ // load, but there may be some background work by the
+ // runtime. Since the OS rusage measurement will
+ // include all work done by the process, also compare
+ // against all samples in our profile.
+ var value time.Duration
+ for _, sample := range p.Sample {
+ value += time.Duration(sample.Value[1]) * time.Nanosecond
+ }
+
+ totalTime := userTime + systemTime
+ t.Logf("compare %s user + %s system = %s vs %s", userTime, systemTime, totalTime, value)
+ if err := compare(totalTime, value, maxDiff); err != nil {
+ t.Logf("compare got %v want nil", err)
+ ok = false
+ }
+
+ return ok
+ }
+
+ testCPUProfile(t, acceptProfile, func(dur time.Duration) {
+ userTime, systemTime = diffCPUTime(t, func() {
var wg sync.WaitGroup
var once sync.Once
for i := 0; i < tc.workers; i++ {
@@ -206,27 +239,6 @@ func TestCPUProfileMultithreadMagnitude(t *testing.T) {
wg.Wait()
})
})
-
- for i, unit := range []string{"count", "nanoseconds"} {
- if have, want := p.SampleType[i].Unit, unit; have != want {
- t.Errorf("pN SampleType[%d]; %q != %q", i, have, want)
- }
- }
-
- // cpuHog1 called above is the primary source of CPU
- // load, but there may be some background work by the
- // runtime. Since the OS rusage measurement will
- // include all work done by the process, also compare
- // against all samples in our profile.
- var value time.Duration
- for _, sample := range p.Sample {
- value += time.Duration(sample.Value[1]) * time.Nanosecond
- }
-
- t.Logf("compare %s vs %s", cpuTime, value)
- if err := compare(cpuTime, value, maxDiff); err != nil {
- t.Errorf("compare got %v want nil", err)
- }
})
}
}
@@ -476,14 +488,14 @@ func testCPUProfile(t *testing.T, matches profileMatchFunc, f func(dur time.Dura
return nil
}
-var diffCPUTimeImpl func(f func()) time.Duration
+var diffCPUTimeImpl func(f func()) (user, system time.Duration)
-func diffCPUTime(t *testing.T, f func()) time.Duration {
+func diffCPUTime(t *testing.T, f func()) (user, system time.Duration) {
if fn := diffCPUTimeImpl; fn != nil {
return fn(f)
}
t.Fatalf("cannot measure CPU time on GOOS=%s GOARCH=%s", runtime.GOOS, runtime.GOARCH)
- return 0
+ return 0, 0
}
func contains(slice []string, s string) bool {
@@ -809,9 +821,9 @@ func TestBlockProfile(t *testing.T) {
},
re: `
[0-9]+ [0-9]+ @( 0x[[:xdigit:]]+)+
-# 0x[0-9a-f]+ runtime\.chanrecv1\+0x[0-9a-f]+ .*/src/runtime/chan.go:[0-9]+
-# 0x[0-9a-f]+ runtime/pprof\.blockChanRecv\+0x[0-9a-f]+ .*/src/runtime/pprof/pprof_test.go:[0-9]+
-# 0x[0-9a-f]+ runtime/pprof\.TestBlockProfile\+0x[0-9a-f]+ .*/src/runtime/pprof/pprof_test.go:[0-9]+
+# 0x[0-9a-f]+ runtime\.chanrecv1\+0x[0-9a-f]+ .*runtime/chan.go:[0-9]+
+# 0x[0-9a-f]+ runtime/pprof\.blockChanRecv\+0x[0-9a-f]+ .*runtime/pprof/pprof_test.go:[0-9]+
+# 0x[0-9a-f]+ runtime/pprof\.TestBlockProfile\+0x[0-9a-f]+ .*runtime/pprof/pprof_test.go:[0-9]+
`},
{
name: "chan send",
@@ -823,9 +835,9 @@ func TestBlockProfile(t *testing.T) {
},
re: `
[0-9]+ [0-9]+ @( 0x[[:xdigit:]]+)+
-# 0x[0-9a-f]+ runtime\.chansend1\+0x[0-9a-f]+ .*/src/runtime/chan.go:[0-9]+
-# 0x[0-9a-f]+ runtime/pprof\.blockChanSend\+0x[0-9a-f]+ .*/src/runtime/pprof/pprof_test.go:[0-9]+
-# 0x[0-9a-f]+ runtime/pprof\.TestBlockProfile\+0x[0-9a-f]+ .*/src/runtime/pprof/pprof_test.go:[0-9]+
+# 0x[0-9a-f]+ runtime\.chansend1\+0x[0-9a-f]+ .*runtime/chan.go:[0-9]+
+# 0x[0-9a-f]+ runtime/pprof\.blockChanSend\+0x[0-9a-f]+ .*runtime/pprof/pprof_test.go:[0-9]+
+# 0x[0-9a-f]+ runtime/pprof\.TestBlockProfile\+0x[0-9a-f]+ .*runtime/pprof/pprof_test.go:[0-9]+
`},
{
name: "chan close",
@@ -837,9 +849,9 @@ func TestBlockProfile(t *testing.T) {
},
re: `
[0-9]+ [0-9]+ @( 0x[[:xdigit:]]+)+
-# 0x[0-9a-f]+ runtime\.chanrecv1\+0x[0-9a-f]+ .*/src/runtime/chan.go:[0-9]+
-# 0x[0-9a-f]+ runtime/pprof\.blockChanClose\+0x[0-9a-f]+ .*/src/runtime/pprof/pprof_test.go:[0-9]+
-# 0x[0-9a-f]+ runtime/pprof\.TestBlockProfile\+0x[0-9a-f]+ .*/src/runtime/pprof/pprof_test.go:[0-9]+
+# 0x[0-9a-f]+ runtime\.chanrecv1\+0x[0-9a-f]+ .*runtime/chan.go:[0-9]+
+# 0x[0-9a-f]+ runtime/pprof\.blockChanClose\+0x[0-9a-f]+ .*runtime/pprof/pprof_test.go:[0-9]+
+# 0x[0-9a-f]+ runtime/pprof\.TestBlockProfile\+0x[0-9a-f]+ .*runtime/pprof/pprof_test.go:[0-9]+
`},
{
name: "select recv async",
@@ -851,9 +863,9 @@ func TestBlockProfile(t *testing.T) {
},
re: `
[0-9]+ [0-9]+ @( 0x[[:xdigit:]]+)+
-# 0x[0-9a-f]+ runtime\.selectgo\+0x[0-9a-f]+ .*/src/runtime/select.go:[0-9]+
-# 0x[0-9a-f]+ runtime/pprof\.blockSelectRecvAsync\+0x[0-9a-f]+ .*/src/runtime/pprof/pprof_test.go:[0-9]+
-# 0x[0-9a-f]+ runtime/pprof\.TestBlockProfile\+0x[0-9a-f]+ .*/src/runtime/pprof/pprof_test.go:[0-9]+
+# 0x[0-9a-f]+ runtime\.selectgo\+0x[0-9a-f]+ .*runtime/select.go:[0-9]+
+# 0x[0-9a-f]+ runtime/pprof\.blockSelectRecvAsync\+0x[0-9a-f]+ .*runtime/pprof/pprof_test.go:[0-9]+
+# 0x[0-9a-f]+ runtime/pprof\.TestBlockProfile\+0x[0-9a-f]+ .*runtime/pprof/pprof_test.go:[0-9]+
`},
{
name: "select send sync",
@@ -865,9 +877,9 @@ func TestBlockProfile(t *testing.T) {
},
re: `
[0-9]+ [0-9]+ @( 0x[[:xdigit:]]+)+
-# 0x[0-9a-f]+ runtime\.selectgo\+0x[0-9a-f]+ .*/src/runtime/select.go:[0-9]+
-# 0x[0-9a-f]+ runtime/pprof\.blockSelectSendSync\+0x[0-9a-f]+ .*/src/runtime/pprof/pprof_test.go:[0-9]+
-# 0x[0-9a-f]+ runtime/pprof\.TestBlockProfile\+0x[0-9a-f]+ .*/src/runtime/pprof/pprof_test.go:[0-9]+
+# 0x[0-9a-f]+ runtime\.selectgo\+0x[0-9a-f]+ .*runtime/select.go:[0-9]+
+# 0x[0-9a-f]+ runtime/pprof\.blockSelectSendSync\+0x[0-9a-f]+ .*runtime/pprof/pprof_test.go:[0-9]+
+# 0x[0-9a-f]+ runtime/pprof\.TestBlockProfile\+0x[0-9a-f]+ .*runtime/pprof/pprof_test.go:[0-9]+
`},
{
name: "mutex",
@@ -879,9 +891,9 @@ func TestBlockProfile(t *testing.T) {
},
re: `
[0-9]+ [0-9]+ @( 0x[[:xdigit:]]+)+
-# 0x[0-9a-f]+ sync\.\(\*Mutex\)\.Lock\+0x[0-9a-f]+ .*/src/sync/mutex\.go:[0-9]+
-# 0x[0-9a-f]+ runtime/pprof\.blockMutex\+0x[0-9a-f]+ .*/src/runtime/pprof/pprof_test.go:[0-9]+
-# 0x[0-9a-f]+ runtime/pprof\.TestBlockProfile\+0x[0-9a-f]+ .*/src/runtime/pprof/pprof_test.go:[0-9]+
+# 0x[0-9a-f]+ sync\.\(\*Mutex\)\.Lock\+0x[0-9a-f]+ .*sync/mutex\.go:[0-9]+
+# 0x[0-9a-f]+ runtime/pprof\.blockMutex\+0x[0-9a-f]+ .*runtime/pprof/pprof_test.go:[0-9]+
+# 0x[0-9a-f]+ runtime/pprof\.TestBlockProfile\+0x[0-9a-f]+ .*runtime/pprof/pprof_test.go:[0-9]+
`},
{
name: "cond",
@@ -893,9 +905,9 @@ func TestBlockProfile(t *testing.T) {
},
re: `
[0-9]+ [0-9]+ @( 0x[[:xdigit:]]+)+
-# 0x[0-9a-f]+ sync\.\(\*Cond\)\.Wait\+0x[0-9a-f]+ .*/src/sync/cond\.go:[0-9]+
-# 0x[0-9a-f]+ runtime/pprof\.blockCond\+0x[0-9a-f]+ .*/src/runtime/pprof/pprof_test.go:[0-9]+
-# 0x[0-9a-f]+ runtime/pprof\.TestBlockProfile\+0x[0-9a-f]+ .*/src/runtime/pprof/pprof_test.go:[0-9]+
+# 0x[0-9a-f]+ sync\.\(\*Cond\)\.Wait\+0x[0-9a-f]+ .*sync/cond\.go:[0-9]+
+# 0x[0-9a-f]+ runtime/pprof\.blockCond\+0x[0-9a-f]+ .*runtime/pprof/pprof_test.go:[0-9]+
+# 0x[0-9a-f]+ runtime/pprof\.TestBlockProfile\+0x[0-9a-f]+ .*runtime/pprof/pprof_test.go:[0-9]+
`},
}
diff --git a/src/runtime/pprof/proto.go b/src/runtime/pprof/proto.go
index 073a076802..68dac42d20 100644
--- a/src/runtime/pprof/proto.go
+++ b/src/runtime/pprof/proto.go
@@ -244,6 +244,10 @@ type locInfo struct {
// to represent inlined functions
// https://github.com/golang/go/blob/d6f2f833c93a41ec1c68e49804b8387a06b131c5/src/runtime/traceback.go#L347-L368
pcs []uintptr
+
+ // results of allFrames call for this PC
+ frames []runtime.Frame
+ symbolizeResult symbolizeFlag
}
// newProfileBuilder returns a new profileBuilder.
@@ -399,6 +403,24 @@ func (b *profileBuilder) appendLocsForStack(locs []uint64, stk []uintptr) (newLo
for len(stk) > 0 {
addr := stk[0]
if l, ok := b.locs[addr]; ok {
+ // When generating code for an inlined function, the compiler adds
+ // NOP instructions to the outermost function as a placeholder for
+ // each layer of inlining. When the runtime generates tracebacks for
+ // stacks that include inlined functions, it uses the addresses of
+ // those NOPs as "fake" PCs on the stack as if they were regular
+ // function call sites. But if a profiling signal arrives while the
+ // CPU is executing one of those NOPs, its PC will show up as a leaf
+ // in the profile with its own Location entry. So, always check
+ // whether addr is a "fake" PC in the context of the current call
+ // stack by trying to add it to the inlining deck before assuming
+ // that the deck is complete.
+ if len(b.deck.pcs) > 0 {
+ if added := b.deck.tryAdd(addr, l.frames, l.symbolizeResult); added {
+ stk = stk[1:]
+ continue
+ }
+ }
+
// first record the location if there is any pending accumulated info.
if id := b.emitLocation(); id > 0 {
locs = append(locs, id)
@@ -451,6 +473,27 @@ func (b *profileBuilder) appendLocsForStack(locs []uint64, stk []uintptr) (newLo
return locs
}
+// Here's an example of how Go 1.17 writes out inlined functions, compiled for
+// linux/amd64. The disassembly of main.main shows two levels of inlining: main
+// calls b, b calls a, a does some work.
+//
+// inline.go:9 0x4553ec 90 NOPL // func main() { b(v) }
+// inline.go:6 0x4553ed 90 NOPL // func b(v *int) { a(v) }
+// inline.go:5 0x4553ee 48c7002a000000 MOVQ $0x2a, 0(AX) // func a(v *int) { *v = 42 }
+//
+// If a profiling signal arrives while executing the MOVQ at 0x4553ee (for line
+// 5), the runtime will report the stack as the MOVQ frame being called by the
+// NOPL at 0x4553ed (for line 6) being called by the NOPL at 0x4553ec (for line
+// 9).
+//
+// The role of pcDeck is to collapse those three frames back into a single
+// location at 0x4553ee, with file/line/function symbolization info representing
+// the three layers of calls. It does that via sequential calls to pcDeck.tryAdd
+// starting with the leaf-most address. The fourth call to pcDeck.tryAdd will be
+// for the caller of main.main. Because main.main was not inlined in its caller,
+// the deck will reject the addition, and the fourth PC on the stack will get
+// its own location.
+
// pcDeck is a helper to detect a sequence of inlined functions from
// a stack trace returned by the runtime.
//
@@ -487,7 +530,7 @@ func (d *pcDeck) reset() {
// since the stack trace is already fully expanded) and the symbolizeResult
// to the deck. If it fails the caller needs to flush the deck and retry.
func (d *pcDeck) tryAdd(pc uintptr, frames []runtime.Frame, symbolizeResult symbolizeFlag) (success bool) {
- if existing := len(d.pcs); existing > 0 {
+ if existing := len(d.frames); existing > 0 {
// 'd.frames' are all expanded from one 'pc' and represent all
// inlined functions so we check only the last one.
newFrame := frames[0]
@@ -535,7 +578,12 @@ func (b *profileBuilder) emitLocation() uint64 {
newFuncs := make([]newFunc, 0, 8)
id := uint64(len(b.locs)) + 1
- b.locs[addr] = locInfo{id: id, pcs: append([]uintptr{}, b.deck.pcs...)}
+ b.locs[addr] = locInfo{
+ id: id,
+ pcs: append([]uintptr{}, b.deck.pcs...),
+ symbolizeResult: b.deck.symbolizeResult,
+ frames: append([]runtime.Frame{}, b.deck.frames...),
+ }
start := b.pb.startMessage()
b.pb.uint64Opt(tagLocation_ID, id)
diff --git a/src/runtime/pprof/rusage_test.go b/src/runtime/pprof/rusage_test.go
index b0d651e0eb..b82b1af768 100644
--- a/src/runtime/pprof/rusage_test.go
+++ b/src/runtime/pprof/rusage_test.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build darwin || freebsd || linux || netbsd || openbsd
+//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
package pprof
@@ -15,7 +15,7 @@ func init() {
diffCPUTimeImpl = diffCPUTimeRUsage
}
-func diffCPUTimeRUsage(f func()) time.Duration {
+func diffCPUTimeRUsage(f func()) (user, system time.Duration) {
ok := true
var before, after syscall.Rusage
@@ -32,8 +32,10 @@ func diffCPUTimeRUsage(f func()) time.Duration {
}
if !ok {
- return 0
+ return 0, 0
}
- return time.Duration((after.Utime.Nano() + after.Stime.Nano()) - (before.Utime.Nano() + before.Stime.Nano()))
+ user = time.Duration(after.Utime.Nano() - before.Utime.Nano())
+ system = time.Duration(after.Stime.Nano() - before.Stime.Nano())
+ return user, system
}
diff --git a/src/runtime/race/README b/src/runtime/race/README
index d3c55182ef..fdbf1d55e6 100644
--- a/src/runtime/race/README
+++ b/src/runtime/race/README
@@ -6,7 +6,7 @@ To update the .syso files use golang.org/x/build/cmd/racebuild.
race_darwin_amd64.syso built with LLVM 89f7ccea6f6488c443655880229c54db1f180153 with https://reviews.llvm.org/D114825 applied and Go 7ccbcc90560468937f02609a43cb39a6e13ff797.
race_freebsd_amd64.syso built with LLVM 89f7ccea6f6488c443655880229c54db1f180153 and Go f62d3202bf9dbb3a00ad2a2c63ff4fa4188c5d3b.
-race_linux_amd64.syso built with LLVM 89f7ccea6f6488c443655880229c54db1f180153 and Go f62d3202bf9dbb3a00ad2a2c63ff4fa4188c5d3b.
+race_linux_amd64.syso built with LLVM 41cb504b7c4b18ac15830107431a0c1eec73a6b2 and Go 851ecea4cc99ab276109493477b2c7e30c253ea8.
race_linux_ppc64le.syso built with LLVM 89f7ccea6f6488c443655880229c54db1f180153 and Go f62d3202bf9dbb3a00ad2a2c63ff4fa4188c5d3b.
race_netbsd_amd64.syso built with LLVM 89f7ccea6f6488c443655880229c54db1f180153 and Go f62d3202bf9dbb3a00ad2a2c63ff4fa4188c5d3b.
race_windows_amd64.syso built with LLVM 89f7ccea6f6488c443655880229c54db1f180153 and Go f62d3202bf9dbb3a00ad2a2c63ff4fa4188c5d3b.
diff --git a/src/runtime/race/race_linux_amd64.syso b/src/runtime/race/race_linux_amd64.syso
index e00398c964..a23064efac 100644
--- a/src/runtime/race/race_linux_amd64.syso
+++ b/src/runtime/race/race_linux_amd64.syso
Binary files differ
diff --git a/src/runtime/race/testdata/mop_test.go b/src/runtime/race/testdata/mop_test.go
index 94b6e58de0..0d79091df4 100644
--- a/src/runtime/race/testdata/mop_test.go
+++ b/src/runtime/race/testdata/mop_test.go
@@ -1896,6 +1896,14 @@ func TestRaceNestedStruct(t *testing.T) {
}
func TestRaceIssue5567(t *testing.T) {
+ testRaceRead(t, false)
+}
+
+func TestRaceIssue51618(t *testing.T) {
+ testRaceRead(t, true)
+}
+
+func testRaceRead(t *testing.T, pread bool) {
defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(4))
in := make(chan []byte)
res := make(chan error)
@@ -1914,7 +1922,11 @@ func TestRaceIssue5567(t *testing.T) {
var n, total int
b := make([]byte, 17) // the race is on b buffer
for err == nil {
- n, err = f.Read(b)
+ if pread {
+ n, err = f.ReadAt(b, int64(total))
+ } else {
+ n, err = f.Read(b)
+ }
total += n
if n > 0 {
in <- b[:n]
diff --git a/src/runtime/race_arm64.s b/src/runtime/race_arm64.s
index 95fec0b9c6..8c0dd25f0b 100644
--- a/src/runtime/race_arm64.s
+++ b/src/runtime/race_arm64.s
@@ -45,11 +45,7 @@
// Defined as ABIInternal so as to avoid introducing a wrapper,
// which would make caller's PC ineffective.
TEXT runtime·raceread<ABIInternal>(SB), NOSPLIT, $0-8
-#ifdef GOEXPERIMENT_regabiargs
MOVD R0, R1 // addr
-#else
- MOVD addr+0(FP), R1
-#endif
MOVD LR, R2
// void __tsan_read(ThreadState *thr, void *addr, void *pc);
MOVD $__tsan_read(SB), R9
@@ -74,11 +70,7 @@ TEXT runtime·racereadpc(SB), NOSPLIT, $0-24
// Defined as ABIInternal so as to avoid introducing a wrapper,
// which would make caller's PC ineffective.
TEXT runtime·racewrite<ABIInternal>(SB), NOSPLIT, $0-8
-#ifdef GOEXPERIMENT_regabiargs
MOVD R0, R1 // addr
-#else
- MOVD addr+0(FP), R1
-#endif
MOVD LR, R2
// void __tsan_write(ThreadState *thr, void *addr, void *pc);
MOVD $__tsan_write(SB), R9
@@ -103,13 +95,8 @@ TEXT runtime·racewritepc(SB), NOSPLIT, $0-24
// Defined as ABIInternal so as to avoid introducing a wrapper,
// which would make caller's PC ineffective.
TEXT runtime·racereadrange<ABIInternal>(SB), NOSPLIT, $0-16
-#ifdef GOEXPERIMENT_regabiargs
MOVD R1, R2 // size
MOVD R0, R1 // addr
-#else
- MOVD addr+0(FP), R1
- MOVD size+8(FP), R2
-#endif
MOVD LR, R3
// void __tsan_read_range(ThreadState *thr, void *addr, uintptr size, void *pc);
MOVD $__tsan_read_range(SB), R9
@@ -135,13 +122,8 @@ TEXT runtime·racereadrangepc1(SB), NOSPLIT, $0-24
// Defined as ABIInternal so as to avoid introducing a wrapper,
// which would make caller's PC ineffective.
TEXT runtime·racewriterange<ABIInternal>(SB), NOSPLIT, $0-16
-#ifdef GOEXPERIMENT_regabiargs
MOVD R1, R2 // size
MOVD R0, R1 // addr
-#else
- MOVD addr+0(FP), R1
- MOVD size+8(FP), R2
-#endif
MOVD LR, R3
// void __tsan_write_range(ThreadState *thr, void *addr, uintptr size, void *pc);
MOVD $__tsan_write_range(SB), R9
@@ -189,11 +171,7 @@ ret:
// func runtime·racefuncenter(pc uintptr)
// Called from instrumented code.
TEXT runtime·racefuncenter<ABIInternal>(SB), NOSPLIT, $0-8
-#ifdef GOEXPERIMENT_regabiargs
MOVD R0, R9 // callpc
-#else
- MOVD callpc+0(FP), R9
-#endif
JMP racefuncenter<>(SB)
// Common code for racefuncenter
diff --git a/src/runtime/race_ppc64le.s b/src/runtime/race_ppc64le.s
index 68cc5c8805..0d8aaa01c1 100644
--- a/src/runtime/race_ppc64le.s
+++ b/src/runtime/race_ppc64le.s
@@ -43,11 +43,7 @@
// func runtime·RaceRead(addr uintptr)
// Called from instrumented Go code
TEXT runtime·raceread<ABIInternal>(SB), NOSPLIT, $0-8
-#ifndef GOEXPERIMENT_regabiargs
- MOVD addr+0(FP), R4
-#else
- MOVD R3, R4
-#endif
+ MOVD R3, R4 // addr
MOVD LR, R5 // caller of this?
// void __tsan_read(ThreadState *thr, void *addr, void *pc);
MOVD $__tsan_read(SB), R8
@@ -68,11 +64,7 @@ TEXT runtime·racereadpc(SB), NOSPLIT, $0-24
// func runtime·RaceWrite(addr uintptr)
// Called from instrumented Go code
TEXT runtime·racewrite<ABIInternal>(SB), NOSPLIT, $0-8
-#ifndef GOEXPERIMENT_regabiargs
- MOVD addr+0(FP), R4
-#else
- MOVD R3, R4
-#endif
+ MOVD R3, R4 // addr
MOVD LR, R5 // caller has set LR via BL inst
// void __tsan_write(ThreadState *thr, void *addr, void *pc);
MOVD $__tsan_write(SB), R8
@@ -93,13 +85,8 @@ TEXT runtime·racewritepc(SB), NOSPLIT, $0-24
// func runtime·RaceReadRange(addr, size uintptr)
// Called from instrumented Go code.
TEXT runtime·racereadrange<ABIInternal>(SB), NOSPLIT, $0-16
-#ifndef GOEXPERIMENT_regabiargs
- MOVD addr+0(FP), R4
- MOVD size+8(FP), R5
-#else
- MOVD R4, R5
- MOVD R3, R4
-#endif
+ MOVD R4, R5 // size
+ MOVD R3, R4 // addr
MOVD LR, R6
// void __tsan_read_range(ThreadState *thr, void *addr, uintptr size, void *pc);
MOVD $__tsan_read_range(SB), R8
@@ -121,13 +108,8 @@ TEXT runtime·RaceReadRange(SB), NOSPLIT, $0-16
// func runtime·RaceWriteRange(addr, size uintptr)
// Called from instrumented Go code.
TEXT runtime·racewriterange<ABIInternal>(SB), NOSPLIT, $0-16
-#ifndef GOEXPERIMENT_regabiargs
- MOVD addr+0(FP), R4
- MOVD size+8(FP), R5
-#else
- MOVD R4, R5
- MOVD R3, R4
-#endif
+ MOVD R4, R5 // size
+ MOVD R3, R4 // addr
MOVD LR, R6
// void __tsan_write_range(ThreadState *thr, void *addr, uintptr size, void *pc);
MOVD $__tsan_write_range(SB), R8
diff --git a/src/runtime/rt0_linux_ppc64le.s b/src/runtime/rt0_linux_ppc64le.s
index 4f7c6e6c99..66f7e7b22a 100644
--- a/src/runtime/rt0_linux_ppc64le.s
+++ b/src/runtime/rt0_linux_ppc64le.s
@@ -147,25 +147,35 @@ TEXT _main<>(SB),NOSPLIT,$-8
// In a statically linked binary, the stack contains argc,
// argv as argc string pointers followed by a NULL, envv as a
// sequence of string pointers followed by a NULL, and auxv.
- // There is no TLS base pointer.
+ // The TLS pointer should be initialized to 0.
//
- // In a dynamically linked binary, r3 contains argc, r4
- // contains argv, r5 contains envp, r6 contains auxv, and r13
+ // In an ELFv2 compliant dynamically linked binary, R3 contains argc,
+ // R4 contains argv, R5 contains envp, R6 contains auxv, and R13
// contains the TLS pointer.
//
- // Figure out which case this is by looking at r4: if it's 0,
- // we're statically linked; otherwise we're dynamically
- // linked.
- CMP R0, R4
- BNE dlink
+ // When loading via glibc, the first doubleword on the stack points
+ // to NULL a value. (that is *(uintptr)(R1) == 0). This is used to
+ // differentiate static vs dynamicly linked binaries.
+ //
+ // If loading with the musl loader, it doesn't follow the ELFv2 ABI. It
+ // passes argc/argv similar to the linux kernel, R13 (TLS) is
+ // initialized, and R3/R4 are undefined.
+ MOVD (R1), R12
+ CMP R0, R12
+ BEQ tls_and_argcv_in_reg
- // Statically linked
+ // Arguments are passed via the stack (musl loader or a static binary)
MOVD 0(R1), R3 // argc
ADD $8, R1, R4 // argv
+
+ // Did the TLS pointer get set? If so, don't change it (e.g musl).
+ CMP R0, R13
+ BNE tls_and_argcv_in_reg
+
MOVD $runtime·m0+m_tls(SB), R13 // TLS
ADD $0x7000, R13
-dlink:
+tls_and_argcv_in_reg:
BR main(SB)
TEXT main(SB),NOSPLIT,$-8
diff --git a/src/runtime/runtime-gdb_test.go b/src/runtime/runtime-gdb_test.go
index ee8c6c210f..bb76116ee9 100644
--- a/src/runtime/runtime-gdb_test.go
+++ b/src/runtime/runtime-gdb_test.go
@@ -49,7 +49,7 @@ func checkGdbEnvironment(t *testing.T) {
case "plan9":
t.Skip("there is no gdb on Plan 9")
}
- if final := os.Getenv("GOROOT_FINAL"); final != "" && runtime.GOROOT() != final {
+ if final := os.Getenv("GOROOT_FINAL"); final != "" && testenv.GOROOT(t) != final {
t.Skip("gdb test can fail with GOROOT_FINAL pending")
}
}
@@ -204,7 +204,7 @@ func testGdbPython(t *testing.T, cgo bool) {
}
args := []string{"-nx", "-q", "--batch",
- "-iex", "add-auto-load-safe-path " + filepath.Join(runtime.GOROOT(), "src", "runtime"),
+ "-iex", "add-auto-load-safe-path " + filepath.Join(testenv.GOROOT(t), "src", "runtime"),
"-ex", "set startup-with-shell off",
"-ex", "set print thread-events off",
}
@@ -215,7 +215,7 @@ func testGdbPython(t *testing.T, cgo bool) {
// Until gold and gdb can work together, temporarily load the
// python script directly.
args = append(args,
- "-ex", "source "+filepath.Join(runtime.GOROOT(), "src", "runtime", "runtime-gdb.py"),
+ "-ex", "source "+filepath.Join(testenv.GOROOT(t), "src", "runtime", "runtime-gdb.py"),
)
} else {
args = append(args,
@@ -276,7 +276,7 @@ func testGdbPython(t *testing.T, cgo bool) {
cmd.Env = []string{}
out, err := cmd.CombinedOutput()
if err != nil && bytes.Contains(out, []byte("cannot find GOROOT")) {
- t.Skipf("skipping because GOROOT=%s does not exist", runtime.GOROOT())
+ t.Skipf("skipping because GOROOT=%s does not exist", testenv.GOROOT(t))
}
_, file, _, _ := runtime.Caller(1)
@@ -416,7 +416,7 @@ func TestGdbBacktrace(t *testing.T) {
// Execute gdb commands.
args := []string{"-nx", "-batch",
- "-iex", "add-auto-load-safe-path " + filepath.Join(runtime.GOROOT(), "src", "runtime"),
+ "-iex", "add-auto-load-safe-path " + filepath.Join(testenv.GOROOT(t), "src", "runtime"),
"-ex", "set startup-with-shell off",
"-ex", "break main.eee",
"-ex", "run",
@@ -498,7 +498,7 @@ func TestGdbAutotmpTypes(t *testing.T) {
// Execute gdb commands.
args := []string{"-nx", "-batch",
- "-iex", "add-auto-load-safe-path " + filepath.Join(runtime.GOROOT(), "src", "runtime"),
+ "-iex", "add-auto-load-safe-path " + filepath.Join(testenv.GOROOT(t), "src", "runtime"),
"-ex", "set startup-with-shell off",
"-ex", "break main.main",
"-ex", "run",
@@ -563,7 +563,7 @@ func TestGdbConst(t *testing.T) {
// Execute gdb commands.
args := []string{"-nx", "-batch",
- "-iex", "add-auto-load-safe-path " + filepath.Join(runtime.GOROOT(), "src", "runtime"),
+ "-iex", "add-auto-load-safe-path " + filepath.Join(testenv.GOROOT(t), "src", "runtime"),
"-ex", "set startup-with-shell off",
"-ex", "break main.main",
"-ex", "run",
@@ -626,7 +626,7 @@ func TestGdbPanic(t *testing.T) {
// Execute gdb commands.
args := []string{"-nx", "-batch",
- "-iex", "add-auto-load-safe-path " + filepath.Join(runtime.GOROOT(), "src", "runtime"),
+ "-iex", "add-auto-load-safe-path " + filepath.Join(testenv.GOROOT(t), "src", "runtime"),
"-ex", "set startup-with-shell off",
"-ex", "run",
"-ex", "backtrace",
@@ -701,7 +701,7 @@ func TestGdbInfCallstack(t *testing.T) {
// Execute gdb commands.
// 'setg_gcc' is the first point where we can reproduce the issue with just one 'run' command.
args := []string{"-nx", "-batch",
- "-iex", "add-auto-load-safe-path " + filepath.Join(runtime.GOROOT(), "src", "runtime"),
+ "-iex", "add-auto-load-safe-path " + filepath.Join(testenv.GOROOT(t), "src", "runtime"),
"-ex", "set startup-with-shell off",
"-ex", "break setg_gcc",
"-ex", "run",
diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go
index 3d01ac5171..1fb9e195e5 100644
--- a/src/runtime/runtime2.go
+++ b/src/runtime/runtime2.go
@@ -1129,5 +1129,5 @@ var (
isarchive bool // -buildmode=c-archive
)
-// Must agree with internal/buildcfg.Experiment.FramePointer.
+// Must agree with internal/buildcfg.FramePointerEnabled.
const framepointer_enabled = GOARCH == "amd64" || GOARCH == "arm64"
diff --git a/src/runtime/signal_windows_test.go b/src/runtime/signal_windows_test.go
index 7c88ab573e..add23cd292 100644
--- a/src/runtime/signal_windows_test.go
+++ b/src/runtime/signal_windows_test.go
@@ -10,7 +10,6 @@ import (
"os/exec"
"path/filepath"
"runtime"
- "strconv"
"strings"
"syscall"
"testing"
@@ -24,6 +23,7 @@ func TestVectoredHandlerDontCrashOnLibrary(t *testing.T) {
t.Skip("this test can only run on windows/amd64")
}
testenv.MustHaveGoBuild(t)
+ testenv.MustHaveCGO(t)
testenv.MustHaveExecPath(t, "gcc")
testprog.Lock()
defer testprog.Unlock()
@@ -91,13 +91,16 @@ func TestCtrlHandler(t *testing.T) {
// run test program
cmd = exec.Command(exe)
+ var stdout bytes.Buffer
var stderr bytes.Buffer
+ cmd.Stdout = &stdout
cmd.Stderr = &stderr
- outPipe, err := cmd.StdoutPipe()
+ inPipe, err := cmd.StdinPipe()
if err != nil {
- t.Fatalf("Failed to create stdout pipe: %v", err)
+ t.Fatalf("Failed to create stdin pipe: %v", err)
}
- outReader := bufio.NewReader(outPipe)
+ // keep inPipe alive until the end of the test
+ defer inPipe.Close()
// in a new command window
const _CREATE_NEW_CONSOLE = 0x00000010
@@ -113,29 +116,15 @@ func TestCtrlHandler(t *testing.T) {
cmd.Wait()
}()
- // wait for child to be ready to receive signals
- if line, err := outReader.ReadString('\n'); err != nil {
- t.Fatalf("could not read stdout: %v", err)
- } else if strings.TrimSpace(line) != "ready" {
- t.Fatalf("unexpected message: %s", line)
- }
-
- // gracefully kill pid, this closes the command window
- if err := exec.Command("taskkill.exe", "/pid", strconv.Itoa(cmd.Process.Pid)).Run(); err != nil {
- t.Fatalf("failed to kill: %v", err)
+ // check child exited gracefully, did not timeout
+ if err := cmd.Wait(); err != nil {
+ t.Fatalf("Program exited with error: %v\n%s", err, &stderr)
}
// check child received, handled SIGTERM
- if line, err := outReader.ReadString('\n'); err != nil {
- t.Fatalf("could not read stdout: %v", err)
- } else if expected, got := syscall.SIGTERM.String(), strings.TrimSpace(line); expected != got {
+ if expected, got := syscall.SIGTERM.String(), strings.TrimSpace(stdout.String()); expected != got {
t.Fatalf("Expected '%s' got: %s", expected, got)
}
-
- // check child exited gracefully, did not timeout
- if err := cmd.Wait(); err != nil {
- t.Fatalf("Program exited with error: %v\n%s", err, &stderr)
- }
}
// TestLibraryCtrlHandler tests that Go DLL allows calling program to handle console control events.
@@ -148,6 +137,7 @@ func TestLibraryCtrlHandler(t *testing.T) {
t.Skip("this test can only run on windows/amd64")
}
testenv.MustHaveGoBuild(t)
+ testenv.MustHaveCGO(t)
testenv.MustHaveExecPath(t, "gcc")
testprog.Lock()
defer testprog.Unlock()
diff --git a/src/runtime/stubs.go b/src/runtime/stubs.go
index ad78363bb6..cd7c91029b 100644
--- a/src/runtime/stubs.go
+++ b/src/runtime/stubs.go
@@ -7,7 +7,6 @@ package runtime
import (
"internal/abi"
"internal/goarch"
- "internal/goexperiment"
"runtime/internal/math"
"unsafe"
)
@@ -434,4 +433,4 @@ func sigpanic0()
// registers the system supports.
//
// Protected by finlock.
-var intArgRegs = abi.IntArgRegs * (goexperiment.RegabiArgsInt | goarch.IsAmd64)
+var intArgRegs = abi.IntArgRegs
diff --git a/src/runtime/sys_solaris_amd64.s b/src/runtime/sys_solaris_amd64.s
index 05fd187517..24d2d61df0 100644
--- a/src/runtime/sys_solaris_amd64.s
+++ b/src/runtime/sys_solaris_amd64.s
@@ -29,18 +29,6 @@ TEXT runtime·miniterrno(SB),NOSPLIT,$0
MOVQ AX, (m_mOS+mOS_perrno)(BX)
RET
-// pipe(3c) wrapper that returns fds in AX, DX.
-// NOT USING GO CALLING CONVENTION.
-TEXT runtime·pipe1(SB),NOSPLIT,$0
- SUBQ $16, SP // 8 bytes will do, but stack has to be 16-byte aligned
- MOVQ SP, DI
- LEAQ libc_pipe(SB), AX
- CALL AX
- MOVL 0(SP), AX
- MOVL 4(SP), DX
- ADDQ $16, SP
- RET
-
// Call a library function with SysV calling conventions.
// The called function can take a maximum of 6 INTEGER class arguments,
// see
diff --git a/src/runtime/syscall_solaris.go b/src/runtime/syscall_solaris.go
index e270e271c0..79775711ae 100644
--- a/src/runtime/syscall_solaris.go
+++ b/src/runtime/syscall_solaris.go
@@ -25,11 +25,6 @@ var (
libc_wait4 libcFunc
)
-//go:linkname pipe1x runtime.pipe1
-var pipe1x libcFunc // name to take addr of pipe1
-
-func pipe1() // declared for vet; do NOT call
-
// Many of these are exported via linkname to assembly in the syscall
// package.
@@ -196,19 +191,6 @@ func syscall_ioctl(fd, req, arg uintptr) (err uintptr) {
return call.err
}
-//go:linkname syscall_pipe
-func syscall_pipe() (r, w, err uintptr) {
- call := libcall{
- fn: uintptr(unsafe.Pointer(&pipe1x)),
- n: 0,
- args: uintptr(unsafe.Pointer(&pipe1x)), // it's unused but must be non-nil, otherwise crashes
- }
- entersyscallblock()
- asmcgocall(unsafe.Pointer(&asmsysvicall6x), unsafe.Pointer(&call))
- exitsyscall()
- return call.r1, call.r2, call.err
-}
-
// This is syscall.RawSyscall, it exists to satisfy some build dependency,
// but it doesn't work.
//
diff --git a/src/runtime/testdata/testwinsignal/main.go b/src/runtime/testdata/testwinsignal/main.go
index 1e7c9475fd..e1136f3887 100644
--- a/src/runtime/testdata/testwinsignal/main.go
+++ b/src/runtime/testdata/testwinsignal/main.go
@@ -2,18 +2,52 @@ package main
import (
"fmt"
+ "io"
+ "log"
"os"
"os/signal"
+ "syscall"
"time"
)
func main() {
+ // Ensure that this process terminates when the test times out,
+ // even if the expected signal never arrives.
+ go func() {
+ io.Copy(io.Discard, os.Stdin)
+ log.Fatal("stdin is closed; terminating")
+ }()
+
+ // Register to receive all signals.
c := make(chan os.Signal, 1)
signal.Notify(c)
- fmt.Println("ready")
+ // Get console window handle.
+ kernel32 := syscall.NewLazyDLL("kernel32.dll")
+ getConsoleWindow := kernel32.NewProc("GetConsoleWindow")
+ hwnd, _, err := getConsoleWindow.Call()
+ if hwnd == 0 {
+ log.Fatal("no associated console: ", err)
+ }
+
+ // Send message to close the console window.
+ const _WM_CLOSE = 0x0010
+ user32 := syscall.NewLazyDLL("user32.dll")
+ postMessage := user32.NewProc("PostMessageW")
+ ok, _, err := postMessage.Call(hwnd, _WM_CLOSE, 0, 0)
+ if ok == 0 {
+ log.Fatal("post message failed: ", err)
+ }
+
sig := <-c
+ // Allow some time for the handler to complete if it's going to.
+ //
+ // (In https://go.dev/issue/41884 the handler returned immediately,
+ // which caused Windows to terminate the program before the goroutine
+ // that received the SIGTERM had a chance to actually clean up.)
time.Sleep(time.Second)
+
+ // Print the signal's name: "terminated" makes the test succeed.
fmt.Println(sig)
}
diff --git a/src/runtime/tls_arm64.h b/src/runtime/tls_arm64.h
index fe5e4cee12..3aa8c63d39 100644
--- a/src/runtime/tls_arm64.h
+++ b/src/runtime/tls_arm64.h
@@ -10,7 +10,6 @@
#define TLS_linux
#endif
#ifdef TLS_linux
-#define TPIDR TPIDR_EL0
#define MRS_TPIDR_R0 WORD $0xd53bd040 // MRS TPIDR_EL0, R0
#endif
@@ -21,23 +20,19 @@
#define TLS_darwin
#endif
#ifdef TLS_darwin
-#define TPIDR TPIDRRO_EL0
#define TLSG_IS_VARIABLE
#define MRS_TPIDR_R0 WORD $0xd53bd060 // MRS TPIDRRO_EL0, R0
#endif
#ifdef GOOS_freebsd
-#define TPIDR TPIDR_EL0
#define MRS_TPIDR_R0 WORD $0xd53bd040 // MRS TPIDR_EL0, R0
#endif
#ifdef GOOS_netbsd
-#define TPIDR TPIDRRO_EL0
#define MRS_TPIDR_R0 WORD $0xd53bd040 // MRS TPIDRRO_EL0, R0
#endif
#ifdef GOOS_openbsd
-#define TPIDR TPIDR_EL0
#define MRS_TPIDR_R0 WORD $0xd53bd040 // MRS TPIDR_EL0, R0
#endif
diff --git a/src/runtime/traceback.go b/src/runtime/traceback.go
index 0cdd53cc93..23bce2bf34 100644
--- a/src/runtime/traceback.go
+++ b/src/runtime/traceback.go
@@ -113,7 +113,7 @@ func gentraceback(pc0, sp0, lr0 uintptr, gp *g, skip int, pcbuf *uintptr, max in
f := findfunc(frame.pc)
if !f.valid() {
if callback != nil || printing {
- print("runtime: unknown pc ", hex(frame.pc), "\n")
+ print("runtime: g ", gp.goid, ": unknown pc ", hex(frame.pc), "\n")
tracebackHexdump(gp.stack, &frame, 0)
}
if callback != nil {
@@ -247,7 +247,7 @@ func gentraceback(pc0, sp0, lr0 uintptr, gp *g, skip int, pcbuf *uintptr, max in
doPrint = false
}
if callback != nil || doPrint {
- print("runtime: unexpected return pc for ", funcname(f), " called from ", hex(frame.lr), "\n")
+ print("runtime: g ", gp.goid, ": unexpected return pc for ", funcname(f), " called from ", hex(frame.lr), "\n")
tracebackHexdump(gp.stack, &frame, lrPtr)
}
if callback != nil {
diff --git a/src/runtime/traceback_test.go b/src/runtime/traceback_test.go
index 7d8b04e14b..e50bd95ead 100644
--- a/src/runtime/traceback_test.go
+++ b/src/runtime/traceback_test.go
@@ -6,7 +6,7 @@ package runtime_test
import (
"bytes"
- "internal/goexperiment"
+ "internal/abi"
"internal/testenv"
"runtime"
"strings"
@@ -23,7 +23,7 @@ func TestTracebackArgs(t *testing.T) {
abiSel := func(x, y string) string {
// select expected output based on ABI
// In noopt build we always spill arguments so the output is the same as stack ABI.
- if optimized && goexperiment.RegabiArgs {
+ if optimized && abi.IntArgRegs > 0 {
return x
}
return y