1. 11 Apr, 2011 6 commits
  2. 10 Apr, 2011 2 commits
  3. 09 Apr, 2011 1 commit
    • Russ Cox's avatar
      ld: 25% faster · 1bc84b7e
      Russ Cox authored
      The ld time was dominated by symbol table processing, so
        * increase hash table size
        * emit fewer symbols in gc (just 1 per string, 1 per type)
        * add read-only lookup to avoid creating spurious symbols
        * add linked list to speed whole-table traversals
      
      Breaks dwarf generator (no idea why), so disable dwarf.
      
      Reduces time for 6l to link godoc by 25%.
      
      R=ken2
      CC=golang-dev
      https://golang.org/cl/4383047
      1bc84b7e
  4. 08 Apr, 2011 24 commits
    • Robert Griesemer's avatar
      go/printer, gofmt: use blank to separate import rename from import path · ebaf01f0
      Robert Griesemer authored
      Note that declarations.golden is not using spaces for alignment (so
      that the alignment tabs are visible) which is why this change affects
      the test cases significantly. gofmt uses spaces for alignment (by default)
      and only tabs for indentation.
      
      gofmt -w src misc (no changes)
      
      Fixes #1673.
      
      R=iant
      CC=golang-dev
      https://golang.org/cl/4388044
      ebaf01f0
    • Adam Langley's avatar
      big: don't crash when printing nil ints · 8fc67033
      Adam Langley authored
      "%#v" of a structure with *big.Int's tends to crash a lot otherwise.
      
      R=golang-dev, gri
      CC=golang-dev
      https://golang.org/cl/4382044
      8fc67033
    • Russ Cox's avatar
      8g: optimize byte mov · 23f6479b
      Russ Cox authored
      Rewrite MOVB with less expensive
      instruction when possible.
      
      Suggested by atomic symbol.
      
      benchmark                                        old ns/op    new ns/op    delta
      crc32.BenchmarkCrc32KB                               13066         3942  -69.83%
      crc64.BenchmarkCrc64KB                                8780         5949  -32.24%
      lzw.BenchmarkDecoder1e4                             771224       636538  -17.46%
      lzw.BenchmarkDecoder1e5                            7101218      6096634  -14.15%
      lzw.BenchmarkDecoder1e6                           69762020     60789400  -12.86%
      lzw.BenchmarkEncoder1e4                             707968       638812   -9.77%
      lzw.BenchmarkEncoder1e5                            6567122      5965552   -9.16%
      lzw.BenchmarkEncoder1e6                           65006000     58911680   -9.38%
      utf8_test.BenchmarkRuneCountTenASCIIChars              166          165   -0.60%
      utf8_test.BenchmarkRuneCountTenJapaneseChars           246          258   +4.88%
      utf8_test.BenchmarkEncodeASCIIRune                      13           10  -23.08%
      utf8_test.BenchmarkEncodeJapaneseRune                   37           16  -56.76%
      utf8_test.BenchmarkDecodeASCIIRune                      23           21   -8.70%
      utf8_test.BenchmarkDecodeJapaneseRune                   58           32  -44.83%
      
      R=ken2
      CC=golang-dev
      https://golang.org/cl/4381045
      23f6479b
    • Russ Cox's avatar
      gc: fix weird error message · e7c4a6df
      Russ Cox authored
      Fixes #1670.
      
      R=ken2
      CC=golang-dev
      https://golang.org/cl/4386045
      e7c4a6df
    • Robert Hencke's avatar
      io: fixes for Read with n > 0, os.EOF · 8dc0ba7a
      Robert Hencke authored
      R=rsc
      CC=golang-dev
      https://golang.org/cl/4271080
      8dc0ba7a
    • Russ Cox's avatar
      bug327: document what's being tested · 68ed122b
      Russ Cox authored
      R=r
      CC=golang-dev
      https://golang.org/cl/4380043
      68ed122b
    • Russ Cox's avatar
      ld: fix arm build · d26e7364
      Russ Cox authored
      R=ken2
      CC=golang-dev, mikkel
      https://golang.org/cl/4384048
      d26e7364
    • Russ Cox's avatar
      http: do not listen on 0.0.0.0 during test · e6e2eb58
      Russ Cox authored
      Quiets the pop-up boxes on OS X.
      
      R=bradfitzgo, r2
      CC=golang-dev
      https://golang.org/cl/4387042
      e6e2eb58
    • Russ Cox's avatar
      codereview: automatically port old diffs forward · 740051ae
      Russ Cox authored
      In the current codereview, if a patch was written against
      a version of a file that had subsequently been edited,
      hg clpatch would fail, even if the patch and the edits were
      in different parts of the file.  In this situation the reviewer
      typically wrote back saying "please hg sync and hg mail
      to update the patch".
      
      This change rewrites the patch automatically, using the
      same transformation that hg sync + hg mail would.
      
      If the interim changes (since the patch was created)
      affect the same line ranges as the patch, clpatch will
      still refuse to apply it.  But this CL should make
      of the trivial conflicts we see just go away.
      
      R=golang-dev, r
      CC=golang-dev
      https://golang.org/cl/4377046
      740051ae
    • Rob Pike's avatar
      gotest: Fix fix for \r\n on windows. · ddd0fa17
      Rob Pike authored
      R=rsc, brainman, rh, r2
      CC=golang-dev
      https://golang.org/cl/4366045
      ddd0fa17
    • Russ Cox's avatar
      update go tree for reflect changes · db5c5d6f
      Russ Cox authored
      R=golang-dev, r
      CC=golang-dev
      https://golang.org/cl/4353043
      db5c5d6f
    • Russ Cox's avatar
      gofix: reflect changes · fb94eb19
      Russ Cox authored
      R=gri
      CC=golang-dev
      https://golang.org/cl/4343047
      fb94eb19
    • Russ Cox's avatar
      gofix: add -diff, various fixes and helpers · 877c1892
      Russ Cox authored
        * add -diff command line option
        * use scoping information in refersTo, isPkgDot, isPtrPkgDot.
        * add new scoping-based helpers countUses, rewriteUses, assignsTo, isTopName.
        * rename rewrite to walk, add walkBeforeAfter.
        * add toy typechecker, a placeholder for go/types
      
      R=gri
      CC=golang-dev
      https://golang.org/cl/4285053
      877c1892
    • Russ Cox's avatar
      reflect: new Type and Value definitions · fb175cf7
      Russ Cox authored
      Type is now an interface that implements all the possible type methods.
      Instead of a type switch on a reflect.Type t, switch on t.Kind().
      If a method is invoked on the wrong kind of type (for example,
      calling t.Field(0) when t.Kind() != Struct), the call panics.
      
      There is one method renaming: t.(*ChanType).Dir() is now t.ChanDir().
      
      Value is now a struct value that implements all the possible value methods.
      Instead of a type switch on a reflect.Value v, switch on v.Kind().
      If a method is invoked on the wrong kind of value (for example,
      calling t.Recv() when t.Kind() != Chan), the call panics.
      
      Since Value is now a struct, not an interface, its zero value
      cannot be compared to nil.  Instead of v != nil, use v.IsValid().
      Instead of other uses of nil as a Value, use Value{}, the zero value.
      
      Many methods have been renamed, most due to signature conflicts:
      
                 OLD                          NEW
      
          v.(*ArrayValue).Elem             v.Index
          v.(*BoolValue).Get               v.Bool
          v.(*BoolValue).Set               v.SetBool
          v.(*ChanType).Dir                v.ChanDir
          v.(*ChanValue).Get               v.Pointer
          v.(*ComplexValue).Get            v.Complex
          v.(*ComplexValue).Overflow       v.OverflowComplex
          v.(*ComplexValue).Set            v.SetComplex
          v.(*FloatValue).Get              v.Float
          v.(*FloatValue).Overflow         v.OverflowFloat
          v.(*FloatValue).Set              v.SetFloat
          v.(*FuncValue).Get               v.Pointer
          v.(*InterfaceValue).Get          v.InterfaceData
          v.(*IntValue).Get                v.Int
          v.(*IntValue).Overflow           v.OverflowInt
          v.(*IntValue).Set                v.SetInt
          v.(*MapValue).Elem               v.MapIndex
          v.(*MapValue).Get                v.Pointer
          v.(*MapValue).Keys               v.MapKeys
          v.(*MapValue).SetElem            v.SetMapIndex
          v.(*PtrValue).Get                v.Pointer
          v.(*SliceValue).Elem             v.Index
          v.(*SliceValue).Get              v.Pointer
          v.(*StringValue).Get             v.String
          v.(*StringValue).Set             v.SetString
          v.(*UintValue).Get               v.Uint
          v.(*UintValue).Overflow          v.OverflowUint
          v.(*UintValue).Set               v.SetUint
          v.(*UnsafePointerValue).Get      v.Pointer
          v.(*UnsafePointerValue).Set      v.SetPointer
      
      Part of the motivation for this change is to enable a more
      efficient implementation of Value, one that does not allocate
      memory during most operations.  To reduce the size of the CL,
      this CL's implementation is a wrapper around the old API.
      Later CLs will make the implementation more efficient without
      changing the API.
      
      Other CLs to be submitted at the same time as this one
      add support for this change to gofix (4343047) and update
      the Go source tree (4353043).
      
      R=gri, iant, niemeyer, r, rog, gustavo, r2
      CC=golang-dev
      https://golang.org/cl/4281055
      fb175cf7
    • Russ Cox's avatar
      gofix: be more conservative about rewrite to os.Create · 846a368b
      Russ Cox authored
      Rewrite only if we understood all the flags we saw.
      
      R=r
      CC=golang-dev
      https://golang.org/cl/4376046
      846a368b
    • Alex Brainman's avatar
      gotest: handle \r\n returned by gomake on Windows (fixes build) · d9763147
      Alex Brainman authored
      R=golang-dev, peterGo, rsc1
      CC=Joe Poirier, golang-dev
      https://golang.org/cl/4370048
      d9763147
    • Robert Griesemer's avatar
    • Robert Griesemer's avatar
      gotype: use go/types GcImporter · 1baffa7d
      Robert Griesemer authored
      R=rsc
      CC=golang-dev
      https://golang.org/cl/4358043
      1baffa7d
    • Robert Griesemer's avatar
      go/types: New Go type hierarchy implementation for AST. · a87382e7
      Robert Griesemer authored
      This CL defines a new, more Go-like representation of
      Go types (different structs for different types as
      opposed to a single Type node). It also implements
      an ast.Importer for object/archive files generated
      by the gc compiler tool chain. Besides the individual
      type structs, the main difference is the handling of
      named types: In the old world, a named type had a
      non-nil *Object pointer but otherwise looked no
      different from other types. In this new model, named
      types have their own representation types.Name. As
      a result, resolving cycles is a bit simpler during
      construction, at the cost of having to deal with
      types.Name nodes explicitly later. It remains to be
      seen if this is a good approach. Nevertheless, code
      involving types reads more nicely and benefits from
      full type checking. Also, the representation seems
      to more closely match the spec wording.
      
      Credits: The original version of the gc importer was
      written by Evan Shaw (chickencha@gmail.com). The new
      version in this CL is based largely on Evan's original
      code but contains bug fixes, a few simplifications,
      some restructuring, and was adjusted to use the
      new type hierarchy. I have added a comprehensive test
      that imports all packages found under $GOROOT/pkg (with
      a 3s time-out to limit the run-time of the test). Run
      gotest -v for details.
      
      The original version of ExportData (exportdata.go) was
      written by Russ Cox (rsc@golang.org). The current version
      is returning the internal buffer positioned at the beginning
      of the export data instead of printing the export data to
      stdout.
      
      With the new types package, the existing in-progress
      typechecker package is deprecated. I will delete it
      once all functionality has been brought over.
      
      R=eds, rog, rsc
      CC=golang-dev
      https://golang.org/cl/4314054
      a87382e7
    • Robert Griesemer's avatar
      scanner: better TokenString output · 70bf4215
      Robert Griesemer authored
      R=rsc
      CC=golang-dev
      https://golang.org/cl/4373048
      70bf4215
    • John DeNero's avatar
      A codewalk through a simple program that illustrates several aspects of Go... · 4ffee801
      John DeNero authored
      A codewalk through a simple program that illustrates several aspects of Go functions: function objects, higher-order functions, variadic functions, tail recursion, etc.  The example program simulates the game of Pig, a dice game with simple rules but a nontrivial solution.
      
      R=adg, rsc, iant2, r
      CC=golang-dev
      https://golang.org/cl/4306045
      4ffee801
    • Alex Brainman's avatar
      test/bench: enable build and test on Windows · 776fd725
      Alex Brainman authored
      R=golang-dev, rsc1
      CC=golang-dev
      https://golang.org/cl/4366043
      776fd725
    • Alex Brainman's avatar
      misc/cgo/life: enable build and test on Windows · 2683c76d
      Alex Brainman authored
      R=golang-dev, rsc1
      CC=golang-dev, vcc
      https://golang.org/cl/4374044
      2683c76d
    • Alex Brainman's avatar
      syscall: fix Windows Signalled · d3cd0c07
      Alex Brainman authored
      Thanks to fhs.
      
      R=golang-dev, r2
      CC=ality, fhs, golang-dev
      https://golang.org/cl/4375044
      d3cd0c07
  5. 07 Apr, 2011 7 commits