compiler: introduce size threshold for nil checks

Add a new control variable to the Gogo class that stores the size
threshold for nil checks. This value can be used to control the
policy for deciding when a given deference operation needs a check and
when it does not. A size threshold of -1 means that every potentially
faulting dereference needs an explicit check (and branch to error
call). A size threshold of K (where K > 0) means that if the size of
the object being dereferenced is >= K, then we need a check.

Change-Id: Idf33b5c0b600dd20dfe549d3c74589868f3de8e8
Reviewed-on: https://go-review.googlesource.com/80996
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 files changed