]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: schedule OpArg earlier in blocks for better debugging
authorDavid Chase <drchase@google.com>
Thu, 18 Oct 2018 18:43:51 +0000 (14:43 -0400)
committerDavid Chase <drchase@google.com>
Tue, 23 Oct 2018 21:11:01 +0000 (21:11 +0000)
The location list for OpArg starts where the OpArg appears;
this is not necessarily as soon as the OpArg coulde be
observed, and it is reasonable for a user to expect that
if a breakpoint is set "on f" then the arguments to f will
be observable where that breakpoint happens to be set (this
may also require setting the breakpoint after the prologue,
but that is another issue).

Change-Id: I0a1b848e50f475e5d8a5fad781241126872a0400
Reviewed-on: https://go-review.googlesource.com/c/142819
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Reviewed-by: Alessandro Arzilli <alessandro.arzilli@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/ssa/schedule.go

index f1783a9532efe04be1dba3d2b0e76c1a9b0d8a1d..9e19bb85b03a76a2f4d1d74764c50d626b74b652 100644 (file)
@@ -8,6 +8,7 @@ import "container/heap"
 
 const (
        ScorePhi = iota // towards top of block
+       ScoreArg
        ScoreNilCheck
        ScoreReadTuple
        ScoreVarDef
@@ -113,6 +114,9 @@ func schedule(f *Func) {
                        case v.Op == OpVarDef:
                                // We want all the vardefs next.
                                score[v.ID] = ScoreVarDef
+                       case v.Op == OpArg:
+                               // We want all the args as early as possible, for better debugging.
+                               score[v.ID] = ScoreArg
                        case v.Type.IsMemory():
                                // Schedule stores as early as possible. This tends to
                                // reduce register pressure. It also helps make sure