1. 11 Apr, 2017 14 commits
  2. 10 Apr, 2017 13 commits
  3. 09 Apr, 2017 3 commits
  4. 08 Apr, 2017 4 commits
  5. 07 Apr, 2017 6 commits
    • Dave Cheney's avatar
      cmd/compile/internal/gc: remove unused pkgByPath type · fd83d7b8
      Dave Cheney authored
      pkgByPath was added in d78c84c4 to eliminate the differences between the
      export formats around the time of Go 1.7.
      
      The last remnants of the textual export format was removed by Josh in
      39850 making the pkgByPath sorting type unused.
      
      Change-Id: I168816d6401f45119475a4fe5ada00d9ce571a9e
      Reviewed-on: https://go-review.googlesource.com/40050Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
      fd83d7b8
    • Josh Bleecher Snyder's avatar
      cmd/compile: make typenamesym do less work · 6d9c77f5
      Josh Bleecher Snyder authored
      This is a re-roll of CL 39710,
      which broke deterministic builds.
      
      typenamesym is called from three places:
      typename, ngotype, and Type.Symbol.
      Only in typename do we actually need a Node.
      ngotype and Type.Symbol require only a Sym.
      And writing the newly created Node to
      Sym.Def is unsafe in a concurrent backend.
      Rather than use a mutex protect to Sym.Def,
      make typenamesym not touch Sym.Def.
      
      The assignment to Sym.Def was serving a second purpose,
      namely to prevent duplicate entries on signatlist.
      Preserve that functionality by switching signatlist to a map.
      This in turn requires that we sort signatlist
      when exporting it, to preserve reproducibility.
      
      We sort using exactly the same mechanism
      that the export code (dtypesym) uses.
      Failure to do that led to non-deterministic builds (#19872).
      Since we've already calculated the Type's export name,
      we could pass it to dtypesym, sparing it a bit of work.
      That can be done as a future optimization.
      
      Updates #15756
      
      name       old alloc/op      new alloc/op      delta
      Template        39.2MB ± 0%       39.3MB ± 0%    ~     (p=0.075 n=10+10)
      Unicode         29.8MB ± 0%       29.8MB ± 0%    ~     (p=0.393 n=10+10)
      GoTypes          113MB ± 0%        113MB ± 0%  +0.06%  (p=0.027 n=10+8)
      SSA             1.25GB ± 0%       1.25GB ± 0%  +0.05%  (p=0.000 n=8+10)
      Flate           25.3MB ± 0%       25.3MB ± 0%    ~     (p=0.105 n=10+10)
      GoParser        31.7MB ± 0%       31.8MB ± 0%    ~     (p=0.165 n=10+10)
      Reflect         78.2MB ± 0%       78.2MB ± 0%    ~     (p=0.190 n=10+10)
      Tar             26.6MB ± 0%       26.6MB ± 0%    ~     (p=0.481 n=10+10)
      XML             42.2MB ± 0%       42.2MB ± 0%    ~     (p=0.968 n=10+9)
      
      name       old allocs/op     new allocs/op     delta
      Template          384k ± 1%         386k ± 1%  +0.43%  (p=0.019 n=10+10)
      Unicode           320k ± 0%         321k ± 0%  +0.36%  (p=0.015 n=10+10)
      GoTypes          1.14M ± 0%        1.14M ± 0%  +0.33%  (p=0.000 n=10+8)
      SSA              9.69M ± 0%        9.71M ± 0%  +0.18%  (p=0.000 n=10+9)
      Flate             233k ± 1%         233k ± 1%    ~     (p=0.481 n=10+10)
      GoParser          315k ± 1%         316k ± 1%    ~     (p=0.113 n=9+10)
      Reflect           979k ± 0%         979k ± 0%    ~     (p=0.971 n=10+10)
      Tar               250k ± 1%         250k ± 1%    ~     (p=0.481 n=10+10)
      XML               391k ± 1%         392k ± 0%    ~     (p=1.000 n=10+9)
      
      Change-Id: Ia9f21cc29c047021fa8a18c2a3d861a5146aefac
      Reviewed-on: https://go-review.googlesource.com/39915
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      6d9c77f5
    • Matthew Dempsky's avatar
      cmd/compile/internal/types: remove IterFields · 5b38923e
      Matthew Dempsky authored
      No longer needed after previous CLs.
      
      Change-Id: I9dd1040f3f28363c44434a810cbd7061cf6a028f
      Reviewed-on: https://go-review.googlesource.com/39857
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarDave Cheney <dave@cheney.net>
      Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      5b38923e
    • Matthew Dempsky's avatar
      cmd/compile/internal/types: remove Cmptmp · 31585837
      Matthew Dempsky authored
      It's unused and redundant with types.Type.Compare.
      
      Change-Id: I8d93473e9cee61650cb0c19a402316a3d418160e
      Reviewed-on: https://go-review.googlesource.com/40011
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      31585837
    • Josh Bleecher Snyder's avatar
      cmd/compile: allow composite literal structs with _ fields · c9446398
      Josh Bleecher Snyder authored
      Given code such as
      
      type T struct {
        _ string
      }
      
      func f() {
        var x = T{"space"}
        // ...
      }
      
      the compiler rewrote the 'var x' line as
      
      var x T
      x._ = "space"
      
      The compiler then rejected the assignment to
      a blank field, thus rejecting valid code.
      
      It also failed to catch a number of invalid assignments.
      And there were insufficient checks for validity
      when emitting static data, leading to ICEs.
      
      To fix, check earlier for explicit blanks field names,
      explicitly handle legit blanks in sinit,
      and don't try to emit static data for nodes
      for which typechecking has failed.
      
      Fixes #19482
      
      Change-Id: I594476171d15e6e8ecc6a1749e3859157fe2c929
      Reviewed-on: https://go-review.googlesource.com/38006
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      c9446398
    • Josh Bleecher Snyder's avatar
      cmd/compile: add a dowidth call to convas · 44a0681a
      Josh Bleecher Snyder authored
      This dowidth currently happens during AST to SSA conversion.
      As such, it is a concurrency pinch point.
      It's a bit silly, but do it here in walk instead.
      This appears (fingers crossed) to be the last
      unresolved dowidth concurrency problem.
      
      Updates #15756
      
      Change-Id: I87cbf718a14ad21aca74586003d79320cca75953
      Reviewed-on: https://go-review.googlesource.com/39994
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      44a0681a