1. 12 Apr, 2019 5 commits
    • Clément Chigot's avatar
      net: retrieve if unix network is available only once for AIX · 77fa11df
      Clément Chigot authored
      The previous version was executing "oslevel -s" everytime testableNetwork
      was called with unix/unixgram network. The current version retrieves if
      the network is possible only once at the beginning of the tests.
      
      This is clearly faster:
      ok      net     74.045s
      ok      net     5.098s
      
      Change-Id: I12549da27721f85c007cf17cab5cfdbfeb839cf6
      Reviewed-on: https://go-review.googlesource.com/c/go/+/171717
      Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      77fa11df
    • Daniel Langner's avatar
      doc/go_faq: fix grammar · 90458ec8
      Daniel Langner authored
      Change-Id: Idbd6c97d754e3565aeade4d9e8011a76e8da19c2
      GitHub-Last-Rev: 22e917e5ca429d76506346841e5b3c93c2a5f3fb
      GitHub-Pull-Request: golang/go#31439
      Reviewed-on: https://go-review.googlesource.com/c/go/+/171885Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      90458ec8
    • Austin Clements's avatar
      runtime: delete unused isscanstatus function · f448c212
      Austin Clements authored
      Change-Id: I693250e980cc60ea151736b42ac6b1426ab801b3
      Reviewed-on: https://go-review.googlesource.com/c/go/+/171765
      Run-TryBot: Austin Clements <austin@google.com>
      Reviewed-by: default avatarMichael Knyszek <mknyszek@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      f448c212
    • Tobias Klauser's avatar
      bootstrap.bash: fix build if no exec wrapper exists · df1cdbf7
      Tobias Klauser authored
      Since CL 170941 bootstrap.bash fails if no exec wrapper exists for a
      given GOOS/GOARCH yet:
      
        #### Building ../../go-linux-arm-bootstrap
      
        Building Go cmd/dist using /usr/local/go.
        Building Go toolchain1 using /usr/local/go.
        Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
        Building Go toolchain2 using go_bootstrap and Go toolchain1.
        Building Go toolchain3 using go_bootstrap and Go toolchain2.
        Building packages and commands for host, linux/amd64.
        Building packages and commands for target, linux/arm.
        rm: cannot remove 'bin/go_linux_arm_exec': No such file or directory
      
      Fix it by using 'rm -f' to ignore nonexisting files.
      
      Change-Id: Ib4b1e19747052fa4dca06319f35cc25a0545c4f7
      Reviewed-on: https://go-review.googlesource.com/c/go/+/171722
      Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarElias Naur <mail@eliasnaur.com>
      df1cdbf7
    • Josh Bleecher Snyder's avatar
      cmd/link: fix off-by-one in ftabaddstring · 7f9e0220
      Josh Bleecher Snyder authored
      ftabaddstring adds a string to the pclntab.
      The pclntab uses C strings, so the code added 1 to the length.
      However, it also added an extraneous 1 in the Grow call. Remove that.
      
      While we're here, simplify, document, remove an unnecessary parameter,
      and remove some unnecessary conversions.
      
      Shaves off a few bytes here and there, and thus updates #6853.
      
      file      before    after     Δ       %       
      go        14671316  14659028  -12288  -0.084% 
      addr2line 4280552   4276456   -4096   -0.096% 
      api       6058936   6050744   -8192   -0.135% 
      buildid   2861040   2856944   -4096   -0.143% 
      cgo       4867912   4863816   -4096   -0.084% 
      compile   25770104  25753720  -16384  -0.064% 
      cover     5286888   5282792   -4096   -0.077% 
      dist      3634048   3629952   -4096   -0.113% 
      doc       4691000   4686904   -4096   -0.087% 
      fix       3393736   3389640   -4096   -0.121% 
      link      6109280   6105184   -4096   -0.067% 
      nm        4225960   4221864   -4096   -0.097% 
      objdump   4636520   4632424   -4096   -0.088% 
      pack      2285200   2281104   -4096   -0.179% 
      pprof     14657508  14645220  -12288  -0.084% 
      test2json 2818568   2814472   -4096   -0.145% 
      trace     11618524  11610332  -8192   -0.071% 
      vet       8403544   8395352   -8192   -0.097% 
      
      Change-Id: I20b1f541de5d3ed326dd937aad6a43801862df51
      Reviewed-on: https://go-review.googlesource.com/c/go/+/171820
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      7f9e0220
  2. 11 Apr, 2019 11 commits
  3. 10 Apr, 2019 10 commits
  4. 09 Apr, 2019 8 commits
    • Cherry Zhang's avatar
      cmd/internal/obj/x86: allow non-zero offset in TLS reference · 68c66414
      Cherry Zhang authored
      An instruction that references TLS, e.g.
      
      MOVQ	0(TLS), AX
      
      on some platforms (e.g. Android), or in shared mode, may be
      translated to (assuming TLS offset already loaded to CX)
      
      MOVQ	0(CX)(TLS*1), AX
      
      which in turns translates to
      
      movq	%fs:(%rcx), %rax
      
      We have rejected non-zero offset for TLS reference, like 16(TLS).
      Actually, the instruction can take offset, i.e. it is a valid
      instruction for, e.g.,
      
      movq	%fs:16(%rcx),%rcx
      
      So, allow offset in TLS reference.
      
      Change-Id: Iaf1996bad7fe874e0c298ea441af5acb136a4028
      Reviewed-on: https://go-review.googlesource.com/c/go/+/171151
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      68c66414
    • Tobias Klauser's avatar
      strings: add TestIndexByte · 016625c2
      Tobias Klauser authored
      Add TestIndexByte to package strings similar to the already existing
      TestIndexByte in package bytes.
      
      Change-Id: Ib60695cb326156a4fe48138c66393ebbd11e4a25
      Reviewed-on: https://go-review.googlesource.com/c/go/+/171197
      Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      016625c2
    • Tobias Klauser's avatar
      strings: use Go style character range comparison in ToUpper/ToLower · 78175474
      Tobias Klauser authored
      As noted by Brad in CL 170954 for package bytes.
      
      Change-Id: I2772a356299e54ba5b7884d537e6649039adb9be
      Reviewed-on: https://go-review.googlesource.com/c/go/+/171198
      Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      78175474
    • Andrei Vagin's avatar
      runtime: preempt a goroutine which calls a lot of short system calls · 4166ff42
      Andrei Vagin authored
      A goroutine should be preempted if it runs for 10ms without blocking.
      We found that this doesn't work for goroutines which call short system calls.
      
      For example, the next program can stuck for seconds without this fix:
      
      $ cat main.go
      package main
      
      import (
      	"runtime"
      	"syscall"
      )
      
      func main() {
      	runtime.GOMAXPROCS(1)
      	c := make(chan int)
      	go func() {
      		c <- 1
      		for {
      			t := syscall.Timespec{
      				Nsec: 300,
      			}
      			if true {
      				syscall.Nanosleep(&t, nil)
      			}
      		}
      	}()
      	<-c
      }
      
      $ time go run main.go
      
      real	0m8.796s
      user	0m0.367s
      sys	0m0.893s
      
      Updates #10958
      
      Change-Id: Id3be54d3779cc28bfc8b33fe578f13778f1ae2a2
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170138Reviewed-by: default avatarDmitry Vyukov <dvyukov@google.com>
      Run-TryBot: Dmitry Vyukov <dvyukov@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      4166ff42
    • Tobias Klauser's avatar
      bytes: optimize ToLower and ToUpper for ASCII-only case · 08e1823a
      Tobias Klauser authored
      Follow what CL 68370 and CL 76470 did for the respective functions in
      package strings.
      
      Also adjust godoc strings to match the respective strings functions and
      mention the special case for ASCII-only byte slices which don't need
      conversion.
      
      name                                       old time/op  new time/op  delta
      ToUpper/#00-8                              9.35ns ± 3%  6.08ns ± 2%  -35.04%  (p=0.000 n=9+9)
      ToUpper/ONLYUPPER-8                        77.7ns ± 1%  16.9ns ± 2%  -78.22%  (p=0.000 n=10+10)
      ToUpper/abc-8                              36.5ns ± 1%  22.1ns ± 1%  -39.43%  (p=0.000 n=10+8)
      ToUpper/AbC123-8                           56.9ns ± 2%  28.2ns ± 2%  -50.54%  (p=0.000 n=8+10)
      ToUpper/azAZ09_-8                          62.3ns ± 1%  26.9ns ± 1%  -56.82%  (p=0.000 n=9+10)
      ToUpper/longStrinGwitHmixofsmaLLandcAps-8   219ns ± 2%    63ns ± 2%  -71.17%  (p=0.000 n=10+10)
      ToUpper/longɐstringɐwithɐnonasciiⱯchars-8   367ns ± 2%   374ns ± 3%   +2.05%  (p=0.000 n=9+10)
      ToUpper/ɐɐɐɐɐ-8                             200ns ± 1%   206ns ± 1%   +2.49%  (p=0.000 n=10+10)
      ToUpper/a\u0080\U0010ffff-8                90.4ns ± 1%  93.8ns ± 0%   +3.82%  (p=0.000 n=10+7)
      ToLower/#00-8                              9.59ns ± 1%  6.13ns ± 2%  -36.08%  (p=0.000 n=10+10)
      ToLower/abc-8                              36.4ns ± 1%  10.4ns ± 1%  -71.50%  (p=0.000 n=10+10)
      ToLower/AbC123-8                           55.8ns ± 1%  27.5ns ± 1%  -50.61%  (p=0.000 n=10+10)
      ToLower/azAZ09_-8                          61.7ns ± 1%  30.2ns ± 1%  -50.98%  (p=0.000 n=8+10)
      ToLower/longStrinGwitHmixofsmaLLandcAps-8   226ns ± 1%    64ns ± 1%  -71.53%  (p=0.000 n=10+9)
      ToLower/LONGⱯSTRINGⱯWITHⱯNONASCIIⱯCHARS-8   354ns ± 0%   361ns ± 0%   +2.18%  (p=0.000 n=10+10)
      ToLower/ⱭⱭⱭⱭⱭ-8                             180ns ± 1%   186ns ± 0%   +3.45%  (p=0.000 n=10+9)
      ToLower/A\u0080\U0010ffff-8                91.7ns ± 0%  94.5ns ± 0%   +2.99%  (p=0.000 n=10+10)
      
      Change-Id: Ifdb8ae328ff9feacd1c170db8eebbf98c399e204
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170954
      Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      08e1823a
    • Mikio Hara's avatar
      syscall: gofmt -w -s · 2ab75c0f
      Mikio Hara authored
      Change-Id: Ib46f1a528e16cd0c2617defbf4dcd1f1b582cdc2
      Reviewed-on: https://go-review.googlesource.com/c/go/+/171101
      Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      2ab75c0f
    • Mikio Hara's avatar
      cmd/cover: rename temporary directory prefix for consistency · 7ea4cd3f
      Mikio Hara authored
      This change renames the temporary directory prefix for testing to
      go-testcover from gotestcover. It looks like other packages have the
      "go-" prefix for temporary directories, such as go-build, go-tool-dist
      and go-nettest.
      
      Change-Id: I91ab570d33c4c1bb48e6e01451a811272f6f8b77
      Reviewed-on: https://go-review.googlesource.com/c/go/+/171100Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      7ea4cd3f
    • Neven Sajko's avatar
      all: change the old assembly style AX:CX to CX, AX · 7756a72b
      Neven Sajko authored
      Assembly files with "/vendor/" or "testdata" in their paths were ignored.
      
      Change-Id: I3882ff07eb4426abb9f8ee96f82dff73c81cd61f
      GitHub-Last-Rev: 51ae8c324d72a12a059272fcf8568e670bfaf21b
      GitHub-Pull-Request: golang/go#31166
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170197Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      7756a72b
  5. 08 Apr, 2019 6 commits