1. 03 Jun, 2011 11 commits
    • Mikio Hara's avatar
      net: add network interface identification API · 518331df
      Mikio Hara authored
      This CL introduces new API into package net to identify the network
      interface.  A functionality of new API is very similar to RFC3493 -
      "Interface Identification".
      
      R=r, gri, bradfitz, robert.hencke, fullung, rsc
      CC=golang-dev
      https://golang.org/cl/4437087
      518331df
    • Russ Cox's avatar
      8g: compute register liveness during regopt · 84f291b1
      Russ Cox authored
      Input code like
      
      0000 (x.go:2) TEXT    main+0(SB),$36-0
      0001 (x.go:3) MOVL    $5,i+-8(SP)
      0002 (x.go:3) MOVL    $0,i+-4(SP)
      0003 (x.go:4) MOVL    $1,BX
      0004 (x.go:4) MOVL    i+-8(SP),AX
      0005 (x.go:4) MOVL    i+-4(SP),DX
      0006 (x.go:4) MOVL    AX,autotmp_0000+-20(SP)
      0007 (x.go:4) MOVL    DX,autotmp_0000+-16(SP)
      0008 (x.go:4) MOVL    autotmp_0000+-20(SP),CX
      0009 (x.go:4) CMPL    autotmp_0000+-16(SP),$0
      0010 (x.go:4) JNE     ,13
      0011 (x.go:4) CMPL    CX,$32
      0012 (x.go:4) JCS     ,14
      0013 (x.go:4) MOVL    $0,BX
      0014 (x.go:4) SHLL    CX,BX
      0015 (x.go:4) MOVL    BX,x+-12(SP)
      0016 (x.go:5) MOVL    x+-12(SP),AX
      0017 (x.go:5) CDQ     ,
      0018 (x.go:5) MOVL    AX,autotmp_0001+-28(SP)
      0019 (x.go:5) MOVL    DX,autotmp_0001+-24(SP)
      0020 (x.go:5) MOVL    autotmp_0001+-28(SP),AX
      0021 (x.go:5) MOVL    autotmp_0001+-24(SP),DX
      0022 (x.go:5) MOVL    AX,(SP)
      0023 (x.go:5) MOVL    DX,4(SP)
      0024 (x.go:5) CALL    ,runtime.printint+0(SB)
      0025 (x.go:5) CALL    ,runtime.printnl+0(SB)
      0026 (x.go:6) RET     ,
      
      is problematic because the liveness range for
      autotmp_0000 (0006-0009) is nested completely
      inside a span where BX holds a live value (0003-0015).
      Because the register allocator only looks at 0006-0009
      to see which registers are used, it misses the fact that
      BX is unavailable and uses it anyway.
      
      The n->pun = anyregalloc() check in tempname is
      a workaround for this bug, but I hit it again because
      I did the tempname call before allocating BX, even
      though I then used the temporary after storing in BX.
      This should fix the real bug, and then we can remove
      the workaround in tempname.
      
      The code creates pseudo-variables for each register
      and includes that information in the liveness propagation.
      Then the regu fields can be populated using that more
      complete information.  With that approach, BX is marked
      as in use on every line in the whole span 0003-0015,
      so that the decision about autotmp_0000
      (using only 0006-0009) still has all the information
      it needs.
      
      This is not specific to the 386, but it only happens in
      generated code of the form
      
              load R1
              ...
              load var into R2
              ...
              store R2 back into var
              ...
              use R1
      
      and for the most part the other compilers generate
      the loads for a given compiled line before any of
      the stores.  Even so, this may not be the case everywhere,
      so the change is worth making in all three.
      
      R=ken2, ken, ken
      CC=golang-dev
      https://golang.org/cl/4529106
      84f291b1
    • Dmitriy Vyukov's avatar
      testing: check that tests and benchmarks do not affect GOMAXPROCS · 79b397b2
      Dmitriy Vyukov authored
      Plus fix spoiling of GOMAXPROCS in 2 existing rwmutex tests.
      Plus fix benchmark output to stdout (now it outputs to stderr like all other output).
      
      R=rsc
      CC=golang-dev
      https://golang.org/cl/4529111
      79b397b2
    • Lucio De Re's avatar
      8l, ld: Initial adjustments for Plan 9 native compilation of 8l · 9baaa6f7
      Lucio De Re authored
      These changes are not particularly invasive and have been tested
      as broadly as possible.
      
      8l/l.h:
        -	#pragma varargck: added some, removed duplicates.
      
      ld/dwarf.c:
        -	As Plan 9 has no NULL, changed all occurrences to nil.
        -	Added USED(size); where necessary.
        -	Added (void) argument in definition of finddebugruntimepath().
        -	Plan 9 compiler was complaining about multiple
              assignments, repeaired by breaking up the commands.
        -	Correction: havedynamic = 1; restored.
      
      ld/go.c:
        -	Needed USED(file); in two functions.
        -	Removed unused assignments flagged by the Plan 9 compiler.
      
      ld/lib.c:
        -	Replaced unlink() with remove() which seems available everywhere.
        -	Removed USED(c4); and USED(magic) no longer required.
        -	Removed code flagged as unused by the Plan 9 compiler.
        -	Added attributes to a number of format strings.
      
      R=rsc
      CC=golang-dev
      https://golang.org/cl/4435047
      9baaa6f7
    • Luuk van Dijk's avatar
      gc: renamed walkdef to typecheckdef and moved from walk to typedef. · ab8ed7f8
      Luuk van Dijk authored
      also inlined a typechecking function in dcl away.
      
      R=rsc
      CC=golang-dev
      https://golang.org/cl/4550115
      ab8ed7f8
    • Andrew Gerrand's avatar
      dashboard: add favicon.ico · f4f58368
      Andrew Gerrand authored
      R=golang-dev, dsymonds
      CC=golang-dev
      https://golang.org/cl/4547082
      f4f58368
    • Nigel Tao's avatar
      f531ef32
    • Luuk van Dijk's avatar
      gc: allow tags on parameters in export section of object files. · 56668283
      Luuk van Dijk authored
      This is in preparation of escape analysis; function parameters
      can now be tagged with interesting bits by the compiler by
      assigning to n->note.
      
      tested by having typecheck put a fake tag on all parameters of
      pointer type and compiling the tree.
      
      R=rsc
      CC=golang-dev
      https://golang.org/cl/4524092
      56668283
    • Nigel Tao's avatar
      exp/draw: fix clipping bug where sp/mp were not shifted when r.Min was. · ae5a972d
      Nigel Tao authored
      image: add Rectangle.ContainsRectangle method.
      
      R=r, rsc
      CC=golang-dev
      https://golang.org/cl/4517130
      ae5a972d
    • Andrew Gerrand's avatar
      tag weekly.2011-06-02 · f628f741
      Andrew Gerrand authored
      R=r
      CC=golang-dev
      https://golang.org/cl/4551092
      f628f741
    • Andrew Gerrand's avatar
      weekly.2011-06-02 · 897ad0c0
      Andrew Gerrand authored
      R=golang-dev, r
      CC=golang-dev
      https://golang.org/cl/4548091
      897ad0c0
  2. 02 Jun, 2011 21 commits
  3. 01 Jun, 2011 8 commits
    • Gustavo Niemeyer's avatar
      sync: always wake up previously sleeping goroutines on Cond.Signal · 17bfa32f
      Gustavo Niemeyer authored
      This changes the internal implementation of Cond so that
      it uses two generations of waiters.  This enables Signal
      to guarantee that it will only wake up waiters that are
      currently sleeping at the call time.
      
      Fixes #1648.
      
      R=dvyukov, gustavo, rsc
      CC=golang-dev
      https://golang.org/cl/4524083
      17bfa32f
    • Robert Griesemer's avatar
      big: fix broken overflow test · 158b427e
      Robert Griesemer authored
      - tested with GOARCH=386
      - tested with GOARCH=amd64
      
      R=iant
      CC=golang-dev
      https://golang.org/cl/4526100
      158b427e
    • Brad Fitzpatrick's avatar
      exec: new API, replace Run with Command · f259f6ba
      Brad Fitzpatrick authored
      This removes exec.Run and replaces exec.Cmd with a
      new implementation. The new exec.Cmd represents
      both a currently-running command and also a command
      being prepared. It has a good zero value.
      
      You can Start + Wait on a Cmd, or simply Run it.
      Start (and Run) deal with copying stdout, stdin,
      and stderr between the Cmd's io.Readers and
      io.Writers.
      
      There are convenience methods to capture a command's
      stdout and/or stderr.
      
      R=r, n13m3y3r, rsc, gustavo, alex.brainman, dsymonds, r, adg, duzy.chan, mike.rosset, kevlar
      CC=golang-dev
      https://golang.org/cl/4552052
      f259f6ba
    • Robert Griesemer's avatar
      fix build: remove non-portable test case · 2132a7f5
      Robert Griesemer authored
      On a 32bit machine, the big.Words are only 32bit.
      
      R=rsc
      CC=golang-dev
      https://golang.org/cl/4561055
      2132a7f5
    • Robert Griesemer's avatar
    • Robert Griesemer's avatar
      big: ~8x faster number scanning · ce2701b2
      Robert Griesemer authored
      - better number scanning algorithm
      - fixed a couple of bugs related to base interpretation
      - added scan benchmark
      - added more test cases and made tests more precise
      - introduced Int.scan method matching nat.scan
      - refactored Int.Scan; now uses int.scan
      - refactored Int.SetString; now uses int.scan
      
      There is more potential, this was a fairly simple change.
      
      gotest -test.bench="ScanPi" before/after (best of 3 runs):
      big.BenchmarkScanPi	   1000	    2024900 ns/op
      big.BenchmarkScanPi       10000      257540 ns/op
      
      R=chickencha
      CC=golang-dev, rsc
      https://golang.org/cl/4527089
      ce2701b2
    • Russ Cox's avatar
      undo CL 4557058 / b4c2ffae7034 · 16dbf218
      Russ Cox authored
      Using the getaddrinfo order is only okay if we
      are smart enough to try multiple addresses in Dial.
      Since the code does not do that, we must make
      the right first choice, regardless of what getaddrinfo
      does, and more often that not that means using the
      IPv4 address, even on IPv6 systems.  With the CL
      applied, gotest fails in package net on OS X.
      
      helix.cam=; gotest
      ...
      --- FAIL: net.TestDialGoogleIPv4 (1.05 seconds)
              -- 74.125.226.179:80 --
              -- www.google.com:80 --
              Dial("tcp", "", "www.google.com:80") = _, dial tcp [2001:4860:800f::69]:80: address family not supported by protocol family
              -- 74.125.226.179:http --
              -- www.google.com:http --
              Dial("tcp", "", "www.google.com:http") = _, dial tcp [2001:4860:800f::69]:80: address family not supported by protocol family
              -- 074.125.226.179:0080 --
              -- [::ffff:74.125.226.179]:80 --
              -- [::ffff:4a7d:e2b3]:80 --
              -- [0:0:0:0:0000:ffff:74.125.226.179]:80 --
              -- [0:0:0:0:000000:ffff:74.125.226.179]:80 --
              -- [0:0:0:0:0:ffff::74.125.226.179]:80 --
      FAIL
      gotest: "./6.out" failed: exit status 1
      
      ««« original CL description
      net: name-based destination address selection
      
      getaddrinfo() orders the addresses according to RFC 3484.
      
      This means when IPv6 is working on a host we get results like:
          []string = {"2001:4810::110", "66.117.47.214"}
      
      and when it's not working we get:
          []string = {"66.117.47.214", "2001:4810::110"}
      
      thus can drop firstFavoriteAddr.
      
      This also means /etc/gai.conf works on relevant systems.
      
      R=rsc, mikioh.mikioh
      CC=golang-dev
      https://golang.org/cl/4557058
      
      »»»
      
      R=golang-dev, bradfitz
      CC=golang-dev
      https://golang.org/cl/4532101
      16dbf218
    • Adam Langley's avatar
      crypto/openpgp: add support for symmetrically encrypting files. · e0cca45f
      Adam Langley authored
      This mostly adds the infrastructure for writing various forms of
      packets as well as reading them. Adding symmetric encryption support
      was simply an easy motivation.
      
      There's also one brown-paper-bag fix in here. Previously I had the
      conditional for the MDC hash check backwards: the code was checking
      that the hash was *incorrect*. This was neatly counteracted by another
      bug: it was hashing the ciphertext of the OCFB prefix, not the
      plaintext.
      
      R=bradfitz
      CC=golang-dev
      https://golang.org/cl/4564046
      e0cca45f