1. 24 May, 2012 8 commits
    • Russ Cox's avatar
      cmd/6g: peephole fixes/additions · 3d3b4906
      Russ Cox authored
      * Shift/rotate by constant doesn't have to stop subprop. (also in 8g)
      * Remove redundant MOVLQZX instructions.
      * An attempt at issuing loads early.
        Good for 0.5% on a good day, might not be worth keeping.
        Need to understand more about whether the x86
        looks ahead to what loads might be coming up.
      
      R=ken2, ken
      CC=golang-dev
      https://golang.org/cl/6203091
      3d3b4906
    • Shenghou Ma's avatar
      cmd/cc: fix uint right shift in constant evaluation · 34ad3995
      Shenghou Ma authored
              Fixes #3664.
      
      R=golang-dev, bradfitz, rsc
      CC=golang-dev
      https://golang.org/cl/6249048
      34ad3995
    • Dmitriy Vyukov's avatar
      runtime: faster GC mark phase · b0702bd0
      Dmitriy Vyukov authored
      Also bump MaxGcproc to 8.
      
      benchmark             old ns/op    new ns/op    delta
      Parser               3796323000   3763880000   -0.85%
      Parser-2             3591752500   3518560250   -2.04%
      Parser-4             3423825250   3334955250   -2.60%
      Parser-8             3304585500   3267014750   -1.14%
      Parser-16            3313615750   3286160500   -0.83%
      
      Tree                  984128500    942501166   -4.23%
      Tree-2                932564444    883266222   -5.29%
      Tree-4                835831000    799912777   -4.30%
      Tree-8                819238500    789717333   -3.73%
      Tree-16               880837833    837840055   -5.13%
      
      Tree2                 604698100    579716900   -4.13%
      Tree2-2               372414500    356765200   -4.20%
      Tree2-4               187488100    177455900   -5.56%
      Tree2-8               136315300    102086700  -25.11%
      Tree2-16               93725900     76705800  -22.18%
      
      ParserPause           157441210    166202783   +5.56%
      ParserPause-2          93842650     85199900   -9.21%
      ParserPause-4          56844404     53535684   -5.82%
      ParserPause-8          35739446     30767613  -16.15%
      ParserPause-16         32718255     27212441  -16.83%
      
      TreePause              29610557     29787725   +0.60%
      TreePause-2            24001659     20674421  -13.86%
      TreePause-4            15114887     12842781  -15.03%
      TreePause-8            13128725     10741747  -22.22%
      TreePause-16           16131360     12506901  -22.47%
      
      Tree2Pause           2673350920   2651045280   -0.83%
      Tree2Pause-2         1796999200   1709350040   -4.88%
      Tree2Pause-4         1163553320   1090706480   -6.67%
      Tree2Pause-8          987032520    858916360  -25.11%
      Tree2Pause-16         864758560    809567480   -6.81%
      
      ParserLastPause       280537000    289047000   +3.03%
      ParserLastPause-2     183030000    166748000   -8.90%
      ParserLastPause-4     105817000     91552000  -13.48%
      ParserLastPause-8      65127000     53288000  -18.18%
      ParserLastPause-16     45258000     38334000  -15.30%
      
      TreeLastPause          45072000     51449000  +12.39%
      TreeLastPause-2        39269000     37866000   -3.57%
      TreeLastPause-4        23564000     20649000  -12.37%
      TreeLastPause-8        20881000     15807000  -24.30%
      TreeLastPause-16       23297000     17309000  -25.70%
      
      Tree2LastPause       6046912000   5797120000   -4.13%
      Tree2LastPause-2     3724034000   3567592000   -4.20%
      Tree2LastPause-4     1874831000   1774524000   -5.65%
      Tree2LastPause-8     1363108000   1020809000  -12.79%
      Tree2LastPause-16     937208000    767019000  -22.18%
      
      R=rsc, 0xe2.0x9a.0x9b
      CC=golang-dev
      https://golang.org/cl/6223050
      b0702bd0
    • Andrew Balholm's avatar
      exp/html: detect "integration points" in SVG and MathML content · 82e22725
      Andrew Balholm authored
      Detect HTML integration points and MathML text integration points.
      At these points, process tokens as HTML, not as foreign content.
      
      Pass 33 more tests.
      
      R=nigeltao
      CC=golang-dev
      https://golang.org/cl/6249044
      82e22725
    • David Symonds's avatar
      flag: include flag name in redefinition panic. · 04f3cf0f
      David Symonds authored
      R=golang-dev, rsc, r
      CC=golang-dev
      https://golang.org/cl/6250043
      04f3cf0f
    • Joel Sing's avatar
      runtime: make go work on netbsd/amd64 · 5a043de7
      Joel Sing authored
      R=golang-dev, rsc, devon.odell
      CC=golang-dev
      https://golang.org/cl/6222044
      5a043de7
    • Andrew Balholm's avatar
      exp/html: update test data · e947eba2
      Andrew Balholm authored
      Import updated test data from the WebKit Subversion repository (SVN revision 118111).
      
      Some of the old tests were failing because we were HTML5 compliant, but the tests weren't.
      
      R=nigeltao
      CC=golang-dev
      https://golang.org/cl/6228049
      e947eba2
    • Brad Fitzpatrick's avatar
      encoding/json: documentation fix · 83771afe
      Brad Fitzpatrick authored
      Fixes #3650
      
      R=golang-dev, adg
      CC=golang-dev
      https://golang.org/cl/6238046
      83771afe
  2. 23 May, 2012 10 commits
  3. 22 May, 2012 22 commits
    • Ugorji Nwoke's avatar
      text/template: exec should accept interface value as valid. · 4f7c33cd
      Ugorji Nwoke authored
      Currently, if you pass some data to a template as an interface (e.g. interface{})
      and extract that value that value as a parameter for a function, it fails, saying
      wrong type.
      
      This is because it is only looking at the interface type, not the interface content.
      
      This CL uses the underlying content as the parameter to the func.
      
      Fixes #3642.
      
      R=golang-dev, r, r
      CC=golang-dev
      https://golang.org/cl/6218052
      4f7c33cd
    • Shenghou Ma's avatar
      cmd/ld, cmd/6l, cmd/8l, cmd/5l: fix hidden/local symbol import for ELF systems · 576d648b
      Shenghou Ma authored
         Introduce a newsym() to cmd/lib.c to add a symbol but don't add
      them to hash table.
         Introduce a new bit flag SHIDDEN and bit mask SMASK to handle hidden
      and/or local symbols in ELF symbol tables. Though we still need to order
      the symbol table entries correctly.
         Fix for issue 3261 comment #9.
         For CL 5822049.
      
      R=iant, rsc
      CC=golang-dev
      https://golang.org/cl/5823055
      576d648b
    • Shenghou Ma's avatar
      cmd/ld: take section symbols' value into account for PE · 1c4b77a7
      Shenghou Ma authored
          ld -r could generate multiple section symbols for the same section,
      but with different values, we have to take that into account.
          Fixes #3322.
          Part of issue 3261.
          For CL 5822049.
      
      R=golang-dev, iant, rsc, iant
      CC=golang-dev
      https://golang.org/cl/5823059
      1c4b77a7
    • Shenghou Ma's avatar
      sync/atomic: use cas64 to implement {Load,Store,Add}{Uint,Int}64 on Linux/ARM · 090f9fc3
      Shenghou Ma authored
              Now with GOARM=5 our all.bash should pass on ARMv5 systems.
              Fixes #3331.
      
      R=golang-dev, rsc, dvyukov
      CC=golang-dev
      https://golang.org/cl/6210071
      090f9fc3
    • Shenghou Ma's avatar
      runtime: support conditional execution in ARM softfloat · fb3a1b68
      Shenghou Ma authored
              Fixes #3638.
      
      R=golang-dev, dave, rsc
      CC=golang-dev
      https://golang.org/cl/6213057
      fb3a1b68
    • Russ Cox's avatar
      undo CL 6112054 / 2eec2501961c · 3d03ec88
      Russ Cox authored
      Now that we've fixed the Expect: test, this CL should be okay.
      
      ««« original CL description
      net/http: revert 97d027b3aa68
      
      Revert the following change set:
      
              changeset:   13018:97d027b3aa68
              user:        Gustavo Niemeyer <gustavo@niemeyer.net>
              date:        Mon Apr 23 22:00:16 2012 -0300
              summary:     net/http: allow clients to disable keep-alive
      
      This broke a test on Windows 64 and somebody else
      will have to check.
      
      R=golang-dev, r
      CC=golang-dev
      https://golang.org/cl/6112054
      »»»
      
      Fixes #3540.
      
      R=golang-dev, bradfitz
      CC=golang-dev
      https://golang.org/cl/6228046
      3d03ec88
    • Russ Cox's avatar
      unicode: fix comment about variable types · 77f00e5e
      Russ Cox authored
      In both the web and command line tool,
      the comment is shown after the declaration.
      But in the code the comment is obviously before.
      Make the text not refer to a specific order.
      
      R=r, dsymonds
      CC=golang-dev
      https://golang.org/cl/6206094
      77f00e5e
    • Jan Ziak's avatar
      cmd/gc: export constants in hexadecimal · fbaf59bf
      Jan Ziak authored
      R=golang-dev, r, rsc, iant, remyoudompheng, dave
      CC=golang-dev
      https://golang.org/cl/6206077
      fbaf59bf
    • Russ Cox's avatar
      crypto/md5: faster inner loop, 3x faster overall · 15436da2
      Russ Cox authored
      The speedup is a combination of unrolling/specializing
      the actual code and also making the compiler generate better code.
      
      Go 1.0.1 (size: 1239 code + 320 data = 1559 total)
      md5.BenchmarkHash1K   1000000	   7178 ns/op	 142.64 MB/s
      md5.BenchmarkHash8K    200000	  56834 ns/op	 144.14 MB/s
      
      Partial unroll  (size: 1115 code + 256 data = 1371 total)
      md5.BenchmarkHash1K   5000000	   2513 ns/op	 407.37 MB/s
      md5.BenchmarkHash8K    500000	  19406 ns/op	 422.13 MB/s
      
      Complete unroll  (size: 1900 code + 0 data = 1900 code)
      md5.BenchmarkHash1K   5000000	   2442 ns/op	 419.18 MB/s
      md5.BenchmarkHash8K    500000	  18957 ns/op	 432.13 MB/s
      
      Comparing Go 1.0.1 and the complete unroll (this CL):
      
      benchmark               old MB/s     new MB/s  speedup
      md5.BenchmarkHash1K       142.64       419.18    2.94x
      md5.BenchmarkHash8K       144.14       432.13    3.00x
      
      On the same machine, 'openssl speed md5' reports 441 MB/s
      and 531 MB/s for our two cases, so this CL is at 90% and 80% of
      those speeds, which is at least in the right ballpark.
      OpenSSL is using carefully engineered assembly, so we are
      unlikely to catch up completely.
      
      Measurements on a Mid-2010 MacPro5,1.
      
      R=golang-dev, bradfitz, agl
      CC=golang-dev
      https://golang.org/cl/6220046
      15436da2
    • Russ Cox's avatar
      net/http: refactor body logic in test · 1c445755
      Russ Cox authored
      This just eliminates some duplication.
      Also add a pointer to RFC 1122, in case
      this comes up again.
      
      R=golang-dev, bradfitz
      CC=golang-dev
      https://golang.org/cl/6229044
      1c445755
    • Dmitriy Vyukov's avatar
      runtime: faster GC sweep phase · 845aa1fc
      Dmitriy Vyukov authored
      benchmark                              old ns/op    new ns/op    delta
      
      garbage.BenchmarkParser               3731065750   3715543750   -0.41%
      garbage.BenchmarkParser-2             3631299750   3495248500   -3.75%
      garbage.BenchmarkParser-4             3386486000   3339353000   -1.39%
      garbage.BenchmarkParser-8             3267632000   3286422500   +0.58%
      garbage.BenchmarkParser-16            3299203000   3316081750   +0.51%
      
      garbage.BenchmarkTree                  977532888    919453833   -5.94%
      garbage.BenchmarkTree-2                919948555    853478000   -7.23%
      garbage.BenchmarkTree-4                841329000    790207000   -6.08%
      garbage.BenchmarkTree-8                787792777    740380666   -6.01%
      garbage.BenchmarkTree-16               899257166    846594555   -5.86%
      
      garbage.BenchmarkTree2                 574876300    571885800   -0.52%
      garbage.BenchmarkTree2-2               348162700    345888900   -0.65%
      garbage.BenchmarkTree2-4               184912500    179137000   -3.22%
      garbage.BenchmarkTree2-8               104243900    103485600   -0.73%
      garbage.BenchmarkTree2-16               97269500     85137100  -14.25%
      
      garbage.BenchmarkParserPause           141101976    157746974  +11.80%
      garbage.BenchmarkParserPause-2         103096051     83043048  -19.45%
      garbage.BenchmarkParserPause-4          52153133     45951111  -11.89%
      garbage.BenchmarkParserPause-8          36730190     38901024   +5.91%
      garbage.BenchmarkParserPause-16         32678875     29578585   -9.49%
      
      garbage.BenchmarkTreePause              29487065     29648439   +0.55%
      garbage.BenchmarkTreePause-2            22443494     21306159   -5.07%
      garbage.BenchmarkTreePause-4            15799691     14985647   -5.15%
      garbage.BenchmarkTreePause-8            10768112     9531420   -12.97%
      garbage.BenchmarkTreePause-16           16329891     15205158   -6.89%
      
      garbage.BenchmarkTree2Pause           2586957240   2577533200   -0.36%
      garbage.BenchmarkTree2Pause-2         1683383760   1673923800   -0.56%
      garbage.BenchmarkTree2Pause-4         1102860320   1074040280   -2.68%
      garbage.BenchmarkTree2Pause-8          902627920    886122400   -1.86%
      garbage.BenchmarkTree2Pause-16         856470920    804152320   -6.50%
      
      garbage.BenchmarkParserLastPause       277316000    280839000   +1.25%
      garbage.BenchmarkParserLastPause-2     179446000    163687000   -8.78%
      garbage.BenchmarkParserLastPause-4     106752000     94144000  -11.81%
      garbage.BenchmarkParserLastPause-8      57758000     61640000   +6.72%
      garbage.BenchmarkParserLastPause-16     51235000     42552000  -16.95%
      
      garbage.BenchmarkTreeLastPause          45244000     50786000  +12.25%
      garbage.BenchmarkTreeLastPause-2        37163000     34654000   -6.75%
      garbage.BenchmarkTreeLastPause-4        24178000     21967000   -9.14%
      garbage.BenchmarkTreeLastPause-8        20390000     15648000  -30.30%
      garbage.BenchmarkTreeLastPause-16       22398000     20180000   -9.90%
      
      garbage.BenchmarkTree2LastPause       5748706000   5718809000   -0.52%
      garbage.BenchmarkTree2LastPause-2     3481570000   3458844000   -0.65%
      garbage.BenchmarkTree2LastPause-4     1849073000   1791330000   -3.22%
      garbage.BenchmarkTree2LastPause-8     1042375000   1034811000   -0.73%
      garbage.BenchmarkTree2LastPause-16     972637000    851323000  -14.25%
      
      There is also visible improvement in consumed CPU time:
      tree2 -heapsize=8000000000 -cpus=12
      before: 248.74user 6.36system 0:52.74elapsed 483%CPU
      after:  229.86user 6.33system 0:51.08elapsed 462%CPU
      -1.66s of real time, but -18.91s of consumed CPU time
      
      R=golang-dev
      CC=golang-dev
      https://golang.org/cl/6215065
      845aa1fc
    • Robert Griesemer's avatar
      go/ast: document CommentGroup.Text and add test case. · 581e7c2a
      Robert Griesemer authored
      R=golang-dev, rsc
      CC=golang-dev
      https://golang.org/cl/6206096
      581e7c2a
    • Brad Fitzpatrick's avatar
      net/http: improve TestServerExpect · 5a033376
      Brad Fitzpatrick authored
      Fail more usefully, and Logf in one place instead of Errorf where
      an error is acceptable.
      
      R=golang-dev, rsc
      CC=golang-dev
      https://golang.org/cl/6221059
      5a033376
    • Robert Griesemer's avatar
      go/parser: fix comment grouping (day 1 bug) · f26d6173
      Robert Griesemer authored
      Comment groups must end at the end of a line (or the
      next non-comment token) if the group started on a line
      with non-comment tokens.
      
      This is important for correct computation of "lead"
      and "line" comments (Doc and Comment fields in AST nodes).
      
      Without this fix, the "line" comment for F1 in the
      following example:
      
      type T struct {
           F1 int // comment1
           // comment2
           F2 int
      }
      
      is "// comment1// comment2" rather than just "// comment1".
      
      This bug was present from Day 1 but only visible when
      looking at export-filtered ASTs where only comments
      associated with AST nodes are printed, and only in rare
      cases (e.g, in the case above, if F2 where not exported,
      godoc would show "// comment2" anyway because it was
      considered part of the "line" comment for F1).
      
      The bug fix is very small (parser.go). The bulk of the
      changes are additional test cases (parser_test.go).
      
      The fix exposed a caching bug in go/printer via one of the
      existing tests, hence the changes to printer.go.
      
      As an aside, the fix removes the the need for empty lines
      before an "// Output" comment for some special cases of
      code examples (e.g.: src/pkg/strings/example_test.go, Count
      example).
      
      No impact on gofmt formatting of src, misc.
      
      Fixes #3139.
      
      R=rsc
      CC=golang-dev
      https://golang.org/cl/6209080
      f26d6173
    • Robert Griesemer's avatar
      godoc: slightly smarter synopsis extraction · f596eb5d
      Robert Griesemer authored
      Ignore synopses that start with
      "Copyright", "All rights", and "Author".
      
      R=rsc
      CC=golang-dev
      https://golang.org/cl/6218047
      f596eb5d
    • Robert Griesemer's avatar
      go/scanner: strip carriage returns from commments · 7b9a6d8d
      Robert Griesemer authored
      Also:
      - cleaned up and simplified TestScan
      - added tests for comments containing carriage returns
      
      Fixes #3647.
      
      R=rsc
      CC=golang-dev
      https://golang.org/cl/6225047
      7b9a6d8d
    • Alexey Borzenkov's avatar
      net/url: better parsing of urls with @ symbol in authority · f7277dac
      Alexey Borzenkov authored
      Fixes #3439
      
      R=r, rsc, dsymonds, n13m3y3r
      CC=golang-dev
      https://golang.org/cl/6206090
      f7277dac
    • Russ Cox's avatar
      cmd/6a: delete dead code · 6a22e2fb
      Russ Cox authored
      R=ken2
      CC=golang-dev
      https://golang.org/cl/6223060
      6a22e2fb
    • Joel Sing's avatar
      syscall: implement nametomib() on netbsd · 495a9dc2
      Joel Sing authored
      Implement nametomib() on NetBSD using the CTL_QUERY node discovery
      mechanism.
      
      R=golang-dev, rsc
      CC=golang-dev
      https://golang.org/cl/6211071
      495a9dc2
    • Benjamin Black's avatar
      crypto/x509: Add ECDSA support · 5c6162cd
      Benjamin Black authored
      R=golang-dev, agl, rsc
      CC=golang-dev
      https://golang.org/cl/6208087
      5c6162cd
    • Adam Langley's avatar
      crypto/ecdsa: add full set of NIST test vectors. · 5759c602
      Adam Langley authored
      This includes the NIST test suite for ECDSA and alters the test to
      parse and evaluate it.
      
      R=golang-dev, bradfitz, rsc, b
      CC=golang-dev
      https://golang.org/cl/6219058
      5759c602
    • Adam Langley's avatar
      crypto/ecdsa: fix case where p != 0 mod 8 and the hash length < p. · 477d7b16
      Adam Langley authored
      I made a typo which breaks P-521.
      
      R=golang-dev, rsc
      CC=golang-dev
      https://golang.org/cl/6219057
      477d7b16