1. 28 May, 2018 3 commits
  2. 27 May, 2018 1 commit
    • Ian Lance Taylor's avatar
      cmd/go: don't generate output for "go build -o /dev/null x.go" · c1d9d1f3
      Ian Lance Taylor authored
      We look for "-o /dev/null", and, if found, pretend that there was no
      "-o" option and don't generate an action to create the final executable.
      
      We look for "go build x.go", and, if found, and if -o was not used,
      pretend that the user specified "-o x".
      
      Unfortunately, we were doing those in the wrong order, so that "go
      build -o /dev/null x.go" would first clear the "-o" option and then
      set it to "-o x".
      
      This CL flips the order so that the right thing happens.
      
      Fixes #25579
      
      Change-Id: Ic9556ac0a57f7b45b685951bc96ba5ea4633b860
      Reviewed-on: https://go-review.googlesource.com/114715
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      c1d9d1f3
  3. 26 May, 2018 5 commits
  4. 25 May, 2018 6 commits
  5. 24 May, 2018 10 commits
  6. 23 May, 2018 15 commits
    • Heschi Kreinick's avatar
      cmd/compile: fix debug info generation for loads from Phis · 65c365bf
      Heschi Kreinick authored
      Apparently a LoadReg can take a Phi as its argument. The Phi has names
      in the NamedValue table, so just read the Load's names from the Phi.
      
      The example given, XORKeyStream in chacha20, is pretty complicated so I
      didn't try to actually debug it and verify that the results are right.
      But the debug logging looks reasonable, with the right names in the right
      registers at the right times.
      
      Fixes #25404
      
      Change-Id: I2c3183dcfb033948556d6805bd66c22c0b45625c
      Reviewed-on: https://go-review.googlesource.com/114008
      Run-TryBot: Heschi Kreinick <heschi@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarDavid Chase <drchase@google.com>
      65c365bf
    • Heschi Kreinick's avatar
      cmd/compile: clean up debug info generation logging · 391a963b
      Heschi Kreinick authored
      Remove the unexpected function, which is a lot less relevant now that
      the generation basically can't detect invalid states, and make sure no
      logging appears without -d locationlists=2.
      
      Updates #25404
      
      Change-Id: If3522df5a7397f2e7b43cb808936e319132132b6
      Reviewed-on: https://go-review.googlesource.com/114007
      Run-TryBot: Heschi Kreinick <heschi@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarDavid Chase <drchase@google.com>
      391a963b
    • Alexander Döring's avatar
      math/big: reduce allocations in Karatsuba case of sqr · 1a5d0f83
      Alexander Döring authored
      For #23221.
      
      Change-Id: If55dcf2e0706d6658f4a0863e3740437e008706c
      Reviewed-on: https://go-review.googlesource.com/114335
      Run-TryBot: Robert Griesemer <gri@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
      1a5d0f83
    • Anit Gandhi's avatar
      crypto/{aes,internal/cipherhw,tls}: use common internal/cpu in place of cipherhw · 3f2039e2
      Anit Gandhi authored
      When the internal/cpu package was introduced, the AES package still used
      the custom crypto/internal/cipherhw package for amd64 and s390x. This
      change removes that package entirely in favor of directly referencing the
      cpu feature flags set and exposed by the internal/cpu package. In
      addition, 5 new flags have been added to the internal/cpu s390x struct
      for detecting various cipher message (KM) features.
      
      Change-Id: I77cdd8bc1b04ab0e483b21bf1879b5801a4ba5f4
      GitHub-Last-Rev: a611e3ecb1f480dcbfce3cb0c8c9e4058f56c1a4
      GitHub-Pull-Request: golang/go#24766
      Reviewed-on: https://go-review.googlesource.com/105695Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      3f2039e2
    • Richard Musiol's avatar
      cmd/compile: add wasm stack optimization · 482d2419
      Richard Musiol authored
      Go's SSA instructions only operate on registers. For example, an add
      instruction would read two registers, do the addition and then write
      to a register. WebAssembly's instructions, on the other hand, operate
      on the stack. The add instruction first pops two values from the stack,
      does the addition, then pushes the result to the stack. To fulfill
      Go's semantics, one needs to map Go's single add instruction to
      4 WebAssembly instructions:
      - Push the value of local variable A to the stack
      - Push the value of local variable B to the stack
      - Do addition
      - Write value from stack to local variable C
      
      Now consider that B was set to the constant 42 before the addition:
      - Push constant 42 to the stack
      - Write value from stack to local variable B
      
      This works, but is inefficient. Instead, the stack is used directly
      by inlining instructions if possible. With inlining it becomes:
      - Push the value of local variable A to the stack (add)
      - Push constant 42 to the stack (constant)
      - Do addition (add)
      - Write value from stack to local variable C (add)
      
      Note that the two SSA instructions can not be generated sequentially
      anymore, because their WebAssembly instructions are interleaved.
      
      Design doc: https://docs.google.com/document/d/131vjr4DH6JFnb-blm_uRdaC0_Nv3OUwjEY5qVCxCup4
      
      Updates #18892
      
      Change-Id: Ie35e1c0bebf4985fddda0d6330eb2066f9ad6dec
      Reviewed-on: https://go-review.googlesource.com/103535
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
      482d2419
    • Hana Kim's avatar
      cmd/vendor/.../unix: pick up upstream fixes for broken tests · 02399fa6
      Hana Kim authored
      Update golang/go#25528
      Update golang/go#25529
      
      Change-Id: I47ec282e76eb7740547e220ac00d6a7992e17b9e
      Reviewed-on: https://go-review.googlesource.com/114094Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      02399fa6
    • Alexander Döring's avatar
      math/big: specialize Karatsuba implementation for squaring · 1dc20e91
      Alexander Döring authored
      Currently we use three different algorithms for squaring:
      1. basic multiplication for small numbers
      2. basic squaring for medium numbers
      3. Karatsuba multiplication for large numbers
      
      Change 3. to a version of Karatsuba multiplication specialized
      for x == y.
      
      Increasing the performance of 3. lets us lower the threshold
      between 2. and 3.
      
      Adapt TestCalibrate to the change that 3. isn't independent
      of the threshold between 1. and 2. any more.
      
      Fixes #23221.
      
      benchstat old.txt new.txt
      name           old time/op  new time/op  delta
      NatSqr/1-4     29.6ns ± 7%  29.5ns ± 5%     ~     (p=0.103 n=50+50)
      NatSqr/2-4     51.9ns ± 1%  51.9ns ± 1%     ~     (p=0.693 n=42+49)
      NatSqr/3-4     64.3ns ± 1%  64.1ns ± 0%   -0.26%  (p=0.000 n=46+43)
      NatSqr/5-4     93.5ns ± 2%  93.1ns ± 1%   -0.39%  (p=0.000 n=48+49)
      NatSqr/8-4      131ns ± 1%   131ns ± 1%     ~     (p=0.870 n=46+49)
      NatSqr/10-4     175ns ± 1%   175ns ± 1%   +0.38%  (p=0.000 n=49+47)
      NatSqr/20-4     426ns ± 1%   429ns ± 1%   +0.84%  (p=0.000 n=46+48)
      NatSqr/30-4     702ns ± 2%   699ns ± 1%   -0.38%  (p=0.011 n=46+44)
      NatSqr/50-4    1.44µs ± 2%  1.43µs ± 1%   -0.54%  (p=0.010 n=48+48)
      NatSqr/80-4    2.85µs ± 1%  2.87µs ± 1%   +0.68%  (p=0.000 n=47+47)
      NatSqr/100-4   4.06µs ± 1%  4.07µs ± 1%   +0.29%  (p=0.000 n=46+45)
      NatSqr/200-4   13.4µs ± 1%  13.5µs ± 1%   +0.73%  (p=0.000 n=48+48)
      NatSqr/300-4   28.5µs ± 1%  28.2µs ± 1%   -1.22%  (p=0.000 n=46+48)
      NatSqr/500-4   81.9µs ± 1%  67.0µs ± 1%  -18.25%  (p=0.000 n=48+48)
      NatSqr/800-4    161µs ± 1%   140µs ± 1%  -13.29%  (p=0.000 n=47+48)
      NatSqr/1000-4   245µs ± 1%   207µs ± 1%  -15.17%  (p=0.000 n=49+49)
      
      go test -v -calibrate --run TestCalibrate
      ...
      Calibrating threshold between basicSqr(x) and karatsubaSqr(x)
      Looking for a timing difference for x between 200 - 500 words by 10 step
      words = 200 deltaT =     -980ns (  -7%) is karatsubaSqr(x) better: false
      words = 210 deltaT =     -773ns (  -5%) is karatsubaSqr(x) better: false
      words = 220 deltaT =     -695ns (  -4%) is karatsubaSqr(x) better: false
      words = 230 deltaT =     -570ns (  -3%) is karatsubaSqr(x) better: false
      words = 240 deltaT =     -458ns (  -2%) is karatsubaSqr(x) better: false
      words = 250 deltaT =      -63ns (   0%) is karatsubaSqr(x) better: false
      words = 260 deltaT =      118ns (   0%) is karatsubaSqr(x) better: true  threshold  found
      words = 270 deltaT =      377ns (   1%) is karatsubaSqr(x) better: true
      words = 280 deltaT =      765ns (   3%) is karatsubaSqr(x) better: true
      words = 290 deltaT =      673ns (   2%) is karatsubaSqr(x) better: true
      words = 300 deltaT =      502ns (   1%) is karatsubaSqr(x) better: true
      words = 310 deltaT =      629ns (   2%) is karatsubaSqr(x) better: true
      words = 320 deltaT =    1.011µs (   3%) is karatsubaSqr(x) better: true
      words = 330 deltaT =     1.36µs (   4%) is karatsubaSqr(x) better: true
      words = 340 deltaT =    3.001µs (   8%) is karatsubaSqr(x) better: true
      words = 350 deltaT =    3.178µs (   8%) is karatsubaSqr(x) better: true
      ...
      
      Change-Id: I6f13c23d94d042539ac28e77fd2618cdc37a429e
      Reviewed-on: https://go-review.googlesource.com/105075
      Run-TryBot: Robert Griesemer <gri@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
      1dc20e91
    • Andrew Bonventre's avatar
      doc: update Code of Conduct · 723f4286
      Andrew Bonventre authored
      Change-Id: I82c03dd026bb797a49b7361389373924acf6366c
      Reviewed-on: https://go-review.googlesource.com/114085Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
      723f4286
    • Hana (Hyang-Ah) Kim's avatar
      cmd/pprof: add readline support similar to upstream · 3f892149
      Hana (Hyang-Ah) Kim authored
      The upstream pprof implements the readline feature using
      the github.com/chzyer/readline package in its pprof.go main.
      
      It would be ideal to use the same readline support package as
      the upstream for better user experience and code maintenance.
      However, bringing in third-party packages requires more work
      than I envisioned (e.g. clean up the vendored code to meet the
      expected standard - iow don't break builders).
      
      As a result, this change implements the similar feature
      for the pprof command included in the go distribution
      (cmd/pprof/pprof.go) using golang.org/x/crypto/ssh/terminal
      for now.
      
      Auto-completion is not yet supported (same in the upstream).
      
      The feature is enabled only in linux, windows, darwin, and
      only when terminal support is available.
      
      This change brings in new vendored packages,
      golang.org/x/crypto/ssh/terminal and
      golang.org/x/sys/{unix,windows}.
      
      For #14041
      
      Change-Id: If4a790796acf2ab20f7e81268b9d9354c5a5cd2b
      Reviewed-on: https://go-review.googlesource.com/112436
      Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      3f892149
    • Richard Musiol's avatar
      syscall: partially revert "enable some nacl code to be shared with js/wasm" · 392ff18b
      Richard Musiol authored
      This partially reverts commit 3bdbb5df.
      The latest CL of js/wasm's file system support does not use
      file descriptor mapping any more.
      
      Change-Id: Iaec9c84b392366282cddc69acc75c8a3eb556824
      Reviewed-on: https://go-review.googlesource.com/114195Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      392ff18b
    • Adam Medzinski's avatar
      net: add example for net.UDPConn.WriteTo function · 645d4726
      Adam Medzinski authored
      The current documentation of the WriteTo function is very poor and it
      is difficult to deduce how to use it correctly. A good example will
      make things much easier.
      
      Fixes #25456
      
      Change-Id: Ibf0c0e153afae8f3e0d7d765d0dc9bcbfd69bfb1
      Reviewed-on: https://go-review.googlesource.com/113775
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      645d4726
    • Elias Naur's avatar
      misc/android: forward SIGQUIT to the process running on the device · 7ba1c91d
      Elias Naur authored
      When a test binary runs for too long, the go command sends it a
      SIGQUIT to force a backtrace dump. On Android, the exec wrapper
      will instead receive the signal and dump its backtrace.
      
      Forward SIGQUIT signals from the wrapper to the wrapped process
      to gain useful backtraces.
      
      Inspired by issuse 25519; this CL would have revealed the hanging
      test directly in the builder log.
      
      Change-Id: Ic362d06940d261374343a1dc09366ef54edaa631
      Reviewed-on: https://go-review.googlesource.com/114137
      Run-TryBot: Elias Naur <elias.naur@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      7ba1c91d
    • David Chase's avatar
      cmd/compile: grow stack before test() to avoid gdb misbehavior · 77c51c6c
      David Chase authored
      While next-ing over a call in gdb, if execution of that call
      causes a goroutine's stack to grow (i.e., be moved), gdb loses
      track and runs ahead to the next breakpoint, or to the end of
      the program, whichever comes first.
      
      Prevent this by preemptively growing the stack so that
      ssa/debug_test.go will reliably measure what is intended,
      the goodness of line number placement and variable printing.
      
      Fixes #25497.
      
      Change-Id: I8daf931650292a8c8faad2285d7fd405f2157bd2
      Reviewed-on: https://go-review.googlesource.com/114080
      Run-TryBot: David Chase <drchase@google.com>
      Reviewed-by: 's avatarAustin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      77c51c6c
    • Ian Gudger's avatar
      net: fix DNS NXDOMAIN performance regression · 11b3ee6f
      Ian Gudger authored
      golang.org/cl/37879 unintentionally changed the way NXDOMAIN errors were
      handled. Before that change, resolution would fail on the first NXDOMAIN
      error and return to the user. After that change, the next server would
      be consulted and resolution would fail only after all servers had been
      consulted. This change restores the old behavior.
      
      Go 10.10.2:
      BenchmarkGoLookupIP-12                        	   10000	    174883 ns/op   11450 B/op	     163 allocs/op
      BenchmarkGoLookupIPNoSuchHost-12              	    3000	    670140 ns/op   52189 B/op	     544 allocs/op
      BenchmarkGoLookupIPWithBrokenNameServer-12    	       1	5002568137 ns/op  163792 B/op	     375 allocs/op
      
      before this change:
      BenchmarkGoLookupIP-12                        	   10000	    165501 ns/op    8585 B/op	      94 allocs/op
      BenchmarkGoLookupIPNoSuchHost-12              	    1000	   1204117 ns/op   83661 B/op	     674 allocs/op
      BenchmarkGoLookupIPWithBrokenNameServer-12    	       1	5002629186 ns/op  159128 B/op	     275 allocs/op
      
      after this change:
      BenchmarkGoLookupIP-12                        	   10000	    158102 ns/op    8585 B/op	      94 allocs/op
      BenchmarkGoLookupIPNoSuchHost-12              	    2000	    645364 ns/op   42990 B/op	     356 allocs/op
      BenchmarkGoLookupIPWithBrokenNameServer-12    	       1	5002163437 ns/op  159144 B/op	     275 allocs/op
      
      Fixes #25336
      
      Change-Id: I315cd70330d1f66e54ce5a189a61c99f095bc138
      Reviewed-on: https://go-review.googlesource.com/113815Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      11b3ee6f
    • dchenk's avatar
      net/http: fix doc comment on PostFormValue function · 09797676
      dchenk authored
      This function checks Request.PostForm, which now includes values parsed
      from a PATCH request.
      
      Change-Id: I5d0af58d9c0e9111d4e822c45f0fb1f511bbf0d5
      Reviewed-on: https://go-review.googlesource.com/114009Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      09797676