]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/escape: support OITAB and OCHECKNIL
authorMatthew Dempsky <mdempsky@google.com>
Mon, 8 Aug 2022 20:23:04 +0000 (13:23 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 9 Aug 2022 16:41:39 +0000 (16:41 +0000)
commit0c2f87f23d72841544e372fac0bcf5168324d8c9
tree2b48fdaf1ddefee48b250656d145e3fc4a665bbc
parent25d74f324dde687e1bbf486ef444a1f73f48f4eb
cmd/compile/internal/escape: support OITAB and OCHECKNIL

For interface method values, we nil check the receiver value at the
point of evaluating the method value. Currently this is inserted by
the backend during walk, but in some cases it's useful to emit them
upfront instead.

OITAB is essentially a field selection operation, like ODOT, OIDATA,
and OSPTR.

OCHECKNIL is a statement that simply evaluates its unary operand, and
discards the result (after testing for nil).

Change-Id: I583b5170539caa9a87aec661d5c293080fd87fbb
Reviewed-on: https://go-review.googlesource.com/c/go/+/422197
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
src/cmd/compile/internal/escape/expr.go
src/cmd/compile/internal/escape/stmt.go