1. 12 Apr, 2016 26 commits
  2. 11 Apr, 2016 14 commits
    • Brad Fitzpatrick's avatar
      context: attempt to deflake timing tests · 501ddf71
      Brad Fitzpatrick authored
      Passes on OpenBSD now when running it with -count=500.
      
      Presumably this will also fix the same problems seen on FreeBSD and
      Windows.
      
      Fixes #15158
      
      Change-Id: I86451c901613dfa5ecff0c2ecc516527a3c011b3
      Reviewed-on: https://go-review.googlesource.com/21840
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAndrew Gerrand <adg@golang.org>
      501ddf71
    • Rob Pike's avatar
      cmd/vet: improve documentation for flags, slightly · d1feddb7
      Rob Pike authored
      The way that -all works was unclear from the documentation and made
      worse by recent changes to the flag package. Improve matters by making
      the help message say "default true" for the tests that do default to true,
      and tweak some of the wording.
      
      Before:
      
      Usage of vet:
      	vet [flags] directory...
      	vet [flags] files... # Must be a single package
      For more information run
      	go doc cmd/vet
      
      Flags:
        -all
          	enable all non-experimental checks (default unset)
        -asmdecl
          	check assembly against Go declarations (default unset)
      ...
      
      After:
      
      Usage of vet:
      	vet [flags] directory...
      	vet [flags] files... # Must be a single package
      By default, -all is set and all non-experimental checks are run.
      For more information run
      	go doc cmd/vet
      
      Flags:
        -all
          	enable all non-experimental checks (default true)
        -asmdecl
          	check assembly against Go declarations (default true)
      ...
      
      Change-Id: Ie94b27381a9ad2382a10a7542a93bce1d59fa8f5
      Reviewed-on: https://go-review.googlesource.com/21495Reviewed-by: default avatarAndrew Gerrand <adg@golang.org>
      d1feddb7
    • Josh Bleecher Snyder's avatar
      cmd/compile: avoid write barrier in append fast path · a4650a21
      Josh Bleecher Snyder authored
      When we are writing the result of an append back
      to the same slice, we don’t need a write barrier
      on the fast path.
      
      This re-implements an optimization that was present
      in the old backend.
      
      Updates #14921
      Fixes #14969
      
      Sample code:
      
      var x []byte
      
      func p() {
      	x = append(x, 1, 2, 3)
      }
      
      Before:
      
      "".p t=1 size=224 args=0x0 locals=0x48
      	0x0000 00000 (append.go:21)	TEXT	"".p(SB), $72-0
      	0x0000 00000 (append.go:21)	MOVQ	(TLS), CX
      	0x0009 00009 (append.go:21)	CMPQ	SP, 16(CX)
      	0x000d 00013 (append.go:21)	JLS	199
      	0x0013 00019 (append.go:21)	SUBQ	$72, SP
      	0x0017 00023 (append.go:21)	FUNCDATA	$0, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB)
      	0x0017 00023 (append.go:21)	FUNCDATA	$1, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB)
      	0x0017 00023 (append.go:19)	MOVQ	"".x+16(SB), CX
      	0x001e 00030 (append.go:19)	MOVQ	"".x(SB), DX
      	0x0025 00037 (append.go:19)	MOVQ	"".x+8(SB), BX
      	0x002c 00044 (append.go:19)	MOVQ	BX, "".autotmp_0+64(SP)
      	0x0031 00049 (append.go:22)	LEAQ	3(BX), BP
      	0x0035 00053 (append.go:22)	CMPQ	BP, CX
      	0x0038 00056 (append.go:22)	JGT	$0, 131
      	0x003a 00058 (append.go:22)	MOVB	$1, (DX)(BX*1)
      	0x003e 00062 (append.go:22)	MOVB	$2, 1(DX)(BX*1)
      	0x0043 00067 (append.go:22)	MOVB	$3, 2(DX)(BX*1)
      	0x0048 00072 (append.go:22)	MOVQ	BP, "".x+8(SB)
      	0x004f 00079 (append.go:22)	MOVQ	CX, "".x+16(SB)
      	0x0056 00086 (append.go:22)	MOVL	runtime.writeBarrier(SB), AX
      	0x005c 00092 (append.go:22)	TESTB	AL, AL
      	0x005e 00094 (append.go:22)	JNE	$0, 108
      	0x0060 00096 (append.go:22)	MOVQ	DX, "".x(SB)
      	0x0067 00103 (append.go:23)	ADDQ	$72, SP
      	0x006b 00107 (append.go:23)	RET
      	0x006c 00108 (append.go:22)	LEAQ	"".x(SB), CX
      	0x0073 00115 (append.go:22)	MOVQ	CX, (SP)
      	0x0077 00119 (append.go:22)	MOVQ	DX, 8(SP)
      	0x007c 00124 (append.go:22)	PCDATA	$0, $0
      	0x007c 00124 (append.go:22)	CALL	runtime.writebarrierptr(SB)
      	0x0081 00129 (append.go:23)	JMP	103
      	0x0083 00131 (append.go:22)	LEAQ	type.[]uint8(SB), AX
      	0x008a 00138 (append.go:22)	MOVQ	AX, (SP)
      	0x008e 00142 (append.go:22)	MOVQ	DX, 8(SP)
      	0x0093 00147 (append.go:22)	MOVQ	BX, 16(SP)
      	0x0098 00152 (append.go:22)	MOVQ	CX, 24(SP)
      	0x009d 00157 (append.go:22)	MOVQ	BP, 32(SP)
      	0x00a2 00162 (append.go:22)	PCDATA	$0, $0
      	0x00a2 00162 (append.go:22)	CALL	runtime.growslice(SB)
      	0x00a7 00167 (append.go:22)	MOVQ	40(SP), DX
      	0x00ac 00172 (append.go:22)	MOVQ	48(SP), AX
      	0x00b1 00177 (append.go:22)	MOVQ	56(SP), CX
      	0x00b6 00182 (append.go:22)	ADDQ	$3, AX
      	0x00ba 00186 (append.go:19)	MOVQ	"".autotmp_0+64(SP), BX
      	0x00bf 00191 (append.go:22)	MOVQ	AX, BP
      	0x00c2 00194 (append.go:22)	JMP	58
      	0x00c7 00199 (append.go:22)	NOP
      	0x00c7 00199 (append.go:21)	CALL	runtime.morestack_noctxt(SB)
      	0x00cc 00204 (append.go:21)	JMP	0
      
      After:
      
      "".p t=1 size=208 args=0x0 locals=0x48
      	0x0000 00000 (append.go:21)	TEXT	"".p(SB), $72-0
      	0x0000 00000 (append.go:21)	MOVQ	(TLS), CX
      	0x0009 00009 (append.go:21)	CMPQ	SP, 16(CX)
      	0x000d 00013 (append.go:21)	JLS	191
      	0x0013 00019 (append.go:21)	SUBQ	$72, SP
      	0x0017 00023 (append.go:21)	FUNCDATA	$0, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB)
      	0x0017 00023 (append.go:21)	FUNCDATA	$1, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB)
      	0x0017 00023 (append.go:19)	MOVQ	"".x+16(SB), CX
      	0x001e 00030 (append.go:19)	MOVQ	"".x+8(SB), DX
      	0x0025 00037 (append.go:19)	MOVQ	DX, "".autotmp_0+64(SP)
      	0x002a 00042 (append.go:19)	MOVQ	"".x(SB), BX
      	0x0031 00049 (append.go:22)	LEAQ	3(DX), BP
      	0x0035 00053 (append.go:22)	MOVQ	BP, "".x+8(SB)
      	0x003c 00060 (append.go:22)	CMPQ	BP, CX
      	0x003f 00063 (append.go:22)	JGT	$0, 84
      	0x0041 00065 (append.go:22)	MOVB	$1, (BX)(DX*1)
      	0x0045 00069 (append.go:22)	MOVB	$2, 1(BX)(DX*1)
      	0x004a 00074 (append.go:22)	MOVB	$3, 2(BX)(DX*1)
      	0x004f 00079 (append.go:23)	ADDQ	$72, SP
      	0x0053 00083 (append.go:23)	RET
      	0x0054 00084 (append.go:22)	LEAQ	type.[]uint8(SB), AX
      	0x005b 00091 (append.go:22)	MOVQ	AX, (SP)
      	0x005f 00095 (append.go:22)	MOVQ	BX, 8(SP)
      	0x0064 00100 (append.go:22)	MOVQ	DX, 16(SP)
      	0x0069 00105 (append.go:22)	MOVQ	CX, 24(SP)
      	0x006e 00110 (append.go:22)	MOVQ	BP, 32(SP)
      	0x0073 00115 (append.go:22)	PCDATA	$0, $0
      	0x0073 00115 (append.go:22)	CALL	runtime.growslice(SB)
      	0x0078 00120 (append.go:22)	MOVQ	40(SP), CX
      	0x007d 00125 (append.go:22)	MOVQ	56(SP), AX
      	0x0082 00130 (append.go:22)	MOVQ	AX, "".x+16(SB)
      	0x0089 00137 (append.go:22)	MOVL	runtime.writeBarrier(SB), AX
      	0x008f 00143 (append.go:22)	TESTB	AL, AL
      	0x0091 00145 (append.go:22)	JNE	$0, 168
      	0x0093 00147 (append.go:22)	MOVQ	CX, "".x(SB)
      	0x009a 00154 (append.go:22)	MOVQ	"".x(SB), BX
      	0x00a1 00161 (append.go:19)	MOVQ	"".autotmp_0+64(SP), DX
      	0x00a6 00166 (append.go:22)	JMP	65
      	0x00a8 00168 (append.go:22)	LEAQ	"".x(SB), DX
      	0x00af 00175 (append.go:22)	MOVQ	DX, (SP)
      	0x00b3 00179 (append.go:22)	MOVQ	CX, 8(SP)
      	0x00b8 00184 (append.go:22)	PCDATA	$0, $0
      	0x00b8 00184 (append.go:22)	CALL	runtime.writebarrierptr(SB)
      	0x00bd 00189 (append.go:22)	JMP	154
      	0x00bf 00191 (append.go:22)	NOP
      	0x00bf 00191 (append.go:21)	CALL	runtime.morestack_noctxt(SB)
      	0x00c4 00196 (append.go:21)	JMP	0
      
      Change-Id: I77a41ad3a22557a4bb4654de7d6d24a029efe34a
      Reviewed-on: https://go-review.googlesource.com/21813
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      a4650a21
    • David Chase's avatar
      cmd/compile: added stats printing to stackalloc · 32efa16c
      David Chase authored
      This is controlled by the "regalloc" stats flag, since regalloc
      calls stackalloc.  The plan is for this to allow comparison
      of cheaper stack allocation algorithms with what we have now.
      
      Change-Id: Ibf64a780344c69babfcbb328fd6d053ea2e02cfc
      Reviewed-on: https://go-review.googlesource.com/21393
      Run-TryBot: David Chase <drchase@google.com>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      32efa16c
    • Keith Randall's avatar
      cmd/compile: zero all three argstorage slots · 7e40627a
      Keith Randall authored
      These changes were missed when going from 2 to 3 argstorage slots.
      https://go-review.googlesource.com/20296/
      
      Change-Id: I930a307bb0b695bf1ae088030c9bbb6d14ca31d2
      Reviewed-on: https://go-review.googlesource.com/21841Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
      7e40627a
    • Keith Randall's avatar
      cmd/compile: fix -N build · 7f53391f
      Keith Randall authored
      The decomposer of builtin types is confused by having structs
      still around from the user-type decomposer.  They're all dead though,
      so just enabling a deadcode pass fixes things.
      
      Change-Id: I2df6bc7e829be03eabfd24c8dda1bff96f3d7091
      Reviewed-on: https://go-review.googlesource.com/21839
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      7f53391f
    • Josh Bleecher Snyder's avatar
      image/color: add YCbCrToRGB benchmark · 7166dfe0
      Josh Bleecher Snyder authored
      Change-Id: I9ba76d5b0861a901415fdceccaf2f5caa2facb7f
      Reviewed-on: https://go-review.googlesource.com/21837
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      7166dfe0
    • Michael Munday's avatar
      cmd/internal/obj/s390x: add MULHD instruction · cd6b2b74
      Michael Munday authored
      Emulate 64-bit signed high multiplication ((a*b)>>64). To do this
      we use the 64-bit unsigned high multiplication method and then
      fix the result as shown in Hacker's Delight 2nd ed., chapter 8-3.
      
      Required to enable some division optimizations.
      
      Change-Id: I9194f428e09d3d029cb1afb4715cd5424b5d922e
      Reviewed-on: https://go-review.googlesource.com/21774Reviewed-by: default avatarBill O'Farrell <billotosyr@gmail.com>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      cd6b2b74
    • Brad Fitzpatrick's avatar
      net/http: add ServerContextKey to let a handler access its Server · cabb1402
      Brad Fitzpatrick authored
      Fixes #12438
      Updates #15229 (to decide context key variable naming convention)
      
      Change-Id: I3ba423e91b689e232143247d044495a12c97a7d2
      Reviewed-on: https://go-review.googlesource.com/21829Reviewed-by: default avatarAndrew Gerrand <adg@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      cabb1402
    • Shawn Walker-Salas's avatar
      cmd/link: external linking can fail on Solaris 11.2+ · e79fef8e
      Shawn Walker-Salas authored
      Workaround external linking issues encountered on Solaris 11.2+ due to
      the go.o object file being created with a NULL STT_FILE symtab entry by
      using a placeholder name.
      
      Fixes #14957
      
      Change-Id: I89c501b4c548469f3c878151947d35588057982b
      Reviewed-on: https://go-review.googlesource.com/21636Reviewed-by: default avatarDavid Crawshaw <crawshaw@golang.org>
      e79fef8e
    • Dmitry Vyukov's avatar
      internal/trace: support parsing of 1.5 traces · 3fafe2e8
      Dmitry Vyukov authored
      1. Parse out version from trace header.
      2. Restore handling of 1.5 traces.
      3. Restore optional symbolization of traces.
      4. Add some canned 1.5 traces for regression testing
         (http benchmark trace, runtime/trace stress traces,
          plus one with broken timestamps).
      
      Change-Id: Idb18a001d03ded8e13c2730eeeb37c5836e31256
      Reviewed-on: https://go-review.googlesource.com/21803
      Run-TryBot: Dmitry Vyukov <dvyukov@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAustin Clements <austin@google.com>
      3fafe2e8
    • Keith Randall's avatar
      cmd/compile: fix naming of decomposed structs · b04e1452
      Keith Randall authored
      When a struct is SSAable, we will name its component parts
      by their field names.  For example,
      type T struct {
           a, b, c int
      }
      If we ever need to spill a variable x of type T, we will
      spill its individual components to variables named x.a, x.b,
      and x.c.
      
      Change-Id: I857286ff1f2597f2c4bbd7b4c0b936386fb37131
      Reviewed-on: https://go-review.googlesource.com/21389Reviewed-by: default avatarDavid Chase <drchase@google.com>
      b04e1452
    • Alexandru Moșoi's avatar
      cmd/compile: bce when max and limit are consts · 6c6089b3
      Alexandru Moșoi authored
      Removes 49 more bound checks in make.bash. For example:
      
      var a[100]int
      for i := 0; i < 50; i++ {
        use a[i+25]
      }
      
      Change-Id: I85e0130ee5d07f0ece9b17044bba1a2047414ce7
      Reviewed-on: https://go-review.googlesource.com/21379Reviewed-by: default avatarDavid Chase <drchase@google.com>
      Run-TryBot: Alexandru Moșoi <alexandru@mosoi.ro>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      6c6089b3
    • Dan Peterson's avatar
      net/http: document Error does not end the request · 00681eec
      Dan Peterson authored
      Fixes #15205
      
      Change-Id: Ia650806756758ca8ed2272b1696e59b809b16c61
      Reviewed-on: https://go-review.googlesource.com/21836Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      00681eec