1
0
mirror of https://github.com/golang/go synced 2024-09-30 11:28:36 -06:00
Commit Graph

30228 Commits

Author SHA1 Message Date
Russ Cox
ef3a9f2dd4 html/template, text/template: drop defined template list from errors
The report in #17414 points out that if you have many many templates,
then this is an overwhelming list and just hurts the signal-to-noise ratio of the error.

Even the test of the old behavior also supports the idea that this is noise:

	template: empty: "empty" is an incomplete or empty template; defined templates are: "secondary"

The chance that someone mistyped "secondary" as "empty" is slim at best.

Similarly, the compiler does not augment an error like 'unknown variable x'
by dumping the full list of all the known variables.

For all these reasons, drop the list.

Fixes #17414.

Change-Id: I78f92d2c591df7218385fe723a4abc497913acf8
Reviewed-on: https://go-review.googlesource.com/32116
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2016-10-28 17:10:55 +00:00
Russ Cox
54f691d69d runtime: skip TestMemmoveOverflow if mmap of needed page fails
Fixes #16731.

Change-Id: I6d393357973d008ab7cf5fb264acb7d38c9354eb
Reviewed-on: https://go-review.googlesource.com/32104
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-10-28 17:10:39 +00:00
Robert Griesemer
7fd6b925e3 spec: update operator and delimiter section
Follow-up on https://go-review.googlesource.com/30601.

Change-Id: I51b603a6c4877b571e83cd7c4e78a8988cc831ca
Reviewed-on: https://go-review.googlesource.com/32310
Reviewed-by: Rob Pike <r@golang.org>
2016-10-28 17:05:48 +00:00
Josh Chorlton
d86a6ef0c7 net/http: fix cookie Expires minimum year to 1601 instead of Epoch year 1970
Following RFC 6265 Section 5.1.1.5, ensure that the minimum
year for which an Expires value is valid and can be included in
the cookie's string, is 1601 instead of the Epoch year 1970.

A detailed specification for parsing the Expiry field is at:
https://tools.ietf.org/html/rfc6265#section-5.2.1

I stumbled across this bug due to this StackOverflow answer
that recommends setting the Expiry to the Epoch:
http://stackoverflow.com/a/5285982

Fixes #17632

Change-Id: I3c1bdf821d369320334a5dc1e4bf22783cbfe9fc
Reviewed-on: https://go-review.googlesource.com/32142
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-10-28 16:44:44 +00:00
Russ Cox
a8e86d99f1 mime/quotedprintable: accept = not followed by 2 hex digits as literal equals
This lets quotedprintable handle some inputs found in the wild,
most notably generated by "Microsoft CDO for Exchange 2000",
and it also matches how Python's quopri package handles these inputs.

Fixes #13219.

Change-Id: I69d400659d01b6ea0f707b7053d61803a85b4799
Reviewed-on: https://go-review.googlesource.com/32174
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-10-28 16:08:06 +00:00
Jaana Burcu Dogan
864859d209 net/http/httptrace: refer http.Client users to the blog post
Fixes #17152.

Change-Id: I4dd5e505c65f3efe736e46d3781cccf31d7f574f
Reviewed-on: https://go-review.googlesource.com/32117
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-10-28 14:51:29 +00:00
Brad Fitzpatrick
fc2507dbd3 doc: remove mention of Go 1.6.3 working on Sierra
We thought it would at the time, but then Beta 4 changed the ABI
again, so it wasn't true in practice.

Fixes #17643

Change-Id: I36b747bd69a56adc7291fa30d6bffdf67ab8741b
Reviewed-on: https://go-review.googlesource.com/32238
Reviewed-by: Russ Cox <rsc@golang.org>
2016-10-28 14:46:24 +00:00
Austin Clements
6da83c6fc0 runtime, cmd/trace: track goroutines blocked on GC assists
Currently when a goroutine blocks on a GC assist, it emits a generic
EvGoBlock event. Since assist blocking events and, in particular, the
length of the blocked assist queue, are important for diagnosing GC
behavior, this commit adds a new EvGoBlockGC event for blocking on a
GC assist. The trace viewer uses this event to report a "waiting on
GC" count in the "Goroutines" row. This makes sense because, unlike
other blocked goroutines, these goroutines do have work to do, so
being blocked on a GC assist is quite similar to being in the
"runnable" state, which we also report in the trace viewer.

