Commit 36694064 authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

cmd/compile: disable checknils during alg eq generation

Cuts 20k off cmd/go and 32k off golang.org/x/tools/cmd/godoc, approx 0.15% each.

For #6853 and #9930

Change-Id: Ic510b76b80a9153b1ede7b3533d2dbc16caa5c63
Reviewed-on: https://go-review.googlesource.com/19768
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarDavid Crawshaw <crawshaw@golang.org>
parent e7f6d8b2
...@@ -2862,10 +2862,18 @@ func geneq(sym *Sym, t *Type) { ...@@ -2862,10 +2862,18 @@ func geneq(sym *Sym, t *Type) {
// for a struct containing a reflect.Value, which itself has // for a struct containing a reflect.Value, which itself has
// an unexported field of type unsafe.Pointer. // an unexported field of type unsafe.Pointer.
old_safemode := safemode old_safemode := safemode
safemode = 0 safemode = 0
// Disable checknils while compiling this code.
// We are comparing a struct or an array,
// neither of which can be nil, and our comparisons
// are shallow.
Disable_checknil++
funccompile(fn) funccompile(fn)
safemode = old_safemode safemode = old_safemode
Disable_checknil--
} }
func ifacelookdot(s *Sym, t *Type, followptr *bool, ignorecase int) *Type { func ifacelookdot(s *Sym, t *Type, followptr *bool, ignorecase int) *Type {
......
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