]> Cypherpunks repositories - gostls13.git/log
gostls13.git
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

12 years agoexp/types: permit importing packages without available source.
David Symonds [Sun, 30 Sep 2012 05:56:23 +0000 (15:56 +1000)]
exp/types: permit importing packages without available source.

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

12 years agoexp/types: better diagnosis for compile failures.
David Symonds [Sun, 30 Sep 2012 05:46:37 +0000 (15:46 +1000)]
exp/types: better diagnosis for compile failures.

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

12 years agotest/fixedbugs/bug454.go: add a test for CL 6564052
Shenghou Ma [Sat, 29 Sep 2012 15:23:56 +0000 (23:23 +0800)]
test/fixedbugs/bug454.go: add a test for CL 6564052
   Also mention that ignoring second blank identifier of range is required by the spec in the code.

   Fixes #4173.

R=daniel.morsing, remyoudompheng, r
CC=golang-dev
https://golang.org/cl/6594043

12 years agosyscall: add ipv4 ancillary data for darwin
Mikio Hara [Sat, 29 Sep 2012 03:43:05 +0000 (12:43 +0900)]
syscall: add ipv4 ancillary data for darwin

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

12 years agogo spec: arguments for append may overlap
Robert Griesemer [Fri, 28 Sep 2012 22:55:38 +0000 (15:55 -0700)]
go spec: arguments for append may overlap

Fixes #4142.

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

12 years agocmd/godoc: fix minor bug in FormatSelections.
Paul Chang [Fri, 28 Sep 2012 21:19:43 +0000 (14:19 -0700)]
cmd/godoc: fix minor bug in FormatSelections.

FormatSelections tries to call a nil function value if lw is nil
and the final entry in the selections array is non-nil. Luckily,
this doesn't actually happen in practice since godoc doesn't use
this combination (no line numbers, but with selections).

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

12 years agoCONTRIBUTORS: added Paul Chang (Google CLA)
Robert Griesemer [Fri, 28 Sep 2012 21:19:31 +0000 (14:19 -0700)]
CONTRIBUTORS: added Paul Chang (Google CLA)

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

12 years agocontainer/list: slightly better code factoring
Robert Griesemer [Fri, 28 Sep 2012 17:58:46 +0000 (10:58 -0700)]
container/list: slightly better code factoring

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

12 years agocontainer/list: Correctly maintain internal invariants
Robert Griesemer [Fri, 28 Sep 2012 17:35:32 +0000 (10:35 -0700)]
container/list: Correctly maintain internal invariants

The previous implementation was a mess with invariants
maintained inconsistently. Essentially reimplemented
the package:

- used a circular list as internal representation for
  significantly simpler implementation with fewer
  special cases while maintaining the illusion of
  a nil-terminated doubly linked list externally

- more precise documentation

- cleaned up and simplified tests, added test case
  for issue 4103.

No changes to the API or documented semantics.

All this said, I would be in favor of removing
this package eventually. container/ring provides
a faster implementation and a simpler and more
powerful API.

Fixes #4103.

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

12 years agotest: match gccgo error messages
Ian Lance Taylor [Fri, 28 Sep 2012 15:30:30 +0000 (08:30 -0700)]
test: match gccgo error messages

