1. 13 Mar, 2017 15 commits
  2. 12 Mar, 2017 2 commits
    • Martin Möhrmann's avatar
      strconv: fix performance regression in integer formatting on 32bit platforms · b71ed4ed
      Martin Möhrmann authored
      Some of the changes in CL golang.org/cl/38071/ assumed that / and %
      could always be combined to use only one DIV instruction. However,
      this is not the case for 64bit operands on a 32bit platform which use
      seperate runtime functions to calculate division and modulo.
      
      This CL restores the original optimizations that help on 32bit platforms
      with negligible impact on 64bit platforms.
      
      386:
      name          old time/op  new time/op  delta
      FormatInt-2   6.06µs ± 0%  6.02µs ± 0%  -0.70%  (p=0.000 n=20+20)
      AppendInt-2   4.98µs ± 0%  4.98µs ± 0%    ~     (p=0.747 n=18+18)
      FormatUint-2  1.93µs ± 0%  1.85µs ± 0%  -4.19%  (p=0.000 n=20+20)
      AppendUint-2  1.71µs ± 0%  1.64µs ± 0%  -3.68%  (p=0.000 n=20+20)
      
      amd64:
      name          old time/op  new time/op  delta
      FormatInt-2   2.41µs ± 0%  2.41µs ± 0%  -0.09%  (p=0.010 n=18+18)
      AppendInt-2   1.77µs ± 0%  1.77µs ± 0%  +0.08%  (p=0.000 n=18+18)
      FormatUint-2   653ns ± 1%   653ns ± 0%    ~     (p=0.178 n=20+20)
      AppendUint-2   514ns ± 0%   513ns ± 0%  -0.13%  (p=0.000 n=20+17)
      
      Change-Id: I574a18e54fb41b25fbe51ce696e7a8765abc79a6
      Reviewed-on: https://go-review.googlesource.com/38051
      Run-TryBot: Martin Möhrmann <moehrmann@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      b71ed4ed
    • Matthew Dempsky's avatar
      cmd/link: eliminate markextra · d3434782
      Matthew Dempsky authored
      This appears to be leftover from when instruction selection happened
      in the linker. Many of the morestackX functions listed don't even
      exist anymore.
      
      Now that we select instructions within the compiler and assembler,
      normal deadcode elimination mechanisms should suffice for these
      symbols.
      
      Change-Id: I2cb1e435101392e7c983957c4acfbbcc87a5ca7d
      Reviewed-on: https://go-review.googlesource.com/38077
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      d3434782
  3. 11 Mar, 2017 4 commits
  4. 10 Mar, 2017 9 commits
  5. 09 Mar, 2017 10 commits
    • Josh Bleecher Snyder's avatar
      cmd/compile: rename Func.constVal arg for clarity · c63ad970
      Josh Bleecher Snyder authored
      Values have an Aux and an AuxInt.
      We're setting AuxInt, not Aux.
      Say so.
      
      Change-Id: I41aa783273bb7e1ba47c941aa4233f818e37dadd
      Reviewed-on: https://go-review.googlesource.com/37997
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      c63ad970
    • Robert Griesemer's avatar
      cmd/compile: print columns (not just lines) in error messages · 2a5cf48f
      Robert Griesemer authored
      Compiler errors now show the exact line and line byte offset (sometimes
      called "column") of where an error occured. For `go tool compile x.go`:
      
      	package p
      	const c int = false
      	//line foo.go:123
      	type t intg
      
      reports
      
      	x.go:2:7: cannot convert false to type int
      	foo.go:123[x.go:4:8]: undefined: intg
      
      (Some errors use the "wrong" position for the error message; arguably
      the byte offset for the first error should be 15, the position of 'false',
      rathen than 7, the position of 'c'. But that is an indepedent issue.)
      
      The byte offset (column) values are measured in bytes; they start at 1,
      matching the convention used by editors and IDEs.
      
      Positions modified by //line directives show the line offset only for the
      actual source location (in square brackets), not for the "virtual" file and
      line number because that code is likely generated and the //line directive
      only provides line information.
      
      Because the new format might break existing tools or scripts, printing
      of line offsets can be disabled with the new compiler flag -C. We plan
      to remove this flag eventually.
      
      Fixes #10324.
      
      Change-Id: I493f5ee6e78457cf7b00025aba6b6e28e50bb740
      Reviewed-on: https://go-review.googlesource.com/37970Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      2a5cf48f
    • Robert Griesemer's avatar
      cmd/compile/internal/syntax: start line offset (column) numbers at 1 · 1f9f0ea3
      Robert Griesemer authored
      We could leave it alone and fix line offset (column) numbers when
      reporting errors, but that is likely to cause confusion (internal
      numbers don't match reported numbers). Instead, switch to default
      numbering starting at 1.
      
      For package syntax-internal use only, introduced constants defining
      the line and column bases, and use them throughout the code and its
      tests. It is possible to change these constants and package syntax
      will continue to work. But changing them is going to break any client
      that makes explicit assumptions about line and column numbers (which
      is "all of them").
      
      Change-Id: Ia3d136a8ec8d9372ed9c05ca47d3dff222cf030e
      Reviewed-on: https://go-review.googlesource.com/37996Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      1f9f0ea3
    • Paul Marks's avatar
      net: add Resolver.StrictErrors · bfc164c6
      Paul Marks authored
      When LookupIP is performing multiple subqueries, this option causes a
      timeout/servfail affecting a single query to abort the whole operation,
      instead of returning a partial (IPv4/IPv6-only) result.
      
      Similarly, operations that walk the DNS search list will also abort when
      encountering one of these errors.
      
      Fixes #17448
      
      Change-Id: Ice22e4aceb555c5a80d19bd1fde8b8fe87ac9517
      Reviewed-on: https://go-review.googlesource.com/32572Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      bfc164c6
    • Philip Hofer's avatar
      cmd/compile: clean up ssa.Value memory arg usage · b0e91d83
      Philip Hofer authored
      This change adds a method to replace expressions
      of the form
      
         v.Args[len(v.Args)-1]
      
      so that the code's intention to walk memory arguments
      is explicit.
      
      Passes toolstash-check.
      
      Change-Id: I0c80d73bc00989dd3cdf72b4f2c8e1075a2515e0
      Reviewed-on: https://go-review.googlesource.com/37757
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      b0e91d83
    • Cherry Zhang's avatar
      cmd/compile: remove duplicated zeroing of outgoing args · e471ad91
      Cherry Zhang authored
      Outgoing arg zeroing code is inserted at walk.go:paramstoheap.
      Don't do it twice.
      
      Change-Id: I70afac6af9e39b3efce0a6a79d6193428d922708
      Reviewed-on: https://go-review.googlesource.com/37863
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      e471ad91
    • Daniel Martí's avatar
      src/*.bash: use tabs consistently · 027500ce
      Daniel Martí authored
      make.bash used mostly tabs and buildall.bash used mostly spaces, but
      they were both mixing them. Be consistent and use tabs, as that's what's
      more common and what the Go code uses.
      
      Change-Id: Ia6affbfccfe64fda800c1ac400965df364d2c545
      Reviewed-on: https://go-review.googlesource.com/37967Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      027500ce
    • Michael Munday's avatar
      cmd/compile: fix OffPtr type in 2-field struct Store rule · 945180fe
      Michael Munday authored
      The type of the OffPtr for the first field was incorrect. It should
      have been a pointer to the field type, rather than the field
      type itself.
      
      Fixes #19475.
      
      Change-Id: I3960b404da0f4bee759331126cce6140d2ce1df7
      Reviewed-on: https://go-review.googlesource.com/37869
      Run-TryBot: Michael Munday <munday@ca.ibm.com>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      945180fe
    • Bryan C. Mills's avatar
      runtime/cgo: return correct sa_flags · 4210930a
      Bryan C. Mills authored
      A typo in the previous revision ("act" instead of "oldact") caused us
      to return the sa_flags from the new (or zeroed) sigaction rather than
      the old one.
      
      In the presence of a signal handler registered before
      runtime.libpreinit, this caused setsigstack to erroneously zero out
      important sa_flags (such as SA_SIGINFO) in its attempt to re-register
      the existing handler with SA_ONSTACK.
      
      Change-Id: I3cd5152a38ec0d44ae611f183bc1651d65b8a115
      Reviewed-on: https://go-review.googlesource.com/37852
      Run-TryBot: Bryan Mills <bcmills@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      4210930a
    • Bryan C. Mills's avatar
      runtime: fix _cgo_yield usage with sysmon and on BSD · e57350f4
      Bryan C. Mills authored
      There are a few problems from change 35494, discovered during testing
      of change 37852.
      
      1. I was confused about the usage of n.key in the sema variant, so we
         were looping on the wrong condition. The error was not caught by
         the TryBots (presumably due to missing TSAN coverage in the BSD and
         darwin builders?).
      
      2. The sysmon goroutine sometimes skips notetsleep entirely, using
         direct usleep syscalls instead. In that case, we were not calling
         _cgo_yield, leading to missed signals under TSAN.
      
      3. Some notetsleep calls have long finite timeouts. They should be
         broken up into smaller chunks with a yield at the end of each
         chunk.
      
      updates #18717
      
      Change-Id: I91175af5dea3857deebc686f51a8a40f9d690bcc
      Reviewed-on: https://go-review.googlesource.com/37867
      Run-TryBot: Bryan Mills <bcmills@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      e57350f4