aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/arm
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/arm
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/arm')
-rw-r--r--src/cmd/compile/internal/arm/ssa.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/arm/ssa.go b/src/cmd/compile/internal/arm/ssa.go
index 140b9d10ac..4188775329 100644
--- a/src/cmd/compile/internal/arm/ssa.go
+++ b/src/cmd/compile/internal/arm/ssa.go
@@ -778,6 +778,14 @@ func ssaGenValue(s *gc.SSAGenState, v *ssa.Value) {
case ssa.OpARMLoweredGetClosurePtr:
// Closure pointer is R7 (arm.REGCTXT).
gc.CheckLoweredGetClosurePtr(v)
+ case ssa.OpARMLoweredGetCallerSP:
+ // caller's SP is FixedFrameSize below the address of the first arg
+ p := s.Prog(arm.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.OpARMFlagEQ,
ssa.OpARMFlagLT_ULT,
ssa.OpARMFlagLT_UGT,