]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: zero all three argstorage slots
authorKeith Randall <khr@golang.org>
Mon, 11 Apr 2016 20:17:52 +0000 (13:17 -0700)
committerKeith Randall <khr@golang.org>
Mon, 11 Apr 2016 20:49:22 +0000 (20:49 +0000)
These changes were missed when going from 2 to 3 argstorage slots.
https://go-review.googlesource.com/20296/

Change-Id: I930a307bb0b695bf1ae088030c9bbb6d14ca31d2
Reviewed-on: https://go-review.googlesource.com/21841
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
src/cmd/compile/internal/ssa/func.go
src/cmd/compile/internal/ssa/value.go

index 6e47b7f19c02f7703193bad70411d3ac56d54b14..8dd75f6093ce948532da17eab0848784d1f44bc6 100644 (file)
@@ -284,7 +284,10 @@ func (b *Block) NewValue2I(line int32, op Op, t Type, auxint int64, arg0, arg1 *
 func (b *Block) NewValue3(line int32, op Op, t Type, arg0, arg1, arg2 *Value) *Value {
        v := b.Func.newValue(op, t, b, line)
        v.AuxInt = 0
-       v.Args = []*Value{arg0, arg1, arg2}
+       v.Args = v.argstorage[:3]
+       v.argstorage[0] = arg0
+       v.argstorage[1] = arg1
+       v.argstorage[2] = arg2
        arg0.Uses++
        arg1.Uses++
        arg2.Uses++
@@ -295,7 +298,10 @@ func (b *Block) NewValue3(line int32, op Op, t Type, arg0, arg1, arg2 *Value) *V
 func (b *Block) NewValue3I(line int32, op Op, t Type, auxint int64, arg0, arg1, arg2 *Value) *Value {
        v := b.Func.newValue(op, t, b, line)
        v.AuxInt = auxint
-       v.Args = []*Value{arg0, arg1, arg2}
+       v.Args = v.argstorage[:3]
+       v.argstorage[0] = arg0
+       v.argstorage[1] = arg1
+       v.argstorage[2] = arg2
        arg0.Uses++
        arg1.Uses++
        arg2.Uses++
index fd4eb64db17ce40e864151df0f6a7477673e7e98..6c364ad932e5ce11f6aada6682adf7fc22553356 100644 (file)
@@ -185,6 +185,7 @@ func (v *Value) resetArgs() {
        }
        v.argstorage[0] = nil
        v.argstorage[1] = nil
+       v.argstorage[2] = nil
        v.Args = v.argstorage[:0]
 }