const1.go:31:12: error: integer constant overflow
const1.go:31:12: error: integer constant overflow
const1.go:33:12: error: integer constant overflow
const1.go:33:12: error: integer constant overflow
const1.go:34:14: error: integer constant overflow
const1.go:35:17: error: integer constant overflow
const1.go:35:17: error: integer constant overflow
const1.go:35:17: error: integer constant overflow
const1.go:35:17: error: integer constant overflow
const1.go:35:17: error: integer constant overflow
const1.go:36:19: error: integer constant overflow
const1.go:37:15: error: integer constant overflow
const1.go:37:15: error: integer constant overflow
const1.go:37:24: error: integer constant overflow
const1.go:37:15: error: integer constant overflow
const1.go:37:15: error: integer constant overflow
const1.go:37:15: error: integer constant overflow
const1.go:37:24: error: integer constant overflow
const1.go:37:15: error: integer constant overflow
const1.go:38:12: error: integer constant overflow
const1.go:38:12: error: integer constant overflow
const1.go:38:12: error: integer constant overflow
const1.go:38:12: error: integer constant overflow
const1.go:41:20: error: integer constant overflow
const1.go:41:20: error: integer constant overflow
const1.go:42:20: error: integer constant overflow
const1.go:42:20: error: integer constant overflow
const1.go:44:28: error: integer constant overflow
const1.go:44:28: error: integer constant overflow
const1.go:45:14: error: integer constant overflow
const1.go:49:14: error: integer constant overflow
const1.go:50:14: error: integer constant overflow
const1.go:51:14: error: integer constant overflow
const1.go:54:23: error: integer constant overflow
const1.go:54:23: error: integer constant overflow
const1.go:54:23: error: integer constant overflow
const1.go:54:23: error: integer constant overflow
const1.go:56:14: error: integer constant overflow
const1.go:57:24: error: integer constant overflow
const1.go:57:24: error: integer constant overflow
const1.go:58:24: error: integer constant overflow
const1.go:58:24: error: integer constant overflow
const1.go:59:22: error: integer constant overflow
const1.go:59:22: error: integer constant overflow
const1.go:61:24: error: integer constant overflow
const1.go:62:20: error: division by zero
const1.go:65:19: error: floating point constant overflow
const1.go:65:19: error: floating point constant overflow
const1.go:66:28: error: floating point constant overflow
const1.go:66:28: error: floating point constant overflow
const1.go:67:19: error: floating point constant overflow
const1.go:67:19: error: floating point constant overflow
const1.go:68:19: error: division by zero
const1.go:33:14: error: integer constant overflow
const1.go:35:19: error: integer constant overflow
const1.go:42:22: error: integer constant overflow
const1.go:53:17: error: integer constant overflow
const1.go:55:14: error: integer constant overflow
const1.go:59:24: error: integer constant overflow
const1.go:69:20: error: expected integer type
const1.go:75:4: error: argument 1 has incompatible type (cannot use type int8 as type int)
const1.go:76:4: error: argument 1 has incompatible type (cannot use type int8 as type int)
const1.go:77:4: error: argument 1 has incompatible type (cannot use type uint8 as type int)
const1.go:79:4: error: argument 1 has incompatible type (cannot use type float32 as type int)
const1.go:80:4: error: argument 1 has incompatible type (cannot use type float64 as type int)
const1.go:81:4: error: floating point constant truncated to integer
const1.go:83:4: error: argument 1 has incompatible type (cannot use type float64 as type int)
const1.go:84:4: error: argument 1 has incompatible type (cannot use type string as type int)
const1.go:85:4: error: argument 1 has incompatible type (cannot use type bool as type int)
const1.go:88:7: error: const initializer cannot be nil

const2.go:14:8: error: expected ‘=’

const5.go:27:7: error: expression is not constant
const5.go:28:7: error: expression is not constant
const5.go:30:7: error: expression is not constant
const5.go:31:7: error: expression is not constant

ddd1.go:57:23: error: invalid use of ‘...’ in type conversion
ddd1.go:59:6: error: invalid use of ‘...’ in type conversion
ddd1.go:60:12: error: use of ‘[...]’ outside of array literal
ddd1.go:21:15: error: argument 1 has incompatible type
ddd1.go:22:10: error: argument 1 has incompatible type
ddd1.go:30:6: error: invalid use of ‘...’ with non-slice
ddd1.go:30:6: error: invalid use of ‘...’ with non-slice
ddd1.go:46:2: error: invalid use of %<...%> with builtin function
ddd1.go:47:2: error: invalid use of %<...%> with builtin function
ddd1.go:49:2: error: invalid use of %<...%> with builtin function
ddd1.go:50:6: error: invalid use of %<...%> with builtin function
ddd1.go:51:6: error: invalid use of %<...%> with builtin function
ddd1.go:53:6: error: invalid use of %<...%> with builtin function
ddd1.go:58:13: error: invalid use of %<...%> with builtin function
ddd1.go:20:10: error: floating point constant truncated to integer
ddd1.go:32:6: error: invalid use of ‘...’ calling non-variadic function

