1. 03 Apr, 2018 3 commits
  2. 02 Apr, 2018 14 commits
    • quasilyte's avatar
      cmd/link/internal/ld: make Thearch unexported · da02dcda
      quasilyte authored
      s/Thearch/thearch/
      
      This reduces the amount of exported global variables,
      which in turn could make it easier to refactor them later.
      
      Also updated somewhat vague comment about ld.Thearch.
      There is no need for Thearch to be exported as Archinit is
      called by ld.Main.
      
      Updates #22095
      
      Change-Id: I266b291f6eac0165f70c51964738206e066cea08
      Reviewed-on: https://go-review.googlesource.com/103878
      Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      da02dcda
    • Matthew Dempsky's avatar
      cmd/compile: simplify exportsym debug message · fac7d5dd
      Matthew Dempsky authored
      No need to disambiguate if we're exporting or reexporting, because
      it's obvious from the output.
      
      Change-Id: I59053d34dc6f8b29e20749c7b03c3cb4f4d641ff
      Reviewed-on: https://go-review.googlesource.com/104236Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
      fac7d5dd
    • Matthew Dempsky's avatar
      cmd/compile: simplify exportsym flags and logic · ce1252a6
      Matthew Dempsky authored
      We used to have three Sym flags for dealing with export/reexport:
      Export, Package, and Exported.
      
      Export and Package were used to distinguish whether a symbol is
      exported or package-scope (i.e., mutually exclusive), except that for
      local declarations Export served double-duty as tracking whether the
      symbol had been added to exportlist.
      
      Meanwhile, imported declarations that needed reexporting could be
      added to exportlist multiple times, necessitating a flag to track
      whether they'd already been written out by exporter.
      
      Simplify all of these into a single OnExportList flag so that we can
      ensure symbols on exportlist are present exactly once. Merge
      reexportsym into exportsym so there's a single place where we append
      to exportlist.
      
      Code that used to set Exported to prevent a symbol from being exported
      can now just set OnExportList before calling declare to prevent it
      from even appearing on exportlist.
      
      Lastly, drop the IsAlias check in exportsym: we call exportsym too
      early for local symbols to detect if they're an alias, and we never
      reexport aliases.
      
      Passes toolstash-check.
      
      Change-Id: Icdea3719105dc169fcd7651606589cd08b0a80ff
      Reviewed-on: https://go-review.googlesource.com/103865
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      ce1252a6
    • Matthew Dempsky's avatar
      cmd/compile: cleanup Order.cleanTempNoPop slightly · 096d9677
      Matthew Dempsky authored
      Passes toolstash-check.
      
      Change-Id: Ia769e719e89e508201711775ea3e2cb3979387fa
      Reviewed-on: https://go-review.googlesource.com/102215
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarDaniel Martí <mvdan@mvdan.cc>
      096d9677
    • Matthew Dempsky's avatar
      cmd/compile: simplify reexport logic · bcc8edfd
      Matthew Dempsky authored
      Currently, we reexport any package-scope constant, function, type, or
      variable declarations needed by an inlineable function body. However,
      now that we have an early pass to walk inlineable function bodies
      (golang.org/cl/74110), we can simplify the logic for finding these
      declarations.
      
      The binary export format supports writing out type declarations
      in-place at their first use. Also, it always writes out constants by
      value, so their declarations never need to be reexported.
      
      Notably, we attempted this before (golang.org/cl/36170) and had to
      revert it (golang.org/cl/45911). However, this was because while
      writing out inline bodies, we could discover variable/function
      dependencies. By collecting variable/function dependencies during
      inlineable function discovery, we avoid this problem.
      
      While here, get rid of isInlineable. We already typecheck inlineable
      function bodies during inlFlood, so it's become a no-op. Just move the
      comment explaining parameter numbering to its caller.
      
      Change-Id: Ibbfaafce793733675d3a2ad98791758583055666
      Reviewed-on: https://go-review.googlesource.com/103864Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
      bcc8edfd
    • Ilya Tocar's avatar
      strings: speed-up replace for byteStringReplacer case · fd22542e
      Ilya Tocar authored
      Use Count instead of loop to determine a number of replacements.
      Also increment index instead of advancing slices, to avoid some extra stores.
      Shows very significant speed-up on html benchmarks:
      
      Escape-6          34.2µs ± 2%  20.8µs ± 2%  -39.06%  (p=0.000 n=10+10)
      EscapeNone-6      7.04µs ± 1%  1.05µs ± 0%  -85.03%  (p=0.000 n=10+10)
      
      On benchmarks in package strings results are still significant:
      
      ByteStringMatch-6    1.59µs ± 2%    1.17µs ± 2%  -26.35%  (p=0.000 n=10+10)
      HTMLEscapeNew-6       390ns ± 2%     337ns ± 2%  -13.62%  (p=0.000 n=10+10)
      HTMLEscapeOld-6       621ns ± 2%     603ns ± 2%   -2.95%  (p=0.000 n=10+9)
      
      Change-Id: Ibea3235b6e451ba72cd5db57716d17b917e72944
      Reviewed-on: https://go-review.googlesource.com/97255
      Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      fd22542e
    • Matthew Dempsky's avatar
      cmd/compile: disable instrumentation for no-race packages earlier · c0841ecd
      Matthew Dempsky authored
      Rather than checking for each function whether the package supports
      instrumentation, check once up front.
      
      Relatedly, tweak the logic for preventing inlining calls to runtime
      functions from instrumented packages. Previously, we simply disallowed
      inlining runtime functions altogether when instrumenting. With this
      CL, it's only disallowed from packages that are actually being
      instrumented. That is, now intra-runtime calls can be inlined.
      
      Updates #19054.
      
      Change-Id: I88c97b48bf70193a8a3ee18d952dcb26b0369d55
      Reviewed-on: https://go-review.googlesource.com/102815
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
      c0841ecd
    • Giovanni Bajo's avatar
      go/types: fix column reporting of invalid selector names · 69032440
      Giovanni Bajo authored
      Fixes #24645
      
      Change-Id: I914674451b6667c3ebaf012893503d9de58991ee
      Reviewed-on: https://go-review.googlesource.com/104155
      Run-TryBot: Giovanni Bajo <rasky@develer.com>
      Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
      69032440
    • Travis Bischel's avatar
      compress/gzip: do not count header bytes written in Write · f1deee0e
      Travis Bischel authored
      Before, if an underlying writer errored within 10 bytes (plus any gzip
      header metadata), a gzip.Write would erroneously report up to 10 bytes
      written that were not actually written of the input slice. This is
      especially problematic when the input slice is less than 10 bytes.
      
      The error came from counting the 10 header byte write. If writing the
      header is completely successful, the 10 bytes written is overridden by
      the flate write with the input slice.
      
      This removes counting the 10 required header bytes, and also changes the
      return to use zero until the slice is used.
      
      The old Write could return one byte written when it actually was not.
      This is difficult to verify because the smallest input slice is one
      byte; a test checking that the input slice was the byte written would be
      quite involved. Thankfully, gzip's minimum header write is 10 bytes. If
      we test that two bytes are not falsely written, we indirectly cover the
      one byte case.
      
      Fixes #24625
      
      Change-Id: I1c1f8cd791e0c4cffc22aa8acd95186582c832ba
      Reviewed-on: https://go-review.googlesource.com/103861Reviewed-by: 's avatarJoe Tsai <joetsai@google.com>
      Run-TryBot: Joe Tsai <joetsai@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      f1deee0e
    • isharipo's avatar
      test/fixedbugs: fix bug248 and bug345 · b44e73ea
      isharipo authored
      When test/run script was removed, these two tests
      were changed to be executed by test/run.go.
      Because errchk does not exit with non-zero status on
      errors, they were silently failing for a while.
      
      This change makes 2 things:
      
      1. Compile tested packages in GOROOT/test to match older runner script
         behavior (strictly required only in bug345, optional in bug248)
      
      2. Check command output with "(?m)^BUG" regexp.
         It approximates older `grep -q '^BUG' that was used before.
      
      See referenced issue for detailed explanation.
      
      Fixes #24629
      
      Change-Id: Ie888dcdb4e25cdbb19d434bbc5cb03eb633e9ee8
      Reviewed-on: https://go-review.googlesource.com/104095
      Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com>
      Reviewed-by: 's avatarEmmanuel Odeke <emm.odeke@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      b44e73ea
    • Matthew Dempsky's avatar
      cmd/compile: use newfuncname in dclfunc · 45ce10fa
      Matthew Dempsky authored
      Eliminates an inconsistency between user functions and generated
      functions.
      
      Passes toolstash-check.
      
      Change-Id: I946b511ca81d88a0024b5932cb50f3d8b9e808f4
      Reviewed-on: https://go-review.googlesource.com/103863
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
      45ce10fa
    • Meng Zhuo's avatar
      crypto/md5: add assembly implementation on arm64 · b834cd9a
      Meng Zhuo authored
      This change improves the performance of the block
      function used within crypto/md5 on arm64.  The following
      improvement was seen:
      
      name                 old time/op    new time/op     delta
      Hash8Bytes             1.62µs ± 0%     0.85µs ± 0%  -47.83%  (p=0.000 n=8+10)
      Hash1K                 8.82µs ± 0%     7.10µs ± 3%  -19.52%  (p=0.000 n=10+10)
      Hash8K                 59.5µs ± 2%     50.2µs ± 0%  -15.63%  (p=0.000 n=9+10)
      Hash8BytesUnaligned    1.63µs ± 0%     0.85µs ± 0%  -47.92%  (p=0.000 n=9+10)
      Hash1KUnaligned        14.1µs ± 0%      7.4µs ± 0%  -47.45%  (p=0.000 n=9+10)
      Hash8KUnaligned         101µs ± 0%       53µs ± 0%  -47.57%  (p=0.000 n=10+10)
      
      name                 old speed      new speed       delta
      Hash8Bytes           4.93MB/s ± 0%   9.44MB/s ± 0%  +91.61%  (p=0.000 n=9+10)
      Hash1K                116MB/s ± 0%    144MB/s ± 3%  +24.28%  (p=0.000 n=10+10)
      Hash8K                138MB/s ± 2%    163MB/s ± 0%  +18.52%  (p=0.000 n=9+10)
      Hash8BytesUnaligned  4.92MB/s ± 0%   9.44MB/s ± 0%  +92.04%  (p=0.000 n=9+10)
      Hash1KUnaligned      72.8MB/s ± 0%  138.6MB/s ± 0%  +90.29%  (p=0.000 n=9+8)
      Hash8KUnaligned      80.9MB/s ± 0%  154.2MB/s ± 0%  +90.71%  (p=0.000 n=10+10)
      
      Change-Id: I9e121a3132ff1b59e30f2de64e46106269065ecd
      Reviewed-on: https://go-review.googlesource.com/101875Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
      b834cd9a
    • Daniel Martí's avatar
      cmd: remove some unused parameters · 27226504
      Daniel Martí authored
      Change-Id: I9d2a4b8df324897e264d30801e95ddc0f0e75f3a
      Reviewed-on: https://go-review.googlesource.com/102337
      Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarIlya Tocar <ilya.tocar@intel.com>
      27226504
    • Matthew Dempsky's avatar
      cmd/compile: refactor constant rewriting · 0250ef91
      Matthew Dempsky authored
      Extract all rewrite-to-OLITERAL expressions to use a single setconst
      helper function.
      
      Does not pass toolstash-check for two reasons:
      
      1) We now consistently clear Left/Right/etc when rewriting Nodes into
      OLITERALs, which results in their inlining complexity being correctly
      computed. So more functions can now be inlined.
      
      2) We preserve Pos, so PC line tables change somewhat.
      
      Change-Id: I2b5c293bee7c69c2ccd704677f5aba4ec40e3155
      Reviewed-on: https://go-review.googlesource.com/103860
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarDaniel Martí <mvdan@mvdan.cc>
      0250ef91
  3. 01 Apr, 2018 5 commits
  4. 31 Mar, 2018 5 commits
  5. 30 Mar, 2018 13 commits