- 02 Nov, 2017 27 commits
-
-
Joe Tsai authored
Usage of atomic.Value has a subtle requirement that the value be of the same concrete type. In prior usage, the intention was to consistently store a value of the error type. Since error is an interface, the underlying concrete can differ. Fix this by creating a type-safe abstraction over atomic.Value that wraps errors in a struct{error} type to ensure consistent types. Change-Id: Ica74f2daba15e4cff48d2b4f830d2cb51c608fb6 Reviewed-on: https://go-review.googlesource.com/75594 Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
mattyw authored
The existing implementation names a c net.Conn return which is never user. Leaving the returns unamed is marginally clearer. Change-Id: If9a411c9235b78c116a8ffb21fef71f7a4a4ce8f Reviewed-on: https://go-review.googlesource.com/66890Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Brad Fitzpatrick authored
Updates #22540 Change-Id: I63e8c4874f8a774e9c47affc856aadf8c35ca23b Reviewed-on: https://go-review.googlesource.com/75593 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Tom Bergan <tombergan@google.com>
-
Michael Munday authored
Prior to this CL loads with sign extension could not be replaced with indexed loads (only loads with zero extension). This CL also prevents large offsets (more than 20-bits) from being merged into indexed loads. It is better to keep such offsets separate. Gives a small improvement in binary size, ~1.5KB from .text in cmd/go. Change-Id: Ib848ffc2b05de6660c5ce2394ae1d1d144273e29 Reviewed-on: https://go-review.googlesource.com/36845 Run-TryBot: Michael Munday <mike.munday@ibm.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
Daniel Martí authored
These are likely from the time when gc was written in C. There is no need for any of these to be passed pointers, as the previous values are not kept in any way, and the pointers are never nil. Others were left untouched as they fell into one of these useful cases. While at it, also turn some 0/1 integers into booleans. Passes toolstash -cmp on std cmd. Change-Id: Id3a9c9e84ef89536c4dc69a7fdbacd0fd7a76a9b Reviewed-on: https://go-review.googlesource.com/72990 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Ilya Tocar authored
Replace calls to memmove with known (constant) size, with OpMove. Do it only if it is safe from aliasing point of view. Helps with code like this: append(buf,"const str"...) In strconv this provides nice benefit: Quote-6 731ns ± 2% 647ns ± 3% -11.41% (p=0.000 n=10+10) QuoteRune-6 117ns ± 5% 111ns ± 1% -4.54% (p=0.000 n=10+10) AppendQuote-6 475ns ± 0% 396ns ± 0% -16.59% (p=0.000 n=9+10) AppendQuoteRune-6 32.0ns ± 0% 27.4ns ± 0% -14.41% (p=0.000 n=8+9) Change-Id: I7704f5c51b46aed2d8f033de74c75140fc35036c Reviewed-on: https://go-review.googlesource.com/54394 Run-TryBot: Ilya Tocar <ilya.tocar@intel.com> Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Brad Fitzpatrick authored
Updates #22540 Change-Id: I26e79c25652976fac6f2e5a7afb4fd1240996d74 Reviewed-on: https://go-review.googlesource.com/75531Reviewed-by: Tom Bergan <tombergan@google.com> Run-TryBot: Tom Bergan <tombergan@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Joe Tsai authored
To improve readability when exported fields are removed, forbid the printer from emitting an empty line before the first comment in a const, var, or type block. Also, when printing the "Has filtered or unexported fields." message, add an empty line before it to separate the message from the struct or interfact contents. Before the change: <<< type NamedArg struct { // Name is the name of the parameter placeholder. // // If empty, the ordinal position in the argument list will be // used. // // Name must omit any symbol prefix. Name string // Value is the value of the parameter. // It may be assigned the same value types as the query // arguments. Value interface{} // contains filtered or unexported fields } > > After the change: > <<< > type NamedArg struct { > // Name is the name of the parameter placeholder. > // > // If empty, the ordinal position in the argument list will be > // used. > // > // Name must omit any symbol prefix. > Name string > > // Value is the value of the parameter. > // It may be assigned the same value types as the query > // arguments. > Value interface{} > > // contains filtered or unexported fields > } Fixes #18264 Change-Id: I9fe17ca39cf92fcdfea55064bd2eaa784ce48c88 Reviewed-on: https://go-review.googlesource.com/71990 Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
-
Martin Möhrmann authored
* Avoid calculating insertk until needed. * Avoid a pointer into b.tophash and just track the insertion index. This avoids b.tophash being marked as escaping to heap. * Calculate val only once at the end of the mapassign functions. Function sizes decrease slightly, e.g. for mapassign_faststr: before "".mapassign_faststr STEXT size=1166 args=0x28 locals=0x78 after "".mapassign_faststr STEXT size=1080 args=0x28 locals=0x68 name old time/op new time/op delta MapAssign/Int32/256-4 19.4ns ± 4% 19.5ns ±11% ~ (p=0.973 n=20+20) MapAssign/Int32/65536-4 32.5ns ± 2% 32.4ns ± 3% ~ (p=0.078 n=20+19) MapAssign/Int64/256-4 20.3ns ± 6% 17.6ns ± 5% -13.01% (p=0.000 n=20+20) MapAssign/Int64/65536-4 33.3ns ± 2% 33.3ns ± 1% ~ (p=0.444 n=20+20) MapAssign/Str/256-4 22.3ns ± 3% 22.4ns ± 3% ~ (p=0.343 n=20+20) MapAssign/Str/65536-4 44.9ns ± 1% 43.9ns ± 1% -2.39% (p=0.000 n=20+19) Change-Id: I2627bb8a961d366d9473b5922fa129176319eb22 Reviewed-on: https://go-review.googlesource.com/74870 Run-TryBot: Martin Möhrmann <moehrmann@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
Ilya Tocar authored
We already do this for floor/ceil, but RoundToEven was added later. Intrinsify it also. name old time/op new time/op delta RoundToEven-8 3.00ns ± 1% 0.68ns ± 2% -77.34% (p=0.000 n=10+10) Change-Id: Ib158cbceb436c6725b2d9353a526c5c4be19bcad Reviewed-on: https://go-review.googlesource.com/74852 Run-TryBot: Ilya Tocar <ilya.tocar@intel.com> Reviewed-by: Keith Randall <khr@golang.org>
-
Brad Fitzpatrick authored
Fixes #21343 Change-Id: I3582fced902592fe12bfa29acf7b40b6e5e554a7 Reviewed-on: https://go-review.googlesource.com/75150 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
-
Kenny Grant authored
The comment on invalid time values in Constants and example refers to _ zero padding when it should refer to space padding. Change-Id: I5784356e389d324703e20eec6203f147db92880f Reviewed-on: https://go-review.googlesource.com/75410Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Tobias Klauser authored
The ztypes_windows* file names indicate that these are auto-generated but they aren't. Rename them to types_windows* to avoid this confusion. This follows CL 52950 which did the same for golang.org/x/sys. Change-Id: Ia557ec5d4bcfb6bae20e34e71b5f3f190285794f Reviewed-on: https://go-review.googlesource.com/75390 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Marcel van Lohuizen authored
The only file that really changed is x/net/idna (upstream 8253218a). See CL 73730: avoid memory leak in validation codes The rest is just a small change in the generation line at the top. Change-Id: I62c5172f77f63d919c41d11c6db0a9517bc2a221 Reviewed-on: https://go-review.googlesource.com/74953Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Martin Möhrmann authored
Handle make(map[any]any) and make(map[any]any, hint) where hint <= BUCKETSIZE special to allow for faster map initialization and to improve binary size by using runtime calls with fewer arguments. Given hint is smaller or equal to BUCKETSIZE in which case overLoadFactor(hint, 0) is false and no buckets would be allocated by makemap: * If hmap needs to be allocated on the stack then only hmap's hash0 field needs to be initialized and no call to makemap is needed. * If hmap needs to be allocated on the heap then a new special makehmap function will allocate hmap and intialize hmap's hash0 field. Reduces size of the godoc by ~36kb. AMD64 name old time/op new time/op delta NewEmptyMap 16.6ns ± 2% 5.5ns ± 2% -66.72% (p=0.000 n=10+10) NewSmallMap 64.8ns ± 1% 56.5ns ± 1% -12.75% (p=0.000 n=9+10) Updates #6853 Change-Id: I624e90da6775afaa061178e95db8aca674f44e9b Reviewed-on: https://go-review.googlesource.com/61190 Run-TryBot: Martin Möhrmann <moehrmann@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
isharipo authored
Current AllowedOpCodes is 1024, which is not enough for modern x86. Changed limit to 2048 (though AVX512 will exceed this). Additional Z-cases and ytab tables are added to make it possible to handle missing AVX1 and AVX2 instructions. This CL is required by x86avxgen to work properly: https://go-review.googlesource.com/c/arch/+/66972 Change-Id: I290214bbda554d2cba53349f50dcd34014fe4cee Reviewed-on: https://go-review.googlesource.com/70650 Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ilya Tocar <ilya.tocar@intel.com>
-
Ilya Tocar authored
Add support for ADX cpuid bit detection and all instructions, implied by that bit (ADOX/ADCX). They are useful for rsa and math/big in general. Change-Id: Idaa93303ead48fd18b9b3da09b3e79de2f7e2193 Reviewed-on: https://go-review.googlesource.com/74850 Run-TryBot: Ilya Tocar <ilya.tocar@intel.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
-
Cherry Zhang authored
Change-Id: Ifa7701e97c0ec7d113e952b2b366edf422d6df2f Reviewed-on: https://go-review.googlesource.com/69351 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Lynn Boger authored
This change adds an asm implementations modf for ppc64x. Improvements: BenchmarkModf-16 7.48 6.26 -16.31% Updates: #21390 Change-Id: I9c4f3213688e3e8842d050840dc04fc9c0bf6ce4 Reviewed-on: https://go-review.googlesource.com/74411 Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Michael Munday <mike.munday@ibm.com>
-
Blixt authored
The comment currently implies that a zero will be added, but the underscore is used to add a space for single-digit dates. Change-Id: Ib3bac8a16bc2d1fcb26ab3bb7ad172b89e1a4a24 Reviewed-on: https://go-review.googlesource.com/75230Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Tobias Klauser authored
Since CL 33071, testCPUProfile is only one user of the badOS map. Replace it by the corresponding switch, with the "plan9" case removed because it is already checked earlier in the same function. Change-Id: Id647b8ee1fd37516bb702b35b3c9296a4f56b61b Reviewed-on: https://go-review.googlesource.com/75110 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Russ Cox authored
If GODEBUG=gocacheverify=1, then instead of using the cache to avoid computations, the go command will do the computations and double-check that they match any existing cache entries. This is handled entirely in the cache implementation; there's no complexity added to any of the cache usage sites. (As of this CL there aren't any cache usage sites, but soon there will be.) Also change GOCMDDEBUGHASH to the more usual GODEBUG=gocachehash=1. Change-Id: I574f181e06b5299b1d9c6d402e40c57a0e064e74 Reviewed-on: https://go-review.googlesource.com/75294 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org>
-
Russ Cox authored
This lets users see the effective GOCACHE setting. Change-Id: I0b6dd2945d54611be89ed68fe2fd99110b9a25f6 Reviewed-on: https://go-review.googlesource.com/75293Reviewed-by: David Crawshaw <crawshaw@golang.org>
-
Russ Cox authored
These are convenience function for small cached items. Change-Id: Iba92b7826a9fd6979e627687f2ce72d4b4799385 Reviewed-on: https://go-review.googlesource.com/75292Reviewed-by: David Crawshaw <crawshaw@golang.org>
-
Russ Cox authored
Use a build cache separate from the default user cache, one that will be wiped out during startup, so that make.bash continues to start from a clean slate. Change-Id: I38733991015c66efb89fc170c71701b1dd9de28d Reviewed-on: https://go-review.googlesource.com/75291 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org>
-
Russ Cox authored
This makes ImportDir("$GOROOT/src/math", 0) and Import("math", "", 0) equivalent. It was an oversight that they were not before. An upcoming change to the go command relies on the two returning the same results. Change-Id: I187da4830fae85f8dde673c22836ff2da6801047 Reviewed-on: https://go-review.googlesource.com/75290 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org>
-
Russ Cox authored
The cache is stored in $GOCACHE, which is printed by go env and defaults to a subdirectory named "go-build" in the standard user cache directory for the host operating system. This CL only implements the cache. Future CLs will store data in it. Change-Id: I0b4965a9e50f852e17e44ec3d6dafe05b58f0d22 Reviewed-on: https://go-review.googlesource.com/68116 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org>
-
- 01 Nov, 2017 13 commits
-
-
griesemer authored
At the end of type-checking a function or closure, unused local variables are reported by looking at all variables in the function scope and its nested children scopes. If a nested scope belonged to a nested function (closure), that scope would be searched twice, leading to multiple error messages for unused variables. This CL introduces an internal-only marker to identify function scopes so that they can be ignored where needed. Fixes #22524. Change-Id: If58cc17b2f0615a16f33ea262f50dffd0e86d0f0 Reviewed-on: https://go-review.googlesource.com/75251Reviewed-by: Alan Donovan <adonovan@google.com>
-
Evan Jones authored
Mac OS X 10.13 introduced APFS which stores nanosecond resolution timestamps. The implementation of os.Stat already returns full resolution timestamps, but os.Chtimes only sets timestamps with microsecond resolution. Fix this by using setattrlist on Darwin, which takes a struct timeval with nanosecond resolution. This is what Mac OS X 10.13 appears uses to implement utimensat, according to dtruss. Fixes #22528 Change-Id: I397dabef6b2b73a081382999aa4c4405ab8c6015 Reviewed-on: https://go-review.googlesource.com/74952 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Ian Lance Taylor authored
Updates #21322 Change-Id: Ib03ee9dbe1b44c2fecd51f2f2c23a88482158e7e Reviewed-on: https://go-review.googlesource.com/75250Reviewed-by: Rob Pike <r@golang.org>
-
Tom Bergan authored
Updates http2 to x/net/http2 git rev c73622c77280 http2: always delay closing the connection after sending GOAWAY https://golang.org/cl/71372 http2: Discard data reads on HEAD requests https://golang.org/cl/72551 Fixes #18701 Fixes #22376 Change-Id: I2460cec64848992fff21790868b5fb8c91f050f2 Reviewed-on: https://go-review.googlesource.com/75210 Run-TryBot: Tom Bergan <tombergan@google.com> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Tim Cooper authored
The marshal method allows the hash's internal state to be serialized and unmarshaled at a later time, without having the re-write the entire stream of data that was already written to the hash. Fixes #20573 Change-Id: I40bbb84702ac4b7c5662f99bf943cdf4081203e5 Reviewed-on: https://go-review.googlesource.com/66710Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Leigh McCulloch authored
Whitespace is ignored in bool values and attrs. It is convenient and relatively safe since whitespace around a bool value is often unimportant. The same logic can be applied to numeric values of types int, uint, and float. Fixes #22146 Change-Id: Ie0462def90304af144b8e2e72d85b644857c27cc Reviewed-on: https://go-review.googlesource.com/73891Reviewed-by: Sam Whited <sam@samwhited.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Sam Whited <sam@samwhited.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Leigh McCulloch authored
Whitespace is ignored in bool values and attrs, but there are no tests capturing this behavior. Change-Id: I7a7249de4886f510869e91de937e69b83c3254c8 Reviewed-on: https://go-review.googlesource.com/73890Reviewed-by: Sam Whited <sam@samwhited.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Sam Whited <sam@samwhited.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Mikio Hara authored
Also replaces verbs for error message from %s to %v. In general, low level IO APIs return an error value containing non-string types and there's no guarantee that all the types implement fmt.Stringer interface. Change-Id: I8a6e2a80d5c721c772a83b9556bac16556eaa771 Reviewed-on: https://go-review.googlesource.com/73931 Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Mikio Hara authored
Change-Id: Ibae06adcc69cae34cb0a14d990a0949b77fa772c Reviewed-on: https://go-review.googlesource.com/73930 Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Dmitri Shuralyov authored
In CL 50510, the Content-Type header started to be set in Redirect when request method is GET. (Prior to that, it wasn't set at all, which is what said CL was fixing.) However, according to HTTP specification, the expected response for a HEAD request is identical to that of a GET request, but without the response body. This CL updates the behavior to set the Content-Type header for HEAD method in addition to GET. This actually allows a simpler implementation than before. This change largely reverts CL 50510, and applies the simpler implementation. Add a test for Content-Type header and body for GET, HEAD requests. Updates CL 50510. Change-Id: If33ea3f4bbc5246bb5dc751458004828cfe681b9 Reviewed-on: https://go-review.googlesource.com/65190 Run-TryBot: Dmitri Shuralyov <shurcool@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> Reviewed-by: Tom Bergan <tombergan@google.com>
-
Radek Sohlich authored
It is easy to miss the documentation information that no arguments in the Notify function means that the Notify will catch all possible signals. So the example was added with explicit comment above the Notify usage. Fixes #22257 Change-Id: Ia6a16dd4a419f7c77d89020ca5db85979b5b474e Reviewed-on: https://go-review.googlesource.com/74730 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Cherry Zhang authored
The counter part, writeInt in cmd/internal/obj, writes int64s. So the reader side should also read int64s. This may cause a larger range of values being accepted, some of which should not be that large. This is probably ok: for example, for size/index/length, the very large value (due to corruption) may be well past the end and causes other errors. And we did not do much bound check anyway. One exmaple where this matters is ARM32's object file. For one type of relocation it encodes the instruction into Reloc.Add field (which itself may be problematic and worth fix) and the instruction encoding overflows int32, causing ARM32 object file being rejected by goobj (and so objdump and nm) before. Unskip ARM32 object file tests in goobj, nm, and objdump. Updates #19811. Change-Id: Ia46c2b68df5f1c5204d6509ceab6416ad6372315 Reviewed-on: https://go-review.googlesource.com/69010 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
-
griesemer authored
Fixes #22473. Change-Id: Ie886dfc8b5510970d6d63ca6472c73325f6f2276 Reviewed-on: https://go-review.googlesource.com/74971 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Martin Möhrmann <moehrmann@google.com>
-