• 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
Name
Last commit
Last update
..
addr2line Loading commit data...
api Loading commit data...
asm Loading commit data...
buildid Loading commit data...
cgo Loading commit data...
compile Loading commit data...
cover Loading commit data...
dist Loading commit data...
doc Loading commit data...
fix Loading commit data...
go Loading commit data...
gofmt Loading commit data...
internal Loading commit data...
link Loading commit data...
nm Loading commit data...
objdump Loading commit data...
pack Loading commit data...
pprof Loading commit data...
test2json Loading commit data...
trace Loading commit data...
vendor Loading commit data...
vet Loading commit data...