1. 30 Sep, 2016 5 commits
    • David Crawshaw's avatar
      runtime: remove defer from standard cgo call · 44150215
      David Crawshaw authored
      The endcgo function call is currently deferred in case a cgo
      callback into Go panics and unwinds through cgocall. Typical cgo
      calls do not have callbacks into Go, and even fewer panic, so we
      pay the cost of this defer for no typical benefit.
      
      Amazingly, there is another defer on the cgocallback path also used
      to cleanup in case the Go code called by cgo panics. This CL folds
      the first defer into the second, to reduce the cost of typical cgo
      calls.
      
      This reduces the overhead for a no-op cgo call significantly:
      
      	name       old time/op  new time/op  delta
      	CgoNoop-8  93.5ns ± 0%  51.1ns ± 1%  -45.34%  (p=0.016 n=4+5)
      
      The total effect between Go 1.7 and 1.8 is even greater, as CL 29656
      reduced the cost of defer recently. Hopefully a future Go release
      will drop the cost of defer to nothing, making this optimization
      unnecessary. But until then, this is nice.
      
      Change-Id: Id1a5648f687a87001d95bec6842e4054bd20ee4f
      Reviewed-on: https://go-review.googlesource.com/30080
      Run-TryBot: David Crawshaw <crawshaw@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      44150215
    • Matthew Dempsky's avatar
      runtime, syscall: use FP instead of SP for parameters · 9828b7c4
      Matthew Dempsky authored
      Consistently access function parameters using the FP pseudo-register
      instead of SP (e.g., x+0(FP) instead of x+4(SP) or x+8(SP), depending
      on register size). Two reasons: 1) doc/asm says the SP pseudo-register
      should use negative offsets in the range [-framesize, 0), and 2)
      cmd/vet only validates parameter offsets when indexed from the FP
      pseudo-register.
      
      No binary changes to the compiled object files for any of the affected
      package/OS/arch combinations.
      
      Change-Id: I0efc6079bc7519fcea588c114ec6a39b245d68b0
      Reviewed-on: https://go-review.googlesource.com/30085Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      9828b7c4
    • Matthew Dempsky's avatar
      cmd/compile: eliminate stkdelta · 79db1625
      Matthew Dempsky authored
      At this point in the compiler we haven't assigned Xoffset values for
      PAUTO variables anyway, so just immediately store the stack offsets
      into Xoffset rather than into a global map.
      
      Change-Id: I61eb471c857c8b145fd0895cbd98fd4e8d3c3365
      Reviewed-on: https://go-review.googlesource.com/30081
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      79db1625
    • Matthew Dempsky's avatar
      cmd/compile: split Addrconst out of Naddr · bb2bbfa0
      Matthew Dempsky authored
      There are only three Prog types that we were creating with an OLITERAL
      Node: ATEXT, ATYPE, and AFUNCDATA. ATEXT's value we later overwrite in
      defframe, and ATYPE's we don't even need. AFUNCDATA only needs integer
      constants, so get rid of all the non-int constant logic and skip
      creating a Node representation for the constant.
      
      While here, there are a few other Naddr code paths that are no longer
      needed, so turn those into Fatalfs.
      
      Passes toolstash/buildall.
      
      Change-Id: I4cc9b92c3011890afd4f31ebeba8b1b42b753cab
      Reviewed-on: https://go-review.googlesource.com/30074
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      bb2bbfa0
    • Brad Fitzpatrick's avatar
      net/http: remove TODO about the Server's base context · 214bf680
      Brad Fitzpatrick authored
      I decided not to expand the API for this per discusion on #16220.
      
      Fixes #16220
      
      Change-Id: I65cb2eacd4ec28c79438a8f7c30024524a484ce6
      Reviewed-on: https://go-review.googlesource.com/30082Reviewed-by: default avatarDaniel Theophanes <kardianos@gmail.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      214bf680
  2. 29 Sep, 2016 17 commits
  3. 28 Sep, 2016 8 commits
  4. 27 Sep, 2016 10 commits