1. 21 Mar, 2016 30 commits
  2. 20 Mar, 2016 10 commits
    • Richard Miller's avatar
      net/http: adaptive wait time in PersistConnLeak tests · 34f0c0b3
      Richard Miller authored
      In tests TransportPersistConnLeak and TransportPersistConnLeakShortBody,
      there's a fixed wait time (100ms and 400ms respectively) to allow
      goroutines to exit after CloseIdleConnections is called. This
      is sometimes too short on a slow host running many simultaneous
      tests.
      
      This CL replaces the fixed sleep in each test with a sequence of
      shorter sleeps, testing the number of remaining goroutines until
      it reaches the threshold or an overall time limit of 500ms expires.
      This prevents some failures in the plan9_arm builder, while reducing
      the test time on faster machines.
      
      Fixes #14887
      
      Change-Id: Ia5c871062df139e2667cdfb2ce8283e135435318
      Reviewed-on: https://go-review.googlesource.com/20922
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      34f0c0b3
    • Alexandru Moșoi's avatar
      cmd/compile: add rules to simplify AddPtr · a7a19994
      Alexandru Moșoi authored
      Fixes #14849
      
      Change-Id: I86e2dc27ca73bb6b24261a68cbf0094a63167414
      Reviewed-on: https://go-review.googlesource.com/20833Reviewed-by: default avatarKeith Randall <khr@golang.org>
      Run-TryBot: Alexandru Moșoi <alexandru@mosoi.ro>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      a7a19994
    • Ian Lance Taylor's avatar
      cmd/compile: fix varexpr handling of ODOT · a9407b57
      Ian Lance Taylor authored
      For a long time varexpr has handled ODOT incorrectly: it has always
      returned false.  Before https://golang.org/cl/20890 this has been
      because an ODOT had a Right field with an ONAME with no Class, for which
      varexpr returns false.  CL 20890 preserved the behavior of varexpr for
      ODOT, so that the change would pass toolstash -cmp.
      
      This CL fixes varexpr so that ODOT can return true in some cases.  This
      breaks toolstash -cmp.  While the changed compiler allocates temporary
      variables in a different order, I have not been able to find any
      examples where the generated code is different, other than using
      different stack offsets and, in some cases, registers.  It seems that
      other parts of the compiler will force the ODOT into a temporary anyhow.
      
      Still, this change is clearly correct, and is a minor compiler cleanup.
      
      Change-Id: I71506877aa3c13966bb03c281aa16271ee7fe80a
      Reviewed-on: https://go-review.googlesource.com/20907
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      Reviewed-by: default avatarDavid Crawshaw <crawshaw@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      a9407b57
    • Shahar Kohanim's avatar
      cmd/link: patch up symbols only once per object file · 93098de0
      Shahar Kohanim authored
      name       old s/op   new s/op   delta
      LinkCmdGo  0.57 ± 5%  0.55 ± 6%  -2.37%  (p=0.000 n=97+98)
      
      GOGC=off:
      
      name       old s/op   new s/op   delta
      LinkCmdGo  0.48 ± 3%  0.47 ± 3%  -2.90%  (p=0.000 n=100+100)
      
      Change-Id: I1a36dbf84914cacb79842bc0ddb1e26b4c5a5828
      Reviewed-on: https://go-review.googlesource.com/20917Reviewed-by: default avatarDavid Crawshaw <crawshaw@golang.org>
      Run-TryBot: David Crawshaw <crawshaw@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      93098de0
    • Ian Lance Taylor's avatar
      cmd/compile: don't penalize ODOT and friends when inlining · 060038bd
      Ian Lance Taylor authored
      Historically ODOT and friends have been considered to cost an extra
      budget point when deciding whether they should be inlined, because they
      had an ONAME node that represented the name to the right of the dot.
      This doesn't really make sense, as in general that symbol does not add
      any extra instructions; it just affects the offset of the load or store
      instruction.  And the ONAME node is gone now.  So, remove the extra
      cost.
      
      This does not pass toolstash -cmp, as it changes inlining decisions.
      For example, mspan.init in runtime/mheap.go is now considered to be an
      inlining candidate.
      
      Change-Id: I5ad27f08c66fd5daa4c8472dd0795df989183f5e
      Reviewed-on: https://go-review.googlesource.com/20891Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      060038bd
    • Shahar Kohanim's avatar
      cmd/link: use encbuf when writing integers · d6d33f67
      Shahar Kohanim authored
      name       old s/op   new s/op   delta
      LinkCmdGo  0.59 ± 6%  0.58 ± 5%  -1.61%  (p=0.000 n=99+99)
      
      GOGC=off:
      name       old s/op   new s/op   delta
      LinkCmdGo  0.50 ± 3%  0.49 ± 3%  -1.28%  (p=0.000 n=98+99)
      
      Change-Id: I737ae056214999441a210c69ec0cf4febc39a715
      Reviewed-on: https://go-review.googlesource.com/20914Reviewed-by: default avatarDavid Crawshaw <crawshaw@golang.org>
      Run-TryBot: David Crawshaw <crawshaw@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      d6d33f67
    • Shahar Kohanim's avatar
      cmd/compile, cmd/link: remove unused fields from relocations · 78fc59ef
      Shahar Kohanim authored
      Reduces size of archives in pkg/linux_amd64 by 3% from 41.5MB to 40.2MB
      
      Change-Id: Id64ca7995de8dd84c9e7ce1985730927cf4bfd66
      Reviewed-on: https://go-review.googlesource.com/20912Reviewed-by: default avatarDavid Crawshaw <crawshaw@golang.org>
      78fc59ef
    • Shahar Kohanim's avatar
      cmd/link: optimize int parsing · 35049450
      Shahar Kohanim authored
      Speeds up linking cmd/go by ~1.5%:
      
      name       old s/op   new s/op   delta
      LinkCmdGo  0.58 ± 6%  0.57 ± 5%  -1.21%  (p=0.000 n=98+99)
      
      Less noisy benchmark, with garbage collection off:
      
      name       old s/op   new s/op   delta
      LinkCmdGo  0.49 ± 2%  0.49 ± 2%  -1.79%  (p=0.000 n=98+99)
      
      Change-Id: I0123bcb66a87cbc4d703356e4c5a4035032012ec
      Reviewed-on: https://go-review.googlesource.com/20916Reviewed-by: default avatarDavid Crawshaw <crawshaw@golang.org>
      Run-TryBot: David Crawshaw <crawshaw@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      35049450
    • Martin Möhrmann's avatar
      fmt: unify integer formatting · 8d9ece9d
      Martin Möhrmann authored
      Deduplicate the verb switch for signed and unsigned integer formatting.
      
      Make names of integer related functions consistent
      with names of other fmt functions.
      
      Consolidate basic integer tests.
      
      Change-Id: I0c19c24f1c2c06a3b1a4d7d377dcdac3b36bb0f5
      Reviewed-on: https://go-review.googlesource.com/20831
      Run-TryBot: Rob Pike <r@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRob Pike <r@golang.org>
      8d9ece9d
    • Matthew Dempsky's avatar
      cmd/compile: ignore receiver name when checking duplicate methods · 3eaa3046
      Matthew Dempsky authored
      In golang.org/cl/20602, I changed the semantics of Eqtype to stop
      checking the receiver parameters for type equality, and pushed this
      responsibility to addmethod (the only Eqtype caller that cared).
      However, I accidentally made the check stricter by making it start
      requiring that receiver names were identical.
      
      In general, this is a non-problem because the receiver names in export
      data will always match the original source. But running
      GO_GCFLAGS=-newexport ./all.bash at one point tries to load both old
      and new format export data for package sync, which reveals the
      problem. (See golang.org/issue/14877 for details.)
      
      Easy fix: just check the receiver type for type equality in addmethod,
      instead of the entire receiver parameter list.
      
      Fixes #14877.
      
      Change-Id: If10b79f66ba58a1b7774622b4fbad1916aba32f1
      Reviewed-on: https://go-review.googlesource.com/20906
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      3eaa3046