1. 01 May, 2019 3 commits
  2. 30 Apr, 2019 34 commits
  3. 29 Apr, 2019 3 commits
    • Keith Randall's avatar
      cmd/compile: evaluate map initializers incrementally · ee59c06a
      Keith Randall authored
      For the code:
      
      m := map[int]int {
        a(): b(),
        c(): d(),
        e(): f(),
      }
      
      We used to do:
      
      t1 := a()
      t2 := b()
      t3 := c()
      t4 := d()
      t5 := e()
      t6 := f()
      m := map[int]int{}
      m[t1] = t2
      m[t3] = t4
      m[t5] = t6
      
      After this CL we do:
      
      m := map[int]int{}
      t1 := a()
      t2 := b()
      m[t1] = t2
      t3 := c()
      t4 := d()
      m[t3] = t4
      t5 := e()
      t6 := f()
      m[t5] = t6
      
      Ordering the initialization this way limits the lifetime of the
      temporaries involved.  In particular, for large maps the number of
      simultaneously live temporaries goes from ~2*len(m) to ~2. This change
      makes the compiler (regalloc, mostly) a lot happier. The compiler runs
      faster and uses a lot less memory.
      
      For #26546, changes compile time of a big map from 8 sec to 0.5 sec.
      
      Fixes #26552
      
      Update #26546
      
      Change-Id: Ib7d202dead3feaf493a464779fd9611c63fcc25f
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174417
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      ee59c06a
    • Joel Sing's avatar
      cmd,runtime: enable cgo for openbsd/arm64 · 998cc2a1
      Joel Sing authored
      Updates #31656.
      
      Change-Id: Ide6f829282fcdf20c67998b766a201a6a92c3035
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174132
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      998cc2a1
    • Ian Lance Taylor's avatar
      runtime: account for callbacks in checkdead on Windows · 98c5a56f
      Ian Lance Taylor authored
      When a callback runs on a different thread in Windows, as in the
      runtime package test TestCallbackInAnotherThread, it will use the
      extra M. That can cause the test in checkdead to fail incorrectly.
      Check whether there actually is an extra M before expecting it.
      
      I think this is a general problem unrelated to timers. I think the test
      was passing previously because the timer goroutine was using an M.
      But I haven't proved that. This change seems correct, and it avoids
      the test failure when using the new timers on Windows.
      
      Updates #27707
      
      Change-Id: Ieb31c04ff0354d6fae7e173b59bcfadb8b0464cd
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174037Reviewed-by: default avatarKeith Randall <khr@golang.org>
      98c5a56f