5g: don't generate reg variables for direct-called functions

The test intended to skip direct calls when creating
registerization variables was testing p->to.type instead of
p->to.name, so it always failed, causing regopt to create
unnecessary variables for these names.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://codereview.appspot.com/169110043
bufio: don't loop generating empty tokens

The new rules for split functions mean that we are exposed
to the common bug of a function that loops forever at EOF.
Pick these off by shutting down the scanner if too many
consecutive empty tokens are delivered.

Fixes issue 9020.

LGTM=rsc, adg
R=golang-codereviews, rsc, adg, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/169970043
doc/go1.4.html: document new subrepo import paths

LGTM=r, adg
R=adg, r, 0xjnml, dr.volker.dobler
CC=golang-codereviews
https://codereview.appspot.com/166980044
bufio: fix reading of many blank lines in a row

Fixes issue 9020.

LGTM=bradfitz, r
R=r, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/170030043
runtime: avoid gentraceback of self on user goroutine stack

Gentraceback may grow the stack.
One of the gentraceback wrappers may grow the stack.
One of the gentraceback callback calls may grow the stack.
Various stack pointers are stored in various stack locations
as type uintptr during the execution of these calls.
If the stack does grow, these stack pointers will not be
updated and will start trying to decode stack memory that
is no longer valid.

It may be possible to change the type of the stack pointer
variables to be unsafe.Pointer, but that's pretty subtle and
may still have problems, even if we catch every last one.
An easier, more obviously correct fix is to require that
gentraceback of the currently running goroutine must run
on the g0 stack, not on the goroutine's own stack.

Not doing this causes faults when you set
        StackFromSystem = 1
        StackFaultOnFree = 1

The new check in gentraceback will catch future lapses.

The more general problem is calling getcallersp but then
calling a function that might relocate the stack, which would
invalidate the result of getcallersp. Add note to stubs.go
declaration of getcallersp explaining the problem, and
check all existing calls to getcallersp. Most needed fixes.

This affects Callers, Stack, and nearly all the runtime
profiling routines. It does not affect stack copying directly
nor garbage collection.

LGTM=khr
R=khr, bradfitz
CC=golang-codereviews, r
https://codereview.appspot.com/167060043
bufio: remove unused 'panicked' variable from test

LGTM=r
R=r
CC=golang-codereviews
https://codereview.appspot.com/166230044
os/exec: tell lsof not to block

For some reason lsof is now hanging on my workstation
without the -b (avoid blocking in the kernel) option.
Adding -b makes the test pass and shouldn't hurt.

I don't know how recent the -b option is.  If the builders
are ok with it, it's probably ok.

LGTM=rsc
R=golang-codereviews, bradfitz, rsc
CC=golang-codereviews
https://codereview.appspot.com/166220043
os: document that users of Fd should keep f alive

Fixes issue 9046.

LGTM=r
R=r
CC=golang-codereviews
https://codereview.appspot.com/162680043
runtime: fix initial gp->sched.pc in newextram

CL 170720043 missed this one when adding +PCQuantum.

LGTM=iant
R=r, iant
CC=golang-codereviews
https://codereview.appspot.com/168090043
runtime: don't stop bitmap dump at BitsDead

Stack bitmaps need to be scanned past any BitsDead entries.

Object bitmaps will not have any BitsDead in them (bitmap extraction stops at
the first BitsDead entry in makeheapobjbv).  data/bss bitmaps also have no BitsDead entries.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://codereview.appspot.com/168270043
test: move linkx and sinit to run.go

The remaining run-only tests will be migrated to run.go in another CL.

This CL will break the build due to issues 8746 and 8806.

Update issue 4139
Update issue 8746
Update issue 8806

LGTM=rsc
R=rsc, bradfitz, iant
CC=golang-codereviews
https://codereview.appspot.com/144630044

Committer: Russ Cox <rsc@golang.org>
doc: change "/s/..." links to be on golang.org

People viewing this locally will not have a /s/ on their local godoc.
tip.golang.org doesn't have one either.

Also change all golang.org links to https, to avoid mixed content
warnings when viewing https://golang.org/.

Fixes issue 9028.

LGTM=bradfitz, r
R=r, bradfitz
CC=adg, golang-codereviews
https://codereview.appspot.com/168250043
doc/go1.4.html: leave stack size at 2 kB

LGTM=r
R=khr, r
CC=golang-codereviews
https://codereview.appspot.com/165590043
cmd/objdump, cmd/pprof: factor disassembly into cmd/internal/objfile

Moving so that new Go 1.4 pprof can use it.

The old 'GNU objdump workalike' mode for 'go tool objdump'
is now gone, as are the tests for that mode. It was used only
by pre-Go 1.4 pprof. You can still specify an address range on
the command line; you just get the same output format as
you do when dumping the entire binary (without an address
limitation).

LGTM=r
R=r
CC=golang-codereviews, iant
https://codereview.appspot.com/167320043
cmd/internal/objfile: add Disasm

This was missing from CL 167320043.
Happy to apply comments in a followup.
TBR to fix build.

TBR=r
CC=golang-codereviews
https://codereview.appspot.com/171260043
cmd/go: disable warnings from cmd/cc when building for SWIG

Fixes issue 9065.

LGTM=rsc
R=rsc, misch
CC=golang-codereviews
https://codereview.appspot.com/171270043
net/http: fix benchmark goroutine leak

New detection because of net/http now using TestMain.

Fixes Issue 9033

LGTM=iant
R=golang-codereviews, iant
CC=adg, golang-codereviews, rsc
https://codereview.appspot.com/170210043
lib/codereview: fix with more recent hg revisions.

I've Mercurial version 3.2 and hg submit fails with:

  File "/home/agl/devel/go/lib/codereview/codereview.py", line 3567, in get_hg_status
    ret = hg_commands.status(fui, self.repo, *[], **{'rev': [rev], 'copies': True})
  File "/usr/lib/python2.7/site-packages/mercurial/commands.py", line 5714, in status
    fm = ui.formatter('status', opts)
  File "/home/agl/devel/go/lib/codereview/codereview.py", line 3464, in formatter
    return plainformatter(self, topic, opts)
  File "/usr/lib/python2.7/site-packages/mercurial/formatter.py", line 57, in __init__
    if ui.debugflag:
  AttributeError: 'FakeMercurialUI' object has no attribute 'debugflag'

This change dumbly adds a boolean debugflag and that seems to work.

LGTM=minux
R=rsc, minux
CC=golang-codereviews
https://codereview.appspot.com/167410043
cmd/api: use golang.org/x/... import paths

LGTM=bradfitz, rsc
R=rsc, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/169000043
all: use golang.org/x/... import paths

LGTM=rsc, r
R=r, rsc
CC=golang-codereview, golang-codereviews
https://codereview.appspot.com/168050043