1. 26 Apr, 2017 19 commits
    • Justin Nuß's avatar
      encoding/csv: add option to reuse slices returned by Read · 2181653b
      Justin Nuß authored
      In many cases the records returned by Reader.Read will only be used between calls
      to Read and become garbage once a new record is read. In this case, instead of
      allocating a new slice on each call to Read, we can reuse the last allocated slice
      for successive calls to avoid unnecessary allocations.
      
      This change adds a new field ReuseRecord to the Reader struct to enable this reuse.
      
      ReuseRecord is false by default to avoid breaking existing code which dependss on
      the current behaviour.
      
      I also added 4 new benchmarks, corresponding to the existing Read benchmarks, which
      set ReuseRecord to true.
      
      Benchstat on my local machine (old is ReuseRecord = false, new is ReuseRecord = true)
      
      name                          old time/op    new time/op    delta
      Read-8                          2.75µs ± 2%    1.88µs ± 1%  -31.52%  (p=0.000 n=14+15)
      ReadWithFieldsPerRecord-8       2.75µs ± 0%    1.89µs ± 1%  -31.43%  (p=0.000 n=13+13)
      ReadWithoutFieldsPerRecord-8    2.77µs ± 1%    1.88µs ± 1%  -32.06%  (p=0.000 n=15+15)
      ReadLargeFields-8               55.4µs ± 1%    54.2µs ± 0%   -2.07%  (p=0.000 n=15+14)
      
      name                          old alloc/op   new alloc/op   delta
      Read-8                            664B ± 0%       24B ± 0%  -96.39%  (p=0.000 n=15+15)
      ReadWithFieldsPerRecord-8         664B ± 0%       24B ± 0%  -96.39%  (p=0.000 n=15+15)
      ReadWithoutFieldsPerRecord-8      664B ± 0%       24B ± 0%  -96.39%  (p=0.000 n=15+15)
      ReadLargeFields-8               3.94kB ± 0%    2.98kB ± 0%  -24.39%  (p=0.000 n=15+15)
      
      name                          old allocs/op  new allocs/op  delta
      Read-8                            18.0 ± 0%       8.0 ± 0%  -55.56%  (p=0.000 n=15+15)
      ReadWithFieldsPerRecord-8         18.0 ± 0%       8.0 ± 0%  -55.56%  (p=0.000 n=15+15)
      ReadWithoutFieldsPerRecord-8      18.0 ± 0%       8.0 ± 0%  -55.56%  (p=0.000 n=15+15)
      ReadLargeFields-8                 24.0 ± 0%      12.0 ± 0%  -50.00%  (p=0.000 n=15+15)
      
      Fixes #19721
      
      Change-Id: I79b14128bb9bb3465f53f40f93b1b528a9da6f58
      Reviewed-on: https://go-review.googlesource.com/41730Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      2181653b
    • Brandon Bennett's avatar
      testing: add argument to list tests, benchmarks, and examples · ba8ff87d
      Brandon Bennett authored
      Some large testing/build systems require some form of test discovery before
      running tests.  This usually allows for analytics, history, and stats on a per
      tests basis.  Typically these systems are meant used in multi-language
      environments and the original source code is not known or available.
      
      This adds a -test.list option which takes a regular expression as an
      argument. Any tests, benchmarks, or examples that match that regular
      expression will be printed, one per line, to stdout and then the program
      will exit.
      
      Since subtests are named/discovered at run time this will only show
      top-level tests names and is a known limitation.
      
      Fixes #17209
      
      Change-Id: I7e607f5f4f084d623a1cae88a1f70e7d92b7f13e
      Reviewed-on: https://go-review.googlesource.com/41195Reviewed-by: default avatarMarcel van Lohuizen <mpvl@golang.org>
      Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      ba8ff87d
    • Russ Cox's avatar
      context: define behavior for Err before Done is closed · 6e2c4bc0
      Russ Cox authored
      The Context definition to date has not defined what Err returns
      before the Done channel is closed. Define that it returns nil,
      as most implementations do.
      
      All the standard context implementations (those in package
      context and in golang.org/x/net/context) return Err() == nil
      when Done is not yet closed. However, some non-standard
      implementations may exist that return Err() != nil in this case,
      as permitted by the Context definition before this date.
      Call these "errorful implementations".
      
      Because all the standard context implementations ensure that
      Err() == nil when Done is not yet closed, clients now exist that
      assume Err() != nil implies Done is closed and use calling Err
      as a quick short-circuit check instead of first doing a non-blocking
      receive from Done and then, if that succeeds, needing to call Err.
      This assumption holds for all the standard Context implementations,
      so these clients work fine in practice, even though they are making
      unwarranted assumptions about the Context implementations.
      Call these "technically incorrect clients".
      
      If a technically incorrect client encounters an errorful
      implementation, the client misbehaves. Because there are few
      errorful implementations, over time we expect that many clients
      will end up being technically incorrect without realizing it,
      leading to latent, subtle bugs. If we want to eliminate these
      latent, subtle bugs, there are two ways to do this:
      either make errorful implementations more common
      (exposing the client bugs more often) or redefine the Context
      interface so that the clients are not buggy after all.
      
      If we make errorful implementations more common, such
      as by changing the standard context implementations to
      return ErrNotDone instead of nil when Err is called before
      Done is closed, this will shake out essentially all of the
      technically incorrect clients, forcing people to find and fix
      those clients during the transition to Go 1.9.
      Technically this is allowed by the compatibility policy,
      but we expect there are many pieces of code assuming
      that Err() != nil means done, so updating will cause real pain.
      
      If instead we disallow errorful implementations, then they
      will need to be fixed as they are discovered, but the fault
      will officially lie in the errorful Context implementation,
      not in the clients. Technically this is disallowed by the compatibility
      policy, because these errorful implementations were "correct"
      in earlier versions of Go, except that they didn't work with
      common client code. We expect there are hardly any errorful
      implementations, so that disallowing them will be less disruptive
      and more in the spirit of the compatibility policy.
      
      This CL takes the path of expected least disruption,
      narrowing the Context interface semantics and potentially
      invalidating existing implementations. A survey of the
      go-corpus v0.01 turned up only five Context implementations,
      all trivial and none errorful (details in #19856).
      We are aware of one early Context implementation inside Google,
      from before even golang.org/x/net/context existed,
      that is errorful. The misbehavior of an open-source library
      when passed such a context is what prompted #19856.
      That context implementation would be disallowed after this CL
      and would need to be corrected. We are aware of no other
      affected context implementations. On the other hand, a survey
      of the go-corpus v0.01 turned up many instances of client
      code assuming that Err() == nil implies not done yet
      (details also in #19856). On balance, narrowing Context and
      thereby allowing Err() == nil checks should invalidate significantly
      less code than a push to flush out all the currently technically
      incorrect Err() == nil checks.
      
      If release feedback shows that we're wrong about this balance,
      we can roll back this CL and try again in Go 1.10.
      
      Fixes #19856.
      
      Change-Id: Id45d126fac70e1fcc42d73e5a87ca1b66935b831
      Reviewed-on: https://go-review.googlesource.com/40291
      Run-TryBot: Russ Cox <rsc@golang.org>
      Reviewed-by: default avatarSameer Ajmani <sameer@golang.org>
      6e2c4bc0
    • David du Colombier's avatar
      net: fix close on closed listener on Plan 9 · 8a4087ae
      David du Colombier authored
      Since close errors have been cleaned up in CL 39997,
      TestCloseError is failing on Plan 9, because
      TCPListener.Close didn't check that the listener
      has already been closed before writing the "hangup"
      string to the listener control file.
      
      This change fixes TCPListener.Close on Plan 9,
      by closing poll.FD before writing the "hangup"
      string.
      
      Fixes #20128.
      
      Change-Id: I13862b23a9055dd1be658acef7066707d98c591f
      Reviewed-on: https://go-review.googlesource.com/41850
      Run-TryBot: David du Colombier <0intro@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      8a4087ae
    • Fangming.Fang's avatar
      cmd/internal: fix bug getting wrong indicator in DRconv() · aecf73fc
      Fangming.Fang authored
      Change-Id: I251ae497b0ab237d4b3fe98e397052394142d437
      Reviewed-on: https://go-review.googlesource.com/41653Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      aecf73fc
    • Mike Strosaker's avatar
      crypto/sha256,crypto/sha512: improve performance for sha{256,512}.block on ppc64le · 48582e15
      Mike Strosaker authored
      This updates sha256.block and sha512.block to use vector instructions.  While
      each round must still be performed independently, this allows for the use of
      the vshasigma{w,d} crypto acceleration instructions.
      
      For crypto/sha256:
      
      benchmark               old ns/op     new ns/op     delta
      BenchmarkHash8Bytes     570           300           -47.37%
      BenchmarkHash1K         7529          3018          -59.91%
      BenchmarkHash8K         55308         21938         -60.33%
      
      benchmark               old MB/s     new MB/s     speedup
      BenchmarkHash8Bytes     14.01        26.58        1.90x
      BenchmarkHash1K         136.00       339.23       2.49x
      BenchmarkHash8K         148.11       373.40       2.52x
      
      For crypto/sha512:
      
      benchmark               old ns/op     new ns/op     delta
      BenchmarkHash8Bytes     725           394           -45.66%
      BenchmarkHash1K         5062          2107          -58.38%
      BenchmarkHash8K         34711         13918         -59.90%
      
      benchmark               old MB/s     new MB/s     speedup
      BenchmarkHash8Bytes     11.03        20.29        1.84x
      BenchmarkHash1K         202.28       485.84       2.40x
      BenchmarkHash8K         236.00       588.56       2.49x
      
      Fixes #20069
      
      Change-Id: I28bffe6e9eb484a83a004116fce84acb4942abca
      Reviewed-on: https://go-review.googlesource.com/41391
      Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarCarlos Eduardo Seo <cseo@linux.vnet.ibm.com>
      Reviewed-by: default avatarDavid Chase <drchase@google.com>
      Reviewed-by: default avatarLynn Boger <laboger@linux.vnet.ibm.com>
      48582e15
    • Aliaksandr Valialkin's avatar
      runtime: align mcentral by cache line size · 259d6099
      Aliaksandr Valialkin authored
      This may improve perormance during concurrent access
      to mheap.central array from multiple CPU cores.
      
      Change-Id: I8f48dd2e72aa62e9c32de07ae60fe552d8642782
      Reviewed-on: https://go-review.googlesource.com/41550Reviewed-by: default avatarAustin Clements <austin@google.com>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      259d6099
    • Emmanuel Odeke's avatar
      net: defer file.close() + minor style cleanup · c433c374
      Emmanuel Odeke authored
      Moved the relevant file.close() usages close to after the
      file opens and put them in defer statements, so that readers
      don't have to think too much as to where the file is
      being closed.
      
      Change-Id: Ic4190b02ea2f5ac281b9ba104e0023e9f87ca8c7
      Reviewed-on: https://go-review.googlesource.com/41796Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      c433c374
    • Ian Lance Taylor's avatar
      os: consistently return ErrClosed for closed file · e3d7ec00
      Ian Lance Taylor authored
      Catch all the cases where a file operation might return ErrFileClosing,
      and convert to ErrClosed. Use a new method for the conversion, which
      permits us to remove some KeepAlive calls.
      
      Change-Id: I584178f297efe6cb86f3090b2341091b412f1041
      Reviewed-on: https://go-review.googlesource.com/41793
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      e3d7ec00
    • Josh Bleecher Snyder's avatar
      cmd/compile: move Node.Typecheck to flags · 502a03ff
      Josh Bleecher Snyder authored
      Change-Id: Id5aa4a1499068bf2d3497b21d794f970b7e47fdf
      Reviewed-on: https://go-review.googlesource.com/41795
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      502a03ff
    • Josh Bleecher Snyder's avatar
      cmd/compile: move Node.Initorder to flags · e2560ace
      Josh Bleecher Snyder authored
      Grand savings: 6 bits.
      
      Change-Id: I364be54cc41534689e01672ed0fe2c10a560d3d4
      Reviewed-on: https://go-review.googlesource.com/41794
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      e2560ace
    • Josh Bleecher Snyder's avatar
      cmd/compile: convert Node.Embedded into a flag · af7da9a5
      Josh Bleecher Snyder authored
      Change-Id: I30c59ba84dcacc3de39c42f94484b47bb7c36eba
      Reviewed-on: https://go-review.googlesource.com/41792
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      af7da9a5
    • Todd Neal's avatar
      plugin: resolve plugin import path issue · 7a92395d
      Todd Neal authored
      Resolve import paths to get plugin symbol prefixes.
      
      Fixes #19534
      
      Change-Id: Ic25d83e72465ba8f6be0337218a1627b5dc702dc
      Reviewed-on: https://go-review.googlesource.com/40994
      Run-TryBot: Todd Neal <todd@tneal.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarDavid Crawshaw <crawshaw@golang.org>
      7a92395d
    • Michael Fraenkel's avatar
      net/http: make LocalAddrContext handle wildcard interface · 819d1cce
      Michael Fraenkel authored
      The LocalAddrContext should have the network address of the actual
      interface.
      
      Fixes #18686
      
      Change-Id: I9c401eda312f3a0e7e65b013af827aeeef3b4d3d
      Reviewed-on: https://go-review.googlesource.com/35490
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      819d1cce
    • Josh Bleecher Snyder's avatar
      cmd/compile: move Node.Walkdef into flags · d2863996
      Josh Bleecher Snyder authored
      Node.Walkdef is 0, 1, or 2, so it only requires two bits.
      Add support for 2-bit values to bitset,
      and use it for Node.Walkdef.
      
      Class, Embedded, Typecheck, and Initorder will follow suit
      in subsequent CLs.
      
      The multi-bit flags will go at the beginning,
      since that generates (marginally) more efficient code.
      
      Change-Id: Id6e2e66e437f10aaa05b8a6e1652efb327d06128
      Reviewed-on: https://go-review.googlesource.com/41791
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      d2863996
    • Josh Bleecher Snyder's avatar
      cmd/compile: delete bitset16 · 804784c8
      Josh Bleecher Snyder authored
      It is no longer used.
      
      Change-Id: Id64f387867a0503d13eaecda12e6606682c24595
      Reviewed-on: https://go-review.googlesource.com/41790
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      804784c8
    • Ian Lance Taylor's avatar
      os, net, internal/poll: return consistent error for closed socket · fb4b4342
      Ian Lance Taylor authored
      In the past we returned "use of closed network connection" when using
      a closed network descriptor in some way. In CL 36799 that was changed
      to return "use of closed file or network connection". Because programs
      have no access to a value of this error type (see issue #4373) they
      resort to doing direct string comparisons (see issue #19252). This CL
      restores the old error string so that we don't break programs
      unnecessarily with the 1.9 release.
      
      This adds a test to the net package for the expected string.
      
      For symmetry check that the os package returns the expected error,
      which for os already exists as os.ErrClosed.
      
      Updates #4373.
      Fixed #19252.
      
      Change-Id: I5b83fd12cfa03501a077cad9336499b819f4a38b
      Reviewed-on: https://go-review.googlesource.com/39997
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      fb4b4342
    • Josh Bleecher Snyder's avatar
      cmd/compile: make node.hasVal into two bools · 2fb2ebc3
      Josh Bleecher Snyder authored
      In addition to being more compact,
      this makes the code a lot clearer.
      
      Change-Id: Ibcb70526c2e5913dcf34904fda194e3585228c3f
      Reviewed-on: https://go-review.googlesource.com/41761
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      2fb2ebc3
    • Josh Bleecher Snyder's avatar
      cmd/compile: make node.Likely a flag · 7f0757b3
      Josh Bleecher Snyder authored
      node.Likely may once have held -1/0/+1,
      but it is now only 0/1.
      
      With improved SSA heuristics,
      it may someday go away entirely.
      
      Change-Id: I6451d17fd7fb47e67fea4d39df302b6db00ea57b
      Reviewed-on: https://go-review.googlesource.com/41760
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      7f0757b3
  2. 25 Apr, 2017 21 commits
    • Daniel Martí's avatar
      html/template: use bytes.ContainsAny · 6049b174
      Daniel Martí authored
      It was added in Go 1.7. Also gofmt while at it.
      
      Change-Id: Idb65fb44e2f2a4365dceea3f833aeb51a8d12333
      Reviewed-on: https://go-review.googlesource.com/41692
      Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      6049b174
    • Brad Fitzpatrick's avatar
      cmd/dist: disable internal linking tests on Alpine · 6f45e37b
      Brad Fitzpatrick authored
      Updates #18243
      
      Change-Id: I1fe0af65dbd52c3e8e0a245e4cbbdfca100971b4
      Reviewed-on: https://go-review.googlesource.com/41759
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
      6f45e37b
    • Brad Fitzpatrick's avatar
      net/http: update bundled x/net/http2 · 0d3143ea
      Brad Fitzpatrick authored
      This updates the bundled http2 package from git rev
      5602c733f70afc6dcec6766be0d5034d4c4f14de of the x/net repo for:
      
        http2: Use NO_ERROR instead of CANCEL when responding before the request is finished
        https://golang.org/cl/40630
      
        http2: enforce write deadline per stream
        https://golang.org/cl/34727
      
      Updates golang/go#19948
      Fixes golang/go#18437
      
      Change-Id: I14500476e91551fa8f27a1aeb8ae3cac9600b74c
      Reviewed-on: https://go-review.googlesource.com/41753Reviewed-by: default avatarKale Blankenship <kale@lemnisys.com>
      Reviewed-by: default avatarTom Bergan <tombergan@google.com>
      Run-TryBot: Kale Blankenship <kale@lemnisys.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      0d3143ea
    • Mikio Hara's avatar
      vendor: update vendored route · e10af2e8
      Mikio Hara authored
      Updates golang_org/x/net/route to rev da118f7 for:
      - route: don't fail test when at least one version of INET protocols is available
      
      Updates #19298.
      Updates #19967.
      
      Change-Id: I46948f1bd4ac6e6afd424623233f90e2b6b954c6
      Reviewed-on: https://go-review.googlesource.com/41652
      Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      e10af2e8
    • Mikio Hara's avatar
      vendor: update vendored lif · 9cb004be
      Mikio Hara authored
      Updates golang_org/x/net/lif to rev a25ba90 for:
      - lif: don't fail test when at least one version of INET protocols is available
      
      Updates #19967.
      
      Change-Id: I4b946a4c6eee7938193688ecbfc4a9d69d88c94e
      Reviewed-on: https://go-review.googlesource.com/41651
      Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      9cb004be
    • Mikio Hara's avatar
      runtime: adjust netpoll panic messages · 91c9b0d5
      Mikio Hara authored
      Change-Id: I34547b057605bb9e1e2227c41867589348560244
      Reviewed-on: https://go-review.googlesource.com/41513
      Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      91c9b0d5
    • Brad Fitzpatrick's avatar
      net/http/cgi: fix plan9 build · 5d306dcd
      Brad Fitzpatrick authored
      Cleanup CL https://golang.org/cl/41691 broke the plan9 build by removing
      a use of a package but not removing the package import.
      
      Trybots don't check that. I filed #20119 for that.
      
      Change-Id: Ia030e6924665dfb871ca964455b899d51b0200c2
      Reviewed-on: https://go-review.googlesource.com/41752Reviewed-by: default avatarDavid du Colombier <0intro@gmail.com>
      5d306dcd
    • Brad Fitzpatrick's avatar
      cmd/go, cmd/dist: temporarily disable race and PIE internal link tests on Alpine · 7fc82104
      Brad Fitzpatrick authored
      In an effort to at least understand the complete set of things not
      working on Alpine Linux, I've been trying to get the build passing
      again, even with tests disabled.
      
      The race detector is broken on Alpine. That is #14481 (and #9918).
      So disable those tests for now.
      
      Also, internal linking with PIE doesn't work on Alpine yet.
      That is #18243. So disable that test for now.
      
      With this CL, all.bash almost passes. There's some cgo test failing
      still, but there's no bug yet, so that can be a separate CL.
      
      Change-Id: I3ffbb0e787ed54cb82f298b6bd5bf3ccfbc82622
      Reviewed-on: https://go-review.googlesource.com/41678
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      7fc82104
    • Josh Bleecher Snyder's avatar
      go/internal/gcimporter: add test object files for go1.8 versions 4 and 5 · b692e749
      Josh Bleecher Snyder authored
      Version 4 generated with toolchain at commit 51012314.
      Version 5 generated with toolchain at commit a6b16e00.
      
      Change-Id: If11ec8b3357f0f71776c15665e4d5228b3842ff7
      Reviewed-on: https://go-review.googlesource.com/41710
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      b692e749
    • Josh Bleecher Snyder's avatar
      cmd/compile: improve efficiency of binary export position encoding · a6b16e00
      Josh Bleecher Snyder authored
      Use -64 instead of 0 as the magic "new file"
      line delta, since it is much less common.
      
      Use a new path encoding that breaks up paths
      into /-separated components, allowing
      reuse of the component strings, and making
      many re-used paths a single byte to encode.
      
      Bump the export version to 5.
      
      Fixes #20080
      
      name        old export-bytes  new export-bytes  delta
      Template          19.1k ± 0%        17.4k ± 0%  -8.74%  (p=0.008 n=5+5)
      Unicode           4.47k ± 0%        4.42k ± 0%  -0.96%  (p=0.008 n=5+5)
      GoTypes           29.9k ± 0%        27.6k ± 0%  -7.41%  (p=0.008 n=5+5)
      Compiler          71.4k ± 0%        65.4k ± 0%  -8.45%  (p=0.008 n=5+5)
      SSA               67.8k ± 0%        65.6k ± 0%  -3.38%  (p=0.008 n=5+5)
      Flate             4.99k ± 0%        4.79k ± 0%  -3.91%  (p=0.008 n=5+5)
      GoParser          8.77k ± 0%        7.97k ± 0%  -9.14%  (p=0.008 n=5+5)
      Reflect           6.27k ± 0%        6.13k ± 0%  -2.22%  (p=0.008 n=5+5)
      Tar               9.46k ± 0%        8.82k ± 0%  -6.69%  (p=0.008 n=5+5)
      XML               16.0k ± 0%        14.9k ± 0%  -6.69%  (p=0.008 n=5+5)
      [Geo mean]        14.8k             14.0k       -5.80%
      
      Change-Id: Iea0c8c62e61dbab3cfd14ee121e34845c85f00d2
      Reviewed-on: https://go-review.googlesource.com/41619
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      a6b16e00
    • griesemer's avatar
      cmd/compile: factor out access to thisT · 51012314
      griesemer authored
      isifacemethod accessed thisT without checking if it was initialized,
      opening the possibility for a bug during type checking. Give better
      name, move it to package types, and provide accessor instead.
      
      Change-Id: I29ffc408252a4ba4ef1de218fa154397786c9be6
      Reviewed-on: https://go-review.googlesource.com/41673Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      51012314
    • Damien Lespiau's avatar
      cmd/internal/obj/x86: port the doasm comment to go · 4e5593dd
      Damien Lespiau authored
      This comment is very useful but still refers to the C implementation.
      Adapting it for Go is fairly straightforward though.
      
      Change-Id: Ib6dde25f3a18acbce76bb3cffdc29f5ccf43c1f7
      Reviewed-on: https://go-review.googlesource.com/41696Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      4e5593dd
    • Michael Munday's avatar
      cmd: fix the order that s390x operands are printed in · db6f3bbc
      Michael Munday authored
      The assembler reordered the operands of some instructions to put the
      first operand into From3. Unfortunately this meant that when the
      instructions were printed the operands were in a different order than
      the assembler would expect as input. For example, 'MVC $8, (R1), (R2)'
      would be printed as 'MVC (R1), $8, (R2)'.
      
      Originally this was done to ensure that From contained the source
      memory operand. The current compiler no longer requires this and so
      this CL simply makes all instructions use the standard order for
      operands: From, Reg, From3 and finally To.
      
      Fixes #18295
      
      Change-Id: Ib2b5ec29c647ca7a995eb03dc78f82d99618b092
      Reviewed-on: https://go-review.googlesource.com/40299
      Run-TryBot: Michael Munday <munday@ca.ibm.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      db6f3bbc
    • Daniel Martí's avatar
      regexp: remove redundant break · 7d547b64
      Daniel Martí authored
      Breaks are implicit, and since there is no outer loop this one could not
      mean a loop break that was missing a label.
      
      Change-Id: Ie91018db1825aa8285c1aa55c9d28fc7ec7148af
      Reviewed-on: https://go-review.googlesource.com/39691
      Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      7d547b64
    • Daniel Martí's avatar
      all: remove some unused parameters in test code · 516e6f6d
      Daniel Martí authored
      Mostly unnecessary *testing.T arguments.
      
      Found with github.com/mvdan/unparam.
      
      Change-Id: Ifb955cb88f2ce8784ee4172f4f94d860fa36ae9a
      Reviewed-on: https://go-review.googlesource.com/41691
      Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      516e6f6d
    • Ian Lance Taylor's avatar
      os: fix race between file I/O and Close · 11c7b449
      Ian Lance Taylor authored
      Now that the os package uses internal/poll on Unix and Windows systems,
      it can rely on internal/poll reference counting to ensure that the
      file descriptor is not closed until all I/O is complete.
      
      That was already working. This CL completes the job by not trying to
      modify the Sysfd field when it might still be used by the I/O routines.
      
      Fixes #7970
      
      Change-Id: I7a3daa1a6b07b7345bdce6f0cd7164bd4eaee952
      Reviewed-on: https://go-review.googlesource.com/41674Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      11c7b449
    • Carlos Eduardo Seo's avatar
      math/big: improve performance for addVV/subVV for ppc64x · 9459c03b
      Carlos Eduardo Seo authored
      This change adds a better asm implementation of addVV for ppc64x, with speedups
      up to nearly 3x in the best cases.
      
      benchmark                   old ns/op     new ns/op     delta
      BenchmarkAddVV/1-8          7.33          5.81          -20.74%
      BenchmarkAddVV/2-8          8.72          6.49          -25.57%
      BenchmarkAddVV/3-8          10.5          7.08          -32.57%
      BenchmarkAddVV/4-8          12.7          7.57          -40.39%
      BenchmarkAddVV/5-8          14.3          8.06          -43.64%
      BenchmarkAddVV/10-8         27.6          11.1          -59.78%
      BenchmarkAddVV/100-8        218           82.4          -62.20%
      BenchmarkAddVV/1000-8       2064          718           -65.21%
      BenchmarkAddVV/10000-8      20536         7153          -65.17%
      BenchmarkAddVV/100000-8     211004        72403         -65.69%
      
      benchmark                   old MB/s     new MB/s     speedup
      BenchmarkAddVV/1-8          8729.74      11006.26     1.26x
      BenchmarkAddVV/2-8          14683.65     19707.55     1.34x
      BenchmarkAddVV/3-8          18226.96     27103.63     1.49x
      BenchmarkAddVV/4-8          20204.50     33805.81     1.67x
      BenchmarkAddVV/5-8          22348.64     39694.06     1.78x
      BenchmarkAddVV/10-8         23212.74     57631.08     2.48x
      BenchmarkAddVV/100-8        29300.07     77629.53     2.65x
      BenchmarkAddVV/1000-8       31000.56     89094.54     2.87x
      BenchmarkAddVV/10000-8      31163.61     89469.16     2.87x
      BenchmarkAddVV/100000-8     30331.16     88393.73     2.91x
      
      It also adds the use of CTR for the loop counter in subVV, instead of
      manually updating the loop counter. This is slightly faster.
      
      Change-Id: Ic4b05cad384fd057972d46a5618ed5c3039d7460
      Reviewed-on: https://go-review.googlesource.com/41010
      Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarLynn Boger <laboger@linux.vnet.ibm.com>
      9459c03b
    • Ben Shi's avatar
      cmd/internal/obj/arm: use new form of MOVW introduced in ARMv7 · a0418063
      Ben Shi authored
      As discussion in issue #18293, "MOVW $Imm-16, Reg" was introduced in
      ARMv7. It directly encoded the 16-bit immediate into the instruction
      instead of put it in the constant pool.
      
      This patch makes the arm assembler choose this form of MOVW if available.
      
      Besides 4 bytes are saved in the constant pool, the go1 benchmark test
      also shows a slight improvement.
      
      name                     old time/op    new time/op    delta
      BinaryTree17-4              42.7s ± 1%     42.7s ± 1%    ~     (p=0.304 n=50+50)
      Fannkuch11-4                24.8s ± 1%     24.8s ± 0%    ~     (p=0.757 n=50+49)
      FmtFprintfEmpty-4           875ns ± 1%     873ns ± 2%    ~     (p=0.066 n=44+46)
      FmtFprintfString-4         1.43µs ± 1%    1.45µs ± 1%  +1.68%  (p=0.000 n=44+44)
      FmtFprintfInt-4            1.52µs ± 1%    1.52µs ± 1%  +0.26%  (p=0.009 n=41+45)
      FmtFprintfIntInt-4         2.19µs ± 1%    2.20µs ± 1%  +0.76%  (p=0.000 n=43+46)
      FmtFprintfPrefixedInt-4    2.56µs ± 2%    2.53µs ± 1%  -1.03%  (p=0.000 n=45+44)
      FmtFprintfFloat-4          4.41µs ± 1%    4.39µs ± 1%  -0.52%  (p=0.000 n=44+44)
      FmtManyArgs-4              9.02µs ± 2%    9.04µs ± 1%  +0.27%  (p=0.000 n=46+44)
      GobDecode-4                 106ms ± 1%     106ms ± 1%    ~     (p=0.310 n=45+43)
      GobEncode-4                88.1ms ± 2%    88.0ms ± 2%    ~     (p=0.648 n=49+50)
      Gzip-4                      4.31s ± 1%     4.27s ± 1%  -1.01%  (p=0.000 n=50+50)
      Gunzip-4                    618ms ± 1%     608ms ± 1%  -1.65%  (p=0.000 n=45+47)
      HTTPClientServer-4          689µs ± 6%     692µs ± 4%  +0.52%  (p=0.038 n=50+47)
      JSONEncode-4                282ms ± 2%     280ms ± 1%  -0.75%  (p=0.000 n=46+43)
      JSONDecode-4                945ms ± 2%     940ms ± 1%  -0.47%  (p=0.000 n=47+47)
      Mandelbrot200-4            49.4ms ± 1%    49.3ms ± 1%    ~     (p=0.163 n=45+45)
      GoParse-4                  46.0ms ± 3%    45.5ms ± 2%  -0.95%  (p=0.000 n=49+40)
      RegexpMatchEasy0_32-4      1.29µs ± 1%    1.28µs ± 1%  -0.14%  (p=0.005 n=38+45)
      RegexpMatchEasy0_1K-4      7.92µs ± 8%    7.75µs ± 6%  -2.12%  (p=0.000 n=47+50)
      RegexpMatchEasy1_32-4      1.31µs ± 1%    1.31µs ± 0%    ~     (p=0.282 n=45+48)
      RegexpMatchEasy1_1K-4      10.4µs ± 5%    10.4µs ± 3%    ~     (p=0.771 n=50+49)
      RegexpMatchMedium_32-4     2.06µs ± 1%    2.07µs ± 1%  +0.35%  (p=0.001 n=44+49)
      RegexpMatchMedium_1K-4      533µs ± 1%     532µs ± 1%    ~     (p=0.710 n=43+47)
      RegexpMatchHard_32-4       29.7µs ± 1%    29.6µs ± 1%  -0.34%  (p=0.002 n=43+46)
      RegexpMatchHard_1K-4        893µs ± 2%     885µs ± 1%  -0.85%  (p=0.000 n=50+45)
      Revcomp-4                  85.6ms ± 4%    85.5ms ± 2%    ~     (p=0.683 n=50+50)
      Template-4                  1.05s ± 3%     1.04s ± 1%  -1.06%  (p=0.000 n=50+44)
      TimeParse-4                7.19µs ± 2%    7.11µs ± 2%  -1.10%  (p=0.000 n=48+46)
      TimeFormat-4               13.4µs ± 1%    13.5µs ± 1%    ~     (p=0.056 n=46+49)
      [Geo mean]                  747µs          745µs       -0.28%
      
      name                     old speed      new speed      delta
      GobDecode-4              7.23MB/s ± 1%  7.22MB/s ± 1%    ~     (p=0.062 n=45+39)
      GobEncode-4              8.71MB/s ± 2%  8.72MB/s ± 2%    ~     (p=0.656 n=49+50)
      Gzip-4                   4.50MB/s ± 1%  4.55MB/s ± 1%  +1.03%  (p=0.000 n=50+50)
      Gunzip-4                 31.4MB/s ± 1%  31.9MB/s ± 1%  +1.67%  (p=0.000 n=45+47)
      JSONEncode-4             6.89MB/s ± 2%  6.94MB/s ± 1%  +0.76%  (p=0.000 n=46+43)
      JSONDecode-4             2.05MB/s ± 2%  2.06MB/s ± 2%  +0.32%  (p=0.017 n=47+50)
      GoParse-4                1.26MB/s ± 3%  1.27MB/s ± 1%  +0.68%  (p=0.000 n=50+48)
      RegexpMatchEasy0_32-4    24.9MB/s ± 1%  24.9MB/s ± 1%  +0.13%  (p=0.004 n=38+45)
      RegexpMatchEasy0_1K-4     129MB/s ± 7%   132MB/s ± 6%  +2.34%  (p=0.000 n=46+50)
      RegexpMatchEasy1_32-4    24.5MB/s ± 1%  24.4MB/s ± 1%    ~     (p=0.252 n=45+48)
      RegexpMatchEasy1_1K-4    98.8MB/s ± 4%  98.7MB/s ± 3%    ~     (p=0.771 n=50+49)
      RegexpMatchMedium_32-4    485kB/s ± 3%   480kB/s ± 0%  -0.95%  (p=0.000 n=50+38)
      RegexpMatchMedium_1K-4   1.92MB/s ± 1%  1.92MB/s ± 1%    ~     (p=0.129 n=43+47)
      RegexpMatchHard_32-4     1.08MB/s ± 2%  1.08MB/s ± 1%  +0.38%  (p=0.017 n=46+46)
      RegexpMatchHard_1K-4     1.15MB/s ± 2%  1.16MB/s ± 1%  +0.67%  (p=0.001 n=50+49)
      Revcomp-4                29.7MB/s ± 4%  29.7MB/s ± 2%    ~     (p=0.682 n=50+50)
      Template-4               1.85MB/s ± 3%  1.87MB/s ± 1%  +1.04%  (p=0.000 n=50+44)
      [Geo mean]               6.56MB/s       6.60MB/s       +0.47%
      
      
      Change-Id: Ic2cca90133c27a08d9f1a23c65b0eed5fbd02684
      Reviewed-on: https://go-review.googlesource.com/41190
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      a0418063
    • Brad Fitzpatrick's avatar
      runtime: ignore TestCgoPprofPIE test failures on Alpine (take 2) · 34ee8ec1
      Brad Fitzpatrick authored
      s/arm64/amd64/ in previous typo CL 41628
      
      Updates #19938
      Updates #18243
      
      Change-Id: I282244ee3c94535f229a87b6246382385ff64428
      Reviewed-on: https://go-review.googlesource.com/41675Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      34ee8ec1
    • Martin Möhrmann's avatar
      runtime: simplify detection of preference to use AVX memmove · b64e8178
      Martin Möhrmann authored
      Reduces cmd/go by 4464 bytes on amd64.
      
      Removes the duplicate detection of AVX support and
      presence of Intel processors.
      
      Change-Id: I4670189951a63760fae217708f68d65e94a30dc5
      Reviewed-on: https://go-review.googlesource.com/41570Reviewed-by: default avatarKeith Randall <khr@golang.org>
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      b64e8178
    • Brad Fitzpatrick's avatar
      runtime: ignore TestCgoPprofPIE test failures on Alpine · 16271b8b
      Brad Fitzpatrick authored
      Updates #19938
      Updates #18243
      
      Change-Id: Ib6e704c0a5d596bdfaa6493902d2528bec55bf16
      Reviewed-on: https://go-review.googlesource.com/41628Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      16271b8b