- 12 Oct, 2016 29 commits
-
-
Hiroshi Ioka authored
Fixes #16690 Change-Id: I6db588c4b0f23c5ec6bc9b85a488b60fab3f2f13 Reviewed-on: https://go-review.googlesource.com/30892Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Momchil Velikov authored
- trim blocks with multiple predecessors - trim blocks, which contain only phi-functions - trim blocks, which can be merged into the successor block As an example, compiling the following source: ---8<------ package p type Node struct { Key int Left, Right *Node } func Search(r *Node, k int) *Node { for r != nil { switch { case k == r.Key: return r case k < r.Key: r = r.Left default: r = r.Right } } return nil } ---8<------ with `GOSSAFUNC=Search" go tool compile t.go`, results in the following code: ---8<------ genssa 00000 (t.go:8) TEXT "".Search(SB), $0 00001 (t.go:8) FUNCDATA $0, "".gcargs·0(SB) 00002 (t.go:8) FUNCDATA $1, "".gclocals·1(SB) 00003 (t.go:8) TYPE "".r(FP)type.*"".Node, $8 00004 (t.go:8) TYPE "".k+8(FP)type.int, $8 00005 (t.go:8) TYPE "".~r2+16(FP)type.*"".Node, $8 v40 00006 (t.go:9) MOVQ "".k+8(FP), AX v34 00007 (t.go:9) MOVQ "".r(FP), CX v33 00008 (t.go:9) TESTQ CX, CX b2 00009 (t.go:9) JEQ $0, 22 v16 00010 (t.go:11) MOVQ (CX), DX v21 00011 (t.go:11) CMPQ DX, AX b9 00012 (t.go:11) JEQ $0, 19 v64 00013 (t.go:13) CMPQ AX, DX b13 00014 (t.go:13) JGE 17 v36 00015 (t.go:14) MOVQ 8(CX), CX b4 00016 (t.go:9) JMP 8 <---+ v42 00017 (t.go:16) MOVQ 16(CX), CX | b21 00018 (t.go:10) JMP 16 ----+ v28 00019 (t.go:12) VARDEF "".~r2+16(FP) v29 00020 (t.go:12) MOVQ CX, "".~r2+16(FP) b10 00021 (t.go:12) RET v44 00022 (t.go:19) VARDEF "".~r2+16(FP) v45 00023 (t.go:19) MOVQ $0, "".~r2+16(FP) b5 00024 (t.go:19) RET 00025 (<unknown line number>) END ---8<------ Note the jump at 18 jumps to another jump at 16. Looking at the function after trimming: --8<------ after trim [199 ns] b1: v1 = InitMem <mem> v2 = SP <uintptr> : SP v67 = Arg <*Node> {r} : r[*Node] v59 = Arg <int> {k} : k[int] v40 = LoadReg <int> v59 : AX v34 = LoadReg <*Node> v67 : CX Plain → b2 b2: ← b1 b4 v8 = Phi <*Node> v34 v68 : CX v33 = TESTQ <flags> v8 v8 NE v33 → b9 b5 (likely) b9: ← b2 v16 = MOVQload <int> v8 v1 : DX v21 = CMPQ <flags> v16 v40 EQ v21 → b10 b13 (unlikely) b13: ← b9 v64 = CMPQ <flags> v40 v16 LT v64 → b19 b21 b19: ← b13 v36 = MOVQload <*Node> [8] v8 v1 : CX Plain → b4 b4: ← b21 b19 < v68 = Phi <*Node> v42 v36 : CX <- no actual code Plain → b2 < b21: ← b13 v42 = MOVQload <*Node> [16] v8 v1 : CX Plain → b4 b10: ← b9 v28 = VarDef <mem> {~r2} v1 v29 = MOVQstore <mem> {~r2} v2 v8 v28 v30 = Copy <mem> v29 Ret v30 b5: ← b2 v44 = VarDef <mem> {~r2} v1 v45 = MOVQstoreconst <mem> {~r2} [val=0,off=0] v2 v44 v47 = Copy <mem> v45 Ret v47 --8<------ The jump at 16 corresponds to the edge b21 -> b4. The block b4 contains only phi-ops, i.e. no actual code besides the jump to b2. However b4 is not trimmed, because it a) has more than one predecessor, and b) it is not empty. This change enhances trim.go to remove more blocks, subject to the following criteria: - block has predecessors (i.e. not the start block) - block is BlockPlain - block does not loop back to itself - block is the single predecessor of its successor; the instructions of the block are merged into the successor - block does no emit actual code, besides a possible unconditional jump. Currently only OpPhi are considered to not be actual code, perhaps OpKeepAlive/others should be considered too? As an example, after the change, the block b4 is trimmed and the jump at 18 jumps directly to 8. Revision 1: Adjust phi-ops arguments after merge Ensure the number of phi-ops arguments matches the new number of predecessors in the merged block. When moving values, make them refer to the merged block. Revision 2: - Make clear the intent that we do not want to trim the entry block - Double check that we are merging a phi operation - Minor code style fix - Fix a potentially dangerous situation when a blocks refers to the inline value space in another block Change-Id: I0ab91779f931f404d11008f5c45606d985d7fbaa Reviewed-on: https://go-review.googlesource.com/28812 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
Kevin Burke authored
Change-Id: I611511434f37c75f77c22f61f469108243bc0101 Reviewed-on: https://go-review.googlesource.com/29121Reviewed-by: Russ Cox <rsc@golang.org>
-
Cyrill Schumacher authored
- precalculate *Cookie slice in read cookie functions - readSetCookies: pre-allocs depending on the count of Set-Cookies - rename success variable to ok; avoid else - refactor Cookie.String to use less allocations - remove fmt package and replace with writes to a bytes.Buffer - add BenchmarkReadSetCookies and BenchmarkReadCookies name old time/op new time/op delta CookieString-8 1.42µs ± 2% 0.78µs ± 1% -45.36% (p=0.000 n=10+10) ReadSetCookies-8 3.46µs ± 1% 3.42µs ± 2% -1.39% (p=0.001 n=10+10) ReadCookies-8 5.12µs ± 1% 5.15µs ± 2% ~ (p=0.393 n=10+10) name old alloc/op new alloc/op delta CookieString-8 520B ± 0% 384B ± 0% -26.15% (p=0.000 n=10+10) ReadSetCookies-8 968B ± 0% 960B ± 0% -0.83% (p=0.000 n=10+10) ReadCookies-8 2.01kB ± 0% 2.01kB ± 0% ~ (all samples are equal) name old allocs/op new allocs/op delta CookieString-8 10.0 ± 0% 3.0 ± 0% -70.00% (p=0.000 n=10+10) ReadSetCookies-8 18.0 ± 0% 17.0 ± 0% -5.56% (p=0.000 n=10+10) ReadCookies-8 16.0 ± 0% 16.0 ± 0% ~ (all samples are equal) Change-Id: I870670987f10f3e52f9c657cfb8e6eaaa97a6162 Reviewed-on: https://go-review.googlesource.com/27850 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
-
Alan Donovan authored
Change-Id: Ibcf5e0ba694b280744a00c2c6fda300f0a653455 Reviewed-on: https://go-review.googlesource.com/30715Reviewed-by: Robert Griesemer <gri@golang.org>
-
Alan Donovan authored
Change-Id: Ieb3d605f03a7185a707621bef7160090c9bdb51f Reviewed-on: https://go-review.googlesource.com/28873Reviewed-by: Alan Donovan <adonovan@google.com>
-
Emmanuel Odeke authored
Update comments for duffzero and duffcopy which referred to legacy locations: + cmd/?g/cgen.go + cmd/?g/ggen.go Remnants of the old days when we had 5g, 6g etc. Those locations have since moved to: + cmd/compile/internal/<arch>/cgen.go + cmd/compile/internal/<arch>/ggen.go Change-Id: Ie2ea668559d52d42b747260ea69a6d5b3d70e859 Reviewed-on: https://go-review.googlesource.com/29073Reviewed-by: Russ Cox <rsc@golang.org>
-
Jean-Nicolas Moal authored
For #16360. Change-Id: Iaa3548704786018eacec530f7a907b976fa532fe Reviewed-on: https://go-review.googlesource.com/27443 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Hiroshi Ioka authored
EvalSymlinks returns error if given path or its target path don't exist. Add a test for future improvement. Change-Id: Ic9a4aa5eaee0fe7ac523d54d8eb3132a11b380b3 Reviewed-on: https://go-review.googlesource.com/27330Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org>
-
Dave Cheney authored
This change adds runtime/trace support to go tool compile. Change-Id: I6c496b9b063796123f75eba6af511c53a57c0196 Reviewed-on: https://go-review.googlesource.com/25354 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org>
-
Joshua Boelter authored
Add checks for failure of CreateEvent, SetEvent or WaitForSingleObject. Any failures are considered fatal and will throw() after printing an informative message. Updates #16646 Change-Id: I3bacf9001d2abfa8667cc3aff163ff2de1c99915 Reviewed-on: https://go-review.googlesource.com/26655Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
David du Colombier authored
This cosmetic change defines ld.FlagTextAddr using ld.HEADR in the Plan 9 cases, like it is done for other operating systems. Change-Id: Ic929c1c437f25661058682cf3e159f0b16cdc538 Reviewed-on: https://go-review.googlesource.com/30912 Run-TryBot: David du Colombier <0intro@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Mikio Hara authored
Also removes unnecessary allocation. Change-Id: I3406cf75a7b64d93b2b99c7f1f5c78f580452b60 Reviewed-on: https://go-review.googlesource.com/30891 Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
David du Colombier authored
Support for multiple text sections was added in CL 27790. However, this change broke the build on plan9/amd64. In relocsym, the R_ADDROFF relocation was changed to use offsets relative to the start of the first text section. However, Segtext.Vaddr is the address of the text segment, while we expect to start from the first section (text.runtime) of the text segment. Fixes #17411. Change-Id: I86bbcbda81cea735b0ecf156eab2e6e5d63acce3 Reviewed-on: https://go-review.googlesource.com/30911 Run-TryBot: David du Colombier <0intro@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Ian Lance Taylor authored
All the implementations of NsecToTimespec and NsecToTimeval were the same other than types. Write a single version that uses GOARCH/GOOS-specific setTimespec and setTimeval functions to handle the types. The logic in NsecToTimespec and NsecToTimeval caused times before 1970 to have a negative usec/nsec. The Linux kernel requires that usec contain a positive number; for consistency, we do this for both NsecToTimespec and NsecToTimeval. Change-Id: I525eaba2e7cdb00cb57fa00182dabf19fec298ae Reviewed-on: https://go-review.googlesource.com/30826 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
-
Chris McGee authored
The new implementation parses the plan9 interface files and builds Interface representations for the net package. Updates #17218 Change-Id: I3199d18d9e96a17e922186c3abff1d7cd9cbec2e Reviewed-on: https://go-review.googlesource.com/29963 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Sina Siadat authored
Show usage of os.IsNotExist in an example. Change-Id: I5306ea06c370099de5b02668dfa02b87b0c2beac Reviewed-on: https://go-review.googlesource.com/25571Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Shawn Walker-Salas authored
Support the tagging of binaries created with the internal linker on Solaris as having a non-executable stack by writing a PT_SUNWSTACK program header. Fixes #16074 Change-Id: I3888f2153083385d04a52f341570f93e5738b276 Reviewed-on: https://go-review.googlesource.com/24142 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
-
Gyu-Ho Lee authored
To prevent slice growth when appending. Change-Id: I2cdb9b09bc33f63188b19573c8b9a77601e63801 Reviewed-on: https://go-review.googlesource.com/23783 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
-
Alex Brainman authored
Updates #15978 Updates #16145 Change-Id: I161f5bc97d41c08bf5e1405ccafa86232d70886d Reviewed-on: https://go-review.googlesource.com/25320 Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
-
Tristan Ooohry authored
The error coming out of matchGoImport does not differentiate between having no imports, and having some invalid imports. This some extra context to the error message to help debug these issues. Fixes #16467 Change-Id: I3e9a119ed73da1bed5e07365be0221ea6b7f19db Reviewed-on: https://go-review.googlesource.com/25121 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
-
Xuyang Kang authored
If strict option is enabled, when decoding, instead of skip the padding bits, it will do strict check to enforce they are set to zero. Fixes #15656 Change-Id: I869fb725a39cc9dde44dbc4ff0046446e7abc642 Reviewed-on: https://go-review.googlesource.com/24964Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Gustav Westling authored
Simplify map key literals in "gofmt -s" Fixes #16461. Change-Id: Ia61739b34a30ac27f6696f94a98809109a8a7b61 Reviewed-on: https://go-review.googlesource.com/25530 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
-
Keith Randall authored
Update the description of the conditions under which highlighting might be misleading. Fixes #16754 Change-Id: I3078a09e0b9a76d12078352e15a3f26ba3f1bbee Reviewed-on: https://go-review.googlesource.com/30818Reviewed-by: David Chase <drchase@google.com>
-
Dmitri Shuralyov authored
This is a followup to CL 24747, where the package doc phrase "Functions in this package replace occurrences of slash unless otherwise specified." was removed. The phrase was originally added in CL 7310 together with this explicit opt out statement for SplitList. Remove it since it's no longer neccessary. This helps consistency. Updates #16111. Updates #10122. Change-Id: Iba86de57c24100adecac9cb5892ce180126c0ea6 Reviewed-on: https://go-review.googlesource.com/25250Reviewed-by: Russ Cox <rsc@golang.org>
-
Gleb Stepanov authored
Fix typo in word synchronization in comments. Change-Id: I453b4e799301e758799c93df1e32f5244ca2fb84 Reviewed-on: https://go-review.googlesource.com/25174Reviewed-by: Russ Cox <rsc@golang.org>
-
Michael Munday authored
The canBackTrace variable is true for all of the architectures Go supports and this is likely to remain the case as new architectures are added. Change-Id: I73900c018eb4b2e5c02fccd8d3e89853b2ba9d90 Reviewed-on: https://go-review.googlesource.com/22423Reviewed-by: Cherry Zhang <cherryyz@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Michael Pratt authored
When generating callgrind format output, produce cost lines at instruction granularity. This allows visualizers supporting the callgrind format to display instruction-level profiling information. We also need to provide the object file (ob=) in order for tools to find the object file to disassemble when displaying assembly. We opportunistically group cost lines corressponding to the same function together, reducing the number of superfluous description lines. Subposition compression (relative position numbering) is also used to reduce the output size. Change-Id: Id8e960b81dc7a47ec1dfbae877521f76972431c4 Reviewed-on: https://go-review.googlesource.com/23781 Run-TryBot: Michael Pratt <mpratt@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Raul Silvera <rsilvera@google.com> Reviewed-by: Russ Cox <rsc@golang.org>
-
Filippo Valsorda authored
The trace tool can generate some interesting profiles, but it was only exposing them as svg through the web UI. This adds command line options to generate the raw pprof file. Change-Id: I52e4f909fdca6f65c3616add444e3892783640f4 Reviewed-on: https://go-review.googlesource.com/23324Reviewed-by: Russ Cox <rsc@golang.org>
-
- 11 Oct, 2016 11 commits
-
-
Ian Lance Taylor authored
All implementations of these functions are identical. Change-Id: I7cbea53c02bb0cee75e30beed19d29ba0a7ef657 Reviewed-on: https://go-review.googlesource.com/30819 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
James Clarke authored
Change-Id: I1a2504ad9ca8607588d2d366598115fe360435b5 Reviewed-on: https://go-review.googlesource.com/30870Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Joe Tsai authored
We should preserve the fact that a roundtrip read on fields with the zero value should remain the zero for those that are reasonable to stay that way. If the zero value for a MS-DOS timestamp was used, then it is sensible for that zero value to also be read back later. Fixes #17403 Change-Id: I32c3915eab180e91ddd2499007374f7b85f0bd76 Reviewed-on: https://go-review.googlesource.com/30811 Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Matthew Dempsky authored
Shrinks cmd/go's text segment by 0.9%. text data bss dec hex filename 6447148 231643 146328 6825119 68249f go.before 6387404 231643 146328 6765375 673b3f go.after Change-Id: I431e8482dbb11a7c1c77f2196cada43d5dad2981 Reviewed-on: https://go-review.googlesource.com/30817Reviewed-by: Austin Clements <austin@google.com>
-
Matthew Dempsky authored
Also, fix a byte-ordering problem with stack maps for assembly function signatures on big-endian targets. Change-Id: I6e8698f5fbb04b31771a65f4a8f3f9c045ff3c98 Reviewed-on: https://go-review.googlesource.com/30816Reviewed-by: Austin Clements <austin@google.com>
-
Michael Munday authored
We save and restore the link register in non-leaf functions because it is clobbered by CALLs. It is therefore available for general purpose use. Only enabled on s390x currently. The RC4 benchmarks in particular benefit from the extra register: name old speed new speed delta RC4_128 243MB/s ± 2% 341MB/s ± 2% +40.46% (p=0.008 n=5+5) RC4_1K 267MB/s ± 0% 359MB/s ± 1% +34.32% (p=0.008 n=5+5) RC4_8K 271MB/s ± 0% 362MB/s ± 0% +33.61% (p=0.008 n=5+5) Change-Id: Id23bff95e771da9425353da2f32668b8e34ba09f Reviewed-on: https://go-review.googlesource.com/30597Reviewed-by: Cherry Zhang <cherryyz@google.com> Run-TryBot: Michael Munday <munday@ca.ibm.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Adam Langley authored
The Subject and Issuer names in a certificate look like they should be a list of key-value pairs. However, they're actually a list of lists of key-value pairs. Previously we only looked at the first element of each sublist and the vast majority of certificates only have one element per sublist. However, it's possible to have multiple elements and some 360 certificates from the “Pilot” log are so constructed. This change causes all elements of the sublists to be processed. Fixes #16836. Change-Id: Ie0a5159135b08226ec517fcf251aa17aada37857 Reviewed-on: https://go-review.googlesource.com/30810Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Hajime Hoshi authored
Change-Id: Ib14b5421bb5e407bbd4d3cbfc68c92d3dd257cb1 Reviewed-on: https://go-review.googlesource.com/30732 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
David Chase authored
In some cases the members of the root set from which flood runs themselves escape, without their referents being also tagged as escaping. Fix this by reflooding from those roots whose escape increases, and also enhance the "leak" test to include reachability from a heap-escaped root. Fixes #17318. Change-Id: Ied1e75cee17ede8ca72a8b9302ce8201641ec593 Reviewed-on: https://go-review.googlesource.com/30693 Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
-
Russ Cox authored
A later CL will be adding more code here. It will help to keep it separate from the other code. Change-Id: I971ba53de819cd10991b51fdec665984939a5f9b Reviewed-on: https://go-review.googlesource.com/30709Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Russ Cox authored
The Montgomery multiply code is applicable to this case but was being bypassed. Don't do that. The old test len(x) > 1 was really just a bad approximation to x > 1. name old time/op new time/op delta Exp-8 5.56ms ± 4% 5.73ms ± 3% ~ (p=0.095 n=5+5) Exp2-8 7.59ms ± 1% 5.66ms ± 1% -25.40% (p=0.008 n=5+5) This comes up especially when doing Fermat (Miller-Rabin) primality tests with base 2. Change-Id: I4cc02978db6dfa93f7f3c8f32718e25eedb4f5ed Reviewed-on: https://go-review.googlesource.com/30708Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-