1. 19 Aug, 2016 2 commits
  2. 18 Aug, 2016 21 commits
  3. 17 Aug, 2016 17 commits
    • Adam Langley's avatar
      crypto/x509: require a NULL parameters for RSA public keys. · 59aeac20
      Adam Langley authored
      The RFC is clear that the Parameters in an AlgorithmIdentifer for an RSA
      public key must be NULL. BoringSSL enforces this so we have strong
      evidence that this is a widely compatible change.
      
      Embarrassingly enough, the major source of violations of this is us. Go
      used to get this correct in only one of two places. This was only fixed
      in 2013 (with 4874bc9b). That's why lots of test certificates are
      updated in this change.
      
      Fixes #16166.
      
      Change-Id: Ib9a4551349354c66e730d44eb8cee4ec402ea8ab
      Reviewed-on: https://go-review.googlesource.com/27312Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      59aeac20
    • Alberto Donizetti's avatar
      encoding/hex: change lookup table from string to array · 57370a87
      Alberto Donizetti authored
      name            old time/op  new time/op  delta
      Encode/256-4     431ns ± 2%   391ns ± 2%   -9.36%  (p=0.000 n=8+8)
      Encode/1024-4   1.68µs ± 0%  1.51µs ± 0%   -9.91%  (p=0.001 n=7+7)
      Encode/4096-4   6.68µs ± 0%  6.03µs ± 1%   -9.69%  (p=0.000 n=8+8)
      Encode/16384-4  27.0µs ± 1%  24.0µs ± 0%  -11.03%  (p=0.000 n=8+7)
      
      Change-Id: I6994e02f77797349c4e188377d84f97dffe98399
      Reviewed-on: https://go-review.googlesource.com/27254Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      57370a87
    • Robert Griesemer's avatar
      go/types: enable disabled test for comma-ok expressions · 17eee310
      Robert Griesemer authored
      This was fixed long ago but the test was not enabled.
      
      For #8189.
      
      Change-Id: Ia44ef752b6bf076f3e243d2d0db326a392a20193
      Reviewed-on: https://go-review.googlesource.com/27310
      Run-TryBot: Robert Griesemer <gri@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      17eee310
    • Adam Langley's avatar
      crypto/hmac: don't test for length equality in Equal. · 69371671
      Adam Langley authored
      subtle.ConstantTimeCompare now tests the length of the inputs (although
      it didn't when this code was written) so this test in crypto/hmac is now
      superfluous.
      
      Fixes #16336.
      
      Change-Id: Ic02d8537e776fa1dd5694d3af07a28c4d840d14b
      Reviewed-on: https://go-review.googlesource.com/27239Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      69371671
    • Adam Langley's avatar
      crypto/x509: return error for missing SerialNumber. · b23b9a76
      Adam Langley authored
      If the SerialNumber is nil in the template then the resulting panic is
      rather deep in encoding/asn1 and it's not obvious what went wrong.
      
      This change tests and returns a more helpful error in this case.
      
      Fixes #16603.
      
      Change-Id: Ib30d652555191eb78f705dff8d909e4b5808f9ca
      Reviewed-on: https://go-review.googlesource.com/27238Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      b23b9a76
    • Jaana Burcu Dogan's avatar
      runtime: fix the absolute URL to pprof tools · c2322b7e
      Jaana Burcu Dogan authored
      Change-Id: I82eaf5c14a5b8b9ec088409f946adf7b5fd5dbe3
      Reviewed-on: https://go-review.googlesource.com/27311Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      c2322b7e
    • Jess Frazelle's avatar
      text/template: remove unused Tree.parse return value · c3f05d95
      Jess Frazelle authored
      Fixes #13993
      
      Change-Id: Ic61b2bcd9f4f71457d3a8581574633d505d5750e
      Reviewed-on: https://go-review.googlesource.com/27240
      Run-TryBot: Rob Pike <r@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRob Pike <r@golang.org>
      c3f05d95
    • Robert Griesemer's avatar
      go/types: better error message for invalid fallthrough case · d1272a8b
      Robert Griesemer authored
      Now matches the gc compiler.
      
      Fixes #15594.
      
      Change-Id: I9f3942367bc0acf883c6216b8ca44820832f5fe3
      Reviewed-on: https://go-review.googlesource.com/27241
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Run-TryBot: Robert Griesemer <gri@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      d1272a8b
    • Radu Berinde's avatar
      hash/crc32: improve the processing of the last bytes in the SSE4.2 code for AMD64 · 0c819b65
      Radu Berinde authored
      This commit improves the processing of the final few bytes in
      castagnoliSSE42: instead of processing one byte at a time, we use all
      versions of the CRC32 instruction to process 4 bytes, then 2, then 1.
      The difference is only noticeable for small "odd" sized buffers.
      
      We do the similar improvement for processing the first few bytes in
      the case of unaligned buffer.
      
      Fixing the test which was not actually verifying the results for
      misaligned buffers (WriteString was creating an internal copy which
      was aligned).
      
      Adding benchmarks for length 15 (aligned and misaligned), results
      below.
      
      name                          old time/op    new time/op    delta
      CastagnoliCrc15B-4              25.1ns ± 0%    22.1ns ± 1%  -12.14%
      CastagnoliCrc15BMisaligned-4    25.2ns ± 0%    22.9ns ± 1%   -9.03%
      CastagnoliCrc40B-4              23.1ns ± 0%    23.4ns ± 0%   +1.08%
      CastagnoliCrc1KB-4               127ns ± 0%     128ns ± 0%   +1.18%
      CastagnoliCrc4KB-4               462ns ± 0%     464ns ± 0%     ~
      CastagnoliCrc32KB-4             3.58µs ± 0%    3.60µs ± 0%   +0.58%
      
      name                          old speed      new speed      delta
      CastagnoliCrc15B-4             597MB/s ± 0%   679MB/s ± 1%  +13.77%
      CastagnoliCrc15BMisaligned-4   596MB/s ± 0%   655MB/s ± 1%   +9.94%
      CastagnoliCrc40B-4            1.73GB/s ± 0%  1.71GB/s ± 0%   -1.14%
      CastagnoliCrc1KB-4            8.01GB/s ± 0%  7.93GB/s ± 1%   -1.06%
      CastagnoliCrc4KB-4            8.86GB/s ± 0%  8.83GB/s ± 0%     ~
      CastagnoliCrc32KB-4           9.14GB/s ± 0%  9.09GB/s ± 0%   -0.58%
      
      Change-Id: I499e37af2241d28e3e5d522bbab836c1a718430a
      Reviewed-on: https://go-review.googlesource.com/24470Reviewed-by: default avatarKeith Randall <khr@golang.org>
      0c819b65
    • Cherry Zhang's avatar
      cmd/compile: CSE copied tuple selectors · 3d5cf72c
      Cherry Zhang authored
      In CSE if a tuple generator is CSE'd to a different block, its
      selectors are copied to the same block. In this case, also CES
      the copied selectors.
      
      Test copied from Keith's CL 27202.
      
      Fixes #16741.
      
      Change-Id: I2fc8b9513d430f10d6104275cfff5fb75d3ef3d9
      Reviewed-on: https://go-review.googlesource.com/27236
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarDavid Chase <drchase@google.com>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      3d5cf72c
    • Josh Bleecher Snyder's avatar
      cmd/vet: infer asm arch from build context · 2b8e143d
      Josh Bleecher Snyder authored
      If we cannot infer the asm arch from the filename
      or the build tags, assume that it is the
      current build arch. Assembly files with no
      restrictions ought to be usable on all arches.
      
      Updates #11041
      
      Change-Id: I0ae807dbbd5fb67ca21d0157fe180237a074113a
      Reviewed-on: https://go-review.googlesource.com/27151
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRob Pike <r@golang.org>
      2b8e143d
    • Josh Bleecher Snyder's avatar
      cmd/vet: allow ^& uintptr arithmetic · 752e1615
      Josh Bleecher Snyder authored
      The unsafe.Pointer check allows adding to
      and subtracting from uintptrs in order to do
      arithmetic.
      
      Some code needs to round uintptrs.
      Allow &^ for that purpose.
      
      Updates #11041
      
      Change-Id: Ib90dd2954bb6c78427058271e13f2ce4c4af38fb
      Reviewed-on: https://go-review.googlesource.com/27156
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRob Pike <r@golang.org>
      752e1615
    • Atin M's avatar
      crypto/tls: set Conn.ConnectionState.ServerName unconditionally · ebcd1797
      Atin M authored
      Moves the state.ServerName assignment to outside the if
      statement that checks for handshakeComplete.
      
      Fixes #15571
      
      Change-Id: I6c4131ddb16389aed1c410a975f9aa3b52816965
      Reviewed-on: https://go-review.googlesource.com/22862
      Run-TryBot: Adam Langley <agl@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAdam Langley <agl@golang.org>
      ebcd1797
    • Cherry Zhang's avatar
      cmd/compile: add more ARM64 optimizations · 659dd4f1
      Cherry Zhang authored
      - Use machine instructions for uint64<->float conversions
      - Do not enforce alignment on Zero/Move
      	ARM64 supports unaligned load/stores, but only aligned offset
      	or small offset can be encoded into instructions.
      - Do combined loads
      
      Change-Id: Iffca7dd0f13070b17b784861ce5a30af584680eb
      Reviewed-on: https://go-review.googlesource.com/27086Reviewed-by: default avatarDavid Chase <drchase@google.com>
      659dd4f1
    • Alberto Donizetti's avatar
      math/big: avoid allocation in float.{Add, Sub} when there's no aliasing · cda633b3
      Alberto Donizetti authored
      name               old time/op    new time/op    delta
      FloatAdd/10-4         116ns ± 1%      82ns ± 0%   -28.74%  (p=0.008 n=5+5)
      FloatAdd/100-4        124ns ± 0%      86ns ± 1%   -30.34%  (p=0.016 n=4+5)
      FloatAdd/1000-4       192ns ± 1%     123ns ± 0%   -35.94%  (p=0.008 n=5+5)
      FloatAdd/10000-4      826ns ± 0%     438ns ± 0%   -46.99%  (p=0.000 n=4+5)
      FloatAdd/100000-4    6.82µs ± 1%    3.36µs ± 0%   -50.74%  (p=0.008 n=5+5)
      FloatSub/10-4         108ns ± 1%      77ns ± 1%   -29.06%  (p=0.008 n=5+5)
      FloatSub/100-4        115ns ± 0%      79ns ± 0%   -31.48%  (p=0.029 n=4+4)
      FloatSub/1000-4       168ns ± 0%      99ns ± 0%   -41.09%  (p=0.029 n=4+4)
      FloatSub/10000-4      690ns ± 2%     288ns ± 1%   -58.24%  (p=0.008 n=5+5)
      FloatSub/100000-4    5.37µs ± 1%    2.10µs ± 1%   -60.89%  (p=0.008 n=5+5)
      
      name               old alloc/op   new alloc/op   delta
      FloatAdd/10-4         48.0B ± 0%     0.0B ±NaN%  -100.00%  (p=0.008 n=5+5)
      FloatAdd/100-4        64.0B ± 0%     0.0B ±NaN%  -100.00%  (p=0.008 n=5+5)
      FloatAdd/1000-4        176B ± 0%       0B ±NaN%  -100.00%  (p=0.008 n=5+5)
      FloatAdd/10000-4     1.41kB ± 0%   0.00kB ±NaN%  -100.00%  (p=0.008 n=5+5)
      FloatAdd/100000-4    13.6kB ± 0%    0.0kB ±NaN%  -100.00%  (p=0.008 n=5+5)
      FloatSub/10-4         48.0B ± 0%     0.0B ±NaN%  -100.00%  (p=0.008 n=5+5)
      FloatSub/100-4        64.0B ± 0%     0.0B ±NaN%  -100.00%  (p=0.008 n=5+5)
      FloatSub/1000-4        176B ± 0%       0B ±NaN%  -100.00%  (p=0.008 n=5+5)
      FloatSub/10000-4     1.41kB ± 0%   0.00kB ±NaN%  -100.00%  (p=0.008 n=5+5)
      FloatSub/100000-4    13.6kB ± 0%    0.0kB ±NaN%  -100.00%  (p=0.008 n=5+5)
      
      Fixes #14868
      
      Change-Id: Ia2b8b1a8ef0868288ecb25f812b17bd03ff40d1c
      Reviewed-on: https://go-review.googlesource.com/23568Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      cda633b3
    • Robert Griesemer's avatar
      cmd/compile: add compiler phase timing · f542576b
      Robert Griesemer authored
      Timings is a simple data structure that collects times of labeled
      Start/Stop events describing timed phases, which later can be written
      to a file.
      
      Adjacent phases with common label prefix are automatically collected
      in a group together with the accumulated phase time.
      
      Timing data can be appended to a file in benchmark data format
      using the new -bench flag:
      
      $ go build -gcflags="-bench=/dev/stdout" -o /dev/null go/types
      commit: devel +8847c6b Mon Aug 15 17:51:53 2016 -0700
      goos: darwin
      goarch: amd64
      BenchmarkCompile:go/types:fe:init              1       663292 ns/op      0.07 %
      BenchmarkCompile:go/types:fe:loadsys           1      1337371 ns/op      0.14 %
      BenchmarkCompile:go/types:fe:parse             1     47008869 ns/op      4.91 %    10824 lines    230254 lines/s
      BenchmarkCompile:go/types:fe:typecheck:top1    1      2843343 ns/op      0.30 %
      BenchmarkCompile:go/types:fe:typecheck:top2    1       447457 ns/op      0.05 %
      BenchmarkCompile:go/types:fe:typecheck:func    1     15119595 ns/op      1.58 %      427 funcs     28241 funcs/s
      BenchmarkCompile:go/types:fe:capturevars       1        56314 ns/op      0.01 %
      BenchmarkCompile:go/types:fe:inlining          1      9805767 ns/op      1.02 %
      BenchmarkCompile:go/types:fe:escapes           1     53598646 ns/op      5.60 %
      BenchmarkCompile:go/types:fe:xclosures         1       199302 ns/op      0.02 %
      BenchmarkCompile:go/types:fe:subtotal          1    131079956 ns/op     13.70 %
      BenchmarkCompile:go/types:be:compilefuncs      1    692009428 ns/op     72.33 %      427 funcs       617 funcs/s
      BenchmarkCompile:go/types:be:externaldcls      1        54591 ns/op      0.01 %
      BenchmarkCompile:go/types:be:dumpobj           1    133478173 ns/op     13.95 %
      BenchmarkCompile:go/types:be:subtotal          1    825542192 ns/op     86.29 %
      BenchmarkCompile:go/types:unaccounted          1       106101 ns/op      0.01 %
      BenchmarkCompile:go/types:total                1    956728249 ns/op    100.00 %
      
      For #16169.
      
      Change-Id: I93265fe0cb08e47cd413608d0824c5dd35ba7899
      Reviewed-on: https://go-review.googlesource.com/24462Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      f542576b
    • Tom Wilkie's avatar
      net: don't avoid resolving .local addresses · 289df4e6
      Tom Wilkie authored
      .local addresses are used by things like Kubernetes and Weave DNS; Go
      should not avoid resolving them.
      
      This is a partial revert of https://golang.org/cl/21328 which was too
      strict of an interpretation of RFC 6762.
      
      Fixes #16739
      
      Change-Id: I349415b4eab5d61240dd18217bd95dc7d2105cd5
      Reviewed-on: https://go-review.googlesource.com/27250Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      289df4e6