Skip to content

Commit

Permalink
cmd/internal/gc: shrink Node.Ostk to uint8
Browse files Browse the repository at this point in the history
Change-Id: Ifda5d84b28717986c93b63767298180a6d6236c0
  • Loading branch information
josharian committed May 15, 2015
1 parent f6482f7 commit 69cd9cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/cmd/6g/ggen.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -318,15 +318,15 @@ 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.Ostk = r // squirrel away old r value
reg[dr] = 1
}
}

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.Ostk
gmove(oldx, x)
gc.Regfree(oldx)
}
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/internal/gc/syntax.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ type Node struct {
Lineno int32
Xoffset int64
Stkdelta int64 // offset added by stack frame compaction phase.
Ostk int32 // 6g only
Ostk uint8 // 6g only
Iota int32
Walkgen uint32
Esclevel Level
Expand Down

0 comments on commit 69cd9cd

Please sign in to comment.