1. 10 Feb, 2017 1 commit
    • Robert Griesemer's avatar
      cmd/compile/internal/syntax: removed gcCompat code needed to pass orig. tests · 3fd3171c
      Robert Griesemer authored
      The gcCompat mode was introduced to match the new parser's node position
      setup exactly with the positions used by the original parser. Some of the
      gcCompat adjustments were required to satisfy syntax error test cases,
      and the rest were required to make toolstash cmp pass.
      
      This change removes the former gcCompat adjustments and instead adjusts
      the respective test cases as necessary. In some cases this makes the error
      lines consistent with the ones reported by gccgo.
      
      Where it has changed, the position associated with a given syntactic construct
      is the position (line/col number) of the left-most token belonging to the
      construct.
      
      Change-Id: I5b60c00c5999a895c4d6d6e9b383c6405ccf725c
      Reviewed-on: https://go-review.googlesource.com/36695
      Run-TryBot: Robert Griesemer <gri@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      3fd3171c
  2. 09 Feb, 2017 25 commits
  3. 08 Feb, 2017 14 commits
    • Ian Lance Taylor's avatar
      net: merge FreeBSD and DragonFly sendfile support · 27520cc4
      Ian Lance Taylor authored
      The two files were identical except for comments.
      
      Change-Id: Ifc300026c8e4584afa50a7b669099eaff146ea5d
      Reviewed-on: https://go-review.googlesource.com/36631
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      27520cc4
    • David du Colombier's avatar
      cmd/gofmt: fix diff on Plan 9 · 12991a75
      David du Colombier authored
      On Plan 9, GNU diff is called ape/diff.
      
      Fixes #18999.
      
      Change-Id: I7cf6c23c97bcc47172bbf838fd9dd72aefa4c18b
      Reviewed-on: https://go-review.googlesource.com/36650Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: David du Colombier <0intro@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      12991a75
    • Dmitri Shuralyov's avatar
      net/http: don't modify Request in StripPrefix · af59742d
      Dmitri Shuralyov authored
      As of https://golang.org/cl/21530, rules are updated to state
      that Handlers shouldn't modify the provided Request. This change
      updates StripPrefix to follow that rule.
      
      Resolves #18952.
      
      Change-Id: I29bbb580722e871131fa75a97e6e038ec64fdfcd
      Reviewed-on: https://go-review.googlesource.com/36483Reviewed-by: default avatarMatt Layher <mdlayher@gmail.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Matt Layher <mdlayher@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      af59742d
    • Cherry Zhang's avatar
      cmd/compile: handle DOT STRUCTLIT for zero-valued struct in SSA · a146dd3a
      Cherry Zhang authored
      CL 35261 makes SSA handle zero-valued STRUCTLIT, but DOT operation
      was not handled.
      
      Fixes #18994.
      
      Change-Id: Ic7976036acca1523b0b14afac4d170797e8aee20
      Reviewed-on: https://go-review.googlesource.com/36565
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      a146dd3a
    • David Lazar's avatar
      cmd/compile: include linknames in export data · e3efdffa
      David Lazar authored
      This lets the compiler inline functions that contain a linknamed symbol.
      Previously, the net/http tests would fail to build with -l=4 because
      the compiler inlined functions that call net.byteIndex (which is
      linknamed to strings.IndexByte).
      
      This changes only the compiler-specific export data, so we don't need to
      bump the export format version number.
      
      The following benchmark results show how the size of package export data
      is impacted by this change. These benchmarks were created by compiling
      the go1 benchmark and running `go tool pack x` to extract the export
      data from the resulting .a files.
      
      name                                          old bytes   new bytes   delta
      bufio                                        3.48k ± 0%  3.58k ± 0%  +2.90%
      bytes                                        5.05k ± 0%  5.16k ± 0%  +2.16%
      compress/bzip2                               2.61k ± 0%  2.68k ± 0%  +2.68%
      compress/flate                               5.07k ± 0%  5.14k ± 0%  +1.40%
      compress/gzip                                8.26k ± 0%  8.40k ± 0%  +1.70%
      container/list                               1.69k ± 0%  1.76k ± 0%  +4.07%
      context                                      3.93k ± 0%  4.01k ± 0%  +1.86%
      crypto                                       1.03k ± 0%  1.03k ± 0%  +0.39%
      crypto/aes                                     475 ± 0%    475 ± 0%  +0.00%
      crypto/cipher                                1.18k ± 0%  1.18k ± 0%  +0.00%
      crypto/des                                     502 ± 0%    502 ± 0%  +0.00%
      crypto/dsa                                   5.71k ± 0%  5.77k ± 0%  +1.16%
      crypto/ecdsa                                 6.67k ± 0%  6.75k ± 0%  +1.08%
      crypto/elliptic                              6.28k ± 0%  6.35k ± 0%  +1.07%
      crypto/hmac                                    464 ± 0%    464 ± 0%  +0.00%
      crypto/internal/cipherhw                       313 ± 0%    313 ± 0%  +0.00%
      crypto/md5                                     691 ± 0%    695 ± 0%  +0.58%
      crypto/rand                                  5.37k ± 0%  5.43k ± 0%  +1.23%
      crypto/rc4                                     512 ± 0%    512 ± 0%  +0.00%
      crypto/rsa                                   7.05k ± 0%  7.12k ± 0%  +1.05%
      crypto/sha1                                    756 ± 0%    760 ± 0%  +0.53%
      crypto/sha256                                  523 ± 0%    523 ± 0%  +0.00%
      crypto/sha512                                  662 ± 0%    662 ± 0%  +0.00%
      crypto/subtle                                  835 ± 0%    873 ± 0%  +4.55%
      crypto/tls                                   28.1k ± 0%  28.5k ± 0%  +1.30%
      crypto/x509                                  17.7k ± 0%  17.9k ± 0%  +1.04%
      crypto/x509/pkix                             9.75k ± 0%  9.90k ± 0%  +1.50%
      encoding                                       473 ± 0%    473 ± 0%  +0.00%
      encoding/asn1                                1.41k ± 0%  1.42k ± 0%  +1.00%
      encoding/base64                              1.67k ± 0%  1.69k ± 0%  +0.90%
      encoding/binary                              2.65k ± 0%  2.76k ± 0%  +4.07%
      encoding/gob                                 13.3k ± 0%  13.5k ± 0%  +1.65%
      encoding/hex                                   854 ± 0%    857 ± 0%  +0.35%
      encoding/json                                11.9k ± 0%  12.1k ± 0%  +1.71%
      encoding/pem                                   484 ± 0%    484 ± 0%  +0.00%
      errors                                         360 ± 0%    361 ± 0%  +0.28%
      flag                                         7.32k ± 0%  7.42k ± 0%  +1.48%
      fmt                                          1.42k ± 0%  1.42k ± 0%  +0.00%
      go/ast                                       15.7k ± 0%  15.8k ± 0%  +1.07%
      go/parser                                    7.48k ± 0%  7.59k ± 0%  +1.55%
      go/scanner                                   3.88k ± 0%  3.94k ± 0%  +1.39%
      go/token                                     3.51k ± 0%  3.53k ± 0%  +0.60%
      hash                                           507 ± 0%    507 ± 0%  +0.00%
      hash/crc32                                     685 ± 0%    685 ± 0%  +0.00%
      internal/nettrace                              474 ± 0%    474 ± 0%  +0.00%
      internal/pprof/profile                       8.29k ± 0%  8.36k ± 0%  +0.89%
      internal/race                                  511 ± 0%    511 ± 0%  +0.00%
      internal/singleflight                          966 ± 0%    969 ± 0%  +0.31%
      internal/syscall/unix                          427 ± 0%    427 ± 0%  +0.00%
      io                                           3.48k ± 0%  3.52k ± 0%  +1.15%
      io/ioutil                                    5.30k ± 0%  5.38k ± 0%  +1.53%
      log                                          4.46k ± 0%  4.53k ± 0%  +1.59%
      math                                         3.72k ± 0%  3.75k ± 0%  +0.75%
      math/big                                     8.91k ± 0%  9.01k ± 0%  +1.15%
      math/rand                                    1.29k ± 0%  1.30k ± 0%  +0.46%
      mime                                         2.59k ± 0%  2.63k ± 0%  +1.55%
      mime/multipart                               3.61k ± 0%  3.68k ± 0%  +1.80%
      mime/quotedprintable                         2.20k ± 0%  2.25k ± 0%  +2.50%
      net                                          21.1k ± 0%  21.3k ± 0%  +1.10%
      net/http                                     56.6k ± 0%  57.3k ± 0%  +1.28%
      net/http/httptest                            33.6k ± 0%  34.1k ± 0%  +1.38%
      net/http/httptrace                           14.4k ± 0%  14.5k ± 0%  +1.29%
      net/http/internal                            2.70k ± 0%  2.77k ± 0%  +2.59%
      net/textproto                                4.51k ± 0%  4.60k ± 0%  +1.82%
      net/url                                      1.71k ± 0%  1.73k ± 0%  +1.41%
      os                                           11.3k ± 0%  11.4k ± 0%  +1.36%
      path                                           587 ± 0%    589 ± 0%  +0.34%
      path/filepath                                4.46k ± 0%  4.55k ± 0%  +1.88%
      reflect                                      6.39k ± 0%  6.43k ± 0%  +0.72%
      regexp                                       5.82k ± 0%  5.88k ± 0%  +1.12%
      regexp/syntax                                3.22k ± 0%  3.24k ± 0%  +0.62%
      runtime                                      12.9k ± 0%  13.2k ± 0%  +1.94%
      runtime/cgo                                    229 ± 0%    229 ± 0%  +0.00%
      runtime/debug                                3.66k ± 0%  3.72k ± 0%  +1.86%
      runtime/internal/atomic                        905 ± 0%    905 ± 0%  +0.00%
      runtime/internal/sys                         2.00k ± 0%  2.05k ± 0%  +2.55%
      runtime/pprof                                4.16k ± 0%  4.23k ± 0%  +1.66%
      runtime/pprof/internal/protopprof            11.5k ± 0%  11.7k ± 0%  +1.27%
      runtime/trace                                  354 ± 0%    354 ± 0%  +0.00%
      sort                                         1.63k ± 0%  1.68k ± 0%  +2.94%
      strconv                                      1.84k ± 0%  1.85k ± 0%  +0.54%
      strings                                      3.87k ± 0%  3.97k ± 0%  +2.48%
      sync                                         1.51k ± 0%  1.52k ± 0%  +0.33%
      sync/atomic                                  1.58k ± 0%  1.60k ± 0%  +1.27%
      syscall                                      53.2k ± 0%  53.3k ± 0%  +0.20%
      testing                                      8.14k ± 0%  8.26k ± 0%  +1.49%
      testing/internal/testdeps                      597 ± 0%    598 ± 0%  +0.17%
      text/tabwriter                               3.09k ± 0%  3.14k ± 0%  +1.85%
      text/template                                15.4k ± 0%  15.7k ± 0%  +1.89%
      text/template/parse                          8.90k ± 0%  9.12k ± 0%  +2.46%
      time                                         5.75k ± 0%  5.86k ± 0%  +1.86%
      unicode                                      4.62k ± 0%  4.62k ± 0%  +0.07%
      unicode/utf16                                  693 ± 0%    706 ± 0%  +1.88%
      unicode/utf8                                 1.05k ± 0%  1.07k ± 0%  +1.14%
      vendor/golang_org/x/crypto/chacha20poly1305  1.25k ± 0%  1.26k ± 0%  +0.64%
      vendor/golang_org/x/crypto/curve25519          392 ± 0%    392 ± 0%  +0.00%
      vendor/golang_org/x/crypto/poly1305            426 ± 0%    426 ± 0%  +0.00%
      vendor/golang_org/x/net/http2/hpack          4.19k ± 0%  4.26k ± 0%  +1.69%
      vendor/golang_org/x/net/idna                   355 ± 0%    355 ± 0%  +0.00%
      vendor/golang_org/x/net/lex/httplex            609 ± 0%    615 ± 0%  +0.99%
      vendor/golang_org/x/text/transform           1.31k ± 0%  1.31k ± 0%  +0.08%
      vendor/golang_org/x/text/unicode/norm        5.78k ± 0%  5.90k ± 0%  +2.06%
      vendor/golang_org/x/text/width               1.24k ± 0%  1.24k ± 0%  +0.16%
      [Geo mean]                                    2.49k       2.52k       +1.10%
      
      Fixes #18167.
      
      Change-Id: Ia5b7e70adc9652c7ee9954ca2efc1c59fa79be2b
      Reviewed-on: https://go-review.googlesource.com/33911
      Run-TryBot: David Lazar <lazard@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      Reviewed-by: default avatarDavid Chase <drchase@google.com>
      e3efdffa
    • Kale Blankenship's avatar
      net/http/pprof: return error when requested profile duration exceeds WriteTimeout · 39366326
      Kale Blankenship authored
      Updates Profile and Trace handlers to reject requests for durations >=
      WriteTimeout.
      
      Modifies go tool pprof to print the body of the http response when
      status != 200.
      
      Fixes #18755
      
      Change-Id: I6faed21685693caf39f315f003039538114937b0
      Reviewed-on: https://go-review.googlesource.com/35564Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      39366326
    • Максим Федосеев's avatar
      crypto/tls: fix link to more info about channel bindings · 7bd968fb
      Максим Федосеев authored
      Link in the description of TLSUnique field of ConnectionState struct
      leads to an article that is no longer available, so this commit
      replaces it with link to a copy of the very same article on another
      site.
      
      Fixes #18842.
      
      Change-Id: I8f8d298c4774dc0fbbad5042db0684bb3220aee8
      Reviewed-on: https://go-review.googlesource.com/36052Reviewed-by: default avatarFilippo Valsorda <hi@filippo.io>
      Reviewed-by: default avatarAdam Langley <agl@golang.org>
      7bd968fb
    • Jaana Burcu Dogan's avatar
      doc: remove the confusing use of CL · e2390ec1
      Jaana Burcu Dogan authored
      CL (change list) pops out of nowhere and confuses the
      reader. Use "change" instead to be consistent with the
      rest of the document.
      
      Fixes #18989.
      
      Change-Id: I525a63a195dc6bb992c8ad0f10c2f2e1b2b952df
      Reviewed-on: https://go-review.googlesource.com/36564Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      e2390ec1
    • Michael Munday's avatar
      cmd/compile: remove unnecessary type conversions on s390x · a16e631e
      Michael Munday authored
      Some rules insert MOVDreg ops to ensure that type changes are kept.
      If there is no type change (or the input is constant) then the MOVDreg
      can be omitted, allowing further optimization.
      
      Reduces the size of the .text section in the asm tool by ~33KB.
      
      Change-Id: I386883bb35b843c7b99a269cd6840dca77cf4371
      Reviewed-on: https://go-review.googlesource.com/36547
      Run-TryBot: Michael Munday <munday@ca.ibm.com>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      a16e631e
    • Robert Griesemer's avatar
      go/constant: use new math/big.IsInt and isUint predicates · 92cdde01
      Robert Griesemer authored
      Slightly cleaner and more readable code.
      
      Change-Id: I35263dbf338861b0a1bd62d59417b6a2c6a4e670
      Reviewed-on: https://go-review.googlesource.com/36562
      Run-TryBot: Robert Griesemer <gri@golang.org>
      Reviewed-by: default avatarAlan Donovan <adonovan@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      92cdde01
    • haya14busa's avatar
      cmd/gofmt: use actual filename in gofmt -d output · ee7fdc26
      haya14busa authored
      By using actual filename, diff output of "gofmt -d" can be used with
      other commands like "diffstat" and "patch".
      
      Example:
        $ gofmt -d path/to/file.go | diffstat
        $ gofmt -d path/to/file.go > gofmt.patch
        $ patch -u -p0 < gofmt.patch
      
      Fixes #18932
      
      Change-Id: I21ce15eb77870d72f2c14bfd5e7c21e2c77dc9ab
      Reviewed-on: https://go-review.googlesource.com/36374
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      ee7fdc26
    • Aliaksandr Valialkin's avatar
      bytes, strings: optimize Split* · 89465027
      Aliaksandr Valialkin authored
      The relevant benchmark results on linux/amd64:
      
      bytes:
      
      SplitSingleByteSeparator-4   25.7ms ± 5%   9.1ms ± 4%  -64.40%  (p=0.000 n=10+10)
      SplitMultiByteSeparator-4    13.8ms ±20%   4.3ms ± 8%  -69.23%  (p=0.000 n=10+10)
      SplitNSingleByteSeparator-4  1.88µs ± 9%  0.88µs ± 4%  -53.25%  (p=0.000 n=10+10)
      SplitNMultiByteSeparator-4   4.83µs ±10%  1.32µs ± 9%  -72.65%  (p=0.000 n=10+10)
      
      strings:
      
      name                         old time/op  new time/op  delta
      SplitSingleByteSeparator-4   21.4ms ± 8%   8.5ms ± 5%  -60.19%  (p=0.000 n=10+10)
      SplitMultiByteSeparator-4    13.2ms ± 9%   3.9ms ± 4%  -70.29%  (p=0.000 n=10+10)
      SplitNSingleByteSeparator-4  1.54µs ± 5%  0.75µs ± 7%  -51.21%  (p=0.000 n=10+10)
      SplitNMultiByteSeparator-4   3.57µs ± 8%  1.01µs ±11%  -71.76%  (p=0.000 n=10+10)
      
      Fixes #18973
      
      Change-Id: Ie4bc010c6cc389001e72eab530497c81e5b26f34
      Reviewed-on: https://go-review.googlesource.com/36510Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      89465027
    • Daniel Theophanes's avatar
      database/sql: record the context error in Rows if canceled · c026845b
      Daniel Theophanes authored
      Previously it was intended that Rows.Scan would return
      an error and Rows.Err would return nil. This was problematic
      because drivers could not differentiate between a normal
      Rows.Close or a context cancel close.
      
      The alternative is to require drivers to return a Scan to return
      an error if the driver is closed while there are still rows to be read.
      This is currently not how several drivers currently work and may be
      difficult to detect when there are additional rows.
      
      At the same time guard the the Rows.lasterr and prevent a close
      while a Rows operation is active.
      
      For the drivers that do not have Context methods, do not check for
      context cancelation after the operation, but before for any operation
      that may modify the database state.
      
      Fixes #18961
      
      Change-Id: I49a25318ecd9f97a35d5b50540ecd850c01cfa5e
      Reviewed-on: https://go-review.googlesource.com/36485Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      Run-TryBot: Russ Cox <rsc@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      c026845b
    • Adam Langley's avatar
      crypto/tls: document that only tickets are supported. · 0c9325e1
      Adam Langley authored
      This change clarifies that only ticket-based resumption is supported by
      crypto/tls. It's not clear where to document this for a server,
      although perhaps it's obvious there because there's nowhere to plug in
      the storage that would be needed by SessionID-based resumption.
      
      Fixes #18607
      
      Change-Id: Iaaed53e8d8f2f45c2f24c0683052df4be6340922
      Reviewed-on: https://go-review.googlesource.com/36560Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      0c9325e1