Change-Id: Ic21a326992606b121ea3d3d00110d8d1fdc7a5ef
Reviewed-on: https://go-review.googlesource.com/30704
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
2016-10-28 14:29:47 +00:00
Austin Clements
640e916915 cmd/trace: track each G's state explicitly
Currently the trace tool tracks an overall counts of goroutine states,
but not the states of any individual goroutine. We're about to add
more sophisticated blocked-state tracking, so add this tracking and
base the state counts off the tracked goroutine states.

Change-Id: I943ed61782436cf9540f4ee26c5561715c5b4a1d
Reviewed-on: https://go-review.googlesource.com/30703
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
2016-10-28 14:29:44 +00:00
Austin Clements
6834839427 runtime, cmd/trace: annotate different mark worker types
Currently mark workers are shown in the trace as regular goroutines
labeled "runtime.gcBgMarkWorker". That's somewhat unhelpful to an end
user because of the opaque label and particularly unhelpful to runtime
developers because it doesn't distinguish the different types of mark
workers.

Fix this by introducing a variant of the GoStart event called
GoStartLabel that lets the runtime indicate a label for a goroutine
execution span and using this to label mark worker executions as "GC
(<mode>)" in the trace viewer.

Since this bumps the trace version to 1.8, we also add test data for
1.7 traces.

Change-Id: Id7b9c0536508430c661ffb9e40e436f3901ca121
Reviewed-on: https://go-review.googlesource.com/30702
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
2016-10-28 14:29:40 +00:00
Cherry Zhang
f9238a76ff cmd/compile: make LR allocatable in non-leaf functions on ARM
The mechanism is initially introduced (and reviewed) in CL 30597
on S390X.

Reduce number of "spilled value remains" by 0.4% in cmd/go.

Disabled on ARMv5 because LR is clobbered almost everywhere with
inserted softfloat calls.

Change-Id: I2934737ce2455909647ed2118fe2bd6f0aa5ac52
Reviewed-on: https://go-review.googlesource.com/32178
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2016-10-28 14:25:33 +00:00
Cherry Zhang
4f1ca8b6f9 cmd/internal/obj/mips: materialize float constant 0 from zero register
Materialize float constant 0 from integer zero register, instead
of loading from constant pool.

Change-Id: Ie4728895b9d617bec2a29d15729c0efaa10eedbb
Reviewed-on: https://go-review.googlesource.com/32109
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2016-10-28 14:20:09 +00:00
Carlos Eduardo Seo
0acefdbea0 cmd/asm, cmd/internal/obj/ppc64: Add vector scalar (VSX) registers and instructions
The current implementation for Power architecture does not include the vector
scalar (VSX) registers.  This adds the 63 VSX registers and the most commonly
used instructions: load/store VSX vector/scalar, move to/from VSR, logical
operations, select, merge, splat, permute, shift, FP-FP conversion, FP-integer
conversion and integer-FP conversion.

Change-Id: I0f7572d2359fe7f3ea0124a1eb1b0bebab33649e
Reviewed-on: https://go-review.googlesource.com/30510
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-10-28 13:38:30 +00:00
David Crawshaw
9c02c75639 runtime: pass windows float syscall args via XMM
Based on the calling convention documented in:

	https://msdn.microsoft.com/en-us/library/zthk2dkh.aspx

and long-used in golang.org/x/mobile/gl via some fixup asm:

	https://go.googlesource.com/mobile/+/master/gl/work_windows_amd64.s

Fixes #6510

Change-Id: I97e81baaa2872bcd732b1308915eb66f1ba2168f
Reviewed-on: https://go-review.googlesource.com/32173
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Minux Ma <minux@golang.org>
2016-10-28 13:13:08 +00:00
Austin Clements
dd500193d3 runtime: fix preemption of fractional and idle mark workers
Currently, gcDrain looks for the preemption flag at getg().preempt.
However, commit d6625ca moved mark worker draining to the system
stack, which means getg() returns the g0, which never has the preempt
flag set, so idle and fractional workers don't get preempted after
10ms and just run until they run out of work. As a result, if there's
enough idle time, GC becomes effectively STW.

