cmd/6g, cmd/internal/gc: use Etype instead of Ostk

Change-Id: Ifda5d84b28717986c93b63767298180a6d6236c0
Reviewed-on: https://go-review.googlesource.com/10140
Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
Josh Bleecher Snyder 2015-05-14 19:50:41 -07:00
parent 2b063bdff1
commit ddc93398b9
2 changed files with 4 additions and 5 deletions

View file

@ -306,7 +306,7 @@ func dodiv(op int, nl *gc.Node, nr *gc.Node, res *gc.Node) {
* known to be dead. * known to be dead.
*/ */
func savex(dr int, x *gc.Node, oldx *gc.Node, res *gc.Node, t *gc.Type) { func savex(dr int, x *gc.Node, oldx *gc.Node, res *gc.Node, t *gc.Type) {
r := int(reg[dr]) r := reg[dr]
// save current ax and dx if they are live // save current ax and dx if they are live
// and not the destination // and not the destination
@ -318,7 +318,7 @@ func savex(dr int, x *gc.Node, oldx *gc.Node, res *gc.Node, t *gc.Type) {
x.Type = gc.Types[gc.TINT64] x.Type = gc.Types[gc.TINT64]
gmove(x, oldx) gmove(x, oldx)
x.Type = t x.Type = t
oldx.Ostk = int32(r) // squirrel away old r value oldx.Etype = r // squirrel away old r value
reg[dr] = 1 reg[dr] = 1
} }
} }
@ -326,7 +326,7 @@ func savex(dr int, x *gc.Node, oldx *gc.Node, res *gc.Node, t *gc.Type) {
func restx(x *gc.Node, oldx *gc.Node) { func restx(x *gc.Node, oldx *gc.Node) {
if oldx.Op != 0 { if oldx.Op != 0 {
x.Type = gc.Types[gc.TINT64] x.Type = gc.Types[gc.TINT64]
reg[x.Reg] = uint8(oldx.Ostk) reg[x.Reg] = oldx.Etype
gmove(oldx, x) gmove(oldx, x)
gc.Regfree(oldx) gc.Regfree(oldx)
} }

View file

@ -27,7 +27,7 @@ type Node struct {
Nointerface bool Nointerface bool
Ullman uint8 // sethi/ullman number Ullman uint8 // sethi/ullman number
Addable bool // addressable Addable bool // addressable
Etype uint8 // op for OASOP, etype for OTYPE, exclam for export Etype uint8 // op for OASOP, etype for OTYPE, exclam for export, 6g saved reg
Bounded bool // bounds check unnecessary Bounded bool // bounds check unnecessary
Class uint8 // PPARAM, PAUTO, PEXTERN, etc Class uint8 // PPARAM, PAUTO, PEXTERN, etc
Embedded uint8 // ODCLFIELD embedded type Embedded uint8 // ODCLFIELD embedded type
@ -97,7 +97,6 @@ type Node struct {
Lineno int32 Lineno int32
Xoffset int64 Xoffset int64
Stkdelta int64 // offset added by stack frame compaction phase. Stkdelta int64 // offset added by stack frame compaction phase.
Ostk int32 // 6g only
Iota int32 Iota int32
Walkgen uint32 Walkgen uint32
Esclevel Level Esclevel Level