1
0
mirror of https://github.com/golang/go synced 2024-11-18 09:44:50 -07:00

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.
*/
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
// 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]
gmove(x, oldx)
x.Type = t
oldx.Ostk = int32(r) // squirrel away old r value
oldx.Etype = r // squirrel away old r value
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) {
if oldx.Op != 0 {
x.Type = gc.Types[gc.TINT64]
reg[x.Reg] = uint8(oldx.Ostk)
reg[x.Reg] = oldx.Etype
gmove(oldx, x)
gc.Regfree(oldx)
}

View File

@ -27,7 +27,7 @@ type Node struct {
Nointerface bool
Ullman uint8 // sethi/ullman number
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
Class uint8 // PPARAM, PAUTO, PEXTERN, etc
Embedded uint8 // ODCLFIELD embedded type
@ -97,7 +97,6 @@ type Node struct {
Lineno int32
Xoffset int64
Stkdelta int64 // offset added by stack frame compaction phase.
Ostk int32 // 6g only
Iota int32
Walkgen uint32
Esclevel Level