Fix this by looking for the preemption flag on getg().m.curg, which
will always be the user G (where the preempt flag is set), regardless
of whether gcDrain is running on the user or the g0 stack.

Change-Id: Ib554cf49a705b86ccc3d08940bc869f868c50dd2
Reviewed-on: https://go-review.googlesource.com/32251
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
2016-10-28 13:09:48 +00:00
Peter Weinberger
ca922b6d36 runtime: Profile goroutines holding contended mutexes.
runtime.SetMutexProfileFraction(n int) will capture 1/n-th of stack
traces of goroutines holding contended mutexes if n > 0. From runtime/pprof,
pprot.Lookup("mutex").WriteTo writes the accumulated
stack traces to w (in essentially the same format that blocking
profiling uses).

Change-Id: Ie0b54fa4226853d99aa42c14cb529ae586a8335a
Reviewed-on: https://go-review.googlesource.com/29650
Reviewed-by: Austin Clements <austin@google.com>
2016-10-28 11:47:16 +00:00
Martin Möhrmann
b679665a18 cmd/compile: move stringtoslicebytetmp to the backend
- removes the runtime function stringtoslicebytetmp
- removes the generation of calls to stringtoslicebytetmp from the frontend
- adds handling of OSTRARRAYBYTETMP in the backend

This reduces binary sizes and avoids function call overhead.

Change-Id: Ib9988d48549cee663b685b4897a483f94727b940
Reviewed-on: https://go-review.googlesource.com/32158
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Martin Möhrmann <martisch@uos.de>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-10-28 07:58:47 +00:00
Alex Brainman
f595848e9a runtime/cgo: do not link threads lib by default on windows
I do not know why it is included. All tests pass without it.

Change-Id: I839076ee131816dfd177570a902c69fe8fba5022
Reviewed-on: https://go-review.googlesource.com/32144
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-10-28 04:36:31 +00:00
Josh Bleecher Snyder
79d2115ec9 cmd/compile: eliminate more allocs in newblock
name       old allocs/op    new allocs/op    delta
Template         389k ± 0%        386k ± 0%  -0.84%        (p=0.000 n=10+10)
Unicode          323k ± 0%        323k ± 0%  -0.25%        (p=0.000 n=10+10)
GoTypes         1.17M ± 0%       1.16M ± 0%  -0.93%        (p=0.000 n=10+10)
Compiler        4.13M ± 0%       4.09M ± 0%  -1.05%        (p=0.000 n=10+10)

Change-Id: I6c00850d07511c2e65761c7373fc3df738499105
Reviewed-on: https://go-review.googlesource.com/32235
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-10-28 03:13:35 +00:00
Josh Bleecher Snyder
23d762c129 cmd/compile: combine slice allocations in newblock
name       old allocs/op    new allocs/op    delta
Template         394k ± 0%        391k ± 0%  -0.80%        (p=0.000 n=10+10)
Unicode          350k ± 0%        349k ± 0%  -0.27%        (p=0.000 n=10+10)
GoTypes         1.18M ± 0%       1.17M ± 0%  -0.92%        (p=0.000 n=10+10)
Compiler        4.18M ± 0%       4.14M ± 0%  -1.05%        (p=0.000 n=10+10)


Change-Id: I838a4e2110afe6496c535b9a0ec5aa882d63a707
Reviewed-on: https://go-review.googlesource.com/32223
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-10-28 02:14:16 +00:00
Nigel Tao
caba0bd189 image/png: implement grayscale transparency.
Change-Id: Ib9309ee499fc51be2662d778430ee30089822e57
Reviewed-on: https://go-review.googlesource.com/32143
Reviewed-by: Rob Pike <r@golang.org>
2016-10-28 02:10:13 +00:00
Matthew Dempsky
bba1ac4fd9 cmd/compile: stop adding implicit OKEY nodes
Keys are uncommon in array and slice literals, and normalizing
OARRAYLIT and OSLICELIT nodes to always use OKEY ends up not reducing
complexity much. Instead, only create OKEY nodes to represent explicit
keys, and recalculate implicit keys when/where necessary.

