1. 07 May, 2016 4 commits
    • Robert Griesemer's avatar
      cmd/compile: add and enable (internal) option to only track named types · 394ac818
      Robert Griesemer authored
      The new export format keeps track of all types that are exported.
      If a type is seen that was exported before, only a reference to
      that type is emitted. The importer maintains a list of all the
      seen types and uses that list to resolve type references.
      
      The existing compiler infrastructure's invariants assumes that
      only named types are referred to before they are fully set up.
      Referring to unnamed incomplete types causes problems. One of
      the issues was #15548.
      
      Added a new internal flag 'trackAllTypes' to enable/disable
      this type tracking. With this change only named types are
      tracked.
      
      Verified that this fix also addresses #15548, even w/o the
      prior fix for that issue (in fact that prior fix is turned
      off if trackAllTypes is disabled because it's not needed).
      
      The test for #15548 covers also this change.
      
      For #15548.
      
      Change-Id: Id0b3ff983629703d025a442823f99649fd728a56
      Reviewed-on: https://go-review.googlesource.com/22839
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
      394ac818
    • Elias Naur's avatar
      cmd/go: add -shared to darwin/arm{,64} default build mode · fa270ad9
      Elias Naur authored
      Buildmode c-archive now supports position independent code for
      darwin/arm (in addition to darwin/arm64). Make PIC (-shared) the
      default for both platforms in the default buildmode.
      
      Without this change, gomobile will go install the standard library
      into its separate package directory without PIC support.
      
      Also add -shared to darwin/arm64 in buildmode c-archive, for
      symmetry (darwin/arm64 always generates position independent code).
      
      Fixes #15519
      
      Change-Id: If27d2cbea8f40982e14df25da2703cbba572b5c6
      Reviewed-on: https://go-review.googlesource.com/22920Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
      Run-TryBot: David Crawshaw <crawshaw@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      fa270ad9
    • Tal Shprecher's avatar
      cmd/compile: properly handle map assignments for OAS2DOTTYPE · 9d7c9b43
      Tal Shprecher authored
      The boolean destination in an OAS2DOTTYPE expression craps out during
      compilation when trying to assign to a map entry because, unlike slice entries,
      map entries are not directly addressable in memory. The solution is to
      properly order the boolean destination node so that map entries are set
      via autotmp variables.
      
      Fixes #14678
      
      Change-Id: If344e8f232b5bdac1b53c0f0d21eeb43ab17d3de
      Reviewed-on: https://go-review.googlesource.com/22833Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      9d7c9b43
    • Elias Naur's avatar
      runtime: use entire address space on 32 bit · e6ec8206
      Elias Naur authored
      In issue #13992, Russ mentioned that the heap bitmap footprint was
      halved but that the bitmap size calculation hadn't been updated. This
      presents the opportunity to either halve the bitmap size or double
      the addressable virtual space. This CL doubles the addressable virtual
      space. On 32 bit this can be tweaked further to allow the bitmap to
      cover the entire 4GB virtual address space, removing a failure mode
      if the kernel hands out memory with a too low address.
      
      First, fix the calculation and double _MaxArena32 to cover 4GB virtual
      memory space with the same bitmap size (256 MB).
      
      Then, allow the fallback mode for the initial memory reservation
      on 32 bit (or 64 bit with too little available virtual memory) to not
      include space for the arena. mheap.sysAlloc will automatically reserve
      additional space when the existing arena is full.
      
      Finally, set arena_start to 0 in 32 bit mode, so that any address is
      acceptable for subsequent (additional) reservations.
      
      Before, the bitmap was always located just before arena_start, so
      fix the two places relying on that assumption: Point the otherwise unused
      mheap.bitmap to one byte after the end of the bitmap, and use it for
      bitmap addressing instead of arena_start.
      
      With arena_start set to 0 on 32 bit, the cgoInRange check is no longer a
      sufficient check for Go pointers. Introduce and call inHeapOrStack to
      check whether a pointer is to the Go heap or stack.
      
      While we're here, remove sysReserveHigh which seems to be unused.
      
      Fixes #13992
      
      Change-Id: I592b513148a50b9d3967b5c5d94b86b3ec39acc2
      Reviewed-on: https://go-review.googlesource.com/20471Reviewed-by: 's avatarAustin Clements <austin@google.com>
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      e6ec8206
  2. 06 May, 2016 27 commits
  3. 05 May, 2016 9 commits
    • David Chase's avatar
      cmd/compile: repair MININT conversion bug in arm softfloat · 6db98a3c
      David Chase authored
      Negative-case conversion code was wrong for minimum int32,
      used negate-then-widen instead of widen-then-negate.
      
      Test already exists; this fixes the failure.
      
      Fixes #15563.
      
      Change-Id: I4b0b3ae8f2c9714bdcc405d4d0b1502ccfba2b40
      Reviewed-on: https://go-review.googlesource.com/22830
      Run-TryBot: David Chase <drchase@google.com>
      Reviewed-by: 's avatarKeith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      6db98a3c
    • Alan Donovan's avatar
      go/token: document postcondition of SetLines · 5f83bf60
      Alan Donovan authored
      Change-Id: Ie163deade396b3e298a93845b9ca4d52333ea82a
      Reviewed-on: https://go-review.googlesource.com/22831Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      5f83bf60
    • Richard Miller's avatar
      os/exec: re-enable TestExtraFiles for plan9 · 5bf9b39a
      Richard Miller authored
      This test should now succeed after CL 22610 which fixes issue #7118
      
      Change-Id: Ie785a84d77b27c832a1ddd81699bf25dab24b97d
      Reviewed-on: https://go-review.googlesource.com/22640Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: 's avatarDavid du Colombier <0intro@gmail.com>
      Run-TryBot: David du Colombier <0intro@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      5bf9b39a
    • Richard Miller's avatar
      syscall: simplify closing of extra fds in plan9 StartProcess · 639a20da
      Richard Miller authored
      Reviving earlier work by @ality in https://golang.org/cl/57890043
      to make the closing of extra file descriptors in syscall.StartProcess
      less race-prone. Instead of making a list of open fds in the parent
      before forking, the child can read through the list of open fds and
      close the ones not explicitly requested.  Also eliminate the
      complication of keeping open any extra fds which were inherited by
      the parent when it started.
      
      This CL will be followed by one to eliminate the ForkLock in plan9,
      which is now redundant.
      
      Fixes #5605
      
      Change-Id: I6b4b942001baa54248b656c52dced3b62021c486
      Reviewed-on: https://go-review.googlesource.com/22610
      Run-TryBot: David du Colombier <0intro@gmail.com>
      Reviewed-by: 's avatarDavid du Colombier <0intro@gmail.com>
      639a20da
    • Andrew Gerrand's avatar
      doc: update broken links in release notes · 9b05ae61
      Andrew Gerrand authored
      Fixes #15559
      
      Change-Id: Ie58650f35e32c1f49669134b62876357abcdc583
      Reviewed-on: https://go-review.googlesource.com/22823Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      9b05ae61
    • Robert Griesemer's avatar
      cmd/compile: verify imported types after they are fully imported · 8650c230
      Robert Griesemer authored
      Fixes #15548.
      
      Change-Id: I1dfa9c8739a4b6d5e4c737c1a1e09e80e045b7aa
      Reviewed-on: https://go-review.googlesource.com/22803Reviewed-by: 's avatarAlan Donovan <adonovan@google.com>
      8650c230
    • Emmanuel Odeke's avatar
      runtime: print signal name in panic, if name is known · 1a7fc235
      Emmanuel Odeke authored
      Adds a small function signame that infers a signal name
      from the signal table, otherwise will fallback to using
      hex(sig) as previously. No signal table is present for
      Windows hence it will always print the hex value.
      
      Sample code and new result:
      ```go
      package main
      
      import (
        "fmt"
        "time"
      )
      
      func main() {
        defer func() {
          if err := recover(); err != nil {
            fmt.Printf("err=%v\n", err)
          }
        }()
      
        ticker := time.Tick(1e9)
        for {
          <-ticker
        }
      }
      ```
      
      ```shell
      $ go run main.go &
      $ kill -11 <pid>
      fatal error: unexpected signal during runtime execution
      [signal SIGSEGV: segmentation violation code=0x1 addr=0xb01dfacedebac1e
      pc=0xc71db]
      ...
      ```
      
      Fixes #13969
      
      Change-Id: Ie6be312eb766661f1cea9afec352b73270f27f9d
      Reviewed-on: https://go-review.googlesource.com/22753Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      1a7fc235
    • Russ Cox's avatar
      net: fix hostLookupOrder("") · fafd792d
      Russ Cox authored
      Fixes #13623.
      
      Change-Id: I1bd96aa7b6b715e4dbdcf0c37c2d29228df6565c
      Reviewed-on: https://go-review.googlesource.com/18329Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      fafd792d
    • Lynn Boger's avatar
      sync/atomic, runtime/internal/atomic: improve ppc64x atomics · eeca3ba9
      Lynn Boger authored
      The following performance improvements have been made to the
      low-level atomic functions for ppc64le & ppc64:
      
      - For those cases containing a lwarx and stwcx (or other sizes):
      sync, lwarx, maybe something, stwcx, loop to sync, sync, isync
      The sync is moved before (outside) the lwarx/stwcx loop, and the
       sync after is removed, so it becomes:
      sync, lwarx, maybe something, stwcx, loop to lwarx, isync
      
      - For the Or8 and And8, the shifting and manipulation of the
      address to the word aligned version were removed and the
      instructions were changed to use lbarx, stbcx instead of
      register shifting, xor, then lwarx, stwcx.
      
      - New instructions LWSYNC, LBAR, STBCC were tested and added.
      runtime/atomic_ppc64x.s was changed to use the LWSYNC opcode
      instead of the WORD encoding.
      
      Fixes #15469
      
      Ran some of the benchmarks in the runtime and sync directories.
      Some results varied from run to run but the trend was improvement
      based on best times for base and new:
      
      runtime.test:
      BenchmarkChanNonblocking-128         0.88          0.89          +1.14%
      BenchmarkChanUncontended-128         569           511           -10.19%
      BenchmarkChanContended-128           63110         53231         -15.65%
      BenchmarkChanSync-128                691           598           -13.46%
      BenchmarkChanSyncWork-128            11355         11649         +2.59%
      BenchmarkChanProdCons0-128           2402          2090          -12.99%
      BenchmarkChanProdCons10-128          1348          1363          +1.11%
      BenchmarkChanProdCons100-128         1002          746           -25.55%
      BenchmarkChanProdConsWork0-128       2554          2720          +6.50%
      BenchmarkChanProdConsWork10-128      1909          1804          -5.50%
      BenchmarkChanProdConsWork100-128     1624          1580          -2.71%
      BenchmarkChanCreation-128            237           212           -10.55%
      BenchmarkChanSem-128                 705           667           -5.39%
      BenchmarkChanPopular-128             5081190       4497566       -11.49%
      
      BenchmarkCreateGoroutines-128             532           473           -11.09%
      BenchmarkCreateGoroutinesParallel-128     35.0          34.7          -0.86%
      BenchmarkCreateGoroutinesCapture-128      4923          4200          -14.69%
      
      sync.test:
      BenchmarkUncontendedSemaphore-128      112           94.2          -15.89%
      BenchmarkContendedSemaphore-128        133           128           -3.76%
      BenchmarkMutexUncontended-128          1.90          1.67          -12.11%
      BenchmarkMutex-128                     353           310           -12.18%
      BenchmarkMutexSlack-128                304           283           -6.91%
      BenchmarkMutexWork-128                 554           541           -2.35%
      BenchmarkMutexWorkSlack-128            567           556           -1.94%
      BenchmarkMutexNoSpin-128               275           242           -12.00%
      BenchmarkMutexSpin-128                 1129          1030          -8.77%
      BenchmarkOnce-128                      1.08          0.96          -11.11%
      BenchmarkPool-128                      29.8          27.4          -8.05%
      BenchmarkPoolOverflow-128              40564         36583         -9.81%
      BenchmarkSemaUncontended-128           3.14          2.63          -16.24%
      BenchmarkSemaSyntNonblock-128          1087          1069          -1.66%
      BenchmarkSemaSyntBlock-128             897           893           -0.45%
      BenchmarkSemaWorkNonblock-128          1034          1028          -0.58%
      BenchmarkSemaWorkBlock-128             949           886           -6.64%
      
      Change-Id: I4403fb29d3cd5254b7b1ce87a216bd11b391079e
      Reviewed-on: https://go-review.googlesource.com/22549Reviewed-by: 's avatarMichael Munday <munday@ca.ibm.com>
      Reviewed-by: 's avatarMinux Ma <minux@golang.org>
      eeca3ba9