declbad.go:20:3: error: variables redeclared but no variable is new
declbad.go:38:3: error: variables redeclared but no variable is new
declbad.go:44:3: error: variables redeclared but no variable is new
declbad.go:51:3: error: variables redeclared but no variable is new
declbad.go:57:3: error: variables redeclared but no variable is new
declbad.go:63:3: error: variables redeclared but no variable is new
declbad.go:26:3: error: incompatible types in assignment (cannot use type float32 as type int)
declbad.go:32:3: error: incompatible types in assignment (cannot use type int as type float32)
declbad.go:44:3: error: incompatible types in assignment (different number of results)

fixedbugs/bug223.go:21:5: error: initialization expression for ‘m’ depends upon itself

fixedbugs/bug412.go:10:2: error: duplicate field name ‘x’

fixedbugs/bug413.go:11:5: error: initialization expression for ‘i’ depends upon itself

fixedbugs/bug416.go:13:1: error: method ‘X’ redeclares struct field name

fixedbugs/bug435.go:15:49: error: missing ‘)’
fixedbugs/bug435.go:15:2: error: reference to undefined name ‘bar’

fixedbugs/bug451.go:9:9: error: expected package

typeswitch3.go:39:9: error: no new variables on left side of ‘:=’
typeswitch3.go:24:2: error: impossible type switch case (type has no methods)

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

12 years agostrings: implement a faster single-string Replacer
Eric Roshan-Eisner [Fri, 28 Sep 2012 02:34:18 +0000 (12:34 +1000)]
strings: implement a faster single-string Replacer

The string searching is implemented separately so other functions
may make use of it in the future.

benchmark                        old ns/op    new ns/op    delta
BenchmarkSingleMaxSkipping          125889         2474  -98.03%
BenchmarkSingleLongSuffixFail        16252         1996  -87.72%
BenchmarkSingleMatch                260793       136266  -47.75%

benchmark                         old MB/s     new MB/s  speedup
BenchmarkSingleMaxSkipping           79.43      4041.57   50.88x
BenchmarkSingleLongSuffixFail        61.65       501.81    8.14x
BenchmarkSingleMatch                 57.52       110.08    1.91x

R=nigeltao
CC=golang-dev
https://golang.org/cl/6545049

12 years agotesting: remove redundant whitespace in output
Eric Roshan-Eisner [Fri, 28 Sep 2012 00:01:09 +0000 (10:01 +1000)]
testing: remove redundant whitespace in output

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

12 years agopkg/syscall: Plan 9, 64-bit: Update error checks from sys calls.
Akshat Kumar [Thu, 27 Sep 2012 23:56:44 +0000 (09:56 +1000)]
pkg/syscall: Plan 9, 64-bit: Update error checks from sys calls.

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, rminnich, npe, r
CC=golang-dev
https://golang.org/cl/6576057

12 years agodoc: clarify that the displayed tar file name is an example
Andrew Gerrand [Thu, 27 Sep 2012 22:34:18 +0000 (15:34 -0700)]
doc: clarify that the displayed tar file name is an example

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

12 years agodoc: fix OS X download links
Andrew Gerrand [Thu, 27 Sep 2012 21:48:33 +0000 (14:48 -0700)]
doc: fix OS X download links

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

