- 24 Oct, 2019 9 commits
-
-
Bryan C. Mills authored
Updates #33848 Change-Id: I10b4c79faef8bc3dee2ceba14d496fa049e84fb2 Reviewed-on: https://go-review.googlesource.com/c/go/+/202977 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
-
Cuong Manh Le authored
Correct comment about allocating big enough slice to copy result of Getdirentries. While at it, also convert from Dirent directly to slice of byte. Updates #35092 Change-Id: I892de7953120622882e1561728e1e56b009a2351 Reviewed-on: https://go-review.googlesource.com/c/go/+/202880 Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@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 binary 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: I63b1a60d1ebf28126f55ee9fd7ecffe9cb23d1ff Reviewed-on: https://go-review.googlesource.com/c/go/+/202340Reviewed-by: Austin Clements <austin@google.com>
-
Bryan C. Mills authored
The default value of cfg.BuildMod depends on the 'go' version in the go.mod file. The go.mod file is read and parsed, and its settings are applied, in modload.InitMod. As it turns out, modload.Enabled does not invoke InitMod, so cfg.BuildMod is not necessarily set even if modload.Enabled returns true. Updates #33848 Change-Id: I13a4dd80730528e6f1a5acc492fcfe07cb59d94e Reviewed-on: https://go-review.googlesource.com/c/go/+/202917 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
-
Cuong Manh Le authored
Change-Id: Ic809a533f9c4042373bdad3ba1cd237d203bacff Reviewed-on: https://go-review.googlesource.com/c/go/+/202881Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Cuong Manh Le authored
Fixes #35092 Change-Id: I8f1ee2b79d42b2291548fd5645940a61f6d67582 Reviewed-on: https://go-review.googlesource.com/c/go/+/202878 Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Brad Fitzpatrick authored
Fixes Darwin. Updates #35092 Change-Id: I045f070c8549d00610b459e3a82cac870d9ddb54 Reviewed-on: https://go-review.googlesource.com/c/go/+/203077 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Robert Griesemer authored
A Rat is represented via a quotient a/b where a and b are Int values. To make it possible to use an uninitialized Rat value (with a and b uninitialized and thus == 0), the implementation treats a 0 denominator as 1. Rat.Num and Rat.Denom return pointers to these values a and b. Because b may be 0, Rat.Denom used to first initialize it to 1 and thus produce an undesirable side-effect (by changing the Rat's denominator). This CL changes Denom to return a new (not shared) *Int with value 1 in the rare case where the Rat was not initialized. This eliminates the side effect and returns the correct denominator value. While this is changing behavior of the API, the impact should now be minor because together with (prior) CL https://golang.org/cl/202997, which initializes Rats ASAP, Denom is unlikely used to access the denominator of an uninitialized (and thus 0) Rat. Any operation that will somehow set a Rat value will ensure that the denominator is not 0. Fixes #33792. Updates #3521. Change-Id: I0bf15ac60513cf52162bfb62440817ba36f0c3fc Reviewed-on: https://go-review.googlesource.com/c/go/+/203059 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Robert Griesemer authored
A Rat is represented via a quotient a/b where a and b are Int values. To make it possible to use an uninitialized Rat value (with a and b uninitialized and thus == 0), the implementation treats a 0 denominator as 1. For each operation we check if the denominator is 0, and then treat it as 1 (if necessary). Operations that create a new Rat result, normalize that value such that a result denominator 1 is represened as 0 again. This CL changes this behavior slightly: 0 denominators are still interpreted as 1, but whenever we (safely) can, we set an uninitialized 0 denominator to 1. This simplifies the code overall. Also: Improved some doc strings. Preparation for addressing issue #33792. Updates #33792. Change-Id: I3040587c8d0dad2e840022f96ca027d8470878a0 Reviewed-on: https://go-review.googlesource.com/c/go/+/202997 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
- 23 Oct, 2019 14 commits
-
-
Cherry Zhang authored
On ARM and ARM64, during a VDSO call, the g register may be temporarily clobbered by the VDSO code. If a signal is received during the execution of VDSO code, we may not find a valid g reading the g register. In CL 192937, we conservatively assume g is nil. But this approach has a problem: we cannot handle the signal in this case. Further, if the signal is not a profiling signal, we'll call badsignal, which calls needm, which wants to get an extra m, but we don't have one in a non-cgo binary, which cuases the program to hang. This is even more of a problem with async preemption, where we will receive more signals than before. I ran into this problem while working on async preemption support on ARM64. In this CL, before making a VDSO call, we save the g on the gsignal stack. When we receive a signal, we will be running on the gsignal stack, so we can fetch the g from there and move on. We probably want to do the same for PPC64. Currently we rely on that the VDSO code doesn't actually clobber the g register, but this is not guaranteed and we don't have control with. Idea from discussion with Dan Cross and Austin. Should fix #34391. Change-Id: Idbefc5e4c2f4373192c2be797be0140ae08b26e3 Reviewed-on: https://go-review.googlesource.com/c/go/+/202759 Run-TryBot: Cherry Zhang <cherryyz@google.com> Reviewed-by: Austin Clements <austin@google.com>
-
Rohan Verma authored
Fixes #35099 Change-Id: Ieaf3174540087bd20443b38703ef88d9f9638052 GitHub-Last-Rev: 12973bc66f39caebb4156396de3b9df670bf12b5 GitHub-Pull-Request: golang/go#35123 Reviewed-on: https://go-review.googlesource.com/c/go/+/202998Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Dmitri Shuralyov authored
benchcmp was moved out of misc into x/tools in CL 60100043 in 2014, and then replaced by a forwarding script in CL 82710043. Five years have since passed, and the forwarding script has outlived its usefulness. It's now more confusing than helpful. Delete it. Change-Id: I8c7d65b97e0b3fe367df69a86ae10c7960c05be3 Reviewed-on: https://go-review.googlesource.com/c/go/+/202762Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Jason A. Donenfeld authored
It turns out that Windows has "legitimate" keys that have bogus type values or bogus lengths that don't correspond with their type. On up to date Windows 10 systems, this test always fails for this reason. These keys exist because of bugs in Microsoft's code. This commit works around the problem by simply blacklisting known instances. It also expands the error message a bit so that we can make adjustments should the problem ever happen again, and reformats the messages so that it makes copy and pasting into the blacklist easier. Updates #35084 Change-Id: I50322828c0eb0ccecbb62d6bf4f9c726fa0b3c27 Reviewed-on: https://go-review.googlesource.com/c/go/+/202897 Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Fazlul Shahriar authored
Update #25234 Fixes #35083 Change-Id: Ida39516ab1c14a34a62c2232476a75e83f4e3f75 Reviewed-on: https://go-review.googlesource.com/c/go/+/202657Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Jay Conrod authored
Since CL 194600, search.CleanPaths preserves characters after '@' in each argument. This was done so that paths could be cleaned while version queries were preserved. However, local and absolute file paths may contain '@' characters. With this change, '@' is treated as a normal character by search.CleanPaths in local and absolute paths. Fixes #35115 Change-Id: Ia7d37e0a2737442d4f1796cc2fc3a59237a8ddfe Reviewed-on: https://go-review.googlesource.com/c/go/+/202761 Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
-
Ghazni Nattarshah authored
Fixes #35052 Change-Id: Ie7c52f39203cf16d8b53a333b591cffccdf7446a Reviewed-on: https://go-review.googlesource.com/c/go/+/202877Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Brad Fitzpatrick authored
Updates #33323 Change-Id: I4b3076469f3db8ab0fe888edcf0471f17dc199e6 Reviewed-on: https://go-review.googlesource.com/c/go/+/202823Reviewed-by: Robert Griesemer <gri@golang.org>
-
Jason A. Donenfeld authored
This was disabled due to a report that the App Store rejects the symbol __sysctl. However, we use the sysctl symbol, which is fine. The __sysctl symbol is used by x/sys/unix, which needs fixing instead. So, this commit reenables sysctl on iOS, so that things like net.InterfaceByName can work again. This reverts CL 193843, CL 193844, CL 193845, and CL 193846. Fixes #35101 Updates #34133 Updates #35103 Change-Id: Ib8eb9f87b81db24965b0de29d99eb52887c7c60a Reviewed-on: https://go-review.googlesource.com/c/go/+/202778 Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com> Reviewed-by: David Crawshaw <crawshaw@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Tobias Klauser authored
Report the value returned by kevent, not the previously set errno which is 0. Found while debugging CL 198544 Change-Id: I854f5418f8ed8e083d909d328501355496c67a53 Reviewed-on: https://go-review.googlesource.com/c/go/+/202777 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Ian Lance Taylor authored
Since the new timers run on g0, which does not have a race context, we add a race context field to the P, and use that for timer functions. This works since all timer functions are in the standard library. Updates #27707 Change-Id: I8a5b727b4ddc8ca6fc60eb6d6f5e9819245e395b Reviewed-on: https://go-review.googlesource.com/c/go/+/171882 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
Ian Lance Taylor authored
Updates #27707 Change-Id: Id4b37594511895f404ee3c09a85263b2b35f835d Reviewed-on: https://go-review.googlesource.com/c/go/+/171881 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>
-
Ian Lance Taylor authored
Since timers are now on a P, rather than having a G running timerproc, timejump changes to return a P rather than a G. Updates #27707 Change-Id: I3d05af2d664409a0fd906e709fdecbbcbe00b9a7 Reviewed-on: https://go-review.googlesource.com/c/go/+/171880 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
-
Jason A. Donenfeld authored
It turns out that Windows has "legitimate" keys that have bogus type values or bogus lengths that don't correspond with their type. On up to date Windows 10 systems, this test always fails for this reason. So, this commit alters the test to simply log the discrepancy and move on. Fixes #35084 Change-Id: I56e12cc62aff49cfcc38ff01a19dfe53153976a0 Reviewed-on: https://go-review.googlesource.com/c/go/+/202678 Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
- 22 Oct, 2019 17 commits
-
-
Matthew Dempsky authored
It can still be manually disabled again using -d=checkptr=0. It's also still disabled by default for GOOS=windows, because the Windows standard library code has a lot of unsafe pointer conversions that need updating. Updates #34964. Change-Id: Ie0b8b4fdf9761565e0dcb00d69997ad896ac233d Reviewed-on: https://go-review.googlesource.com/c/go/+/201783 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Matthew Dempsky authored
This CL extends checkptrBase to recognize pointers into the stack and data/bss sections. I was meaning to do this eventually anyway, but it's also an easy way to workaround #35068. Updates #35068. Change-Id: Ib47f0aa800473a4fbc249da52ff03bec32c3ebe2 Reviewed-on: https://go-review.googlesource.com/c/go/+/202639 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com>
-
Ian Lance Taylor authored
Updates #27707 Change-Id: I51da8a04ec12ba1efa435e86e3a15d4d13c96c45 Reviewed-on: https://go-review.googlesource.com/c/go/+/171879 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
-
Ian Lance Taylor authored
Updates #27707 Change-Id: I1e65effb708911c727d126c51e0f50fe219f42ff Reviewed-on: https://go-review.googlesource.com/c/go/+/171878 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
-
Ian Lance Taylor authored
The adjusttimers function is where we check the adjustTimers field in the P struct to see if we need to resort the heap. We walk forward in the heap and find and resort timers that have been modified, until we find all the timers that were modified to run earlier. Along the way we remove deleted timers. Updates #27707 Change-Id: I1cba7fe77b8112b7e9a9dba80b5dfb08fcc7c568 Reviewed-on: https://go-review.googlesource.com/c/go/+/171877 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
-
Jay Conrod authored
Also, test that 'go mod download' without arguments reports an error. Fixes #32027 Change-Id: I873fc59fba4c78ee2b4f49f0d846ee2ac0eee4db Reviewed-on: https://go-review.googlesource.com/c/go/+/202697 Run-TryBot: Jay Conrod <jayconrod@google.com> Reviewed-by: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Ian Lance Taylor authored
Updates #27707 Change-Id: Idda31d0065064a81c570e291ef588d020871997d Reviewed-on: https://go-review.googlesource.com/c/go/+/171836 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
-
Ian Lance Taylor authored
Also add a skeleton of the runOneTimer function. Updates #27707 Change-Id: Ic6a0279354a57295f823093704b7e152ce5d769d Reviewed-on: https://go-review.googlesource.com/c/go/+/171835 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
-
Matthew Dempsky authored
They're still lacking in details, but at least better than being printed as raw interface values. Updates #22218. Change-Id: I4fd813253afdd6455c0c9b5a05c61659805abad1 Reviewed-on: https://go-review.googlesource.com/c/go/+/202677 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Ian Lance Taylor authored
The dodeltimer function removes a timer from a heap. The dodeltimer0 function removes the first timer from a heap; in the old timer code this common special case was inlined in the timerproc function. Updates #27707 Change-Id: I1b7c0af46866abb4bffa8aa4d8e7143f9ae8f402 Reviewed-on: https://go-review.googlesource.com/c/go/+/171834 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>
-
Ben Shi authored
Updates golang/go#30439 Change-Id: Iadc737e4c6bb05bb576fe4bb344ad92403697352 Reviewed-on: https://go-review.googlesource.com/c/go/+/201380 Run-TryBot: Ben Shi <powerman1st@163.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
Ian Lance Taylor authored
Updates #27707 Change-Id: I02f97ec7869ec8a3fb2dfc94cff246badc7ea0fa Reviewed-on: https://go-review.googlesource.com/c/go/+/171833 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
-
Jay Conrod authored
- Deleted dead code in gopkgin.go. - Minor documentation changes. Updates #34924 Change-Id: Ie2c744bbf6662cae20f09163200f20d7589fd237 Reviewed-on: https://go-review.googlesource.com/c/go/+/202565 Run-TryBot: Jay Conrod <jayconrod@google.com> Reviewed-by: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Jay Conrod authored
The -modcacherw flag is now registered in work.AddModCommonFlags, which is called from work.AddBuildFlags, where it was registered before. 'go mod' subcommands register the flag by calling work.AddModCommonFlags directly. Also, build commands now exit with an error if -modcacherw is set explicitly (not in GOFLAGS) in GOPATH mode. Updates #31481 Change-Id: I461e59a51ed31b006fff4d5c57c2a866be0bbf38 Reviewed-on: https://go-review.googlesource.com/c/go/+/202563 Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
-
Brad Fitzpatrick authored
Fixes #34978 Change-Id: I3baf1392ba7366ae6628889c47c343ef702ec438 Reviewed-on: https://go-review.googlesource.com/c/go/+/202078Reviewed-by: Bryan C. Mills <bcmills@google.com> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
smasher164 authored
CL 137156 introduces an intrinsic on AMD64 that executes vfmadd231sd when feature detection is successful. However, because floating-point isn't allowed in note handler, the builder disables SSE instructions, and fails when attempting to execute this instruction. This change disables FMA on plan9 to immediately use the software fallback. Fixes #35063. Change-Id: I87d8f0995bd2f15013d203e618938f5079c9eed2 Reviewed-on: https://go-review.googlesource.com/c/go/+/202617Reviewed-by: Keith Randall <khr@golang.org>
-
Ian Lance Taylor authored
This adds a new field to P, adjustTimers, that tells the P that one of its existing timers was modified to be earlier, and that it therefore needs to resort them. Updates #27707 Change-Id: I4c5f5b51ed116f1d898d3f87cdddfa1b552337f8 Reviewed-on: https://go-review.googlesource.com/c/go/+/171832 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
-