Fixes #15350.

name       old time/op     new time/op     delta
Template       299ms ± 9%      299ms ±12%    ~           (p=0.694 n=28+30)
Unicode        165ms ± 7%      162ms ± 9%    ~           (p=0.084 n=27+27)
GoTypes        950ms ± 9%      963ms ± 5%    ~           (p=0.301 n=30+29)
Compiler       4.23s ± 7%      4.17s ± 7%    ~           (p=0.057 n=29+27)

name       old user-ns/op  new user-ns/op  delta
Template        389M ±15%       400M ±12%    ~           (p=0.202 n=30+29)
Unicode         246M ±21%       232M ±22%  -5.76%        (p=0.006 n=28+29)
GoTypes        1.34G ± 8%      1.34G ± 7%    ~           (p=0.775 n=28+30)
Compiler       5.91G ± 6%      5.87G ± 7%    ~           (p=0.298 n=28+29)

name       old alloc/op    new alloc/op    delta
Template      41.2MB ± 0%     41.2MB ± 0%    ~           (p=0.085 n=30+30)
Unicode       34.0MB ± 0%     31.5MB ± 0%  -7.28%        (p=0.000 n=30+29)
GoTypes        121MB ± 0%      121MB ± 0%    ~           (p=0.657 n=30+30)
Compiler       511MB ± 0%      511MB ± 0%  -0.01%        (p=0.001 n=29+29)

name       old allocs/op   new allocs/op   delta
Template        390k ± 0%       390k ± 0%    ~           (p=0.225 n=30+29)
Unicode         318k ± 0%       293k ± 0%  -8.03%        (p=0.000 n=30+29)
GoTypes        1.16M ± 0%      1.16M ± 0%    ~           (p=0.745 n=30+30)
Compiler       4.35M ± 0%      4.35M ± 0%    ~           (p=0.105 n=30+30)

Change-Id: I6310739a0bfdb54f1ab8a460b2c03615ad1ff5bc
Reviewed-on: https://go-review.googlesource.com/32221
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-10-27 22:55:30 +00:00
Nigel Tao
4951c79363 image/png: implement truecolor transparency.
Change-Id: I99b9a51db29d514ebaa9c1cfde65c0b5184c0f42
Reviewed-on: https://go-review.googlesource.com/32140
Reviewed-by: Rob Pike <r@golang.org>
2016-10-27 22:27:41 +00:00
Cherry Zhang
0dabbcdc43 math/big: flip long/short flag on TestFloat32Distribution
It looks like a typo in CL 30707.

Change-Id: Ia2d013567dbd1a49901d9be0cd2d5a103e6e38cf
Reviewed-on: https://go-review.googlesource.com/32187
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2016-10-27 21:44:37 +00:00
Keith Randall
f357091a6d cmd/compile: combine some extensions with loads
For cases where we already have the ops, combine
sign or zero extension with the previous load
(even if the load is larger width).

Update #15105

Change-Id: I76c5ddd69e1f900d2a17d35503083bd3b4978e48
Reviewed-on: https://go-review.googlesource.com/28190
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2016-10-27 21:31:26 +00:00
Josh Bleecher Snyder
dc5f9311be cmd/compile: eliminate Name.Inlvar
Use a local map during inlining instead.

Change-Id: I10cd19885e7124f812bb04a79dbda52bfebfe1a1
Reviewed-on: https://go-review.googlesource.com/32225
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2016-10-27 21:23:01 +00:00
Keith Randall
ac74225dcc cmd/compile: remove redundant extension after shift
var x uint64
uint8(x >> 56)

We don't need to generate any code for the uint8().

Update #15090

Change-Id: Ie1ca4e32022dccf7f7bc42d531a285521fb67872
Reviewed-on: https://go-review.googlesource.com/28191
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2016-10-27 21:21:59 +00:00
Keith Randall
deb4177cf0 cmd/compile: use masks instead of branches for slicing
When we do

  var x []byte = ...
  y := x[i:]

We can't just use y.ptr = x.ptr + i, as the new pointer may point to the
next object in memory after the backing array.
We used to fix this by doing:

  y.cap = x.cap - i
  delta := i
  if y.cap == 0 {
    delta = 0
  }
  y.ptr = x.ptr + delta

