- 18 Oct, 2019 5 commits
-
-
Alberto Donizetti authored
The Div functions in math/bits (Div, Div32, and Div64) compute both quotients and remainders, but they panic if the quotients do not not fit a 32/64 uint. Since, on the other hand, the remainder will always fit the size of the divisor, it is useful to have Div variants that only compute the remainder, and don't panic on a quotient overflow. This change adds to the math/bits package three new functions: Rem(hi, lo, y uint) uint Rem32(hi, lo, y uint32) uint32 Rem64(hi, lo, y uint64) uint64 which can be used to compute (hi,lo)%y even when the quotient overflows the uint size. Fixes #28970 Change-Id: I119948429f737670c5e5ceb8756121e6a738dbdc Reviewed-on: https://go-review.googlesource.com/c/go/+/197838 Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
Cuong Manh Le authored
Fixes #34869 Change-Id: I21bc60b9a5d1204dade1cceed6cddccf5b537b0e Reviewed-on: https://go-review.googlesource.com/c/go/+/200958 Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Keith Randall authored
Add test to make sure we get the right traceback when mid-stack inlining. Update #33309 Change-Id: I23979cbe6b12fad105dbd26698243648aa86a354 Reviewed-on: https://go-review.googlesource.com/c/go/+/195984 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
-
Keith Randall authored
Pulls in a new snapshot of the race detector, containing a fix that lets it handle mid-stack inlining correctly. Fixes #33309 Change-Id: I7551912a491f0615e77d069f198c1b8a6eead280 Reviewed-on: https://go-review.googlesource.com/c/go/+/201898 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Robert Griesemer authored
Updating the underlying type of an imported type (even though is was set to the same type again) leads to a race condition if the imported package is imported by separate, concurrently type-checked packages. Fixes #31749. Change-Id: Iabb8e8593eb067eb4816c1df81e545ff52d32c6c Reviewed-on: https://go-review.googlesource.com/c/go/+/201838 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
- 17 Oct, 2019 20 commits
-
-
Matthew Dempsky authored
Fixes #34968. Change-Id: I538d653fab6cf7cf9b9b7022a1c2d4ae6ee497b6 Reviewed-on: https://go-review.googlesource.com/c/go/+/201823 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Keith Randall authored
The race detector C code expects the g register (aka R28) to be preserved per the C calling convention. Make sure we save/restore it. Once this is in we can revert the O3 -> O1 change to racebuild. Change-Id: Ia785b2717c136f565d45bed283e87b744e35c62d Reviewed-on: https://go-review.googlesource.com/c/go/+/201744Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Alexander Rakoczy authored
Change-Id: Ia571b8aa791578a77ed5c2b8eaf45c9684eea1c3 Reviewed-on: https://go-review.googlesource.com/c/go/+/201820Reviewed-by: Andrew Bonventre <andybons@golang.org>
-
Matthew Dempsky authored
We need to explicitly convert pointers to unsafe.Pointer before passing to the runtime checkptr instrumentation in case the user declared their own type with underlying type unsafe.Pointer. Updates #22218. Fixes #34966. Change-Id: I3baa2809d77f8257167cd78f57156f819130baa8 Reviewed-on: https://go-review.googlesource.com/c/go/+/201782 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
Alexander Rakoczy authored
Change-Id: I832ba5f32d513b586bb0b02371231786b25631e3 Reviewed-on: https://go-review.googlesource.com/c/go/+/201817Reviewed-by: Andrew Bonventre <andybons@golang.org>
-
Katie Hockman authored
Change-Id: I73f27924046a0a2493330ddc732d1a2fd3f730a5 Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/575981Reviewed-by: Filippo Valsorda <valsorda@google.com> Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/575983 Reviewed-on: https://go-review.googlesource.com/c/go/+/201785Reviewed-by: Filippo Valsorda <filippo@golang.org> Reviewed-by: Andrew Bonventre <andybons@golang.org>
-
Matthew Dempsky authored
This CL tweaks escape analysis to treat unsafe.Pointer(ptr) as an escaping operation when -d=checkptr is enabled. This allows better detection of unsafe pointer arithmetic and conversions, because the runtime checkptr instrumentation can currently only detect object boundaries for heap objects, not stack objects. Updates #22218. Fixes #34959. Change-Id: I856812cc23582fe4d0d401592583323e95919f28 Reviewed-on: https://go-review.googlesource.com/c/go/+/201781 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Keith Randall authored
This CL helps race.bash finish in a reasonable amount of time. Otherwise the Match/Hard1/32M benchmark takes over 1200 seconds to finish on arm64, triggering a timeout. With this change the regexp benchmarks as a whole take only about a minute. Change-Id: Ie2260ef9f5709e32a74bd76f135bc384b2d9853f Reviewed-on: https://go-review.googlesource.com/c/go/+/201742 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Matthew Dempsky authored
This CL extends the runtime instrumentation for (*T)(ptr) to also check that the first and last bytes of *(*T)(ptr) are part of the same heap object. Updates #22218. Updates #34959. Change-Id: I2c8063fe1b7fe6e6145e41c5654cb64dd1c9dd41 Reviewed-on: https://go-review.googlesource.com/c/go/+/201778 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Brad Fitzpatrick authored
Updates #15581 Updates #34368 Change-Id: Ife3be7ed484cbe87960bf972ac701954d86127d8 Reviewed-on: https://go-review.googlesource.com/c/go/+/201740Reviewed-by: Bryan C. Mills <bcmills@google.com>
-
Matthew Dempsky authored
Caught with -d=checkptr. Updates #22218. Change-Id: Ic0fcff4d2c8d83e4e7f5e0c6d01f03c9c7766c6d Reviewed-on: https://go-review.googlesource.com/c/go/+/201617 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Trung Nguyen authored
Fixes #34799 Change-Id: I134b2717fa90c8955902e7eeaaf8510dcc28340e Reviewed-on: https://go-review.googlesource.com/c/go/+/200760 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Bryan C. Mills authored
The issues associated with these skipped checks are closed. If they are working around unfixed bugs, the issues should remain open. If they are working around unfixable properties of the system, the skips should refer to those properties rather than closed issues. Updates #2603 Updates #3955 Updates #25628 Change-Id: I3491c69b2ef5bad0fb12001fe8f7e06b424883ca Reviewed-on: https://go-review.googlesource.com/c/go/+/201718 Run-TryBot: Bryan C. Mills <bcmills@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Brad Fitzpatrick authored
Updates #34956 Change-Id: I35c39f3afda7226eeae0fd6936f7ee0d5d6c025b Reviewed-on: https://go-review.googlesource.com/c/go/+/201737 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Bryan C. Mills <bcmills@google.com> Reviewed-by: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Brad Fitzpatrick authored
Skipping tests isn't great, but neither is a wall of red masking other potential regressions. Updates #34368 Change-Id: I5fdfa54846dd8d648001594c74f059af8af52247 Reviewed-on: https://go-review.googlesource.com/c/go/+/201482 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
-
Artem Alekseev authored
Instructions added: CLDEMOTE, CLWB, TPAUSE, UMWAIT, UMONITOR. Change-Id: I1ba550d4d5acc41a2fd97068ff5834e0412d3bcf Reviewed-on: https://go-review.googlesource.com/c/go/+/183225 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
-
Bryan C. Mills authored
Also log errors from the lsof command on failure. (That's how the missing environment was discovered.) Updates #25628 Change-Id: I71594f60c15d0d254d5d4a86deec7431314c92ff Reviewed-on: https://go-review.googlesource.com/c/go/+/201717 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Michael Munday authored
These functions are not necessary and are not called anywhere. Change-Id: I1c0d814ba3044c27e3626ac9e6052d8154140404 Reviewed-on: https://go-review.googlesource.com/c/go/+/201697 Run-TryBot: Michael Munday <mike.munday@ibm.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Alex Brainman authored
It seems that windowsZones.xml file has moved to Github. I opened http://unicode.org/cldr/data/common/supplemental/windowsZones.xml in my browser, and it redirected me to https://github.com/unicode-org/cldr/blob/master/common/supplemental/windowsZones.xml Very nice of them. And we could see windowsZones.xml change history now. We could even probably file issues against this file, if we find problems. Anyway, this CL adjusts genzabbrs.go to use new GitHub location. I also run 'go generate' command with updated genzabbrs.go to update zoneinfo_abbrs_windows.go. Fixes #34917 Change-Id: I69b71a4e02edd999435738ecb225a6f9793a66d5 Reviewed-on: https://go-review.googlesource.com/c/go/+/201378 Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
-
Matthew Dempsky authored
This CL adds -d=checkptr as a compile-time option for adding instrumentation to check that Go code is following unsafe.Pointer safety rules dynamically. In particular, it currently checks two things: 1. When converting unsafe.Pointer to *T, make sure the resulting pointer is aligned appropriately for T. 2. When performing pointer arithmetic, if the result points to a Go heap object, make sure we can find an unsafe.Pointer-typed operand that pointed into the same object. These checks are currently disabled for the runtime, and can also be disabled through a new //go:nocheckptr annotation. The latter is necessary for functions like strings.noescape, which intentionally violate safety rules to workaround escape analysis limitations. Fixes #22218. Change-Id: If5a51273881d93048f74bcff10a3275c9c91da6a Reviewed-on: https://go-review.googlesource.com/c/go/+/162237 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
- 16 Oct, 2019 11 commits
-
-
Jay Conrod authored
This was spotted in CL 200767. This change just ensures internal packages match their equivalents in x/mod. Also pulled in test added in CL 201517. Change-Id: I51d23d62697c256548f411930fcb6bccce51bf34 Reviewed-on: https://go-review.googlesource.com/c/go/+/201497 Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
-
Eugene Kalinin authored
1. Change mapencode.encode to use fmt.Error rather than MarshalerError. MarshalerError refer to MarshalJSON, but mapencode.encode does not use that. 2. Add sourceFunc field to MarshalerError to record the name of the function that creates the error, so that the Error method can report it correctly. Fixes #29753 Change-Id: I186c2fac8470ae2f9e300501de3730face642230 Reviewed-on: https://go-review.googlesource.com/c/go/+/184119 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Michael Munday authored
This a revert of CL 174437 and follow up fix CL 201317. The s390x assembly in this package makes use of an instruction (specifically KDSA) which is not supported by the current build machine. Remove this assembly for now, we can revisit this functionality once we have a newer build machine and can ensure that this assembly is well tested. Updates #34927. Change-Id: I779286fa7d9530a254b53a515ee76b1218821f2f Reviewed-on: https://go-review.googlesource.com/c/go/+/201360 Run-TryBot: Michael Munday <mike.munday@ibm.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Bryan C. Mills authored
Revert "cmd/compile, cmd/link, runtime: make defers low-cost through inline code and extra funcdata" This reverts CL 190098. Reason for revert: broke several builders. Change-Id: I69161352f9ded02537d8815f259c4d391edd9220 Reviewed-on: https://go-review.googlesource.com/c/go/+/201519 Run-TryBot: Bryan C. Mills <bcmills@google.com> Reviewed-by: Austin Clements <austin@google.com> Reviewed-by: Dan Scales <danscales@google.com>
-
Emmanuel T Odeke authored
Allow TempDir to create directories with predictable prefixes and suffixes, separated by the last "*", for example: "prefix*suffix" will now expand to "prefix" + <RANDOM_VALUE> + "suffix" RELNOTE=yes Fixes #33805. Change-Id: I85fa73ae6a684ce820d1810c82a60765eb9c4a42 Reviewed-on: https://go-review.googlesource.com/c/go/+/198488 Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Dan Scales authored
Generate inline code at defer time to save the args of defer calls to unique (autotmp) stack slots, and generate inline code at exit time to check which defer calls were made and make the associated function/method/interface calls. We remember that a particular defer statement was reached by storing in the deferBits variable (always stored on the stack). At exit time, we check the bits of the deferBits variable to determine which defer function calls to make (in reverse order). These low-cost defers are only used for functions where no defers appear in loops. In addition, we don't do these low-cost defers if there are too many defer statements or too many exits in a function (to limit code increase). When a function uses open-coded defers, we produce extra FUNCDATA_OpenCodedDeferInfo information that specifies the number of defers, and for each defer, the stack slots where the closure and associated args have been stored. The funcdata also includes the location of the deferBits variable. Therefore, for panics, we can use this funcdata to determine exactly which defers are active, and call the appropriate functions/methods/closures with the correct arguments for each active defer. In order to unwind the stack correctly after a recover(), we need to add an extra code segment to functions with open-coded defers that simply calls deferreturn() and returns. This segment is not reachable by the normal function, but is returned to by the runtime during recovery. We set the liveness information of this deferreturn() to be the same as the liveness at the first function call during the last defer exit code (so all return values and all stack slots needed by the defer calls will be live). I needed to increase the stackguard constant from 880 to 896, because of a small amount of new code in deferreturn(). The -N flag disables open-coded defers. '-d defer' prints out the kind of defer being used at each defer statement (heap-allocated, stack-allocated, or open-coded). Cost of defer statement [ go test -run NONE -bench BenchmarkDefer$ runtime ] With normal (stack-allocated) defers only: 35.4 ns/op With open-coded defers: 5.6 ns/op Cost of function call alone (remove defer keyword): 4.4 ns/op Text size increase (including funcdata) for go cmd without/with open-coded defers: 0.09% The average size increase (including funcdata) for only the functions that use open-coded defers is 1.1%. The cost of a panic followed by a recover got noticeably slower, since panic processing now requires a scan of the stack for open-coded defer frames. This scan is required, even if no frames are using open-coded defers: Cost of panic and recover [ go test -run NONE -bench BenchmarkPanicRecover runtime ] Without open-coded defers: 62.0 ns/op With open-coded defers: 255 ns/op A CGO Go-to-C-to-Go benchmark got noticeably faster because of open-coded defers: CGO Go-to-C-to-Go benchmark [cd misc/cgo/test; go test -run NONE -bench BenchmarkCGoCallback ] Without open-coded defers: 443 ns/op With open-coded defers: 347 ns/op Updates #14939 (defer performance) Updates #34481 (design doc) Change-Id: I51a389860b9676cfa1b84722f5fb84d3c4ee9e28 Reviewed-on: https://go-review.googlesource.com/c/go/+/190098Reviewed-by: Austin Clements <austin@google.com>
-
Fazlul Shahriar authored
Fix issues that make these tests pass: - TestDialerLocalAddr: return error if local address is not IPv4 for "tcp4" network. - TestInterfaceAddrs, TestInterfaceUnicastAddrs: don't assume each interface has only one address. It may have more than one or none. - TestConcurrentPreferGoResolversDial: should be skipped on Plan 9. - TestListenMulticastUDP: remove IP from `announce` command and don't mix IPv4 address with IPv6 address in `addmulti` command. Fixes #34931 Change-Id: Ie0fdfe19ea282e5d6d6c938bf3c9139f8f5b0308 Reviewed-on: https://go-review.googlesource.com/c/go/+/201397 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Ben Shi authored
Updates golang/go#30439 Change-Id: Ieaf18b7cfd22a768eb1b7ac549ebc03637258876 Reviewed-on: https://go-review.googlesource.com/c/go/+/201377 Run-TryBot: Ben Shi <powerman1st@163.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
Agniva De Sarker authored
While building a simple hello world binary, there are total 858277 calls to writeUleb during the assembler phase out of which 836625 (97%) are less than 7 bits. Using a simple micro-benchmark like this: func BenchmarkUleb(b *testing.B) { var buf bytes.Buffer for i := 0; i < b.N; i++ { writeUleb128(&buf, 42) buf.Reset() } } We get the following results with the fast path enabled. name old time/op new time/op delta Uleb-4 8.45ns ± 2% 7.51ns ± 2% -11.16% (p=0.000 n=10+10) Applying the time taken to the number of calls, we get roughly 6% improvement in total time taken for writeUleb128. We also apply the change to the function in linker to make it consistent. Change-Id: I9fe8c41df1209f5f3aa7d8bd0181f1b0e536ceb5 Reviewed-on: https://go-review.googlesource.com/c/go/+/201177 Run-TryBot: Agniva De Sarker <agniva.quicksilver@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
bill_ofarrell authored
I used too small a size for buffers, which can cause a panic in some testing. The new buffer size is generous and sufficient for all purposes. Fixes #34927 Fixes #34928 Change-Id: Icdbbfed5da87fe3757be40dfd23182b37ec62d58 Reviewed-on: https://go-review.googlesource.com/c/go/+/201317Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Cherry Zhang authored
The Go spec requires If a deferred function value evaluates to nil, execution panics when the function is invoked, not when the "defer" statement is executed. On Wasm and AIX, currently we actually emit a nil check at the point of defer statement, which will make it panic too early. This CL fixes this. Also, on Wasm, now the nil function will be passed through deferreturn to jmpdefer, which does an explicit nil check and calls sigpanic if it is nil. This sigpanic, being called from assembly, is ABI0. So change the assembler backend to also handle sigpanic in ABI0. Fixes #34926. Updates #8047. Change-Id: I28489a571cee36d2aef041f917b8cfdc31d557d4 Reviewed-on: https://go-review.googlesource.com/c/go/+/201297Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
- 15 Oct, 2019 4 commits
-
-
Ian Lance Taylor authored
Updates #33871 Change-Id: I73b1513a89ad89126159ce03ee72b922cd01916c Reviewed-on: https://go-review.googlesource.com/c/go/+/200837 Run-TryBot: Ian Lance Taylor <iant@golang.org> Run-TryBot: Bryan C. Mills <bcmills@google.com> Reviewed-by: Bryan C. Mills <bcmills@google.com> Reviewed-by: Than McIntosh <thanm@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Robert Griesemer authored
Do not modify the underlying Rat denominator when calling one of the accessors Float32, Float64; verify that we don't modify the Rat denominator when calling Inv, Sign, IsInt, Num. Fixes #34919. Reopens #33792. Change-Id: Ife6d1252373f493a597398ee51e7b5695b708df5 Reviewed-on: https://go-review.googlesource.com/c/go/+/201205Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Ian Lance Taylor authored
Updates #34810 Fixes #34858 Change-Id: Ie934861e51eeafe8a7fd6653c4223a5f5d45efe8 Reviewed-on: https://go-review.googlesource.com/c/go/+/201198Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Ian Lance Taylor authored
This new facility will be used by future CLs in this series. Change the only blocking call to netpoll to do the right thing when netpoll returns an empty list. Updates #6239 Updates #27707 Change-Id: I58b3c2903eda61a3698b1a4729ed0e81382bb1ed Reviewed-on: https://go-review.googlesource.com/c/go/+/171821 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
-