go/types: Pkg *Package field for all objects

The field is nil for predeclared (universe)
objects and parameter/result variables.

R=adonovan
CC=golang-dev
https://codereview.appspot.com/7312093
go/types: Permit dereferencing of named pointer types.

R=golang-dev, gri
CC=golang-dev
https://codereview.appspot.com/7358044

Committer: Robert Griesemer <gri@golang.org>
exp/cookiejar: store cookies under TLD+1 on nil public suffix list

The current implementation would store all cookies received from
any .com domain under "com" in the entries map if a nil public
suffix list is used in constructing the Jar. This is inefficient.

This CL uses the TLD+1 of the domain if the public suffix list
is nil which has two advantages:
 - It uses the entries map efficiently.
 - It prevents a host foo.com to set cookies for bar.com.
   (It may set the cookie, but it won't be returned to bar.com.)
A domain like www.british-library.uk may still set a domain
cookie for .british-library.uk in this case.

The behavior for a non-nil public suffix list is unchanged, cookies
are stored under eTLD+1 in this case.

R=nigeltao
CC=golang-dev
https://codereview.appspot.com/7312105

Committer: Nigel Tao <nigeltao@golang.org>
src/run.rc: "go env -9" is not valid, the correct command is "go tool dist env -9".

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

Committer: Shenghou Ma <minux.ma@gmail.com>
doc/gccgo_contribute: mention gofrontend-dev@googlegroups.com mailing list

R=iant
CC=golang-dev
https://codereview.appspot.com/7323064
src: use internal tests if possible

If a test can be placed in the same package ("internal"), it is placed
there. This facilitates testing of package-private details. Because of
dependency cycles some packages cannot be tested by internal tests.

R=golang-dev, rsc, mikioh.mikioh
CC=golang-dev, r
https://codereview.appspot.com/7323044

Committer: Russ Cox <rsc@golang.org>
reflect: document tie-breaking in Select

The exact words are taken from the spec.

Fixes some confusion on golang-nuts.

R=golang-dev, bradfitz
CC=golang-dev
https://codereview.appspot.com/7353044
runtime: replace bubble sort with heap sort in select

R=golang-dev, agl
CC=golang-dev
https://codereview.appspot.com/7304106
codereview: give up on http fetch after 30 seconds

If Python blocks in the SSL handshake it seems to be
completely uninterruptible, and I've been seeing it
block for at least hours recently. I don't know if the
problem is on the client side or the server side or
somewhere in the network, but setting the timeout
at least means you're guaranteed a new shell prompt
(after printing some errors).

R=golang-dev, bradfitz, minux.ma
CC=golang-dev
https://codereview.appspot.com/7337048
A+C: Donovan Hide (individual CLA)

Generated by addca.

R=gobot
CC=golang-dev
https://codereview.appspot.com/7351046
strings: faster Count, Index

Slightly better benchmarks for when string and separator are equivalent and also less branching in inner loops.
benchmark                        old ns/op    new ns/op    delta
BenchmarkGenericNoMatch               3430         3442   +0.35%
BenchmarkGenericMatch1               23590        22855   -3.12%
BenchmarkGenericMatch2              108031       105025   -2.78%
BenchmarkSingleMaxSkipping            2969         2704   -8.93%
BenchmarkSingleLongSuffixFail         2826         2572   -8.99%
BenchmarkSingleMatch                205268       197832   -3.62%
BenchmarkByteByteNoMatch               987          921   -6.69%
BenchmarkByteByteMatch                2014         1749  -13.16%
BenchmarkByteStringMatch              3083         3050   -1.07%
BenchmarkHTMLEscapeNew                 922          915   -0.76%
BenchmarkHTMLEscapeOld                1654         1570   -5.08%
BenchmarkByteByteReplaces            11897        11556   -2.87%
BenchmarkByteByteMap                  4485         4255   -5.13%
BenchmarkIndexRune                     174          121  -30.46%
BenchmarkIndexRuneFastPath              41           41   -0.24%
BenchmarkIndex                          45           44   -0.22%
BenchmarkMapNoChanges                  433          431   -0.46%
BenchmarkIndexHard1                4015336      3316490  -17.40%
BenchmarkIndexHard2                3976254      3395627  -14.60%
BenchmarkIndexHard3                3973158      3378329  -14.97%
BenchmarkCountHard1                4403549      3448512  -21.69%
BenchmarkCountHard2                4387437      3413059  -22.21%
BenchmarkCountHard3                4403891      3382661  -23.19%
BenchmarkIndexTorture                28354        25864   -8.78%
BenchmarkCountTorture                29625        27463   -7.30%
BenchmarkFields                   38752040     39169840   +1.08%
BenchmarkFieldsFunc               38797765     38888060   +0.23%

benchmark                         old MB/s     new MB/s  speedup
BenchmarkSingleMaxSkipping         3367.07      3697.62    1.10x
BenchmarkSingleLongSuffixFail       354.51       389.47    1.10x
BenchmarkSingleMatch                 73.07        75.82    1.04x
BenchmarkFields                      27.06        26.77    0.99x
BenchmarkFieldsFunc                  27.03        26.96    1.00x

R=dave, fullung, remyoudompheng, rsc
CC=golang-dev
https://codereview.appspot.com/7350045

Committer: Russ Cox <rsc@golang.org>
debug/dwarf: add flag_present attribute encoding.

ref: http://www.dwarfstd.org/doc/DWARF4.pdf

Update issue 4829

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

Committer: Shenghou Ma <minux.ma@gmail.com>
go/types: Use left-hand side's type as hint for right-hand
side expression evaluation in assignment operations.

R=golang-dev, gri
CC=golang-dev
https://codereview.appspot.com/7349046

Committer: Robert Griesemer <gri@golang.org>
path/filepath: document Dir better

This comment matches the one in path.

Fixes issue 4837.

R=golang-dev, bradfitz
CC=golang-dev
https://codereview.appspot.com/7305100
path/filepath: add examples for SplitList and Rel.

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

Committer: Brad Fitzpatrick <bradfitz@golang.org>
cmd/godoc: use go/build to determine package and example files

Also:
- faster code for example extraction
- simplify handling of command documentation:
  all "main" packages are treated as commands
- various minor cleanups along the way

For commands written in Go, any doc.go file containing
documentation must now be part of package main (rather
then package documentation), otherwise the documentation
won't show up in godoc (it will still build, though).

For commands written in C, documentation may still be
in doc.go files defining package documentation, but the
recommended way is to explicitly ignore those files with
a +build ignore constraint to define package main.

Fixes issue 4806.

R=adg, rsc, dave, bradfitz
CC=golang-dev
https://codereview.appspot.com/7333046
exp/README: update README

R=golang-dev, dsymonds, bradfitz
CC=golang-dev
https://codereview.appspot.com/7323073
go/types: include package import path in NamedType.String().

This avoids ambiguity and makes the diagnostics closer to
those issued by gc, but it is more verbose since it qualifies
intra-package references.

Without extra context---e.g. a 'from *Package' parameter to
Type.String()---we are forced to err on one side or the other.

Also, cosmetic changes to exp/ssa:
- Remove package-qualification workaround in Function.FullName.
- Always set go/types.Package.Path field to the import path,
  since we know the correct path at this point.
- In Function.DumpTo, show variadic '...' and result type info,
  and delete now-redundant "# Type: " line.

R=gri
CC=golang-dev
https://codereview.appspot.com/7325051