]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: mark LoweredGetCallerPC rematerializeable
authorCherry Zhang <cherryyz@google.com>
Fri, 13 Oct 2017 15:05:12 +0000 (11:05 -0400)
committerCherry Zhang <cherryyz@google.com>
Sat, 14 Oct 2017 00:53:20 +0000 (00:53 +0000)
The caller's PC is always available in the frame. We can just
load it when needed, no need to spill.

Change-Id: I9c0a525903e574bb4eec9fe53cbeb8c64321166a
Reviewed-on: https://go-review.googlesource.com/70710
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/ssa/gen/386Ops.go
src/cmd/compile/internal/ssa/gen/AMD64Ops.go
src/cmd/compile/internal/ssa/opGen.go

index d407c73cd568ed7a22ad9fb637c2cf99396e6038..f5f46fad2cfbf332a109ae0aa0223ab5e2898cdd 100644 (file)
@@ -444,7 +444,7 @@ func init() {
                // I.e., if f calls g "calls" getcallerpc,
                // the result should be the PC within f that g will return to.
                // See runtime/stubs.go for a more detailed discussion.
-               {name: "LoweredGetCallerPC", reg: gp01},
+               {name: "LoweredGetCallerPC", reg: gp01, rematerializeable: true},
                // LoweredGetCallerSP returns the SP of the caller of the current function.
                {name: "LoweredGetCallerSP", reg: gp01, rematerializeable: true},
                //arg0=ptr,arg1=mem, returns void.  Faults if ptr is nil.
index 653b5d61e37b29bda8604f68799e9442fc207e29..699554ab2e65cd9778ef61bca10ce9c2136eb01c 100644 (file)
@@ -555,7 +555,7 @@ func init() {
                // I.e., if f calls g "calls" getcallerpc,
                // the result should be the PC within f that g will return to.
                // See runtime/stubs.go for a more detailed discussion.
-               {name: "LoweredGetCallerPC", reg: gp01},
+               {name: "LoweredGetCallerPC", reg: gp01, rematerializeable: true},
                // LoweredGetCallerSP returns the SP of the caller of the current function.
                {name: "LoweredGetCallerSP", reg: gp01, rematerializeable: true},
                //arg0=ptr,arg1=mem, returns void.  Faults if ptr is nil.
index 9c289bacafb3a9ea0c418884500b19b557160532..e8249b9e09905b611594240126b240a88c76da14 100644 (file)
@@ -4341,8 +4341,9 @@ var opcodeTable = [...]opInfo{
                },
        },
        {
-               name:   "LoweredGetCallerPC",
-               argLen: 0,
+               name:              "LoweredGetCallerPC",
+               argLen:            0,
+               rematerializeable: true,
                reg: regInfo{
                        outputs: []outputInfo{
                                {0, 239}, // AX CX DX BX BP SI DI
@@ -8118,8 +8119,9 @@ var opcodeTable = [...]opInfo{
                },
        },
        {
-               name:   "LoweredGetCallerPC",
-               argLen: 0,
+               name:              "LoweredGetCallerPC",
+               argLen:            0,
+               rematerializeable: true,
                reg: regInfo{
                        outputs: []outputInfo{
                                {0, 65519}, // AX CX DX BX BP SI DI R8 R9 R10 R11 R12 R13 R14 R15