12 years agocmd/[568]g: header cleanup.
Rémy Oudompheng [Thu, 27 Sep 2012 06:34:00 +0000 (08:34 +0200)]
cmd/[568]g: header cleanup.

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

12 years agobufio: Implement io.WriterTo for (*Reader)
Michael Chaten [Thu, 27 Sep 2012 06:31:03 +0000 (16:31 +1000)]
bufio: Implement io.WriterTo for (*Reader)

This is part 1 of 2 for issue 4028

benchmark                       old ns/op    new ns/op    delta
BenchmarkReaderCopyOptimal          33495         9849  -70.60%
BenchmarkReaderCopyUnoptimal        70631        27041  -61.72%
BenchmarkReaderCopyOldImpl          51407        52970   +3.04%

Update #4028

R=dave, nigeltao, rsc, bradfitz, rogpeppe
CC=golang-dev
https://golang.org/cl/6548047

12 years agotext/template: fix typo of errorf as error in comment.
Josh Holland [Thu, 27 Sep 2012 05:47:54 +0000 (15:47 +1000)]
text/template: fix typo of errorf as error in comment.

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

12 years agoCLA: Josh Holland <jrh@joshh.co.uk> individual contributor
Rob Pike [Thu, 27 Sep 2012 05:47:18 +0000 (15:47 +1000)]
CLA: Josh Holland <jrh@joshh.co.uk> individual contributor

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

12 years agocmd/api: delete redundant text from deletion message
Rob Pike [Thu, 27 Sep 2012 05:39:56 +0000 (15:39 +1000)]
cmd/api: delete redundant text from deletion message

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

12 years agolzw: fix Write returning the wrong number of bytes written.
Nigel Tao [Thu, 27 Sep 2012 03:29:39 +0000 (13:29 +1000)]
lzw: fix Write returning the wrong number of bytes written.

Fixes #4160.

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

12 years agofmt: allow # and x together for strings
Rob Pike [Wed, 26 Sep 2012 20:21:38 +0000 (06:21 +1000)]
fmt: allow # and x together for strings
Silly and small but easy to be consistent.
To make it worthwhile, I eliminated an allocation when using
%x on a byte slice.

Fixes #4149.

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

12 years agonet: spread fd over several pollservers.
Sébastien Paolacci [Wed, 26 Sep 2012 19:32:59 +0000 (15:32 -0400)]
net: spread fd over several pollservers.

Lighten contention without preventing further improvements on pollservers.
Connections are spread over Min(GOMAXPROCS, NumCPU, 8) pollserver instances.

Median of 10 runs, 4 cores @ 3.4GHz, amd/linux-3.2:

BenchmarkTCPOneShot                171917 ns/op   175194 ns/op      1.91%
BenchmarkTCPOneShot-2              101413 ns/op   109462 ns/op      7.94%
BenchmarkTCPOneShot-4               91796 ns/op    35712 ns/op    -61.10%
BenchmarkTCPOneShot-6               90938 ns/op    30607 ns/op    -66.34%
BenchmarkTCPOneShot-8               90374 ns/op    29150 ns/op    -67.75%
BenchmarkTCPOneShot-16             101089 ns/op   111526 ns/op     10.32%

BenchmarkTCPOneShotTimeout         174986 ns/op   178606 ns/op      2.07%
BenchmarkTCPOneShotTimeout-2       101585 ns/op   110678 ns/op      8.95%
BenchmarkTCPOneShotTimeout-4        91547 ns/op    35931 ns/op    -60.75%
BenchmarkTCPOneShotTimeout-6        91496 ns/op    31019 ns/op    -66.10%
BenchmarkTCPOneShotTimeout-8        90670 ns/op    29531 ns/op    -67.43%
BenchmarkTCPOneShotTimeout-16      101013 ns/op   106026 ns/op      4.96%