That generates a branch in what is otherwise straight-line code.

Better to do:

  y.cap = x.cap - i
  mask := (y.cap - 1) >> 63 // -1 if y.cap==0, 0 otherwise
  y.ptr = x.ptr + i &^ mask

It's about the same number of instructions (~4, depending on what
parts are constant, and the target architecture), but it is all
inline. It plays nicely with CSE, and the mask can be computed
in parallel with the index (in cases where a multiply is required).

It is a minor win in both speed and space.

Change-Id: Ied60465a0b8abb683c02208402e5bb7ac0e8370f
Reviewed-on: https://go-review.googlesource.com/32022
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2016-10-27 20:22:49 +00:00
Robert Griesemer
50f66fbb66 cmd/compile: disallow "init" as alias
Fixes #17637.

Change-Id: I5af63b8277c0a0f9fef4880992bcb925ca088687
Reviewed-on: https://go-review.googlesource.com/32106
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2016-10-27 20:01:20 +00:00
Robert Griesemer
89632aa183 cmd/compile, go/parser: disallow "type T = p.T" - must use "=>"
I had added this originally so we can play with different notations
but it doesn't make sense to keep it around since gofmt will convert
a type alias declaration using "=" into one using "=>" anyhow. More
importantly, the spec doesn't permit it.

Change-Id: Icb010b5a9976aebf877e48b3ce9d7245559ca494
Reviewed-on: https://go-review.googlesource.com/32105
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2016-10-27 19:24:47 +00:00
Michael Hudson-Doyle
8b07ec20f7 cmd/compile, runtime: make the go.itab.* symbols module-local
Otherwise, the way the ELF dynamic linker works means that you can end up with
the same itab being passed to additab twice, leading to the itab linked list
having a cycle in it. Add a test to additab in runtime to catch this when it
happens, not some arbitrary and surprsing time later.

Fixes #17594

Change-Id: I6c82edcc9ac88ac188d1185370242dc92f46b1ad
Reviewed-on: https://go-review.googlesource.com/32131
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-10-27 19:13:35 +00:00
Adam Langley
aabdb66d89 vendor/golang_org/x/crypto/poly1305: sync to 1150b8bd09e53aea1d415621adae9bad665061a1
This change updates the vendored version of the poly1305 package to
match the latest version from x/crypto. This pulls in this change:

  commit 1150b8bd09e53aea1d415621adae9bad665061a1
  Author: Adam Langley <agl@golang.org>
  Date:   Fri Oct 21 15:59:10 2016 -0700

      poly1305: don't move R13 in sum_arm.s.

      Rather than change the value of R13 during the execution, keep R13 fixed
      (after the initial prelude) and always use offsets from it.

      This should help the runtime figure out what's going on if, say, a
      signal should occur while running this code.

      I've also trimmed the set of saved registers since Go doesn't require
      the callee to maintain anything except R10 and R13.

      Change-Id: Ifbeca73c1d964cc43bb7f8c20c61066f22fd562d
      Reviewed-on: https://go-review.googlesource.com/31717
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: Cherry Zhang <cherryyz@google.com>

Change-Id: I376b3e5d53aaded891e02801bd5faa5ff758da0d
Reviewed-on: https://go-review.googlesource.com/32227
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-10-27 18:03:11 +00:00
Russ Cox
c01c1d4215 net: add examples to Addr definition
Fixes #16014.

Change-Id: I68b096df7924a3258e940c4d94ec5d06f5bdfcbb
Reviewed-on: https://go-review.googlesource.com/32097
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-10-27 17:55:58 +00:00
Russ Cox
eac5950819 mime: preserve unnecessary backslash escapes as literals
When MSIE sends a full file path (in "intranet mode"), it does not
escape backslashes: "C:\dev\go\foo.txt", not "C:\\dev\\go\\foo.txt".

No known MIME generators emit unnecessary backslash escapes
for simple token characters like numbers and letters.

If we see an unnecessary backslash escape, assume it is from MSIE
and intended as a literal backslash. This makes Go servers deal better
with MSIE without affecting the way they handle conforming MIME
generators.

