diff options
| author | Than McIntosh <thanm@google.com> | 2016-07-14 13:23:11 -0400 |
|---|---|---|
| committer | Ian Lance Taylor <iant@golang.org> | 2016-10-03 18:07:32 +0000 |
| commit | 6c5e377d23136bd371d205e1c2aae6ddccb4597e (patch) | |
| tree | 955fc73c8ae2b8a636f632d88db3c2930753b0f9 /src | |
| parent | 5f36e9a3062c1f133169d01d612da9458a7ea884 (diff) | |
| download | go-6c5e377d23136bd371d205e1c2aae6ddccb4597e.tar.xz | |
cmd/compile: relax liveness restrictions on ambiguously live
Update gc liveness to remove special conservative treatment
of ambiguously live vars, since there is no longer a need to
protect against GCDEBUG=gcdead.
Change-Id: Id6e2d03218f7d67911e8436d283005a124e6957f
Reviewed-on: https://go-review.googlesource.com/24896
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/compile/internal/gc/plive.go | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/cmd/compile/internal/gc/plive.go b/src/cmd/compile/internal/gc/plive.go index 26e2ce9239..fed21c0c84 100644 --- a/src/cmd/compile/internal/gc/plive.go +++ b/src/cmd/compile/internal/gc/plive.go @@ -1188,17 +1188,18 @@ func livenessepilogue(lv *Liveness) { avarinit := bvalloc(nvars) any := bvalloc(nvars) all := bvalloc(nvars) - ambig := bvalloc(localswords()) + pparamout := bvalloc(localswords()) - // Set ambig bit for the pointers to heap-allocated pparamout variables. - // These are implicitly read by post-deferreturn code and thus must be - // kept live throughout the function (if there is any defer that recovers). + // Record pointers to heap-allocated pparamout variables. These + // are implicitly read by post-deferreturn code and thus must be + // kept live throughout the function (if there is any defer that + // recovers). if hasdefer { for _, n := range lv.vars { if n.IsOutputParamHeapAddr() { n.Name.Needzero = true xoffset := n.Xoffset + stkptrsize - onebitwalktype1(n.Type, &xoffset, ambig) + onebitwalktype1(n.Type, &xoffset, pparamout) } } } @@ -1250,11 +1251,6 @@ func livenessepilogue(lv *Liveness) { if debuglive >= 1 { Warnl(p.Lineno, "%v: %L is ambiguously live", Curfn.Func.Nname, n) } - - // Record in 'ambiguous' bitmap. - xoffset := n.Xoffset + stkptrsize - - onebitwalktype1(n.Type, &xoffset, ambig) } } } @@ -1355,11 +1351,9 @@ func livenessepilogue(lv *Liveness) { locals := lv.livepointers[pos] onebitlivepointermap(lv, liveout, lv.vars, args, locals) - // Ambiguously live variables are zeroed immediately after - // function entry. Mark them live for all the non-entry bitmaps - // so that GODEBUG=gcdead=1 mode does not poison them. + // Mark pparamout variables (as described above) if p.As == obj.ACALL { - bvor(locals, locals, ambig) + bvor(locals, locals, pparamout) } // Show live pointer bitmaps. |
