1. 22 May, 2017 10 commits
  2. 20 May, 2017 2 commits
  3. 19 May, 2017 12 commits
  4. 18 May, 2017 16 commits
    • Brad Fitzpatrick's avatar
      os: add some comments and remove an unused variable in rename func · ca598e3c
      Brad Fitzpatrick authored
      This slightly clarifies the just-submitted CL 40577.
      
      Updates #19647
      
      Change-Id: I5584ad0e1abbc31796e3e5752351857f2a13d6d7
      Reviewed-on: https://go-review.googlesource.com/43625
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      ca598e3c
    • Alessandro Arzilli's avatar
      cmd/compile: output DWARF lexical blocks for local variables · 2ad41a30
      Alessandro Arzilli authored
      Change compiler and linker to emit DWARF lexical blocks in .debug_info
      section when compiling with -N -l.
      
      Version of debug_info is updated from DWARF v2 to DWARF v3 since
      version 2 does not allow lexical blocks with discontinuous PC ranges.
      
      Remaining open problems:
      - scope information is removed from inlined functions
      - variables records do not have DW_AT_start_scope attributes so a
      variable will shadow other variables with the same name as soon as its
      containing scope begins, even before its declaration.
      
      Updates #6913.
      Updates #12899.
      
      Change-Id: Idc6808788512ea20e7e45bcf782453acb416fb49
      Reviewed-on: https://go-review.googlesource.com/40095
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
      Reviewed-by: 's avatarJosh Bleecher Snyder <josharian@gmail.com>
      2ad41a30
    • Alexander Menzhinsky's avatar
      os: lstat oldname before renaming · 0f0a51f1
      Alexander Menzhinsky authored
      Fixes #19647
      
      Change-Id: Ife4f98cf2c55ee9490843797213dae2f2647b0a3
      Reviewed-on: https://go-review.googlesource.com/40577Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      0f0a51f1
    • Mark Ryan's avatar
      encoding/base32: ensure base32 decoder propagates errors correctly · 1ea796ee
      Mark Ryan authored
      A number of issues in decoder.Read and newlineFilteringReader.Read were
      preventing errors from the reader supplying the encoded data from being
      propagated to the caller.  Fixing these issues revealed some additional
      problems in which valid decoded data was not always returned to the user
      when errors were actually propagated.
      
      This commit fixes both the error propagation and the lost decoded data
      problems.  It also adds some new unit tests to ensure errors are handled
      correctly by decoder.Read.  The new unit tests increase the test coverage
      of this package from 96.2% to 97.9%.
      
      Fixes #20044
      
      Change-Id: I1a8632da20135906e2d191c2a8825b10e7ecc4c5
      Reviewed-on: https://go-review.googlesource.com/42094Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      1ea796ee
    • Josh Bleecher Snyder's avatar
      test: gofmt chan/*.go · 26a85211
      Josh Bleecher Snyder authored
      These are functional tests, so it is safe to gofmt them.
      
      Change-Id: I3067279c1d49809ac6a62054448ab8a6c3de9bda
      Reviewed-on: https://go-review.googlesource.com/43623Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      26a85211
    • Daniel Theophanes's avatar
      database/sql: allow drivers to support custom arg types · a9bf3b2e
      Daniel Theophanes authored
      Previously all arguments were passed through driver.IsValid.
      This checked arguments against a few fundamental go types and
      prevented others from being passed in as arguments.
      
      The new interface driver.NamedValueChecker may be implemented
      by both driver.Stmt and driver.Conn. This allows
      this new interface to completely supersede the
      driver.ColumnConverter interface as it can be used for
      checking arguments known to a prepared statement and
      arbitrary query arguments. The NamedValueChecker may be
      skipped with driver.ErrSkip after all special cases are
      exhausted to use the default argument converter.
      
      In addition if driver.ErrRemoveArgument is returned
      the argument will not be passed to the query at all,
      useful for passing in driver specific per-query options.
      
      Add a canonical Out argument wrapper to be passed
      to OUTPUT parameters. This will unify checks that need to
      be written in the NameValueChecker.
      
      The statement number check is also moved to the argument
      converter so the NamedValueChecker may remove arguments
      passed to the query.
      
      Fixes #13567
      Fixes #18079
      Updates #18417
      Updates #17834
      Updates #16235
      Updates #13067
      Updates #19797
      
      Change-Id: I89088bd9cca4596a48bba37bfd20d987453ef237
      Reviewed-on: https://go-review.googlesource.com/38533Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      a9bf3b2e
    • griesemer's avatar
      test: restore fixedbugs/bug398.go to original version · 9044cb04
      griesemer authored
      Cannot reproduce original problem. Compiler internals
      have changed enough such that this appears to work now.
      
      Restore original test (exported interfaces), but also
      keep version of the test using non-exported interfaces.
      
      Fixes #15596.
      
      Change-Id: Idb32da80239963242bd5d1609343c80f19773b0c
      Reviewed-on: https://go-review.googlesource.com/43622
      Run-TryBot: Robert Griesemer <gri@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarJosh Bleecher Snyder <josharian@gmail.com>
      9044cb04
    • Josh Bleecher Snyder's avatar
      test: add test for issue 18636 · 79eb8828
      Josh Bleecher Snyder authored
      Updates #18636
      
      Change-Id: I143c670c3940231e29f1814e0a03165682f53243
      Reviewed-on: https://go-review.googlesource.com/43621Reviewed-by: 's avatarJoe Tsai <thebrokentoaster@gmail.com>
      79eb8828
    • Josh Bleecher Snyder's avatar
      cmd/compile: search for remaining WB ops from end to beginning · 85b2940f
      Josh Bleecher Snyder authored
      The writebarrier pass processes WB ops from beginning to end,
      replacing them by other values.
      But it also checks whether there are more ops to process
      by walking from beginning to end.
      This is quadratic, so walk from end to beginning instead.
      
      This speeds up compiling the code in issue 13554:
      
      name  old time/op       new time/op       delta
      Pkg         11.9s ± 2%         8.3s ± 3%  -29.88%  (p=0.000 n=18+17)
      
      Updates #13554
      
      Passes toolstash-check.
      
      Change-Id: I5f8a872ddc4b783540220d89ea2ee188a6d2b2ff
      Reviewed-on: https://go-review.googlesource.com/43571
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
      85b2940f
    • Josh Bleecher Snyder's avatar
      cmd/compile: don't break up contiguous blocks in looprotate · 638ebb04
      Josh Bleecher Snyder authored
      looprotate finds loop headers and arranges for them to be placed
      after the body of the loop. This eliminates a jump from the body.
      
      However, if the loop header is a series of contiguously laid out blocks,
      the rotation introduces a new jump in that series.
      This CL expands the "loop header" to move to be the entire
      run of contiguously laid out blocks in the same loop.
      
      This shrinks object files a little, and actually speeds up
      the compiler noticeably. Numbers below.
      
      Fannkuch performance seems to vary a lot by machine. On my laptop:
      
      name          old time/op  new time/op  delta
      Fannkuch11-8   2.89s ± 2%   2.85s ± 3%  -1.22%  (p=0.000 n=50+50)
      
      This has a significant affect on the append benchmarks in #14758:
      
      name   old time/op    new time/op    delta
      Foo-8     312ns ± 3%     276ns ± 2%  -11.37%  (p=0.000 n=30+29)
      Bar-8     565ns ± 2%     456ns ± 2%  -19.27%  (p=0.000 n=27+28)
      
      Updates #18977
      Fixes #20355
      
      name        old time/op       new time/op       delta
      Template          205ms ± 5%        204ms ± 8%    ~     (p=0.903 n=92+99)
      Unicode          85.3ms ± 4%       85.1ms ± 3%    ~     (p=0.191 n=92+94)
      GoTypes           512ms ± 4%        507ms ± 4%  -0.93%  (p=0.000 n=95+97)
      Compiler          2.38s ± 3%        2.35s ± 3%  -1.27%  (p=0.000 n=98+95)
      SSA               4.67s ± 3%        4.64s ± 3%  -0.62%  (p=0.000 n=95+96)
      Flate             117ms ± 3%        117ms ± 3%    ~     (p=0.099 n=84+86)
      GoParser          139ms ± 4%        137ms ± 4%  -0.90%  (p=0.000 n=97+98)
      Reflect           329ms ± 5%        326ms ± 6%  -0.97%  (p=0.002 n=99+98)
      Tar               102ms ± 6%        101ms ± 5%  -0.97%  (p=0.006 n=97+97)
      XML               198ms ±10%        196ms ±13%    ~     (p=0.087 n=100+100)
      [Geo mean]        318ms             316ms       -0.72%
      
      name        old user-time/op  new user-time/op  delta
      Template          250ms ± 7%        250ms ± 7%    ~     (p=0.850 n=94+92)
      Unicode           107ms ± 8%        106ms ± 5%  -0.76%  (p=0.005 n=98+91)
      GoTypes           665ms ± 5%        659ms ± 5%  -0.85%  (p=0.003 n=93+98)
      Compiler          3.15s ± 3%        3.10s ± 3%  -1.60%  (p=0.000 n=99+98)
      SSA               6.82s ± 3%        6.72s ± 4%  -1.55%  (p=0.000 n=94+98)
      Flate             138ms ± 8%        138ms ± 6%    ~     (p=0.369 n=94+92)
      GoParser          170ms ± 5%        168ms ± 6%  -1.13%  (p=0.002 n=96+98)
      Reflect           412ms ± 8%        416ms ± 8%    ~     (p=0.169 n=100+100)
      Tar               123ms ±18%        123ms ±14%    ~     (p=0.896 n=100+100)
      XML               236ms ± 9%        234ms ±11%    ~     (p=0.124 n=100+100)
      [Geo mean]        401ms             398ms       -0.63%
      
      name        old alloc/op      new alloc/op      delta
      Template         38.8MB ± 0%       38.8MB ± 0%    ~     (p=0.222 n=5+5)
      Unicode          28.7MB ± 0%       28.7MB ± 0%    ~     (p=0.421 n=5+5)
      GoTypes           109MB ± 0%        109MB ± 0%    ~     (p=0.056 n=5+5)
      Compiler          457MB ± 0%        457MB ± 0%  +0.07%  (p=0.008 n=5+5)
      SSA              1.10GB ± 0%       1.10GB ± 0%  +0.05%  (p=0.008 n=5+5)
      Flate            24.5MB ± 0%       24.5MB ± 0%    ~     (p=0.222 n=5+5)
      GoParser         30.9MB ± 0%       31.0MB ± 0%  +0.21%  (p=0.016 n=5+5)
      Reflect          73.4MB ± 0%       73.4MB ± 0%    ~     (p=0.421 n=5+5)
      Tar              25.5MB ± 0%       25.5MB ± 0%    ~     (p=0.548 n=5+5)
      XML              40.9MB ± 0%       40.9MB ± 0%    ~     (p=0.151 n=5+5)
      [Geo mean]       71.6MB            71.6MB       +0.07%
      
      name        old allocs/op     new allocs/op     delta
      Template           394k ± 0%         394k ± 0%    ~     (p=1.000 n=5+5)
      Unicode            344k ± 0%         343k ± 0%    ~     (p=0.310 n=5+5)
      GoTypes           1.16M ± 0%        1.16M ± 0%    ~     (p=1.000 n=5+5)
      Compiler          4.42M ± 0%        4.42M ± 0%    ~     (p=1.000 n=5+5)
      SSA               9.80M ± 0%        9.80M ± 0%    ~     (p=0.095 n=5+5)
      Flate              237k ± 1%         238k ± 1%    ~     (p=0.310 n=5+5)
      GoParser           320k ± 0%         322k ± 1%  +0.50%  (p=0.032 n=5+5)
      Reflect            958k ± 0%         957k ± 0%    ~     (p=0.548 n=5+5)
      Tar                252k ± 1%         252k ± 0%    ~     (p=1.000 n=5+5)
      XML                400k ± 0%         400k ± 0%    ~     (p=0.841 n=5+5)
      [Geo mean]         741k              742k       +0.06%
      
      name        old object-bytes  new object-bytes  delta
      Template           386k ± 0%         386k ± 0%  -0.05%  (p=0.008 n=5+5)
      Unicode            202k ± 0%         202k ± 0%  -0.01%  (p=0.008 n=5+5)
      GoTypes           1.16M ± 0%        1.16M ± 0%  -0.06%  (p=0.008 n=5+5)
      Compiler          3.91M ± 0%        3.91M ± 0%  -0.06%  (p=0.008 n=5+5)
      SSA               7.91M ± 0%        7.92M ± 0%  +0.01%  (p=0.008 n=5+5)
      Flate              228k ± 0%         227k ± 0%  -0.04%  (p=0.008 n=5+5)
      GoParser           283k ± 0%         283k ± 0%  -0.06%  (p=0.008 n=5+5)
      Reflect            952k ± 0%         951k ± 0%  -0.02%  (p=0.008 n=5+5)
      Tar                187k ± 0%         187k ± 0%  -0.04%  (p=0.008 n=5+5)
      XML                406k ± 0%         406k ± 0%  -0.05%  (p=0.008 n=5+5)
      [Geo mean]         648k              648k       -0.04%
      
      Change-Id: I8630c4291a0eb2f7e7927bc04d7cc0efef181094
      Reviewed-on: https://go-review.googlesource.com/43491Reviewed-by: 's avatarKeith Randall <khr@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      638ebb04
    • Alberto Donizetti's avatar
      os: document that NewFile can return nil · 9a432552
      Alberto Donizetti authored
      Fixes #20023
      
      Change-Id: I1bec3e69031ffcfd7ad71716be9597ec322528ff
      Reviewed-on: https://go-review.googlesource.com/41211Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
      9a432552
    • Alberto Donizetti's avatar
      cmd/compile: don't panic in complex division · 2d1829b5
      Alberto Donizetti authored
      Updates #20227
      
      Change-Id: Idadc3137490181a5d380367660cee21e8313cf3b
      Reviewed-on: https://go-review.googlesource.com/42650
      Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
      2d1829b5
    • Ben Shi's avatar
      cmd/internal/obj/arm: remove illegal form of the SWI instruction · c7cae34b
      Ben Shi authored
      SWI only support "SWI $imm", but currently "SWI (Reg)" is also
      accepted. This patch fixes it.
      
      And more instruction tests are added to cmd/asm/internal/asm/testdata/arm.s
      
      fixes #20375
      
      Change-Id: Id437d853924a403e41da9b6cbddd20d994b624ff
      Reviewed-on: https://go-review.googlesource.com/43552
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
      c7cae34b
    • Alex Brainman's avatar
      net: adjust TestInterfaceHardwareAddrWithGetmac · 0927b472
      Alex Brainman authored
      Ignore adapters with "Transport Name:   N/A" line in getmac
      command output. This allows us to skip duplicate MAC addresses.
      
      Fixes #19537.
      
      Change-Id: I6b7be9d31322f963e02023c8f1037f6e9042b479
      Reviewed-on: https://go-review.googlesource.com/39071Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: 's avatarAvelino <t@avelino.xxx>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      0927b472
    • Alex Brainman's avatar
      cmd/link: make sure that runtime.epclntab lives in .text section · b5e964cc
      Alex Brainman authored
      Second attempt to fix #14710.
      
      CL 35272 already tried to fix this issue. But CL 35272 assumed
      that runtime.epclntab type is STEXT, while it is actually SRODATA.
      
      This CL uses Symbol.Sect.Seg to determine if symbol is part
      of Segtext or Segdata.
      
      Fixes #14710
      
      Change-Id: Ic6b6f657555c87a64d2bc36cc4c07ab0591d00c4
      Reviewed-on: https://go-review.googlesource.com/42390
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      b5e964cc
    • Ian Lance Taylor's avatar
      test: add missing copyright header to checkbce.go · f700f89b
      Ian Lance Taylor authored
      Change-Id: Iafeb8e033c876f482caa17cca414fe13b0fadb12
      Reviewed-on: https://go-review.googlesource.com/43613
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarDave Cheney <dave@cheney.net>
      f700f89b