- 17 Apr, 2015 25 commits
-
-
Rob Pike authored
Fix some out-of-date remarks. Fixes #10489. Change-Id: I8f0cce2588828052a5d013e7bac6bcfeb220579d Reviewed-on: https://go-review.googlesource.com/9008Reviewed-by:
Russ Cox <rsc@golang.org>
-
Rob Pike authored
Also use os.Expand for variable substitution so ${x}y works. Fixes #9960. Change-Id: Ic8239b2e737d1f41910dde8ee9524ac48907cb03 Reviewed-on: https://go-review.googlesource.com/9007Reviewed-by:
Russ Cox <rsc@golang.org>
-
Josh Bleecher Snyder authored
Use SETcc instructions instead of Jcc to generate boolean values. This generates shorter, jump-free code, which may in turn enable other peephole optimizations. For example, given func f(i, j int) bool { return i == j } Before "".f t=1 size=32 value=0 args=0x18 locals=0x0 0x0000 00000 (x.go:3) TEXT "".f(SB), $0-24 0x0000 00000 (x.go:3) FUNCDATA $0, gclocals·b4c25e9b09fd0cf9bb429dcefe91c353(SB) 0x0000 00000 (x.go:3) FUNCDATA $1, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB) 0x0000 00000 (x.go:4) MOVQ "".i+8(FP), BX 0x0005 00005 (x.go:4) MOVQ "".j+16(FP), BP 0x000a 00010 (x.go:4) CMPQ BX, BP 0x000d 00013 (x.go:4) JEQ 21 0x000f 00015 (x.go:4) MOVB $0, "".~r2+24(FP) 0x0014 00020 (x.go:4) RET 0x0015 00021 (x.go:4) MOVB $1, "".~r2+24(FP) 0x001a 00026 (x.go:4) JMP 20 After "".f t=1 size=32 value=0 args=0x18 locals=0x0 0x0000 00000 (x.go:3) TEXT "".f(SB), $0-24 0x0000 00000 (x.go:3) FUNCDATA $0, gclocals·b4c25e9b09fd0cf9bb429dcefe91c353(SB) 0x0000 00000 (x.go:3) FUNCDATA $1, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB) 0x0000 00000 (x.go:4) MOVQ "".i+8(FP), BX 0x0005 00005 (x.go:4) MOVQ "".j+16(FP), BP 0x000a 00010 (x.go:4) CMPQ BX, BP 0x000d 00013 (x.go:4) SETEQ "".~r2+24(FP) 0x0012 00018 (x.go:4) RET regexp benchmarks, best of 12 runs: benchmark old ns/op new ns/op delta BenchmarkNotOnePassShortB 782 733 -6.27% BenchmarkLiteral 180 171 -5.00% BenchmarkNotLiteral 2855 2721 -4.69% BenchmarkMatchHard_32 2672 2557 -4.30% BenchmarkMatchHard_1K 80182 76732 -4.30% BenchmarkMatchEasy1_32M 76440180 73304748 -4.10% BenchmarkMatchEasy1_32K 68798 66350 -3.56% BenchmarkAnchoredLongMatch 482 465 -3.53% BenchmarkMatchEasy1_1M 2373042 2292692 -3.39% BenchmarkReplaceAll 2776 2690 -3.10% BenchmarkNotOnePassShortA 1397 1360 -2.65% BenchmarkMatchClass_InRange 3842 3742 -2.60% BenchmarkMatchEasy0_32 125 122 -2.40% BenchmarkMatchEasy0_32K 11414 11164 -2.19% BenchmarkMatchEasy0_1K 668 654 -2.10% BenchmarkAnchoredShortMatch 260 255 -1.92% BenchmarkAnchoredLiteralShortNonMatch 164 161 -1.83% BenchmarkOnePassShortB 623 612 -1.77% BenchmarkOnePassShortA 801 788 -1.62% BenchmarkMatchClass 4094 4033 -1.49% BenchmarkMatchEasy0_32M 14078800 13890704 -1.34% BenchmarkMatchHard_32K 4095844 4045820 -1.22% BenchmarkMatchEasy1_1K 1663 1643 -1.20% BenchmarkMatchHard_1M 131261708 129708215 -1.18% BenchmarkMatchHard_32M 4210112412 4169292003 -0.97% BenchmarkMatchMedium_32K 2460752 2438611 -0.90% BenchmarkMatchEasy0_1M 422914 419672 -0.77% BenchmarkMatchMedium_1M 78581121 78040160 -0.69% BenchmarkMatchMedium_32M 2515287278 2498464906 -0.67% BenchmarkMatchMedium_32 1754 1746 -0.46% BenchmarkMatchMedium_1K 52105 52106 +0.00% BenchmarkAnchoredLiteralLongNonMatch 185 185 +0.00% BenchmarkMatchEasy1_32 107 107 +0.00% BenchmarkOnePassLongNotPrefix 505 505 +0.00% BenchmarkOnePassLongPrefix 147 147 +0.00% The godoc binary is ~0.12% smaller after this CL. Updates #5729. toolstash -cmp passes for all architectures other than amd64 and amd64p32. Other architectures can be done in follow-up CLs. Change-Id: I0e167e259274b722958567fc0af83a17ca002da7 Reviewed-on: https://go-review.googlesource.com/2284Reviewed-by:
Russ Cox <rsc@golang.org>
-
Ian Lance Taylor authored
Change-Id: I87147ca6bb53e3121cc4245449c519509f107638 Reviewed-on: https://go-review.googlesource.com/9009 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by:
David Crawshaw <crawshaw@golang.org>
-
Russ Cox authored
$ sam -d cmd/internal/gc/*.{go,y} cmd/?g/*.go X ,s/, (gc\.)?[BFHNST]conv\(([^()]+), 0\)/, \2/g X/'/w q $ Change-Id: Ic28a4807d237b8ae53ceca1e4e7fdb43580ab560 Reviewed-on: https://go-review.googlesource.com/9032Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by:
Austin Clements <austin@google.com>
-
Russ Cox authored
The next CL will remove unnecessary conv calls. Change-Id: I0e8dbd1756cdec1ef6095ae67629cd3fae0fb4a4 Reviewed-on: https://go-review.googlesource.com/9031Reviewed-by:
Austin Clements <austin@google.com>
-
Russ Cox authored
It's not helping anymore, and it's fooling people who try to understand performance (like me). Change-Id: I133a644acae0ddf1bfa17c654cdc01e2089da963 Reviewed-on: https://go-review.googlesource.com/9018Reviewed-by:
Austin Clements <austin@google.com>
-
Ian Lance Taylor authored
Change-Id: I8c97751a79b57197428b0f0b66fc9575708a2eb0 Reviewed-on: https://go-review.googlesource.com/8979 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by:
David Crawshaw <crawshaw@golang.org>
-
Austin Clements authored
readyExecute passes a closure to mcall that captures an argument to readyExecute. Since mcall is marked noescape, this closure lives on the stack of the calling goroutine. However, the closure puts the calling goroutine on the run queue (and switches to a new goroutine). If the calling goroutine gets scheduled before the mcall returns, this stack-allocated closure will become invalid while it's still executing. One consequence of this we've observed is that the captured gp variable can get overwritten before the call to execute(gp), causing execute(gp) to segfault. Fix this by passing the currently captured gp variable through a field in the calling goroutine's g struct so that the func is no longer a closure. To prevent problems like this in the future, this change also removes the go:noescape annotation from mcall. Due to a compiler bug, this will currently cause a func closure passed to mcall to be implicitly allocated rather than refusing the implicit allocation. However, this is okay because there are no other closures passed to mcall right now and the compiler bug will be fixed shortly. Fixes #10428. Change-Id: I49b48b85de5643323b89e9eaa4df63854e968c32 Reviewed-on: https://go-review.googlesource.com/8866 TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
David Chase <drchase@google.com> Reviewed-by:
Russ Cox <rsc@golang.org>
-
Rob Pike authored
Change-Id: I8029640fe74731d7847390f371af37b85dec96cc Reviewed-on: https://go-review.googlesource.com/9006Reviewed-by:
Rob Pike <r@golang.org>
-
Rob Pike authored
Trivial to do, but overlooked for 1.4, which is good because I prefer the new design, which is just to match against the source code of the line rather than the command word alone. Change-Id: Idcf7c4479e97bb7cd732f0d058012321b6057628 Reviewed-on: https://go-review.googlesource.com/9005Reviewed-by:
Russ Cox <rsc@golang.org>
-
Brad Fitzpatrick authored
Change-Id: Id1ecad2565edd5937a764dcf56b89263353f47c2 Reviewed-on: https://go-review.googlesource.com/8947Reviewed-by:
Ian Lance Taylor <iant@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
-
Michael Matloob authored
Fixes #10319 Change-Id: I96015b0e1dff30a72de11fea3837638b5c672891 Reviewed-on: https://go-review.googlesource.com/8501Reviewed-by:
Russ Cox <rsc@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
-
Hyang-Ah Hana Kim authored
Followed the same test pattern in misc/cgo/testcarchive. Change-Id: I2f863b5c24a28f0b38b0128ed3e8a92c17fb5b9f Reviewed-on: https://go-review.googlesource.com/8985Reviewed-by:
David Crawshaw <crawshaw@golang.org> Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
Russ Cox authored
Change-Id: I0d2b909ceeba9da86c77de4ce23d7c6063f8f10f Reviewed-on: https://go-review.googlesource.com/9017Reviewed-by:
Minux Ma <minux@golang.org>
-
Dave Cheney authored
Updates #10476 Change-Id: Ic4414f669104905c6004835be5cf0fa873553ea6 Reviewed-on: https://go-review.googlesource.com/8962Reviewed-by:
Russ Cox <rsc@golang.org>
-
Russ Cox authored
Repeat of CL 8951. Change-Id: I5430e4a9eb5d8b7d0e3963657092bede67439056 Reviewed-on: https://go-review.googlesource.com/9003Reviewed-by:
Rob Pike <r@golang.org>
-
David Crawshaw authored
Previously we started the Go runtime from a JNI function call, which eventually called the program's main function. Now the runtime is initialized by an ELF initialization function as a c-shared library, and the program's main function is not called. So now we export main so it can be called from JNI. This is necessary for all-Go apps because unlike a normal shared library, the program loading the library is not written by or known to the programmer. As far as they are concerned, the .so is everything. In fact the same code is compiled for iOS as a normal Go program. Change-Id: I61c6a92243240ed229342362231b1bfc7ca526ba Reviewed-on: https://go-review.googlesource.com/9015Reviewed-by:
Hyang-Ah Hana Kim <hyangah@gmail.com>
-
David Crawshaw authored
Change-Id: Ie7f85873978adf3fd5c739176f501ca219592824 Reviewed-on: https://go-review.googlesource.com/9011Reviewed-by:
Hyang-Ah Hana Kim <hyangah@gmail.com> Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
Matthew Dempsky authored
Instead of only checking packages that are already listed in pkgDeps, apply deps checks to all standard library packages. To avoid slowing testing down too much, instead of running "go list std" in a subprocess like cmd/api or cmd/dist, this test manually walks the GOROOT src directory to enumerate packages. Timings on an HP Z620 using linux/amd64: short full before 0.092s 4.880s after 0.137s 5.104s Additionally, a handful of packages that were previously unchecked are now listed, along with their current dependencies. These should probably eventually be moved elsewhere and assigned appropriate allowable-dependency sets. For now, they've been grandfathered in by simply assigning them their current dependencies, so that followup CLs can review them individually as appropriate. Fixes #10475. Change-Id: I83ffd8ff329092f664bf3e3f2c9e3dad8e77ac02 Reviewed-on: https://go-review.googlesource.com/9001 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by:
Russ Cox <rsc@golang.org>
-
Nigel Tao authored
Change-Id: I223a4bd6e3ee31324b46ac79a4022e40f1868491 Reviewed-on: https://go-review.googlesource.com/8995Reviewed-by:
Matthew Dempsky <mdempsky@google.com>
-
Josh Bleecher Snyder authored
This cleanup is in anticipation of implementing jump-free booleans (CL 2284) and zero-aware comparisons (issue 10381). No functional changes. Passes toolstash -cmp. Change-Id: I50f394c60fa2927e177d7fc85b75085060a9e912 Reviewed-on: https://go-review.googlesource.com/8738Reviewed-by:
Russ Cox <rsc@golang.org>
-
Russ Cox authored
This memory is untyped and can't be used anymore. The next version of SWIG won't need it. Change-Id: I592b287c5f5186975ee09a9b28d8efe3b57134e7 Reviewed-on: https://go-review.googlesource.com/8956Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
Mikio Hara authored
This change makes TestDialError, TestListenError work without any external dependency, enables them by default, and removes unnecessary -run_error_test flag for fixing #4856. Also fixes inconsistent error values on Dial, Listen partially as a first stab. Updates #4856. Change-Id: Ie10c151ae06759085f352c7db2ca45107a81914f Reviewed-on: https://go-review.googlesource.com/8903Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
Mikio Hara authored
In followup changes, we'll move OpError around from the netFD layer to the Conn layer for fixing #4856. Before doing that, this change makes netFD of Plan 9 match netFD for POSIX platforms to avoid conflict. Change-Id: Iea7632716d48722a1758e52effefec964a3a9442 Reviewed-on: https://go-review.googlesource.com/8990Reviewed-by:
David du Colombier <0intro@gmail.com> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
- 16 Apr, 2015 15 commits
-
-
Nigel Tao authored
red, green and blue. Fixes #9902 Change-Id: Ibffd0aa2f98996170e39a919296f69e9d5c71545 Reviewed-on: https://go-review.googlesource.com/8907Reviewed-by:
Rob Pike <r@golang.org>
-
Shenghou Ma authored
Change-Id: I3b3f80791a1db4c2b7318f81a115972cd2237f08 Signed-off-by:
Shenghou Ma <minux@golang.org> Reviewed-on: https://go-review.googlesource.com/8787Reviewed-by:
David Crawshaw <crawshaw@golang.org>
-
David Crawshaw authored
I said I removed this from cl/8711 in response to your comment, but apparently I did not. misc/cgo/testcarchive continues to pass on darwin/amd64. Change-Id: I6410782f2a78bf117741628fb71cac56e289b590 Reviewed-on: https://go-review.googlesource.com/9010Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
David Crawshaw authored
For some reason the absense of an implementation does not stop arm64 binaries being built. However it comes up with -buildmode=c-archive. Change-Id: Ic0db5fd8fb4fe8252b5aa320818df0c7aec3db8f Reviewed-on: https://go-review.googlesource.com/8989Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Michael Hudson-Doyle authored
Change-Id: I749fd91cd3c7581cdcc97a15e8eeee0c20f0b259 Reviewed-on: https://go-review.googlesource.com/8805Reviewed-by:
Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org>
-
David Crawshaw authored
Change-Id: Ib227aa3e14d01a0ab1ad9e53d107858e045d1c42 Reviewed-on: https://go-review.googlesource.com/8984Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
David du Colombier authored
Change-Id: I8b2063e65d3454a694a789c1682dacfe0bea2e19 Reviewed-on: https://go-review.googlesource.com/8965Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Jonathan Rudenberg authored
- Multiple GetCertificate tests shared the same name and were overwriting each other, each test now has a unique name. - expectAlert was not implemented in the data updater, the single test that used it has been replaced with a ClientHello failure test. Fixes #10470 Change-Id: I500738f6302ffa863d7ee45d85fa8773155e0614 Reviewed-on: https://go-review.googlesource.com/8959Reviewed-by:
Adam Langley <agl@golang.org> Run-TryBot: Adam Langley <agl@golang.org>
-
David Crawshaw authored
Change-Id: I8e912ff9327a4163b63b8c628aa3546e86ddcc02 Reviewed-on: https://go-review.googlesource.com/8983Reviewed-by:
Hyang-Ah Hana Kim <hyangah@gmail.com>
-
Brad Fitzpatrick authored
This reverts commit 3e6b7f35. Change-Id: Icad2b235b9880729fbdf80d7dfd71e56df4b1231 Reviewed-on: https://go-review.googlesource.com/8944Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Shenghou Ma authored
Change-Id: I3b3f80791a1db4c2b7318f81a115972cd2237f06 Signed-off-by:
Shenghou Ma <minux@golang.org> Reviewed-on: https://go-review.googlesource.com/8785Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Brad Fitzpatrick authored
Fixes #7075 Change-Id: I57fcebaaef768b00263b6b91211b1434f6a4b229 Reviewed-on: https://go-review.googlesource.com/8919Reviewed-by:
Josh Bleecher Snyder <josharian@gmail.com>
-
Russ Cox authored
Change-Id: I86530a4fd240f3e056e3277355d2965f6863b852 Reviewed-on: https://go-review.googlesource.com/8951Reviewed-by:
Rob Pike <r@golang.org>
-
Alexandre Cesaro authored
It is not needed right now, but it will allow more flexibility in the future. Fixes #10472 Change-Id: I2eaea70abeca5ed10f89b0b2dfdabdac376a0a41 Reviewed-on: https://go-review.googlesource.com/8964Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Michael Hudson-Doyle authored
The ptrto field of the type data cannot be relied on when dynamic linking: a type T may be defined in a module that makes no use of pointers to that type, but another module can contain a package that imports the first one and does use *T pointers. The second module will end up defining type data for *T and a type.*T symbol pointing at it. It's important that calling .PtrTo() on the refect.Type for T returns this type data and not some synthesized object, so we need reflect to be able to find it! Fortunately, the reflect package already has a mechanism for doing this sort of thing: ChanOf/MapOf/etc look for pre-existing type data by name. So this change just extends PtrTo() to consult this too, and changes the compiler to include pointer types in the data consulted when compiling for dynamic linking. Change-Id: I3773c066fd0679a62e9fc52a84bf64f1d67662b7 Reviewed-on: https://go-review.googlesource.com/8232Reviewed-by:
Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org>
-