1. 09 Mar, 2017 3 commits
  2. 08 Mar, 2017 11 commits
    • Elias Naur's avatar
      go/internal/srcimporter: skip tests on iOS · 3a1271da
      Elias Naur authored
      The iOS test harness only includes the current test directory in its
      app bundles, but the tests need access to all source code.
      
      Change-Id: I8a902b183bc2745b4fbfffef867002d573abb1f5
      Reviewed-on: https://go-review.googlesource.com/37961
      Run-TryBot: Elias Naur <elias.naur@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      3a1271da
    • Josh Bleecher Snyder's avatar
      runtime: optimize slicebytestostring · 23be7289
      Josh Bleecher Snyder authored
      Inline rawstringtmp and simplify.
      Use memmove instead of copy.
      
      name                     old time/op  new time/op  delta
      SliceByteToString/1-8    19.4ns ± 2%  14.1ns ± 1%  -27.04%  (p=0.000 n=20+17)
      SliceByteToString/2-8    20.8ns ± 2%  15.5ns ± 2%  -25.46%  (p=0.000 n=20+20)
      SliceByteToString/4-8    20.7ns ± 1%  14.9ns ± 1%  -28.30%  (p=0.000 n=20+20)
      SliceByteToString/8-8    23.2ns ± 1%  17.1ns ± 1%  -26.22%  (p=0.000 n=19+19)
      SliceByteToString/16-8   29.4ns ± 1%  23.6ns ± 1%  -19.76%  (p=0.000 n=17+20)
      SliceByteToString/32-8   31.4ns ± 1%  26.0ns ± 1%  -17.11%  (p=0.000 n=16+19)
      SliceByteToString/64-8   36.1ns ± 0%  30.0ns ± 0%  -16.96%  (p=0.000 n=16+16)
      SliceByteToString/128-8  46.9ns ± 0%  38.9ns ± 0%  -17.15%  (p=0.000 n=17+19)
      
      Change-Id: I422e688830e4a9bd21897d1f74964625b735f436
      Reviewed-on: https://go-review.googlesource.com/37791
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMarvin Stenger <marvin.stenger94@gmail.com>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      23be7289
    • Elias Naur's avatar
      os/user: fake Current on Android · 228438e0
      Elias Naur authored
      On Android devices where the stub fallback for Current fails to
      extract a User from the environment, return a dummy fallback instead
      of failing.
      
      While we're here, use / instead of /home/nacl for the NaCL fallback.
      
      Hopefully fixes the Android builder.
      
      Change-Id: Ia29304fbc224ee5f9c0f4e706d1756f765a7eae5
      Reviewed-on: https://go-review.googlesource.com/37960
      Run-TryBot: Elias Naur <elias.naur@gmail.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      228438e0
    • Bryan C. Mills's avatar
      runtime: poll libc to deliver signals under TSAN · 29edf0f9
      Bryan C. Mills authored
      fixes #18717
      
      Change-Id: I7244463d2e7489e0b0fe3b74c4b782e71210beb2
      Reviewed-on: https://go-review.googlesource.com/35494
      Run-TryBot: Bryan Mills <bcmills@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      29edf0f9
    • David Chase's avatar
      cmd/compile: check loop rescheduling with stack bound, not counter · d71f36b5
      David Chase authored
      After benchmarking with a compiler modified to have better
      spill location, it became clear that this method of checking
      was actually faster on (at least) two different architectures
      (ppc64 and amd64) and it also provides more timely interruption
      of loops.
      
      This change adds a modified FOR loop node "FORUNTIL" that
      checks after executing the loop body instead of before (i.e.,
      always at least once).  This ensures that a pointer past the
      end of a slice or array is not made visible to the garbage
      collector.
      
      Without the rescheduling checks inserted, the restructured
      loop from this  change apparently provides a 1% geomean
      improvement on PPC64 running the go1 benchmarks; the
      improvement on AMD64 is only 0.12%.
      
      Inserting the rescheduling check exposed some peculiar bug
      with the ssa test code for s390x; this was updated based on
      initial code actually generated for GOARCH=s390x to use
      appropriate OpArg, OpAddr, and OpVarDef.
      
      NaCl is disabled in testing.
      
      Change-Id: Ieafaa9a61d2a583ad00968110ef3e7a441abca50
      Reviewed-on: https://go-review.googlesource.com/36206
      Run-TryBot: David Chase <drchase@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      d71f36b5
    • Kevin Burke's avatar
      database/sql: fix spelling mistake in tests · 6fbedc1a
      Kevin Burke authored
      Change-Id: I04e150d4e4123aad2f277e5c6e9f2abd15628a28
      Reviewed-on: https://go-review.googlesource.com/37941Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      6fbedc1a
    • Robert Griesemer's avatar
      cmd/compile: fix recorded export data position info · 2123a6c6
      Robert Griesemer authored
      The position information recorded now consists of the line-
      directive relative filename and line number. It would be
      relatively easy to also encode absolute position information
      as necessary (by serializing src.PosBase data).
      
      For example, given $GOROOT/src/tmp/x.go:
      
      	package p
      
      	const C0 = 0
      
      	//line c.go:10
      	const C1 = 1
      
      	//line t.go:20
      	type T int
      
      	//line v.go:30
      	var V T
      
      	//line f.go:40
      	func F() {}
      
      The recorded positions for the exported entities are:
      
      	C0 $GOROOT/src/tmp/x.go 3
      	C1 c.go 10
      	T t.go 20
      	V v.go 30
      	F f.go 40
      
      Fix verified by manual inspection. There's currently no easy way
      to test this, but it will eventually be tested when we fix #7311.
      
      Fixes #19391.
      
      Change-Id: I6269067ea58358250fe6dd1f73bdf9e5d2adfe3d
      Reviewed-on: https://go-review.googlesource.com/37936Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      2123a6c6
    • Sarah Adams's avatar
      database/sql: proper prepared statement support in transactions · 82e1732f
      Sarah Adams authored
      This change was originally written by Marko Tiikkaja <marko@joh.to>.
      https://go-review.googlesource.com/#/c/2035/
      
      Previously *Tx.Stmt always prepared a new statement, even if an
      existing one was available on the connection the transaction was on.
      Now we first see if the statement is already available on the
      connection and only prepare if it isn't. Additionally, when we do
      need to prepare one, we store it in the parent *Stmt to allow it to be
      later reused by other calls to *Tx.Stmt on that statement or just
      straight up by *Stmt.Exec et al.
      
      To make sure that the statement doesn't disappear unexpectedly, we
      record a dependency from the statement returned by *Tx.Stmt to the
      *Stmt it came from and set a new field, parentStmt, to point to the
      originating *Stmt. When the transaction's *Stmt is closed, we remove
      the dependency. This way the "parent" *Stmt can be closed by the user
      without her having to know whether any transactions are still using it
      or not.
      
      Fixes #15606
      
      Change-Id: I41b5056847e117ac61130328b0239d1e000a4a08
      Reviewed-on: https://go-review.googlesource.com/35476
      Run-TryBot: Daniel Theophanes <kardianos@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarDaniel Theophanes <kardianos@gmail.com>
      82e1732f
    • Johan Brandhorst's avatar
      net/http: use httptest.Server Client in tests · 3b988eb6
      Johan Brandhorst authored
      After merging https://go-review.googlesource.com/c/34639/,
      it was pointed out to me that a lot of tests under net/http
      could use the new functionality to simplify and unify testing.
      
      Using the httptest.Server provided Client removes the need to
      call CloseIdleConnections() on all Transports created, as it
      is automatically called on the Transport associated with the
      client when Server.Close() is called.
      
      Change the transport used by the non-TLS
      httptest.Server to a new *http.Transport rather than using
      http.DefaultTransport implicitly. The TLS version already
      used its own *http.Transport. This change is to prevent
      concurrency problems with using DefaultTransport implicitly
      across several httptest.Server's.
      
      Add tests to ensure the httptest.Server.Client().Transport
      RoundTripper interface is implemented by a *http.Transport,
      as is now assumed across large parts of net/http tests.
      
      Change-Id: I9f9d15f59d72893deead5678d314388718c91821
      Reviewed-on: https://go-review.googlesource.com/37771
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      3b988eb6
    • Hiroshi Ioka's avatar
      net/mail: fix wrong error message in consumePhrase · 2bd6360e
      Hiroshi Ioka authored
      Fixes #19415
      
      Change-Id: I6414f82e42bd09f1793156befce326aeac919ea2
      Reviewed-on: https://go-review.googlesource.com/37911Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      2bd6360e
    • Russ Cox's avatar
      runtime/pprof: add GNU build IDs to Mappings recorded from /proc/self/maps · c797256a
      Russ Cox authored
      This helps systems that maintain an external database mapping
      build ID to symbol information for the given binary, especially
      in the case where /proc/self/maps lists many different files
      (for example, many shared libraries).
      
      Avoid importing debug/elf to avoid dragging in that whole
      package (and its dependencies like debug/dwarf) into the
      build of every program that generates a profile.
      
      Fixes #19431.
      
      Change-Id: I6d4362a79fe23e4f1726dffb0661d20bb57f766f
      Reviewed-on: https://go-review.googlesource.com/37855
      Run-TryBot: Russ Cox <rsc@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      c797256a
  3. 07 Mar, 2017 24 commits
  4. 06 Mar, 2017 2 commits
    • Robert Griesemer's avatar
      Revert "cmd/compile: improve error message if init is directly invoked" · cf710949
      Robert Griesemer authored
      This reverts commit cb6e0639.
      
      The fix is incorrect as it's perfectly fine to refer to an
      identifier 'init' inside a function, and 'init' may even be
      a variable of function value. Misspelling 'init' in that
      context would lead to an incorrect error message.
      
      Reopened #8481.
      
      Change-Id: I49787fdf7738213370ae6f0cab54013e9e3394a8
      Reviewed-on: https://go-review.googlesource.com/37876
      Run-TryBot: Robert Griesemer <gri@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      cf710949
    • philhofer's avatar
      cmd/compile: emit OffPtr for first field in SSA'd structs · a6bd42f2
      philhofer authored
      Given
      
        (Store [c] (OffPtr <T1> [0] (Addr <T> _)) _
          (Store [c] (Addr <T> _) _ _))
      
      dead store elimination doesn't eliminate the inner
      Store, because it addresses a type of a different width
      than the first store.
      
      When decomposing StructMake operations, always generate
      an OffPtr to address struct fields so that dead stores to
      the first field of the struct can be optimized away.
      
      benchmarks affected on darwin/amd64:
      HTTPClientServer-8        73.2µs ± 1%    72.7µs ± 1%  -0.69%  (p=0.022 n=9+10)
      TimeParse-8                304ns ± 1%     300ns ± 0%  -1.61%  (p=0.000 n=9+9)
      RegexpMatchEasy1_32-8     80.1ns ± 0%    79.5ns ± 1%  -0.84%  (p=0.000 n=8+9)
      GobDecode-8               6.78ms ± 0%    6.81ms ± 1%  +0.46%  (p=0.000 n=9+10)
      Gunzip-8                  36.1ms ± 1%    36.2ms ± 0%  +0.37%  (p=0.019 n=10+10)
      JSONEncode-8              15.6ms ± 0%    15.7ms ± 0%  +0.69%  (p=0.000 n=9+10)
      
      Change-Id: Ia80d73fd047f9400c616ca64fdee4f438a0e7f21
      Reviewed-on: https://go-review.googlesource.com/37769
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      a6bd42f2