- 04 Sep, 2017 1 commit
-
-
Mark Pulford authored
Avoid counting nodes that don't generate code (eg, constants) against the inlining budget. Fixes #21749 Change-Id: I10fca073e64be7d304709ef33e125eb8c78d5e4d Reviewed-on: https://go-review.googlesource.com/61250Reviewed-by: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 03 Sep, 2017 4 commits
-
-
Matthew Dempsky authored
Fixes #21747. Change-Id: I6a68370be3b7510ce364ddd1e41a1d767ce3a67f Reviewed-on: https://go-review.googlesource.com/61311 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
-
Andrii Soldatenko authored
First sentence of https://golang.org/doc/effective_go.html#maps dot is missing. Change-Id: Ic93b407945a6ad24a73ae9f7b6076ac9619871db Reviewed-on: https://go-review.googlesource.com/61020Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
-
Keith Randall authored
Bad merge, missed changing to keyed literal structs. Bug introduced in CL 56252 Change-Id: I55cccff4990bd25e6387f6c90919ee5866900d7f Reviewed-on: https://go-review.googlesource.com/61290 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Martin Möhrmann <moehrmann@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Cholerae Hu authored
Do the similar thing to CL 55143 to reduce IMUL. Change-Id: I1bd38f618058e3cd74fac181f003610ea13f2294 Reviewed-on: https://go-review.googlesource.com/56252 Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
- 02 Sep, 2017 2 commits
-
-
Mark Pulford authored
This function avoids subtle faults found in many ad-hoc implementations, and is simple enough to be inlined by the compiler. Fixes #20100 Change-Id: Ib320254e9b1f1f798c6ef906b116f63bc29e8d08 Reviewed-on: https://go-review.googlesource.com/43652Reviewed-by: Robert Griesemer <gri@golang.org>
-
Keith Randall authored
overLoadFactor wasn't really doing what it says it does. It was reporting overOrEqualToLoadFactor. That's actually what we want when adding an entry to a map, but it isn't what we want when constructing a map in the first place. The impetus for this change is that if you make a map with a hint of exactly 8 (which happens, for example, with the unitMap in time/format.go), we allocate 2 buckets for it instead of 1. Instead, make overLoadFactor really report when it is > the max allowed load factor, not >=. Adjust the callers who want to ensure that the map is no more than the max load factor after an insertion by adding a +1 to the current (pre-addition) size. Change-Id: Ie8d85344800a9a870036b637b1031ddd9e4b93f9 Reviewed-on: https://go-review.googlesource.com/61053 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Martin Möhrmann <moehrmann@google.com>
-
- 01 Sep, 2017 10 commits
-
-
Guilherme Garnier authored
Change-Id: Ia557771272a8ef3602f0281b8c89d2cfe146c8b3 Reviewed-on: https://go-review.googlesource.com/60470Reviewed-by: Adrian Hesketh <adrianhesketh@hushmail.com> Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com> Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Ilya Tocar authored
Currently we only use 1 and 4 as a scale for indexed 4-byte load. In code generated in #20711 we can use indexed load with scale=8, to improve performance: name old time/op new time/op delta GM-6 108µs ± 0% 95µs ± 0% -12.06% (p=0.000 n=10+10) So add new ops and combine loadidx1(shift 3..).. into loadidx8, same for stores. Change-Id: I5ed1c250ac40960e20606580cf9de221e75b72f1 Reviewed-on: https://go-review.googlesource.com/46134 Run-TryBot: Ilya Tocar <ilya.tocar@intel.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
David Crawshaw authored
When compiling a plugin, package main gets a new name so as not to conflict with the main package in the host binary, or any other plugins. It is already defined by cmd/go, and used by cmd/link when filling out the "" package placeholder in symbols. With this CL, the plugin-specific name for main is also passed to cmd/compile's -p flag. This is used to fill out the pkgpath field of types, and ensures that two types defined in two different plugin mains with the same name will not be mistaken for one another at runtime. Fixes #21386 Change-Id: I8a646d8d7451caff533fe0007343ea8b8e1704ed Reviewed-on: https://go-review.googlesource.com/60910 Run-TryBot: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
griesemer authored
The spec is not conclusive about whether a non-constant shift of certain untyped constant left operands is valid when the shift expression appears as an index in an index or slice expression, or as a size in a `make` function call. Despite identical spec rules in all these cases, cmd/compile accepts make([]byte, 1.0 << s) but pronounces an error for a[1.0 << s] (go/types accepts both). This change clarifies the spec by explicitly stating that an untyped constant left operand in a non-constant shift (1.0 in the above examples) will be given type `int` in these contexts. A separate issue #21693 addresses the cmd/compile bug. Fixes #14844. Change-Id: I4b52125e487a607fae377fcbed55463cdce9836c Reviewed-on: https://go-review.googlesource.com/60230Reviewed-by: Russ Cox <rsc@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Tobias Klauser authored
Extract device major/minor number on Darwin and set Devmajor and Devminor in FileInfoHeader. Code based on the Major/Minor functions for Darwin in golang.org/x/sys/unix. Change-Id: I51b65f607bfa2e6b177b8b66e2b246b771367b84 Reviewed-on: https://go-review.googlesource.com/60850Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com> Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
griesemer authored
Packages of dot imports don't appear in the Info.Implicits map since they are already taken care of by the Info.Defs map. Fix documentation. Implicitly dot-imported objects of a package shouldn't appear in the Info.Implicits map because the documentation never said so and there's no way to map multiple objects to the same *ast.ImportSpec with the current data structure. Added missing test for Info.Implicits. The fix is a trivial one-line deletion, the rest is documentation and test. Fixes #21591. Change-Id: I12a37dab85c531911c9363ec3d58daa095c7eb24 Reviewed-on: https://go-review.googlesource.com/60672Reviewed-by: Alan Donovan <adonovan@google.com>
-
Rob Pike authored
The "build flags" mentioned in the documentation are only those that apply to analyzing packages and executing the tool. Fixes #21711. Change-Id: Ie7b2a354f1e30c928b40888c51fc68e599a5444a Reviewed-on: https://go-review.googlesource.com/60830Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Hiroshi Ioka authored
The approach of https://golang.org/cl/43476 turned out incorrect. The problem is that the sniff introduced by the CL only work for simple expression. And when it fails it fallback to uint64, not int64, which breaks backward compatibility. In this CL, we use DWARF for guessing kind instead. That should be more reliable than previous approach. And importanly, it fallbacks to int64 even if it fails to guess kind. Fixes #21708 Change-Id: I39a18cb2efbe4faa9becdcf53d5ac68dba180d46 Reviewed-on: https://go-review.googlesource.com/60510 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Joel Sing authored
On OpenBSD -current, clang is available/installed as 'cc'. This means that the existing clang check fails and the clang related flags are not enabled. Fix this by enabling the clang flags if the compiler claims to support them. Change-Id: I84d124d2409a10f87002c6cbfdb69b4c9a55981a Reviewed-on: https://go-review.googlesource.com/60750Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Filippo Valsorda authored
Change-Id: Iebb5b67c8defec22edd482d587edaf399a7ba82a Reviewed-on: https://go-review.googlesource.com/37418Reviewed-by: Adam Langley <agl@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
- 31 Aug, 2017 14 commits
-
-
Matthew Dempsky authored
Fixes test regression introduced by golang.org/cl/53071. Change-Id: Ibb085cf6d6be7b91b7c90b7bc6237c10f3097703 Reviewed-on: https://go-review.googlesource.com/60775 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Matthew Dempsky authored
Appease the vet builder until we figure out the ideal solution. Updates #21716. Change-Id: I64ecdf9b6efb0933c5c79e11c860966ff1980305 Reviewed-on: https://go-review.googlesource.com/60776 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Heschi Kreinick authored
Simplify the DWARF representation of structs by emitting field offsets as constants rather than location descriptions. This was not explicitly mentioned as an option in DWARF2. It is mentioned in DWARF4, but isn't listed in the changes, so it's not clear if this was always intended to work or is an undocumented change. Either way, it should be valid DWARF4. Change-Id: Idf7fdd397a21c8f8745673ecc77ef65afa3ffe1c Reviewed-on: https://go-review.googlesource.com/51611 Run-TryBot: Heschi Kreinick <heschi@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: David Chase <drchase@google.com>
-
Bryan C. Mills authored
When we added a Stat call to determine the initial buffer size in https://golang.org/cl/163069, we included an arbitrary 1e9-byte limit "just in case". That interacts badly with power-of-2 resizing in *bytes.Buffer: it causes buffers reading from very large files to consume up to twice the necessary space. The documentation for (os.FileInfo).Size says that it reports "length in bytes for regular files; system-dependent for others", but the "system dependent" cases overwhelmingly return either a small number (e.g., the length of the target path for a symlink) or a non-positive number (e.g., for a file in /proc under Linux). It should be appropriate to use the number reported by Size as an approximate lower bound, even if it is large. fixes #21455 Change-Id: I609c72519b7b87428c24d0b22db46eede30e0e54 Reviewed-on: https://go-review.googlesource.com/55870Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Sam Whited authored
Since these are type aliases in Go 1.9 make rewriting golang.org/x/net/context imports to context the default. Change-Id: Ib7ee58b59ea5463b92e1590c8b8f5c0ef87d310b Reviewed-on: https://go-review.googlesource.com/58590Reviewed-by: Sameer Ajmani <sameer@golang.org> Run-TryBot: Sam Whited <sam@samwhited.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Francesc Campoy Flores authored
Fixes #19511 Change-Id: I5585726773b822dba0be0196961132323ebbe084 Reviewed-on: https://go-review.googlesource.com/53071Reviewed-by: Chris Broadfoot <cbro@golang.org>
-
Kunpei Sakai authored
Fixes #20933 Change-Id: I827c8d265674a7448c51c1da991e9b3b4501ba11 Reviewed-on: https://go-review.googlesource.com/59850 Run-TryBot: Tom Bergan <tombergan@google.com> Reviewed-by: Tom Bergan <tombergan@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Ben Shi authored
Add support of more ARM VFP instructions in the assembler. They were introduced in ARM VFPv2. "NMULF/NMULD Fm, Fn, Fd": Fd = -Fn*Fm "MULAF/MULAD Fm, Fn, Fd": Fd = Fd + Fn*Fm "NMULAF/NMULAD Fm, Fn, Fd": Fd = -(Fd + Fn*Fm) "MULSF/MULSD Fm, Fn, Fd": Fd = Fd - Fn*Fm "NMULSF/NMULSD Fm, Fn, Fd": Fd = -(Fd - Fn*Fm) Change-Id: Icd302676ca44a9f5f153fce734225299403c4163 Reviewed-on: https://go-review.googlesource.com/60170Reviewed-by: Cherry Zhang <cherryyz@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
griesemer authored
Change-Id: Id003e2dbecad7b3c249a747f8b4032135dfbe34f Reviewed-on: https://go-review.googlesource.com/60670Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
-
griesemer authored
This makes sure that the go/types package still builds even if the hilbert test generated its test file in the go/types package (when run as: go test -run Hilbert -out=h.go). Change-Id: I60ecbaaa1537de14cfa95e2e6fc8ebedff651baf Reviewed-on: https://go-review.googlesource.com/60531Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
-
Joe Tsai authored
Some constants were added to flate that seem to be an experimental attempt at increasing the window size. However, according to RFC1951, the largest window size is 32KiB, so these constants are non-standard. Delete them. Fixes #18458 Change-Id: Ia94989637ca031a56bce2548624fa48044caa7b9 Reviewed-on: https://go-review.googlesource.com/60490 Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Kenji Yano authored
This change added support "end of central directory record comemnt" to the Writer. There is a new exported field Writer.Comment in this change. If invalid size of comment was set, Close returns error without closing resources. Fixes #21634 Change-Id: Ifb62bc6c7f81b9257ac83eb570ad9915de727f8c Reviewed-on: https://go-review.googlesource.com/59310Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com> Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Cherry Zhang authored
Normal shift rules plus constant folding are enough to generate efficient shift-by-constant instructions. Add test to make sure we don't generate comparisons for constant shifts. TODO: there are still constant shift rules on PPC64. If they are removed, the constant folding rules are not enough to remove all the test and mask stuff for constant shifts. Leave them in for now. Fixes #20663. Change-Id: I724cc324aa8607762d0c8aacf9bfa641bda5c2a1 Reviewed-on: https://go-review.googlesource.com/60330 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
Johnny Luo authored
Fixes #20054 Change-Id: I3c660ca0c56cdde2c2ac2f6a666d8531ab5588c5 Reviewed-on: https://go-review.googlesource.com/49050 Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
-
- 30 Aug, 2017 9 commits
-
-
Chris Ball authored
Matches other architectures by using names for syscalls instead of numbers directly. Fixes #20499. Change-Id: I63d606b0b1fe6fb517fd994a7542a3f38d80dd54 Reviewed-on: https://go-review.googlesource.com/44213 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Carlos Eduardo Seo authored
Between go1.7 and go1.8, a performance regression was introduced in some of the BenchmarkCompareBytes benchmarks. Go1.7 vs Go1.8: BenchmarkCompareBytesToNil-8 7.44 8.44 +13.44% BenchmarkCompareBytesIdentical-8 6.96 11.5 +65.23% BenchmarkCompareBytesBigIdentical-8 6.65 47112 +708351.13% This change fixes the problem by optimizing the case where the byte slices being compared are equal: Go1.9 vs current: BenchmarkCompareBytesToNil-8 7.35 7.00 -4.76% BenchmarkCompareBytesIdentical-8 11.4 6.81 -40.26% BenchmarkCompareBytesBigIdentical-8 48396 9.26 -99.98% runtime.cmpstring can benefit from the same approach and is also changed. Change-Id: I3cb25f59d8b940a83a2cf687eea764cfeff90688 Reviewed-on: https://go-review.googlesource.com/59650 Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
-
Hiroshi Ioka authored
Currently, cgo supports only macros which can be reduced to constants or variables. The CL addresses remaining parts, macros which can be represented as niladic functions. The basic idea is simple: 1. make a thin wrapper function per macros. 2. replace macro expansions with function calls. Fixes #10715 Fixes #18720 Change-Id: I150b4fb48e9dc4cc34466ef6417c04ac93d4bc1a Reviewed-on: https://go-review.googlesource.com/43970 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Joe Tsai authored
Use "file" consistently instead of "entry". Change-Id: Ia81c9665d0d956adb78f7fa49de40cdb87fba000 Reviewed-on: https://go-review.googlesource.com/60150Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Joe Tsai authored
Nearly every Header obtained from FileInfoHeader via the FS has timestamps with sub-second resolution and the AccessTime and ChangeTime fields populated. This forces the PAX format to almost always be used, which has the following problems: * PAX is still not as widely supported compared to USTAR * The PAX headers will occupy at minimum 1KiB for every entry The old behavior of tar Writer had no support for sub-second resolution nor any support for AccessTime or ChangeTime, so had neither problem. Instead the Writer would just truncate sub-second information and ignore the AccessTime and ChangeTime fields. In this CL, we preserve the behavior such that the *default* behavior would output a USTAR header for most cases by truncating sub-second time measurements and ignoring AccessTime and ChangeTime. To use either of the features, users will need to explicitly specify that the format is PAX or GNU. The exact policy chosen is this: * USTAR and GNU may still be chosen even if sub-second measurements are present; they simply truncate the timestamp to the nearest second. As before, PAX uses sub-second resolutions. * If the Format is unspecified, then WriteHeader ignores AccessTime and ChangeTime when using the USTAR format. This ensures that USTAR may still be chosen for a vast majority of file entries obtained through FileInfoHeader. Updates #11171 Updates #17876 Change-Id: Icc5274d4245922924498fd79b8d3ae94d5717271 Reviewed-on: https://go-review.googlesource.com/59230 Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Marvin Stenger authored
This change implements the convention for generated code header agreed upon in https://golang.org/s/generatedcode. Additionally run go generate. Also update some comments. Updates #13560 Change-Id: If45f91b93aaa0d43280c2c4630823bc4d2dc7d3a Reviewed-on: https://go-review.googlesource.com/60250 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Michael Stapelberg authored
Previously, the suggested code would result in the following golint warning: “should drop = 0 from declaration of var errorsOnlyKey; it is the zero value” Change-Id: I1a302c1e40ca89acbc76897e39097ecd04865460 Reviewed-on: https://go-review.googlesource.com/60290Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Ilya Tocar authored
Some instructions operating on <= 32 bits also zero out upper 32bits. Remove zeroextensions of such values. Triggers a few times during all.bash. Also removes ugly code like: MOVL CX,CX Change-Id: I66a46c190dd6929b7e3c52f3fe6b967768d00638 Reviewed-on: https://go-review.googlesource.com/58090 Run-TryBot: Ilya Tocar <ilya.tocar@intel.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
griesemer authored
The last sentence in the section on slice expressions could be read as if it might apply to strings. Changed the sentence a bit to emphasize its applicability to slices only. See also the issue for more background. Fixes #19220. Change-Id: I8551f34230e4ed93f951e7b871cc81f54a5874a9 Reviewed-on: https://go-review.googlesource.com/59890Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-