Skip to content
Permalink
Branch: master
Commits on Mar 14, 2019
  1. math, math/bits: add intrinsics for wasm

    neelance authored and bradfitz committed Mar 5, 2019
    This commit adds compiler intrinsics for the packages math and
    math/bits on the wasm architecture for better performance.
    
    benchmark                        old ns/op     new ns/op     delta
    BenchmarkCeil                    8.31          3.21          -61.37%
    BenchmarkCopysign                5.24          3.88          -25.95%
    BenchmarkAbs                     5.42          3.34          -38.38%
    BenchmarkFloor                   8.29          3.18          -61.64%
    BenchmarkRoundToEven             9.76          3.26          -66.60%
    BenchmarkSqrtLatency             8.13          4.88          -39.98%
    BenchmarkSqrtPrime               5246          3535          -32.62%
    BenchmarkTrunc                   8.29          3.15          -62.00%
    BenchmarkLeadingZeros            13.0          4.23          -67.46%
    BenchmarkLeadingZeros8           4.65          4.42          -4.95%
    BenchmarkLeadingZeros16          7.60          4.38          -42.37%
    BenchmarkLeadingZeros32          10.7          4.48          -58.13%
    BenchmarkLeadingZeros64          12.9          4.31          -66.59%
    BenchmarkTrailingZeros           6.52          4.04          -38.04%
    BenchmarkTrailingZeros8          4.57          4.14          -9.41%
    BenchmarkTrailingZeros16         6.69          4.16          -37.82%
    BenchmarkTrailingZeros32         6.97          4.23          -39.31%
    BenchmarkTrailingZeros64         6.59          4.00          -39.30%
    BenchmarkOnesCount               7.93          3.30          -58.39%
    BenchmarkOnesCount8              3.56          3.19          -10.39%
    BenchmarkOnesCount16             4.85          3.19          -34.23%
    BenchmarkOnesCount32             7.27          3.19          -56.12%
    BenchmarkOnesCount64             8.08          3.28          -59.41%
    BenchmarkRotateLeft              4.88          3.80          -22.13%
    BenchmarkRotateLeft64            5.03          3.63          -27.83%
    
    Change-Id: Ic1e0c2984878be8defb6eb7eb6ee63765c793222
    Reviewed-on: https://go-review.googlesource.com/c/go/+/165177
    Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: Cherry Zhang <cherryyz@google.com>
  2. misc/wasm: add workaround for missed timeout events

    neelance authored and Richard Musiol committed Mar 12, 2019
    TryBot is sometimes running into deadlocks on js/wasm. We haven't been
    able to reproduce them yet. This workaround is an experiment to resolve
    these deadlocks by retrying a missed timeout event.
    
    A timeout event is scheduled by Go to be woken by JavaScript after a
    certain amount of time. The checkTimeouts function then checks which
    notes to wake by comparing their deadline to nanotime. If this
    check fails erroneously then the note may stay asleep forever, causing
    a deadlock. This may or may not be the reason of the observed
    deadlocks.
    
    Updates #28975.
    
    Change-Id: I46b9d4069307142914f0e7b3acd4e65578319f0b
    Reviewed-on: https://go-review.googlesource.com/c/go/+/167119
    Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Commits on Mar 3, 2019
  1. all: rename WebAssembly instructions according to spec changes

    neelance authored and Richard Musiol committed Dec 12, 2018
    The names of some instructions have been updated in the WebAssembly
    specification to be more consistent, see
    WebAssembly/spec@994591e.
    This change to the spec is possible because it is still in a draft
    state.
    
    Go's support for WebAssembly is still experimental and thus excempt from
    the compatibility promise. Being consistent with the spec should
    warrant this breaking change to the assembly instruction names.
    
    Change-Id: Iafb8b18ee7f55dd0e23c6c7824aa1fad43117ef1
    Reviewed-on: https://go-review.googlesource.com/c/153797
    Run-TryBot: Richard Musiol <neelance@gmail.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: Cherry Zhang <cherryyz@google.com>
  2. misc/wasm: better adapt to different JavaScript environments

    neelance authored and Richard Musiol committed Dec 26, 2018
    This change adds support for using wasm with Electron. It refactors
    environment detection to a more modular approach instead of explicitly
    testing for Node.js.
    
    Fixes #29404
    
    Change-Id: I882a9c56523744e7fd7cb2013d158df91cf91d14
    Reviewed-on: https://go-review.googlesource.com/c/164665
    Run-TryBot: Richard Musiol <neelance@gmail.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
You can’t perform that action at this time.