1. 14 Sep, 2012 9 commits
  2. 13 Sep, 2012 12 commits
  3. 12 Sep, 2012 10 commits
  4. 11 Sep, 2012 9 commits
    • Daniel Morsing's avatar
      cmd/gc: Inline pointer sized T2I interface conversions · 8fd65b0e
      Daniel Morsing authored
      This CL also adds support for marking the likelyness of IF nodes in the AST being true. This feature is being used here to mark the slow path as unlikely.
      
      src/pkg/runtime:
      benchmark                  old ns/op    new ns/op    delta
      BenchmarkConvT2IUintptr           16            1  -91.63%
      
      test/bench/go1:
      benchmark                 old ns/op    new ns/op    delta
      BenchmarkBinaryTree17    5416917000   5461355000   +0.82%
      BenchmarkFannkuch11      3810355000   3842609000   +0.85%
      BenchmarkGobDecode         19950950     19855420   -0.48%
      BenchmarkGobEncode         11301220     11308530   +0.06%
      BenchmarkGzip             548119600    546869200   -0.23%
      BenchmarkGunzip           176145400    180208300   +2.31%
      BenchmarkJSONEncode        93117400     70163100  -24.65%
      BenchmarkJSONDecode       406626800    409999200   +0.83%
      BenchmarkMandelbrot200      6300992      6317866   +0.27%
      BenchmarkParse              7664396      7451625   -2.78%
      BenchmarkRevcomp         1189424000   1412332000  +18.74%
      BenchmarkTemplate         491308400    458654200   -6.65%
      
      benchmark                  old MB/s     new MB/s  speedup
      BenchmarkGobDecode            38.47        38.66    1.00x
      BenchmarkGobEncode            67.92        67.87    1.00x
      BenchmarkGzip                 35.40        35.48    1.00x
      BenchmarkGunzip              110.16       107.68    0.98x
      BenchmarkJSONEncode           20.84        27.66    1.33x
      BenchmarkJSONDecode            4.77         4.73    0.99x
      BenchmarkParse                 7.56         7.77    1.03x
      BenchmarkRevcomp             213.69       179.96    0.84x
      BenchmarkTemplate              3.95         4.23    1.07x
      
      R=rsc, dave, nigeltao
      CC=golang-dev
      https://golang.org/cl/6351090
      8fd65b0e
    • Nigel Tao's avatar
      cmd/gc: recognize small TPTR64 values as small integer constants. · 0184081e
      Nigel Tao authored
      Given the following Go program:
      
      func sum(s []int) int {
              ret := 0
              for _, x := range s {
                      ret += x
              }
              return ret
      }
      
      6g would previously generate:
      
      --- prog list "sum" ---
      0000 (main.go:3) TEXT    sum+0(SB),$0-24
      0001 (main.go:5) MOVQ    s+0(FP),CX
      0002 (main.go:5) MOVL    s+8(FP),DI
      0003 (main.go:5) MOVL    s+12(FP),BX
      0004 (main.go:4) MOVL    $0,SI
      0005 (main.go:5) MOVL    $0,AX
      0006 (main.go:5) JMP     ,8
      0007 (main.go:5) INCL    ,AX
      0008 (main.go:5) CMPL    AX,DI
      0009 (main.go:5) JGE     $0,16
      0010 (main.go:5) MOVL    (CX),DX
      0011 (main.go:5) MOVQ    $4,BX
      0012 (main.go:5) ADDQ    CX,BX
      0013 (main.go:5) MOVQ    BX,CX
      0014 (main.go:6) ADDL    DX,SI
      0015 (main.go:5) JMP     ,7
      0016 (main.go:8) MOVL    SI,.noname+16(FP)
      0017 (main.go:8) RET     ,
      
      and now generates:
      
      --- prog list "sum" ---
      0000 (main.go:3) TEXT    sum+0(SB),$0-24
      0001 (main.go:5) MOVQ    s+0(FP),CX
      0002 (main.go:5) MOVL    s+8(FP),DI
      0003 (main.go:5) MOVL    s+12(FP),BX
      0004 (main.go:4) MOVL    $0,SI
      0005 (main.go:5) MOVL    $0,AX
      0006 (main.go:5) JMP     ,8
      0007 (main.go:5) INCL    ,AX
      0008 (main.go:5) CMPL    AX,DI
      0009 (main.go:5) JGE     $0,14
      0010 (main.go:5) MOVL    (CX),BP
      0011 (main.go:5) ADDQ    $4,CX
      0012 (main.go:6) ADDL    BP,SI
      0013 (main.go:5) JMP     ,7
      0014 (main.go:8) MOVL    SI,.noname+16(FP)
      0015 (main.go:8) RET     ,
      
      The key difference is that
      0011 (main.go:5) MOVQ    $4,BX
      0012 (main.go:5) ADDQ    CX,BX
      0013 (main.go:5) MOVQ    BX,CX
      has changed to
      0011 (main.go:5) ADDQ    $4,CX
      
      R=rsc, dave, remyoudompheng
      CC=golang-dev
      https://golang.org/cl/6506089
      0184081e
    • Andrew Gerrand's avatar
      C: add Francesc Campoy (Google CLA) · b64a99da
      Andrew Gerrand authored
      R=golang-dev, dsymonds, campoy
      CC=golang-dev
      https://golang.org/cl/6490102
      b64a99da
    • Rémy Oudompheng's avatar
      cmd/6g, cmd/8g: do not LEA[LQ] interfaces when calling methods. · b45b6fd1
      Rémy Oudompheng authored
      It is enough to load directly the data word and the itab word
      from memory, so we save a LEA instruction for each method call,
      and allow elimination of some extra temporaries.
      
      Update #1914.
      
      R=daniel.morsing, rsc
      CC=golang-dev, remy
      https://golang.org/cl/6501110
      b45b6fd1
    • Rémy Oudompheng's avatar
      cmd/6g, cmd/8g: eliminate extra agen for nil comparisons. · ff642e29
      Rémy Oudompheng authored
      Removes an extra LEAL/LEAQ instructions there and usually saves
      a useless temporary in the idiom
          if err := foo(); err != nil {...}
      
      Generated code is also less involved:
          MOVQ err+n(SP), AX
          CMPQ AX, $0
      (potentially CMPQ n(SP), $0) instead of
          LEAQ err+n(SP), AX
          CMPQ (AX), $0
      
      Update #1914.
      
      R=daniel.morsing, nigeltao, rsc
      CC=golang-dev, remy
      https://golang.org/cl/6493099
      ff642e29
    • Nigel Tao's avatar
      strings: more thorough Replacer tests. · b19c32ac
      Nigel Tao authored
      This verifies existing behavior. Some replacements are arguably wrong
      (these are marked with TODO) but changing behavior is left for a
      follow-up CL.
      
      Also fix that BenchmarkGenericMatch wasn't actually matching anything.
      
      R=rsc, eric.d.eisner
      CC=bradfitz, golang-dev
      https://golang.org/cl/6488110
      b19c32ac
    • Andrew Gerrand's avatar
      C: spell Brian's name correctly · b4840366
      Andrew Gerrand authored
      R=iant, nigeltao
      CC=golang-dev
      https://golang.org/cl/6492102
      b4840366
    • Alex Brainman's avatar
      4c60f974
    • Russ Cox's avatar
      encoding/json: handle anonymous fields · f97bfb93
      Russ Cox authored
      Fixes #3069.
      
      R=golang-dev, n13m3y3r
      CC=golang-dev
      https://golang.org/cl/6460044
      f97bfb93