OREGISTER is unused.
All remaining uses of Node.Reg use REGSP.
Change-Id: I51cf06826867e576baabd568e04f96d2634f5cad
Reviewed-on: https://go-review.googlesource.com/31856
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
// case ODDDARG:
// unimplemented - handled by default case
- // case OREGISTER:
- // unimplemented - handled by default case
-
case OLITERAL:
if n.Val().Ctype() == CTNIL && n.Orig != nil && n.Orig != n {
p.expr(n.Orig)
// case ODDDARG:
// unimplemented
- // case OREGISTER:
- // unimplemented
-
case OLITERAL:
typ := p.typ()
n := nodlit(p.value(typ))
package gc
import (
- "cmd/internal/obj"
"fmt"
"strconv"
"strings"
case ODDDARG:
fmt.Fprint(s, "... argument")
- case OREGISTER:
- fmt.Fprint(s, obj.Rconv(int(n.Reg)))
-
case OLITERAL: // this is a bit of a mess
if fmtmode == FErr {
if n.Orig != nil && n.Orig != n {
default:
fmt.Fprintf(s, "%v%j", n.Op, n)
- case OREGISTER, OINDREG:
- fmt.Fprintf(s, "%v-%v%j", n.Op, obj.Rconv(int(n.Reg)), n)
+ case OINDREGSP:
+ fmt.Fprintf(s, "%v-SP%j", n.Op, n)
case OLITERAL:
fmt.Fprintf(s, "%v-%v%j", n.Op, n.Val(), n)
Fatalf("bad fp")
case 0: // preparing arguments for call
- n.Op = OINDREG
- n.Reg = int16(Thearch.REGSP)
+ n.Op = OINDREGSP
n.Xoffset += Ctxt.FixedFrameSize()
case 1: // reading arguments inside call
OCHECKNIL: "CHECKNIL",
OVARKILL: "VARKILL",
OVARLIVE: "VARLIVE",
- OREGISTER: "REGISTER",
- OINDREG: "INDREG",
+ OINDREGSP: "INDREGSP",
OCMP: "CMP",
ODEC: "DEC",
OINC: "INC",
OCHECKNIL, // always followed by a read.
OCLOSUREVAR, // immutable pointer to captured variable
ODOTMETH, // either part of CALLMETH or CALLPART (lowered to PTRLIT)
- OINDREG, // at this stage, only n(SP) nodes from nodarg
+ OINDREGSP, // at this stage, only n(SP) nodes from nodarg
ODCL, // declarations (without value) cannot be races
ODCLCONST,
ODCLTYPE,
// Make a fake node to mimic loading return value, ONLY for write barrier test.
// This is future-proofing against non-scalar 2-result intrinsics.
// Currently we only have scalar ones, which result in no write barrier.
- fakeret := &Node{Op: OINDREG, Reg: int16(Thearch.REGSP)}
+ fakeret := &Node{Op: OINDREGSP}
s.assign(n.List.First(), v1, needwritebarrier(n.List.First(), fakeret), false, n.Lineno, 0, false)
s.assign(n.List.Second(), v2, needwritebarrier(n.List.Second(), fakeret), false, n.Lineno, 0, false)
return
// Note we know the volatile result is false because you can't write &f() in Go.
return a
- case OINDREG:
- if int(n.Reg) != Thearch.REGSP {
- s.Fatalf("OINDREG of non-SP register %s in expr: %v", obj.Rconv(int(n.Reg)), n)
- return nil
- }
+ case OINDREGSP:
addr := s.entryNewValue1I(ssa.OpOffPtr, ptrto(n.Type), n.Xoffset, s.sp)
return s.newValue2(ssa.OpLoad, n.Type, addr, s.mem())
s.Fatalf("variable address class %v not implemented", classnames[n.Class])
return nil, false
}
- case OINDREG:
- // indirect off a register
+ case OINDREGSP:
+ // indirect off REGSP
// used for storing/loading arguments/returns to/from callees
- if int(n.Reg) != Thearch.REGSP {
- s.Fatalf("OINDREG of non-SP register %s in addr: %v", obj.Rconv(int(n.Reg)), n)
- return nil, false
- }
return s.entryNewValue1I(ssa.OpOffPtr, t, n.Xoffset, s.sp), true
case OINDEX:
if n.Left.Type.IsSlice() {
}
switch n.Op {
- case OREGISTER, OLITERAL, ONAME:
+ case OLITERAL, ONAME:
ul = 1
if n.Class == PAUTOHEAP {
ul++
// Various. Usually an offset into a struct. For example:
// - ONAME nodes that refer to local variables use it to identify their stack frame position.
- // - ODOT, ODOTPTR, and OINDREG use it to indicate offset relative to their base address.
+ // - ODOT, ODOTPTR, and OINDREGSP use it to indicate offset relative to their base address.
// - OSTRUCTKEY uses it to store the named field's offset.
// - OXCASE and OXFALL use it to validate the use of fallthrough.
// Possibly still more uses. If you find any, document them.
Lineno int32
- // OREGISTER, OINDREG
- Reg int16
-
Esc uint16 // EscXXX
Op Op
OCHECKNIL // emit code to ensure pointer/interface not nil
OVARKILL // variable is dead
OVARLIVE // variable is alive
-
- // thearch-specific registers
- OREGISTER // a register, such as AX.
- OINDREG // offset plus indirect of a register, such as 8(SP).
+ OINDREGSP // offset plus indirect of REGSP, such as 8(SP).
// arch-specific opcodes
OCMP // compare: ACMP.
continue
}
- if lhs.Op != OINDREG {
- yyerror("call argument store does not use OINDREG")
+ if lhs.Op != OINDREGSP {
+ yyerror("call argument store does not use OINDREGSP")
}
// can't really check this in machine-indep code.
case OTYPE,
ONONAME,
- OINDREG,
+ OINDREGSP,
OEMPTY,
OGETG:
func iscallret(n *Node) bool {
n = outervalue(n)
- return n.Op == OINDREG && n.Reg == int16(Thearch.REGSP)
+ return n.Op == OINDREGSP
}
func isstack(n *Node) bool {
}
switch n.Op {
- case OINDREG:
- return n.Reg == int16(Thearch.REGSP)
+ case OINDREGSP:
+ return true
case ONAME:
switch n.Class {