aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/mips
diff options
context:
space:
mode:
authorCherry Zhang <cherryyz@google.com>2017-10-09 15:33:29 -0400
committerCherry Zhang <cherryyz@google.com>2017-10-10 15:15:21 +0000
commit6f3e5e637c6c26d1d24e20e96b86ecd27a7ecabc (patch)
treede80139c252a6e8a67696c74f87d38352eda6056 /src/cmd/compile/internal/mips
parentae175f74cb4beb4a6695e185c77c7ed52ee2d1d7 (diff)
downloadgo-6f3e5e637c6c26d1d24e20e96b86ecd27a7ecabc.tar.gz
go-6f3e5e637c6c26d1d24e20e96b86ecd27a7ecabc.zip
cmd/compile: intrinsify runtime.getcallersp
Add a compiler intrinsic for getcallersp. So we are able to get rid of the argument (not done in this CL). Change-Id: Ic38fda1c694f918328659ab44654198fb116668d Reviewed-on: https://go-review.googlesource.com/69350 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com> Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/cmd/compile/internal/mips')
-rw-r--r--src/cmd/compile/internal/mips/ssa.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/mips/ssa.go b/src/cmd/compile/internal/mips/ssa.go
index f7810ca497..ee68afdfa3 100644
--- a/src/cmd/compile/internal/mips/ssa.go
+++ b/src/cmd/compile/internal/mips/ssa.go
@@ -755,6 +755,14 @@ func ssaGenValue(s *gc.SSAGenState, v *ssa.Value) {
case ssa.OpMIPSLoweredGetClosurePtr:
// Closure pointer is R22 (mips.REGCTXT).
gc.CheckLoweredGetClosurePtr(v)
+ case ssa.OpMIPSLoweredGetCallerSP:
+ // caller's SP is FixedFrameSize below the address of the first arg
+ p := s.Prog(mips.AMOVW)
+ p.From.Type = obj.TYPE_ADDR
+ p.From.Offset = -gc.Ctxt.FixedFrameSize()
+ p.From.Name = obj.NAME_PARAM
+ p.To.Type = obj.TYPE_REG
+ p.To.Reg = v.Reg()
case ssa.OpClobber:
// TODO: implement for clobberdead experiment. Nop is ok for now.
default: