Commit bf499052 authored by Cuong Manh Le's avatar Cuong Manh Le Committed by Brad Fitzpatrick

cmd/compile: update comments to refer to Order methods

Change-Id: I09090effcc5d814d4e024da3f944e825365588f1
Reviewed-on: https://go-review.googlesource.com/c/go/+/205477
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 62581ee9
...@@ -216,7 +216,7 @@ func walkrange(n *Node) *Node { ...@@ -216,7 +216,7 @@ func walkrange(n *Node) *Node {
return n return n
} }
// orderstmt arranged for a copy of the array/slice variable if needed. // order.stmt arranged for a copy of the array/slice variable if needed.
ha := a ha := a
hv1 := temp(types.Types[TINT]) hv1 := temp(types.Types[TINT])
...@@ -291,7 +291,7 @@ func walkrange(n *Node) *Node { ...@@ -291,7 +291,7 @@ func walkrange(n *Node) *Node {
n.List.Set1(a) n.List.Set1(a)
case TMAP: case TMAP:
// orderstmt allocated the iterator for us. // order.stmt allocated the iterator for us.
// we only use a once, so no copy needed. // we only use a once, so no copy needed.
ha := a ha := a
...@@ -327,7 +327,7 @@ func walkrange(n *Node) *Node { ...@@ -327,7 +327,7 @@ func walkrange(n *Node) *Node {
} }
case TCHAN: case TCHAN:
// orderstmt arranged for a copy of the channel variable. // order.stmt arranged for a copy of the channel variable.
ha := a ha := a
n.Left = nil n.Left = nil
...@@ -371,7 +371,7 @@ func walkrange(n *Node) *Node { ...@@ -371,7 +371,7 @@ func walkrange(n *Node) *Node {
// // original body // // original body
// } // }
// orderstmt arranged for a copy of the string variable. // order.stmt arranged for a copy of the string variable.
ha := a ha := a
hv1 := temp(types.Types[TINT]) hv1 := temp(types.Types[TINT])
......
...@@ -651,7 +651,7 @@ opswitch: ...@@ -651,7 +651,7 @@ opswitch:
case ORECV: case ORECV:
// x = <-c; n.Left is x, n.Right.Left is c. // x = <-c; n.Left is x, n.Right.Left is c.
// orderstmt made sure x is addressable. // order.stmt made sure x is addressable.
n.Right.Left = walkexpr(n.Right.Left, init) n.Right.Left = walkexpr(n.Right.Left, init)
n1 := nod(OADDR, n.Left, nil) n1 := nod(OADDR, n.Left, nil)
...@@ -753,7 +753,7 @@ opswitch: ...@@ -753,7 +753,7 @@ opswitch:
key = r.Right key = r.Right
} else { } else {
// standard version takes key by reference // standard version takes key by reference
// orderexpr made sure key is addressable. // order.expr made sure key is addressable.
key = nod(OADDR, r.Right, nil) key = nod(OADDR, r.Right, nil)
} }
...@@ -806,7 +806,7 @@ opswitch: ...@@ -806,7 +806,7 @@ opswitch:
t := map_.Type t := map_.Type
fast := mapfast(t) fast := mapfast(t)
if fast == mapslow { if fast == mapslow {
// orderstmt made sure key is addressable. // order.stmt made sure key is addressable.
key = nod(OADDR, key, nil) key = nod(OADDR, key, nil)
} }
n = mkcall1(mapfndel(mapdelete[fast], t), nil, init, typename(t), map_, key) n = mkcall1(mapfndel(mapdelete[fast], t), nil, init, typename(t), map_, key)
...@@ -945,7 +945,7 @@ opswitch: ...@@ -945,7 +945,7 @@ opswitch:
// Orderexpr arranged for n.Left to be a temporary for all // Orderexpr arranged for n.Left to be a temporary for all
// the conversions it could see. Comparison of an interface // the conversions it could see. Comparison of an interface
// with a non-interface, especially in a switch on interface value // with a non-interface, especially in a switch on interface value
// with non-interface cases, is not visible to orderstmt, so we // with non-interface cases, is not visible to order.stmt, so we
// have to fall back on allocating a temp here. // have to fall back on allocating a temp here.
if !islvalue(v) { if !islvalue(v) {
v = copyexpr(v, v.Type, init) v = copyexpr(v, v.Type, init)
...@@ -1098,7 +1098,7 @@ opswitch: ...@@ -1098,7 +1098,7 @@ opswitch:
fast := mapfast(t) fast := mapfast(t)
if fast == mapslow { if fast == mapslow {
// standard version takes key by reference. // standard version takes key by reference.
// orderexpr made sure key is addressable. // order.expr made sure key is addressable.
key = nod(OADDR, key, nil) key = nod(OADDR, key, nil)
} }
n = mkcall1(mapfn(mapassign[fast], t), nil, init, typename(t), map_, key) n = mkcall1(mapfn(mapassign[fast], t), nil, init, typename(t), map_, key)
...@@ -1107,7 +1107,7 @@ opswitch: ...@@ -1107,7 +1107,7 @@ opswitch:
fast := mapfast(t) fast := mapfast(t)
if fast == mapslow { if fast == mapslow {
// standard version takes key by reference. // standard version takes key by reference.
// orderexpr made sure key is addressable. // order.expr made sure key is addressable.
key = nod(OADDR, key, nil) key = nod(OADDR, key, nil)
} }
...@@ -2526,7 +2526,7 @@ func writebarrierfn(name string, l *types.Type, r *types.Type) *Node { ...@@ -2526,7 +2526,7 @@ func writebarrierfn(name string, l *types.Type, r *types.Type) *Node {
} }
func addstr(n *Node, init *Nodes) *Node { func addstr(n *Node, init *Nodes) *Node {
// orderexpr rewrote OADDSTR to have a list of strings. // order.expr rewrote OADDSTR to have a list of strings.
c := n.List.Len() c := n.List.Len()
if c < 2 { if c < 2 {
...@@ -2559,7 +2559,7 @@ func addstr(n *Node, init *Nodes) *Node { ...@@ -2559,7 +2559,7 @@ func addstr(n *Node, init *Nodes) *Node {
var fn string var fn string
if c <= 5 { if c <= 5 {
// small numbers of strings use direct runtime helpers. // small numbers of strings use direct runtime helpers.
// note: orderexpr knows this cutoff too. // note: order.expr knows this cutoff too.
fn = fmt.Sprintf("concatstring%d", c) fn = fmt.Sprintf("concatstring%d", c)
} else { } else {
// large numbers of strings are passed to the runtime as a slice. // large numbers of strings are passed to the runtime as a slice.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment