1. 28 Aug, 2017 21 commits
  2. 27 Aug, 2017 1 commit
  3. 26 Aug, 2017 2 commits
  4. 25 Aug, 2017 16 commits
    • Joe Tsai's avatar
      archive/tar: improve package documentation · bad6b6fa
      Joe Tsai authored
      Many aspects of the package is woefully undocumented.
      With the recent flurry of improvements, the package is now at feature
      parity with the GNU and TAR tools. Thoroughly all of the public API
      and perform some minor stylistic cleanup in some code segments.
      
      Change-Id: Ic892fd72c587f30dfe91d1b25b88c9c8048cc389
      Reviewed-on: https://go-review.googlesource.com/59210
      Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      bad6b6fa
    • Joe Tsai's avatar
      archive/tar: add raw support for global PAX records · 19a99594
      Joe Tsai authored
      The PAX specification says the following:
      <<<
      'g' represents global extended header records for the following files in the archive.
      The format of these extended header records shall be as described in pax Extended Header.
      Each value shall affect all subsequent files that do not override that value
      in their own extended header record and until another global extended header record
      is reached that provides another value for the same field.
      >>>
      
      This CL adds support for parsing and composing global PAX records,
      but intentionally does not provide support for automatically
      persisting the global state across files.
      
      Changes made:
      * When Reader encounters a TypeXGlobalRecord header, it parses the
      PAX records and returns them to the user ad-verbatim. Reader does not
      store them in its state, ensuring it has no effect on future Next calls.
      * When Writer receives a TypeXGlobalRecord header, it writes the
      PAX records to the archive ad-verbatim. It does not store them in
      its state, ensuring it has no effect on future WriteHeader calls.
      * The restriction regarding empty record values is lifted since this
      value is used to represent deletion in global headers.
      
      Why provide raw support only:
      * Some archives in the wild have a global header section (often empty)
      and it is the user's responsibility to manually read and discard it's body.
      The logic added here allows users to more easily skip over these sections.
      * For users that do care about global headers, having access to the raw
      records allows them to implement the functionality of global headers themselves
      and manually persist the global state across files.
      * We can still upgrade to a full implementation in the future.
      
      Why we don't provide full support:
      * Even though the PAX specification describes their operation in detail,
      both the GNU and BSD tar tools (which are the most common implementations)
      do not have a consistent interpretation of many details.
      * Global headers were a controversial feature in PAX, by admission of the
      specification itself:
        <<<
        The concept of a global extended header (typeflag g) was controversial.
      
        The typeflag g global headers should not be used with interchange media that
        could suffer partial data loss in transporting the archive.
        >>>
      * Having state persist from entry-to-entry complicates the implementation
      for a feature that is not widely used and not well supported.
      
      Change-Id: I1d904cacc2623ddcaa91525a5470b7dbe226c7e8
      Reviewed-on: https://go-review.googlesource.com/59190Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
      19a99594
    • Hiroshi Ioka's avatar
      cmd/link: fix debug message · 37b04c90
      Hiroshi Ioka authored
      Change-Id: I6cb0ed9b726da34106ba239b57e2da732a8e1b71
      Reviewed-on: https://go-review.googlesource.com/50730Reviewed-by: default avatarMichael Hudson-Doyle <michael.hudson@canonical.com>
      Reviewed-by: default avatarAvelino <t@avelino.xxx>
      37b04c90
    • Daniel Martí's avatar
      testing: error if -parallel is given N<1 · 86dde2de
      Daniel Martí authored
      Otherwise, if there are any parallel tests, it will hang and panic with
      "all goroutines are asleep - deadlock!".
      
      Do not use flag.Uint to handle the error for us because we also want to
      error on N==0, and because it would make setting the default to
      GOMAXPROCS(0) more difficult, since it's an int.
      
      Check for it right after flag.Parse, and mimic flag errors by printing
      the usage and returning exit code 2.
      
      Fixes #20542.
      
      Change-Id: I0c9d4587f83d406a8f5e42ed74e40be46d639ffb
      Reviewed-on: https://go-review.googlesource.com/54150
      Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      86dde2de
    • Meir Fischer's avatar
      testing: ensure profiles are written upon -timeout panic · 7e455b62
      Meir Fischer authored
      This addresses the case of a -timeout panic, but not the more
      general case of a signal arriving. See CL 48370 and CL 44352
      for recent difficulties in that area.
      
      "-timeout" here means flag usage to distinguish from the
      default timeout termination which uses signals.
      
      Fixes #19394
      
      Change-Id: I5452d5422c0c080e940cbcc8c6606049975268c6
      Reviewed-on: https://go-review.googlesource.com/48491Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      7e455b62
    • Artyom Pervukhin's avatar
      crypto/tls: fix docstring of Config.ClientSessionCache · 85deaf60
      Artyom Pervukhin authored
      Closes #21519
      
      Change-Id: I1247e9435de93aae7e4db2b6e8e5be1b010c296b
      Reviewed-on: https://go-review.googlesource.com/56832Reviewed-by: default avatarAvelino <t@avelino.xxx>
      Reviewed-by: default avatarAdam Langley <agl@golang.org>
      85deaf60
    • Joe Tsai's avatar
      archive/tar: support arbitrary PAX records · a795ca51
      Joe Tsai authored
      This CL adds the following new publicly visible API:
      	type Header struct { ...; PAXRecords map[string]string }
      
      The new Header.PAXRecords field is a map of all PAX extended header records.
      
      We suggest (but do not enforce) that users use VENDOR-prefixed keys
      according to the following in the PAX specification:
      <<<
      The standard developers have reserved keyword name space for vendor extensions.
      It is suggested that the format to be used is:
      	VENDOR.keyword
      where VENDOR is the name of the vendor or organization in all uppercase letters.
      >>>
      
      When reading, the Header.PAXRecords is populated with all PAX records
      encountered so far, including basic ones (e.g., "path", "mtime", etc).
      When writing, the fields of Header will be merged into PAXRecords,
      overwriting any records that may conflict.
      
      Since PAXRecords is a more expressive feature than Xattrs and
      is entirely a superset of Xattrs, we mark Xattrs as deprecated,
      and steer users towards the new PAXRecords API.
      
      The issue has a discussion about adding a Header.SetPAXRecord method
      to help validate records and keep the Header fields in sync.
      However, we do not include that in this CL since that helper
      method can always be added in the future.
      
      There is no support for global records.
      
      Fixes #14472
      
      Change-Id: If285a52749acc733476cf75a2c7ad15bc1542071
      Reviewed-on: https://go-review.googlesource.com/58390
      Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      a795ca51
    • Joe Tsai's avatar
      go/build: add go1.10 build tag · 4d6da864
      Joe Tsai authored
      Add this early in the cycle so that we can start regression testing
      of the master toolchain.
      
      Change-Id: Ida3ccad6e9642648f489babd12877fc8a5eca07a
      Reviewed-on: https://go-review.googlesource.com/59151Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      4d6da864
    • Ian Lance Taylor's avatar
      runtime: unify sigTabT type across Unix systems · 6126384f
      Ian Lance Taylor authored
      Change-Id: I8e8a3a118b1216f191c9076b70a88f6f3f19f79f
      Reviewed-on: https://go-review.googlesource.com/59150
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      6126384f
    • Borja Clemente's avatar
      bytes: Add missing examples to functions · 394f6a5a
      Borja Clemente authored
      Fixes #21570
      
      Change-Id: Ia0734929a04fbce8fdd5fbcb1b7baff9a8bbe39e
      Reviewed-on: https://go-review.googlesource.com/58030Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      Reviewed-by: default avatarJoe Tsai <thebrokentoaster@gmail.com>
      Run-TryBot: Robert Griesemer <gri@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      394f6a5a
    • Tom Levy's avatar
      sort: fix mix-up between "!less" and "greater" in examples · 2bba2671
      Tom Levy authored
      If Less(a, b) returns true when a is less than b, the correct way to
      check if a is greater than b is to use Less(b, a). It is wrong to use
      !Less(a, b) because that checks if a is greater than *or equal to* b.
      
      1. The decreasingDistance function in Example_sortKeys makes this
         mistake. Fix it.
      
      2. The documentation of multiSorter.Less says it loops along the less
         functions until it finds a comparison "that is either Less or
         !Less". This is nonsense, because (Less(a, b) or !Less(a, b)) is
         always true. Fix the documentation to say that it finds a
         comparison "that discriminates between the two items (one is less
         than the other)". The implementation already does this correctly.
      
      Change-Id: If52b79f68e4fdb0d1095edf29bdecdf154a61b8d
      Reviewed-on: https://go-review.googlesource.com/57752Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      2bba2671
    • fanzha02's avatar
      cmd/internal/obj/arm64: fix assemble fcsels/fcseld bug · aea286b4
      fanzha02 authored
      The current code treats the type of SIMD&FP register as C_REG incorrectly.
      
      The fix code converts C_REG type into C_FREG type.
      
      Uncomment fcsels/fcseld test cases.
      
      Fixes #21582
      Change-Id: I754c51f72a0418bd352cbc0f7740f14cc599c72d
      Reviewed-on: https://go-review.googlesource.com/58350Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      aea286b4
    • Heschi Kreinick's avatar
      cmd/compile: bug fixes for DWARF location lists · 38bd725b
      Heschi Kreinick authored
      Fix two small but serious bugs in the DWARF location list code that
      should have been caught by the automated tests I didn't write.
      
      After emitting debug information for a user variable, mark it as done
      so that it doesn't get emitted again. Otherwise it would be written once
      per slot it was decomposed into.
      
      Correct a merge error in CL 44350: the location list abbreviations need
      to have DW_AT_decl_line too, otherwise the resulting DWARF is gibberish.
      
      Change-Id: I6ab4b8b32b7870981dac80eadf0ebfc4015ccb01
      Reviewed-on: https://go-review.googlesource.com/59070
      Run-TryBot: Heschi Kreinick <heschi@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarDavid Chase <drchase@google.com>
      38bd725b
    • jaredculp's avatar
      math: add examples for trig functions · dc42ffff
      jaredculp authored
      Change-Id: Ic3ce2f3c055f2636ec8fc9cec8592e596b18dc05
      Reviewed-on: https://go-review.googlesource.com/54771
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      dc42ffff
    • Wei Xiao's avatar
      cmd/compile: memory clearing optimization for arm64 · c02fc160
      Wei Xiao authored
      Use "STP (ZR, ZR), O(R)" instead of "MOVD ZR, O(R)" to implement memory clearing.
      Also improve assembler supports to STP/LDP.
      Results (A57@2GHzx8):
      
      benchmark                   old ns/op     new ns/op     delta
      BenchmarkClearFat8-8        1.00          1.00          +0.00%
      BenchmarkClearFat12-8       1.01          1.01          +0.00%
      BenchmarkClearFat16-8       1.01          1.01          +0.00%
      BenchmarkClearFat24-8       1.52          1.52          +0.00%
      BenchmarkClearFat32-8       3.00          2.02          -32.67%
      BenchmarkClearFat40-8       3.50          2.52          -28.00%
      BenchmarkClearFat48-8       3.50          3.03          -13.43%
      BenchmarkClearFat56-8       4.00          3.50          -12.50%
      BenchmarkClearFat64-8       4.25          4.00          -5.88%
      BenchmarkClearFat128-8      8.01          8.01          +0.00%
      BenchmarkClearFat256-8      16.1          16.0          -0.62%
      BenchmarkClearFat512-8      32.1          32.0          -0.31%
      BenchmarkClearFat1024-8     64.1          64.1          +0.00%
      
      Change-Id: Ie5f5eac271ff685884775005825f206167a5c146
      Reviewed-on: https://go-review.googlesource.com/55610
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      c02fc160
    • Ilya Tocar's avatar
      cmd/compile/internal/ssa: combine consecutive loads and stores on amd64 · 9c99512d
      Ilya Tocar authored
      Sometimes (often for calls) we generate code like this:
      
      MOVQ  (addr),AX
      MOVQ  8(addr),BX
      MOVQ  AX,(otheraddr)
      MOVQ  BX,8(otheraddr)
      
      Replace it with
      
      MOVUPS (addr),X0
      MOVUPS X0,(otheraddr)
      
      For completeness do the same for 8,16,32-bit loads/stores too.
      Shaves 1% from code sections of go tool.
      
      /localdisk/itocar/golang/bin/go 10293917
      go_old 10334877 [40960 bytes]
      
      read-only data = 682 bytes (0.040769%)
      global text (code) = 38961 bytes (1.036503%)
      Total difference 39643 bytes (0.674628%)
      
      Updates #6853
      
      Change-Id: I1f0d2f60273a63a079b58927cd1c4e3429d2e7ae
      Reviewed-on: https://go-review.googlesource.com/57130
      Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      9c99512d