[dev.ssa] cmd/compile: unify and check LoweredGetClosurePtr

The comments were mostly duplicated; unify them.
Add a check that the required invariant holds.

Change-Id: I42fe09dcd1fac76d3c4e191f7a58c591c5ce429b
Reviewed-on: https://go-review.googlesource.com/24719
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: David Chase <drchase@google.com>
This commit is contained in:
Josh Bleecher Snyder 2016-07-03 13:40:03 -07:00
parent ad8b8f644e
commit 41a7dca272
3 changed files with 14 additions and 11 deletions

View file

@ -708,12 +708,8 @@ func ssaGenValue(s *gc.SSAGenState, v *ssa.Value) {
ssa.OpARMLoweredSelect1:
// nothing to do
case ssa.OpARMLoweredGetClosurePtr:
// Output is hardwired to R7 (arm.REGCTXT) only,
// and R7 contains the closure pointer on
// closure entry, and this "instruction"
// is scheduled to the very beginning
// of the entry block.
// nothing to do here.
// Closure pointer is R7 (arm.REGCTXT).
gc.CheckLoweredGetClosurePtr(v)
default:
v.Unimplementedf("genValue not implemented: %s", v.LongString())
}