]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: make funccompile non-reentrant
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Mon, 14 Sep 2020 03:38:45 +0000 (10:38 +0700)
committerCuong Manh Le <cuong.manhle.vn@gmail.com>
Tue, 15 Sep 2020 02:05:31 +0000 (02:05 +0000)
commitd20298e1c7d1df794a11ce7768e027c6759df2a4
tree5365a146c03340d4a38ecdb1181541a050f406aa
parentf4936d09fd5a1fff890d63ee2ab9543243dc4da6
cmd/compile: make funccompile non-reentrant

Currently, there's awkward reentrancy issue with funccompile:

    funccompile -> compile -> dtypesym -> geneq/genhash/genwrapper -> funccompile

Though it's not a problem at this moment, some attempts by @mdempsky to
move order/walk/instrument into buildssa was failed, due to SSA cache
corruption.

This commit fixes that reentrancy issue, by making generated functions
to be pumped through the same compile workqueue that normal functions
are compiled. We do this by adding them to xtop, instead of calling
funccompile directly in geneq/genhash/genwrapper. In dumpdata, we look
for uncompiled functions in xtop instead of compilequeue, then finish
compiling them.

Updates #38463
Fixes #33485

Change-Id: Ic9f0ce45b56ae2ff3862f17fd979253ddc144bb5
Reviewed-on: https://go-review.googlesource.com/c/go/+/254617
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Keith Randall <khr@golang.org>
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
src/cmd/compile/internal/gc/alg.go
src/cmd/compile/internal/gc/obj.go
src/cmd/compile/internal/gc/subr.go