1. 30 Apr, 2019 12 commits
    • Joshua M. Clulow's avatar
      all: add new GOOS=illumos, split out of GOOS=solaris · f686a289
      Joshua M. Clulow authored
      Like GOOS=android which implies the "linux" build tag, GOOS=illumos
      implies the "solaris" build tag. This lets the existing ecosystem of
      packages still work on illumos, but still permits packages to start
      differentiating between solaris and illumos.
      
      Fixes #20603
      
      Change-Id: I8f4eabf1a66060538dca15d7658c1fbc6c826622
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174457
      Run-TryBot: Benny Siegert <bsiegert@gmail.com>
      Reviewed-by: default avatarBenny Siegert <bsiegert@gmail.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      f686a289
    • Clément Chigot's avatar
      cmd/link: add .go.buildinfo in XCOFF symbol table · 0c9e0c25
      Clément Chigot authored
      .go.buildinfo must be added to the symbol table on AIX. Otherwise, ld
      won't be able to handle its relocations.
      
      This patch also make ".data" the default section for all symbols inside
      the data segment.
      
      Change-Id: I83ac2bf1050e0ef6ef9c96ff793efd4ddc8e98d7
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174298
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      0c9e0c25
    • Elias Naur's avatar
      runtime: implement pthread functions for darwin/arm64 · 9f12e2e0
      Elias Naur authored
      They were not needed when Go only produced binaries with cgo suppport.
      Now that Go is about to run self-hosted on iOS we do need these.
      
      Updates #31722
      
      Change-Id: If233aa2b31edc7b1c2dcac68974f9fba0604f9a3
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174300
      Run-TryBot: Elias Naur <mail@eliasnaur.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      9f12e2e0
    • Brad Fitzpatrick's avatar
      cmd/dist: disable cgo for darwin/386 · e0ac75d2
      Brad Fitzpatrick authored
      Fixes #31751
      
      Change-Id: Id002f14557a34accc3597cb1b9a42e838a027da4
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174497Reviewed-by: default avatarKeith Randall <khr@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      e0ac75d2
    • Romain Baugue's avatar
      html: add a Fuzz function · 4ad13555
      Romain Baugue authored
      Adds a sample Fuzz test function to package html based on
      https://github.com/dvyukov/go-fuzz-corpus/blob/master/stdhtml/main.go
      
      Updates #19109
      Updates #31309
      
      Change-Id: I8c49fff8f70fc8a8813daf1abf0044752003adbb
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174301Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      4ad13555
    • Tyler Bui-Palsulich's avatar
      cmd/go: say to confirm import path when it's not found · 12aec551
      Tyler Bui-Palsulich authored
      Fixes #31366.
      
      Change-Id: Ief26f53e7fe94bedb7db79d3d7130c4cdcec4281
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174179
      Run-TryBot: Jay Conrod <jayconrod@google.com>
      Reviewed-by: default avatarJay Conrod <jayconrod@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      12aec551
    • Romain Baugue's avatar
      encoding/csv: add a Fuzz function · 858064fb
      Romain Baugue authored
      Adds a sample Fuzz test function to package encoding/csv based on
      https://github.com/dvyukov/go-fuzz-corpus/blob/master/csv/main.go
      
      Updates #19109
      Updates #31309
      
      Change-Id: Ieb0cb6caa1df72dbb7e29df4bdeed0bfa91187d3
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174302Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      858064fb
    • Russ Cox's avatar
      cmd/go/internal/modfetch: fix concurrent read/write race in modfetch · 8e28cd19
      Russ Cox authored
      On Windows systems, the failure rate for cmd/go's TestScript/mod_concurrent
      is somewhere around 3-10% without this change. With the change, I have yet
      to see a failure.
      
      Fixes #31744.
      
      Change-Id: Ib321ebb9556dd8438086cf329dfa083a9e051732
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174439
      Run-TryBot: Russ Cox <rsc@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      8e28cd19
    • Richard Musiol's avatar
      cmd/internal/obj/wasm: cache SP in a local · 203e1888
      Richard Musiol authored
      We use Wasm global variables extensively for simulating
      registers, especially SP. V8 does not handle global variables
      efficiently.
      
      This CL reduces global variable accesses by caching the global SP
      in a local variable in each function. The local cache is set on
      function entry and updated after each call (where the stack could
      have moved). Within a function, the SP access will use the local
      variable.
      
      Supersedes https://golang.org/cl/173979.
      
      Running on Chrome Version 73.0.3683.103 on darwin/amd64:
      
      name                   old time/op    new time/op     delta
      BinaryTree17              15.3s ± 2%      14.5s ± 3%   -5.20%  (p=0.000 n=9+10)
      Fannkuch11                8.91s ± 2%      9.48s ± 2%   +6.41%  (p=0.000 n=9+10)
      FmtFprintfEmpty           197ns ± 5%      165ns ± 3%  -16.09%  (p=0.000 n=9+8)
      FmtFprintfString          354ns ± 8%      325ns ± 7%   -8.33%  (p=0.001 n=10+10)
      FmtFprintfInt             400ns ± 4%      368ns ± 6%   -8.01%  (p=0.000 n=10+10)
      FmtFprintfIntInt          618ns ± 3%      587ns ± 6%   -4.97%  (p=0.001 n=10+10)
      FmtFprintfPrefixedInt     637ns ± 4%      606ns ± 4%   -4.88%  (p=0.000 n=10+10)
      FmtFprintfFloat           965ns ± 7%      898ns ± 4%   -6.97%  (p=0.000 n=10+10)
      FmtManyArgs              2.34µs ± 1%     2.24µs ± 3%   -4.40%  (p=0.000 n=9+10)
      GobDecode                29.8ms ± 3%     28.8ms ± 6%   -3.60%  (p=0.006 n=9+10)
      GobEncode                20.5ms ± 8%     17.6ms ± 3%  -14.32%  (p=0.000 n=10+10)
      Gzip                      714ms ± 3%      718ms ± 8%     ~     (p=0.971 n=10+10)
      Gunzip                    148ms ± 3%      136ms ± 3%   -7.99%  (p=0.000 n=10+9)
      HTTPClientServer          219µs ± 3%      215µs ± 4%     ~     (p=0.190 n=10+10)
      JSONEncode               35.1ms ± 2%     31.8ms ±13%   -9.52%  (p=0.002 n=10+10)
      JSONDecode                220ms ± 3%      207ms ± 5%   -5.87%  (p=0.000 n=10+10)
      Mandelbrot200            5.22ms ± 1%     5.11ms ± 4%   -2.11%  (p=0.027 n=8+10)
      GoParse                  17.2ms ± 6%     16.1ms ± 5%   -6.63%  (p=0.000 n=10+9)
      RegexpMatchEasy0_32       375ns ± 3%      340ns ± 3%   -9.25%  (p=0.000 n=10+10)
      RegexpMatchEasy0_1K      2.70µs ± 3%     2.65µs ± 4%     ~     (p=0.118 n=10+10)
      RegexpMatchEasy1_32       341ns ± 2%      305ns ± 4%  -10.62%  (p=0.000 n=9+10)
      RegexpMatchEasy1_1K      3.20µs ± 3%     2.99µs ± 3%   -6.35%  (p=0.000 n=10+10)
      RegexpMatchMedium_32      520ns ± 3%      501ns ± 4%   -3.64%  (p=0.002 n=9+10)
      RegexpMatchMedium_1K      145µs ± 7%      128µs ± 3%  -11.57%  (p=0.000 n=9+10)
      RegexpMatchHard_32       7.88µs ± 3%     7.01µs ± 5%  -10.97%  (p=0.000 n=10+10)
      RegexpMatchHard_1K        237µs ± 5%      207µs ± 4%  -12.71%  (p=0.000 n=9+10)
      Revcomp                   2.34s ± 1%      2.31s ± 5%     ~     (p=0.230 n=7+10)
      Template                  261ms ± 7%      246ms ± 5%   -5.93%  (p=0.007 n=10+10)
      TimeParse                1.47µs ± 3%     1.39µs ± 5%   -5.75%  (p=0.000 n=9+10)
      TimeFormat               1.52µs ± 3%     1.43µs ± 4%   -6.42%  (p=0.000 n=8+10)
      
      name                   old speed      new speed       delta
      GobDecode              25.7MB/s ± 3%   26.7MB/s ± 5%   +3.77%  (p=0.006 n=9+10)
      GobEncode              37.5MB/s ± 8%   43.7MB/s ± 3%  +16.61%  (p=0.000 n=10+10)
      Gzip                   27.2MB/s ± 3%   27.0MB/s ± 7%     ~     (p=0.971 n=10+10)
      Gunzip                  131MB/s ± 3%    142MB/s ± 5%   +8.07%  (p=0.000 n=10+10)
      JSONEncode             55.2MB/s ± 2%   61.2MB/s ±12%  +10.80%  (p=0.002 n=10+10)
      JSONDecode             8.84MB/s ± 3%   9.39MB/s ± 5%   +6.28%  (p=0.000 n=10+10)
      GoParse                3.37MB/s ± 6%   3.61MB/s ± 5%   +7.09%  (p=0.000 n=10+9)
      RegexpMatchEasy0_32    85.3MB/s ± 3%   94.0MB/s ± 3%  +10.20%  (p=0.000 n=10+10)
      RegexpMatchEasy0_1K     379MB/s ± 3%    387MB/s ± 4%     ~     (p=0.123 n=10+10)
      RegexpMatchEasy1_32    93.9MB/s ± 2%  105.1MB/s ± 4%  +11.96%  (p=0.000 n=9+10)
      RegexpMatchEasy1_1K     320MB/s ± 3%    342MB/s ± 3%   +6.79%  (p=0.000 n=10+10)
      RegexpMatchMedium_32   1.92MB/s ± 2%   2.00MB/s ± 3%   +3.94%  (p=0.001 n=9+10)
      RegexpMatchMedium_1K   7.09MB/s ± 6%   8.01MB/s ± 3%  +13.00%  (p=0.000 n=9+10)
      RegexpMatchHard_32     4.06MB/s ± 3%   4.56MB/s ± 5%  +12.38%  (p=0.000 n=10+10)
      RegexpMatchHard_1K     4.32MB/s ± 4%   4.96MB/s ± 4%  +14.60%  (p=0.000 n=9+10)
      Revcomp                 109MB/s ± 1%    110MB/s ± 5%     ~     (p=0.219 n=7+10)
      Template               7.44MB/s ± 8%   7.91MB/s ± 5%   +6.30%  (p=0.007 n=10+10)
      
      Change-Id: I5828cf6b23ce104c02addc2642aba48dd6c48aab
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174062
      Run-TryBot: Richard Musiol <neelance@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      203e1888
    • Richard Musiol's avatar
      runtime: do not use heap arena hints on wasm · c2d9eea1
      Richard Musiol authored
      The address space of WebAssembly's linear memory is contiguous, so
      requesting specific addresses is not supported. Do not use heap arena
      hints so we do not have unused memory ranges.
      
      This fixes go1 benchmarks on wasm which ran out of memory since
      https://golang.org/cl/170950.
      
      Change-Id: I70115b18dbe43abe16dd5f57996343d97bf94760
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174203
      Run-TryBot: Richard Musiol <neelance@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      c2d9eea1
    • LE Manh Cuong's avatar
      encoding/json: fix Unmarshal hang on recursive pointers · dcb84828
      LE Manh Cuong authored
      indirect walks down v until it gets to a non-pointer. But it does not
      handle the case when v is a pointer to itself, like in:
      
      	var v interface{}
      	v = &v
      	Unmarshal(b, v)
      
      So just stop immediately if we see v is a pointer to itself.
      
      Fixes #31740
      
      Change-Id: Ie396264119e24d70284cd9bf76dcb2050babb069
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174337
      Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarDaniel Martí <mvdan@mvdan.cc>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      dcb84828
    • Russ Cox's avatar
      cmd/go: add test of $GONOPROXY, $GONOSUMDB behavior · d021dd6a
      Russ Cox authored
      Change-Id: I8a4917ce14ea22d5991226e485d43a9c9312950e
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174219
      Run-TryBot: Russ Cox <rsc@golang.org>
      Reviewed-by: default avatarJay Conrod <jayconrod@google.com>
      d021dd6a
  2. 29 Apr, 2019 20 commits
  3. 28 Apr, 2019 4 commits
  4. 27 Apr, 2019 4 commits
    • Elias Naur's avatar
      cmd/link/internal/ld,syscall: replace getfsstat64 with getfsstat · 4fdeb73f
      Elias Naur authored
      getfsstat64 is deprecated but not yet caught by the App Store checks.
      Use the supported getfsstat$INODE64 form instead to ensure forward
      compatibility.
      
      Change-Id: I0d97e8a8b254debb3de1cfcb3778dbed3702c249
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174200
      Run-TryBot: Elias Naur <mail@eliasnaur.com>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      4fdeb73f
    • Elias Naur's avatar
      cmd/link/internal/ld,syscall: drop $INODE64 suffixes on simulators · 096ab3c2
      Elias Naur authored
      Some libc functions are suffixed with "$INODE64" on macOS.
      Unfortunately, the iOS simulator doesn't have the suffixes, so we can't
      use GOARCH to distinguish the two platform.
      
      Add linker support for adding the suffix, using the macho platform
      to determine whether it is needed.
      
      While here, add the correct suffix for fdopendir on 386. It's
      "$INODE64$UNIX2003", believe it or not. Without the suffix,
      
      GOARCH=386 go test -short syscall
      
      crashes on my Mojave machine.
      
      Fixes #31447
      
      Change-Id: I9bd3de40ece7df62f744bc24cd00909e56b00b78
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174199
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      096ab3c2
    • Elias Naur's avatar
      cmd/link/internal/ld: consolidate macho platform setup · a74e0120
      Elias Naur authored
      Determine the macho platform once and use that the two places that
      need it. This makes it easier to add a third platform check for a
      follow-up change.
      
      Updates #31447
      
      Change-Id: I522a5fface647ab8e608f816c5832d531534df7a
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174198
      Run-TryBot: Elias Naur <mail@eliasnaur.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      a74e0120
    • Brian Kessler's avatar
      cmd/compile: add unsigned divisibility rules · a28a9427
      Brian Kessler authored
      "Division by invariant integers using multiplication" paper
      by Granlund and Montgomery contains a method for directly computing
      divisibility (x%c == 0 for c constant) by means of the modular inverse.
      The method is further elaborated in "Hacker's Delight" by Warren Section 10-17
      
      This general rule can compute divisibilty by one multiplication and a compare
      for odd divisors and an additional rotate for even divisors.
      
      To apply the divisibility rule, we must take into account
      the rules to rewrite x%c = x-((x/c)*c) and (x/c) for c constant on the first
      optimization pass "opt".  This complicates the matching as we want to match
      only in the cases where the result of (x/c) is not also available.
      So, we must match on the expanded form of (x/c) in the expression x == c*(x/c)
      in the "late opt" pass after common subexpresion elimination.
      
      Note, that if there is an intermediate opt pass introduced in the future we
      could simplify these rules by delaying the magic division rewrite to "late opt"
      and matching directly on (x/c) in the intermediate opt pass.
      
      Additional rules to lower the generic RotateLeft* ops were also applied.
      
      On amd64, the divisibility check is 25-50% faster.
      
      name                     old time/op  new time/op  delta
      DivconstI64-4            2.08ns ± 0%  2.08ns ± 1%     ~     (p=0.881 n=5+5)
      DivisibleconstI64-4      2.67ns ± 0%  2.67ns ± 1%     ~     (p=1.000 n=5+5)
      DivisibleWDivconstI64-4  2.67ns ± 0%  2.67ns ± 0%     ~     (p=0.683 n=5+5)
      DivconstU64-4            2.08ns ± 1%  2.08ns ± 1%     ~     (p=1.000 n=5+5)
      DivisibleconstU64-4      2.77ns ± 1%  1.55ns ± 2%  -43.90%  (p=0.008 n=5+5)
      DivisibleWDivconstU64-4  2.99ns ± 1%  2.99ns ± 1%     ~     (p=1.000 n=5+5)
      DivconstI32-4            1.53ns ± 2%  1.53ns ± 0%     ~     (p=1.000 n=5+5)
      DivisibleconstI32-4      2.23ns ± 0%  2.25ns ± 3%     ~     (p=0.167 n=5+5)
      DivisibleWDivconstI32-4  2.27ns ± 1%  2.27ns ± 1%     ~     (p=0.429 n=5+5)
      DivconstU32-4            1.78ns ± 0%  1.78ns ± 1%     ~     (p=1.000 n=4+5)
      DivisibleconstU32-4      2.52ns ± 2%  1.26ns ± 0%  -49.96%  (p=0.000 n=5+4)
      DivisibleWDivconstU32-4  2.63ns ± 0%  2.85ns ±10%   +8.29%  (p=0.016 n=4+5)
      DivconstI16-4            1.54ns ± 0%  1.54ns ± 0%     ~     (p=0.333 n=4+5)
      DivisibleconstI16-4      2.10ns ± 0%  2.10ns ± 1%     ~     (p=0.571 n=4+5)
      DivisibleWDivconstI16-4  2.22ns ± 0%  2.23ns ± 1%     ~     (p=0.556 n=4+5)
      DivconstU16-4            1.09ns ± 0%  1.01ns ± 1%   -7.74%  (p=0.000 n=4+5)
      DivisibleconstU16-4      1.83ns ± 0%  1.26ns ± 0%  -31.52%  (p=0.008 n=5+5)
      DivisibleWDivconstU16-4  1.88ns ± 0%  1.89ns ± 1%     ~     (p=0.365 n=5+5)
      DivconstI8-4             1.54ns ± 1%  1.54ns ± 1%     ~     (p=1.000 n=5+5)
      DivisibleconstI8-4       2.10ns ± 0%  2.11ns ± 0%     ~     (p=0.238 n=5+4)
      DivisibleWDivconstI8-4   2.22ns ± 0%  2.23ns ± 2%     ~     (p=0.762 n=5+5)
      DivconstU8-4             0.92ns ± 1%  0.94ns ± 1%   +2.65%  (p=0.008 n=5+5)
      DivisibleconstU8-4       1.66ns ± 0%  1.26ns ± 1%  -24.28%  (p=0.008 n=5+5)
      DivisibleWDivconstU8-4   1.79ns ± 0%  1.80ns ± 1%     ~     (p=0.079 n=4+5)
      
      A follow-up change will address the signed division case.
      
      Updates #30282
      
      Change-Id: I7e995f167179aa5c76bb10fbcbeb49c520943403
      Reviewed-on: https://go-review.googlesource.com/c/go/+/168037
      Run-TryBot: Brian Kessler <brian.m.kessler@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      a28a9427