cmd/6g, cmd/8g: Allow optimization of return registers.

The peephole optimizer would keep hands off AX and X0 during returns, even though go doesn't return through registers.

R=dave, rsc
CC=golang-dev
https://codereview.appspot.com/7030046
os: use syscall.Pipe2 on Linux

Update issue 2656

R=golang-dev, iant, minux.ma, bradfitz
CC=golang-dev
https://codereview.appspot.com/7065063

Committer: Ian Lance Taylor <iant@golang.org>
net/http: buffer before chunking

This introduces a buffer between writing from a handler and
writing chunks.  Further, it delays writing the header until
the first full chunk is ready.  In the case where the first
full chunk is also the final chunk (for small responses), that
means we can also compute a Content-Length, which is a nice
side effect for certain benchmarks.

Fixes issue 2357

R=golang-dev, dave, minux.ma, rsc, adg, balasanjay
CC=golang-dev
https://codereview.appspot.com/6964043
test: make rundir match compiledir/errorcheckdir.

This allows test/dwarf to be supported by run.go.

Update issue 4139.

R=golang-dev, bradfitz, iant
CC=golang-dev
https://codereview.appspot.com/7064067
test: adapt old-style tests to new flag parsing.

The -I. syntax now needs a space to be recognized in the
compiler.

R=golang-dev, bradfitz
CC=golang-dev
https://codereview.appspot.com/7098046
database/sql: check NumInput on Stmt.Exec

Fixes issue 3678.

R=golang-dev, bradfitz
CC=golang-dev
https://codereview.appspot.com/6460087

Committer: Brad Fitzpatrick <bradfitz@golang.org>
test: add rotate.go and fixedbugs/bug313

Update issue 4139.

R=golang-dev, iant
CC=golang-dev
https://codereview.appspot.com/7094047
go/types: Moving from *ast.Objects to types.Objects (step 1).

The existing type checker was relying on augmenting ast.Object
fields (empty interfaces) for its purposes. While this worked
for some time now, it has become increasingly brittle. Also,
the need for package information for Fields and Methods would
have required a new field in each ast.Object. Rather than making
them bigger and the code even more subtle, in this CL we are moving
away from ast.Objects.

The types packge now defines its own objects for different
language entities (Const, Var, TypeName, Func), and they
implement the types.Object interface. Imported packages
create a Package object which holds the exported entities
in a types.Scope of types.Objects.

For type-checking, the current package is still using ast.Objects
to make this transition manageable. In a next step, the type-
checker will also use types.Objects instead, which opens the door
door to resolving ASTs entirely by the type checker. As a result,
the AST and type checker become less entangled, and ASTs can be
manipulated "by hand" or programmatically w/o having to worry
about scope and object invariants that are very hard to maintain.

(As a consequence, a future parser can do less work, and a
future AST will not need to define objects and scopes anymore.
Also, object resolution which is now split across the parser,
the ast, (ast.NewPackage), and even the type checker (for composite
literal keys) can be done in a single place which will be simpler
and more efficient.)

Change details:
- Check now takes a []*ast.File instead of a map[string]*ast.File.
It's easier to handle (I deleted code at all use sites) and does
not suffer from undefined order (which is a pain for testing).
- ast.Object.Data is now a *types.Package rather then an *ast.Scope
if the object is a package (obj.Kind == ast.Pkg). Eventually this
will go away altogether.
- Instead of an ast.Importer, Check now uses a types.Importer
(which returns a *types.Package).
- types.NamedType has two object fields (Obj Object and obj *ast.Object);
eventually there will be only Obj. The *ast.Object is needed during
this transition since a NamedType may refer to either an imported
(using types.Object) or locally defined (using *ast.Object) type.
- ast.NewPackage is not used anymore - there's a local copy for
package-level resolution of imports.
- struct fields now take the package origin into account.
- The GcImporter is now returning a *types.Package. It cannot be
used with ast.NewPackage anymore. If that functionality is still
used, a copy of the old GcImporter should be made locally (note
that GcImporter was part of exp/types and it's API was not frozen).
- dot-imports are not handled for the time being (this will come back).

R=adonovan
CC=golang-dev
https://codereview.appspot.com/7058060
database/sql: document args, add a couple examples

Fixes issue 3460

R=golang-dev, alex.brainman
CC=golang-dev
https://codereview.appspot.com/7096046
go/types: export QualifiedName.IsSame and NamedType.AstObj

R=adonovan
CC=golang-dev
https://codereview.appspot.com/7103047
net/http/cgi: fix test case sensitivity on Windows

Fixes issue 4645

R=golang-dev, alex.brainman, minux.ma
CC=golang-dev
https://codereview.appspot.com/7105047
testing: in example, empty output not distinguished from missing output

Fixes issue 4485.

R=golang-dev, rsc, adg
CC=golang-dev
https://codereview.appspot.com/7071050

Committer: Andrew Gerrand <adg@golang.org>
text/template: Document that range can be used on chan types.

Fixes issue 4640.

R=golang-dev, adg
CC=golang-dev
https://codereview.appspot.com/7082044

Committer: Andrew Gerrand <adg@golang.org>
      testing: document whitespace trimming of example expected/actual output.

Fixes issue 4642.

R=golang-dev, adg
CC=golang-dev
https://codereview.appspot.com/7090044

Committer: Andrew Gerrand <adg@golang.org>
build: add missing function declarations for Plan 9

R=golang-dev, minux.ma, rsc, ality, seed
CC=golang-dev
https://codereview.appspot.com/7034052

Committer: Anthony Martin <ality@pbrane.org>
test: limit runoutput tests on arm platforms

runoutput styles tests generally consume a lot of memory. On arm platforms rotate?.go consume around 200mb each to compile, and as tests are sorted alphabetically, they all tend to run at once.

This change limits the number of runoutput jobs to 2 on arm platforms.

R=minux.ma, remyoudompheng, bradfitz, lucio.dere
CC=golang-dev
https://codereview.appspot.com/7099047
cmd/5c: fix handling of side effects when assigning a struct literal.

Also undo revision a5b96b602690 used to workaround the bug.

Fixes issue 4643.

R=rsc, golang-dev, dave, minux.ma, lucio.dere, bradfitz
CC=golang-dev
https://codereview.appspot.com/7090043
cmd/5l: fix invalid executable header on Plan 9

R=minux.ma, lucio.dere
CC=golang-dev
https://codereview.appspot.com/7094048