1. 19 Jun, 2018 8 commits
    • Heschi Kreinick's avatar
      debug/elf,macho,pe: support compressed DWARF · 2036f162
      Heschi Kreinick authored
      Since we're going to start compressing DWARF on Windows and maybe
      Darwin, copy the ELF support for .zdebug sections to macho and pe. The
      code is almost completely the same across the three.
      
      While I was here I added support for compressed .debug_type sections,
      which I presume were overlooked before.
      
      Tests will come in a later CL once we can actually generate compressed
      PE/Mach-O binaries, since there's no other good way to get test data.
      
      Updates #25927, #11799
      
      Change-Id: Ie920b6a16e9270bc3df214ce601a263837810376
      Reviewed-on: https://go-review.googlesource.com/119815
      Run-TryBot: Heschi Kreinick <heschi@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: 's avatarAustin Clements <austin@google.com>
      2036f162
    • Heschi Kreinick's avatar
      cmd/link: enable DWARF compression on Windows · 83515df3
      Heschi Kreinick authored
      Simple follow-on to CL 118276. Everything worked except that the
      compressed sections need to be aligned at PEFILEALIGN.
      
      Fixes #25927
      Updates #11799
      
      Change-Id: Iec871defe30e3e66055d64a5ae77d5a7aca355f5
      Reviewed-on: https://go-review.googlesource.com/119816
      Run-TryBot: Heschi Kreinick <heschi@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: 's avatarAustin Clements <austin@google.com>
      83515df3
    • Dmitri Shuralyov's avatar
      doc: update "Mac OS X", "OS X" to macOS; bump up to 10.10 · 500293d8
      Dmitri Shuralyov authored
      The name was "Mac OS X" during versions 10.0 to 10.7.
      It was renamed to "OS X" starting from 10.8 until 10.11.
      The current name is "macOS" starting with 10.12. [1]
      
      Previous changes (e.g., CL 47252) updated "Mac OS X" to macOS
      in some places, but not everywhere. This CL updates remaining
      instances for consistency.
      
      Only the pages that display current information were updated;
      historical pages such as release notes for older Go releases,
      past articles, blog posts, etc., were left in original form.
      
      Rename the "#osx" anchor to "#macos" on /doc/install page,
      along with the single reference to it on the same page.
      Add an empty div with id="osx" to not break old links.
      
      Update minimum macOS version from 10.8 to 10.10 per #23122.
      
      [1]: https://en.wikipedia.org/wiki/macOS#History
      
      Updates #23122.
      
      Change-Id: I69fe4b85e83265b9d99f447e3cc5230dde094869
      Reviewed-on: https://go-review.googlesource.com/119855Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      500293d8
    • Filippo Valsorda's avatar
      crypto: panic on illegal input and output overlap · 75d15a20
      Filippo Valsorda authored
      Normalized all panic checks and added inexact aliasing panics across
      Stream, Block, BlockMode and AEAD implementations.
      
      Also, tweaked the aliasing docs of cipher.AEAD, as they did not account
      for the append nature of the API.
      
      Fixes #21624
      
      Change-Id: I075c4415f59b3c06e3099bd9f76de6d12af086bf
      Reviewed-on: https://go-review.googlesource.com/109697
      Run-TryBot: Filippo Valsorda <filippo@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      75d15a20
    • David Chase's avatar
      cmd/compile: conditional on -race, disable inline of go:norace · c6e455bb
      David Chase authored
      Adds the appropriate check to inl.go.
      Includes tests of both -race+go:norace and plain go:norace.
      
      Fixes #24651.
      
      Change-Id: Id806342430c20baf4679a985d12eea3b677092e0
      Reviewed-on: https://go-review.googlesource.com/119195
      Run-TryBot: David Chase <drchase@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
      c6e455bb
    • Robert Griesemer's avatar
      cmd/compile: more accurate position for select case error message · 707ca18d
      Robert Griesemer authored
      Fixes #25958.
      
      Change-Id: I1f4808a70c20334ecfc4eb1789f5389d94dcf00e
      Reviewed-on: https://go-review.googlesource.com/119755Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      707ca18d
    • Carlos Eduardo Seo's avatar
      runtime: implement procyield properly for ppc64x · 1caa0629
      Carlos Eduardo Seo authored
      The procyield() function should yield the processor as in other
      architectures. On ppc64x, this is achieved by setting the Program
      Priority Register to 'low priority' prior to the spin loop, and
      setting it back to 'medium-low priority' afterwards.
      
      benchmark                          old ns/op     new ns/op     delta
      BenchmarkMakeChan/Byte-8           87.7          86.6          -1.25%
      BenchmarkMakeChan/Int-8            107           106           -0.93%
      BenchmarkMakeChan/Ptr-8            201           204           +1.49%
      BenchmarkMakeChan/Struct/0-8       78.2          79.7          +1.92%
      BenchmarkMakeChan/Struct/32-8      196           200           +2.04%
      BenchmarkMakeChan/Struct/40-8      236           230           -2.54%
      BenchmarkChanNonblocking-8         8.64          8.85          +2.43%
      BenchmarkChanUncontended-8         5577          5598          +0.38%
      BenchmarkChanContended-8           66106         51529         -22.05%
      BenchmarkChanSync-8                451           441           -2.22%
      BenchmarkChanSyncWork-8            9155          9170          +0.16%
      BenchmarkChanProdCons0-8           1585          1083          -31.67%
      BenchmarkChanProdCons10-8          1094          838           -23.40%
      BenchmarkChanProdCons100-8         831           657           -20.94%
      BenchmarkChanProdConsWork0-8       1471          941           -36.03%
      BenchmarkChanProdConsWork10-8      1033          721           -30.20%
      BenchmarkChanProdConsWork100-8     730           511           -30.00%
      BenchmarkChanCreation-8            135           128           -5.19%
      BenchmarkChanSem-8                 602           463           -23.09%
      BenchmarkChanPopular-8             3017466       2188441       -27.47%
      
      Fixes #25625
      
      Change-Id: Iacb1c888d3c066902152b8367500348fb631c5f9
      Reviewed-on: https://go-review.googlesource.com/115376
      Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      1caa0629
    • Robert Griesemer's avatar
      cmd/compile: fix exporting of 'for' loops · f125052a
      Robert Griesemer authored
      The existing code for encoding 'for' loops in exported, inlineable
      functions incorrectly assumed that the 'Right' field points to an
      'expression' node. Adjusted the code to be able to handle any kind
      of node. Made matching changes for the binary and indexed exporter.
      
      This only shows up together with other pending compiler changes that
      enable exporting of such functions which contain for loops.
      
      No tests yet because we can't test this w/o those pending compiler
      changes. Once those changes are in, this code will be tested implicitly.
      However, the changes were tested manually together with the patches
      described in the issue.
      
      Fixes #25222.
      
      Change-Id: I54babb87e5d665d2c1ef6116c1de1b8c50b1138e
      Reviewed-on: https://go-review.googlesource.com/119595Reviewed-by: 's avatarDavid Chase <drchase@google.com>
      f125052a
  2. 18 Jun, 2018 5 commits
  3. 17 Jun, 2018 3 commits
  4. 16 Jun, 2018 3 commits
  5. 15 Jun, 2018 15 commits
  6. 14 Jun, 2018 6 commits
    • Brian Kessler's avatar
      math/big: handle negative exponents in Exp · 30b045d4
      Brian Kessler authored
      For modular exponentiation, negative exponents can be handled using
      the following relation.
      
      for y < 0: x**y mod m == (x**(-1))**|y| mod m
      
      First compute ModInverse(x, m) and then compute the exponentiation
      with the absolute value of the exponent.  Non-modular exponentiation
      with a negative exponent still returns 1.
      
      Fixes #25865
      
      Change-Id: I2a35986a24794b48e549c8de935ac662d217d8a0
      Reviewed-on: https://go-review.googlesource.com/118562
      Run-TryBot: Robert Griesemer <gri@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
      30b045d4
    • Richard Musiol's avatar
      runtime, sycall/js: add support for callbacks from JavaScript · e083dc63
      Richard Musiol authored
      This commit adds support for JavaScript callbacks back into
      WebAssembly. This is experimental API, just like the rest of the
      syscall/js package. The time package now also uses this mechanism
      to properly support timers without resorting to a busy loop.
      
      JavaScript code can call into the same entry point multiple times.
      The new RUN register is used to keep track of the program's
      run state. Possible values are: starting, running, paused and exited.
      If no goroutine is ready any more, the scheduler can put the
      program into the "paused" state and the WebAssembly code will
      stop running. When a callback occurs, the JavaScript code puts
      the callback data into a queue and then calls into WebAssembly
      to allow the Go code to continue running.
      
      Updates #18892
      Updates #25506
      
      Change-Id: Ib8701cfa0536d10d69bd541c85b0e2a754eb54fb
      Reviewed-on: https://go-review.googlesource.com/114197Reviewed-by: 's avatarAustin Clements <austin@google.com>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      e083dc63
    • Rob Pike's avatar
      cmd/cover: remove use of diff in cover_test.go · 5fdacfa8
      Rob Pike authored
      It's non-portable, and the test isn't hard to write without diff.
      It still produces helpful output in case of trouble:
      
      --- FAIL: TestCoverHTML (0.75s)
          cover_test.go:325: line 4 differs: got:
              	case &lt;-ch:<span class="cov0" title="0"></span>
              want:
              	case &lt;-ch:<span class="cov0" xitle="0"></span>
      
      This makes the test operating-system independent.
      
      Change-Id: Iff35f00cb76ba89bc1b93db01c6f994e74341f4a
      Reviewed-on: https://go-review.googlesource.com/118795Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      5fdacfa8
    • Daniel Martí's avatar
      cmd/vet: simplify side effects func call logic · 26727b84
      Daniel Martí authored
      Instead of first looking for values of unnamed signature type, first
      treat the types and builtins. All the remaining cases will be what we're
      after.
      
      Change-Id: I328e22ae0be1cccaeb45ed4ddaa360233d447e7e
      Reviewed-on: https://go-review.googlesource.com/117835
      Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
      Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
      26727b84
    • Brian Kessler's avatar
      math/big: round x + (-x) to -0 for mode ToNegativeInf · d31cad7c
      Brian Kessler authored
      Handling of sign bit as defined by IEEE 754-2008, section 6.3:
      
      When the sum of two operands with opposite signs (or the difference of
      two operands with like signs) is exactly zero, the sign of that sum (or
      difference) shall be +0 in all rounding-direction attributes except
      roundTowardNegative; under that attribute, the sign of an exact zero
      sum (or difference) shall be −0. However, x+x = x−(−x) retains the same
      sign as x even when x is zero.
      
      This change handles the special case of Add/Sub resulting in exactly zero
      when the rounding mode is ToNegativeInf setting the sign bit accordingly.
      
      Fixes #25798
      
      Change-Id: I4d0715fa3c3e4a3d8a4d7861dc1d6423c8b1c68c
      Reviewed-on: https://go-review.googlesource.com/117495
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
      d31cad7c
    • David Chase's avatar
      cmd/compile: ensure that operand of ORETURN is not double-walked · c359d759
      David Chase authored
      Inlining of switch statements into a RETURNed expression
      can sometimes lead to the switch being walked twice, which
      results in a miscompiled switch statement. The bug depends
      on:
      
      1) multiple results
      2) named results
      3) a return statement whose expression includes a call to a
      function containing a switch statement that is inlined.
      
      It may also be significant that the default case of that
      switch is a panic(), though that's not proven.
      
      Rearranged the walk case for ORETURN so that double walks are
      not possible.  Added a test, because this is so fiddly.
      Added a check against double walks, verified that it fires
      w/o other fix.
      
      Fixes #25776.
      
      Change-Id: I2d594351fa082632512ef989af67eb887059729b
      Reviewed-on: https://go-review.googlesource.com/118318
      Run-TryBot: David Chase <drchase@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
      c359d759