1. 22 Feb, 2013 21 commits
  2. 21 Feb, 2013 19 commits
    • Rob Pike's avatar
      bufio: add examples for Scanner · dbd409af
      Rob Pike authored
      Mention Scanner in docs for ReadLine etc.
      
      R=golang-dev, bradfitz
      CC=golang-dev
      https://golang.org/cl/7375045
      dbd409af
    • Dave Cheney's avatar
      cmd/gc: fix FreeBSD build · 6138e368
      Dave Cheney authored
      R=jsing, mikioh.mikioh, bradfitz
      CC=golang-dev
      https://golang.org/cl/7390048
      6138e368
    • Brad Fitzpatrick's avatar
      net/url: fix URL Opaque notes on making client requests · 0462aad9
      Brad Fitzpatrick authored
      Fixes #4860
      
      R=golang-dev, rsc
      CC=golang-dev
      https://golang.org/cl/7375047
      0462aad9
    • Robert Dinu's avatar
      testing: fix output formatting · 782cbb4f
      Robert Dinu authored
      Revision 5e7fd762f356 has changed the output formatting in a way that
      is no longer in line with the format described by the revision
      ff0ade0b937b which has introduced this functionality.
      When decorating the first line, instead of indenting the whole line,
      the current implementation adds indentation right after the "decorate"
      part and  before the "log" message.
      The fix addresses this issue.
      
      R=golang-dev, iant, minux.ma, r, rsc, remyoudompheng
      CC=golang-dev
      https://golang.org/cl/7304094
      782cbb4f
    • Russ Cox's avatar
      cmd/gc, reflect, runtime: switch to indirect func value representation · 1903ad71
      Russ Cox authored
      Step 1 of http://golang.org/s/go11func.
      
      R=golang-dev, r, daniel.morsing, remyoudompheng
      CC=golang-dev
      https://golang.org/cl/7393045
      1903ad71
    • Brad Fitzpatrick's avatar
      archive/tar: make test pass on setgid dirs · 4335e69a
      Brad Fitzpatrick authored
      Fixes #4867
      
      R=golang-dev, dsymonds
      CC=golang-dev
      https://golang.org/cl/7382045
      4335e69a
    • Carl Shapiro's avatar
      cmd/5g, cmd/5l, cmd/6l, cmd/8l, cmd/gc, cmd/ld, runtime: accurate args and locals information · f466617a
      Carl Shapiro authored
      Previously, the func structure contained an inaccurate value for
      the args member and a 0 value for the locals member.
      
      This change populates the func structure with args and locals
      values computed by the compiler.  The number of args was
      already available in the ATEXT instruction.  The number of
      locals is now passed through in the new ALOCALS instruction.
      
      This change also switches the unit of args and locals to be
      bytes, just like the frame member, instead of 32-bit words.
      
      R=golang-dev, bradfitz, cshapiro, dave, rsc
      CC=golang-dev
      https://golang.org/cl/7399045
      f466617a
    • Brad Fitzpatrick's avatar
      net/http, net/url: deal with URL.Opaque beginning with // · fb21bca0
      Brad Fitzpatrick authored
      Update #4860
      
      R=adg, rsc, campoy
      CC=golang-dev
      https://golang.org/cl/7369045
      fb21bca0
    • Russ Cox's avatar
      doc: mention go fix in go1.1 release notes draft · aed05446
      Russ Cox authored
      R=golang-dev, bradfitz, r
      CC=golang-dev
      https://golang.org/cl/7379045
      aed05446
    • Rob Pike's avatar
      unicode: use new Scanner interface in table creation · 6f96a76c
      Rob Pike authored
      Update norm and local/collate as well.
      
      R=mpvl
      CC=golang-dev
      https://golang.org/cl/7395045
      6f96a76c
    • Brad Fitzpatrick's avatar
      database/sql: check for nil Scan pointers · bca3f5fc
      Brad Fitzpatrick authored
      Return nice errors and don't panic.
      
      Fixes #4859
      
      R=golang-dev, rsc
      CC=golang-dev
      https://golang.org/cl/7383046
      bca3f5fc
    • Russ Cox's avatar
      runtime: better error from TestGcSys when gc is disabled · 5833c96b
      Russ Cox authored
      R=golang-dev, bradfitz
      CC=golang-dev
      https://golang.org/cl/7390047
      5833c96b
    • Dmitriy Vyukov's avatar
      runtime: fix heap corruption · 94fab3ca
      Dmitriy Vyukov authored
      R=golang-dev, rsc
      CC=golang-dev
      https://golang.org/cl/7397049
      94fab3ca
    • Russ Cox's avatar
      cmd/5g, cmd/6g: fix node dump formats · 0cdc0b3b
      Russ Cox authored
      lvd changed the old %N to %+hN and these
      never got updated.
      
      R=ken2
      CC=golang-dev
      https://golang.org/cl/7391045
      0cdc0b3b
    • Alan Donovan's avatar
      exp/ssa/interp: (#6 of 5): test interpretation of SSA form of $GOROOT/test/*.go. · aa5aaabb
      Alan Donovan authored
      The interpreter's os.Exit now triggers a special panic rather
      than kill the test process.  (It's semantically dubious, since
      it will run deferred routines.)  Interpret now returns its
      exit code rather than calling os.Exit.
      
      Also:
      - disabled parts of a few $GOROOT/tests via os.Getenv("GOSSAINTERP").
      - remove unnecessary 'slots' param to external functions; they
        are never closures.
      
      Most of the tests are disabled until go/types supports shifts.
      They can be reenabled if you patch this workaround:
      https://golang.org/cl/7312068
      
      R=iant, bradfitz
      CC=golang-dev, gri
      https://golang.org/cl/7313062
      aa5aaabb
    • Russ Cox's avatar
      cmd/fix: delete pre-Go 1 fixes · df93283d
      Russ Cox authored
      Assume people who were going to update to Go 1 have done so.
      Those with pre-Go 1 trees remaining will need to update first
      to Go 1.0 (using its 'go fix') and then to Go 1.1.
      
      Cuts the cmd/fix test time by 99% (3 seconds to 0.03 seconds).
      
      R=golang-dev, bradfitz
      CC=golang-dev
      https://golang.org/cl/7402046
      df93283d
    • Alan Donovan's avatar
      exp/ssa: add dedicated Panic instruction. · 92cbf82f
      Alan Donovan authored
      By avoiding the need for self-loops following calls to panic,
      we reduce the number of basic blocks considerably.
      
      R=gri
      CC=golang-dev, iant
      https://golang.org/cl/7403043
      92cbf82f
    • Mikio Hara's avatar
      net: add benchmarks for network interface identification · 0ad88a48
      Mikio Hara authored
      Current results on linux/amd64:
      BenchmarkInterfaces                      20000             80902 ns/op
      BenchmarkInterfaceByIndex                50000             71591 ns/op
      BenchmarkInterfaceByName                 20000             79908 ns/op
      BenchmarkInterfaceAddrs                   2000            836413 ns/op
      BenchmarkInterfacesAndAddrs               5000            605946 ns/op
      BenchmarkInterfacesAndMulticastAddrs     10000            169029 ns/op
      
      Update #4866.
      
      R=golang-dev, bradfitz
      CC=golang-dev
      https://golang.org/cl/7368046
      0ad88a48
    • Alan Donovan's avatar
      exp/ssa: build fully pruned SSA form. · 86712158
      Alan Donovan authored
      Overview: Function.finish() now invokes the "lifting" pass which replaces local allocs and loads and stores to such cells by SSA registers.  We use very standard machinery:
      
      (1) we build the dominator tree for the function's control flow graph (CFG) using the "Simple" Lengauer-Tarjan algorithm.  (Very "simple" in fact: even simple path compression is not yet implemented.)
      
      In sanity-checking mode, we cross check the dominator tree against an alternative implementation using a simple iterative dataflow algorithm.
      This all lives in dom.go, along with some diagnostic printing routines.
      
      (2) we build the dominance frontier for the entire CFG using the Cytron et al algorithm.  The DF is represented as a slice of slices, keyed by block index.  See buildDomFrontier() in lift.go.
      
      (3) we determine for each Alloc whether it can be lifted: is it only subject to loads and stores?  If so, we traverse the iterated dominance frontier (IDF) creating φ-nodes; they are not prepended to the blocks yet.
      See liftAlloc() in lift.go.
      
      (4) we perform the SSA renaming algorithm from Cytron et al, replacing all loads to lifted Alloc cells by the value stored by the dominating store operation, and deleting the stores and allocs.  See rename() in lift.go.
      
      (5) we eliminate unneeded φ-nodes, then concatenate the remaining ones with the non-deleted instructions of the block into a new slice.  We eliminate any lifted allocs from Function.Locals.
      
      To ease reviewing, I have avoided almost all optimisations at this point, though there are many opportunities to explore.  These will be easier to understand as follow-up changes.
      
      All the existing tests (pending CL 7313062) pass.  (Faster!)
      
      Details:
      
      "NaiveForm" BuilderMode flag suppresses all the new logic.
      Exposed as 'ssadump -build=N'.
      
      BasicBlock:
      - add .Index field (b.Func[b.Index]==b), simplifying
        algorithms such as Kildall-style dataflow with bitvectors.
      - rename the Name field to Comment to better reflect its
        reduced purpose.  It now has a String() method.
      - 'dom' field holds dominator tree node; private for now.
      - new predIndex method.
      - hasPhi is now a method
      
      dom.go:
      - domTree: a new struct for a node in a dominator tree.
      - buildDomTree builds the dominator tree using the simple
        variant Lengauer/Tarjan algorithm with Georgiadis'
        bucket optimizations.
      - sanityCheckDomTree builds dominance relation using
        Kildall-style dataflow and ensures the same result is
        obtained.
      - printDomTreeDot prints the CFG/DomTree in GraphViz format.
      
      blockopt.go:
      - perform a mark/sweep pass to eliminate unreachable
        cycles; the previous prune() opt would only eliminate
        trivially dead blocks.  (Needed for LT algo.)
      - using .Index, fuseblocks can now delete fused blocks directly.
      - delete prune().
      
      sanity.go: more consistency checks:
      - Phi with missing edge value
      - local Alloc instructions must appear in Function.Locals.
      - BasicBlock.Index, Func consistency
      - CFG edges are all intraprocedural.
      - detect nils in BasicBlock.Instrs.
      - detect Function.Locals with Heap flag set.
      - check fn.Blocks is nil if empty.
      
      Also:
      - Phi now has Comment field for debugging.
      - Fixed bug in Select.Operands()
        (took address of temporary copy of field)
      - new Literal constructor zeroLiteral().
      - algorithms steal private fields Alloc.index,
        BasicBlock.gaps to avoid allocating maps.
      - We print Function.Locals in DumpTo.
      - added profiling support to ssadump.
      
      R=iant, gri
      CC=golang-dev
      https://golang.org/cl/7229074
      86712158