1. 26 Apr, 2017 23 commits
    • Bryan C. Mills's avatar
      sync: import Map from x/sync/syncmap · 959025c0
      Bryan C. Mills authored
      This is a direct port of the version from
      commit a60ad46e0ed33d02e09bda439efaf9c9727dbc6c
      (https://go-review.googlesource.com/c/37342/).
      
      updates #17973
      updates #18177
      
      Change-Id: I63fa5ef6951b1edd39f84927d1181a4df9b15385
      Reviewed-on: https://go-review.googlesource.com/36617Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      959025c0
    • Josh Bleecher Snyder's avatar
      cmd/compile: minor cleanup · e1a7db7f
      Josh Bleecher Snyder authored
      Follow-up to review comments on CL 41797.
      
      Mask the input to set2 and set3, so that at the very least,
      we won't corrupt the rest of the flags in case of a bad input.
      It also seems more semantically appropriate.
      
      Do minor cleanup in addrescapes. I started on larger cleanup,
      but it wasn't clear that it was an improvement.
      
      Add warning comments and sanity checks to Initorder and Class constants,
      to attempt to prevent them from overflowing their allotted flag bits.
      
      Passes toolstash-check.
      
      Change-Id: I57b9661ba36f56406aa7a1d8da9b7c70338f9119
      Reviewed-on: https://go-review.googlesource.com/41817
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      e1a7db7f
    • Lynn Boger's avatar
      cmd/internal/obj/ppc64: use MOVDU to update stack reg for leaf functions where possible · 6910e108
      Lynn Boger authored
      When the stack register is decremented to acquire stack space at
      the beginning of a function, a MOVDU should be used so it is done
      atomically, unless the size of the stack frame is too large for
      that instruction.  The code to determine whether to use MOVDU
      or MOVD was checking if the function was a leaf and always generating MOVD
      when it was.  The choice of MOVD vs. MOVDU should only depend on the stack
      frame size.  This fixes that problem.
      
      Change-Id: I0e49c79036f1e8f7584179e1442b938fc6da085f
      Reviewed-on: https://go-review.googlesource.com/41813Reviewed-by: 's avatarMichael Munday <munday@ca.ibm.com>
      6910e108
    • Josh Bleecher Snyder's avatar
      cmd/compile: move Node.Class to flags · 386765af
      Josh Bleecher Snyder authored
      Put it at position zero, since it is fairly hot.
      
      This shrinks gc.Node into a smaller size class on 64 bit systems.
      
      name        old time/op       new time/op       delta
      Template          193ms ± 5%        192ms ± 3%    ~     (p=0.353 n=94+93)
      Unicode          86.1ms ± 5%       85.0ms ± 4%  -1.23%  (p=0.000 n=95+98)
      GoTypes           546ms ± 3%        544ms ± 4%  -0.40%  (p=0.007 n=94+97)
      Compiler          2.56s ± 3%        2.54s ± 3%  -0.67%  (p=0.000 n=99+97)
      SSA               5.13s ± 2%        5.10s ± 3%  -0.55%  (p=0.000 n=94+98)
      Flate             122ms ± 6%        121ms ± 4%  -0.75%  (p=0.002 n=97+95)
      GoParser          144ms ± 5%        144ms ± 4%    ~     (p=0.298 n=98+97)
      Reflect           348ms ± 4%        349ms ± 4%    ~     (p=0.350 n=98+97)
      Tar               105ms ± 5%        104ms ± 5%    ~     (p=0.154 n=96+98)
      XML               200ms ± 5%        198ms ± 4%  -0.71%  (p=0.015 n=97+98)
      [Geo mean]        330ms             328ms       -0.52%
      
      name        old user-time/op  new user-time/op  delta
      Template          229ms ±11%        224ms ± 7%  -2.16%  (p=0.001 n=100+87)
      Unicode           109ms ± 5%        109ms ± 6%    ~     (p=0.897 n=96+91)
      GoTypes           712ms ± 4%        709ms ± 4%    ~     (p=0.085 n=96+98)
      Compiler          3.41s ± 3%        3.36s ± 3%  -1.43%  (p=0.000 n=98+98)
      SSA               7.46s ± 3%        7.31s ± 3%  -2.02%  (p=0.000 n=100+99)
      Flate             145ms ± 6%        143ms ± 6%  -1.11%  (p=0.001 n=99+97)
      GoParser          177ms ± 5%        176ms ± 5%  -0.78%  (p=0.018 n=95+95)
      Reflect           432ms ± 7%        435ms ± 9%    ~     (p=0.296 n=100+100)
      Tar               121ms ± 7%        121ms ± 5%    ~     (p=0.072 n=100+95)
      XML               241ms ± 4%        239ms ± 5%    ~     (p=0.085 n=97+99)
      [Geo mean]        413ms             410ms       -0.73%
      
      name        old alloc/op      new alloc/op      delta
      Template         38.4MB ± 0%       37.7MB ± 0%  -1.85%  (p=0.008 n=5+5)
      Unicode          30.1MB ± 0%       28.8MB ± 0%  -4.09%  (p=0.008 n=5+5)
      GoTypes           112MB ± 0%        110MB ± 0%  -1.69%  (p=0.008 n=5+5)
      Compiler          470MB ± 0%        461MB ± 0%  -1.91%  (p=0.008 n=5+5)
      SSA              1.13GB ± 0%       1.11GB ± 0%  -1.70%  (p=0.008 n=5+5)
      Flate            25.0MB ± 0%       24.6MB ± 0%  -1.67%  (p=0.008 n=5+5)
      GoParser         31.6MB ± 0%       31.1MB ± 0%  -1.66%  (p=0.008 n=5+5)
      Reflect          77.1MB ± 0%       75.8MB ± 0%  -1.69%  (p=0.008 n=5+5)
      Tar              26.3MB ± 0%       25.7MB ± 0%  -2.06%  (p=0.008 n=5+5)
      XML              41.9MB ± 0%       41.1MB ± 0%  -1.93%  (p=0.008 n=5+5)
      [Geo mean]       73.5MB            72.0MB       -2.03%
      
      name        old allocs/op     new allocs/op     delta
      Template           383k ± 0%         383k ± 0%    ~     (p=0.690 n=5+5)
      Unicode            343k ± 0%         343k ± 0%    ~     (p=0.841 n=5+5)
      GoTypes           1.16M ± 0%        1.16M ± 0%    ~     (p=0.310 n=5+5)
      Compiler          4.43M ± 0%        4.42M ± 0%  -0.17%  (p=0.008 n=5+5)
      SSA               9.85M ± 0%        9.85M ± 0%    ~     (p=0.310 n=5+5)
      Flate              236k ± 0%         236k ± 1%    ~     (p=0.841 n=5+5)
      GoParser           320k ± 0%         320k ± 0%    ~     (p=0.421 n=5+5)
      Reflect            988k ± 0%         987k ± 0%    ~     (p=0.690 n=5+5)
      Tar                252k ± 0%         251k ± 0%    ~     (p=0.095 n=5+5)
      XML                399k ± 0%         399k ± 0%    ~     (p=1.000 n=5+5)
      [Geo mean]         741k              740k       -0.07%
      
      Change-Id: I9e952b58a98e30a12494304db9ce50d0a85e459c
      Reviewed-on: https://go-review.googlesource.com/41797
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: 's avatarMarvin Stenger <marvin.stenger94@gmail.com>
      386765af
    • 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: 's 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: 's 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: 's 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: 's 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: 's 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: 's avatarCarlos Eduardo Seo <cseo@linux.vnet.ibm.com>
      Reviewed-by: 's avatarDavid Chase <drchase@google.com>
      Reviewed-by: 's 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: 's avatarAustin Clements <austin@google.com>
      Reviewed-by: 's 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: 's 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: 's 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: 's 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: 's 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: 's 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: 's 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: 's 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: 's 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: 's 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: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: 's 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: 's 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: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      7f0757b3
  2. 25 Apr, 2017 17 commits