1. 01 Nov, 2016 8 commits
    • Martin Möhrmann's avatar
      runtime: improve atoi implementation · d7b34d5f
      Martin Möhrmann authored
      - Adds overflow checks
      - Adds parsing of negative integers
      - Adds boolean return value to signal parsing errors
      - Adds atoi32 for parsing of integers that fit in an int32
      - Adds tests
      
      Handling of errors to provide error messages
      at the call sites is left to future CLs.
      
      Updates #17718
      
      Change-Id: I3cacd0ab1230b9efc5404c68edae7304d39bcbc0
      Reviewed-on: https://go-review.googlesource.com/32390Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      d7b34d5f
    • Carlos Eduardo Seo's avatar
      runtime: get ppc64x ISA level and hardware capabilities from HWCAP/HWCAP2 · 40aaf283
      Carlos Eduardo Seo authored
      This implements a check that can be done at runtime for the ISA level and
      hardware capability. It follows the same implementation as in s390x.
      
      These checks will be important as we enable new instructions and write go
      asm implementations using those.
      
      Updates #15403
      Fixes #16643
      
      Change-Id: Idfee374a3ffd7cf13a7d8cf0a6c83d247d3bee16
      Reviewed-on: https://go-review.googlesource.com/32330Reviewed-by: default avatarLynn Boger <laboger@linux.vnet.ibm.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      40aaf283
    • Michael Munday's avatar
      bytes, strings: optimize multi-byte index operations on s390x · 47c58b46
      Michael Munday authored
      Use vector instructions to speed up indexing operations for short
      strings (64 bytes or less).
      
      bytes_s390x.go and strings_s390x.go are based on their amd64
      equivalents in CL 31690.
      
      bytes package:
      
      name                   old time/op    new time/op    delta
      Index/10                 40.3ns ± 7%    11.3ns ± 4%    -72.06%  (p=0.000 n=10+10)
      Index/32                  196ns ± 1%      27ns ± 2%    -86.25%  (p=0.000 n=10+10)
      Index/4K                 28.9µs ± 1%     1.5µs ± 2%    -94.94%    (p=0.000 n=9+9)
      Index/4M                 30.1ms ± 2%     1.5ms ± 3%    -94.94%  (p=0.000 n=10+10)
      Index/64M                 549ms ±13%      28ms ± 3%    -94.87%   (p=0.000 n=10+9)
      IndexEasy/10             18.8ns ±11%    11.5ns ± 2%    -38.81%  (p=0.000 n=10+10)
      IndexEasy/32             23.6ns ± 6%    28.1ns ± 3%    +19.29%  (p=0.000 n=10+10)
      IndexEasy/4K              251ns ± 5%     223ns ± 8%    -11.04%  (p=0.000 n=10+10)
      IndexEasy/4M              318µs ± 9%     266µs ± 8%    -16.42%  (p=0.000 n=10+10)
      IndexEasy/64M            14.7ms ±16%    13.2ms ±11%    -10.22%  (p=0.001 n=10+10)
      
      strings package:
      
      name                   old time/op  new time/op  delta
      IndexRune              88.1ns ±16%  28.9ns ± 4%  -67.20%  (p=0.000 n=10+10)
      IndexRuneLongString     456ns ± 7%    34ns ± 3%  -92.50%  (p=0.000 n=10+10)
      IndexRuneFastPath      12.9ns ±14%  11.1ns ± 6%  -13.84%  (p=0.000 n=10+10)
      Index                  13.0ns ± 7%  11.3ns ± 4%  -13.31%  (p=0.000 n=10+10)
      IndexHard1             3.38ms ± 9%  0.07ms ± 1%  -97.79%  (p=0.000 n=10+10)
      IndexHard2             3.58ms ± 7%  0.37ms ± 2%  -89.78%  (p=0.000 n=10+10)
      IndexHard3             3.47ms ± 7%  0.75ms ± 1%  -78.52%  (p=0.000 n=10+10)
      IndexHard4             3.56ms ± 6%  1.34ms ± 0%  -62.39%    (p=0.000 n=9+9)
      
      Change-Id: If36c2afb8c02e80fcaa1cf5ec2abb0a2be08c7d1
      Reviewed-on: https://go-review.googlesource.com/32447
      Run-TryBot: Michael Munday <munday@ca.ibm.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      47c58b46
    • Daniel Martí's avatar
      testing: don't warn if -bench was passed · 11ff4b21
      Daniel Martí authored
      In a previous change, cmd/go was taught to show a "no tests ran" warning
      if test did nothing. But it missed a case - if no tests nor examples ran
      but any benchmarks were meant to be run, it would still produce the
      warning. This meant that running only benchmarks, which is common, would
      be confusing:
      
      	 $ go test -run='^$' -bench=.
      	testing: warning: no tests to run
      	BenchmarkFoo-4            300000              5056 ns/op
      	[...]
      
      I believe this was because of a copy-paste error in the tests. This was
      being tested, but on the wrong file which does contain a test that was
      being run. Fix the path and fix the now failing test by never showing
      the warning if -bench was given a non-empty string.
      
      The rationale is that if -bench was given but there was no output, it's
      obvious that nothing happened as benchmarks always produce output even
      without -v. So showing a warning in those cases is redundant.
      
      To make future typos less likely, make sure that no tests are being run
      in the cases where we only want to run benchmarks.
      
      Fixes #17603.
      
      Change-Id: I4c626caf39f72260c6a9761c06446663f465f947
      Reviewed-on: https://go-review.googlesource.com/32157Reviewed-by: default avatarMarcel van Lohuizen <mpvl@golang.org>
      Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      11ff4b21
    • Emmanuel Odeke's avatar
      net/http/httputil: add ModifyResponse to reverseProxy · 4a13f31f
      Emmanuel Odeke authored
      Adds ModifyResponse, an optional func to ReverseProxy
      that modifies a response in the backend, right before
      the headers of the response are written to the internal
      response writer.
      If ModifyResponse returns an error, the proxy returns
      a StatusBadGateway error.
      
      Fixes #14237.
      
      Change-Id: I8e03139e34dea0084512ccbd8cc49e941bf9fb5d
      Reviewed-on: https://go-review.googlesource.com/32356Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      4a13f31f
    • Joe Tsai's avatar
      encoding/json: marshal with null when RawMessage is nil · 032d150b
      Joe Tsai authored
      This CL expands upon a change made in (http://golang.org/cl/21811)
      to ensure that a nil RawMessage gets serialized as "null" instead of
      being a nil slice.
      
      The added check only triggers when the RawMessage is nil. We do not
      handle the case when the RawMessage is non-nil, but empty.
      
      Fixes #17704
      Updates #14493
      
      Change-Id: I0fbebcdd81f7466c5b78c94953afc897f162ceb4
      Reviewed-on: https://go-review.googlesource.com/32472Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      032d150b
    • Robert Griesemer's avatar
      cmd/compile/internal/syntax: don't panic if no error handler is provided · 7a26d9fc
      Robert Griesemer authored
      If no error handler is provided, terminate parsing with first error
      and report that error.
      
      Fixes #17697.
      
      Change-Id: I9070faf7239bd53725de141507912b92ded3474b
      Reviewed-on: https://go-review.googlesource.com/32456
      Run-TryBot: Robert Griesemer <gri@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      7a26d9fc
    • Brad Fitzpatrick's avatar
      net/http: add Server.Close & Server.Shutdown for forced & graceful shutdown · 53fc330e
      Brad Fitzpatrick authored
      Also updates x/net/http2 to git rev 541150 for:
      
         http2: add support for graceful shutdown of Server
         https://golang.org/cl/32412
      
         http2: make http2.Server access http1's Server via an interface check
         https://golang.org/cl/32417
      
      Fixes #4674
      Fixes #9478
      
      Change-Id: I8021a18dee0ef2fe3946ac1776d2b10d3d429052
      Reviewed-on: https://go-review.googlesource.com/32329
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      53fc330e
  2. 31 Oct, 2016 28 commits
  3. 30 Oct, 2016 4 commits