BenchmarkTCPPersistent              51731 ns/op    53324 ns/op      3.08%
BenchmarkTCPPersistent-2            32888 ns/op    30678 ns/op     -6.72%
BenchmarkTCPPersistent-4            25751 ns/op    15595 ns/op    -39.44%
BenchmarkTCPPersistent-6            26737 ns/op     9805 ns/op    -63.33%
BenchmarkTCPPersistent-8            26850 ns/op     9730 ns/op    -63.76%
BenchmarkTCPPersistent-16          104449 ns/op   102838 ns/op     -1.54%

BenchmarkTCPPersistentTimeout       51806 ns/op    53281 ns/op      2.85%
BenchmarkTCPPersistentTimeout-2     32956 ns/op    30895 ns/op     -6.25%
BenchmarkTCPPersistentTimeout-4     25994 ns/op    18111 ns/op    -30.33%
BenchmarkTCPPersistentTimeout-6     26679 ns/op     9846 ns/op    -63.09%
BenchmarkTCPPersistentTimeout-8     26810 ns/op     9727 ns/op    -63.72%
BenchmarkTCPPersistentTimeout-16   101652 ns/op   104410 ns/op      2.71%

R=rsc, dvyukov, dave, mikioh.mikioh, bradfitz, remyoudompheng
CC=golang-dev
https://golang.org/cl/6496054

12 years agocmd/6g, cmd/8g: fix two "out of fixed registers" cases.
Rémy Oudompheng [Wed, 26 Sep 2012 19:17:11 +0000 (21:17 +0200)]
cmd/6g, cmd/8g: fix two "out of fixed registers" cases.

In two cases, registers were allocated too early resulting
in exhausting of available registers when nesting these
operations.

The case of method calls was due to missing cases in igen,
which only makes calls but doesn't allocate a register for
the result.

The case of 8-bit multiplication was due to a wrong order
in register allocation when Ullman numbers were bigger on the
RHS.

Fixes #3907.
Fixes #4156.

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

12 years agocmd/gc: Don't calculate second value in range if it is blank.
Daniel Morsing [Wed, 26 Sep 2012 19:10:29 +0000 (21:10 +0200)]
cmd/gc: Don't calculate second value in range if it is blank.

Low hanging fruit optimization. Will remove an expensive copy if the range variable is an array.

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

12 years agocrypto/x509: add Plan 9 root certificate location
David du Colombier [Wed, 26 Sep 2012 18:47:47 +0000 (14:47 -0400)]
crypto/x509: add Plan 9 root certificate location

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

12 years agodoc: add important info for would-be go contributors.
Jonathan Feinberg [Wed, 26 Sep 2012 18:39:31 +0000 (14:39 -0400)]
doc: add important info for would-be go contributors.

Link to the "installing from source" docs instead of the "installing" docs.

Remind would-be hacker to switch to the default branch from the release branch.

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

12 years agocrypto/aes: speed up using AES-NI on amd64
Shenghou Ma [Wed, 26 Sep 2012 17:54:10 +0000 (01:54 +0800)]
crypto/aes: speed up using AES-NI on amd64

This CL requires CL 5970055.

benchmark           old ns/op    new ns/op    delta
BenchmarkEncrypt          161           23  -85.71%
BenchmarkDecrypt          158           24  -84.24%
BenchmarkExpand           526           62  -88.21%

benchmark            old MB/s     new MB/s  speedup
BenchmarkEncrypt        99.32       696.19    7.01x
BenchmarkDecrypt       100.93       641.56    6.36x

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

12 years agocmd/6a, cmd/6l: add support for AES-NI instrutions and PSHUFD
Shenghou Ma [Wed, 26 Sep 2012 17:53:08 +0000 (01:53 +0800)]
cmd/6a, cmd/6l: add support for AES-NI instrutions and PSHUFD
This CL adds support for the these 7 new instructions to 6a/6l in
preparation of the upcoming CL for AES-NI accelerated crypto/aes:
AESENC, AESENCLAST, AESDEC, AESDECLAST, AESIMC, AESKEYGENASSIST,
and PSHUFD.

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

