1. 15 Apr, 2019 10 commits
    • Josh Bleecher Snyder's avatar
      cmd/link: deduplicate pctab info in pclntab · d79aea6b
      Josh Bleecher Snyder authored
      The existing pclntab construction took care to re-use strings:
      filenames and fully qualified function names.
      
      It did not try to deduplicate pctab information,
      perhaps because the author assumed that there
      wouldn't be much duplication.
      
      This change introduces that deduplication.
      The cache gets a 33% hit rate during make.bash.
      
      This doesn't require any changes to the file format,
      and shrinks binaries by about 1%.
      
      Updates #6853
      
      file      before    after     Δ        %       
      go        14659236  14515876  -143360  -0.978% 
      addr2line 4272424   4223272   -49152   -1.150% 
      api       6050808   5993464   -57344   -0.948% 
      asm       4906416   4869552   -36864   -0.751% 
      buildid   2861104   2824240   -36864   -1.288% 
      cgo       4859784   4810632   -49152   -1.011% 
      compile   25749656  25213080  -536576  -2.084% 
      cover     5286952   5229608   -57344   -1.085% 
      dist      3634192   3597328   -36864   -1.014% 
      doc       4691080   4641928   -49152   -1.048% 
      fix       3397960   3361096   -36864   -1.085% 
      link      6113568   6064432   -49136   -0.804% 
      nm        4221928   4172776   -49152   -1.164% 
      objdump   4636600   4587448   -49152   -1.060% 
      pack      2281184   2256608   -24576   -1.077% 
      pprof     14641204  14485556  -155648  -1.063% 
      test2json 2814536   2785864   -28672   -1.019% 
      trace     11602204  11487516  -114688  -0.989% 
      vet       8399528   8313512   -86016   -1.024% 
      
      Change-Id: I59c6aae522700a0d36ddd2cbca6e22ecdf17eea2
      Reviewed-on: https://go-review.googlesource.com/c/go/+/172079
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      d79aea6b
    • Josh Bleecher Snyder's avatar
      cmd/link: clean up pclntab · d3a23874
      Josh Bleecher Snyder authored
      More minor cleanup:
      
      * Code simplification
      * Move variable declaration closer to use
      * Add docs
      * Refactor loop
      
      Change-Id: I6f662cb65038b6ad927eb83757b241ac1ef58943
      Reviewed-on: https://go-review.googlesource.com/c/go/+/172078
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      d3a23874
    • Ian Lance Taylor's avatar
      os: don't treat RemoveAll("/x") as RemoveAll("x") · 3ebd9523
      Ian Lance Taylor authored
      Fixes #31468
      
      Change-Id: I5c4e61631b8af35bfc14b0cb9bc77feec100e340
      Reviewed-on: https://go-review.googlesource.com/c/go/+/172058
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      3ebd9523
    • Udalov Max's avatar
      crypto/sha512: use math/bits.RotateLeft64 instead of ad-hoc implementation · 827044e7
      Udalov Max authored
      This makes code more readable and idiomatic and slightly increase performance.
      
      Updates #31456
      
      Benchstat:
      name          old time/op    new time/op    delta
      Hash8Bytes-8     281ns ± 4%     280ns ± 3%    ~     (p=0.640 n=10+10)
      Hash1K-8        2.01µs ± 6%    2.02µs ± 3%    ~     (p=0.481 n=10+10)
      Hash8K-8        14.2µs ± 6%    13.5µs ± 1%  -4.90%  (p=0.001 n=10+10)
      
      name          old speed      new speed      delta
      Hash8Bytes-8  28.5MB/s ± 4%  28.5MB/s ± 3%    ~     (p=0.516 n=10+10)
      Hash1K-8       510MB/s ± 6%   507MB/s ± 4%    ~     (p=0.481 n=10+10)
      Hash8K-8       576MB/s ± 6%   605MB/s ± 1%  +5.02%  (p=0.001 n=10+10)
      
      Tested on macbook pro 2018 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
      
      Change-Id: I1f5b78096dd49d14ffcb9129142c4a4e05b81ff9
      Reviewed-on: https://go-review.googlesource.com/c/go/+/171736Reviewed-by: default avatarFilippo Valsorda <filippo@golang.org>
      827044e7
    • Robert Griesemer's avatar
      math/big: don't clobber shared underlying array in pow5 computation · f8c6f986
      Robert Griesemer authored
      Rearranged code slightly to make lifetime of underlying array of
      pow5 more explicit in code.
      
      Fixes #31184.
      
      Change-Id: I063081f0e54097c499988d268a23813746592654
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170641Reviewed-by: default avatarFilippo Valsorda <filippo@golang.org>
      f8c6f986
    • Matthew Dempsky's avatar
      cmd/compile: add new escape analysis implementation · 97c4ad43
      Matthew Dempsky authored
      This CL adds a new escape analysis implementation, which can be
      enabled through the -newescape compiler flag.
      
      This implementation focuses on simplicity, but in the process ends up
      using less memory, speeding up some compile-times, fixing memory
      corruption issues, and overall significantly improving escape analysis
      results.
      
      Updates #23109.
      
      Change-Id: I6176d9a7ae9d80adb0208d4112b8a1e1f4c9143a
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170322
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarDavid Chase <drchase@google.com>
      97c4ad43
    • Michael Munday's avatar
      runtime: fix GDB tests on s390x running Ubuntu 18.04 · d91f7e66
      Michael Munday authored
      On Ubuntu 18.04 I am seeing GDB fail to restore the stack pointer
      during this test because stack unwinding can't find the PC. This CL
      is essentially a partial revert of CL 23940 and fixes the issue on
      s390x.
      
      Change-Id: Ib4c41162dc85dc882eb6e248330f4082c3fa94c3
      Reviewed-on: https://go-review.googlesource.com/c/go/+/169857
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      d91f7e66
    • Michael Munday's avatar
      cmd/link, runtime: mark goexit as the top of the call stack · aafe2573
      Michael Munday authored
      This CL adds a new attribute, TOPFRAME, which can be used to mark
      functions that should be treated as being at the top of the call
      stack. The function `runtime.goexit` has been marked this way on
      architectures that use a link register.
      
      This will stop programs that use DWARF to unwind the call stack
      from unwinding past `runtime.goexit` on architectures that use a
      link register. For example, it eliminates "corrupt stack?"
      warnings when generating a backtrace that hits `runtime.goexit`
      in GDB on s390x.
      
      Similar code should be added for non-link-register architectures
      (i.e. amd64, 386). They mark the top of the call stack slightly
      differently to link register architectures so I haven't added
      that code (they need to mark "rip" as undefined).
      
      Fixes #24385.
      
      Change-Id: I15b4c69ac75b491daa0acf0d981cb80eb06488de
      Reviewed-on: https://go-review.googlesource.com/c/go/+/169726
      Run-TryBot: Michael Munday <mike.munday@ibm.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      aafe2573
    • Yuval Pavel Zholkover's avatar
      cmd/dist: enable cgo for freebsd/arm · 0bd101ce
      Yuval Pavel Zholkover authored
      Change-Id: Icc1a54da848bf446919c0d5470d1e79fad339832
      Reviewed-on: https://go-review.googlesource.com/c/go/+/171727Reviewed-by: default avatarTobias Klauser <tobias.klauser@gmail.com>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      0bd101ce
    • Daniel Martí's avatar
      go/token: add IsIdentifier, IsKeyword, and IsExported · 60a8dbf3
      Daniel Martí authored
      Telling whether a string is a valid Go identifier can seem like an easy
      task, but it's easy to forget about the edge cases. For example, some
      implementations out there forget that an empty string or keywords like
      "func" aren't valid identifiers.
      
      Add a simple implementation with proper Unicode support, and start using
      it in cmd/cover and cmd/doc. Other pieces of the standard library
      reimplement part of this logic, but don't use a "func(string) bool"
      signature, so we're leaving them untouched for now.
      
      Add some tests too, to ensure that we actually got these edge cases
      correctly.
      
      Since telling whether a string is a valid identifier requires knowing
      that it's not a valid keyword, add IsKeyword too. The internal map was
      already accessible via Lookup, but "Lookup(str) != IDENT" isn't as easy
      to understand as IsKeyword(str). And, as per Josh's suggestion, we could
      have IsKeyword (and probably Lookup too) use a perfect hash function
      instead of a global map.
      
      Finally, for consistency with these new functions, add IsExported. That
      makes go/ast.IsExported a bit redundant, so perhaps it can be deprecated
      in favor of go/token.IsExported in the future. Clarify that
      token.IsExported doesn't imply token.IsIdentifier, to avoid ambiguity.
      
      Fixes #30064.
      
      Change-Id: I0e0e49215fd7e47b603ebc2b5a44086c51ba57f7
      Reviewed-on: https://go-review.googlesource.com/c/go/+/169018
      Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      Reviewed-by: default avatarAlan Donovan <adonovan@google.com>
      60a8dbf3
  2. 14 Apr, 2019 2 commits
  3. 13 Apr, 2019 5 commits
  4. 12 Apr, 2019 11 commits
  5. 11 Apr, 2019 11 commits
  6. 10 Apr, 2019 1 commit