Skip to content

Commit 37752d0

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents dba4466 + d13da63 commit 37752d0

File tree

42 files changed

+1345
-425
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1345
-425
lines changed

doc/godebug.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ Go command will follow symlinks to regular files embedding files.
169169
The default value `embedfollowsymlinks=0` does not allow following
170170
symlinks. `embedfollowsymlinks=1` will allow following symlinks.
171171

172+
Go 1.25 corrected the semantics of contention reports for runtime-internal locks,
173+
and so removed the [`runtimecontentionstacks` setting](/pkg/runtime#hdr-Environment_Variable).
174+
172175
### Go 1.24
173176

174177
Go 1.24 added a new `fips140` setting that controls whether the Go
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
The mutex profile for contention on runtime-internal locks now correctly points
2+
to the end of the critical section that caused the delay. This matches the
3+
profile's behavior for contention on `sync.Mutex` values. The
4+
`runtimecontentionstacks` setting for `GODEBUG`, which allowed opting in to the
5+
unusual behavior of Go 1.22 through 1.24 for this part of the profile, is now
6+
gone.

src/cmd/asm/internal/asm/testdata/loong64enc1.s

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -964,3 +964,25 @@ lable2:
964964
XVSETALLNEH X1, FCC0 // 20b49c76
965965
XVSETALLNEW X1, FCC0 // 20b89c76
966966
XVSETALLNEV X1, FCC0 // 20bc9c76
967+
968+
// [X]VFRINT[{RNE/RZ/RP/RM}].{S/D} instructions
969+
VFRINTRNEF V1, V2 // 22749d72
970+
VFRINTRNED V1, V2 // 22789d72
971+
VFRINTRZF V1, V2 // 22649d72
972+
VFRINTRZD V1, V2 // 22689d72
973+
VFRINTRPF V1, V2 // 22549d72
974+
VFRINTRPD V1, V2 // 22589d72
975+
VFRINTRMF V1, V2 // 22449d72
976+
VFRINTRMD V1, V2 // 22489d72
977+
VFRINTF V1, V2 // 22349d72
978+
VFRINTD V1, V2 // 22389d72
979+
XVFRINTRNEF X1, X2 // 22749d76
980+
XVFRINTRNED X1, X2 // 22789d76
981+
XVFRINTRZF X1, X2 // 22649d76
982+
XVFRINTRZD X1, X2 // 22689d76
983+
XVFRINTRPF X1, X2 // 22549d76
984+
XVFRINTRPD X1, X2 // 22589d76
985+
XVFRINTRMF X1, X2 // 22449d76
986+
XVFRINTRMD X1, X2 // 22489d76
987+
XVFRINTF X1, X2 // 22349d76
988+
XVFRINTD X1, X2 // 22389d76

src/cmd/compile/internal/reflectdata/map_swiss.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ func SwissMapType() *types.Type {
159159
// globalShift uint8
160160
//
161161
// writing uint8
162+
// tombstonePossible bool
162163
// // N.B Padding
163164
//
164165
// clearSeq uint64
@@ -172,6 +173,7 @@ func SwissMapType() *types.Type {
172173
makefield("globalDepth", types.Types[types.TUINT8]),
173174
makefield("globalShift", types.Types[types.TUINT8]),
174175
makefield("writing", types.Types[types.TUINT8]),
176+
makefield("tombstonePossible", types.Types[types.TBOOL]),
175177
makefield("clearSeq", types.Types[types.TUINT64]),
176178
}
177179

src/cmd/compile/internal/test/inl_test.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,25 @@ func TestIntendedInlining(t *testing.T) {
284284
}
285285
}
286286

287+
if runtime.GOARCH != "wasm" {
288+
// mutex implementation for multi-threaded GOARCHes
289+
want["runtime"] = append(want["runtime"],
290+
// in the fast paths of lock2 and unlock2
291+
"key8",
292+
"(*mLockProfile).store",
293+
)
294+
if bits.UintSize == 64 {
295+
// these use 64-bit arithmetic, which is hard to inline on 32-bit platforms
296+
want["runtime"] = append(want["runtime"],
297+
// in the fast paths of lock2 and unlock2
298+
"mutexSampleContention",
299+
300+
// in a slow path of lock2, but within the critical section
301+
"(*mLockProfile).end",
302+
)
303+
}
304+
}
305+
287306
// Functions that must actually be inlined; they must have actual callers.
288307
must := map[string]bool{
289308
"compress/flate.byLiteral.Len": true,

src/cmd/dist/test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1678,7 +1678,7 @@ func (t *tester) makeGOROOTUnwritable() (undo func()) {
16781678
func raceDetectorSupported(goos, goarch string) bool {
16791679
switch goos {
16801680
case "linux":
1681-
return goarch == "amd64" || goarch == "ppc64le" || goarch == "arm64" || goarch == "s390x"
1681+
return goarch == "amd64" || goarch == "ppc64le" || goarch == "arm64" || goarch == "s390x" || goarch == "loong64"
16821682
case "darwin":
16831683
return goarch == "amd64" || goarch == "arm64"
16841684
case "freebsd", "netbsd", "windows":

src/cmd/internal/obj/loong64/a.out.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,28 @@ const (
950950
AXVFRSQRTF
951951
AXVFRSQRTD
952952

953+
// LSX and LASX floating point conversion instructions
954+
AVFRINTRNEF
955+
AVFRINTRNED
956+
AVFRINTRZF
957+
AVFRINTRZD
958+
AVFRINTRPF
959+
AVFRINTRPD
960+
AVFRINTRMF
961+
AVFRINTRMD
962+
AVFRINTF
963+
AVFRINTD
964+
AXVFRINTRNEF
965+
AXVFRINTRNED
966+
AXVFRINTRZF
967+
AXVFRINTRZD
968+
AXVFRINTRPF
969+
AXVFRINTRPD
970+
AXVFRINTRMF
971+
AXVFRINTRMD
972+
AXVFRINTF
973+
AXVFRINTD
974+
953975
// LSX and LASX integer neg instructions
954976
AVNEGB
955977
AVNEGH

src/cmd/internal/obj/loong64/anames.go

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cmd/internal/obj/loong64/asm.go

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1722,6 +1722,16 @@ func buildop(ctxt *obj.Link) {
17221722
opset(AVNEGH, r0)
17231723
opset(AVNEGW, r0)
17241724
opset(AVNEGV, r0)
1725+
opset(AVFRINTRNEF, r0)
1726+
opset(AVFRINTRNED, r0)
1727+
opset(AVFRINTRZF, r0)
1728+
opset(AVFRINTRZD, r0)
1729+
opset(AVFRINTRPF, r0)
1730+
opset(AVFRINTRPD, r0)
1731+
opset(AVFRINTRMF, r0)
1732+
opset(AVFRINTRMD, r0)
1733+
opset(AVFRINTF, r0)
1734+
opset(AVFRINTD, r0)
17251735

17261736
case AXVPCNTB:
17271737
opset(AXVPCNTH, r0)
@@ -1737,6 +1747,16 @@ func buildop(ctxt *obj.Link) {
17371747
opset(AXVNEGH, r0)
17381748
opset(AXVNEGW, r0)
17391749
opset(AXVNEGV, r0)
1750+
opset(AXVFRINTRNEF, r0)
1751+
opset(AXVFRINTRNED, r0)
1752+
opset(AXVFRINTRZF, r0)
1753+
opset(AXVFRINTRZD, r0)
1754+
opset(AXVFRINTRPF, r0)
1755+
opset(AXVFRINTRPD, r0)
1756+
opset(AXVFRINTRMF, r0)
1757+
opset(AXVFRINTRMD, r0)
1758+
opset(AXVFRINTF, r0)
1759+
opset(AXVFRINTD, r0)
17401760

17411761
case AVADDB:
17421762
opset(AVADDH, r0)
@@ -3583,6 +3603,46 @@ func (c *ctxt0) oprr(a obj.As) uint32 {
35833603
return 0x1da70e << 10 // xvneg.w
35843604
case AXVNEGV:
35853605
return 0x1da70f << 10 // xvneg.d
3606+
case AVFRINTRNEF:
3607+
return 0x1ca75d << 10 // vfrintrne.s
3608+
case AVFRINTRNED:
3609+
return 0x1ca75e << 10 // vfrintrne.d
3610+
case AVFRINTRZF:
3611+
return 0x1ca759 << 10 // vfrintrz.s
3612+
case AVFRINTRZD:
3613+
return 0x1ca75a << 10 // vfrintrz.d
3614+
case AVFRINTRPF:
3615+
return 0x1ca755 << 10 // vfrintrp.s
3616+
case AVFRINTRPD:
3617+
return 0x1ca756 << 10 // vfrintrp.d
3618+
case AVFRINTRMF:
3619+
return 0x1ca751 << 10 // vfrintrm.s
3620+
case AVFRINTRMD:
3621+
return 0x1ca752 << 10 // vfrintrm.d
3622+
case AVFRINTF:
3623+
return 0x1ca74d << 10 // vfrint.s
3624+
case AVFRINTD:
3625+
return 0x1ca74e << 10 // vfrint.d
3626+
case AXVFRINTRNEF:
3627+
return 0x1da75d << 10 // xvfrintrne.s
3628+
case AXVFRINTRNED:
3629+
return 0x1da75e << 10 // xvfrintrne.d
3630+
case AXVFRINTRZF:
3631+
return 0x1da759 << 10 // xvfrintrz.s
3632+
case AXVFRINTRZD:
3633+
return 0x1da75a << 10 // xvfrintrz.d
3634+
case AXVFRINTRPF:
3635+
return 0x1da755 << 10 // xvfrintrp.s
3636+
case AXVFRINTRPD:
3637+
return 0x1da756 << 10 // xvfrintrp.d
3638+
case AXVFRINTRMF:
3639+
return 0x1da751 << 10 // xvfrintrm.s
3640+
case AXVFRINTRMD:
3641+
return 0x1da752 << 10 // xvfrintrm.d
3642+
case AXVFRINTF:
3643+
return 0x1da74d << 10 // xvfrint.s
3644+
case AXVFRINTD:
3645+
return 0x1da74e << 10 // xvfrint.d
35863646
case AVSETEQV:
35873647
return 0x1ca726<<10 | 0x0<<3 // vseteqz.v
35883648
case AVSETNEV:

src/crypto/tls/cache.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ var globalCertCache = new(certCache)
4343

4444
// activeCert is a handle to a certificate held in the cache. Once there are
4545
// no alive activeCerts for a given certificate, the certificate is removed
46-
// from the cache by a finalizer.
46+
// from the cache by a cleanup.
4747
type activeCert struct {
4848
cert *x509.Certificate
4949
}
5050

5151
// active increments the number of references to the entry, wraps the
52-
// certificate in the entry in an activeCert, and sets the finalizer.
52+
// certificate in the entry in an activeCert, and sets the cleanup.
5353
//
54-
// Note that there is a race between active and the finalizer set on the
54+
// Note that there is a race between active and the cleanup set on the
5555
// returned activeCert, triggered if active is called after the ref count is
5656
// decremented such that refs may be > 0 when evict is called. We consider this
5757
// safe, since the caller holding an activeCert for an entry that is no longer
@@ -60,11 +60,11 @@ type activeCert struct {
6060
func (cc *certCache) active(e *cacheEntry) *activeCert {
6161
e.refs.Add(1)
6262
a := &activeCert{e.cert}
63-
runtime.SetFinalizer(a, func(_ *activeCert) {
64-
if e.refs.Add(-1) == 0 {
65-
cc.evict(e)
63+
runtime.AddCleanup(a, func(ce *cacheEntry) {
64+
if ce.refs.Add(-1) == 0 {
65+
cc.evict(ce)
6666
}
67-
})
67+
}, e)
6868
return a
6969
}
7070

0 commit comments

Comments
 (0)