12 years agocodereview: use subprocess.call() instead of os.spawnvp() for portability
Shivakumar GN [Wed, 26 Sep 2012 17:50:59 +0000 (01:50 +0800)]
codereview: use subprocess.call() instead of os.spawnvp() for portability

Fixes #4121.

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

12 years agospec: permit trailing comma in conversions
Robert Griesemer [Wed, 26 Sep 2012 17:31:57 +0000 (10:31 -0700)]
spec: permit trailing comma in conversions

Also: Adjust prose in Conversions section
to be consistent.

This is a backward-compatible syntax change.
For a discussion see issue 2568.

Fixes #2568.
Fixes #4123.

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

12 years agodoc/go1.1: fix metadata json format
Francisco Souza [Wed, 26 Sep 2012 15:49:36 +0000 (08:49 -0700)]
doc/go1.1: fix metadata json format

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

12 years agocmd/go, cmd/ld: fix libgcc order and add __image_base__ symbol for windows
Shenghou Ma [Wed, 26 Sep 2012 14:34:25 +0000 (22:34 +0800)]
cmd/go, cmd/ld: fix libgcc order and add __image_base__ symbol for windows
        Fixes #4063.

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

12 years agocmd/go: assume that code in $GOROOT is up to date
Joel Sing [Wed, 26 Sep 2012 14:00:50 +0000 (00:00 +1000)]
cmd/go: assume that code in $GOROOT is up to date

Do not check compiler/linker timestamps for packages that are in the
$GOROOT. Avoids trying to rebuild non-writable standard packages when
timestamps have not been retained on the Go binaries.

Fixes #4106.

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

12 years agoreflect.DeepEqual: rewrite clarification about nil and empty slice.
Rob Pike [Wed, 26 Sep 2012 10:46:49 +0000 (20:46 +1000)]
reflect.DeepEqual: rewrite clarification about nil and empty slice.
The previous version was created by an idiot. This time, Rog Peppe
wrote the text. Thanks, Rog.
(== doesn't work on slices in general, so it makes no sense to
talk about in the context of DeepEqual.)

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

12 years agonet: fix plan 9 build
Mikio Hara [Wed, 26 Sep 2012 07:11:49 +0000 (16:11 +0900)]
net: fix plan 9 build

R=golang-dev, lucio.dere, fshahriar
CC=golang-dev
https://golang.org/cl/6562046

12 years agoreflect.DeepEqual: document that empty and nil are unequal for slices
Rob Pike [Wed, 26 Sep 2012 05:21:07 +0000 (15:21 +1000)]
reflect.DeepEqual: document that empty and nil are unequal for slices

Update #4133.
Added a sentence of documentation to call out the behavior.

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

12 years agoexp/types/staging: updated gcimporter
Robert Griesemer [Wed, 26 Sep 2012 00:39:02 +0000 (17:39 -0700)]
exp/types/staging: updated gcimporter

Mostly minor changes to match the new
definitions in types.go and const.go.

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

12 years agoexp/types/staging: support for typechecking (most) builtins
Robert Griesemer [Wed, 26 Sep 2012 00:38:43 +0000 (17:38 -0700)]
exp/types/staging: support for typechecking (most) builtins

This code relies on some functions that are not yet in staging,
but it get's harder to keep all this in sync in a piece-meal
fashion.

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

12 years agoexp/types/staging: operands, constants, and error handling
Robert Griesemer [Wed, 26 Sep 2012 00:38:22 +0000 (17:38 -0700)]
exp/types/staging: operands, constants, and error handling

More pieces of the typechecker code:

- Operands are temporary objects representing an expressions's
type and value (for constants). An operand is the equivalent of
an "attribute" in attribute grammars except that it's not stored
but only passed around during type checking.

