]> Cypherpunks repositories - gostls13.git/log
gostls13.git
12 years agodebug/pe: support PE files which contain no symbol table (if NumberOfSymbols is equal...
Robin Eklind [Tue, 9 Oct 2012 00:15:53 +0000 (11:15 +1100)]
debug/pe: support PE files which contain no symbol table (if NumberOfSymbols is equal to 0 in the IMAGE_FILE_HEADER structure).

No longer assume that e_lfanew (in the IMAGE_DOS_HEADER strcuture) is always one byte. It is now regarded as a 4 byte uint32.

Fixes #4177.

R=golang-dev, alex.brainman, dave, minux.ma
CC=golang-dev
https://golang.org/cl/6587048

12 years agoA+C: added Robin Eklind (individual CLA)
Robert Griesemer [Tue, 9 Oct 2012 00:14:44 +0000 (17:14 -0700)]
A+C: added Robin Eklind (individual CLA)

R=alex.brainman, r
CC=golang-dev
https://golang.org/cl/6643045

12 years agogodoc: support Playground examples on App Engine
Andrew Gerrand [Mon, 8 Oct 2012 22:57:51 +0000 (09:57 +1100)]
godoc: support Playground examples on App Engine

Updates setup-godoc-app.bash to produce a working godoc app
by substituting the go1.0.x go/... packages with those from tip.

R=gri
CC=golang-dev
https://golang.org/cl/6587080

12 years agotesting: change -test.benchtime to a flag.Duration.
David Symonds [Mon, 8 Oct 2012 21:57:29 +0000 (08:57 +1100)]
testing: change -test.benchtime to a flag.Duration.

Fixes #3902.

R=golang-dev, minux.ma, rsc, r
CC=golang-dev
https://golang.org/cl/6611059

12 years agoencoding/base{32,64}: add examples.
David Symonds [Mon, 8 Oct 2012 21:56:34 +0000 (08:56 +1100)]
encoding/base{32,64}: add examples.

Fixes #4136.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6615061

12 years agonet/url: report first error from ParseQuery.
David Symonds [Mon, 8 Oct 2012 21:10:32 +0000 (08:10 +1100)]
net/url: report first error from ParseQuery.

Fixes #4175.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6610068

12 years agotest: Make run.go's errorcheck behave like testlib.
Daniel Morsing [Mon, 8 Oct 2012 14:36:45 +0000 (16:36 +0200)]
test: Make run.go's errorcheck behave like testlib.

testlib will complain about any unmatched errors left in errorchecks while run.go will not.

Fixes #4141.

R=golang-dev, minux.ma, remyoudompheng, rsc
CC=golang-dev
https://golang.org/cl/6614060

12 years agodoc: update text about hgrc and environment variables.
David Symonds [Mon, 8 Oct 2012 11:24:41 +0000 (22:24 +1100)]
doc: update text about hgrc and environment variables.

Mercurial has supported environment variables in hgrc files since
version 1.4 (released November 2009).

R=golang-dev, dave, minux.ma
CC=golang-dev
https://golang.org/cl/6619067

12 years agofix build: use temporary variable to avoid compiler error
Robert Griesemer [Mon, 8 Oct 2012 01:16:04 +0000 (18:16 -0700)]
fix build: use temporary variable to avoid compiler error

R=r
CC=golang-dev
https://golang.org/cl/6612066

12 years agoexp/types/staging: more flexible API, cleanups
Robert Griesemer [Mon, 8 Oct 2012 01:02:19 +0000 (18:02 -0700)]
exp/types/staging: more flexible API, cleanups

- Changed Check signature to take function parameters for
  more flexibility: Now a client can interrupt type checking
  early (via panic in one the upcalls) once the desired
  type information or number of errors is reached. Default
  use is still simple.

- Cleaned up main typechecking loops. Now does not neglect
  _ declarations anymore.

- Various other cleanups.

R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/6612049

12 years ago/exp/types/staging: expression and statement type checking
Robert Griesemer [Mon, 8 Oct 2012 01:01:43 +0000 (18:01 -0700)]
/exp/types/staging: expression and statement type checking

Still lots of pieces missing, but basic framework working.
Lots of tests.

R=rsc
CC=golang-dev
https://golang.org/cl/6594054

12 years agoexp/types/staging: test drivers
Robert Griesemer [Mon, 8 Oct 2012 01:00:56 +0000 (18:00 -0700)]
exp/types/staging: test drivers

This code has been reviewed before. The most significant
change is to check_test which now can handle more than
one error at the same error position (due to spurious
errors - should not happen in praxis once error handling
has been fine-tuned). This change makes check_test easier
to use during development.

R=rsc
CC=golang-dev
https://golang.org/cl/6584057

12 years agoexp/locale/collate: use gofmt -w -s (rather than just gofmt -w)
Robert Griesemer [Mon, 8 Oct 2012 00:59:33 +0000 (17:59 -0700)]
exp/locale/collate: use gofmt -w -s (rather than just gofmt -w)

Also: apply gofmt -w -s to existing tables.

R=mpvl, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/6611051

12 years agogo/parser: fix object kind
Robert Griesemer [Mon, 8 Oct 2012 00:58:13 +0000 (17:58 -0700)]
go/parser: fix object kind

Bug introduced with CL 6624047.

R=r
CC=golang-dev
https://golang.org/cl/6620073

12 years agogophertool: make work with latest Chrome extension security restrictions
Brad Fitzpatrick [Mon, 8 Oct 2012 00:56:10 +0000 (17:56 -0700)]
gophertool: make work with latest Chrome extension security restrictions

No JavaScript in HTML anymore.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6619066

12 years agogodoc: fetch jQuery via https
Andrew Gerrand [Sun, 7 Oct 2012 23:40:56 +0000 (10:40 +1100)]
godoc: fetch jQuery via https

R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/6614064

12 years agocmd/5g: avoid temporaries during gcmp(reg, constant)
Dave Cheney [Sun, 7 Oct 2012 22:51:04 +0000 (09:51 +1100)]
cmd/5g: avoid temporaries during gcmp(reg, constant)

Address several instances of unneeded temporaries when using gcmp.

func M(m map[int]bool) int {
        return len(m)
}

--- prog list "M" ---
0000 (/home/dfc/src/map.go:3) TEXT      M+0(SB),$0-8
0001 (/home/dfc/src/map.go:4) MOVW      m+0(FP),R0
0002 (/home/dfc/src/map.go:4) MOVW      $0,R1
0003 (/home/dfc/src/map.go:4) CMP       R1,R0,
0004 (/home/dfc/src/map.go:4) BEQ       ,6(APC)
0005 (/home/dfc/src/map.go:4) MOVW      0(R0),R0
0006 (/home/dfc/src/map.go:4) MOVW      R0,.noname+4(FP)
0007 (/home/dfc/src/map.go:4) RET       ,

after:

--- prog list "M" ---
0000 (/home/dfc/src/map.go:3) TEXT      M+0(SB),$0-8
0001 (/home/dfc/src/map.go:4) MOVW      m+0(FP),R0
0002 (/home/dfc/src/map.go:4) CMP       $0,R0,
0003 (/home/dfc/src/map.go:4) BEQ       ,5(APC)
0004 (/home/dfc/src/map.go:4) MOVW      0(R0),R0
0005 (/home/dfc/src/map.go:4) MOVW      R0,.noname+4(FP)
0006 (/home/dfc/src/map.go:4) RET       ,

func C(c chan int) int {
        return cap(c)
}

--- prog list "C" ---
0000 (/home/dfc/src/map.go:3) TEXT      C+0(SB),$0-8
0001 (/home/dfc/src/map.go:4) MOVW      c+0(FP),R0
0002 (/home/dfc/src/map.go:4) MOVW      $0,R1
0003 (/home/dfc/src/map.go:4) CMP       R1,R0,
0004 (/home/dfc/src/map.go:4) BEQ       ,6(APC)
0005 (/home/dfc/src/map.go:4) MOVW      4(R0),R0
0006 (/home/dfc/src/map.go:4) MOVW      R0,.noname+4(FP)
0007 (/home/dfc/src/map.go:4) RET       ,

after:

--- prog list "C" ---
0000 (/home/dfc/src/map.go:3) TEXT      C+0(SB),$0-8
0001 (/home/dfc/src/map.go:4) MOVW      c+0(FP),R0
0002 (/home/dfc/src/map.go:4) CMP       $0,R0,
0003 (/home/dfc/src/map.go:4) BEQ       ,5(APC)
0004 (/home/dfc/src/map.go:4) MOVW      4(R0),R0
0005 (/home/dfc/src/map.go:4) MOVW      R0,.noname+4(FP)
0006 (/home/dfc/src/map.go:4) RET       ,

R=rsc, minux.ma, remyoudompheng
CC=golang-dev
https://golang.org/cl/6618054

12 years agotest: convert more tests to rundir/compiledir conventions
Rémy Oudompheng [Sun, 7 Oct 2012 21:22:01 +0000 (23:22 +0200)]
test: convert more tests to rundir/compiledir conventions

Update #4139.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6609051

12 years agotest/testlib: don't forget stderr for rundircmpout.
Rémy Oudompheng [Sun, 7 Oct 2012 21:14:20 +0000 (23:14 +0200)]
test/testlib: don't forget stderr for rundircmpout.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6620071

12 years agocmd/8a: add SSE2 instructions
Russ Cox [Sun, 7 Oct 2012 20:36:29 +0000 (16:36 -0400)]
cmd/8a: add SSE2 instructions

R=ken
CC=golang-dev
https://golang.org/cl/6614063

12 years agocmd/8l: add SSE2 instructions
Russ Cox [Sun, 7 Oct 2012 20:36:14 +0000 (16:36 -0400)]
cmd/8l: add SSE2 instructions

R=ken
CC=golang-dev
https://golang.org/cl/6610065

12 years agocmd/gc: skip over reported BOMs
Russ Cox [Sun, 7 Oct 2012 20:35:45 +0000 (16:35 -0400)]
cmd/gc: skip over reported BOMs

This keeps the BOM runes from causing other errors.

R=golang-dev, remyoudompheng
CC=golang-dev
https://golang.org/cl/6625062

12 years agocmd/ld, cmd/5l: support R_ARM_PC24 and R_ARM_JUMP24, fix R_ARM_CALL
Shenghou Ma [Sun, 7 Oct 2012 20:20:17 +0000 (04:20 +0800)]
cmd/ld, cmd/5l: support R_ARM_PC24 and R_ARM_JUMP24, fix R_ARM_CALL

1. R_ARM_CALL can also be used to call a PLT entry
2. add support for R_ARM_PC24 and R_ARM_JUMP24
3. refactor, remove D_PLT32 in favor of D_CALL

Fixes #4006.

R=rsc, dave
CC=fullung, golang-dev
https://golang.org/cl/6622057

12 years agocodereview: more mercurial interface fixes
Shenghou Ma [Sun, 7 Oct 2012 20:19:36 +0000 (04:19 +0800)]
codereview: more mercurial interface fixes
        Fixes #4131.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6614061

12 years agotest: correct type in declbad.go
Rémy Oudompheng [Sun, 7 Oct 2012 19:52:57 +0000 (21:52 +0200)]
test: correct type in declbad.go

The test is not about type mismatches and it causes
an extra error to appear.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6614062

12 years agotest/bench/shootout: match gcc architecture to GOARCH
Russ Cox [Sun, 7 Oct 2012 19:49:56 +0000 (15:49 -0400)]
test/bench/shootout: match gcc architecture to GOARCH

If we're benchmarking 8g, use gcc -m32.
If we're benchmarking 6g, use gcc -m64.

R=golang-dev, bradfitz, minux.ma, remyoudompheng
CC=golang-dev
https://golang.org/cl/6625061

12 years agocmd/gc: more graceful handling of invalid fields in widstruct.
Rémy Oudompheng [Sun, 7 Oct 2012 19:46:10 +0000 (21:46 +0200)]
cmd/gc: more graceful handling of invalid fields in widstruct.

The protection against segfaults does not completely solve
crashes and breaks test/fixedbugs/bug365.go

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6615058

12 years agocmd/gc: avoid crash in %N print
Russ Cox [Sun, 7 Oct 2012 19:35:01 +0000 (15:35 -0400)]
cmd/gc: avoid crash in %N print

R=ken2
CC=golang-dev
https://golang.org/cl/6609052

12 years agoio/ioutil: fix data race under the race detector
Dmitriy Vyukov [Sun, 7 Oct 2012 18:08:06 +0000 (22:08 +0400)]
io/ioutil: fix data race under the race detector
See issue 3970 (it's already marked as Fixed).

R=rsc, minux.ma
CC=golang-dev
https://golang.org/cl/6624059

12 years agorace: sync/atomic changes
Dmitriy Vyukov [Sun, 7 Oct 2012 18:07:32 +0000 (22:07 +0400)]
race: sync/atomic changes
This is a part of a bigger change that adds data race detection feature:
https://golang.org/cl/6456044

R=rsc, remyoudompheng
CC=gobot, golang-dev
https://golang.org/cl/6536059

12 years agorace: sync changes
Dmitriy Vyukov [Sun, 7 Oct 2012 18:07:03 +0000 (22:07 +0400)]
race: sync changes
This is a part of a bigger change that adds data race detection feature:
https://golang.org/cl/6456044

R=rsc, minux.ma
CC=gobot, golang-dev
https://golang.org/cl/6529053

12 years agorace: runtime changes
Dmitriy Vyukov [Sun, 7 Oct 2012 18:05:32 +0000 (22:05 +0400)]
race: runtime changes
This is a part of a bigger change that adds data race detection feature:
https://golang.org/cl/6456044

R=rsc
CC=gobot, golang-dev
https://golang.org/cl/6535050

12 years agoruntime: disable TestParForParallel for now on 32-bit hosts
Shenghou Ma [Sun, 7 Oct 2012 17:56:27 +0000 (01:56 +0800)]
runtime: disable TestParForParallel for now on 32-bit hosts
Also add call to GC() to make it easier to re-enable the test.

Update #4155.
When we have precise GC merged, re-enable this test.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6622058

12 years agotest/run.go: use correct executable filename on Windows, fix build
Shenghou Ma [Sun, 7 Oct 2012 17:54:56 +0000 (01:54 +0800)]
test/run.go: use correct executable filename on Windows, fix build

R=golang-dev, daniel.morsing
CC=golang-dev
https://golang.org/cl/6624060

12 years agoos: make TestMkdirAllWithSymlink more robust
Brad Fitzpatrick [Sun, 7 Oct 2012 17:31:56 +0000 (10:31 -0700)]
os: make TestMkdirAllWithSymlink more robust

Don't assume the test has a clean environment within /tmp.
Use an actual new tempdir for its tests.

Fixes FreeBSD build failure as seen at:
http://build.golang.org/log/396738676356d7fb6bab6eaf1b97cac820f8a90f

--- FAIL: TestMkdirAllWithSymlink (0.00 seconds)
path_test.go:178:                 Mkdir /tmp/dir: mkdir /tmp/dir: file exists
FAIL
FAIL    os      1.091s

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/6615057

12 years agonet/http/httptest: mimic the normal HTTP server's ResponseWriter more closely
Brad Fitzpatrick [Sun, 7 Oct 2012 16:48:14 +0000 (09:48 -0700)]
net/http/httptest: mimic the normal HTTP server's ResponseWriter more closely

Also adds tests, which didn't exist before.

Fixes #4188

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6613062

12 years agotest: use rundir and errorcheckdir for a few more tests.
Rémy Oudompheng [Sun, 7 Oct 2012 16:37:05 +0000 (18:37 +0200)]
test: use rundir and errorcheckdir for a few more tests.

Update #4139.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/6620070

12 years agotesting: fix extra tabs when t.Log("string")
Shenghou Ma [Sun, 7 Oct 2012 16:21:53 +0000 (00:21 +0800)]
testing: fix extra tabs when t.Log("string")

t.Log("line 1\nline 2\nline 3")

Old output:
=== RUN TestLine3
--- PASS: TestLine3 (0.00 seconds)
testing_test.go:25:  line 1
line 2
line 3
PASS

New output:
=== RUN TestLine3
--- PASS: TestLine3 (0.00 seconds)
testing_test.go:24:  line 1
line 2
line 3
PASS

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6613069

12 years agosyscall: fix Statfs and Fstatfs on Linux/ARM
Shenghou Ma [Sun, 7 Oct 2012 16:13:28 +0000 (00:13 +0800)]
syscall: fix Statfs and Fstatfs on Linux/ARM

R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/6615055

12 years agocmd/gc: replace "typechecking loop" by nicer errors in some cases.
Rémy Oudompheng [Sun, 7 Oct 2012 15:35:21 +0000 (17:35 +0200)]
cmd/gc: replace "typechecking loop" by nicer errors in some cases.

For issue 3757:
BEFORE:  test/fixedbugs/bug463.go:12: typechecking loop involving a
             test/fixedbugs/bug463.go:12 a
             test/fixedbugs/bug463.go:12 <node DCLCONST>
AFTER:   test/fixedbugs/bug463.go:12: constant definition loop
             test/fixedbugs/bug463.go:12: a uses a

For issue 3937:
BEFORE: test/fixedbugs/bug464.go:12: typechecking loop involving foo
            test/fixedbugs/bug464.go:12 <T>
            test/fixedbugs/bug464.go:12 foo
            test/fixedbugs/bug464.go:12 <node DCLFUNC>
AFTER:  test/fixedbugs/bug464.go:12: foo is not a type

Fixes #3757.
Fixes #3937.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6614058

12 years agocmd/gc: Don't accept qualified names as literal keys
Daniel Morsing [Sun, 7 Oct 2012 14:47:53 +0000 (16:47 +0200)]
cmd/gc: Don't accept qualified names as literal keys

Fixes #4067.

R=golang-dev, minux.ma, dave, rsc
CC=golang-dev
https://golang.org/cl/6622056

12 years agoimage/jpeg: move the huffman bit decoder state higher up in the
Nigel Tao [Sun, 7 Oct 2012 08:32:28 +0000 (19:32 +1100)]
image/jpeg: move the huffman bit decoder state higher up in the
decoder struct, inside the unmappedzero limit, to eliminate some
TESTB instructions in the inner decoding loop.

benchmark          old ns/op    new ns/op    delta
BenchmarkDecode      2943204      2746360   -6.69%

R=r, dave
CC=golang-dev
https://golang.org/cl/6625058

12 years agocmd/gc: fix output filename generation on Windows
Shenghou Ma [Sun, 7 Oct 2012 06:14:46 +0000 (14:14 +0800)]
cmd/gc: fix output filename generation on Windows

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6610060

12 years agocmd/gc: don't dereference a nil Type pointer in widstruct
Akshat Kumar [Sun, 7 Oct 2012 06:11:59 +0000 (14:11 +0800)]
cmd/gc: don't dereference a nil Type pointer in widstruct

The nil dereference in the next few lines doesn't seem
to cause a segmentation fault on Unix, but does seem
to halt the Go compiler.

The following is a test case:

>>>
package main

func mine(int b) int {
        return b + 2
}

func main() {
        mine()

        c = mine()
}
<<<

Without this change only the following is caught:

typecheck.go:3: undefined: b
typecheck.go:4: undefined: b

with it, we catch all the errors:

typecheck.go:3: undefined: b
typecheck.go:4: undefined: b
typecheck.go:10: undefined: c
typecheck.go:10: cannot assign to c .

R=rsc, minux.ma
CC=golang-dev
https://golang.org/cl/6542060

12 years agocmd/gc: Don't export embedded builtins
Daniel Morsing [Sun, 7 Oct 2012 04:53:57 +0000 (06:53 +0200)]
cmd/gc: Don't export embedded builtins

Fixes #4124.

R=golang-dev, dave, minux.ma, remyoudompheng, rsc
CC=golang-dev
https://golang.org/cl/6543057

12 years agocmd/5g: avoid temporary in slice bounds check
Dave Cheney [Sun, 7 Oct 2012 00:37:14 +0000 (11:37 +1100)]
cmd/5g: avoid temporary in slice bounds check

before

func addr(s[]int) *int {
        return &s[2]
   10c1c:       e28d0008        add     r0, sp, #8
   10c20:       e5901004        ldr     r1, [r0, #4]
   10c24:       e3a02002        mov     r2, #2
   10c28:       e1510002        cmp     r1, r2
   10c2c:       8a000000        bhi     10c34 <main.addr+0x34>
   10c30:       eb0035e6        bl      1e3d0 <runtime.panicindex>
   10c34:       e5900000        ldr     r0, [r0]
   10c38:       e2800008        add     r0, r0, #8
   10c3c:       e58d0014        str     r0, [sp, #20]
   10c40:       e49df004        pop     {pc}            ; (ldr pc, [sp], #4)

after

func addr(s[]int) *int {
return &s[2]
   10c1c:       e28d0008        add     r0, sp, #8
   10c20:       e5901004        ldr     r1, [r0, #4]
   10c24:       e3510002        cmp     r1, #2
   10c28:       8a000000        bhi     10c30 <main.addr+0x30>
   10c2c:       eb0035e6        bl      1e3cc <runtime.panicindex>
   10c30:       e5900000        ldr     r0, [r0]
   10c34:       e2800008        add     r0, r0, #8
   10c38:       e58d0014        str     r0, [sp, #20]
   10c3c:       e49df004        pop     {pc}            ; (ldr pc, [sp], #4)

Also, relax gcmp restriction that 2nd operand must be a register. A followup
CL will address the remaining TODO items.

R=rsc, remyoudompheng, minux.ma
CC=golang-dev
https://golang.org/cl/6620064

12 years agoimage/jpeg: move the level-shift and clip out of the idct function,
Nigel Tao [Sun, 7 Oct 2012 00:32:02 +0000 (11:32 +1100)]
image/jpeg: move the level-shift and clip out of the idct function,
to be consistent with the fdct function, and to ease any future
idct rewrites in assembly.

The BenchmarkIDCT delta is obviously just an accounting change and not
a real saving, but it does give an indication of what proportion of
time was spent in the actual IDCT and what proportion was in shift and
clip. The idct time taken is now comparable to fdct.

The BenchmarkFDCT delta is an estimate of benchmark noise.

benchmark                   old ns/op    new ns/op    delta
BenchmarkFDCT                    3842         3837   -0.13%
BenchmarkIDCT                    5611         3478  -38.01%
BenchmarkDecodeRGBOpaque      2932785      2929751   -0.10%

R=r
CC=golang-dev
https://golang.org/cl/6625057

12 years agoimage/jpeg: clean up BenchmarkDecode and BenchmarkEncode to not
Nigel Tao [Sun, 7 Oct 2012 00:30:47 +0000 (11:30 +1100)]
image/jpeg: clean up BenchmarkDecode and BenchmarkEncode to not
refer to opacity. Those references were copy/pasted from the
image/png encoding benchmarks, which cares whether or not the
source image is opaque, but the JPEG encoder does not care.

R=r
CC=golang-dev
https://golang.org/cl/6623052

12 years agodoc/debugging_with_gdb: fix minor typo (space before comma)
Robert Hencke [Sun, 7 Oct 2012 00:24:14 +0000 (11:24 +1100)]
doc/debugging_with_gdb: fix minor typo (space before comma)

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6610061

12 years agoimage/jpeg: add DCT tests, do a small optimization (common sub-expression
Nigel Tao [Sat, 6 Oct 2012 23:21:17 +0000 (10:21 +1100)]
image/jpeg: add DCT tests, do a small optimization (common sub-expression
elimination) in idct.go.

benchmark                   old ns/op    new ns/op    delta
BenchmarkIDCT                    5649         5610   -0.69%
BenchmarkDecodeRGBOpaque      2948607      2941051   -0.26%

The "type block" declaration moved so that idct.go is compilable
as a stand-alone file: "go tool 6g -S idct.go" works.

R=r
CC=golang-dev
https://golang.org/cl/6619056

12 years agocmd/gc: avoid clobbering the AST in cgen_callmeth.
Rémy Oudompheng [Sat, 6 Oct 2012 22:52:40 +0000 (00:52 +0200)]
cmd/gc: avoid clobbering the AST in cgen_callmeth.

It confused the detection of init loops when involving
method calls.

Fixes #3890.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6620067

12 years agocmd/6g: fix out of registers when chaining integer divisions.
Rémy Oudompheng [Sat, 6 Oct 2012 22:30:29 +0000 (00:30 +0200)]
cmd/6g: fix out of registers when chaining integer divisions.

Fixes #4201.

R=golang-dev, rsc
CC=golang-dev, remy
https://golang.org/cl/6622055

12 years agocmd/gc: make rnd() more 64-bit-friendly.
Rémy Oudompheng [Sat, 6 Oct 2012 22:29:55 +0000 (00:29 +0200)]
cmd/gc: make rnd() more 64-bit-friendly.

Fixes #4200.

R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/6619057

12 years agotext/template: fix nil crash on Templates
Rob Pike [Sat, 6 Oct 2012 22:26:59 +0000 (09:26 +1100)]
text/template: fix nil crash on Templates
Fixes #3872.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6612060

12 years agotext/template: add an unexported method to Node
Rob Pike [Sat, 6 Oct 2012 20:15:11 +0000 (07:15 +1100)]
text/template: add an unexported method to Node
Protects the package a little against undesirable clients.

R=golang-dev, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/6624054

12 years agocmd/5g: avoid temporary during constant asop
Dave Cheney [Sat, 6 Oct 2012 11:01:49 +0000 (21:01 +1000)]
cmd/5g: avoid temporary during constant asop

func add() int {
        var a int
        a += 10
        a += 20
        a += 30
        a -= 10
        a -= 20
        a -= 30
        return a
}

before

--- prog list "add" ---
0000 (/home/dfc/src/add.go:5) TEXT      add+0(SB),$0-4
0001 (/home/dfc/src/add.go:6) MOVW      $0,R2
0002 (/home/dfc/src/add.go:7) MOVW      $10,R0
0003 (/home/dfc/src/add.go:7) ADD       R0,R2,R1
0004 (/home/dfc/src/add.go:8) MOVW      $20,R0
0005 (/home/dfc/src/add.go:8) ADD       R0,R1
0006 (/home/dfc/src/add.go:9) MOVW      $30,R0
0007 (/home/dfc/src/add.go:9) ADD       R0,R1
0008 (/home/dfc/src/add.go:10) MOVW     $10,R0
0009 (/home/dfc/src/add.go:10) SUB      R0,R1
0010 (/home/dfc/src/add.go:11) MOVW     $20,R0
0011 (/home/dfc/src/add.go:11) SUB      R0,R1
0012 (/home/dfc/src/add.go:12) MOVW     $30,R0
0013 (/home/dfc/src/add.go:12) SUB      R0,R1,R2
0014 (/home/dfc/src/add.go:12) MOVW     R2,R0
0015 (/home/dfc/src/add.go:13) MOVW     R2,R1
0016 (/home/dfc/src/add.go:13) MOVW     R2,.noname+0(FP)
0017 (/home/dfc/src/add.go:13) RET      ,

after

--- prog list "add" ---
0000 (/home/dfc/src/add.go:5) TEXT      add+0(SB),$0-4
0001 (/home/dfc/src/add.go:6) MOVW      $0,R0
0002 (/home/dfc/src/add.go:7) ADD       $10,R0
0003 (/home/dfc/src/add.go:8) ADD       $20,R0
0004 (/home/dfc/src/add.go:9) ADD       $30,R0
0005 (/home/dfc/src/add.go:10) SUB      $10,R0
0006 (/home/dfc/src/add.go:11) SUB      $20,R0
0007 (/home/dfc/src/add.go:12) SUB      $30,R0,R2
0008 (/home/dfc/src/add.go:13) MOVW     R2,R0
0009 (/home/dfc/src/add.go:13) MOVW     R2,.noname+0(FP)
0010 (/home/dfc/src/add.go:13) RET      ,

R=rsc, minux.ma, remyoudompheng
CC=golang-dev
https://golang.org/cl/6584056

12 years agoruntime: fix a panic when growing zero-width-element slices.
Rémy Oudompheng [Sat, 6 Oct 2012 10:05:52 +0000 (12:05 +0200)]
runtime: fix a panic when growing zero-width-element slices.

Fixes #4197.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6611056

12 years agopprof: add goroutine blocking profiling
Dmitriy Vyukov [Sat, 6 Oct 2012 08:56:04 +0000 (12:56 +0400)]
pprof: add goroutine blocking profiling
The profiler collects goroutine blocking information similar to Google Perf Tools.
You may see an example of the profile (converted to svg) attached to
http://code.google.com/p/go/issues/detail?id=3946
The public API changes are:
+pkg runtime, func BlockProfile([]BlockProfileRecord) (int, bool)
+pkg runtime, func SetBlockProfileRate(int)
+pkg runtime, method (*BlockProfileRecord) Stack() []uintptr
+pkg runtime, type BlockProfileRecord struct
+pkg runtime, type BlockProfileRecord struct, Count int64
+pkg runtime, type BlockProfileRecord struct, Cycles int64
+pkg runtime, type BlockProfileRecord struct, embedded StackRecord

R=rsc, dave, minux.ma, r
CC=gobot, golang-dev, r, remyoudompheng
https://golang.org/cl/6443115

12 years agotest: Add rundir, rundircmpout and errorcheckdir commands to testlib and run.go
Daniel Morsing [Sat, 6 Oct 2012 07:23:31 +0000 (09:23 +0200)]
test: Add rundir, rundircmpout and errorcheckdir commands to testlib and run.go

rundir will compile each file in the directory in lexicographic order, link the last file as the main package and run the resulting program. rundircmpout is an related command, that will compare the output of the program to an corresponding .out file

errorcheckdir will compile each file in a directory in lexicographic order, running errorcheck on each file as it compiles. All compilations are assumed to be successful except for the last file. However, If a -0 flag is present on the command, the last compilation will also be assumed successful

This CL also includes a small refactoring of run.go. It was getting unwieldy and the meaning of the run commands was hidden behind argument line formatting.

Fixes #4058.

R=rsc, minux.ma, remyoudompheng, iant
CC=golang-dev
https://golang.org/cl/6554071

12 years agocmd/cc: map C int to int32 in Go defs
Jan Ziak [Sat, 6 Oct 2012 05:56:12 +0000 (13:56 +0800)]
cmd/cc: map C int to int32 in Go defs

R=golang-dev, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/6621052

12 years agocmd/5g: avoid temporary during constant OINDEX
Dave Cheney [Sat, 6 Oct 2012 01:51:06 +0000 (11:51 +1000)]
cmd/5g: avoid temporary during constant OINDEX

func addr(s[]int) *int {
return &s[2]
}

--- prog list "addr" ---
0000 (/home/dfc/src/addr.go:5) TEXT     addr+0(SB),$0-16
0001 (/home/dfc/src/addr.go:6) MOVW     $s+0(FP),R0
0002 (/home/dfc/src/addr.go:6) MOVW     4(R0),R1
0003 (/home/dfc/src/addr.go:6) MOVW     $2,R2
0004 (/home/dfc/src/addr.go:6) CMP      R2,R1,
0005 (/home/dfc/src/addr.go:6) BHI      ,7(APC)
0006 (/home/dfc/src/addr.go:6) BL       ,runtime.panicindex+0(SB)
0007 (/home/dfc/src/addr.go:6) MOVW     0(R0),R0
0008 (/home/dfc/src/addr.go:6) MOVW     $8,R1
0009 (/home/dfc/src/addr.go:6) ADD      R1,R0
0010 (/home/dfc/src/addr.go:6) MOVW     R0,.noname+12(FP)
0011 (/home/dfc/src/addr.go:6) RET      ,

becomes

--- prog list "addr" ---
0000 (/home/dfc/src/addr.go:5) TEXT     addr+0(SB),$0-16
0001 (/home/dfc/src/addr.go:6) MOVW     $s+0(FP),R0
0002 (/home/dfc/src/addr.go:6) MOVW     4(R0),R1
0003 (/home/dfc/src/addr.go:6) MOVW     $2,R2
0004 (/home/dfc/src/addr.go:6) CMP      R2,R1,
0005 (/home/dfc/src/addr.go:6) BHI      ,7(APC)
0006 (/home/dfc/src/addr.go:6) BL       ,runtime.panicindex+0(SB)
0007 (/home/dfc/src/addr.go:6) MOVW     0(R0),R0
0008 (/home/dfc/src/addr.go:6) ADD      $8,R0
0009 (/home/dfc/src/addr.go:6) MOVW     R0,.noname+12(FP)
0010 (/home/dfc/src/addr.go:6) RET      ,

R=rsc, remyoudompheng, minux.ma
CC=golang-dev
https://golang.org/cl/6590056

12 years agocmd/5g: fix out of registers in nested calls, add compiler torture test.
Rémy Oudompheng [Fri, 5 Oct 2012 21:30:49 +0000 (23:30 +0200)]
cmd/5g: fix out of registers in nested calls, add compiler torture test.

R=golang-dev, dave, daniel.morsing, rsc
CC=golang-dev, remy
https://golang.org/cl/6586072

12 years agocrypto/sha256, crypto/sha512: 1.3x speedup
Dmitry Chestnykh [Fri, 5 Oct 2012 21:04:48 +0000 (17:04 -0400)]
crypto/sha256, crypto/sha512: 1.3x speedup

SHA-256:

benchmark          old ns/op    new ns/op    delta
BenchmarkHash1K        21686        16912  -22.01%
BenchmarkHash8K       173216       135020  -22.05%

benchmark           old MB/s     new MB/s  speedup
BenchmarkHash1K        47.22        60.55    1.28x
BenchmarkHash8K        47.29        60.67    1.28x

SHA-512:

benchmark          old ns/op    new ns/op    delta
BenchmarkHash1K        14323        11163  -22.06%
BenchmarkHash8K       114120        88693  -22.28%

benchmark           old MB/s     new MB/s  speedup
BenchmarkHash1K        71.49        91.73    1.28x
BenchmarkHash8K        71.78        92.36    1.29x

R=golang-dev, agl
CC=golang-dev
https://golang.org/cl/6584071

12 years agoruntime: mask SSE exceptions on plan9/amd64
Akshat Kumar [Fri, 5 Oct 2012 20:23:30 +0000 (16:23 -0400)]
runtime: mask SSE exceptions on plan9/amd64

The Go run-time assumes that all SSE floating-point exceptions
are masked so that Go programs are not broken by such invalid
operations. By default, the 64-bit version of the Plan 9 kernel
masks only some SSE floating-point exceptions. Here, we mask
them all on a per-thread basis.

R=rsc, rminnich, minux.ma
CC=golang-dev
https://golang.org/cl/6592056

12 years agodoc/codewalk: make it work with jQuery 1.8.2
Shenghou Ma [Fri, 5 Oct 2012 15:51:40 +0000 (23:51 +0800)]
doc/codewalk: make it work with jQuery 1.8.2
    so that it could work with the bundled jQuery.

R=adg
CC=golang-dev
https://golang.org/cl/6592073

12 years agogo/printer: don't forget the .0 in 1.0
Robert Griesemer [Fri, 5 Oct 2012 15:48:23 +0000 (08:48 -0700)]
go/printer: don't forget the .0 in 1.0

(use floating-point rather then integer constant division)

gofmt -w src misc

Fixes #3965.

R=r, bsiegert, 0xjnml
CC=bradfitz, golang-dev
https://golang.org/cl/6610051

12 years agogo/printer: parenthesize literal function types in conversions
Robert Griesemer [Fri, 5 Oct 2012 04:03:50 +0000 (21:03 -0700)]
go/printer: parenthesize literal function types in conversions

Also: gofmt -w src misc

R=r
CC=golang-dev, iant
https://golang.org/cl/6591071

12 years agogo/parser: unify parsing of const and var declarations
Robert Griesemer [Fri, 5 Oct 2012 03:53:43 +0000 (20:53 -0700)]
go/parser: unify parsing of const and var declarations

The AST representation is already identical. Making the
code (nearly) identical in the parser reduces code size
and ensures that the ast.ValueSpec nodes have the same
values (specifically, iota). This in turn permits the
sharing of much of the respective code in the typechecker.

While at it: type functions work now, so use them.

R=r
CC=golang-dev
https://golang.org/cl/6624047

12 years agonet/mail: make address parsing (more) public
Graham Miller [Fri, 5 Oct 2012 00:08:54 +0000 (10:08 +1000)]
net/mail: make address parsing (more) public

Code for parsing email addresses was already partially part of the public API with "func (Header) AddressList".  This CL adds a trivial implementation for two public methods to parse address and lists from a string. With tests.

R=dsymonds
CC=golang-dev
https://golang.org/cl/5676067

12 years agocrypto/x509: add DecryptBlock function for loading password protected keys
Jeff Wendling [Thu, 4 Oct 2012 19:42:57 +0000 (15:42 -0400)]
crypto/x509: add DecryptBlock function for loading password protected keys

Adds a DecryptBlock function which takes a password and a *pem.Block and
returns the decrypted DER bytes suitable for passing into other crypto/x509
functions.

R=golang-dev, agl, leterip
CC=golang-dev
https://golang.org/cl/6555052

12 years agolib/godoc/godoc.html: try Google hosted jQuery first, fallback to locally hosted one
Shenghou Ma [Thu, 4 Oct 2012 07:14:20 +0000 (15:14 +0800)]
lib/godoc/godoc.html: try Google hosted jQuery first, fallback to locally hosted one

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/6593078

12 years agogodoc: make examples editable and runnable in playground
Andrew Gerrand [Thu, 4 Oct 2012 06:53:05 +0000 (16:53 +1000)]
godoc: make examples editable and runnable in playground

R=dsymonds
CC=golang-dev
https://golang.org/cl/6523045

12 years agogodoc: add jQuery to Go repository, rewrite godocs.js to use jQuery
Andrew Gerrand [Thu, 4 Oct 2012 05:31:25 +0000 (15:31 +1000)]
godoc: add jQuery to Go repository, rewrite godocs.js to use jQuery

For golang.org I intend to rewrite the jquery link in godoc.html
to point to the Google-hosted jquery.js.

R=dsymonds, minux.ma
CC=golang-dev
https://golang.org/cl/6589071

12 years agocmd/go: add support for -test.benchmem
Shenghou Ma [Thu, 4 Oct 2012 05:20:18 +0000 (13:20 +0800)]
cmd/go: add support for -test.benchmem

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6587074

12 years agosrc/run.bat: add new flag for api tool
Rob Pike [Thu, 4 Oct 2012 01:49:33 +0000 (11:49 +1000)]
src/run.bat: add new flag for api tool
Fixes build.
Makes me annoyed.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6591074

12 years agocmd/api: add exception file
Rob Pike [Thu, 4 Oct 2012 01:35:17 +0000 (11:35 +1000)]
cmd/api: add exception file
Fixes build.

R=golang-dev, adg, bradfitz, dsymonds, dave
CC=golang-dev
https://golang.org/cl/6586074

12 years agogodoc: show contents in correct order, expand sections on click
Andrew Gerrand [Thu, 4 Oct 2012 01:21:37 +0000 (11:21 +1000)]
godoc: show contents in correct order, expand sections on click

R=dsymonds
CC=gobot, golang-dev
https://golang.org/cl/6588079

12 years agogo/doc: add nil to list of predeclared constants
Andrew Gerrand [Wed, 3 Oct 2012 22:37:48 +0000 (08:37 +1000)]
go/doc: add nil to list of predeclared constants

R=gri
CC=gobot, golang-dev
https://golang.org/cl/6601054

12 years agogo/doc: rewrite whole file examples for playground
Andrew Gerrand [Wed, 3 Oct 2012 21:55:24 +0000 (07:55 +1000)]
go/doc: rewrite whole file examples for playground

R=gri
CC=gobot, golang-dev
https://golang.org/cl/6592061

12 years agogo spec: conversion types starting with "func" must be parenthesized
Robert Griesemer [Wed, 3 Oct 2012 20:46:37 +0000 (13:46 -0700)]
go spec: conversion types starting with "func" must be parenthesized

Also: Be explicit what operator means with respect to conversion types.

The parenthesis requirement is a language change. At the moment,
literal function types in conversions that cannot possibly be
followed by a '(' don't need parentheses. For instance:

        func(int)int(x)  ->  same as (func(int)int)(x)
        func()()(x)      ->  same as (func())(x)

but:

        func(int)(x)  ->  could be func(int)x {...}

Fixes #4109.

R=rsc, r, iant, ken, iant
CC=golang-dev
https://golang.org/cl/6584065

12 years agomisc/dashboard: set charset utf-8 on build log downloads
Brad Fitzpatrick [Wed, 3 Oct 2012 15:16:27 +0000 (08:16 -0700)]
misc/dashboard: set charset utf-8 on build log downloads

Fixes #4187

R=golang-dev, dave, minux.ma
CC=golang-dev
https://golang.org/cl/6587071

12 years agogodoc: move Examples above Index and make them both collapsable
Andrew Gerrand [Wed, 3 Oct 2012 05:05:08 +0000 (15:05 +1000)]
godoc: move Examples above Index and make them both collapsable

R=golang-dev, dsymonds, bradfitz, r
CC=golang-dev
https://golang.org/cl/6591066

12 years agotesting: update package docs to use ResetTimer() instead of StopTimer/StartTimer()
Shenghou Ma [Wed, 3 Oct 2012 03:41:18 +0000 (11:41 +0800)]
testing: update package docs to use ResetTimer() instead of StopTimer/StartTimer()

R=golang-dev, rsc, r
CC=golang-dev
https://golang.org/cl/6591051

12 years agotext/template: better error messages during execution,
Rob Pike [Wed, 3 Oct 2012 02:02:13 +0000 (12:02 +1000)]
text/template: better error messages during execution,
They now show the correct name, the byte offset on the line, and context for the failed evaluation.
Before:
        template: three:7: error calling index: index out of range: 5
After:
        template: top:7:20: executing "three" at <index "hi" $>: error calling index: index out of range: 5
Here top is the template that was parsed to create the set, and the error appears with the action
starting at byte 20 of line 7 of "top", inside the template called "three", evaluating the expression
<index "hi" $>.

Also fix a bug in index: it didn't work on strings. Ouch.

Also fix bug in error for index: was showing type of index not slice.
The real previous error was:
        template: three:7: error calling index: can't index item of type int
The html/template package's errors can be improved by building on this;
I'll do that in a separate pass.

Extends the API for text/template/parse but only by addition of a field and method. The
old API still works.

Fixes #3188.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6576058

12 years agogo/ast: track position of <- for channel types
Robert Griesemer [Wed, 3 Oct 2012 00:50:36 +0000 (17:50 -0700)]
go/ast: track position of <- for channel types

This is a backward-compatible API change.

Without the correct <- position information,
certain channel types have incorrect position
information.

R=iant, iant
CC=golang-dev
https://golang.org/cl/6585063

12 years agoos/user : use username as fullname if all else fails (on windows)
Shivakumar GN [Wed, 3 Oct 2012 00:33:09 +0000 (10:33 +1000)]
os/user : use username as fullname if all else fails (on windows)

Fixes #4113.

R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/6545054

12 years agogo/parser: correctly parse <-chan T(x) as <-(chan T)(x)
Robert Griesemer [Tue, 2 Oct 2012 23:48:30 +0000 (16:48 -0700)]
go/parser: correctly parse <-chan T(x) as <-(chan T)(x)

Fixes #4110.

R=iant
CC=golang-dev
https://golang.org/cl/6597069

12 years agocodereview.py: suggest installing Mercurial from official website
Robert Hencke [Tue, 2 Oct 2012 20:58:24 +0000 (06:58 +1000)]
codereview.py: suggest installing Mercurial from official website

Continuation of https://golang.org/cl/6499053/

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/6584059

12 years agocmd/8g: do not take the address of string/slice for &s[i]
Rémy Oudompheng [Tue, 2 Oct 2012 06:19:27 +0000 (08:19 +0200)]
cmd/8g: do not take the address of string/slice for &s[i]

A similar change was made in 6g recently.

LEALs in cmd/go: 31440 before, 27867 after.

benchmark                 old ns/op    new ns/op    delta
BenchmarkBinaryTree17    7065794000   6723617000   -4.84%
BenchmarkFannkuch11      7767395000   7477945000   -3.73%
BenchmarkGobDecode         34708140     34857820   +0.43%
BenchmarkGobEncode         10998780     10960060   -0.35%
BenchmarkGzip            1603630000   1471052000   -8.27%
BenchmarkGunzip           242573900    240650400   -0.79%
BenchmarkJSONEncode       120842200    117966100   -2.38%
BenchmarkJSONDecode       247254900    249103100   +0.75%
BenchmarkMandelbrot200     29237330     29241790   +0.02%
BenchmarkParse              8111320      8096865   -0.18%
BenchmarkRevcomp         2595780000   2694153000   +3.79%
BenchmarkTemplate         276679600    264497000   -4.40%

benchmark                              old ns/op    new ns/op    delta
BenchmarkAppendFloatDecimal                  429          416   -3.03%
BenchmarkAppendFloat                         780          740   -5.13%
BenchmarkAppendFloatExp                      746          700   -6.17%
BenchmarkAppendFloatNegExp                   752          694   -7.71%
BenchmarkAppendFloatBig                     1228         1108   -9.77%
BenchmarkAppendFloat32Integer                457          416   -8.97%
BenchmarkAppendFloat32ExactFraction          662          631   -4.68%
BenchmarkAppendFloat32Point                  771          735   -4.67%
BenchmarkAppendFloat32Exp                    722          672   -6.93%
BenchmarkAppendFloat32NegExp                 724          659   -8.98%
BenchmarkAppendFloat64Fixed1                 429          400   -6.76%
BenchmarkAppendFloat64Fixed2                 463          442   -4.54%

Update #1914.

R=golang-dev, daniel.morsing, rsc
CC=golang-dev
https://golang.org/cl/6574043

12 years agorace: gc changes
Dmitriy Vyukov [Tue, 2 Oct 2012 06:05:46 +0000 (10:05 +0400)]
race: gc changes
This is the first part of a bigger change that adds data race detection feature:
https://golang.org/cl/6456044
This change makes gc compiler instrument memory accesses when supplied with -b flag.

R=rsc, nigeltao, lvd
CC=golang-dev
https://golang.org/cl/6497074

12 years agogo/doc: strip example output comment from synthesized main function
Andrew Gerrand [Mon, 1 Oct 2012 22:35:20 +0000 (08:35 +1000)]
go/doc: strip example output comment from synthesized main function

R=gri
CC=gobot, golang-dev
https://golang.org/cl/6524047

12 years agocmd/5g: avoid temporary during constant binary op
Dave Cheney [Mon, 1 Oct 2012 22:12:39 +0000 (08:12 +1000)]
cmd/5g: avoid temporary during constant binary op

This CL is an attempt to backport the abop code generation from 6g. This improves the generation of the range offset if the increment can be encoded directly via Operand2 shift encoding.

0023 (/home/dfc/src/range.go:7) BGE     ,29(APC)
0024 (/home/dfc/src/range.go:7) MOVW    0(R3),R5
0025 (/home/dfc/src/range.go:7) MOVW    $4,R1
0026 (/home/dfc/src/range.go:7) ADD     R1,R3,R3
0027 (/home/dfc/src/range.go:8) ADD     R5,R4,R4
0028 (/home/dfc/src/range.go:7) B       ,17(APC)

becomes

0023 (/home/dfc/src/range.go:7) BGE     ,28(APC)
0024 (/home/dfc/src/range.go:7) MOVW    0(R3),R0
0025 (/home/dfc/src/range.go:7) ADD     $4,R3,R3
0026 (/home/dfc/src/range.go:8) ADD     R0,R4,R4
0027 (/home/dfc/src/range.go:7) B       ,17(APC)

Benchmarks are unimpressive

dfc@qnap:~/go/test/bench/go1$ ~/go/misc/benchcmp {old,new}.txt
benchmark                 old ns/op    new ns/op    delta
BenchmarkBinaryTree17    2147483647   2147483647   +0.93%
BenchmarkFannkuch11      2147483647   2147483647   -2.52%
BenchmarkGobDecode        196135200    195842000   -0.15%
BenchmarkGobEncode         78581650     76734450   -2.35%
BenchmarkGzip            2147483647   2147483647   -0.47%
BenchmarkGunzip          1087243000   1070254000   -1.56%
BenchmarkJSONEncode      1107558000   1146077000   +3.48%
BenchmarkJSONDecode      2147483647   2147483647   -0.07%
BenchmarkMandelbrot200   2147483647   2147483647   -0.77%
BenchmarkParse             74328550     71653400   -3.60%
BenchmarkRevcomp          111123900    109325950   -1.62%
BenchmarkTemplate        2147483647   2147483647   -0.82%

benchmark                  old MB/s     new MB/s  speedup
BenchmarkGobDecode             3.91         3.92    1.00x
BenchmarkGobEncode             9.77        10.00    1.02x
BenchmarkGzip                  3.65         3.66    1.00x
BenchmarkGunzip               17.85        18.13    1.02x
BenchmarkJSONEncode            1.75         1.69    0.97x
BenchmarkJSONDecode            0.83         0.83    1.00x
BenchmarkParse                 0.78         0.81    1.04x
BenchmarkRevcomp              22.87        23.25    1.02x
BenchmarkTemplate              0.84         0.85    1.01x

R=remyoudompheng, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/6564067

12 years agoarchive/tar: fix inconsistent namespace usage in example
Jeremy Jackins [Mon, 1 Oct 2012 22:10:42 +0000 (08:10 +1000)]
archive/tar: fix inconsistent namespace usage in example

This fixes some example code in the tar package documentation, which
first refers to tar.NewWriter and then to Header, which is inconsistent
because NewWriter and Header are both in the tar namespace.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6595050

12 years agomath/big: avoid some allocation in Exp
Adam Langley [Mon, 1 Oct 2012 21:31:35 +0000 (17:31 -0400)]
math/big: avoid some allocation in Exp

benchmark                        old ns/op    new ns/op    delta
BenchmarkRSA1024Decrypt             745686       644964  -13.51%
BenchmarkRSA2048Decrypt            5517318      5049200   -8.48%
Benchmark3PrimeRSA2048Decrypt      3767386      3288048  -12.72%

R=gri
CC=gobot, golang-dev
https://golang.org/cl/6566043

12 years agocmd/godoc: clearer comments in FormatSelections
Robert Griesemer [Mon, 1 Oct 2012 21:17:25 +0000 (14:17 -0700)]
cmd/godoc: clearer comments in FormatSelections

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6561073

12 years agoA+C: add Jeff Wendling (Individual CLA)
Adam Langley [Mon, 1 Oct 2012 20:49:29 +0000 (16:49 -0400)]
A+C: add Jeff Wendling (Individual CLA)

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/6596050

12 years agocmd/go/build: Add magic data for Plan 9 binaries.
Akshat Kumar [Mon, 1 Oct 2012 19:04:52 +0000 (15:04 -0400)]
cmd/go/build: Add magic data for Plan 9 binaries.

This change allows the Go build and install tools to
recognize Plan 9 i386 and amd64 binaries.

R=rsc, r, rminnich
CC=golang-dev
https://golang.org/cl/6575064

12 years agocmd/gc: Missing break in esc switch.
Luuk van Dijk [Mon, 1 Oct 2012 14:33:06 +0000 (16:33 +0200)]
cmd/gc: Missing break in esc switch.

R=rsc
CC=golang-dev
https://golang.org/cl/6594053

12 years agopkg/syscall: Plan 9, 64-bit: Update error checks from sys calls.
Akshat Kumar [Mon, 1 Oct 2012 00:09:08 +0000 (10:09 +1000)]
pkg/syscall: Plan 9, 64-bit: Update error checks from sys calls.

This change updates CL 6576057 for exceptional cases where
return values from Syscall/RawSyscall functions are used.

The system calls return 32-bit integers. With the recent change
in size of `int' in Go for amd64, the type conversion was not
catching `-1' return values. This change makes the conversion
explicitly `int32'.

R=rsc, r
CC=golang-dev
https://golang.org/cl/6590047

12 years agotest/fixedbugs: forgotten test cases for issues 3907 and 4156.
Rémy Oudompheng [Sun, 30 Sep 2012 08:35:09 +0000 (10:35 +0200)]
test/fixedbugs: forgotten test cases for issues 3907 and 4156.

Update #3907.
Update #4156.

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/6595044