runtime: look up arg stackmap for makeFuncStub/methodValueStub during traceback

makeFuncStub and methodValueStub are used by reflect as
generic function implementations. Each call might have
different arguments. Extract those arguments from the
closure data instead of assuming it is the same each time.

Because the argument map is now being extracted from the
function itself, we don't need the special cases in reflect.Call
anymore, so delete those.

Fixes an occasional crash seen when stack copying does
not update makeFuncStub's arguments correctly.

Will also help make it safe to require stack maps in the
garbage collector.

Derived from CL 142000044 by khr.

LGTM=khr
R=khr
CC=golang-codereviews
https://codereview.appspot.com/143890044
runtime: tell the truth about BitVector type

Dmitriy changed all the execution to interpret the BitVector
as an array of bytes. Update the declaration and generation
of the bitmaps to match, to avoid problems on big-endian
machines.

LGTM=khr
R=khr
CC=dvyukov, golang-codereviews
https://codereview.appspot.com/140570044
runtime: stop scanning stack frames/args conservatively

The goal here is to commit fully to having precise information
about stack frames. If we need information we don't have,
crash instead of assuming we should scan conservatively.

Since the stack copying assumes fully precise information,
any crashes during garbage collection that are introduced by
this CL are crashes that could have happened during stack
copying instead. Those are harder to find because stacks are
copied much less often than the garbage collector is invoked.

In service of that goal, remove ARGSIZE macros from
asm_*.s, change switchtoM to have no arguments
(it doesn't have any live arguments), and add
args and locals information to some frames that
can call back into Go.

LGTM=khr
R=khr, rlh
CC=golang-codereviews
https://codereview.appspot.com/137540043
cmd/cc, cmd/gc: stop generating 'argsize' PCDATA

The argsize PCDATA was specifying the number of
bytes passed to a function call, so that if the function
did not specify its argument count, the garbage collector
could use the call site information to scan those bytes
conservatively. We don't do that anymore, so stop
generating the information.

LGTM=khr
R=khr
CC=golang-codereviews
https://codereview.appspot.com/139530043
runtime: fix typo in comment

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/140590043
go/printer: don't reduce nesting depth twice if parentheses are present around an expr

No impact on formatting on our repos.

Fixes issue 8021.

LGTM=adonovan
R=adonovan, dvyukov
CC=golang-codereviews
https://codereview.appspot.com/142020043
runtime: remove a few untyped allocations

LGTM=iant, khr, rlh
R=khr, iant, bradfitz, rlh
CC=dvyukov, golang-codereviews
https://codereview.appspot.com/142030044
cmd/gc: fix racewalk after writebarrier change
Instrument dst argument of writebarrier calls.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://codereview.appspot.com/139560045
runtime: test iteration order of sparse maps

The behavior was fixed in CL 141270043. Add a test.

Fixes issue 8410.

LGTM=khr
R=khr, remyoudompheng
CC=golang-codereviews
https://codereview.appspot.com/137560044
cmd/8g: remove unused variable (fix build)

http://build.golang.org/log/0434a945e3351eedaf56aa824d2bfe9c0d5e6735

LGTM=dave
R=bradfitz, dave
CC=golang-codereviews
https://codereview.appspot.com/144800043
runtime: mark asmcgocall<>(SB) as having no arguments

It doesn't.
Fixes 386 build.

While we're here, mark runtime.asmcgocall as GO_ARGS,
so that it will work with stack copying. I don't think anything
that uses it can lead to a stack copy, but better safe than sorry.
Certainly the runtime.asmcgocall_errno variant needs
(and already has) GO_ARGS.

TBR=iant
CC=golang-codereviews
https://codereview.appspot.com/138400043
runtime: fix traceback of trap on ARM

The merged traceback was wrong for LR machines,
because traceback didn't pass lr to gentraceback.
Now that we have a test looking at traceback output
for a trap (the test of runtime.Breakpoint),
we caught this.

While we're here, fix a 'set and not used' warning.

Fixes arm build.

TBR=r
R=r
CC=golang-codereviews
https://codereview.appspot.com/143040043
image/jpeg: reject invalid Ta and Td values.

Fixes issue 8693.

LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://codereview.appspot.com/141470043
runtime: convert syscall_windows.c to Go

This is necessary because syscall.Syscall blocks, and the
garbage collector needs to be able to scan that frame while
it is blocked, and C frames have no garbage collection
information.

Windows builders are broken now due to this problem:
http://build.golang.org/log/152ca9a4be6783d3a8bf6e2f5b9fc265089728b6

LGTM=alex.brainman
R=alex.brainman
CC=golang-codereviews
https://codereview.appspot.com/144830043
runtime: fix solaris build

CL 144830043 changed LibCall for Windows.
I didn't realize Solaris used it too.

TBR=iant
CC=golang-codereviews
https://codereview.appspot.com/142100043
runtime: fix solaris build, part 2

This file was already assigned to another CL
so it didn't make it into the build fix CL. Sigh.

TBR=iant
CC=golang-codereviews
https://codereview.appspot.com/144850043
syscall: add GO_ARGS to Go-called assembly

Fixes sporadic linux/386 build failure (untyped args)
and probably some others we haven't observed yet.

Fixes issue 8727.

TBR=iant
R=golang-codereviews
CC=bradfitz, golang-codereviews, iant, khr, r
https://codereview.appspot.com/143930043
runtime: fix parameter checking in syscall.NewCallback

I have made mistake while converting it to Go (CL 132820043).
Added test as penance for my sin.

LGTM=rsc
R=golang-codereviews, bradfitz, rsc
CC=golang-codereviews
https://codereview.appspot.com/136560043
net/http: don't call FileSystem.Open with unclean index.html path

Fixes Issue 8722

LGTM=adg
R=adg
CC=golang-codereviews
https://codereview.appspot.com/142090043
cmd/gc: generate type alg after calling dowidth.

Previously it might happen before calling dowidth and
result in a compiler crash.

Fixes issue 8060.

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