1. 21 Jun, 2018 7 commits
    • Terin Stock's avatar
      flag: add a Value example · 6c810027
      Terin Stock authored
      Change-Id: I579cc9f4f8e5be5fd6447a99614797ab7bc53611
      Reviewed-on: https://go-review.googlesource.com/120175
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      6c810027
    • Paul Jolly's avatar
      misc/wasm: fix permissions on wasm_exec.js · 4b342899
      Paul Jolly authored
      Currently wasm_exec.js is executable (0755) yet has no interpreter.
      Indeed wasm_exec.js is only ever used as an argument to Node or loaded
      via a <script> tag in a browser-loaded HTML file.  Hence the execute
      mode bits are superfluous and simply serve to clutter your PATH if
      $GOROOT/misc/wasm is on your PATH (as is required if you want to run go
      test syscall/js).
      
      Change-Id: I279e2457094f8a12b9bf380ad7f1a9f47b22fc96
      Reviewed-on: https://go-review.googlesource.com/120435
      Run-TryBot: Paul Jolly <paul@myitcv.org.uk>
      Reviewed-by: 's avatarDaniel Martí <mvdan@mvdan.cc>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      4b342899
    • Andrei Tudor Călin's avatar
      internal/poll: use more fine-grained locking in Splice · 24fb2e01
      Andrei Tudor Călin authored
      The previous code acquired a read lock on src and a write lock on
      dst for the entire duration of Splice. This resulted in deadlock,
      in a situation akin to the following:
      
      Splice is blocking, waiting to read from src.
      
      The caller tries to close dst from another goroutine, but Close on
      dst blocks in runtime.semacquire, because Splice is still holding a
      write lock on it, and the Close didn't unblock any I/O.
      
      The caller cannot unblock the read side of Splice through other means,
      because they are stuck waiting in dst.Close().
      
      Use more fine-grained locking instead: acquire the read lock on src
      just before trying to splice from the source socket to the pipe,
      and acquire the write lock on dst just before trying to splice from
      the pipe to the destination socket.
      
      Fixes #25985
      
      Change-Id: I264c91c7a69bb6c5e28610e2bd801244804cf86d
      Reviewed-on: https://go-review.googlesource.com/120317
      Run-TryBot: Aram Hăvărneanu <aram@mgk.ro>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      24fb2e01
    • Ian Lance Taylor's avatar
      cmd/go: re-enable a couple of tests of gccgo · 1507502f
      Ian Lance Taylor authored
      Updates #22472
      
      Change-Id: I526d131f2ef8e0200f7a5634c75b31e0ee083f93
      Reviewed-on: https://go-review.googlesource.com/120375
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      1507502f
    • Wei Xiao's avatar
      cmd/compile: improve atomic add intrinsics with ARMv8.1 new instruction · 0a7ac93c
      Wei Xiao authored
      ARMv8.1 has added new instruction (LDADDAL) for atomic memory operations. This
      CL improves existing atomic add intrinsics with the new instruction. Since the
      new instruction is only guaranteed to be present after ARMv8.1, we guard its
      usage with a conditional on CPU feature.
      
      Performance result on ARMv8.1 machine:
      name        old time/op  new time/op  delta
      Xadd-224    1.05µs ± 6%  0.02µs ± 4%  -98.06%  (p=0.000 n=10+8)
      Xadd64-224  1.05µs ± 3%  0.02µs ±13%  -98.10%  (p=0.000 n=9+10)
      [Geo mean]  1.05µs       0.02µs       -98.08%
      
      Performance result on ARMv8.0 machine:
      name        old time/op  new time/op  delta
      Xadd-46      538ns ± 1%   541ns ± 1%  +0.62%  (p=0.000 n=9+9)
      Xadd64-46    505ns ± 1%   508ns ± 0%  +0.48%  (p=0.003 n=9+8)
      [Geo mean]   521ns        524ns       +0.55%
      
      Change-Id: If4b5d8d0e2d6f84fe1492a4f5de0789910ad0ee9
      Reviewed-on: https://go-review.googlesource.com/81877
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
      0a7ac93c
    • Emmanuel T Odeke's avatar
      net/http: avoid deferred unlock in ServeMux.shouldRedirect · 1988b3ed
      Emmanuel T Odeke authored
      CL 96575 introduced concurrency protection for
      ServeMux.shouldRedirect with a read lock and deferred unlock.
      However, the change produced a noticeable regression.
      Instead add the suffix "RLocked" to the function name to
      declare that we should hold the read lock as a pre-requisite
      before calling it, hence avoiding the defer altogether.
      
      Benchmarks:
      name                  old time/op    new time/op    delta
      ServeMux-8              63.3µs ± 0%    54.6µs ± 0%  -13.74%  (p=0.000 n=9+9)
      ServeMux_SkipServe-8    41.4µs ± 2%    32.7µs ± 1%  -21.05%  (p=0.000 n=10+10)
      
      name                  old alloc/op   new alloc/op   delta
      ServeMux-8              17.3kB ± 0%    17.3kB ± 0%     ~     (all equal)
      ServeMux_SkipServe-8     0.00B          0.00B          ~     (all equal)
      
      name                  old allocs/op  new allocs/op  delta
      ServeMux-8                 360 ± 0%       360 ± 0%     ~     (all equal)
      ServeMux_SkipServe-8      0.00           0.00          ~     (all equal)
      
      Updates #25383
      Updates #25482
      
      Change-Id: I2ffa4eafe165faa961ce23bd29b5653a89facbc2
      Reviewed-on: https://go-review.googlesource.com/113996
      Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      1988b3ed
    • Tobias Klauser's avatar
      syscall: check faccessat flags parameter on Linux · 85e38ccc
      Tobias Klauser authored
      Port CL 119495 from golang.org/x/sys/unix to the syscall package.
      
      Currently Linux faccessat(2) syscall implementation doesn't support the
      flags parameter. As per the discussion in #25845, permit the same flags
      as glibc [1].
      
      [1] https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/faccessat.c;h=ea42b2303ff4b2d2d6548ea04376fb265f773436;hb=HEAD
      
      Updates #25845
      
      Change-Id: I132b33275a9cc72b3a97acea5482806c7f47d7f7
      Reviewed-on: https://go-review.googlesource.com/120015
      Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      85e38ccc
  2. 20 Jun, 2018 11 commits
  3. 19 Jun, 2018 9 commits
    • David Carlier's avatar
      runtime: fix FreeBSDNumCPU test · 65d55a13
      David Carlier authored
      num cpu unit test fixes for FreeBSD.
      cpuset -g can possibly output more
      data than expected.
      
      Fixes #25924
      
      Change-Id: Iec45a919df68648759331da7cd1fa3b9f3ca4241
      GitHub-Last-Rev: 4cc275b519cda13189ec48b581ab9ce00cacd7f6
      GitHub-Pull-Request: golang/go#25931
      Reviewed-on: https://go-review.googlesource.com/119376
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      65d55a13
    • Heschi Kreinick's avatar
      debug/elf,macho,pe: support compressed DWARF · 2036f162
      Heschi Kreinick authored
      Since we're going to start compressing DWARF on Windows and maybe
      Darwin, copy the ELF support for .zdebug sections to macho and pe. The
      code is almost completely the same across the three.
      
      While I was here I added support for compressed .debug_type sections,
      which I presume were overlooked before.
      
      Tests will come in a later CL once we can actually generate compressed
      PE/Mach-O binaries, since there's no other good way to get test data.
      
      Updates #25927, #11799
      
      Change-Id: Ie920b6a16e9270bc3df214ce601a263837810376
      Reviewed-on: https://go-review.googlesource.com/119815
      Run-TryBot: Heschi Kreinick <heschi@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: 's avatarAustin Clements <austin@google.com>
      2036f162
    • Heschi Kreinick's avatar
      cmd/link: enable DWARF compression on Windows · 83515df3
      Heschi Kreinick authored
      Simple follow-on to CL 118276. Everything worked except that the
      compressed sections need to be aligned at PEFILEALIGN.
      
      Fixes #25927
      Updates #11799
      
      Change-Id: Iec871defe30e3e66055d64a5ae77d5a7aca355f5
      Reviewed-on: https://go-review.googlesource.com/119816
      Run-TryBot: Heschi Kreinick <heschi@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: 's avatarAustin Clements <austin@google.com>
      83515df3
    • Dmitri Shuralyov's avatar
      doc: update "Mac OS X", "OS X" to macOS; bump up to 10.10 · 500293d8
      Dmitri Shuralyov authored
      The name was "Mac OS X" during versions 10.0 to 10.7.
      It was renamed to "OS X" starting from 10.8 until 10.11.
      The current name is "macOS" starting with 10.12. [1]
      
      Previous changes (e.g., CL 47252) updated "Mac OS X" to macOS
      in some places, but not everywhere. This CL updates remaining
      instances for consistency.
      
      Only the pages that display current information were updated;
      historical pages such as release notes for older Go releases,
      past articles, blog posts, etc., were left in original form.
      
      Rename the "#osx" anchor to "#macos" on /doc/install page,
      along with the single reference to it on the same page.
      Add an empty div with id="osx" to not break old links.
      
      Update minimum macOS version from 10.8 to 10.10 per #23122.
      
      [1]: https://en.wikipedia.org/wiki/macOS#History
      
      Updates #23122.
      
      Change-Id: I69fe4b85e83265b9d99f447e3cc5230dde094869
      Reviewed-on: https://go-review.googlesource.com/119855Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      500293d8
    • Filippo Valsorda's avatar
      crypto: panic on illegal input and output overlap · 75d15a20
      Filippo Valsorda authored
      Normalized all panic checks and added inexact aliasing panics across
      Stream, Block, BlockMode and AEAD implementations.
      
      Also, tweaked the aliasing docs of cipher.AEAD, as they did not account
      for the append nature of the API.
      
      Fixes #21624
      
      Change-Id: I075c4415f59b3c06e3099bd9f76de6d12af086bf
      Reviewed-on: https://go-review.googlesource.com/109697
      Run-TryBot: Filippo Valsorda <filippo@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      75d15a20
    • David Chase's avatar
      cmd/compile: conditional on -race, disable inline of go:norace · c6e455bb
      David Chase authored
      Adds the appropriate check to inl.go.
      Includes tests of both -race+go:norace and plain go:norace.
      
      Fixes #24651.
      
      Change-Id: Id806342430c20baf4679a985d12eea3b677092e0
      Reviewed-on: https://go-review.googlesource.com/119195
      Run-TryBot: David Chase <drchase@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
      c6e455bb
    • Robert Griesemer's avatar
      cmd/compile: more accurate position for select case error message · 707ca18d
      Robert Griesemer authored
      Fixes #25958.
      
      Change-Id: I1f4808a70c20334ecfc4eb1789f5389d94dcf00e
      Reviewed-on: https://go-review.googlesource.com/119755Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      707ca18d
    • Carlos Eduardo Seo's avatar
      runtime: implement procyield properly for ppc64x · 1caa0629
      Carlos Eduardo Seo authored
      The procyield() function should yield the processor as in other
      architectures. On ppc64x, this is achieved by setting the Program
      Priority Register to 'low priority' prior to the spin loop, and
      setting it back to 'medium-low priority' afterwards.
      
      benchmark                          old ns/op     new ns/op     delta
      BenchmarkMakeChan/Byte-8           87.7          86.6          -1.25%
      BenchmarkMakeChan/Int-8            107           106           -0.93%
      BenchmarkMakeChan/Ptr-8            201           204           +1.49%
      BenchmarkMakeChan/Struct/0-8       78.2          79.7          +1.92%
      BenchmarkMakeChan/Struct/32-8      196           200           +2.04%
      BenchmarkMakeChan/Struct/40-8      236           230           -2.54%
      BenchmarkChanNonblocking-8         8.64          8.85          +2.43%
      BenchmarkChanUncontended-8         5577          5598          +0.38%
      BenchmarkChanContended-8           66106         51529         -22.05%
      BenchmarkChanSync-8                451           441           -2.22%
      BenchmarkChanSyncWork-8            9155          9170          +0.16%
      BenchmarkChanProdCons0-8           1585          1083          -31.67%
      BenchmarkChanProdCons10-8          1094          838           -23.40%
      BenchmarkChanProdCons100-8         831           657           -20.94%
      BenchmarkChanProdConsWork0-8       1471          941           -36.03%
      BenchmarkChanProdConsWork10-8      1033          721           -30.20%
      BenchmarkChanProdConsWork100-8     730           511           -30.00%
      BenchmarkChanCreation-8            135           128           -5.19%
      BenchmarkChanSem-8                 602           463           -23.09%
      BenchmarkChanPopular-8             3017466       2188441       -27.47%
      
      Fixes #25625
      
      Change-Id: Iacb1c888d3c066902152b8367500348fb631c5f9
      Reviewed-on: https://go-review.googlesource.com/115376
      Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      1caa0629
    • Robert Griesemer's avatar
      cmd/compile: fix exporting of 'for' loops · f125052a
      Robert Griesemer authored
      The existing code for encoding 'for' loops in exported, inlineable
      functions incorrectly assumed that the 'Right' field points to an
      'expression' node. Adjusted the code to be able to handle any kind
      of node. Made matching changes for the binary and indexed exporter.
      
      This only shows up together with other pending compiler changes that
      enable exporting of such functions which contain for loops.
      
      No tests yet because we can't test this w/o those pending compiler
      changes. Once those changes are in, this code will be tested implicitly.
      However, the changes were tested manually together with the patches
      described in the issue.
      
      Fixes #25222.
      
      Change-Id: I54babb87e5d665d2c1ef6116c1de1b8c50b1138e
      Reviewed-on: https://go-review.googlesource.com/119595Reviewed-by: 's avatarDavid Chase <drchase@google.com>
      f125052a
  4. 18 Jun, 2018 5 commits
  5. 17 Jun, 2018 3 commits
  6. 16 Jun, 2018 3 commits
  7. 15 Jun, 2018 2 commits