1. 14 Mar, 2016 2 commits
  2. 13 Mar, 2016 10 commits
  3. 12 Mar, 2016 13 commits
  4. 11 Mar, 2016 15 commits
    • Matthew Dempsky's avatar
      cmd/compile: move universe block code into new universe.go · 9d7b2b7b
      Matthew Dempsky authored
      Move lexinit, typeinit, lexinit1, and lexfini into new universe.go
      file, and give them a more idiomatic and descriptive API. No code
      changes.
      
      Change-Id: I0e9b25dcc86ad10f4b990dc02bd33477b488cc85
      Reviewed-on: https://go-review.googlesource.com/20604Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
      9d7b2b7b
    • Robert Griesemer's avatar
      cmd/compile: move lexn and lexname into lex.go (cleanup) · 76461c93
      Robert Griesemer authored
      Missed these two declarations in the previous cleanup.
      
      Change-Id: I54ff3accd387dd90e12847daccf4477169797f81
      Reviewed-on: https://go-review.googlesource.com/20603
      Run-TryBot: Robert Griesemer <gri@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      76461c93
    • Robert Griesemer's avatar
      cmd/compile: move lexer into separate file (cleanup) · 998b6dd7
      Robert Griesemer authored
      This is really moving all the non-lexer pieces out of lex.go
      into main.go. It's always been confusing that the top-most
      compiler entry point (Main) is in the same file with the
      lexer. Both files remain of substantial size (> 1000 lines),
      which justifies this even more.
      
      No other changes.
      
      Change-Id: I03895589d5e3cc2340580350bbc1420539893dfc
      Reviewed-on: https://go-review.googlesource.com/20601
      Run-TryBot: Robert Griesemer <gri@golang.org>
      Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      998b6dd7
    • Robert Griesemer's avatar
      cmd/compile: simplify lexer.ungetr · e78ff382
      Robert Griesemer authored
      Change-Id: Id041c1b2d364aecd7a6613a53237f7de2c650a7e
      Reviewed-on: https://go-review.googlesource.com/20599
      Run-TryBot: Robert Griesemer <gri@golang.org>
      Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      e78ff382
    • David Crawshaw's avatar
      cmd/link: treat reflect.Value.Method like Call · e2836935
      David Crawshaw authored
      Fixes #14740
      
      Change-Id: Iad8d971c21977b0a1f4ef55a08bb180a8125e976
      Reviewed-on: https://go-review.googlesource.com/20562Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: David Crawshaw <crawshaw@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      e2836935
    • David Crawshaw's avatar
      cmd/compile: use bufio.Reader directly in lexer · 5aa5db75
      David Crawshaw authored
      Removes an intermediate layer of functions that was clogging up a
      corner of the compiler's profile graph.
      
      I can't measure a performance improvement running a large build
      like jujud, but the profile reports less total time spent in
      gc.(*lexer).getr.
      
      Change-Id: I3000585cfcb0f9729d3a3859e9023690a6528591
      Reviewed-on: https://go-review.googlesource.com/20565Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
      Run-TryBot: David Crawshaw <crawshaw@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      5aa5db75
    • David Crawshaw's avatar
      cmd/compile: track reflect.Type.Method in deadcode · cc158403
      David Crawshaw authored
      In addition to reflect.Value.Call, exported methods can be invoked
      by the Func value in the reflect.Method struct. This CL has the
      compiler track what functions get access to a legitimate reflect.Method
      struct by looking for interface calls to either of:
      
      	Method(int) reflect.Method
      	MethodByName(string) (reflect.Method, bool)
      
      This is a little overly conservative. If a user implements a type
      with one of these methods without using the underlying calls on
      reflect.Type, the linker will assume the worst and include all
      exported methods. But it's cheap.
      
      No change to any of the binary sizes reported in cl/20483.
      
      For #14740
      
      Change-Id: Ie17786395d0453ce0384d8b240ecb043b7726137
      Reviewed-on: https://go-review.googlesource.com/20489Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
      cc158403
    • Josh Bleecher Snyder's avatar
      cmd/compile: improve go.importpath.* docs · 4112f0f7
      Josh Bleecher Snyder authored
      While we're here, remove a bit of dead code.
      
      Change-Id: I1344bb41e5d368825ca5748189382f9e7023c59a
      Reviewed-on: https://go-review.googlesource.com/20596
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      4112f0f7
    • Josh Bleecher Snyder's avatar
      cmd/link: tidy up rdsym · 2ac8555d
      Josh Bleecher Snyder authored
      Use an early return. Check errors. Deduplicate.
      
      Change-Id: Iabefd563b5ef82a16fab4791277630804fd09003
      Reviewed-on: https://go-review.googlesource.com/20597
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      2ac8555d
    • Matthew Dempsky's avatar
      cmd/compile: eliminate uses of Type.Down in bexport.go · de4317cb
      Matthew Dempsky authored
      Change-Id: I298b9d389ac33a24365f4c06a122c3af989906c0
      Reviewed-on: https://go-review.googlesource.com/20594
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
      de4317cb
    • Matthew Dempsky's avatar
      cmd/compile: sort interface methods in tointerface0 · d9bb6939
      Matthew Dempsky authored
      Might as well sort them while they're still in a slice.
      
      Change-Id: I40c25ddc5c054dcb4da2aeefa79947967609d599
      Reviewed-on: https://go-review.googlesource.com/20591
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      d9bb6939
    • Klaus Post's avatar
      compress/flate: optimize huffman bit encoder · 53984e5b
      Klaus Post authored
      Part 1 of optimizing the deflater. This optimizes the bitwriter by:
      
      * Removing allocations.
      * Storing compound values for bit codes instead of 2 separate tables.
      * Accumulate 48 bits between writes instead of 24.
      * Inline bit flushing.
      
      This also contains code that will be used in later CL's
      (writeBlockDynamic, writeBlockHuff).
      
      Tests for Huffman bit writer encoding regressions has been added.
      
      name                       old speed      new speed      delta
      EncodeDigitsSpeed1e4-4     19.3MB/s ± 1%  21.6MB/s ± 1%  +11.77%
      EncodeDigitsSpeed1e5-4     25.0MB/s ± 6%  30.7MB/s ± 1%  +22.70%
      EncodeDigitsSpeed1e6-4     28.2MB/s ± 1%  32.3MB/s ± 1%  +14.64%
      EncodeDigitsDefault1e4-4   13.3MB/s ± 0%  14.2MB/s ± 1%   +7.07%
      EncodeDigitsDefault1e5-4   6.43MB/s ± 1%  6.64MB/s ± 1%   +3.27%
      EncodeDigitsDefault1e6-4   5.81MB/s ± 0%  5.85MB/s ± 1%   +0.69%
      EncodeDigitsCompress1e4-4  13.2MB/s ± 0%  14.4MB/s ± 0%   +9.10%
      EncodeDigitsCompress1e5-4  6.40MB/s ± 1%  6.61MB/s ± 0%   +3.20%
      EncodeDigitsCompress1e6-4  5.80MB/s ± 1%  5.90MB/s ± 1%   +1.64%
      EncodeTwainSpeed1e4-4      18.4MB/s ± 1%  20.7MB/s ± 1%  +12.72%
      EncodeTwainSpeed1e5-4      27.7MB/s ± 1%  31.0MB/s ± 1%  +11.78%
      EncodeTwainSpeed1e6-4      29.1MB/s ± 0%  32.9MB/s ± 2%  +13.25%
      EncodeTwainDefault1e4-4    12.4MB/s ± 0%  13.1MB/s ± 1%   +5.88%
      EncodeTwainDefault1e5-4    7.52MB/s ± 1%  7.83MB/s ± 0%   +4.19%
      EncodeTwainDefault1e6-4    7.08MB/s ± 1%  7.26MB/s ± 0%   +2.54%
      EncodeTwainCompress1e4-4   12.0MB/s ± 1%  12.8MB/s ± 1%   +6.70%
      EncodeTwainCompress1e5-4   5.96MB/s ± 1%  6.16MB/s ± 0%   +3.27%
      EncodeTwainCompress1e6-4   5.37MB/s ± 0%  5.39MB/s ± 1%   +0.47%
      
      >Allocations:
      
      benchmark                              old allocs     new allocs     delta
      BenchmarkEncodeDigitsSpeed1e4-4        50             0              -100.00%
      BenchmarkEncodeDigitsSpeed1e5-4        110            0              -100.00%
      BenchmarkEncodeDigitsSpeed1e6-4        1032           0              -100.00%
      BenchmarkEncodeDigitsDefault1e4-4      56             0              -100.00%
      BenchmarkEncodeDigitsDefault1e5-4      120            0              -100.00%
      BenchmarkEncodeDigitsDefault1e6-4      966            0              -100.00%
      BenchmarkEncodeDigitsCompress1e4-4     56             0              -100.00%
      BenchmarkEncodeDigitsCompress1e5-4     120            0              -100.00%
      BenchmarkEncodeDigitsCompress1e6-4     966            0              -100.00%
      BenchmarkEncodeTwainSpeed1e4-4         58             0              -100.00%
      BenchmarkEncodeTwainSpeed1e5-4         132            0              -100.00%
      BenchmarkEncodeTwainSpeed1e6-4         1082           0              -100.00%
      BenchmarkEncodeTwainDefault1e4-4       52             0              -100.00%
      BenchmarkEncodeTwainDefault1e5-4       126            0              -100.00%
      BenchmarkEncodeTwainDefault1e6-4       886            0              -100.00%
      BenchmarkEncodeTwainCompress1e4-4      52             0              -100.00%
      BenchmarkEncodeTwainCompress1e5-4      120            0              -100.00%
      BenchmarkEncodeTwainCompress1e6-4      880            0              -100.00%
      
      benchmark                              old bytes     new bytes     delta
      BenchmarkEncodeDigitsSpeed1e4-4        4288          2             -99.95%
      BenchmarkEncodeDigitsSpeed1e5-4        8896          15            -99.83%
      BenchmarkEncodeDigitsSpeed1e6-4        84098         153           -99.82%
      BenchmarkEncodeDigitsDefault1e4-4      4480          3             -99.93%
      BenchmarkEncodeDigitsDefault1e5-4      9216          76            -99.18%
      BenchmarkEncodeDigitsDefault1e6-4      73920         768           -98.96%
      BenchmarkEncodeDigitsCompress1e4-4     4480          3             -99.93%
      BenchmarkEncodeDigitsCompress1e5-4     9216          76            -99.18%
      BenchmarkEncodeDigitsCompress1e6-4     73920         768           -98.96%
      BenchmarkEncodeTwainSpeed1e4-4         4544          2             -99.96%
      BenchmarkEncodeTwainSpeed1e5-4         9600          15            -99.84%
      BenchmarkEncodeTwainSpeed1e6-4         77633         153           -99.80%
      BenchmarkEncodeTwainDefault1e4-4       4352          3             -99.93%
      BenchmarkEncodeTwainDefault1e5-4       9408          76            -99.19%
      BenchmarkEncodeTwainDefault1e6-4       65984         768           -98.84%
      BenchmarkEncodeTwainCompress1e4-4      4352          3             -99.93%
      BenchmarkEncodeTwainCompress1e5-4      9216          76            -99.18%
      BenchmarkEncodeTwainCompress1e6-4      65792         768           -98.83%
      
      Updates #14258
      
      Change-Id: Ibaa97b9619743ad623094727228eb2ada1ec7f1f
      Reviewed-on: https://go-review.googlesource.com/19336Reviewed-by: 's avatarNigel Tao <nigeltao@golang.org>
      Reviewed-by: 's avatarJoe Tsai <joetsai@digital-static.net>
      Run-TryBot: Joe Tsai <joetsai@digital-static.net>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      53984e5b
    • Klaus Post's avatar
      compress/flate: test if results are deterministic · afdb8cff
      Klaus Post authored
      This will test if deflate output is deterministic between two runs
      of the deflater, when write sizes differ.
      
      The deflater makes no official promises that results are
      deterministic between runs, but this is a good test to determine
      unintentional randomness.
      
      Note that this does not guarantee that results are deterministic
      across platforms nor that results will be deterministic between
      Go versions. This is also not guarantees we should imply.
      
      Change-Id: Id7dd89fe276060fd83a43d0b34ac35d50fcd32d9
      Reviewed-on: https://go-review.googlesource.com/20573Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      afdb8cff
    • Michael Munday's avatar
      cmd/internal/obj: fix nil pointer dereference in Dconv · d05773ce
      Michael Munday authored
      p can be nil in Dconv so we need to do a check before dereferencing
      it. Fixes a problem I was having running toolstash.
      
      Change-Id: I34d6d278b319583d8454c2342ac88e054fc4b641
      Reviewed-on: https://go-review.googlesource.com/20595Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
      Run-TryBot: David Crawshaw <crawshaw@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      d05773ce
    • Matthew Dempsky's avatar
      cmd/compile: move InitPlan and InitEntry into sinit.go · f973e79d
      Matthew Dempsky authored
      I don't know what they're used for, but that's the only file they're
      referenced in.
      
      Change-Id: Ie39d7d4621e2d5224408243b5789597ca0dc14be
      Reviewed-on: https://go-review.googlesource.com/20593Reviewed-by: 's avatarDave Cheney <dave@cheney.net>
      f973e79d