1. 01 May, 2019 9 commits
    • Pontus Leitzler's avatar
      cmd/go/internal/modfetch/codehost: fix pseudoversions for non-semver tags and... · cbe2b14d
      Pontus Leitzler authored
      cmd/go/internal/modfetch/codehost: fix pseudoversions for non-semver tags and tags on other branches
      
      Pseudoversion determination depends in part on the results from gitRepo.RecentTag, which currently invokes:
      
      git describe --first-parent --always --abbrev=0 --match <prefix>v[0-9]*.[0-9]*.[0-9]* --tags <rev>
      
      The comment at https://github.com/golang/go/issues/27171#issuecomment-470134255 describes some problems with the current approach.
      
      One problem is Docker and other repos can have tags that are not valid semver tags but that still match a glob pattern of v[0-9]*.[0-9]*.[0-9]* which are found by 'git describe' but then rejected by cmd/go, and hence those repos currently can end up with v0.0.0 pseudoversions instead of finding a proper semver tag to use as input to building a pseudoversion  (when then causes problems when the v0.0.0 pseudoversion is fed into MVS). An example problematic tag is a date-based tag such as 'v18.06.16', which matches the glob pattern, but is not a valid semver tag (due to the leading 0 in '06').
      
      Issues #31673, #31287, and #27171 also describe problems where the '--first-parent' argument to 'git describe' cause the current approach to miss relevant semver tags that were created on a separate branch and then subsequently merged to master.
      
      In #27171, Bryan described the base tag that is supposed to be used for pseudoversions as:
      
      "It is intended to be the semantically-latest tag that appears on any commit that is a (transitive) parent of the commit with the given hash, regardless of branches. (The pseudo-version is supposed to sort after every version — tagged or otherwise — that came before it, but before the next tag that a human might plausibly want to apply to the branch.)"
      
      This CL solves the glob problem and tags-on-other-branches problem more directly than the current approach: this CL gets the full list of tags that have been merged into the specific revision of interest, and then sorts and filters the results in cmd/go to select the semantically-latest valid semver tag.
      
      Fixes #31673
      Fixes #31287
      Updates #27171
      
      Change-Id: I7c3e6b46b2b21dd60562cf2893b6bd2afaae61d5
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174061
      Run-TryBot: Jay Conrod <jayconrod@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarJay Conrod <jayconrod@google.com>
      cbe2b14d
    • David Chase's avatar
      runtime: look for idle p to run current goroutine when switching to GC or traceReader · e56c73f1
      David Chase authored
      This repairs one of the several causes of pauses uncovered
      by a GC microbenchmark.  A pause can occur when a goroutine's
      quantum expires "at the same time" a GC is needed.  The
      current M switches to running a GC worker, which means that
      the amount of available work has expanded by one.  The GC
      worker, however, does not call ready, and does not itself
      conditionally wake a P (a "normal" thread would do this).
      
      This is also true if M switches to a traceReader.
      
      This is problem 4 in this list:
      https://github.com/golang/go/issues/27732#issuecomment-423301252
      
      Updates #27732.
      
      Change-Id: I6905365cac8504cde6faab2420f4421536551f0b
      Reviewed-on: https://go-review.googlesource.com/c/go/+/146817
      Run-TryBot: David Chase <drchase@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAustin Clements <austin@google.com>
      e56c73f1
    • Russ Cox's avatar
      index/suffixarray: add 32-bit implementation · 45be3530
      Russ Cox authored
      The original index/suffixarray used 32-bit ints on 64-bit machines,
      because that's what 'int' meant in Go at the time. When we changed
      the meaning of int, that doubled the space overhead of suffix arrays
      for all uses, even though the vast majority of them describe less
      than 2 GB of text.
      
      The space overhead of a suffix array compared to the text is not
      insignificant: there's a big difference for many uses between 4X and 8X.
      
      This CL adjusts names in qsufsort.go so that a global search and
      replace s/32/64/g produces a working 64-bit implementation,
      and then it modifies suffixarray.go to choose between the 32-bit
      and 64-bit implementation as appropriate depending on the input size.
      The 64-bit implementation is generated by 'go generate'.
      
      This CL also restructures the benchmarks, to test different
      input sizes, different input texts, and 32-bit vs 64-bit.
      
      The serialized form uses varint-encoded numbers and is unchanged,
      so on-disk suffix arrays written by older versions of Go will be
      readable by this version, and vice versa.
      
      The 32-bit version runs a up to 17% faster than the 64-bit version
      on real inputs, but more importantly it uses 50% less memory.
      
      I have a followup CL that also implements a faster algorithm
      on top of these improvements, but these are a good first step.
      
      name                                  64-bit speed   32-bit speed    delta
      New/text=opticks/size=100K/bits=*-12  4.44MB/s ± 0%  4.64MB/s ± 0%   +4.41%  (p=0.008 n=5+5)
      New/text=opticks/size=500K/bits=*-12  3.70MB/s ± 1%  3.82MB/s ± 0%   +3.30%  (p=0.008 n=5+5)
      New/text=go/size=100K/bits=*-12       4.40MB/s ± 0%  4.61MB/s ± 0%   +4.82%  (p=0.008 n=5+5)
      New/text=go/size=500K/bits=*-12       3.66MB/s ± 0%  3.77MB/s ± 0%   +3.01%  (p=0.016 n=4+5)
      New/text=go/size=1M/bits=*-12         3.29MB/s ± 0%  3.55MB/s ± 0%   +7.90%  (p=0.016 n=5+4)
      New/text=go/size=5M/bits=*-12         2.25MB/s ± 1%  2.65MB/s ± 0%  +17.81%  (p=0.008 n=5+5)
      New/text=go/size=10M/bits=*-12        1.82MB/s ± 0%  2.09MB/s ± 1%  +14.36%  (p=0.008 n=5+5)
      New/text=go/size=50M/bits=*-12        1.35MB/s ± 0%  1.51MB/s ± 1%  +12.33%  (p=0.008 n=5+5)
      New/text=zero/size=100K/bits=*-12     3.42MB/s ± 0%  3.32MB/s ± 0%   -2.74%  (p=0.000 n=5+4)
      New/text=zero/size=500K/bits=*-12     3.00MB/s ± 1%  2.97MB/s ± 0%   -1.13%  (p=0.016 n=5+4)
      New/text=zero/size=1M/bits=*-12       2.81MB/s ± 0%  2.78MB/s ± 2%     ~     (p=0.167 n=5+5)
      New/text=zero/size=5M/bits=*-12       2.46MB/s ± 0%  2.53MB/s ± 0%   +3.18%  (p=0.008 n=5+5)
      New/text=zero/size=10M/bits=*-12      2.35MB/s ± 0%  2.42MB/s ± 0%   +2.98%  (p=0.016 n=4+5)
      New/text=zero/size=50M/bits=*-12      2.12MB/s ± 0%  2.18MB/s ± 0%   +3.02%  (p=0.008 n=5+5)
      New/text=rand/size=100K/bits=*-12     6.98MB/s ± 0%  7.22MB/s ± 0%   +3.38%  (p=0.016 n=4+5)
      New/text=rand/size=500K/bits=*-12     5.53MB/s ± 0%  5.64MB/s ± 0%   +1.92%  (p=0.008 n=5+5)
      New/text=rand/size=1M/bits=*-12       4.62MB/s ± 1%  5.06MB/s ± 0%   +9.61%  (p=0.008 n=5+5)
      New/text=rand/size=5M/bits=*-12       3.09MB/s ± 0%  3.43MB/s ± 0%  +10.94%  (p=0.016 n=4+5)
      New/text=rand/size=10M/bits=*-12      2.68MB/s ± 0%  2.95MB/s ± 0%  +10.39%  (p=0.008 n=5+5)
      New/text=rand/size=50M/bits=*-12      1.92MB/s ± 0%  2.06MB/s ± 1%   +7.41%  (p=0.008 n=5+5)
      SaveRestore/bits=*-12                  243MB/s ± 1%   259MB/s ± 0%   +6.68%  (p=0.000 n=9+10)
      
      name                               64-bit alloc/op  32-bit alloc/op  delta
      New/text=opticks/size=100K/bits=*-12    1.62MB ± 0%    0.81MB ± 0%  -50.00%  (p=0.000 n=5+4)
      New/text=opticks/size=500K/bits=*-12    8.07MB ± 0%    4.04MB ± 0%  -49.89%  (p=0.008 n=5+5)
      New/text=go/size=100K/bits=*-12         1.62MB ± 0%    0.81MB ± 0%  -50.00%  (p=0.008 n=5+5)
      New/text=go/size=500K/bits=*-12         8.07MB ± 0%    4.04MB ± 0%  -49.89%  (p=0.029 n=4+4)
      New/text=go/size=1M/bits=*-12           16.1MB ± 0%     8.1MB ± 0%  -49.95%  (p=0.008 n=5+5)
      New/text=go/size=5M/bits=*-12           80.3MB ± 0%    40.2MB ± 0%     ~     (p=0.079 n=4+5)
      New/text=go/size=10M/bits=*-12           160MB ± 0%      80MB ± 0%  -50.00%  (p=0.008 n=5+5)
      New/text=go/size=50M/bits=*-12           805MB ± 0%     402MB ± 0%  -50.06%  (p=0.029 n=4+4)
      New/text=zero/size=100K/bits=*-12       3.02MB ± 0%    1.46MB ± 0%     ~     (p=0.079 n=4+5)
      New/text=zero/size=500K/bits=*-12       19.7MB ± 0%     8.7MB ± 0%  -55.98%  (p=0.008 n=5+5)
      New/text=zero/size=1M/bits=*-12         39.0MB ± 0%    19.7MB ± 0%  -49.60%  (p=0.000 n=5+4)
      New/text=zero/size=5M/bits=*-12          169MB ± 0%      85MB ± 0%  -49.46%  (p=0.029 n=4+4)
      New/text=zero/size=10M/bits=*-12         333MB ± 0%     169MB ± 0%  -49.43%  (p=0.000 n=5+4)
      New/text=zero/size=50M/bits=*-12        1.63GB ± 0%    0.74GB ± 0%  -54.61%  (p=0.008 n=5+5)
      New/text=rand/size=100K/bits=*-12       1.61MB ± 0%    0.81MB ± 0%  -50.00%  (p=0.000 n=5+4)
      New/text=rand/size=500K/bits=*-12       8.07MB ± 0%    4.04MB ± 0%  -49.89%  (p=0.000 n=5+4)
      New/text=rand/size=1M/bits=*-12         16.1MB ± 0%     8.1MB ± 0%  -49.95%  (p=0.029 n=4+4)
      New/text=rand/size=5M/bits=*-12         80.7MB ± 0%    40.3MB ± 0%  -50.06%  (p=0.008 n=5+5)
      New/text=rand/size=10M/bits=*-12         161MB ± 0%      81MB ± 0%  -50.03%  (p=0.008 n=5+5)
      New/text=rand/size=50M/bits=*-12         806MB ± 0%     403MB ± 0%  -50.00%  (p=0.016 n=4+5)
      SaveRestore/bits=*-12                   9.47MB ± 0%    5.28MB ± 0%  -44.29%  (p=0.000 n=9+8)
      
      https://perf.golang.org/search?q=upload:20190126.1+|+bits:64+vs+bits:32
      
      Fixes #6816.
      
      Change-Id: Ied2fbea519a202ecc43719debcd233344ce38847
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174097
      Run-TryBot: Russ Cox <rsc@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      45be3530
    • Lynn Boger's avatar
      cmd/compile/internal/ppc64: improve naming for ginsnop2 · b098c0f4
      Lynn Boger authored
      This is a follow up from a review comment at the end of the last
      Go release, to provide a more meaningful name for ginsnop2.
      
      Updates #30475
      
      Change-Id: Ice9efd763bf2204a9e8c55ae230d3e8a80210108
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174757
      Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      b098c0f4
    • Than McIntosh's avatar
      go/internal/gccgoimporter: skip new test with aliases with old gccgo · ab5cee53
      Than McIntosh authored
      Add the issue31540 test to the list of tests that needs to be skipped
      with old copies of gccgo. Along the way, add an explicit field to the
      importer test struct that can be used to tag the test (as opposed to
      having special cases by name in the test routine), so as to make it
      easier to remember to tag testcases correctly.
      
      Fixes #31764.
      
      Change-Id: Ib9d98fea2df8ce0b51e5a886fb2c4acd6db490ff
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174738Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      ab5cee53
    • Michael Anthony Knyszek's avatar
      runtime: change the span allocation policy to first-fit · 40036a99
      Michael Anthony Knyszek authored
      This change modifies the treap implementation to be address-ordered
      instead of size-ordered, and further augments it so it may be used for
      allocation. It then modifies the find method to implement a first-fit
      allocation policy.
      
      This change to the treap implementation consequently makes it so that
      spans are scavenged in highest-address-first order without any
      additional changes to the scavenging code. Because the treap itself is
      now address ordered, and the scavenging code iterates over it in
      reverse, the highest address is now chosen instead of the largest span.
      
      This change also renames the now wrongly-named "scavengeLargest" method
      on mheap to just "scavengeLocked" and also fixes up logic in that method
      which made assumptions about size.
      
      For #30333.
      
      Change-Id: I94b6f3209211cc1bfdc8cdaea04152a232cfbbb4
      Reviewed-on: https://go-review.googlesource.com/c/go/+/164101
      Run-TryBot: Michael Knyszek <mknyszek@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAustin Clements <austin@google.com>
      40036a99
    • Lynn Boger's avatar
      test: enable more memcombine tests for ppc64le · e30aa166
      Lynn Boger authored
      This enables more of the testcases in memcombine for ppc64le,
      and adds more detail to some existing.
      
      Change-Id: Ic522a1175bed682b546909c96f9ea758f8db247c
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174737Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      e30aa166
    • Elias Naur's avatar
      os,time: fix tests on iOS · b39daa7a
      Elias Naur authored
      When fixing tests for for self-hosted iOS builds, I
      broke hosted builds.
      
      Updates #31722
      
      Change-Id: Id4e7d234fbd86cb2d29d320d75f4441efd663d12
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174698
      Run-TryBot: Elias Naur <mail@eliasnaur.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      b39daa7a
    • Michael Vogt's avatar
      net: set DNSError.IsTemporary from addrinfoErrno errors · 7ee22139
      Michael Vogt authored
      Today it is not possible (AFAICT) to detect if a DNSError if of type EAI_AGAIN, i.e. if it is something temporary that should be retried. This information is available inside addrinfoErrno but when the DNSError is created this information is lost.
      
      This PR fixes this so that the addinfoErrno.Temporary information is added to DNSError as well. With that a user who gets a DNSError can check now is its a temporary error (for errors that resulted from a addrinfoErrno this is EAI_AGAIN).
      
      Change-Id: I64badb2ebd904e41fc2e0755416f7f32560534d8
      GitHub-Last-Rev: ced7238a6597039fb23f36f372bd1cf33d60d4a6
      GitHub-Pull-Request: golang/go#31676
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174557Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      7ee22139
  2. 30 Apr, 2019 31 commits
    • bill_ofarrell's avatar
      internal/cpu: add detection for the new ECDSA and EDDSA capabilities on s390x · ba978f5f
      bill_ofarrell authored
      This CL will check for the Message-Security-Assist Extension 9 facility
      which enables the KDSA instruction.
      
      Change-Id: I659aac09726e0999ec652ef1f5983072c8131a48
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174529
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      ba978f5f
    • Michael Fraenkel's avatar
      net/http: make Transport.MaxConnsPerHost work for HTTP/2 · 43b9fcf6
      Michael Fraenkel authored
      Treat HTTP/2 connections as an ongoing persistent connection. When we
      are told there is no cached connections, cleanup the associated
      connection and host connection count.
      
      Fixes #27753
      
      Change-Id: I6b7bd915fc7819617cb5d3b35e46e225c75eda29
      Reviewed-on: https://go-review.googlesource.com/c/go/+/140357Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      43b9fcf6
    • Nir Soffer's avatar
      net/http: add Transport.ReadBufferSize and WriteBufferSize · c706d422
      Nir Soffer authored
      Previously transport was using the hardcoded bufio.defaultBufSize
      (4096), limiting throughput and increasing cpu usage when uploading or
      downloading large files.
      
      Add options to allow users to configure the buffer sizes as needed.
      
      I tested the maximum benefit of this change by uploading data from
      /dev/zero to a server discarding the bytes. Here is an example upload
      using the default buffer size:
      
      $ time ./upload 10 https://localhost:8000/
      Uploaded 10.00g in 25.13 seconds (407.49m/s)
      
      real	0m25.135s
      user	0m5.167s
      sys	0m11.643s
      
      With this change, using 128k buffer size:
      
      $ time ./upload 10 https://localhost:8000/
      Uploaded 10.00g in 7.93 seconds (1291.51m/s)
      
      real	0m7.935s
      user	0m4.517s
      sys	0m2.603s
      
      In real world usage the difference will be smaller, depending on the
      local and remote storage and the network.
      
      See https://github.com/nirs/http-bench for more info.
      
      Fixes #22618
      
      Change-Id: Iac99ed839c7b95d6dc66602ba8fe1fc5b500c47c
      Reviewed-on: https://go-review.googlesource.com/c/go/+/76410Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      c706d422
    • Richard Musiol's avatar
      syscall: on wasm, do not use typed array asynchronously · 6505b485
      Richard Musiol authored
      The underlying buffer of a typed array becomes invalid as soon as we
      grow the WebAssembly memory, which can happen at any time while Go code
      runs. This is a known limitation, see https://golang.org/cl/155778.
      
      As a consequence, using a typed array with one of the asynchronous
      read/write operations of Node.js' fs module is dangerous, since it may
      become invalid while the asynchronous operation has not finished yet.
      The result of this situation is most likely undefined.
      
      I am not aware of any nice solution to this issue, so this change adds
      a workaround of using an additional typed array which is not backed by
      WebAssembly memory and copying the bytes between the two typed arrays.
      
      Maybe WebAssembly will come up with a better solution in the future.
      
      Fixes #31702.
      
      Change-Id: Iafc2a0fa03c81db414520bd45a1a17c00080b61e
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174304
      Run-TryBot: Richard Musiol <neelance@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      6505b485
    • Jay Conrod's avatar
      cmd/go: make get -u upgrade only modules providing packages · 65b89c35
      Jay Conrod authored
      Currently, 'go get -u' upgrades modules matching command line
      arguments and any modules they transitively require. 'go get -u' with
      no positional arguments upgrades all modules transitively required by
      the main module. This usually adds a large number of indirect
      requirements, which is surprising to users.
      
      With this change, 'go get' will load packages specified by
      its arguments using a similar process to other commands
      ('go build', etc). Only modules providing packages will be upgraded.
      
      'go get -u' now upgrades modules providing packages transitively
      imported by the command-line arguments. 'go get -u' without arguments
      will only upgrade modules needed by the package in the current
      directory.
      
      'go get -m' will load all packages within a module. 'go get -m -u'
      without arguments will upgrade modules needed by the main module. It
      is equivalent to 'go get -u all'. Neither command will upgrade modules
      that are required but not used.
      
      Note that 'go get -m' and 'go get -d' both download modules in order
      to load packages.
      
      Fixes #26902
      
      Change-Id: I2bad686b3ca8c9de985a81fb42b16a36bb4cc3ea
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174099
      Run-TryBot: Jay Conrod <jayconrod@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      65b89c35
    • Brian Kessler's avatar
      cmd/compile: add signed divisibility rules · 4d9dd358
      Brian Kessler authored
      "Division by invariant integers using multiplication" paper
      by Granlund and Montgomery contains a method for directly computing
      divisibility (x%c == 0 for c constant) by means of the modular inverse.
      The method is further elaborated in "Hacker's Delight" by Warren Section 10-17
      
      This general rule can compute divisibilty by one multiplication, and add
      and a compare for odd divisors and an additional rotate for even divisors.
      
      To apply the divisibility rule, we must take into account
      the rules to rewrite x%c = x-((x/c)*c) and (x/c) for c constant on the first
      optimization pass "opt".  This complicates the matching as we want to match
      only in the cases where the result of (x/c) is not also needed.
      So, we must match on the expanded form of (x/c) in the expression x == c*(x/c)
      in the "late opt" pass after common subexpresion elimination.
      
      Note, that if there is an intermediate opt pass introduced in the future we
      could simplify these rules by delaying the magic division rewrite to "late opt"
      and matching directly on (x/c) in the intermediate opt pass.
      
      On amd64, the divisibility check is 30-45% faster.
      
      name                     old time/op  new time/op  delta`
      DivisiblePow2constI64-4  0.83ns ± 1%  0.82ns ± 0%     ~     (p=0.079 n=5+4)
      DivisibleconstI64-4      2.68ns ± 1%  1.87ns ± 0%  -30.33%  (p=0.000 n=5+4)
      DivisibleWDivconstI64-4  2.69ns ± 1%  2.71ns ± 3%     ~     (p=1.000 n=5+5)
      DivisiblePow2constI32-4  1.15ns ± 1%  1.15ns ± 0%     ~     (p=0.238 n=5+4)
      DivisibleconstI32-4      2.24ns ± 1%  1.20ns ± 0%  -46.48%  (p=0.016 n=5+4)
      DivisibleWDivconstI32-4  2.27ns ± 1%  2.27ns ± 1%     ~     (p=0.683 n=5+5)
      DivisiblePow2constI16-4  0.81ns ± 1%  0.82ns ± 1%     ~     (p=0.135 n=5+5)
      DivisibleconstI16-4      2.11ns ± 2%  1.20ns ± 1%  -42.99%  (p=0.008 n=5+5)
      DivisibleWDivconstI16-4  2.23ns ± 0%  2.27ns ± 2%   +1.79%  (p=0.029 n=4+4)
      DivisiblePow2constI8-4   0.81ns ± 1%  0.81ns ± 1%     ~     (p=0.286 n=5+5)
      DivisibleconstI8-4       2.13ns ± 3%  1.19ns ± 1%  -43.84%  (p=0.008 n=5+5)
      DivisibleWDivconstI8-4   2.23ns ± 1%  2.25ns ± 1%     ~     (p=0.183 n=5+5)
      
      Fixes #30282
      Fixes #15806
      
      Change-Id: Id20d78263a4fdfe0509229ae4dfa2fede83fc1d0
      Reviewed-on: https://go-review.googlesource.com/c/go/+/173998
      Run-TryBot: Brian Kessler <brian.m.kessler@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      4d9dd358
    • Keith Randall's avatar
      cmd/compile: fix line numbers for index panics · e7d08b6f
      Keith Randall authored
      In the statement x = a[i], the index panic should appear to come from
      the line number of the '['. Previous to this CL we sometimes used the
      line number of the '=' instead.
      
      Fixes #29504
      
      Change-Id: Ie718fd303c1ac2aee33e88d52c9ba9bcf220dea1
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174617
      Run-TryBot: Keith Randall <khr@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      e7d08b6f
    • Iskander Sharipov's avatar
      cmd/asm: reject BSWAPW on amd64 · 720af3c8
      Iskander Sharipov authored
      Since BSWAP operation on 16-bit registers is undefined,
      forbid the usage of BSWAPW. Users should rely on XCHGB instead.
      
      This behavior is consistent with what GAS does.
      
      Fixes #29167
      
      Change-Id: I3b31e3dd2acfd039f7564a1c17e6068617bcde8d
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174312
      Run-TryBot: Iskander Sharipov <quasilyte@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      720af3c8
    • Elias Naur's avatar
      os: fix tests on self-hosted Go builds · 08318f59
      Elias Naur authored
      Updates #31722
      
      Change-Id: I467bb2539f993fad642abf96388a58a263fbe007
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174311
      Run-TryBot: Elias Naur <mail@eliasnaur.com>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      08318f59
    • Keith Randall's avatar
      cmd/compile: remove dynamic entry handling from sinit/maplit · 85387aa3
      Keith Randall authored
      The order pass now handles all the dynamic entries.
      
      Update #26552
      
      Followup to CL 174417
      
      Change-Id: Ie924cadb0e0ba36c423868f654f13040100b44c6
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174498
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      85387aa3
    • Russ Cox's avatar
      cmd/go/internal/modfetch/codehost: disable fetch of server-resolved commit hash · 70b890ce
      Russ Cox authored
      We cannot rely on the server to filter out the refs we don't want
      (we only want refs/heads/* and refs/tags/*), so do not give it
      the full hash.
      
      Fixes #31191.
      
      Change-Id: If1208c35954228aa6e8734f8d5f1725d0ec79c87
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174517
      Run-TryBot: Russ Cox <rsc@golang.org>
      Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      70b890ce
    • Elias Naur's avatar
      cmd/go,cmd/internal/sys,cmd/link: skip Go build ids for externally linked tools · 8bde43e0
      Elias Naur authored
      cmd/go already skips build ids on Android where buildmode=pie is
      forced. Expand the check to all externally linked tools.
      
      Necessary for self-hosted iOS builds where PIE is not forced but
      external linking is.
      
      Updates #31722
      
      Change-Id: Iad796a9411a37eb0c44d365b70a3c5907537e461
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174307
      Run-TryBot: Elias Naur <mail@eliasnaur.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      8bde43e0
    • Emmanuel T Odeke's avatar
      net/http: make Server return 501 for unsupported transfer-encodings · 88548d02
      Emmanuel T Odeke authored
      Ensures that our HTTP/1.X Server properly responds
      with a 501 Unimplemented as mandated by the spec at
      RFC 7230 Section 3.3.1, which says:
          A server that receives a request message with a
          transfer coding it does not understand SHOULD
          respond with 501 (Unimplemented).
      
      Fixes #30710
      
      Change-Id: I096904e6df053cd1e4b551774cc27523ff3d09f6
      Reviewed-on: https://go-review.googlesource.com/c/go/+/167017Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      88548d02
    • Bryan C. Mills's avatar
      cmd/go: query modules in parallel · c66ab9b1
      Bryan C. Mills authored
      Refactor modload.QueryPackage and modload.QueryPattern to share code.
      
      Fine-tune error reporting and make it consistent between QueryPackage and QueryPattern.
      
      Expand tests for pattern errors.
      
      Update a TODO in modget/get.go and add a test case that demonstrates it.
      
      Updates #26232
      
      Change-Id: I900ca8de338ef9a51b7f85ed93d8bcf837621646
      Reviewed-on: https://go-review.googlesource.com/c/go/+/173017
      Run-TryBot: Bryan C. Mills <bcmills@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarJay Conrod <jayconrod@google.com>
      c66ab9b1
    • Elias Naur's avatar
      time: look for zoneinfo.zip in GOROOT · 8e4f1a71
      Elias Naur authored
      The zoneinfo.zip file will be in the $GOROOT in self-hsoted builds
      on iOS.
      
      Updates #31722
      
      Change-Id: I991fae92e3dc50581b099a2d8901aed36ecc7cef
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174310
      Run-TryBot: Elias Naur <mail@eliasnaur.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      8e4f1a71
    • Liberatys's avatar
      cmd/go: derive executable name from package path in 'go run' · 62ddf7d0
      Liberatys authored
      Change name of temporary executable on go run . to directory name.
      Fixes #31571
      
      Change-Id: I0a0ce74154e76205bb43805c95bd7fb8fd2dfd01
      GitHub-Last-Rev: e0964983e18a1d45b55f7098c7489059708c7e5e
      GitHub-Pull-Request: golang/go#31614
      Reviewed-on: https://go-review.googlesource.com/c/go/+/173297
      Run-TryBot: Jay Conrod <jayconrod@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarJay Conrod <jayconrod@google.com>
      62ddf7d0
    • Elias Naur's avatar
      cmd/dist: detect GOHOSTARCH on iOS · 888bac14
      Elias Naur authored
      cmd/dist defaults to GOHOSTARCH=amd64 on darwin because no other
      darwin host could build Go. With the upcoming self-hosted iOS
      builders, GOHOSTARCH=arm64 is also possible.
      
      Updates #31722
      
      Change-Id: I9af47d9f8c57ea45475ce498acefbfe6bf4815b9
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174306
      Run-TryBot: Elias Naur <mail@eliasnaur.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      888bac14
    • Elias Naur's avatar
      cmd/dist: set the default external linker on platforms without gcc · d7edc916
      Elias Naur authored
      The go tool already sets -extld to the appropriate compiler. This
      CL changes cmd/dist to do the same, to fix bootstrapping on platforms
      that only have clang (Android and iOS).
      
      Updates #31722
      
      Change-Id: I8a4fd227f85a768053a8946198eab68bbbdf9ae5
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174305
      Run-TryBot: Elias Naur <mail@eliasnaur.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      d7edc916
    • Brad Fitzpatrick's avatar
      encoding/gob: adding missing fuzz skip to one of the fuzz tests · 55d690d0
      Brad Fitzpatrick authored
      It's slow & often times out randomly on longtest builders. Not useful.
      
      Fixes #31517
      
      Change-Id: Icedbb0c94fbe43d04e8b47d5785ac61c5e2d8750
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174522
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      55d690d0
    • Josh Bleecher Snyder's avatar
      all: refer to map elements as elements instead of values · 73cb9a1c
      Josh Bleecher Snyder authored
      The spec carefully and consistently uses "key" and "element"
      as map terminology. The implementation, not so much.
      
      This change attempts to make the implementation consistently
      hew to the spec's terminology. Beyond consistency, this has
      the advantage of avoid some confusion and naming collisions,
      since v and value are very generic and commonly used terms.
      
      I believe that I found all everything, but there are a lot of
      non-obvious places for these to hide, and grepping for them is hard.
      Hopefully this change changes enough of them that we will start using
      elem going forward. Any remaining hidden cases can be removed ad hoc
      as they are discovered.
      
      The only externally-facing part of this change is in package reflect,
      where there is a minor doc change and a function parameter name change.
      
      Updates #27167
      
      Change-Id: I2f2d78f16c360dc39007b9966d5c2046a29d3701
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174523
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      73cb9a1c
    • Baokun Lee's avatar
      cmd/go/internal/modcmd: allow mod download without go.mod · a8d0047e
      Baokun Lee authored
      Fixes #29522
      
      Change-Id: I48f3a945d24c23c7c7ef5c7f1fe5046b6b2898e9
      Reviewed-on: https://go-review.googlesource.com/c/go/+/157937
      Run-TryBot: Bryan C. Mills <bcmills@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
      a8d0047e
    • Keith Randall's avatar
      runtime: fix data sizes for res_search results · 1fd14082
      Keith Randall authored
      The return values are 32 bit, not 64 bit.
      
      I don't think this would be the cause of any problems, but
      it can't hurt to fix it.
      
      Change-Id: Icdd50606360ab9d74070271f9d1721d5fe640bc7
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174518
      Run-TryBot: Keith Randall <khr@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      1fd14082
    • Joshua M. Clulow's avatar
      all: add new GOOS=illumos, split out of GOOS=solaris · f686a289
      Joshua M. Clulow authored
      Like GOOS=android which implies the "linux" build tag, GOOS=illumos
      implies the "solaris" build tag. This lets the existing ecosystem of
      packages still work on illumos, but still permits packages to start
      differentiating between solaris and illumos.
      
      Fixes #20603
      
      Change-Id: I8f4eabf1a66060538dca15d7658c1fbc6c826622
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174457
      Run-TryBot: Benny Siegert <bsiegert@gmail.com>
      Reviewed-by: default avatarBenny Siegert <bsiegert@gmail.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      f686a289
    • Clément Chigot's avatar
      cmd/link: add .go.buildinfo in XCOFF symbol table · 0c9e0c25
      Clément Chigot authored
      .go.buildinfo must be added to the symbol table on AIX. Otherwise, ld
      won't be able to handle its relocations.
      
      This patch also make ".data" the default section for all symbols inside
      the data segment.
      
      Change-Id: I83ac2bf1050e0ef6ef9c96ff793efd4ddc8e98d7
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174298
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      0c9e0c25
    • Elias Naur's avatar
      runtime: implement pthread functions for darwin/arm64 · 9f12e2e0
      Elias Naur authored
      They were not needed when Go only produced binaries with cgo suppport.
      Now that Go is about to run self-hosted on iOS we do need these.
      
      Updates #31722
      
      Change-Id: If233aa2b31edc7b1c2dcac68974f9fba0604f9a3
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174300
      Run-TryBot: Elias Naur <mail@eliasnaur.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      9f12e2e0
    • Brad Fitzpatrick's avatar
      cmd/dist: disable cgo for darwin/386 · e0ac75d2
      Brad Fitzpatrick authored
      Fixes #31751
      
      Change-Id: Id002f14557a34accc3597cb1b9a42e838a027da4
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174497Reviewed-by: default avatarKeith Randall <khr@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      e0ac75d2
    • Romain Baugue's avatar
      html: add a Fuzz function · 4ad13555
      Romain Baugue authored
      Adds a sample Fuzz test function to package html based on
      https://github.com/dvyukov/go-fuzz-corpus/blob/master/stdhtml/main.go
      
      Updates #19109
      Updates #31309
      
      Change-Id: I8c49fff8f70fc8a8813daf1abf0044752003adbb
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174301Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      4ad13555
    • Tyler Bui-Palsulich's avatar
      cmd/go: say to confirm import path when it's not found · 12aec551
      Tyler Bui-Palsulich authored
      Fixes #31366.
      
      Change-Id: Ief26f53e7fe94bedb7db79d3d7130c4cdcec4281
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174179
      Run-TryBot: Jay Conrod <jayconrod@google.com>
      Reviewed-by: default avatarJay Conrod <jayconrod@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      12aec551
    • Romain Baugue's avatar
      encoding/csv: add a Fuzz function · 858064fb
      Romain Baugue authored
      Adds a sample Fuzz test function to package encoding/csv based on
      https://github.com/dvyukov/go-fuzz-corpus/blob/master/csv/main.go
      
      Updates #19109
      Updates #31309
      
      Change-Id: Ieb0cb6caa1df72dbb7e29df4bdeed0bfa91187d3
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174302Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      858064fb
    • Russ Cox's avatar
      cmd/go/internal/modfetch: fix concurrent read/write race in modfetch · 8e28cd19
      Russ Cox authored
      On Windows systems, the failure rate for cmd/go's TestScript/mod_concurrent
      is somewhere around 3-10% without this change. With the change, I have yet
      to see a failure.
      
      Fixes #31744.
      
      Change-Id: Ib321ebb9556dd8438086cf329dfa083a9e051732
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174439
      Run-TryBot: Russ Cox <rsc@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      8e28cd19
    • Richard Musiol's avatar
      cmd/internal/obj/wasm: cache SP in a local · 203e1888
      Richard Musiol authored
      We use Wasm global variables extensively for simulating
      registers, especially SP. V8 does not handle global variables
      efficiently.
      
      This CL reduces global variable accesses by caching the global SP
      in a local variable in each function. The local cache is set on
      function entry and updated after each call (where the stack could
      have moved). Within a function, the SP access will use the local
      variable.
      
      Supersedes https://golang.org/cl/173979.
      
      Running on Chrome Version 73.0.3683.103 on darwin/amd64:
      
      name                   old time/op    new time/op     delta
      BinaryTree17              15.3s ± 2%      14.5s ± 3%   -5.20%  (p=0.000 n=9+10)
      Fannkuch11                8.91s ± 2%      9.48s ± 2%   +6.41%  (p=0.000 n=9+10)
      FmtFprintfEmpty           197ns ± 5%      165ns ± 3%  -16.09%  (p=0.000 n=9+8)
      FmtFprintfString          354ns ± 8%      325ns ± 7%   -8.33%  (p=0.001 n=10+10)
      FmtFprintfInt             400ns ± 4%      368ns ± 6%   -8.01%  (p=0.000 n=10+10)
      FmtFprintfIntInt          618ns ± 3%      587ns ± 6%   -4.97%  (p=0.001 n=10+10)
      FmtFprintfPrefixedInt     637ns ± 4%      606ns ± 4%   -4.88%  (p=0.000 n=10+10)
      FmtFprintfFloat           965ns ± 7%      898ns ± 4%   -6.97%  (p=0.000 n=10+10)
      FmtManyArgs              2.34µs ± 1%     2.24µs ± 3%   -4.40%  (p=0.000 n=9+10)
      GobDecode                29.8ms ± 3%     28.8ms ± 6%   -3.60%  (p=0.006 n=9+10)
      GobEncode                20.5ms ± 8%     17.6ms ± 3%  -14.32%  (p=0.000 n=10+10)
      Gzip                      714ms ± 3%      718ms ± 8%     ~     (p=0.971 n=10+10)
      Gunzip                    148ms ± 3%      136ms ± 3%   -7.99%  (p=0.000 n=10+9)
      HTTPClientServer          219µs ± 3%      215µs ± 4%     ~     (p=0.190 n=10+10)
      JSONEncode               35.1ms ± 2%     31.8ms ±13%   -9.52%  (p=0.002 n=10+10)
      JSONDecode                220ms ± 3%      207ms ± 5%   -5.87%  (p=0.000 n=10+10)
      Mandelbrot200            5.22ms ± 1%     5.11ms ± 4%   -2.11%  (p=0.027 n=8+10)
      GoParse                  17.2ms ± 6%     16.1ms ± 5%   -6.63%  (p=0.000 n=10+9)
      RegexpMatchEasy0_32       375ns ± 3%      340ns ± 3%   -9.25%  (p=0.000 n=10+10)
      RegexpMatchEasy0_1K      2.70µs ± 3%     2.65µs ± 4%     ~     (p=0.118 n=10+10)
      RegexpMatchEasy1_32       341ns ± 2%      305ns ± 4%  -10.62%  (p=0.000 n=9+10)
      RegexpMatchEasy1_1K      3.20µs ± 3%     2.99µs ± 3%   -6.35%  (p=0.000 n=10+10)
      RegexpMatchMedium_32      520ns ± 3%      501ns ± 4%   -3.64%  (p=0.002 n=9+10)
      RegexpMatchMedium_1K      145µs ± 7%      128µs ± 3%  -11.57%  (p=0.000 n=9+10)
      RegexpMatchHard_32       7.88µs ± 3%     7.01µs ± 5%  -10.97%  (p=0.000 n=10+10)
      RegexpMatchHard_1K        237µs ± 5%      207µs ± 4%  -12.71%  (p=0.000 n=9+10)
      Revcomp                   2.34s ± 1%      2.31s ± 5%     ~     (p=0.230 n=7+10)
      Template                  261ms ± 7%      246ms ± 5%   -5.93%  (p=0.007 n=10+10)
      TimeParse                1.47µs ± 3%     1.39µs ± 5%   -5.75%  (p=0.000 n=9+10)
      TimeFormat               1.52µs ± 3%     1.43µs ± 4%   -6.42%  (p=0.000 n=8+10)
      
      name                   old speed      new speed       delta
      GobDecode              25.7MB/s ± 3%   26.7MB/s ± 5%   +3.77%  (p=0.006 n=9+10)
      GobEncode              37.5MB/s ± 8%   43.7MB/s ± 3%  +16.61%  (p=0.000 n=10+10)
      Gzip                   27.2MB/s ± 3%   27.0MB/s ± 7%     ~     (p=0.971 n=10+10)
      Gunzip                  131MB/s ± 3%    142MB/s ± 5%   +8.07%  (p=0.000 n=10+10)
      JSONEncode             55.2MB/s ± 2%   61.2MB/s ±12%  +10.80%  (p=0.002 n=10+10)
      JSONDecode             8.84MB/s ± 3%   9.39MB/s ± 5%   +6.28%  (p=0.000 n=10+10)
      GoParse                3.37MB/s ± 6%   3.61MB/s ± 5%   +7.09%  (p=0.000 n=10+9)
      RegexpMatchEasy0_32    85.3MB/s ± 3%   94.0MB/s ± 3%  +10.20%  (p=0.000 n=10+10)
      RegexpMatchEasy0_1K     379MB/s ± 3%    387MB/s ± 4%     ~     (p=0.123 n=10+10)
      RegexpMatchEasy1_32    93.9MB/s ± 2%  105.1MB/s ± 4%  +11.96%  (p=0.000 n=9+10)
      RegexpMatchEasy1_1K     320MB/s ± 3%    342MB/s ± 3%   +6.79%  (p=0.000 n=10+10)
      RegexpMatchMedium_32   1.92MB/s ± 2%   2.00MB/s ± 3%   +3.94%  (p=0.001 n=9+10)
      RegexpMatchMedium_1K   7.09MB/s ± 6%   8.01MB/s ± 3%  +13.00%  (p=0.000 n=9+10)
      RegexpMatchHard_32     4.06MB/s ± 3%   4.56MB/s ± 5%  +12.38%  (p=0.000 n=10+10)
      RegexpMatchHard_1K     4.32MB/s ± 4%   4.96MB/s ± 4%  +14.60%  (p=0.000 n=9+10)
      Revcomp                 109MB/s ± 1%    110MB/s ± 5%     ~     (p=0.219 n=7+10)
      Template               7.44MB/s ± 8%   7.91MB/s ± 5%   +6.30%  (p=0.007 n=10+10)
      
      Change-Id: I5828cf6b23ce104c02addc2642aba48dd6c48aab
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174062
      Run-TryBot: Richard Musiol <neelance@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      203e1888