1. 21 Apr, 2016 2 commits
  2. 20 Apr, 2016 20 commits
  3. 19 Apr, 2016 18 commits
    • Andrew Gerrand's avatar
      doc: document go1.6.2 · 7b0ba1cf
      Andrew Gerrand authored
      Change-Id: Ib3063719cf90dfad139dd723b3b16ef0b45e312e
      Reviewed-on: https://go-review.googlesource.com/22251Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      7b0ba1cf
    • Matthew Dempsky's avatar
      cmd/compile/internal/gc: simplify typecheck's Efoo consts · 2244ae41
      Matthew Dempsky authored
      There's no need for Eiota, Eindir, Eaddr, or Eproc; the values are
      threaded through to denote various typechecking contexts, but they
      don't actually influence typechecking behavior at all.
      
      Also, while here, switch the Efoo const declarations to use iota.
      
      Passes toolstash -cmp.
      
      Change-Id: I5cea869ccd0755c481cf071978f863474bc9c1ed
      Reviewed-on: https://go-review.googlesource.com/22271
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      2244ae41
    • Julia Hansbrough's avatar
      runtime: updated SIGSYS to cause a panic + stacktrace · 58012ea7
      Julia Hansbrough authored
      On GNU/Linux, SIGSYS is specified to cause the process to terminate
      without a core dump. In https://codereview.appspot.com/3749041 , it
      appears that Golang accidentally introduced incorrect behavior for
      this signal, which caused Golang processes to keep running after
      receiving SIGSYS. This change reverts it to the old/correct behavior.
      
      Updates #15204
      
      Change-Id: I3aa48a9499c1bc36fa5d3f40c088fdd7599e0db5
      Reviewed-on: https://go-review.googlesource.com/22202Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      58012ea7
    • Robert Griesemer's avatar
      strconv: fix ParseFloat for special forms of zero values · 5e74d409
      Robert Griesemer authored
      Fixes #15364.
      
      Change-Id: Id2a349896064c7c9e00e36c55162068bf18162b2
      Reviewed-on: https://go-review.googlesource.com/22272Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      5e74d409
    • Brad Fitzpatrick's avatar
      crypto/x509: fix copy/paste-o in error message · ba756301
      Brad Fitzpatrick authored
      Fixes #15371
      
      Change-Id: Iff8d36e1bd9b5641f6b577a30ac6e967f973c939
      Reviewed-on: https://go-review.googlesource.com/22240Reviewed-by: default avatarAndrew Gerrand <adg@golang.org>
      ba756301
    • Keith Randall's avatar
      cmd/compile: convT2{I,E} don't handle direct interfaces · 998c8e03
      Keith Randall authored
      We now inline type to interface conversions when the type
      is pointer-shaped.  No need to keep code to handle that in
      convT2{I,E}.
      
      Change-Id: I3a6668259556077cbb2986a9e8fe42a625d506c9
      Reviewed-on: https://go-review.googlesource.com/22249
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMichel Lespinasse <walken@google.com>
      998c8e03
    • Alexandru Moșoi's avatar
      cmd/compile: transform some Phis into Or8. · 8b20fd00
      Alexandru Moșoi authored
      func f(a, b bool) bool {
                return a || b
      }
      
      is now a single instructions (excluding loading and unloading the arguments):
            v10 = ORB <bool> v11 v12 : AX
      
      Change-Id: Iff63399410cb46909f4318ea1c3f45a029f4aa5e
      Reviewed-on: https://go-review.googlesource.com/21872
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
      8b20fd00
    • Robert Griesemer's avatar
      go/types: trailing semis are ok after valid fallthrough · 082f4648
      Robert Griesemer authored
      Fixes #15376.
      
      Change-Id: I9ece80f26b83be129671c961120c157da2ac0079
      Reviewed-on: https://go-review.googlesource.com/22270Reviewed-by: default avatarAlan Donovan <adonovan@google.com>
      082f4648
    • Josh Bleecher Snyder's avatar
      runtime: add maxSliceCap · a4dd6ea1
      Josh Bleecher Snyder authored
      This avoids expensive division calculations
      for many common slice element sizes.
      
      name                      old time/op  new time/op  delta
      MakeSlice-8               51.9ns ± 3%  35.1ns ± 2%  -32.41%  (p=0.000 n=10+10)
      GrowSliceBytes-8          44.1ns ± 2%  44.1ns ± 1%     ~     (p=0.984 n=10+10)
      GrowSliceInts-8           60.9ns ± 3%  60.9ns ± 3%     ~     (p=0.698 n=10+10)
      GrowSlicePtr-8             131ns ± 1%   120ns ± 2%   -8.41%   (p=0.000 n=8+10)
      GrowSliceStruct24Bytes-8   111ns ± 2%   103ns ± 3%   -7.23%    (p=0.000 n=8+8)
      
      Change-Id: I2630eb3d73c814db030cad16e620ea7fecbbd312
      Reviewed-on: https://go-review.googlesource.com/22223Reviewed-by: default avatarKeith Randall <khr@golang.org>
      a4dd6ea1
    • Josh Bleecher Snyder's avatar
      cmd/compile: static composite literals are side-effect free · 55ab07c2
      Josh Bleecher Snyder authored
      This extends CL 22192.
      
      This removes the remaining performance disparity
      between non-SSA and SSA on the AppendInPlace benchmarks.
      
      Going from non-SSA to SSA:
      
      AppendInPlace/NoGrow/2Ptr-8  1.60µs ± 5%  1.53µs ± 5%  -4.04%  (p=0.000 n=15+14)
      AppendInPlace/NoGrow/3Ptr-8  2.04µs ± 3%  1.96µs ± 2%  -3.90%  (p=0.000 n=13+14)
      AppendInPlace/NoGrow/4Ptr-8  2.83µs ± 8%  2.62µs ± 4%  -7.39%  (p=0.000 n=13+15)
      
      Previously these were 20% regressions.
      
      Change-Id: Ie87810bffd598730658e07585f5e2ef979a12b8f
      Reviewed-on: https://go-review.googlesource.com/22248Reviewed-by: default avatarKeith Randall <khr@golang.org>
      55ab07c2
    • Josh Bleecher Snyder's avatar
      cmd/compile: fix isStaticCompositeLiteral · 3c6e60c0
      Josh Bleecher Snyder authored
      Previously, isStaticCompositeLiteral would
      return the wrong value for literals like:
      
      [1]struct{ b []byte }{b: []byte{1}}
      
      Note that the outermost component is an array,
      but once we recurse into isStaticCompositeLiteral,
      we never check again that arrays are actually arrays.
      
      Instead of adding more logic to the guts of
      isStaticCompositeLiteral, allow it to accept
      any Node and return the correct answer.
      
      Change-Id: I6af7814a9037bbc7043da9a96137fbee067bbe0e
      Reviewed-on: https://go-review.googlesource.com/22247Reviewed-by: default avatarKeith Randall <khr@golang.org>
      3c6e60c0
    • Robert Griesemer's avatar
      go/types: accept trailing empty stmts in terminating stmt lists · 562d398a
      Robert Griesemer authored
      Per the latest spec refinement (https://golang.org/cl/19981).
      
      Fixes #14537.
      
      Change-Id: I2dedee942c4da21dc94bdeda466f133827ab5bb9
      Reviewed-on: https://go-review.googlesource.com/22241
      Run-TryBot: Robert Griesemer <gri@golang.org>
      Reviewed-by: default avatarAlan Donovan <adonovan@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      562d398a
    • Michael Munday's avatar
      crypto/aes: de-couple asm and go implementations · 9b6bf20a
      Michael Munday authored
      There is currently only one assembly implementation of AES
      (amd64). While it is possible to fit other implementations to the
      same pattern it complicates the code. For example s390x does not
      use expanded keys, so having enc and dec in the aesCipher struct
      is confusing.
      
      By separating out the asm implementations we can more closely
      match the data structures to the underlying implementation. This
      also opens the door for AES implementations that support block
      cipher modes other than GCM (e.g. CTR and CBC).
      
      This commit changes BenchmarkExpandKey to test the go
      implementation of key expansion. It might be better to have some
      sort of 'initialisation' benchmark instead to cover the startup
      costs of the assembly implementations (which might be doing
      key expansion in a different way, or not at all).
      
      Change-Id: I094a7176b5bbe2177df73163a9c0b711a61c12d6
      Reviewed-on: https://go-review.googlesource.com/22193
      Run-TryBot: Michael Munday <munday@ca.ibm.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      9b6bf20a
    • Josh Bleecher Snyder's avatar
      cmd/compile: re-enable in-place append optimization · 03e216f3
      Josh Bleecher Snyder authored
      CL 21891 was too clever in its attempts to avoid spills.
      Storing newlen too early caused uses of append in the runtime
      itself to receive an inconsistent view of a slice,
      leading to corruption.
      
      This CL makes the generate code much more similar to
      the old backend. It spills more than before,
      but those spills have been contained to the grow path.
      It recalculates newlen unnecessarily on the fast path,
      but that's measurably cheaper than spilling it.
      
      CL 21891 caused runtime failures in 6 of 2000 runs
      of net/http and crypto/x509 in my test setup.
      This CL has gone 6000 runs without a failure.
      
      
      Benchmarks going from master to this CL:
      
      name                         old time/op  new time/op  delta
      AppendInPlace/NoGrow/Byte-8   439ns ± 2%   436ns ± 2%  -0.72%  (p=0.001 n=28+27)
      AppendInPlace/NoGrow/1Ptr-8   901ns ± 0%   856ns ± 0%  -4.95%  (p=0.000 n=26+29)
      AppendInPlace/NoGrow/2Ptr-8  2.15µs ± 1%  1.95µs ± 0%  -9.07%  (p=0.000 n=28+30)
      AppendInPlace/NoGrow/3Ptr-8  2.66µs ± 0%  2.45µs ± 0%  -7.93%  (p=0.000 n=29+26)
      AppendInPlace/NoGrow/4Ptr-8  3.24µs ± 1%  3.02µs ± 1%  -6.75%  (p=0.000 n=28+30)
      AppendInPlace/Grow/Byte-8     269ns ± 1%   271ns ± 1%  +0.84%  (p=0.000 n=30+29)
      AppendInPlace/Grow/1Ptr-8     275ns ± 1%   280ns ± 1%  +1.75%  (p=0.000 n=30+30)
      AppendInPlace/Grow/2Ptr-8     384ns ± 0%   391ns ± 0%  +1.94%  (p=0.000 n=27+30)
      AppendInPlace/Grow/3Ptr-8     455ns ± 0%   462ns ± 0%  +1.43%  (p=0.000 n=29+29)
      AppendInPlace/Grow/4Ptr-8     478ns ± 0%   479ns ± 0%  +0.23%  (p=0.000 n=30+27)
      
      
      However, for the large no-grow cases, there is still more work to be done.
      Going from this CL to the non-SSA backend:
      
      name                         old time/op  new time/op  delta
      AppendInPlace/NoGrow/Byte-8   436ns ± 2%   436ns ± 2%     ~     (p=0.967 n=27+29)
      AppendInPlace/NoGrow/1Ptr-8   856ns ± 0%   884ns ± 0%   +3.28%  (p=0.000 n=29+26)
      AppendInPlace/NoGrow/2Ptr-8  1.95µs ± 0%  1.56µs ± 0%  -20.28%  (p=0.000 n=30+29)
      AppendInPlace/NoGrow/3Ptr-8  2.45µs ± 0%  1.89µs ± 0%  -22.88%  (p=0.000 n=26+28)
      AppendInPlace/NoGrow/4Ptr-8  3.02µs ± 1%  2.56µs ± 1%  -15.35%  (p=0.000 n=30+28)
      AppendInPlace/Grow/Byte-8     271ns ± 1%   283ns ± 1%   +4.56%  (p=0.000 n=29+29)
      AppendInPlace/Grow/1Ptr-8     280ns ± 1%   288ns ± 1%   +2.99%  (p=0.000 n=30+30)
      AppendInPlace/Grow/2Ptr-8     391ns ± 0%   409ns ± 0%   +4.66%  (p=0.000 n=30+29)
      AppendInPlace/Grow/3Ptr-8     462ns ± 0%   481ns ± 0%   +4.13%  (p=0.000 n=29+30)
      AppendInPlace/Grow/4Ptr-8     479ns ± 0%   502ns ± 0%   +4.81%  (p=0.000 n=27+26)
      
      
      New generated code:
      
      var x []byte
      
      func a() {
      	x = append(x, 1)
      }
      
      
      "".a t=1 size=208 args=0x0 locals=0x48
      	0x0000 00000 (a.go:5)	TEXT	"".a(SB), $72-0
      	0x0000 00000 (a.go:5)	MOVQ	(TLS), CX
      	0x0009 00009 (a.go:5)	CMPQ	SP, 16(CX)
      	0x000d 00013 (a.go:5)	JLS	190
      	0x0013 00019 (a.go:5)	SUBQ	$72, SP
      	0x0017 00023 (a.go:5)	FUNCDATA	$0, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB)
      	0x0017 00023 (a.go:5)	FUNCDATA	$1, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB)
      	0x0017 00023 (a.go:6)	MOVQ	"".x+16(SB), CX
      	0x001e 00030 (a.go:6)	MOVQ	"".x+8(SB), DX
      	0x0025 00037 (a.go:6)	MOVQ	"".x(SB), BX
      	0x002c 00044 (a.go:6)	LEAQ	1(DX), BP
      	0x0030 00048 (a.go:6)	CMPQ	BP, CX
      	0x0033 00051 (a.go:6)	JGT	$0, 73
      	0x0035 00053 (a.go:6)	LEAQ	1(DX), AX
      	0x0039 00057 (a.go:6)	MOVQ	AX, "".x+8(SB)
      	0x0040 00064 (a.go:6)	MOVB	$1, (BX)(DX*1)
      	0x0044 00068 (a.go:7)	ADDQ	$72, SP
      	0x0048 00072 (a.go:7)	RET
      	0x0049 00073 (a.go:6)	LEAQ	type.[]uint8(SB), AX
      	0x0050 00080 (a.go:6)	MOVQ	AX, (SP)
      	0x0054 00084 (a.go:6)	MOVQ	BX, 8(SP)
      	0x0059 00089 (a.go:6)	MOVQ	DX, 16(SP)
      	0x005e 00094 (a.go:6)	MOVQ	CX, 24(SP)
      	0x0063 00099 (a.go:6)	MOVQ	BP, 32(SP)
      	0x0068 00104 (a.go:6)	PCDATA	$0, $0
      	0x0068 00104 (a.go:6)	CALL	runtime.growslice(SB)
      	0x006d 00109 (a.go:6)	MOVQ	40(SP), CX
      	0x0072 00114 (a.go:6)	MOVQ	48(SP), DX
      	0x0077 00119 (a.go:6)	MOVQ	DX, "".autotmp_0+64(SP)
      	0x007c 00124 (a.go:6)	MOVQ	56(SP), BX
      	0x0081 00129 (a.go:6)	MOVQ	BX, "".x+16(SB)
      	0x0088 00136 (a.go:6)	MOVL	runtime.writeBarrier(SB), AX
      	0x008e 00142 (a.go:6)	TESTB	AL, AL
      	0x0090 00144 (a.go:6)	JNE	$0, 162
      	0x0092 00146 (a.go:6)	MOVQ	CX, "".x(SB)
      	0x0099 00153 (a.go:6)	MOVQ	"".x(SB), BX
      	0x00a0 00160 (a.go:6)	JMP	53
      	0x00a2 00162 (a.go:6)	LEAQ	"".x(SB), BX
      	0x00a9 00169 (a.go:6)	MOVQ	BX, (SP)
      	0x00ad 00173 (a.go:6)	MOVQ	CX, 8(SP)
      	0x00b2 00178 (a.go:6)	PCDATA	$0, $0
      	0x00b2 00178 (a.go:6)	CALL	runtime.writebarrierptr(SB)
      	0x00b7 00183 (a.go:6)	MOVQ	"".autotmp_0+64(SP), DX
      	0x00bc 00188 (a.go:6)	JMP	153
      	0x00be 00190 (a.go:6)	NOP
      	0x00be 00190 (a.go:5)	CALL	runtime.morestack_noctxt(SB)
      	0x00c3 00195 (a.go:5)	JMP	0
      
      
      Fixes #14969 again
      
      Change-Id: Ia50463b1f506011aad0718a4fef1d4738e43c32d
      Reviewed-on: https://go-review.googlesource.com/22197
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      03e216f3
    • Robert Griesemer's avatar
      spec: refine rules about terminating statements · b5ddbb90
      Robert Griesemer authored
      Per a suggestion from mdempsky.
      
      Both gc and gccgo consider a statement list as terminating if the
      last _non_empty_ statement is terminating; i.e., trailing semis are
      ok. Only gotype followed the current stricter rule in the spec.
      
      This change adjusts the spec to match gc and gccgo behavior. In
      support of this change, the spec has a matching rule for fallthrough,
      which in valid positions may be followed by trailing semis as well.
      
      For details and examples, see the issue below.
      
      Fixes #14422.
      
      Change-Id: Ie17c282e216fc40ecb54623445c17be111e17ade
      Reviewed-on: https://go-review.googlesource.com/19981Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      b5ddbb90
    • Michael Munday's avatar
      crypto/aes: delete TestEncryptBlock and TestDecryptBlock · a39950ba
      Michael Munday authored
      The encryptBlock and decryptBlock functions are already tested
      (via the public API) by TestCipherEncrypt and TestCipherDecrypt
      respectively. Both sets of tests check the output of the two
      functions against the same set of FIPS 197 examples. I therefore
      think it is safe to delete these two tests without losing any
      coverage.
      
      Deleting these two tests will make it easier to modify the
      internal API, which I am hoping to do in future CLs.
      
      Change-Id: I0dd568bc19f47b70ab09699b507833e527d39ba7
      Reviewed-on: https://go-review.googlesource.com/22115Reviewed-by: default avatarAdam Langley <agl@golang.org>
      Run-TryBot: Adam Langley <agl@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      a39950ba
    • Mikio Hara's avatar
      net: add support for Zone of IPNet · 3e9264c9
      Mikio Hara authored
      This change adds Zone field to IPNet structure for making it possible to
      determine which network interface is associated with IPv6 link-local
      address. Also makes ParseCIDR and IPNet.String capable handling literal
      IPv6 address prefixes with zone identifier.
      
      Fixes #14518.
      
      Change-Id: I8f8a40d3b4f500ffef25728d4995651379d8408a
      Reviewed-on: https://go-review.googlesource.com/19946Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      3e9264c9
    • Alex Brainman's avatar
      net: stop using GetHostByName and GetServByName · 45bb8874
      Alex Brainman authored
      Go 1.6 requires Windows XP or later. I have:
      
      C:\>systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
      OS Name:                   Microsoft Windows XP Professional
      OS Version:                5.1.2600 Service Pack 3 Build 2600
      
      Running "go test" PASSes on my system after this CL is applied.
      
      Change-Id: Id59d169138c4a4183322c89ee7e766fb74d381fa
      Reviewed-on: https://go-review.googlesource.com/22209Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      45bb8874