Fixes #15664.

Change-Id: Ia3b03b978317d968dc11b2f6de1df913c6bcbfcc
Reviewed-on: https://go-review.googlesource.com/32175
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-10-27 17:54:59 +00:00
Russ Cox
2bafbe11b1 net/mail: allow empty quoted string name in address again
CL 12905 disallowed "Bob" <""@example.com> but inadvertently
also disallowed "" <bob@example.com>. Move the empty string
check to apply only in the addr-spec.

Fixes #14866.

Change-Id: Ia0b7a1a32810aa78157ae77bd0130b78154c460d
Reviewed-on: https://go-review.googlesource.com/32176
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-10-27 17:54:39 +00:00
Brad Fitzpatrick
07e72666ec net/http: update bundled http2
Updates http2 to x/net git rev b626cca for:

    http2: implement support for server push
    https://golang.org/cl/29439

    http2: reject stream self-dependencies
    https://golang.org/cl/31858

    http2: optimize server frame writes
    https://golang.org/cl/31495

    http2: interface to support pluggable schedulers
    https://golang.org/cl/25366
    (no user-visible behavior change or API surface)

    http2: add Server.IdleTimeout
    https://golang.org/cl/31727

    http2: make Server return conn protocol errors on bad idle stream frames
    https://golang.org/cl/31736

    http2: fix optimized write scheduling
    https://golang.org/cl/32217 (fix for CL 31495 above)

Change-Id: Ie894c72943d355115c8391573bf6b96dc1bd5894
Reviewed-on: https://go-review.googlesource.com/32215
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tom Bergan <tombergan@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-10-27 17:53:54 +00:00
Russ Cox
5594074dcd runtime: use clock_gettime(CLOCK_REALTIME) for nanosecond-precision time.now on arm64, mips64x
Assembly copied from the clock_gettime(CLOCK_MONOTONIC)
call in runtime.nanotime in these files and then modified to use
CLOCK_REALTIME.

Also comment system call numbers in a few other files.

Fixes #11222.

Change-Id: Ie132086de7386f865908183aac2713f90fc73e0d
Reviewed-on: https://go-review.googlesource.com/32177
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2016-10-27 17:53:13 +00:00
Robert Griesemer
aff37662d1 spec: add new language for alias declarations
For #16339.

Change-Id: I7d912ea634bbfacfc0217f97dccb270fde06f16b
Reviewed-on: https://go-review.googlesource.com/30601
Reviewed-by: Russ Cox <rsc@golang.org>
2016-10-27 17:48:02 +00:00
Russ Cox
09692182fa runtime: print sigcode on signal crash
For #17496.

Change-Id: I671a59581c54d17bc272767eeb7b2742b54eca38
Reviewed-on: https://go-review.googlesource.com/32183
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-10-27 17:46:01 +00:00
Robert Griesemer
03d81b5ed9 cmd/compile: import/export of alias declarations
This CL completes support for alias declarations in the compiler.

Also:
- increased export format version
- updated various comments

For #16339.
Fixes #17487.

Change-Id: Ic6945fc44c0041771eaf9dcfe973f601d14de069
Reviewed-on: https://go-review.googlesource.com/32090
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2016-10-27 17:44:45 +00:00
Adam Langley
81038d2e2b crypto/tls: add GetClientCertificate callback
Currently, the selection of a client certificate done internally based
on the limitations given by the server's request and the certifcates in
the Config. This means that it's not possible for an application to
control that selection based on details of the request.

This change adds a callback, GetClientCertificate, that is called by a
Client during the handshake and which allows applications to select the
best certificate at that time.

