mirror of
https://github.com/golang/go
synced 2024-11-12 08:20:22 -07:00
cmd/compile: stop constructing sudog type
The compiler doesn't care about the runtime's sudog type. Stop constructing it. Change-Id: If1885fe30b2e215a08d17662eab5ea6d81fe58ab Reviewed-on: https://go-review.googlesource.com/20797 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Austin Clements <austin@google.com>
This commit is contained in:
parent
65b4020403
commit
ac74e5debc
@ -317,24 +317,10 @@ out:
|
||||
lineno = lno
|
||||
}
|
||||
|
||||
// Keep in sync with src/runtime/runtime2.go and src/runtime/select.go.
|
||||
// Keep in sync with src/runtime/select.go.
|
||||
func selecttype(size int32) *Type {
|
||||
// TODO(dvyukov): it's possible to generate SudoG and Scase only once
|
||||
// TODO(dvyukov): it's possible to generate Scase only once
|
||||
// and then cache; and also cache Select per size.
|
||||
sudog := Nod(OTSTRUCT, nil, nil)
|
||||
|
||||
sudog.List.Append(Nod(ODCLFIELD, newname(Lookup("g")), typenod(Ptrto(Types[TUINT8]))))
|
||||
sudog.List.Append(Nod(ODCLFIELD, newname(Lookup("selectdone")), typenod(Ptrto(Types[TUINT8]))))
|
||||
sudog.List.Append(Nod(ODCLFIELD, newname(Lookup("next")), typenod(Ptrto(Types[TUINT8]))))
|
||||
sudog.List.Append(Nod(ODCLFIELD, newname(Lookup("prev")), typenod(Ptrto(Types[TUINT8]))))
|
||||
sudog.List.Append(Nod(ODCLFIELD, newname(Lookup("elem")), typenod(Ptrto(Types[TUINT8]))))
|
||||
sudog.List.Append(Nod(ODCLFIELD, newname(Lookup("releasetime")), typenod(Types[TUINT64])))
|
||||
sudog.List.Append(Nod(ODCLFIELD, newname(Lookup("ticket")), typenod(Types[TUINT32])))
|
||||
sudog.List.Append(Nod(ODCLFIELD, newname(Lookup("waitlink")), typenod(Ptrto(Types[TUINT8]))))
|
||||
sudog.List.Append(Nod(ODCLFIELD, newname(Lookup("c")), typenod(Ptrto(Types[TUINT8]))))
|
||||
typecheck(&sudog, Etype)
|
||||
sudog.Type.Noalg = true
|
||||
sudog.Type.Local = true
|
||||
|
||||
scase := Nod(OTSTRUCT, nil, nil)
|
||||
scase.List.Append(Nod(ODCLFIELD, newname(Lookup("elem")), typenod(Ptrto(Types[TUINT8]))))
|
||||
|
@ -210,9 +210,6 @@ type gobuf struct {
|
||||
bp uintptr // for GOEXPERIMENT=framepointer
|
||||
}
|
||||
|
||||
// Known to compiler.
|
||||
// Changes here must also be made in src/cmd/compile/internal/gc/select.go's
|
||||
// selecttype.
|
||||
type sudog struct {
|
||||
// The following fields are protected by the hchan.lock of the
|
||||
// channel this sudog is blocking on. shrinkstack depends on
|
||||
|
Loading…
Reference in New Issue
Block a user