When reading Go files, read through import block.
When reading non-Go files, read only leading comments.
R=nigeltao, adg, r
CC=golang-dev
https://golang.org/cl/6493068
instead of variables. Several reasons:
- Encourage users of the API to minimize the number of creations and reuse Collate objects.
- Don't rule out the possibility of using initialization code for collators. For some locales
it will be possible to have very compact representations that can be quickly expanded
into a proper table on demand.
Other changes:
- Change name of root* vars to main*, as the tables are shared between locales.
- Added Locales() method to get a list of supported locales.
R=r
CC=golang-dev
https://golang.org/cl/6498107
X509KeyPair wasn't really supposed to allow the certificate and
key to be in the same file, but it did work if you put the key
first. Since some HTTPS servers support loading keys and certs
like this, this change makes it work in either order.
Fixes#3986.
R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/6499103
This is the easy part of issue 3528.
(What to do about "noescape" is the hard part, left open.)
Update #3528.
R=mikesamuel, r, dsymonds
CC=golang-dev
https://golang.org/cl/6493113
Right now we only have 32-bit ints so that's a no-op.
Took the opportunity to check for some other invalid values too.
Suggestions for additions or modifications welcome.
R=agl
CC=golang-dev
https://golang.org/cl/6493112
This fixes a problem with ELF tools thinking they know the
format of the symbol table, as we do not use any of the
standard formats for that table.
This change will probably annoy the Plan 9 users, but I
believe there are other incompatibilities already that mean
they have to use a Go-specific nm.
Fixes#3473.
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/6500117
go tool dist env -w is supposed to print a Windows batch file.
Normally Windows will execute batch files without \r before \n,
but issue 3060 reports that if the file ends up containing paths
written in Chinese, Windows 7 cannot execute it without the \r.
So add the \r.
Fixes#3060.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6498120
SO_PEERCRED on unix domain socket will fill a Ucred struct,
thus linux needs a custom Getsockopt variant.
Fixes#3836.
R=golang-dev, rsc, iant
CC=golang-dev
https://golang.org/cl/6445104
Rename the first argument of CompareAndSwapT and AddT s/val/addr/
for consistency with LoadT and StoreT.
R=rsc, r, dvyukov
CC=golang-dev
https://golang.org/cl/6494112
It is enough to load directly the data word and the itab word
from memory, so we save a LEA instruction for each method call,
and allow elimination of some extra temporaries.
Update #1914.
R=daniel.morsing, rsc
CC=golang-dev, remy
https://golang.org/cl/6501110
Removes an extra LEAL/LEAQ instructions there and usually saves
a useless temporary in the idiom
if err := foo(); err != nil {...}
Generated code is also less involved:
MOVQ err+n(SP), AX
CMPQ AX, $0
(potentially CMPQ n(SP), $0) instead of
LEAQ err+n(SP), AX
CMPQ (AX), $0
Update #1914.
R=daniel.morsing, nigeltao, rsc
CC=golang-dev, remy
https://golang.org/cl/6493099
This verifies existing behavior. Some replacements are arguably wrong
(these are marked with TODO) but changing behavior is left for a
follow-up CL.
Also fix that BenchmarkGenericMatch wasn't actually matching anything.
R=rsc, eric.d.eisner
CC=bradfitz, golang-dev
https://golang.org/cl/6488110
First set of type checker files for review.
The primary concern here is the typechecker
API (types.go).
R=rsc, adonovan, r, rogpeppe
CC=golang-dev
https://golang.org/cl/6490089
Broke tests on 386.
««« original CL description
6l/8l: emit correct opcodes to F(SUB|DIV)R?D.
When the destination was not F0, 6l and 8l swapped FSUBD/FSUBRD and
FDIVD/FDIVRD.
R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/6498092
»»»
R=golang-dev
CC=golang-dev
https://golang.org/cl/6492100
Also, clear Content-Type and Content-Length on Not Modified
responses before server.go strips them and spams the logs with
warnings.
R=rsc
CC=golang-dev
https://golang.org/cl/6503090
Refactored build + buildTrie into build + buildOrdering.
Note that since the tailoring code is not checked in yet, all tailorings are identical
to root. The table therefore should not and does not grow at this point.
R=r
CC=golang-dev
https://golang.org/cl/6500087
The main case where it happens is when evaluating &s[i] without
bounds checking, which usually happens during range loops (i=0).
This allows registerization of the corresponding variables,
saving 16 bytes of stack frame for each such range loop and a
LEAQ instruction.
R=golang-dev, rsc, dave
CC=golang-dev, remy
https://golang.org/cl/6497073