(Based on https://golang.org/cl/25570/ by Bernd Fix.)

Fixes #16626.

Change-Id: Ia4cea03235d2aa3c9fd49c99c227593c8e86ddd9
Reviewed-on: https://go-review.googlesource.com/32115
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-10-27 17:20:07 +00:00
Russ Cox
6c242c52d3 net/rpc: fix method requirement docs
The receiver itself is not transmitted and does not need to be
marshalable by encoding/gob.

Fixes #16803.

Change-Id: I42a3603fb7d3b36c97dcc2e51a398cd65ec3227d
Reviewed-on: https://go-review.googlesource.com/32094
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2016-10-27 17:12:12 +00:00
Adam Langley
ec18e93ecd crypto/tls: add a SignatureScheme type.
The SignatureAndHashAlgorithm from TLS 1.2[1] is being changed to
SignatureScheme in TLS 1.3[2]. (The actual values are compatible
however.)

Since we expect to support TLS 1.3 in the future, we're already using
the name and style of SignatureScheme in the recently augmented
ClientHelloInfo. As this is public API, it seems that SignatureScheme
should have its own type and exported values, which is implemented in
this change.

[1] https://tools.ietf.org/html/rfc5246#section-7.4.1.4.1
[2] https://tools.ietf.org/html/draft-ietf-tls-tls13-18#section-4.2.3

Change-Id: I0482755d02bb9a04eaf075c012696103eb806645
Reviewed-on: https://go-review.googlesource.com/32119
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-10-27 17:11:04 +00:00
Adam Langley
07a31bc3da crypto/x509: don't accept a root that already appears in a chain.
Since a root certificate is self-signed, it's a valid child of itself.
If a root certificate appeared both in the pool of intermediates and
roots the verification code could find a chain which included it twice:
first as an intermediate and then as a root. (Existing checks prevented
the code from looping any more.)

This change stops the exact same certificate from appearing twice in a
chain. This simplifies the results in the face of the common
configuration error of a TLS server returning a root certificate.

(This should also stop two different versions of the “same” root
appearing in a chain because the self-signature on one will not validate
for the other.)

Fixes #16800.

Change-Id: I004853baa0eea27b44d47b9b34f96113a92ebac8
Reviewed-on: https://go-review.googlesource.com/32121
Run-TryBot: Adam Langley <agl@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-10-27 17:10:53 +00:00
Keith Randall
a047b6bf7d cmd/compile: emit assignments after calls in the right order
Fixes a bug where assignments that should come after a call
were instead being issued before the call.

Fixes #17596
Fixes #17618

Change-Id: Ic9ae4c34ae38fc4ccd0604b65345b05896a2c295
Reviewed-on: https://go-review.googlesource.com/32226
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
2016-10-27 16:52:30 +00:00
Josh Bleecher Snyder
dc53ea7772 cmd/compile: change Func.FCurfn to IsHiddenClosure
IsHiddenClosure is more descriptive.

Change-Id: I06651072925a958b148b64ab0db3a9bfc839af9b
Reviewed-on: https://go-review.googlesource.com/32224
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2016-10-27 16:37:33 +00:00
Cherry Zhang
4f6d479186 cmd/compile: make LR allocatable in non-leaf functions on MIPS64
The mechanism is initially introduced (and reviewed) in CL 30597
on S390X.

Change-Id: I83024d2fc84c8efc23fbda52b3ad83073f42cb93
Reviewed-on: https://go-review.googlesource.com/32179
Reviewed-by: David Chase <drchase@google.com>
2016-10-27 15:35:20 +00:00
Cherry Zhang
5c59cb4aa3 cmd/compile: make LR allocatable in non-leaf functions on ARM64
The mechanism is initially introduced (and reviewed) in CL 30597
on S390X.

Change-Id: I12fbe6e9269b2936690e0ec896cb6b5aa40ad7da
Reviewed-on: https://go-review.googlesource.com/32180
Reviewed-by: David Chase <drchase@google.com>
2016-10-27 15:35:06 +00:00
Cherry Zhang
c69dd3f054 cmd/compile: enable DUFFZERO in defframe on MIPS64
DUFFZERO was disabled due to issue #12108. CL 27592 fixed it and
enabled DUFFZERO in general, but this one was forgotten.

Change-Id: I0476a3a0524c7b54218f7a747bdba76cd823fbc5
Reviewed-on: https://go-review.googlesource.com/32181
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2016-10-27 15:34:45 +00:00
Vladimir Stefanovic
4c182045ff cmd/objdump: skip tests for GOARCH=mips{,le}
Change-Id: I8111ceb6960364166aa8a445f4d6d8b0581d371e
Reviewed-on: https://go-review.googlesource.com/31513
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2016-10-27 14:56:06 +00:00