An error occurred fetching the project authors.
  1. 31 Mar, 2017 1 commit
    • Josh Bleecher Snyder's avatar
      cmd/compile: don't mutate shared nodes in orderinit · 8e36575e
      Josh Bleecher Snyder authored
      A few gc.Node ops may be shared across functions.
      The compiler is (mostly) already careful to avoid mutating them.
      However, from a concurrency perspective, replacing (say)
      an empty list with an empty list still counts as a mutation.
      One place this occurs is orderinit. Avoid it.
      
      This requires fixing one spot where shared nodes were mutated.
      It doesn't result in any functional or performance changes.
      
      Passes toolstash-check.
      
      Updates #15756
      
      Change-Id: I63c93b31baeeac62d7574804acb6b7f2bc9d14a9
      Reviewed-on: https://go-review.googlesource.com/39196
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      8e36575e
  2. 21 Mar, 2017 2 commits
    • Daniel Martí's avatar
      runtime: remove unused *chantype parameters · 2e29eb57
      Daniel Martí authored
      The chanrecv funcs don't use it at all. The chansend ones do, but the
      element type is now part of the hchan struct, which is already a
      parameter.
      
      hchan can be nil in chansend when sending to a nil channel, so when
      instrumenting we must copy to the stack to be able to read the channel
      type.
      
      name             old time/op  new time/op  delta
      ChanUncontended  6.42µs ± 1%  6.22µs ± 0%  -3.06%  (p=0.000 n=19+18)
      
      Initially found by github.com/mvdan/unparam.
      
      Fixes #19591.
      
      Change-Id: I3a5e8a0082e8445cc3f0074695e3593fd9c88412
      Reviewed-on: https://go-review.googlesource.com/38351
      Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      2e29eb57
    • Hugues Bruant's avatar
      runtime: add mapdelete_fast* · 5d6b7fca
      Hugues Bruant authored
      Add benchmarks for map delete with int32/int64/string key
      
      Benchmark results on darwin/amd64
      
      name                 old time/op  new time/op  delta
      MapDelete/Int32/1-8   151ns ± 8%    99ns ± 3%  -34.39%  (p=0.008 n=5+5)
      MapDelete/Int32/2-8   128ns ± 2%   111ns ±15%  -13.40%  (p=0.040 n=5+5)
      MapDelete/Int32/4-8   128ns ± 5%   114ns ± 2%  -10.82%  (p=0.008 n=5+5)
      MapDelete/Int64/1-8   144ns ± 0%   104ns ± 3%  -27.53%  (p=0.016 n=4+5)
      MapDelete/Int64/2-8   153ns ± 1%   126ns ± 3%  -17.17%  (p=0.008 n=5+5)
      MapDelete/Int64/4-8   178ns ± 3%   136ns ± 2%  -23.60%  (p=0.008 n=5+5)
      MapDelete/Str/1-8     187ns ± 3%   171ns ± 3%   -8.54%  (p=0.008 n=5+5)
      MapDelete/Str/2-8     221ns ± 3%   206ns ± 4%   -7.18%  (p=0.016 n=5+4)
      MapDelete/Str/4-8     256ns ± 5%   232ns ± 2%   -9.36%  (p=0.016 n=4+5)
      
      name                     old time/op    new time/op    delta
      BinaryTree17-8              2.78s ± 7%     2.70s ± 1%    ~     (p=0.151 n=5+5)
      Fannkuch11-8                3.21s ± 2%     3.19s ± 1%    ~     (p=0.310 n=5+5)
      FmtFprintfEmpty-8          49.1ns ± 3%    50.2ns ± 2%    ~     (p=0.095 n=5+5)
      FmtFprintfString-8         78.6ns ± 4%    80.2ns ± 5%    ~     (p=0.460 n=5+5)
      FmtFprintfInt-8            79.7ns ± 1%    81.0ns ± 3%    ~     (p=0.103 n=5+5)
      FmtFprintfIntInt-8          117ns ± 2%     119ns ± 0%    ~     (p=0.079 n=5+4)
      FmtFprintfPrefixedInt-8     153ns ± 1%     146ns ± 3%  -4.19%  (p=0.024 n=5+5)
      FmtFprintfFloat-8           239ns ± 1%     237ns ± 1%    ~     (p=0.246 n=5+5)
      FmtManyArgs-8               506ns ± 2%     509ns ± 2%    ~     (p=0.238 n=5+5)
      GobDecode-8                7.06ms ± 4%    6.86ms ± 1%    ~     (p=0.222 n=5+5)
      GobEncode-8                6.01ms ± 5%    5.87ms ± 2%    ~     (p=0.222 n=5+5)
      Gzip-8                      246ms ± 4%     236ms ± 1%  -4.12%  (p=0.008 n=5+5)
      Gunzip-8                   37.7ms ± 4%    37.3ms ± 1%    ~     (p=0.841 n=5+5)
      HTTPClientServer-8         64.9µs ± 1%    64.4µs ± 0%  -0.80%  (p=0.032 n=5+4)
      JSONEncode-8               16.0ms ± 2%    16.2ms ±11%    ~     (p=0.548 n=5+5)
      JSONDecode-8               53.2ms ± 2%    53.1ms ± 4%    ~     (p=1.000 n=5+5)
      Mandelbrot200-8            4.33ms ± 2%    4.32ms ± 2%    ~     (p=0.841 n=5+5)
      GoParse-8                  3.24ms ± 2%    3.27ms ± 4%    ~     (p=0.690 n=5+5)
      RegexpMatchEasy0_32-8      86.2ns ± 1%    85.2ns ± 3%    ~     (p=0.286 n=5+5)
      RegexpMatchEasy0_1K-8       198ns ± 2%     199ns ± 1%    ~     (p=0.310 n=5+5)
      RegexpMatchEasy1_32-8      82.6ns ± 2%    81.8ns ± 1%    ~     (p=0.294 n=5+5)
      RegexpMatchEasy1_1K-8       359ns ± 2%     354ns ± 1%  -1.39%  (p=0.048 n=5+5)
      RegexpMatchMedium_32-8      123ns ± 2%     123ns ± 1%    ~     (p=0.905 n=5+5)
      RegexpMatchMedium_1K-8     38.2µs ± 2%    38.6µs ± 8%    ~     (p=0.690 n=5+5)
      RegexpMatchHard_32-8       1.92µs ± 2%    1.91µs ± 5%    ~     (p=0.460 n=5+5)
      RegexpMatchHard_1K-8       57.6µs ± 1%    57.0µs ± 2%    ~     (p=0.310 n=5+5)
      Revcomp-8                   483ms ± 7%     441ms ± 1%  -8.79%  (p=0.016 n=5+4)
      Template-8                 58.0ms ± 1%    58.2ms ± 7%    ~     (p=0.310 n=5+5)
      TimeParse-8                 324ns ± 6%     312ns ± 2%    ~     (p=0.087 n=5+5)
      TimeFormat-8                330ns ± 1%     329ns ± 1%    ~     (p=0.968 n=5+5)
      
      name                     old speed      new speed      delta
      GobDecode-8               109MB/s ± 4%   112MB/s ± 1%    ~     (p=0.222 n=5+5)
      GobEncode-8               128MB/s ± 5%   131MB/s ± 2%    ~     (p=0.222 n=5+5)
      Gzip-8                   78.9MB/s ± 4%  82.3MB/s ± 1%  +4.25%  (p=0.008 n=5+5)
      Gunzip-8                  514MB/s ± 4%   521MB/s ± 1%    ~     (p=0.841 n=5+5)
      JSONEncode-8              121MB/s ± 2%   120MB/s ±10%    ~     (p=0.548 n=5+5)
      JSONDecode-8             36.5MB/s ± 2%  36.6MB/s ± 4%    ~     (p=1.000 n=5+5)
      GoParse-8                17.9MB/s ± 2%  17.7MB/s ± 4%    ~     (p=0.730 n=5+5)
      RegexpMatchEasy0_32-8     371MB/s ± 1%   375MB/s ± 3%    ~     (p=0.310 n=5+5)
      RegexpMatchEasy0_1K-8    5.15GB/s ± 1%  5.13GB/s ± 1%    ~     (p=0.548 n=5+5)
      RegexpMatchEasy1_32-8     387MB/s ± 2%   391MB/s ± 1%    ~     (p=0.310 n=5+5)
      RegexpMatchEasy1_1K-8    2.85GB/s ± 2%  2.89GB/s ± 1%    ~     (p=0.056 n=5+5)
      RegexpMatchMedium_32-8   8.07MB/s ± 2%  8.06MB/s ± 1%    ~     (p=0.730 n=5+5)
      RegexpMatchMedium_1K-8   26.8MB/s ± 2%  26.6MB/s ± 7%    ~     (p=0.690 n=5+5)
      RegexpMatchHard_32-8     16.7MB/s ± 2%  16.7MB/s ± 5%    ~     (p=0.421 n=5+5)
      RegexpMatchHard_1K-8     17.8MB/s ± 1%  18.0MB/s ± 2%    ~     (p=0.310 n=5+5)
      Revcomp-8                 527MB/s ± 6%   577MB/s ± 1%  +9.44%  (p=0.016 n=5+4)
      Template-8               33.5MB/s ± 1%  33.4MB/s ± 7%    ~     (p=0.310 n=5+5)
      
      Updates #19495
      
      Change-Id: Ib9ece1690813d9b4788455db43d30891e2138df5
      Reviewed-on: https://go-review.googlesource.com/38172Reviewed-by: default avatarHugues Bruant <hugues.bruant@gmail.com>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      5d6b7fca
  3. 14 Mar, 2017 1 commit
  4. 13 Mar, 2017 1 commit
    • Hugues Bruant's avatar
      runtime: add mapassign_fast* · ec091b6a
      Hugues Bruant authored
      Add benchmarks for map assignment with int32/int64/string key
      
      Benchmark results on darwin/amd64
      
      name                  old time/op  new time/op  delta
      MapAssignInt32_255-8  24.7ns ± 3%  17.4ns ± 2%  -29.75%  (p=0.000 n=10+10)
      MapAssignInt32_64k-8  45.5ns ± 4%  37.6ns ± 4%  -17.18%  (p=0.000 n=10+10)
      MapAssignInt64_255-8  26.0ns ± 3%  17.9ns ± 4%  -31.03%  (p=0.000 n=10+10)
      MapAssignInt64_64k-8  46.9ns ± 5%  38.7ns ± 2%  -17.53%  (p=0.000 n=9+10)
      MapAssignStr_255-8    47.8ns ± 3%  24.8ns ± 4%  -48.01%  (p=0.000 n=10+10)
      MapAssignStr_64k-8    83.0ns ± 3%  51.9ns ± 3%  -37.45%  (p=0.000 n=10+9)
      
      name                     old time/op    new time/op    delta
      BinaryTree17-8              3.11s ±19%     2.78s ± 3%    ~     (p=0.095 n=5+5)
      Fannkuch11-8                3.26s ± 1%     3.21s ± 2%    ~     (p=0.056 n=5+5)
      FmtFprintfEmpty-8          50.3ns ± 1%    50.8ns ± 2%    ~     (p=0.246 n=5+5)
      FmtFprintfString-8         82.7ns ± 4%    80.1ns ± 5%    ~     (p=0.238 n=5+5)
      FmtFprintfInt-8            82.6ns ± 2%    81.9ns ± 3%    ~     (p=0.508 n=5+5)
      FmtFprintfIntInt-8          124ns ± 4%     121ns ± 3%    ~     (p=0.111 n=5+5)
      FmtFprintfPrefixedInt-8     158ns ± 6%     160ns ± 2%    ~     (p=0.341 n=5+5)
      FmtFprintfFloat-8           249ns ± 2%     245ns ± 2%    ~     (p=0.095 n=5+5)
      FmtManyArgs-8               513ns ± 2%     519ns ± 3%    ~     (p=0.151 n=5+5)
      GobDecode-8                7.48ms ±12%    7.11ms ± 2%    ~     (p=0.222 n=5+5)
      GobEncode-8                6.25ms ± 1%    6.03ms ± 2%  -3.56%  (p=0.008 n=5+5)
      Gzip-8                      252ms ± 4%     252ms ± 4%    ~     (p=1.000 n=5+5)
      Gunzip-8                   38.4ms ± 3%    38.6ms ± 2%    ~     (p=0.690 n=5+5)
      HTTPClientServer-8         76.9µs ±41%    66.4µs ± 6%    ~     (p=0.310 n=5+5)
      JSONEncode-8               16.5ms ± 3%    16.7ms ± 3%    ~     (p=0.421 n=5+5)
      JSONDecode-8               54.6ms ± 1%    54.3ms ± 2%    ~     (p=0.548 n=5+5)
      Mandelbrot200-8            4.45ms ± 3%    4.47ms ± 1%    ~     (p=0.841 n=5+5)
      GoParse-8                  3.43ms ± 1%    3.32ms ± 2%  -3.28%  (p=0.008 n=5+5)
      RegexpMatchEasy0_32-8      88.2ns ± 3%    89.4ns ± 2%    ~     (p=0.333 n=5+5)
      RegexpMatchEasy0_1K-8       205ns ± 1%     206ns ± 1%    ~     (p=0.905 n=5+5)
      RegexpMatchEasy1_32-8      85.1ns ± 1%    85.5ns ± 5%    ~     (p=0.690 n=5+5)
      RegexpMatchEasy1_1K-8       365ns ± 1%     371ns ± 9%    ~     (p=1.000 n=5+5)
      RegexpMatchMedium_32-8      129ns ± 2%     128ns ± 3%    ~     (p=0.730 n=5+5)
      RegexpMatchMedium_1K-8     39.8µs ± 0%    39.7µs ± 4%    ~     (p=0.730 n=4+5)
      RegexpMatchHard_32-8       1.99µs ± 3%    2.05µs ±16%    ~     (p=0.794 n=5+5)
      RegexpMatchHard_1K-8       59.3µs ± 1%    60.3µs ± 7%    ~     (p=1.000 n=5+5)
      Revcomp-8                   1.36s ±63%     0.52s ± 5%    ~     (p=0.095 n=5+5)
      Template-8                 62.6ms ±14%    60.5ms ± 5%    ~     (p=0.690 n=5+5)
      TimeParse-8                 330ns ± 2%     324ns ± 2%    ~     (p=0.087 n=5+5)
      TimeFormat-8                350ns ± 3%     340ns ± 1%  -2.86%  (p=0.008 n=5+5)
      
      name                     old speed      new speed      delta
      GobDecode-8               103MB/s ±11%   108MB/s ± 2%    ~     (p=0.222 n=5+5)
      GobEncode-8               123MB/s ± 1%   127MB/s ± 2%  +3.71%  (p=0.008 n=5+5)
      Gzip-8                   77.1MB/s ± 4%  76.9MB/s ± 3%    ~     (p=1.000 n=5+5)
      Gunzip-8                  505MB/s ± 3%   503MB/s ± 2%    ~     (p=0.690 n=5+5)
      JSONEncode-8              118MB/s ± 3%   116MB/s ± 3%    ~     (p=0.421 n=5+5)
      JSONDecode-8             35.5MB/s ± 1%  35.8MB/s ± 2%    ~     (p=0.397 n=5+5)
      GoParse-8                16.9MB/s ± 1%  17.4MB/s ± 2%  +3.45%  (p=0.008 n=5+5)
      RegexpMatchEasy0_32-8     363MB/s ± 3%   358MB/s ± 2%    ~     (p=0.421 n=5+5)
      RegexpMatchEasy0_1K-8    4.98GB/s ± 1%  4.97GB/s ± 1%    ~     (p=0.548 n=5+5)
      RegexpMatchEasy1_32-8     376MB/s ± 1%   375MB/s ± 5%    ~     (p=0.690 n=5+5)
      RegexpMatchEasy1_1K-8    2.80GB/s ± 1%  2.76GB/s ± 9%    ~     (p=0.841 n=5+5)
      RegexpMatchMedium_32-8   7.73MB/s ± 1%  7.76MB/s ± 3%    ~     (p=0.730 n=5+5)
      RegexpMatchMedium_1K-8   25.8MB/s ± 0%  25.8MB/s ± 4%    ~     (p=0.651 n=4+5)
      RegexpMatchHard_32-8     16.1MB/s ± 3%  15.7MB/s ±14%    ~     (p=0.794 n=5+5)
      RegexpMatchHard_1K-8     17.3MB/s ± 1%  17.0MB/s ± 7%    ~     (p=0.984 n=5+5)
      Revcomp-8                 273MB/s ±83%   488MB/s ± 5%    ~     (p=0.095 n=5+5)
      Template-8               31.1MB/s ±13%  32.1MB/s ± 5%    ~     (p=0.690 n=5+5)
      
      Updates #19495
      
      Change-Id: I116e9a2a4594769318b22d736464de8a98499909
      Reviewed-on: https://go-review.googlesource.com/38091Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      ec091b6a
  5. 03 Mar, 2017 1 commit
    • Aliaksandr Valialkin's avatar
      cmd/compile: pack bool fields in Node, Name, Func and Type structs to bitsets · ed70f37e
      Aliaksandr Valialkin authored
      This reduces compiler memory usage by up to 4% - see compilebench
      results below.
      
      name       old time/op     new time/op     delta
      Template       245ms ± 4%      241ms ± 2%  -1.88%  (p=0.029 n=10+10)
      Unicode        126ms ± 3%      124ms ± 3%    ~     (p=0.105 n=10+10)
      GoTypes        805ms ± 2%      813ms ± 3%    ~     (p=0.515 n=8+10)
      Compiler       3.95s ± 2%      3.83s ± 1%  -2.96%  (p=0.000 n=9+10)
      MakeBash       47.4s ± 4%      46.6s ± 1%  -1.59%  (p=0.028 n=9+10)
      
      name       old user-ns/op  new user-ns/op  delta
      Template        324M ± 5%       326M ± 3%    ~     (p=0.935 n=10+10)
      Unicode         186M ± 5%       178M ±10%    ~     (p=0.067 n=9+10)
      GoTypes        1.08G ± 7%      1.09G ± 4%    ~     (p=0.956 n=10+10)
      Compiler       5.34G ± 4%      5.31G ± 1%    ~     (p=0.501 n=10+8)
      
      name       old alloc/op    new alloc/op    delta
      Template      41.0MB ± 0%     39.8MB ± 0%  -3.03%  (p=0.000 n=10+10)
      Unicode       32.3MB ± 0%     31.0MB ± 0%  -4.13%  (p=0.000 n=10+10)
      GoTypes        119MB ± 0%      116MB ± 0%  -2.39%  (p=0.000 n=10+10)
      Compiler       499MB ± 0%      487MB ± 0%  -2.48%  (p=0.000 n=10+10)
      
      name       old allocs/op   new allocs/op   delta
      Template        380k ± 1%       379k ± 1%    ~     (p=0.436 n=10+10)
      Unicode         324k ± 1%       324k ± 0%    ~     (p=0.853 n=10+10)
      GoTypes        1.15M ± 0%      1.15M ± 0%    ~     (p=0.481 n=10+10)
      Compiler       4.41M ± 0%      4.41M ± 0%  -0.12%  (p=0.007 n=10+10)
      
      name       old text-bytes  new text-bytes  delta
      HelloSize       623k ± 0%       623k ± 0%    ~     (all equal)
      CmdGoSize      6.64M ± 0%      6.64M ± 0%    ~     (all equal)
      
      name       old data-bytes  new data-bytes  delta
      HelloSize      5.81k ± 0%      5.81k ± 0%    ~     (all equal)
      CmdGoSize       238k ± 0%       238k ± 0%    ~     (all equal)
      
      name       old bss-bytes   new bss-bytes   delta
      HelloSize       134k ± 0%       134k ± 0%    ~     (all equal)
      CmdGoSize       152k ± 0%       152k ± 0%    ~     (all equal)
      
      name       old exe-bytes   new exe-bytes   delta
      HelloSize       967k ± 0%       967k ± 0%    ~     (all equal)
      CmdGoSize      10.2M ± 0%      10.2M ± 0%    ~     (all equal)
      
      Change-Id: I1f40af738254892bd6c8ba2eb43390b175753d52
      Reviewed-on: https://go-review.googlesource.com/37445Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      ed70f37e
  6. 24 Feb, 2017 1 commit
  7. 11 Feb, 2017 1 commit
  8. 10 Feb, 2017 1 commit
  9. 07 Feb, 2017 1 commit
  10. 02 Feb, 2017 1 commit
    • Josh Bleecher Snyder's avatar
      cmd/compile: convert constants to interfaces without allocating · c682d323
      Josh Bleecher Snyder authored
      The order pass is responsible for ensuring that
      values passed to runtime functions, including
      convT2E/convT2I, are addressable.
      
      Prior to this CL, this was always accomplished
      by creating a temp, which frequently escaped to
      the heap, causing allocations, perhaps most
      notably in code like:
      
      fmt.Println(1, 2, 3) // allocates three times
      
      None of the runtime routines modify the contents
      of the pointers they receive, so in the case of
      constants, instead of creating a temp value,
      we can create a static value.
      
      (Marking the static value as read-only provides
      protection against accidental attempts by the runtime
      to modify the constant data.)
      
      This improves code generation for code like:
      
      panic("abc")
      c <- 2 // c is a chan int
      
      which can now simply refer to "abc" and 2,
      rather than going by way of a temporary.
      
      It also allows us to optimize convT2E/convT2I,
      by recognizing static readonly values
      and directly constructing the interface.
      
      This CL adds ~0.5% to binary size, despite
      decreasing the size of many functions,
      because it also adds many static symbols.
      
      This binary size regression could be recovered in
      future (but currently unplanned) work.
      
      There is a lot of content-duplication in these
      symbols; this statement generates six new symbols,
      three containing an int 1 and three containing
      a pointer to the string "a":
      
      fmt.Println(1, 1, 1, "a", "a", "a")
      
      These symbols could be made content-addressable.
      
      Furthermore, these symbols are small, so the
      alignment and naming overhead is large.
      As with the go.strings section, these symbols
      could be hidden and have their alignment reduced.
      
      The changes to test/live.go make it impossible
      (at least with current optimization techniques)
      to place the values being passed to the runtime
      in static symbols, preserving autotmp creation.
      
      Fixes #18704
      
      Benchmarks from fmt and go-kit's logging package:
      
      github.com/go-kit/kit/log
      
      name                      old time/op    new time/op    delta
      JSONLoggerSimple-8          1.91µs ± 2%    2.11µs ±22%     ~     (p=1.000 n=9+10)
      JSONLoggerContextual-8      2.60µs ± 6%    2.43µs ± 2%   -6.29%  (p=0.000 n=9+10)
      Discard-8                    101ns ± 2%      34ns ±14%  -66.33%  (p=0.000 n=10+9)
      OneWith-8                    161ns ± 1%     102ns ±16%  -36.78%  (p=0.000 n=10+10)
      TwoWith-8                    175ns ± 3%     106ns ± 7%  -39.36%  (p=0.000 n=10+9)
      TenWith-8                    293ns ± 3%     227ns ±15%  -22.44%  (p=0.000 n=9+10)
      LogfmtLoggerSimple-8         704ns ± 2%     608ns ± 2%  -13.65%  (p=0.000 n=10+9)
      LogfmtLoggerContextual-8     962ns ± 1%     860ns ±17%  -10.57%  (p=0.003 n=9+10)
      NopLoggerSimple-8            188ns ± 1%     120ns ± 1%  -36.39%  (p=0.000 n=9+10)
      NopLoggerContextual-8        379ns ± 1%     243ns ± 0%  -35.77%  (p=0.000 n=9+10)
      ValueBindingTimestamp-8      577ns ± 1%     499ns ± 1%  -13.51%  (p=0.000 n=10+10)
      ValueBindingCaller-8         898ns ± 2%     844ns ± 2%   -6.00%  (p=0.000 n=10+10)
      
      name                      old alloc/op   new alloc/op   delta
      JSONLoggerSimple-8            904B ± 0%      872B ± 0%   -3.54%  (p=0.000 n=10+10)
      JSONLoggerContextual-8      1.20kB ± 0%    1.14kB ± 0%   -5.33%  (p=0.000 n=10+10)
      Discard-8                    64.0B ± 0%     32.0B ± 0%  -50.00%  (p=0.000 n=10+10)
      OneWith-8                    96.0B ± 0%     64.0B ± 0%  -33.33%  (p=0.000 n=10+10)
      TwoWith-8                     160B ± 0%      128B ± 0%  -20.00%  (p=0.000 n=10+10)
      TenWith-8                     672B ± 0%      640B ± 0%   -4.76%  (p=0.000 n=10+10)
      LogfmtLoggerSimple-8          128B ± 0%       96B ± 0%  -25.00%  (p=0.000 n=10+10)
      LogfmtLoggerContextual-8      304B ± 0%      240B ± 0%  -21.05%  (p=0.000 n=10+10)
      NopLoggerSimple-8             128B ± 0%       96B ± 0%  -25.00%  (p=0.000 n=10+10)
      NopLoggerContextual-8         304B ± 0%      240B ± 0%  -21.05%  (p=0.000 n=10+10)
      ValueBindingTimestamp-8       159B ± 0%      127B ± 0%  -20.13%  (p=0.000 n=10+10)
      ValueBindingCaller-8          112B ± 0%       80B ± 0%  -28.57%  (p=0.000 n=10+10)
      
      name                      old allocs/op  new allocs/op  delta
      JSONLoggerSimple-8            19.0 ± 0%      17.0 ± 0%  -10.53%  (p=0.000 n=10+10)
      JSONLoggerContextual-8        25.0 ± 0%      21.0 ± 0%  -16.00%  (p=0.000 n=10+10)
      Discard-8                     3.00 ± 0%      1.00 ± 0%  -66.67%  (p=0.000 n=10+10)
      OneWith-8                     3.00 ± 0%      1.00 ± 0%  -66.67%  (p=0.000 n=10+10)
      TwoWith-8                     3.00 ± 0%      1.00 ± 0%  -66.67%  (p=0.000 n=10+10)
      TenWith-8                     3.00 ± 0%      1.00 ± 0%  -66.67%  (p=0.000 n=10+10)
      LogfmtLoggerSimple-8          4.00 ± 0%      2.00 ± 0%  -50.00%  (p=0.000 n=10+10)
      LogfmtLoggerContextual-8      7.00 ± 0%      3.00 ± 0%  -57.14%  (p=0.000 n=10+10)
      NopLoggerSimple-8             4.00 ± 0%      2.00 ± 0%  -50.00%  (p=0.000 n=10+10)
      NopLoggerContextual-8         7.00 ± 0%      3.00 ± 0%  -57.14%  (p=0.000 n=10+10)
      ValueBindingTimestamp-8       5.00 ± 0%      3.00 ± 0%  -40.00%  (p=0.000 n=10+10)
      ValueBindingCaller-8          4.00 ± 0%      2.00 ± 0%  -50.00%  (p=0.000 n=10+10)
      
      fmt
      
      name                             old time/op    new time/op    delta
      SprintfPadding-8                   88.9ns ± 3%    79.1ns ± 1%   -11.09%  (p=0.000 n=10+7)
      SprintfEmpty-8                     12.6ns ± 3%    12.8ns ± 3%      ~     (p=0.136 n=10+10)
      SprintfString-8                    38.7ns ± 5%    26.9ns ± 6%   -30.65%  (p=0.000 n=10+10)
      SprintfTruncateString-8            56.7ns ± 2%    47.0ns ± 3%   -17.05%  (p=0.000 n=10+10)
      SprintfQuoteString-8                164ns ± 2%     153ns ± 2%    -7.01%  (p=0.000 n=10+10)
      SprintfInt-8                       38.9ns ±15%    26.5ns ± 2%   -31.93%  (p=0.000 n=10+9)
      SprintfIntInt-8                    60.3ns ± 9%    38.2ns ± 1%   -36.67%  (p=0.000 n=10+8)
      SprintfPrefixedInt-8               58.6ns ±13%    51.2ns ±11%   -12.66%  (p=0.001 n=10+10)
      SprintfFloat-8                     71.4ns ± 3%    64.2ns ± 3%   -10.08%  (p=0.000 n=8+10)
      SprintfComplex-8                    175ns ± 3%     159ns ± 2%    -9.03%  (p=0.000 n=10+10)
      SprintfBoolean-8                   33.5ns ± 4%    25.7ns ± 5%   -23.28%  (p=0.000 n=10+10)
      SprintfHexString-8                 65.3ns ± 3%    51.7ns ± 5%   -20.86%  (p=0.000 n=10+9)
      SprintfHexBytes-8                  67.2ns ± 5%    67.9ns ± 4%      ~     (p=0.383 n=10+10)
      SprintfBytes-8                      129ns ± 7%     124ns ± 7%      ~     (p=0.074 n=9+10)
      SprintfStringer-8                   127ns ± 4%     126ns ± 8%      ~     (p=0.506 n=9+10)
      SprintfStructure-8                  357ns ± 3%     359ns ± 3%      ~     (p=0.469 n=10+10)
      ManyArgs-8                          203ns ± 6%     126ns ± 3%   -37.94%  (p=0.000 n=10+10)
      FprintInt-8                         119ns ±10%      74ns ± 3%   -37.54%  (p=0.000 n=10+10)
      FprintfBytes-8                      122ns ± 4%     120ns ± 3%      ~     (p=0.124 n=10+10)
      FprintIntNoAlloc-8                 78.2ns ± 5%    74.1ns ± 3%    -5.28%  (p=0.000 n=10+10)
      ScanInts-8                          349µs ± 1%     349µs ± 0%      ~     (p=0.606 n=9+8)
      ScanRecursiveInt-8                 43.8ms ± 7%    40.1ms ± 2%    -8.42%  (p=0.000 n=10+10)
      ScanRecursiveIntReaderWrapper-8    43.5ms ± 4%    40.4ms ± 2%    -7.16%  (p=0.000 n=10+9)
      
      name                             old alloc/op   new alloc/op   delta
      SprintfPadding-8                    24.0B ± 0%     16.0B ± 0%   -33.33%  (p=0.000 n=10+10)
      SprintfEmpty-8                      0.00B          0.00B           ~     (all equal)
      SprintfString-8                     21.0B ± 0%      5.0B ± 0%   -76.19%  (p=0.000 n=10+10)
      SprintfTruncateString-8             32.0B ± 0%     16.0B ± 0%   -50.00%  (p=0.000 n=10+10)
      SprintfQuoteString-8                48.0B ± 0%     32.0B ± 0%   -33.33%  (p=0.000 n=10+10)
      SprintfInt-8                        16.0B ± 0%      1.0B ± 0%   -93.75%  (p=0.000 n=10+10)
      SprintfIntInt-8                     24.0B ± 0%      3.0B ± 0%   -87.50%  (p=0.000 n=10+10)
      SprintfPrefixedInt-8                72.0B ± 0%     64.0B ± 0%   -11.11%  (p=0.000 n=10+10)
      SprintfFloat-8                      16.0B ± 0%      8.0B ± 0%   -50.00%  (p=0.000 n=10+10)
      SprintfComplex-8                    48.0B ± 0%     32.0B ± 0%   -33.33%  (p=0.000 n=10+10)
      SprintfBoolean-8                    8.00B ± 0%     4.00B ± 0%   -50.00%  (p=0.000 n=10+10)
      SprintfHexString-8                  96.0B ± 0%     80.0B ± 0%   -16.67%  (p=0.000 n=10+10)
      SprintfHexBytes-8                    112B ± 0%      112B ± 0%      ~     (all equal)
      SprintfBytes-8                      96.0B ± 0%     96.0B ± 0%      ~     (all equal)
      SprintfStringer-8                   32.0B ± 0%     32.0B ± 0%      ~     (all equal)
      SprintfStructure-8                   256B ± 0%      256B ± 0%      ~     (all equal)
      ManyArgs-8                          80.0B ± 0%      0.0B       -100.00%  (p=0.000 n=10+10)
      FprintInt-8                         8.00B ± 0%     0.00B       -100.00%  (p=0.000 n=10+10)
      FprintfBytes-8                      32.0B ± 0%     32.0B ± 0%      ~     (all equal)
      FprintIntNoAlloc-8                  0.00B          0.00B           ~     (all equal)
      ScanInts-8                         15.2kB ± 0%    15.2kB ± 0%      ~     (p=0.248 n=9+10)
      ScanRecursiveInt-8                 21.6kB ± 0%    21.6kB ± 0%      ~     (all equal)
      ScanRecursiveIntReaderWrapper-8    21.7kB ± 0%    21.7kB ± 0%      ~     (all equal)
      
      name                             old allocs/op  new allocs/op  delta
      SprintfPadding-8                     2.00 ± 0%      1.00 ± 0%   -50.00%  (p=0.000 n=10+10)
      SprintfEmpty-8                       0.00           0.00           ~     (all equal)
      SprintfString-8                      2.00 ± 0%      1.00 ± 0%   -50.00%  (p=0.000 n=10+10)
      SprintfTruncateString-8              2.00 ± 0%      1.00 ± 0%   -50.00%  (p=0.000 n=10+10)
      SprintfQuoteString-8                 2.00 ± 0%      1.00 ± 0%   -50.00%  (p=0.000 n=10+10)
      SprintfInt-8                         2.00 ± 0%      1.00 ± 0%   -50.00%  (p=0.000 n=10+10)
      SprintfIntInt-8                      3.00 ± 0%      1.00 ± 0%   -66.67%  (p=0.000 n=10+10)
      SprintfPrefixedInt-8                 2.00 ± 0%      1.00 ± 0%   -50.00%  (p=0.000 n=10+10)
      SprintfFloat-8                       2.00 ± 0%      1.00 ± 0%   -50.00%  (p=0.000 n=10+10)
      SprintfComplex-8                     2.00 ± 0%      1.00 ± 0%   -50.00%  (p=0.000 n=10+10)
      SprintfBoolean-8                     2.00 ± 0%      1.00 ± 0%   -50.00%  (p=0.000 n=10+10)
      SprintfHexString-8                   2.00 ± 0%      1.00 ± 0%   -50.00%  (p=0.000 n=10+10)
      SprintfHexBytes-8                    2.00 ± 0%      2.00 ± 0%      ~     (all equal)
      SprintfBytes-8                       2.00 ± 0%      2.00 ± 0%      ~     (all equal)
      SprintfStringer-8                    4.00 ± 0%      4.00 ± 0%      ~     (all equal)
      SprintfStructure-8                   7.00 ± 0%      7.00 ± 0%      ~     (all equal)
      ManyArgs-8                           8.00 ± 0%      0.00       -100.00%  (p=0.000 n=10+10)
      FprintInt-8                          1.00 ± 0%      0.00       -100.00%  (p=0.000 n=10+10)
      FprintfBytes-8                       1.00 ± 0%      1.00 ± 0%      ~     (all equal)
      FprintIntNoAlloc-8                   0.00           0.00           ~     (all equal)
      ScanInts-8                          1.60k ± 0%     1.60k ± 0%      ~     (all equal)
      ScanRecursiveInt-8                  1.71k ± 0%     1.71k ± 0%      ~     (all equal)
      ScanRecursiveIntReaderWrapper-8     1.71k ± 0%     1.71k ± 0%      ~     (all equal)
      
      Change-Id: I7ba72a25fea4140a0ba40a9f443103ed87cc69b5
      Reviewed-on: https://go-review.googlesource.com/35554
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      c682d323
  11. 09 Jan, 2017 1 commit
    • Robert Griesemer's avatar
      [dev.inline] cmd/internal/src: introduce compact source position representation · 472c792e
      Robert Griesemer authored
      XPos is a compact (8 instead of 16 bytes on a 64bit machine) source
      position representation. There is a 1:1 correspondence between each
      XPos and each regular Pos, translated via a global table.
      
      In some sense this brings back the LineHist, though positions can
      track line and column information; there is a O(1) translation
      between the representations (no binary search), and the translation
      is factored out.
      
      The size increase with the prior change is brought down again and
      the compiler speed is in line with the master repo (measured on
      the same "quiet" machine as for prior change):
      
      name       old time/op     new time/op     delta
      Template       256ms ± 1%      262ms ± 2%    ~             (p=0.063 n=5+4)
      Unicode        132ms ± 1%      135ms ± 2%    ~             (p=0.063 n=5+4)
      GoTypes        891ms ± 1%      871ms ± 1%  -2.28%          (p=0.016 n=5+4)
      Compiler       3.84s ± 2%      3.89s ± 2%    ~             (p=0.413 n=5+4)
      MakeBash       47.1s ± 1%      46.2s ± 2%    ~             (p=0.095 n=5+5)
      
      name       old user-ns/op  new user-ns/op  delta
      Template        309M ± 1%       314M ± 2%    ~             (p=0.111 n=5+4)
      Unicode         165M ± 1%       172M ± 9%    ~             (p=0.151 n=5+5)
      GoTypes        1.14G ± 2%      1.12G ± 1%    ~             (p=0.063 n=5+4)
      Compiler       5.00G ± 1%      4.96G ± 1%    ~             (p=0.286 n=5+4)
      
      Change-Id: Icc570cc60ab014d8d9af6976f1f961ab8828cc47
      Reviewed-on: https://go-review.googlesource.com/34506
      Run-TryBot: Robert Griesemer <gri@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      Reviewed-by: default avatarAustin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      472c792e
  12. 09 Dec, 2016 1 commit
  13. 08 Dec, 2016 1 commit
  14. 31 Oct, 2016 1 commit
    • David Chase's avatar
      cmd/compile: mark temps with new AutoTemp flag, and use it. · 9c066bab
      David Chase authored
      This is an extension of
      https://go-review.googlesource.com/c/31662/
      to mark all the temporaries, not just the ssa-generated ones.
      
      Before-and-after ls -l `go tool -n compile` shows a 3%
      reduction in size (or rather, a prior 3% inflation for
      failing to filter temps out properly.)
      
      Replaced name-dependent "is it a temp?" tests with calls to
      *Node.IsAutoTmp(), which depends on AutoTemp.  Also replace
      calls to istemp(n) with n.IsAutoTmp(), to reduce duplication
      and clean up function name space.  Generated temporaries
      now come with a "." prefix to avoid (apparently harmless)
      clashes with legal Go variable names.
      
      Fixes #17644.
      Fixes #17240.
      
      Change-Id: If1417f29c79a7275d7303ddf859b51472890fd43
      Reviewed-on: https://go-review.googlesource.com/32255
      Run-TryBot: David Chase <drchase@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      9c066bab
  15. 28 Oct, 2016 1 commit
    • Austin Clements's avatar
      cmd/compile: disable various write barrier optimizations · c39918a0
      Austin Clements authored
      Several of our current write barrier elision optimizations are invalid
      with the hybrid barrier. Eliding the hybrid barrier requires that
      *both* the current and new pointer be already shaded and, since we
      don't have the flow analysis to figure out anything about the slot's
      current value, for now we have to just disable several of these
      optimizations.
      
      This has a slight impact on binary size. On linux/amd64, the go tool
      binary increases by 0.7% and the compile binary increases by 1.5%.
      
      It also has a slight impact on performance, as one would expect. We'll
      win some of this back in subsequent commits.
      
      name                      old time/op    new time/op    delta
      BinaryTree17-12              2.38s ± 1%     2.40s ± 1%  +0.82%  (p=0.000 n=18+20)
      Fannkuch11-12                2.84s ± 1%     2.70s ± 0%  -4.97%  (p=0.000 n=18+18)
      FmtFprintfEmpty-12          44.2ns ± 1%    46.4ns ± 2%  +4.89%  (p=0.000 n=16+18)
      FmtFprintfString-12          131ns ± 0%     134ns ± 1%  +2.05%  (p=0.000 n=12+19)
      FmtFprintfInt-12             114ns ± 1%     117ns ± 1%  +3.26%  (p=0.000 n=19+20)
      FmtFprintfIntInt-12          176ns ± 1%     181ns ± 1%  +3.25%  (p=0.000 n=20+20)
      FmtFprintfPrefixedInt-12     185ns ± 1%     190ns ± 1%  +2.77%  (p=0.000 n=19+18)
      FmtFprintfFloat-12           249ns ± 1%     254ns ± 1%  +1.71%  (p=0.000 n=18+20)
      FmtManyArgs-12               747ns ± 1%     743ns ± 1%  -0.58%  (p=0.000 n=19+18)
      GobDecode-12                6.57ms ± 1%    6.61ms ± 0%  +0.73%  (p=0.000 n=19+20)
      GobEncode-12                5.58ms ± 1%    5.60ms ± 0%  +0.27%  (p=0.001 n=18+18)
      Gzip-12                      223ms ± 1%     223ms ± 1%    ~     (p=0.351 n=19+20)
      Gunzip-12                   37.9ms ± 0%    37.9ms ± 1%    ~     (p=0.095 n=16+20)
      HTTPClientServer-12         77.8µs ± 1%    78.5µs ± 1%  +0.97%  (p=0.000 n=19+20)
      JSONEncode-12               14.8ms ± 1%    14.8ms ± 1%    ~     (p=0.079 n=20+19)
      JSONDecode-12               53.7ms ± 1%    54.2ms ± 1%  +0.92%  (p=0.000 n=20+19)
      Mandelbrot200-12            3.81ms ± 1%    3.81ms ± 0%    ~     (p=0.916 n=19+18)
      GoParse-12                  3.19ms ± 1%    3.19ms ± 1%    ~     (p=0.175 n=20+19)
      RegexpMatchEasy0_32-12      71.9ns ± 1%    70.6ns ± 1%  -1.87%  (p=0.000 n=19+20)
      RegexpMatchEasy0_1K-12       946ns ± 0%     944ns ± 0%  -0.22%  (p=0.000 n=19+16)
      RegexpMatchEasy1_32-12      67.3ns ± 2%    66.8ns ± 1%  -0.72%  (p=0.008 n=20+20)
      RegexpMatchEasy1_1K-12       374ns ± 1%     384ns ± 1%  +2.69%  (p=0.000 n=18+20)
      RegexpMatchMedium_32-12      107ns ± 1%     107ns ± 1%    ~     (p=1.000 n=20+20)
      RegexpMatchMedium_1K-12     34.3µs ± 1%    34.6µs ± 1%  +0.90%  (p=0.000 n=20+20)
      RegexpMatchHard_32-12       1.78µs ± 1%    1.80µs ± 1%  +1.45%  (p=0.000 n=20+19)
      RegexpMatchHard_1K-12       53.6µs ± 0%    54.5µs ± 1%  +1.52%  (p=0.000 n=19+18)
      Revcomp-12                   417ms ± 5%     391ms ± 1%  -6.42%  (p=0.000 n=16+19)
      Template-12                 61.1ms ± 1%    64.2ms ± 0%  +5.07%  (p=0.000 n=19+20)
      TimeParse-12                 302ns ± 1%     305ns ± 1%  +0.90%  (p=0.000 n=18+18)
      TimeFormat-12                319ns ± 1%     315ns ± 1%  -1.25%  (p=0.000 n=18+18)
      [Geo mean]                  54.0µs         54.3µs       +0.58%
      
      name         old time/op  new time/op  delta
      XGarbage-12  2.24ms ± 2%  2.28ms ± 1%  +1.68%  (p=0.000 n=18+17)
      XHTTP-12     11.4µs ± 1%  11.6µs ± 2%  +1.63%  (p=0.000 n=18+18)
      XJSON-12     11.6ms ± 0%  12.5ms ± 0%  +7.84%  (p=0.000 n=18+17)
      
      Updates #17503.
      
      Change-Id: I1899f8e35662971e24bf692b517dfbe2b533c00c
      Reviewed-on: https://go-review.googlesource.com/31572Reviewed-by: default avatarKeith Randall <khr@golang.org>
      c39918a0
  16. 12 Oct, 2016 1 commit
    • Keith Randall's avatar
      cmd/compile,runtime: redo how map assignments work · 442de98c
      Keith Randall authored
      To compile:
        m[k] = v
      instead of:
        mapassign(maptype, m, &k, &v), do
      do:
        *mapassign(maptype, m, &k) = v
      
      mapassign returns a pointer to the value slot in the map.  It is just
      like mapaccess except that it will allocate a new slot if k is not
      already present in the map.
      
      This makes map accesses faster but potentially larger (codewise).
      
      It is faster because the write into the map is done when the compiler
      knows the concrete type, so it can be done with a few store
      instructions instead of calling typedmemmove.  We also potentially
      avoid stack temporaries to hold v.
      
      The code can be larger when the map has pointers in its value type,
      since there is a write barrier call in addition to the mapassign call.
      That makes the code at the callsite a bit bigger (go binary is 0.3%
      bigger).
      
      This CL is in preparation for doing operations like m[k] += v with
      only a single runtime call.  That will roughly double the speed of
      such operations.
      
      Update #17133
      Update #5147
      
      Change-Id: Ia435f032090a2ed905dac9234e693972fe8c2dc5
      Reviewed-on: https://go-review.googlesource.com/30815
      Run-TryBot: Keith Randall <khr@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      442de98c
  17. 27 Sep, 2016 1 commit
  18. 16 Sep, 2016 1 commit
  19. 15 Sep, 2016 2 commits
  20. 14 Sep, 2016 2 commits
  21. 04 Sep, 2016 1 commit
  22. 06 Jul, 2016 1 commit
    • Ian Lance Taylor's avatar
      cmd/compile, syscall: add //go:uintptrescapes comment, and use it · bbe5da42
      Ian Lance Taylor authored
      This new comment can be used to declare that the uintptr arguments to a
      function may be converted from pointers, and that those pointers should
      be considered to escape. This is used for the Call methods in
      dll_windows.go that take uintptr arguments, because they call Syscall.
      
      We can't treat these functions as we do syscall.Syscall, because unlike
      Syscall they may cause the stack to grow. For Syscall we can assume that
      stack arguments can remain on the stack, but for these functions we need
      them to escape.
      
      Fixes #16035.
      
      Change-Id: Ia0e5b4068c04f8d303d95ab9ea394939f1f57454
      Reviewed-on: https://go-review.googlesource.com/24551Reviewed-by: default avatarDavid Chase <drchase@google.com>
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      bbe5da42
  23. 18 May, 2016 1 commit
    • Matthew Dempsky's avatar
      cmd/compile: handle unsafe.Pointer(f()) correctly · c65647d6
      Matthew Dempsky authored
      Previously statements like
      
          f(unsafe.Pointer(g()), int(h()))
      
      would be reordered into a sequence of statements like
      
          autotmp_g := g()
          autotmp_h := h()
          f(unsafe.Pointer(autotmp_g), int(autotmp_h))
      
      which can leave g's temporary value on the stack as a uintptr, rather
      than an unsafe.Pointer. Instead, recognize uintptr-to-unsafe.Pointer
      conversions when reordering function calls to instead produce:
      
          autotmp_g := unsafe.Pointer(g())
          autotmp_h := h()
          f(autotmp_g, int(autotmp_h))
      
      Fixes #15329.
      
      Change-Id: I2cdbd89d233d0d5c94791513a9fd5fd958d11ed5
      Reviewed-on: https://go-review.googlesource.com/22273
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      c65647d6
  24. 08 May, 2016 1 commit
  25. 07 May, 2016 1 commit
  26. 27 Apr, 2016 2 commits
  27. 25 Apr, 2016 3 commits
  28. 21 Apr, 2016 1 commit
  29. 06 Apr, 2016 1 commit
  30. 30 Mar, 2016 4 commits
  31. 29 Mar, 2016 1 commit
    • Josh Bleecher Snyder's avatar
      cmd/compile: add typArray, typSlice, and typDDDArray · eb98e515
      Josh Bleecher Snyder authored
      These are the first of several convenience
      constructors for types.
      
      They are part of type field encapsulation.
      This removes most external writes to TARRAY Type and Bound fields.
      
      substAny still directly fiddles with the .Type field.
      substAny generally needs access to Type internals.
      It will be moved to type.go in a future CL.
      
      bimport still directly writes the .Type field.
      This is hard to change.
      
      Also of note:
      
      * inl.go contains an (apparently irrelevant) bug fix:
        as.Right was given the wrong type.
        vararrtype was previously unused.
      * I believe that aindex (subr.go) never creates slices,
        but it is safer to keep existing behavior.
        The removal of -1 as a constant there is part
        of hiding that implementation detail.
        Future CLs will finish that job.
      
      Passes toolstash -cmp.
      
      Change-Id: If09bf001a874d7dba08e9ad0bcd6722860af4b91
      Reviewed-on: https://go-review.googlesource.com/21249Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      eb98e515