runtime: include os_*.h in the generated Go structs

Adding the #include to defs.c makes it get processed
by cmd/dist, which writes out Go equivalent for all the
C data structures defined in defs.c.

This in turn makes it necessary to define the Plink type,
used in os_plan9.h, in os_plan9.go. Rename it to _Plink
to avoid being exported.

LGTM=0intro, iant
R=golang-codereviews, iant, 0intro
CC=golang-codereviews, r
https://codereview.appspot.com/132490043
runtime: change concatstring panic to gothrow

It was a throw originally; it was converted incorrectly.

LGTM=dave
R=khr, dave
CC=golang-codereviews
https://codereview.appspot.com/139000043
runtime: fix windows build

#ifdef'ed out code wasn't updated for argp change.

TBR=iant
CC=golang-codereviews
https://codereview.appspot.com/139040043
runtime: convert mprof.goc to mprof.go

The exported Go definitions appearing in mprof.go are
copied verbatim from debug.go.

The unexported Go funcs and types are new.
The C Bucket type used a union and was not a line-for-line translation.

LGTM=remyoudompheng
R=golang-codereviews, remyoudompheng
CC=dvyukov, golang-codereviews, iant, khr, r
https://codereview.appspot.com/137040043
runtime: fix Stack

Fixes issue 8626.

LGTM=bradfitz
R=golang-codereviews
CC=bradfitz, golang-codereviews, iant, r
https://codereview.appspot.com/137050043
time: update generated zoneinfo_abbrs_windows.go

The file in repo has been updated recently, but all these changes
are gone off the web site now. It seems web site gets updated once
in a while, so we'll update our file occasionally.

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://codereview.appspot.com/140780043
runtime: fix race detector running Go code on g0 of non-main thread

It looks like this has just always been broken:
the race detector handles running Go code on g0 of the main thread
and on g0 of any extra threads created by non-Go code, but it does
not handle running Go code on g0 of non-main threads created by Go.
Handle that.

Should fix the race build failures on the dashboard.

We're running into this now because we are running more
and more Go code on g0.

TBR=dvyukov
CC=golang-codereviews
https://codereview.appspot.com/137910043
runtime: fix gogetenv on Plan 9

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

Committer: Russ Cox <rsc@golang.org>
runtime/pprof: adjust cpuHogger so that tests pass on windows builders

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

Committer: Russ Cox <rsc@golang.org>
runtime: convert cpuprof from C to Go

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

Committer: Russ Cox <rsc@golang.org>
runtime: convert clearpools/registerPoolCleanup to Go

LGTM=bradfitz, rsc
R=golang-codereviews, bradfitz, rsc
CC=golang-codereviews, khr
https://codereview.appspot.com/133240043
database/sql: Avoid re-preparing statements when all connections are busy

Previously, if all connections were busy, we would always
re-prepare the statement on the connection we were assigned from
the pool.  That meant that if all connections were busy most of the
time, the number of prepared statements for each connection would
keep increasing over time.

Instead, after getting a free connection, check to see if the
statement has already been prepared on it, and reuse the statement
handle if so.

LGTM=bradfitz
R=golang-codereviews, gobot, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/116930043

Committer: Brad Fitzpatrick <bradfitz@golang.org>
runtime: move reflect trampolines into thunk file.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/133460043
cmd/gc: fix runtime print(hex(x))

The code I wrote originally works for trivial functions
that are inlined at a call site in another package,
because that was how I wrote my local test.
Make hex(x) work for non-inlinable functions too.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews, r
https://codereview.appspot.com/140830043
runtime: convert traceback*.c to Go

The two converted files were nearly identical.
Instead of continuing that duplication, I merged them
into a single traceback.go.

Tested on arm, amd64, amd64p32, and 386.

LGTM=r
R=golang-codereviews, remyoudompheng, dave, r
CC=dvyukov, golang-codereviews, iant, khr
https://codereview.appspot.com/134200044
A+C: David Leon Gil (individual CLA)

Generated by a+c.

R=gobot
CC=golang-codereviews
https://codereview.appspot.com/134330043
crypto: Add SHA3 functions in go.crypto/sha3 to the Hash enum.

Reverse dependency of https://codereview.appspot.com/130950043/

LGTM=agl
R=golang-codereviews, agl
CC=agl, golang-codereviews
https://codereview.appspot.com/138800043

Committer: Adam Langley <agl@golang.org>
runtime: convert select implementation to Go.

LGTM=rsc
R=golang-codereviews, bradfitz, iant, khr, rsc
CC=golang-codereviews
https://codereview.appspot.com/139020043
runtime: unify fastrand1 and fastrand2

C and Go calling conventions are now compatible, so we
don't need two versions of this function.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/139080043
runtime: handle empty environment variables on Plan 9

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