- Constant operations are implemented in const.go. Constants are
represented as bool (booleans), int64 and *big.Int (integers),
*big.Rat (floats), complex (complex numbers), and string (strings).

- Error reporting is consolidated in errors.go. Only the first
dozen of lines is new code, the rest of the file contains the
exprString and typeString functions formerly in two separate
files (which have been removed).

This is a replacement CL for 6492101 (which was created without
proper use of hg).

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

12 years agonet/http: use tls host instead of proxy, when checking against a certificate
Christian Himpel [Tue, 25 Sep 2012 16:22:13 +0000 (09:22 -0700)]
net/http: use tls host instead of proxy, when checking against a certificate

Fixes #4152.

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

12 years agosyscall: do not use int to test network syscall results (on windows)
Alex Brainman [Tue, 25 Sep 2012 07:06:39 +0000 (17:06 +1000)]
syscall: do not use int to test network syscall results (on windows)

Fixes #4147.

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

12 years agocmd/5c: fix dataflag annotation
Shenghou Ma [Tue, 25 Sep 2012 06:42:44 +0000 (14:42 +0800)]
cmd/5c: fix dataflag annotation

file        old_size     new_size    base@c1ce95068533
bin/go      14717392     6287824     5918236

this huge size difference is due to GC data for runtime.mheap
(NOPTR dataflag is not obeyed).

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

12 years agotest/bench/shootout: new data after 64-bit ints for amd64
Rob Pike [Tue, 25 Sep 2012 04:14:26 +0000 (14:14 +1000)]
test/bench/shootout: new data after 64-bit ints for amd64

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

12 years agocmd/dist: new version for string for development branch
Russ Cox [Tue, 25 Sep 2012 01:35:20 +0000 (21:35 -0400)]
cmd/dist: new version for string for development branch

Remove VERSION, which was forcing version to 'devel'.

Old:
$ go version
go version devel

New:
$ go version
go version devel +0a3866d6cc6b Mon Sep 24 20:08:05 2012 -0400

The date and time (and time zone) is that of the most recent commit,
not the time of the build itself. With some effort we could normalize
the zone, but I don't think it's worth the effort (more C coding,
since Mercurial is unhelpful).

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

12 years agobuild: make int 64 bits on amd64
Russ Cox [Tue, 25 Sep 2012 00:57:01 +0000 (20:57 -0400)]
build: make int 64 bits on amd64

The assembly offsets were converted mechanically using
code.google.com/p/rsc/cmd/asmlint. The instruction
changes were done by hand.

Fixes #2188.

R=iant, r, bradfitz, remyoudompheng
CC=golang-dev
https://golang.org/cl/6550058

12 years agoruntime: add types to MSpan
Jan Ziak [Tue, 25 Sep 2012 00:08:05 +0000 (20:08 -0400)]
runtime: add types to MSpan

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

12 years agoreflect: add MakeFunc (API CHANGE)
Russ Cox [Tue, 25 Sep 2012 00:06:32 +0000 (20:06 -0400)]
reflect: add MakeFunc (API CHANGE)

Fixes #1765.

R=iant, r, daniel.morsing, minux.ma, bradfitz, rogpeppe, remyoudompheng
CC=golang-dev
https://golang.org/cl/6554067

12 years agonet: add read, write message methods to IPConn, UDPConn
Mikio Hara [Mon, 24 Sep 2012 21:57:32 +0000 (06:57 +0900)]
net: add read, write message methods to IPConn, UDPConn

Both methods allow to access the IP ancillary data through
socket control messages.

This CL is required for CL 6482044; go.net/ipv4: new package.

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

12 years agocmd/{5g,6g,8g,6c}: remove unused macro, use %E to print etype.
Rémy Oudompheng [Mon, 24 Sep 2012 21:44:00 +0000 (23:44 +0200)]
cmd/{5g,6g,8g,6c}: remove unused macro, use %E to print etype.

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