runtime: use m and g, instead of R9 and R10, in ARM assembly files
also don't clobber R9 if it is about to crash.

In response to https://codereview.appspot.com/9251043/#msg2.

R=golang-dev, khr, khr, dave
CC=golang-dev
https://codereview.appspot.com/9778046
runtime: fix heap corruption during GC
The 'n' variable is used during rescan initiation in GC_END case,
but it's overwritten with chan capacity in GC_CHAN case.
As the result rescan is done with the wrong object size.
Fixes issue 5554.

R=golang-dev, khr
CC=golang-dev
https://codereview.appspot.com/9831043
os/exec: fix test hang
Currently the test closes random files descriptors,
which leads to hang (in particular if netpoll fd is closed).
Try to open only fd 3, since the parent process expects it to be fd 3 anyway.
Fixes issue 5571.

R=golang-dev, r
CC=golang-dev
https://codereview.appspot.com/9778048
runtime: allocate internal symbol table eagerly
we need it for GC anyway.

R=golang-dev, khr, dave, khr
CC=golang-dev
https://codereview.appspot.com/9728044
runtime: allocate page table lazily
This removes the 256MB memory allocation at startup,
which conflicts with ulimit.
Also will allow to eliminate an unnecessary memory dereference in GC,
because the page table is usually mapped at known address.
Update issue 5049.
Update issue 5236.

R=golang-dev, khr, r, khr, rsc
CC=golang-dev
https://codereview.appspot.com/9791044
runtime: make mheap statically allocated again
This depends on: 9791044: runtime: allocate page table lazily
Once page table is moved out of heap, the heap becomes small.
This removes unnecessary dereferences during heap access.
No logical changes.

R=golang-dev, khr
CC=golang-dev
https://codereview.appspot.com/9802043
cmd/5l, cmd/6l, cmd/8l, cmd/gc, runtime: generate and use bitmaps of argument pointer locations

With this change the compiler emits a bitmap for each function
covering its stack frame arguments area.  If an argument word
is known to contain a pointer, a bit is set.  The garbage
collector reads this information when scanning the stack by
frames and uses it to ignores locations known to not contain a
pointer.

R=golang-dev, bradfitz, daniel.morsing, dvyukov, khr, khr, iant, cshapiro
CC=golang-dev
https://codereview.appspot.com/9223046
A+C: add Katrina Owen (individual CLA)

R=golang-dev
CC=golang-dev
https://codereview.appspot.com/9853043
doc: Fix typo in approximation of square root

See https://en.wikipedia.org/wiki/Newton%27s_method#Square_root_of_a_number

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

Committer: Andrew Gerrand <adg@golang.org>
runtime: make notetsleep() return false if timeout happens
This is needed for preemptive scheduler, because during
stoptheworld we want to wait with timeout and re-preempt
M's on timeout.

R=golang-dev, remyoudompheng, iant
CC=golang-dev
https://codereview.appspot.com/9375043
A+C: John Shahid (individual CLA)

Generated by addca.

R=gobot
CC=golang-dev
https://codereview.appspot.com/9798049
      crypto/tls: Check all certificates in the path.

Currently we only check the leaf node's issuer against the list of
distinguished names in the server's CertificateRequest message. This
will fail if the client certiciate has more than one certificate in
the path and the leaf node issuer isn't in the list of distinguished
names, but the issuer's issuer was in the distinguished names.

R=agl, agl
CC=gobot, golang-dev
https://codereview.appspot.com/9795043

Committer: Adam Langley <agl@golang.org>
fmt: change evalutation of indexed arg to match docs
The old code put the index before the period in the precision;
it should be after so it's always before the star, as documented.
A little trickier to do in one pass but compensated for by more
tests and catching a couple of other error cases.

R=rsc
CC=golang-dev
https://codereview.appspot.com/9751044
runtime: remove all badcallback() functions

R=iant
CC=golang-dev
https://codereview.appspot.com/9738046
cmd/gc: remove unused bit vector comparison code

R=golang-dev, dave, iant
CC=golang-dev
https://codereview.appspot.com/9738045
misc/cgo/test: check API compatibility for cgo pseudo-functions

R=golang-dev, iant
CC=golang-dev
https://codereview.appspot.com/9826043
cmd/5a, cmd/dist, runtime: support m/g in the assembler, drop support for R9/R10
to avoid unintentionally clobber R9/R10.
Thanks Lucio for the suggestion.

PS: yes, this could be considered a big change (but not an API change), but
as it turns out even temporarily changes R9/R10 in user code is unsafe and
leads to very hard to diagnose problems later, better to disable using R9/R10
when the user first uses it.
See CL 6300043 and CL 6305100 for two problems caused by misusing R9/R10.

R=golang-dev, khr, rsc
CC=golang-dev
https://codereview.appspot.com/9840043
cmd/ld, runtime: emit pointer maps for nosplits identified by the linker

A nosplits was assumed to have no argument information and no
pointer map.  However, nosplits created by the linker often
have both.  This change uses the pointer map size as an
alternate source of argument size when processing a nosplit.

In addition, the symbol table construction pointer map size
and argument size consistency check is strengthened.  If a
nptrs is greater than 0 it must be equal to the number of
argument words.

R=golang-dev, khr, khr
CC=golang-dev
https://codereview.appspot.com/9666047
misc/dist: remove lingering ~ file

Fixes issue 5405.

R=golang-dev, adg
CC=golang-dev
https://codereview.appspot.com/9856043
cmd/[568]l/obj.c: NULL is not recognised in Plan 9 build, use nil instead.

Fixes issue 5591.

R=golang-dev, dave, minux.ma, cshapiro
CC=carl shapiro <cshapiro, golang-dev
https://codereview.appspot.com/9839046

Committer: Dave Cheney <dave@cheney.net>