• Austin Clements's avatar
    runtime: make morestack less subtle · bf9c71cb
    Austin Clements authored
    morestack writes the context pointer to gobuf.ctxt, but since
    morestack is written in assembly (and has to be very careful with
    state), it does *not* invoke the requisite write barrier for this
    write. Instead, we patch this up later, in newstack, where we invoke
    an explicit write barrier for ctxt.
    
    This already requires some subtle reasoning, and it's going to get a
    lot hairier with the hybrid barrier.
    
    Fix this by simplifying the whole mechanism. Instead of writing
    gobuf.ctxt in morestack, just pass the value of the context register
    to newstack and let it write it to gobuf.ctxt. This is a normal Go
    pointer write, so it gets the normal Go write barrier. No subtle
    reasoning required.
    
    Updates #17503.
    
    Change-Id: Ia6bf8459bfefc6828f53682ade32c02412e4db63
    Reviewed-on: https://go-review.googlesource.com/31550
    Run-TryBot: Austin Clements <austin@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
    bf9c71cb
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...