1. 03 Dec, 2018 10 commits
  2. 02 Dec, 2018 2 commits
  3. 01 Dec, 2018 6 commits
  4. 30 Nov, 2018 10 commits
  5. 29 Nov, 2018 12 commits
    • Keith Randall's avatar
      cmd/compile: eliminate write barriers when writing non-heap ptrs · 2140975e
      Keith Randall authored
      We don't need a write barrier if:
      1) The location we're writing to doesn't hold a heap pointer, and
      2) The value we're writing isn't a heap pointer.
      
      The freshly returned value from runtime.newobject satisfies (1).
      Pointers to globals, and the contents of the read-only data section satisfy (2).
      
      This is particularly helpful for code like:
      p := []string{"abc", "def", "ghi"}
      
      Where the compiler generates:
         a := new([3]string)
         move(a, statictmp_)  // eliminates write barriers here
         p := a[:]
      
      For big slice literals, this makes the code a smaller and faster to
      compile.
      
      Update #13554. Reduces the compile time by ~10% and RSS by ~30%.
      
      Change-Id: Icab81db7591c8777f68e5d528abd48c7e44c87eb
      Reviewed-on: https://go-review.googlesource.com/c/151498
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAustin Clements <austin@google.com>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      2140975e
    • Austin Clements's avatar
      runtime: check more work flushing races · 438b9544
      Austin Clements authored
      This adds several new checks to help debug #27993. It adds a mechanism
      for freezing write barriers and gcWork puts during the mark completion
      algorithm. This way, if we do detect mark completion, we can catch any
      puts that happened during the completion algorithm. Based on build
      dashboard failures, this seems to be the window of time when these are
      happening.
      
      This also double-checks that all work buffers are empty immediately
      upon entering mark termination (much earlier than the current check).
      This is unlikely to trigger based on the current failures, but is a
      good safety net.
      
      Change-Id: I03f56c48c4322069e28c50fbc3c15b2fee2130c2
      Reviewed-on: https://go-review.googlesource.com/c/151797
      Run-TryBot: Austin Clements <austin@google.com>
      Reviewed-by: default avatarMichael Knyszek <mknyszek@google.com>
      438b9544
    • Ian Lance Taylor's avatar
      cmd/cgo: use field alignment when setting field offset · fbdaa965
      Ian Lance Taylor authored
      The old code ignored the field alignment, and only looked at the field
      offset: if the field offset required padding, cgo added padding. But
      while that approach works for Go (at least with the gc toolchain) it
      doesn't work for C code using packed structs. With a packed struct the
      added padding may leave the struct at a misaligned position, and the
      inserted alignment, which cgo is not considering, may introduce
      additional, unexpected, padding. Padding that ignores alignment is not
      a good idea when the struct is not packed, and Go structs are never
      packed. So don't ignore alignment.
      
      Fixes #28896
      
      Change-Id: Ie50ea15fa6dc35557497097be9fecfecb11efd8a
      Reviewed-on: https://go-review.googlesource.com/c/150602
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
      fbdaa965
    • Agniva De Sarker's avatar
      go/doc: convert to unicode quotes for ToText and Synopsis · 81a5c9c3
      Agniva De Sarker authored
      We refactor the conversion of quotes to their unicode equivalent
      to a separate function so that it can be called from ToText and Synopsis.
      
      And we introduce a temp buffer to write the escaped HTML and convert
      the unicode quotes back to html escaped entities. This simplifies the logic
      and gets rid of the need to track the index of the escaped text.
      
      Fixes #27759
      
      Change-Id: I71cf47ddcd4c6794ccdf2898ac25539388b393c1
      Reviewed-on: https://go-review.googlesource.com/c/150377
      Run-TryBot: Robert Griesemer <gri@golang.org>
      Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      81a5c9c3
    • Gergely Brautigam's avatar
      runtime: node ordering in mTreap; adjust code to reflect description. · 689fae2d
      Gergely Brautigam authored
      Adjust mTreap ordering logic to reflect the description of mTreap ordering.
      Before it was using unsafe.Pointer in order to gather the base address of
      a span. This has been changed to use base, which is the startAddress of a
      span as the description is telling us in mgclarge.go.
      
      Fixes: golang/go#28805
      
      Change-Id: Ib3cd94a0757e23d135b5d41830f38fc08bcf16a3
      GitHub-Last-Rev: 93f749b6700b1e179de16607a18395d5e162ecc1
      GitHub-Pull-Request: golang/go#28973
      Reviewed-on: https://go-review.googlesource.com/c/151499Reviewed-by: default avatarMichael Knyszek <mknyszek@google.com>
      Run-TryBot: Michael Knyszek <mknyszek@google.com>
      689fae2d
    • Bryan C. Mills's avatar
      cmd/doc: treat any non-empty GOMOD as module mode · ec4de31c
      Bryan C. Mills authored
      Previously, we were looking for the string go.mod specifically, but
      the module-mode-outside-a-module logic added in CL 148517 sets GOMOD
      to os.DevNull
      
      Updates #28992
      
      Change-Id: I62a4baaa911a495350294d78bae96be3fe4866cb
      Reviewed-on: https://go-review.googlesource.com/c/151617
      Run-TryBot: Bryan C. Mills <bcmills@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      ec4de31c
    • Bryan C. Mills's avatar
      cmd/go/internal/modfetch: document DownloadDir · c37b6ecc
      Bryan C. Mills authored
      Change-Id: I4717964234fca0c8c5889ed710b66f39eb53a809
      Reviewed-on: https://go-review.googlesource.com/c/151562
      Run-TryBot: Bryan C. Mills <bcmills@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      c37b6ecc
    • Bryan C. Mills's avatar
      cmd/go/testdata/mod: remove unused research.swtch.com/vgo-tour · 20950dba
      Bryan C. Mills authored
      The test that used that module was removed in
      https://golang.org/cl/128900.
      
      Change-Id: Id96270a52398c8ccc09821efb2a6a6b4764f44d9
      Reviewed-on: https://go-review.googlesource.com/c/151560
      Run-TryBot: Bryan C. Mills <bcmills@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      20950dba
    • Bryan C. Mills's avatar
      cmd/go/internal/load: remove redundant assignment to BinDir · aab0b704
      Bryan C. Mills authored
      This assignment became a no-op in CL 36196, where both it and the
      preceding assignment were changed to cfg.GOROOTbin (from gorootBin and
      gobin respectively).
      
      Change-Id: If74969c4cc3ffc5d8394ff9d8e8bcec9e0a4e3b0
      Reviewed-on: https://go-review.googlesource.com/c/151561
      Run-TryBot: Bryan C. Mills <bcmills@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      aab0b704
    • Bryan C. Mills's avatar
      cmd/go/internal/modcmd: check for errors in Download · 365a1877
      Bryan C. Mills authored
      Also test that Download restores deleted files.
      
      Updates #27783
      
      Change-Id: If50074dbcffd74ff08fbaa9ad8c314cfdce0b02d
      Reviewed-on: https://go-review.googlesource.com/c/151559
      Run-TryBot: Bryan C. Mills <bcmills@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      365a1877
    • Bryan C. Mills's avatar
      cmd/go: enable module mode without a main module when GO111MODULE=on · cdbd4d49
      Bryan C. Mills authored
      This is as minimal a change as I could comfortably make to enable 'go
      get' outside of a module for 1.12.
      
      In general, commands invoked in module mode while outside of a module
      operate as though they are in a module with an initially-empty go.mod
      file. ('go env GOMOD' reports os.DevNull.)
      
      Commands that operate on the current directory (such as 'go list' and
      'go get -u' without arguments) fail: without a module definition, we
      don't know the package path. Likewise, commands whose sole purpose is
      to write files within the main module (such as 'go mod edit' and 'go
      mod vendor') fail, since we don't know where to write their output.
      
      Since the go.sum file for the main module is authoritative, we do not
      check go.sum files when operating outside of a module. I plan to
      revisit that when the tree opens for 1.13.
      
      We may also want to revisit the behavior of 'go list': it would be
      useful to be able to query individual packages (and dependencies of
      those packages) within versioned modules, but today we only allow
      versioned paths in conjunction with the '-m' flag.
      
      Fixes #24250
      
      RELNOTE=yes
      
      Change-Id: I028c323ddea27693a92ad0aa4a6a55d5e3f43f2c
      Reviewed-on: https://go-review.googlesource.com/c/148517
      Run-TryBot: Bryan C. Mills <bcmills@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      cdbd4d49
    • Bryan C. Mills's avatar
      cmd/go/internal/modfetch/codehost: add lockfiles for repos · a2b4ac6c
      Bryan C. Mills authored
      The lockfile guards calls that may change the repo's filesystem contents.
      
      We don't know how robust VCS implementations are to running
      simultaneous commands, and this way we don't need to care: only one
      'go' command at a time will modify any given repository.
      
      If we can guarantee that particular VCS implementations are robust
      enough across all of the VCS tool versions we support, we may be able
      to remove some of this locking to improve parallelism.
      
      Updates #26794
      
      Change-Id: I578524974f5015629239cef43d3793aee2b9075c
      Reviewed-on: https://go-review.googlesource.com/c/146381
      Run-TryBot: Bryan C. Mills <bcmills@google.com>
      Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      a2b4ac6c