]> Cypherpunks repositories - gostls13.git/log
gostls13.git
12 years agofaq: go does not have duck typing
Rob Pike [Fri, 7 Sep 2012 21:01:02 +0000 (14:01 -0700)]
faq: go does not have duck typing

R=golang-dev, 0xjnml, iant, adonovan, aram
CC=golang-dev
https://golang.org/cl/6500092

12 years agogo/scanner: skip first character if it's a BOM
Robert Griesemer [Fri, 7 Sep 2012 20:56:31 +0000 (13:56 -0700)]
go/scanner: skip first character if it's a BOM

R=r
CC=golang-dev
https://golang.org/cl/6490095

12 years agofaq: mercurial vs. git
Rob Pike [Fri, 7 Sep 2012 18:19:01 +0000 (11:19 -0700)]
faq: mercurial vs. git
Fixes #4052.

R=golang-dev, bradfitz, iant, rsc
CC=golang-dev
https://golang.org/cl/6490092

12 years agosyscall: Test SCM credentials on Linux.
Albert Strasheim [Fri, 7 Sep 2012 17:31:17 +0000 (10:31 -0700)]
syscall: Test SCM credentials on Linux.

This test was previously removed in 087c6e15702e.

R=bradfitz, rsc, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/6506061

12 years agospec: an initial BOM can be ignored
Rob Pike [Fri, 7 Sep 2012 17:28:24 +0000 (10:28 -0700)]
spec: an initial BOM can be ignored
After further deliberation, let's back down to the Unicode proposal.
Ignoring aBOMinations anywhere means that things like
        grep unsafe *.go
might fail because there's a BOM in the middle: unBOMsafe.

R=golang-dev, rsc, 0xjnml, gri, bradfitz
CC=golang-dev
https://golang.org/cl/6490091

12 years agonet,mime: Minor corrections to documentation comments.
Lucio De Re [Fri, 7 Sep 2012 17:24:55 +0000 (10:24 -0700)]
net,mime: Minor corrections to documentation comments.

R=r
CC=dsymonds, gobot, golang-dev
https://golang.org/cl/6495085

12 years agocmd/yacc: allow leading underscore in token name
Rob Pike [Fri, 7 Sep 2012 16:31:51 +0000 (09:31 -0700)]
cmd/yacc: allow leading underscore in token name
Fixes #4037.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6488093

12 years agofaq: another way to solve the closure/variable/range complaint
Rob Pike [Fri, 7 Sep 2012 16:11:39 +0000 (09:11 -0700)]
faq: another way to solve the closure/variable/range complaint
It's easier just to declare a new variable.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6501103

12 years agocmd/6g: avoid taking the address of slices unnecessarily.
Rémy Oudompheng [Fri, 7 Sep 2012 04:54:42 +0000 (06:54 +0200)]
cmd/6g: avoid taking the address of slices unnecessarily.

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

12 years agoruntime: arm: abort if hardware floating point missing
Dave Cheney [Fri, 7 Sep 2012 04:26:42 +0000 (14:26 +1000)]
runtime: arm: abort if hardware floating point missing

Fixes #3911.

Requires CL 6449127.

dfc@qnap:~$ ./runtime.test
runtime: this CPU has no floating point hardware, so it cannot run
this GOARM=7 binary. Recompile using GOARM=5.

R=rsc, minux.ma
CC=golang-dev
https://golang.org/cl/6442109

12 years agocgo: use debug data section for ELF
Joel Sing [Fri, 7 Sep 2012 03:32:40 +0000 (13:32 +1000)]
cgo: use debug data section for ELF

When generating enums use the debug data section instead of the
DWARF debug info, if it is available in the ELF file. This allows
mkerrors.sh to work correctly on OpenBSD/386 and NetBSD/386.

Fixes #2470.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/6495090

12 years agocmd/yacc: always import fmt, safely
Rob Pike [Thu, 6 Sep 2012 21:58:37 +0000 (14:58 -0700)]
cmd/yacc: always import fmt, safely
The parser depends on it but the client might not import it, so make sure it's there.
Fixes #4038.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6497094

12 years agospec: ignore BOMS outside of string and rune literals.
Rob Pike [Thu, 6 Sep 2012 17:37:13 +0000 (10:37 -0700)]
spec: ignore BOMS outside of string and rune literals.
Happy Birthday UTF-8.

R=golang-dev, rsc, 0xjnml
CC=golang-dev
https://golang.org/cl/6506083

12 years agosyscall: regenerate/update netbsd z-files
Joel Sing [Thu, 6 Sep 2012 16:13:14 +0000 (02:13 +1000)]
syscall: regenerate/update netbsd z-files

Regenerate/update netbsd z-files on NetBSD 6.0 RC1.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6506062

12 years agocrypto/tls: fix data race on conn.err
Dave Cheney [Thu, 6 Sep 2012 07:50:26 +0000 (17:50 +1000)]
crypto/tls: fix data race on conn.err

Fixes #3862.

There were many areas where conn.err was being accessed
outside the mutex. This proposal moves the err value to
an embedded struct to make it more obvious when the error
value is being accessed.

As there are no Benchmark tests in this package I cannot
feel confident of the impact of this additional locking,
although most will be uncontended.

R=dvyukov, agl
CC=golang-dev
https://golang.org/cl/6497070

12 years agoC: add Manu Garg (Google CLA)
Andrew Gerrand [Thu, 6 Sep 2012 05:02:42 +0000 (15:02 +1000)]
C: add Manu Garg (Google CLA)

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/6493087

12 years agoexp/locale/collate/build: moved some of the code to the appropriate file, as
Marcel van Lohuizen [Thu, 6 Sep 2012 04:16:02 +0000 (13:16 +0900)]
exp/locale/collate/build: moved some of the code to the appropriate file, as
promised in CL 13985.

R=r
CC=golang-dev
https://golang.org/cl/6503071

12 years agoimage/jpeg: fix quantization tables to be in zig-zag order, not natural
Nigel Tao [Thu, 6 Sep 2012 01:10:47 +0000 (11:10 +1000)]
image/jpeg: fix quantization tables to be in zig-zag order, not natural
order.

JPEG images generated prior to this CL are still valid JPEGs, as the
quantization tables used are encoded in the wire format. Such JPEGs just
don't use the recommended quantization tables.

R=r, dsymonds, raph, adg
CC=golang-dev, tuom.larsen
https://golang.org/cl/6497083

12 years agocmd/gc: re-order some OFOO constants. Rename ORRC to ORROTC to be
Nigel Tao [Thu, 6 Sep 2012 00:47:25 +0000 (10:47 +1000)]
cmd/gc: re-order some OFOO constants. Rename ORRC to ORROTC to be
consistent with OLROT. Delete unused OBAD, OLRC.

R=rsc, dave
CC=golang-dev
https://golang.org/cl/6489082

12 years agoreflect: faster FieldByName, FieldByNameFunc
Russ Cox [Wed, 5 Sep 2012 13:35:53 +0000 (09:35 -0400)]
reflect: faster FieldByName, FieldByNameFunc

The old code was a depth first graph traversal that could, under the
right conditions, end up re-exploring the same subgraphs multiple
times, once for each way to arrive at that subgraph at a given depth.

The new code uses a breadth first search to make sure that it only
visits each reachable embedded struct once.

Also add fast path for the trivial case.

benchmark                old ns/op    new ns/op    delta
BenchmarkFieldByName1         1321          187  -85.84%
BenchmarkFieldByName2         6118         5186  -15.23%
BenchmarkFieldByName3      8218553        42112  -99.49%

R=gri, r
CC=golang-dev
https://golang.org/cl/6458090

12 years agodoc/go_spec: fix a typo
Oling Cat [Wed, 5 Sep 2012 04:53:13 +0000 (14:53 +1000)]
doc/go_spec: fix a typo

R=nigeltao
CC=golang-dev
https://golang.org/cl/6499075

12 years agoA+C: Oling Cat (individual CLA)
Nigel Tao [Wed, 5 Sep 2012 04:52:12 +0000 (14:52 +1000)]
A+C: Oling Cat (individual CLA)

R=dsymonds
CC=golang-dev
https://golang.org/cl/6503070

12 years agocmd/gc: add commentary to the OXXX constants.
Nigel Tao [Tue, 4 Sep 2012 23:34:52 +0000 (09:34 +1000)]
cmd/gc: add commentary to the OXXX constants.

R=rsc, daniel.morsing
CC=golang-dev
https://golang.org/cl/6495074

12 years agoruntime: fix typo in openbsd-only symbol name.
Alan Donovan [Tue, 4 Sep 2012 20:35:05 +0000 (16:35 -0400)]
runtime: fix typo in openbsd-only symbol name.

R=golang-dev, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/6490076

12 years agonet: fix {FileConn, FileListener, FilePacketConn} fd leak to child process.
Sébastien Paolacci [Tue, 4 Sep 2012 19:37:23 +0000 (12:37 -0700)]
net: fix {FileConn, FileListener, FilePacketConn} fd leak to child process.

All of them call `newFileFD' which must properly restore close-on-exec on
duplicated fds.

R=golang-dev, bradfitz, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/6445081

12 years agoruntime: discard SIGPROF delivered to non-Go threads.
Alan Donovan [Tue, 4 Sep 2012 18:40:49 +0000 (14:40 -0400)]
runtime: discard SIGPROF delivered to non-Go threads.

Signal handlers are global resources but many language
environments (Go, C++ at Google, etc) assume they have sole
ownership of a particular handler.  Signal handlers in
mixed-language applications must therefore be robust against
unexpected delivery of certain signals, such as SIGPROF.

The default Go signal handler runtime·sigtramp assumes that it
will never be called on a non-Go thread, but this assumption
is violated by when linking in C++ code that spawns threads.
Specifically, the handler asserts the thread has an associated
"m" (Go scheduler).

This CL is a very simple workaround: discard SIGPROF delivered to non-Go threads.  runtime.badsignal(int32) now receives the signal number; if it returns without panicking (e.g. sig==SIGPROF) the signal is discarded.

I don't think there is any really satisfactory solution to the
problem of signal-based profiling in a mixed-language
application.  It's not only the issue of handler clobbering,
but also that a C++ SIGPROF handler called in a Go thread
can't unwind the Go stack (and vice versa).  The best we can
hope for is not crashing.

Note:
- I've ported this to all POSIX platforms, except ARM-linux which already ignores unexpected signals on m-less threads.
- I've avoided tail-calling runtime.badsignal because AFAICT the 6a/6l don't support it.
- I've avoided hoisting 'push sig' (common to both function calls) because it makes the code harder to read.
- Fixed an (apparently incorrect?) docstring.

R=iant, rsc, minux.ma
CC=golang-dev
https://golang.org/cl/6498057

12 years agoruntime/pprof: emit end-of-log marker at end of CPU profile.
Alan Donovan [Tue, 4 Sep 2012 18:34:03 +0000 (14:34 -0400)]
runtime/pprof: emit end-of-log marker at end of CPU profile.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6489065

12 years ago doc: fix typo in Concurrency Patterns article
Andrew Gerrand [Tue, 4 Sep 2012 05:28:09 +0000 (15:28 +1000)]
  doc: fix typo in Concurrency Patterns article

Fixes #3178.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/6506064

12 years ago doc: link to references from docs page
Andrew Gerrand [Tue, 4 Sep 2012 05:26:51 +0000 (15:26 +1000)]
  doc: link to references from docs page

Fixes #3667.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/6492078

12 years agonet/http/pprof: updated documentation (run an http server)
Patrick Crosby [Tue, 4 Sep 2012 01:27:20 +0000 (11:27 +1000)]
net/http/pprof: updated documentation (run an http server)

Added instructions for starting an http server
to the godoc header for this package.  With the old
instructions, the example "go tool pprof..." commands
wouldn't work unless you happen to be running an http
server on port 6060 in your application.

R=golang-dev, minux.ma, adg, giacomo.tartari
CC=golang-dev
https://golang.org/cl/6483049

12 years agoruntime: increase stack frame during cgo call on windows/amd64
Alex Brainman [Mon, 3 Sep 2012 02:12:51 +0000 (12:12 +1000)]
runtime: increase stack frame during cgo call on windows/amd64

Fixes #3945.

R=golang-dev, minux.ma
CC=golang-dev, vcc.163
https://golang.org/cl/6490056

12 years agorun.bat: do not run misc\cgo\stdio test on windows (fix build)
Alex Brainman [Mon, 3 Sep 2012 00:33:48 +0000 (10:33 +1000)]
run.bat: do not run misc\cgo\stdio test on windows (fix build)

It is enabled by mistake and should be part of CL 5847068 instead.

R=golang-dev
CC=golang-dev, minux.ma
https://golang.org/cl/6488073

12 years agocmd/5l: embed $GOARM value into binary as runtime.goarm
Shenghou Ma [Sun, 2 Sep 2012 19:51:13 +0000 (03:51 +0800)]
cmd/5l: embed $GOARM value into binary as runtime.goarm

R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/6449127

12 years agodoc/progs: use test/run.go for testing on Windows
Shenghou Ma [Sun, 2 Sep 2012 19:49:03 +0000 (03:49 +0800)]
doc/progs: use test/run.go for testing on Windows
        cgo[1-4].go, go1.go couldn't be tested now
(cgo[1-4].go can only be tested when cgo is enabled, go1.go
contain a list of filenames in the current directory)

R=golang-dev, alex.brainman, rsc
CC=golang-dev
https://golang.org/cl/6218048

12 years agocmd/gc: fix PkgPath of byte, rune types
Russ Cox [Sat, 1 Sep 2012 23:55:55 +0000 (19:55 -0400)]
cmd/gc: fix PkgPath of byte, rune types

Fixes #3853.

R=ken2
CC=golang-dev
https://golang.org/cl/6492071

12 years agocodereview.py: correct error handling without decorator
Uriel Mangado [Sat, 1 Sep 2012 23:55:29 +0000 (19:55 -0400)]
codereview.py: correct error handling without decorator

The decorator hides the number of function arguments from Mercurial,
so Mercurial cannot give proper error messages about commands
invoked with the wrong number of arguments.

Left a 'dummy' hgcommand decorator in place as a way to document
what functions are hg commands, and just in case we need some other
kind of hack in the future.

R=adg, rsc
CC=golang-dev
https://golang.org/cl/6488059

12 years agoA+C: add Uriel Mangado (individual CLA)
Russ Cox [Sat, 1 Sep 2012 23:55:03 +0000 (19:55 -0400)]
A+C: add Uriel Mangado (individual CLA)

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6492070

12 years agocmd/ld: support zero-filled section for Mach-O files
Shenghou Ma [Sat, 1 Sep 2012 20:50:58 +0000 (04:50 +0800)]
cmd/ld: support zero-filled section for Mach-O files

R=golang-dev, r, dave, rsc
CC=golang-dev
https://golang.org/cl/6492069

12 years agocmd/gc: Suggest *T in error for x.(T) if it would work.
Daniel Morsing [Sat, 1 Sep 2012 17:52:55 +0000 (13:52 -0400)]
cmd/gc: Suggest *T in error for x.(T) if it would work.

Accomplished by synchronizing the formatting of conversion errors between typecheck.c and subr.c

Fixes #3984.

R=golang-dev, remyoudompheng, rsc
CC=golang-dev
https://golang.org/cl/6500064

12 years agocmd/6g, cmd/8g: eliminate short integer arithmetic when possible.
Rémy Oudompheng [Sat, 1 Sep 2012 14:40:54 +0000 (16:40 +0200)]
cmd/6g, cmd/8g: eliminate short integer arithmetic when possible.

Fixes #3909.
Fixes #3910.

R=rsc, nigeltao
CC=golang-dev
https://golang.org/cl/6442114

12 years agocmd/go: be clear that import loops are bad
Russ Cox [Sat, 1 Sep 2012 14:34:58 +0000 (10:34 -0400)]
cmd/go: be clear that import loops are bad

There was mail on golang-nuts a few weeks ago
from someone who understood the message perfectly
and knew he had a cyclic dependency but assumed
that Go, like Python or Java, was supposed to handle it.

R=golang-dev, bradfitz, dave
CC=golang-dev
https://golang.org/cl/6488069

12 years agostrconv: faster FormatFloat for fixed number of digits.
Rémy Oudompheng [Sat, 1 Sep 2012 14:31:46 +0000 (16:31 +0200)]
strconv: faster FormatFloat for fixed number of digits.

The performance improvement applies to the case where
prec >= 0 and fmt is 'e' or 'g'.

Additional minor optimisations are included. A small
performance impact happens in some cases due to code
refactoring.

benchmark                              old ns/op    new ns/op    delta
BenchmarkAppendFloat64Fixed1                 623          235  -62.28%
BenchmarkAppendFloat64Fixed2                1050          272  -74.10%
BenchmarkAppendFloat64Fixed3                3723          243  -93.47%
BenchmarkAppendFloat64Fixed4               10285          274  -97.34%

BenchmarkAppendFloatDecimal                  190          206   +8.42%
BenchmarkAppendFloat                         387          377   -2.58%
BenchmarkAppendFloatExp                      397          339  -14.61%
BenchmarkAppendFloatNegExp                   377          336  -10.88%
BenchmarkAppendFloatBig                      546          482  -11.72%

BenchmarkAppendFloat32Integer                188          204   +8.51%
BenchmarkAppendFloat32ExactFraction          329          298   -9.42%
BenchmarkAppendFloat32Point                  400          372   -7.00%
BenchmarkAppendFloat32Exp                    369          306  -17.07%
BenchmarkAppendFloat32NegExp                 372          305  -18.01%

R=golang-dev, rsc
CC=golang-dev, remy
https://golang.org/cl/6462049

12 years agoexp/locale/collate: Added functionality to parse and process LDML files
Marcel van Lohuizen [Sat, 1 Sep 2012 12:15:00 +0000 (14:15 +0200)]
exp/locale/collate: Added functionality to parse and process LDML files
for both locale-specific exemplar characters and tailorings to
the collation table.
Some specifices:
- Moved stringSet to the beginning of the file and added some functionality
  to parse command line files.
- openReader now modifies the input URL for localFiles to guarantee that
  any http source listed in the generated file is indeed this source.
- Note that the implementation of the Tailoring API used by maketables.go
  is not yet checked in. So for now adding tailorings are simply no-ops.
- The generated file of exemplar characters will be used somewhere else.
  Here is a snippet of how the body of the generated file looks like:

type exemplarType int
const (
        exCharacters exemplarType = iota
        exContractions
        exPunctuation
        exAuxiliary
        exCurrency
        exIndex
        exN
)

var exemplarCharacters = map[string][exN]string{
        "af": [exN]string{
                0: "a á â b c d e é è ê ë f g h i î ï j k l m n o ô ö p q r s t u û v w x y z",
                3: "á à â ä ã æ ç é è ê ë í ì î ï ó ò ô ö ú ù û ü ý",
                4: "a b c d e f g h i j k l m n o p q r s t u v w x y z",
        },
        ...
}

R=r
CC=golang-dev
https://golang.org/cl/6501070

12 years agoexp/locale/collate: first changes that introduce implementation of tailorings:
Marcel van Lohuizen [Sat, 1 Sep 2012 12:13:37 +0000 (14:13 +0200)]
exp/locale/collate: first changes that introduce implementation of tailorings:
- Elements in the array are now sorted as a linked list.  This makes it easier to
  apply tailorings.
- Added code to sort entries by collation elements.
- Added logical reset points.  This is used for tailoring relative to certain
  properties, rather than characters.

NOTE: all code for type entry should now be in order.go.  To keep the diffs for
this CL reasonable, though, the existing code is left in builder.go.  I'll move
this in a separate CL.

R=r
CC=golang-dev
https://golang.org/cl/6493063

12 years agosyscall: add PtraceSyscall(pid int, signal int)
Dave Cheney [Fri, 31 Aug 2012 23:17:14 +0000 (09:17 +1000)]
syscall: add PtraceSyscall(pid int, signal int)

Fixes #3525.

PTRACE_SYSCALL behaves like PTRACE_CONT and can deliver
a signal to the process. Ideally PtraceSingleStep should
support the signal argument, but its interface is frozen
by Go1.

R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/6353051

12 years agoA+C: 0/2 on spelling email addresses correctly
Russ Cox [Fri, 31 Aug 2012 22:10:40 +0000 (18:10 -0400)]
A+C: 0/2 on spelling email addresses correctly

TBR=r
CC=golang-dev
https://golang.org/cl/6497067

12 years agonet/http: added ParseTime function.
Patrick Higgins [Fri, 31 Aug 2012 22:10:16 +0000 (18:10 -0400)]
net/http: added ParseTime function.

Parses a time header value into a time.Time according to rfc2616 sec 3.3.

R=golang-dev, dave, rsc, r
CC=bradfitz, golang-dev
https://golang.org/cl/6344046

12 years agoencoding/xml: parse comments in DOCTYPE
Shawn Smith [Fri, 31 Aug 2012 22:09:31 +0000 (18:09 -0400)]
encoding/xml: parse comments in DOCTYPE

R=rsc, n13m3y3r
CC=golang-dev
https://golang.org/cl/6330061

12 years agoA+C: Patrick Higgins, Shawn Smith (individual CLA)
Russ Cox [Fri, 31 Aug 2012 22:07:32 +0000 (18:07 -0400)]
A+C: Patrick Higgins, Shawn Smith (individual CLA)

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6492067

12 years agoruntime: add vdso support for linux/amd64. Fixes issue 1933.
Ivan Krasin [Fri, 31 Aug 2012 22:07:04 +0000 (18:07 -0400)]
runtime: add vdso support for linux/amd64. Fixes issue 1933.

R=iant, imkrasin, krasin, iant, minux.ma, rsc, nigeltao, r, fullung
CC=golang-dev
https://golang.org/cl/6454046

12 years agocmd/gc: fix escape analysis bug with variable capture in loops.
Rémy Oudompheng [Fri, 31 Aug 2012 20:23:37 +0000 (22:23 +0200)]
cmd/gc: fix escape analysis bug with variable capture in loops.

Fixes #3975.

R=rsc, lvd
CC=golang-dev, remy
https://golang.org/cl/6475061

12 years agonet/rpc/jsonrpc: handles missing "params" in jsonrpc.
Alexandru Moșoi [Fri, 31 Aug 2012 19:52:27 +0000 (15:52 -0400)]
net/rpc/jsonrpc: handles missing "params" in jsonrpc.

A crash happens in the first request in a connection
if "params" field is missing because c.req.Params is Nil.

Fixes #3848.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6446051

12 years agotest: restore nigel's bug451 as bug452.
Russ Cox [Fri, 31 Aug 2012 19:43:27 +0000 (15:43 -0400)]
test: restore nigel's bug451 as bug452.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6497066

12 years agoruntime/pprof: restore articles in type doc comments
Russ Cox [Fri, 31 Aug 2012 17:49:57 +0000 (13:49 -0400)]
runtime/pprof: restore articles in type doc comments

Reverts part of CL 6460082.

If a doc comment describes a type by explaining the
meaning of one instance of the type, a leading article
is fine and makes the text less awkward.

Compare:
// A dog is a kind of animal.
// Dog is a kind of animal.

R=golang-dev, dsymonds, dvyukov, r
CC=golang-dev
https://golang.org/cl/6494066

12 years agosrc: Add support for 64-bit version of Plan 9
Akshat Kumar [Fri, 31 Aug 2012 17:21:13 +0000 (13:21 -0400)]
src: Add support for 64-bit version of Plan 9

This set of changes extends the Plan 9 support
to include the AMD64 architecture and should
work on all versions of Plan 9.

R=golang-dev, rminnich, noah.evans, rsc, minux.ma, npe
CC=akskuma, golang-dev, jfflore, noah.evans
https://golang.org/cl/6479052

12 years agocmd/gc: mark broken type declarations as broken.
Daniel Morsing [Fri, 31 Aug 2012 17:02:29 +0000 (13:02 -0400)]
cmd/gc: mark broken type declarations as broken.

This fixes a spurious 'invalid recursive type' error, and stops the compiler from emitting errors on uses of the invalid type.

Fixes #3766.

R=golang-dev, dave, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/6443100

12 years agonet/http: add (*ServeMux).Handler method
Russ Cox [Fri, 31 Aug 2012 16:16:31 +0000 (12:16 -0400)]
net/http: add (*ServeMux).Handler method

The Handler method makes the ServeMux dispatch logic
available to wrappers that enforce additional constraints
on requests.

R=golang-dev, bradfitz, dsymonds
CC=golang-dev
https://golang.org/cl/6450165

12 years agonet/http: fix inserting of implicit redirects in serve mux
Christian Himpel [Fri, 31 Aug 2012 16:00:01 +0000 (12:00 -0400)]
net/http: fix inserting of implicit redirects in serve mux

In serve mux, if pattern contains a host name, pass only the path to
the redirect handler.

Add tests for serve mux redirections.

R=rsc
CC=bradfitz, gobot, golang-dev
https://golang.org/cl/6329045

12 years agocgo/misc/test: burn CPU to improve sleep accuracy
Dave Cheney [Fri, 31 Aug 2012 10:17:59 +0000 (20:17 +1000)]
cgo/misc/test: burn CPU to improve sleep accuracy

Fixes #4008.

Run a background goroutine that wastes CPU to trick the
power management into raising the CPU frequency which,
by side effect, makes sleep more accurate on arm.

=== RUN TestParallelSleep
--- PASS: TestParallelSleep (1.30 seconds)
_cgo_gotypes.go:772:    sleep(1) slept for 1.000458s

R=minux.ma, r
CC=golang-dev
https://golang.org/cl/6498060

12 years agoA+C: added Alan Donovan (Google corporate license)
Robert Griesemer [Fri, 31 Aug 2012 01:38:33 +0000 (18:38 -0700)]
A+C: added Alan Donovan (Google corporate license)

R=adg, bradfitz
CC=golang-dev
https://golang.org/cl/6490063

12 years agoexp/html: change a node's children from a slice to a linked list.
Nigel Tao [Fri, 31 Aug 2012 00:00:12 +0000 (10:00 +1000)]
exp/html: change a node's children from a slice to a linked list.

Also rename Node.{Add,Remove} to Node.{AppendChild,RemoveChild} to
be consistent with the DOM.

benchmark                      old ns/op    new ns/op    delta
BenchmarkParser                  4042040      3749618   -7.23%

benchmark                       old MB/s     new MB/s  speedup
BenchmarkParser                    19.34        20.85    1.08x

BenchmarkParser mallocs per iteration is also:
10495 before / 7992 after

R=andybalholm, r, adg
CC=golang-dev
https://golang.org/cl/6495061

12 years agogo/scanner: don't print garbage if there's no error
Robert Griesemer [Thu, 30 Aug 2012 23:10:33 +0000 (16:10 -0700)]
go/scanner: don't print garbage if there's no error

R=r
CC=golang-dev
https://golang.org/cl/6489059

12 years agocmd/gc: string conversion for surrogates
Rob Pike [Thu, 30 Aug 2012 18:16:55 +0000 (11:16 -0700)]
cmd/gc: string conversion for surrogates
This is required by the spec to produce the replacement char.
The fix lies in lib9's rune code.

R=golang-dev, nigeltao, rsc
CC=golang-dev
https://golang.org/cl/6443109

12 years agopath: improve documentation for Dir
Rob Pike [Thu, 30 Aug 2012 18:16:41 +0000 (11:16 -0700)]
path: improve documentation for Dir

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6495059

12 years agonet/rpc: protect serviceMap with RWMutex
Dmitriy Vyukov [Thu, 30 Aug 2012 16:32:32 +0000 (20:32 +0400)]
net/rpc: protect serviceMap with RWMutex

R=r, r
CC=golang-dev
https://golang.org/cl/6494044

12 years agotext/template: make spaces significant
Rob Pike [Thu, 30 Aug 2012 04:42:53 +0000 (21:42 -0700)]
text/template: make spaces significant

Other than catching an error case that was missed before, this
CL introduces no changes to the template language or API.

For simplicity, templates use spaces as argument separators.
This means that spaces are significant: .x .y is not the same as .x.y.
In the existing code, these cases are discriminated by the lexer,
but that means for instance that (a b).x cannot be distinguished
from (a b) .x, which is lousy. Although that syntax is not
supported yet, we want to support it and this CL is a necessary
step.

This CL emits a "space" token (actually a run of spaces) from
the lexer so the parser can discriminate these cases. It therefore
fixes a couple of undisclosed bugs ("hi".x is now an error) but
doesn't otherwise change the language. Later CLs will amend
the grammar to make .X a proper operator.

There is one unpleasantness: With space a token, three-token
lookahead is now required when parsing variable declarations
to discriminate them from plain variable references. Otherwise
the change isn't bad.

The CL also moves the debugging print code out of the lexer
into the test, which is the only place it's needed or useful.

Step towards resolving issue 3999.
It still remains to move field chaining out of the lexer
and into the parser and make field access an operator.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6492054

12 years agogo_spec.html: clarify rune and string literals
Rob Pike [Wed, 29 Aug 2012 21:46:57 +0000 (14:46 -0700)]
go_spec.html: clarify rune and string literals
No changes to the meaning, just clearer language and more
examples, including illegal rune and string literals.
In particular, "character literal" and "character constant"
are now called "rune literal" and "rune constant" and the
word "character" always refers to the source text, not
program values.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/6448137

12 years agocmd/yacc/units.txt: fix exchange rates
Andrew Balholm [Wed, 29 Aug 2012 17:06:37 +0000 (10:06 -0700)]
cmd/yacc/units.txt: fix exchange rates
        In the example "units" program for goyacc, the exchange rates were
        reciprocals of the correct amounts. Turn them right-side-up
        and update them to current figures.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6495053

12 years agocmd/ld: handle a special case of scattered relocation 2/1 on Darwin/386
Shenghou Ma [Wed, 29 Aug 2012 15:42:05 +0000 (23:42 +0800)]
cmd/ld: handle a special case of scattered relocation 2/1 on Darwin/386
        Fixes #1635.

R=golang-dev, dave, r
CC=golang-dev
https://golang.org/cl/6496043

12 years agosyscall: extract an ExampleLoadLibrary from comment
Shenghou Ma [Wed, 29 Aug 2012 13:44:46 +0000 (21:44 +0800)]
syscall: extract an ExampleLoadLibrary from comment
   while we are at it, fix some out-of-date comments.

R=golang-dev, dave, r
CC=golang-dev
https://golang.org/cl/6498054

12 years agoA+C: add Patrick Crosby (individual contributor)
Andrew Gerrand [Wed, 29 Aug 2012 03:24:53 +0000 (13:24 +1000)]
A+C: add Patrick Crosby (individual contributor)

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6489049

12 years agonet/http/httputil: fix race in DumpRequestOut
Dave Cheney [Tue, 28 Aug 2012 23:05:30 +0000 (09:05 +1000)]
net/http/httputil: fix race in DumpRequestOut

Fixes #3892.

Swapping the order of the writers inside the MultiWriter ensures
the request will be written to buf before http.ReadRequest completes.

The fencedBuffer is not required to make the test pass on
any machine that I have access too, but as the buf is shared
across goroutines, I think it is necessary for correctness.

R=bradfitz, fullung, franciscossouza
CC=golang-dev
https://golang.org/cl/6483061

12 years agotest/bench/shootout: pidigits is much faster
Rob Pike [Tue, 28 Aug 2012 22:33:05 +0000 (15:33 -0700)]
test/bench/shootout: pidigits is much faster
Also fix a bug in the script (s/runonly/run/)

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6501051

12 years agonet: delete unused socket-level option helpers
Mikio Hara [Tue, 28 Aug 2012 21:54:00 +0000 (06:54 +0900)]
net: delete unused socket-level option helpers

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6499043

12 years agomath/big: Replace RCLQ + ANDQ with SETCS in unrolled arithmetic assembly.
Christopher Swenson [Tue, 28 Aug 2012 16:29:45 +0000 (09:29 -0700)]
math/big: Replace RCLQ + ANDQ with SETCS in unrolled arithmetic assembly.

benchmark             old ns/op    new ns/op    delta
BenchmarkAddVW_1              8            8   +0.60%
BenchmarkAddVW_2             10            9   -8.64%
BenchmarkAddVW_3             10           10   -4.63%
BenchmarkAddVW_4             10           11   +3.67%
BenchmarkAddVW_5             11           12   +5.98%
BenchmarkAddVW_1e1           18           20   +6.38%
BenchmarkAddVW_1e2          129          115  -10.85%
BenchmarkAddVW_1e3         1270         1089  -14.25%
BenchmarkAddVW_1e4        13376        12145   -9.20%
BenchmarkAddVW_1e5       130392       125260   -3.94%

benchmark              old MB/s     new MB/s  speedup
BenchmarkAddVW_1        7709.10      7661.92    0.99x
BenchmarkAddVW_2       12451.10     13604.00    1.09x
BenchmarkAddVW_3       17727.81     18721.54    1.06x
BenchmarkAddVW_4       23552.64     22708.81    0.96x
BenchmarkAddVW_5       27411.40     25816.22    0.94x
BenchmarkAddVW_1e1     34063.19     32023.06    0.94x
BenchmarkAddVW_1e2     49529.97     55360.55    1.12x
BenchmarkAddVW_1e3     50380.44     58764.18    1.17x
BenchmarkAddVW_1e4     47843.59     52696.10    1.10x
BenchmarkAddVW_1e5     49082.60     51093.66    1.04x

R=gri, rsc, r
CC=golang-dev
https://golang.org/cl/6480063

12 years agocmd/api: recognize version "devel" as dev. branch and apply -next
Shenghou Ma [Mon, 27 Aug 2012 20:03:27 +0000 (04:03 +0800)]
cmd/api: recognize version "devel" as dev. branch and apply -next

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6476066

12 years agomisc/vim: fix for autocompletion
Tobias Columbus [Mon, 27 Aug 2012 19:59:16 +0000 (03:59 +0800)]
misc/vim: fix for autocompletion

    Vim autocompletion respects the $GOPATH variable and does not
    ignore dashes ('-'), dots ('.') and underscores ('_') like found
    in many remote packages.
    Environment variable $GOROOT is determined by calling
    'go env GOROOT' instead of relying on the user's environment
    variables.

    Fixes #3876
    Fixes #3882

R=golang-dev, franciscossouza, dsymonds, minux.ma
CC=golang-dev
https://golang.org/cl/6443151

12 years agoC: add Tobias Columbus's email used in Rietveld
Shenghou Ma [Mon, 27 Aug 2012 19:57:27 +0000 (03:57 +0800)]
C: add Tobias Columbus's email used in Rietveld

R=golang-dev, tobias.columbus, bradfitz
CC=golang-dev
https://golang.org/cl/6483058

12 years agonet/http: send an explicit zero Content-Length when Handler never Writes
Brad Fitzpatrick [Sun, 26 Aug 2012 18:17:55 +0000 (11:17 -0700)]
net/http: send an explicit zero Content-Length when Handler never Writes

Fixes #4004

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6472055

12 years agoruntime: use netbsd signal ABI v2
Joel Sing [Sun, 26 Aug 2012 10:57:47 +0000 (20:57 +1000)]
runtime: use netbsd signal ABI v2

Use version 2 of the NetBSD signal ABI - both version 2 and version 3
are supported by the kernel, with near identical behaviour. However,
the netbsd32 compat code does not allow version 3 to be used, which
prevents Go netbsd/386 binaries from running in compat mode on a
NetBSD amd64 kernel. Switch to version 2 of the ABI, which is the
same version currently used by NetBSD's libc.

R=minux.ma
CC=golang-dev
https://golang.org/cl/6476068

12 years agotest: use run.go for more tests.
Rémy Oudompheng [Sat, 25 Aug 2012 08:16:02 +0000 (10:16 +0200)]
test: use run.go for more tests.

R=golang-dev, alex.brainman, minux.ma
CC=golang-dev
https://golang.org/cl/6443110

12 years agomath/big: fix broken comment
Robert Griesemer [Fri, 24 Aug 2012 20:50:09 +0000 (13:50 -0700)]
math/big: fix broken comment

R=iant, iant
CC=golang-dev
https://golang.org/cl/6485064

12 years agoVERSION: check in a version file for the development branch
Rob Pike [Fri, 24 Aug 2012 20:01:50 +0000 (13:01 -0700)]
VERSION: check in a version file for the development branch
That way "go version" will talk about "devel" rather than weekly.2012-03-27

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6478061

12 years agotext/template: catch (A).X as a parse error
Rob Pike [Fri, 24 Aug 2012 20:00:24 +0000 (13:00 -0700)]
text/template: catch (A).X as a parse error
This shouldn't be an error (see issue 3999), but until it's handled
correctly, treat it as one to avoid confusion. Without this CL,
(A).X parses as two arguments.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6473059

12 years agotext/template: allow grouping of pipelines using parentheses
Rob Pike [Fri, 24 Aug 2012 19:37:23 +0000 (12:37 -0700)]
text/template: allow grouping of pipelines using parentheses

Based on work by Russ Cox. From his CL:

        This is generally useful but especially helpful when trying
        to use the built-in boolean operators.  It lets you write:

        {{if not (f 1)}} foo {{end}}
        {{if and (f 1) (g 2)}} bar {{end}}
        {{if or (f 1) (g 2)}} quux {{end}}

        instead of

        {{if f 1 | not}} foo {{end}}
        {{if f 1}}{{if g 2}} bar {{end}}{{end}}
        {{$do := 0}}{{if f 1}}{{$do := 1}}{{else if g 2}}{{$do := 1}}{{end}}{{if $do}} quux {{end}}

The result can be a bit LISPy but the benefit in expressiveness and readability
for such a small change justifies it.

I believe no changes are required to html/template.

Fixes #3276.

R=golang-dev, adg, rogpeppe, minux.ma
CC=golang-dev
https://golang.org/cl/6482056

12 years agomath/big: minor tweaks to assembly code (slightly better performance)
Robert Griesemer [Fri, 24 Aug 2012 17:51:39 +0000 (10:51 -0700)]
math/big: minor tweaks to assembly code (slightly better performance)

Benchmarks run on 2.8GHz Quad-Code Intel Xeon,
4GB 800MHz DDR2 FB-DIMM ("PowerMac").

benchmark             old ns/op    new ns/op    delta
BenchmarkAddVV_1              7            7   -0.82%
BenchmarkAddVV_2              8            8   -3.46%
BenchmarkAddVV_3             10            9   -4.81%
BenchmarkAddVV_4              9            9   -1.89%
BenchmarkAddVV_5             11           10   -5.22%
BenchmarkAddVV_1e1           17           18   +4.05%
BenchmarkAddVV_1e2          117          115   -1.71%
BenchmarkAddVV_1e3         1095         1090   -0.46%
BenchmarkAddVV_1e4        13149        12679   -3.57%
BenchmarkAddVV_1e5       135133       129482   -4.18%
BenchmarkAddVW_1              6            6   -1.14%
BenchmarkAddVW_2              7            7   +3.78%
BenchmarkAddVW_3              8            8   +0.12%
BenchmarkAddVW_4              8            8   -6.52%
BenchmarkAddVW_5              9            8   -3.70%
BenchmarkAddVW_1e1           14           13   -4.29%
BenchmarkAddVW_1e2           97           96   -1.33%
BenchmarkAddVW_1e3          953          940   -1.36%
BenchmarkAddVW_1e4         9776         9527   -2.55%
BenchmarkAddVW_1e5       102396        97738   -4.55%

benchmark              old MB/s     new MB/s  speedup
BenchmarkAddVV_1        8702.84      8774.56    1.01x
BenchmarkAddVV_2       14739.60     15277.82    1.04x
BenchmarkAddVV_3       18375.37     19398.16    1.06x
BenchmarkAddVV_4       26935.44     27464.68    1.02x
BenchmarkAddVV_5       27754.04     29423.30    1.06x
BenchmarkAddVV_1e1     37050.89     35629.72    0.96x
BenchmarkAddVV_1e2     54289.15     55533.24    1.02x
BenchmarkAddVV_1e3     58428.83     58682.53    1.00x
BenchmarkAddVV_1e4     48670.55     50475.99    1.04x
BenchmarkAddVV_1e5     47360.54     49427.66    1.04x
BenchmarkAddVW_1       10397.27     10502.23    1.01x
BenchmarkAddVW_2       17279.03     16654.13    0.96x
BenchmarkAddVW_3       23858.39     23825.89    1.00x
BenchmarkAddVW_4       29799.42     31895.06    1.07x
BenchmarkAddVW_5       34781.83     36105.11    1.04x
BenchmarkAddVW_1e1     45629.88     47597.42    1.04x
BenchmarkAddVW_1e2     65341.93     66240.04    1.01x
BenchmarkAddVW_1e3     67153.67     68069.83    1.01x
BenchmarkAddVW_1e4     65464.60     67173.83    1.03x
BenchmarkAddVW_1e5     62501.88     65480.66    1.05x

R=iant
CC=golang-dev
https://golang.org/cl/6484056

12 years agomath/big: faster (add|sub)V(V|W) routines
Robert Griesemer [Fri, 24 Aug 2012 16:20:44 +0000 (09:20 -0700)]
math/big: faster (add|sub)V(V|W) routines

Benchmarks run on 3.06GHz Intel Core 2 Duo,
4GB 800MHz DDR2 SDRAM ("iMac").

benchmark             old ns/op    new ns/op    delta
BenchmarkAddVV_1              6            6   +2.75%
BenchmarkAddVV_2              9            7  -19.71%
BenchmarkAddVV_3              9            9   +2.25%
BenchmarkAddVV_4             10            8  -20.46%
BenchmarkAddVV_5             12           10  -19.53%
BenchmarkAddVV_1e1           23           15  -32.48%
BenchmarkAddVV_1e2          213          107  -49.77%
BenchmarkAddVV_1e3         2088          993  -52.44%
BenchmarkAddVV_1e4        20874        12027  -42.38%
BenchmarkAddVV_1e5       209858       121480  -42.11%
BenchmarkAddVW_1              5            5   +0.90%
BenchmarkAddVW_2             11           11   -3.51%
BenchmarkAddVW_3              7            7   -0.27%
BenchmarkAddVW_4              8            7   -6.32%
BenchmarkAddVW_5              9            8  -10.89%
BenchmarkAddVW_1e1           17           12  -26.01%
BenchmarkAddVW_1e2          155           89  -42.32%
BenchmarkAddVW_1e3         1479          873  -40.97%
BenchmarkAddVW_1e4        13838         8764  -36.67%
BenchmarkAddVW_1e5       147353        89560  -39.22%

benchmark              old MB/s     new MB/s  speedup
BenchmarkAddVV_1        9765.57      9508.55    0.97x
BenchmarkAddVV_2       13077.63     16284.97    1.25x
BenchmarkAddVV_3       20599.58     20156.67    0.98x
BenchmarkAddVV_4       23591.58     29516.02    1.25x
BenchmarkAddVV_5       24920.95     31194.10    1.25x
BenchmarkAddVV_1e1     27393.76     40621.71    1.48x
BenchmarkAddVV_1e2     29911.96     59592.99    1.99x
BenchmarkAddVV_1e3     30650.73     64429.84    2.10x
BenchmarkAddVV_1e4     30660.09     53213.08    1.74x
BenchmarkAddVV_1e5     30496.74     52683.46    1.73x
BenchmarkAddVW_1       11503.39     11405.98    0.99x
BenchmarkAddVW_2       11203.56     11586.92    1.03x
BenchmarkAddVW_3       26173.45     26224.75    1.00x
BenchmarkAddVW_4       30560.30     32621.94    1.07x
BenchmarkAddVW_5       33183.81     37269.94    1.12x
BenchmarkAddVW_1e1     36991.75     50098.53    1.35x
BenchmarkAddVW_1e2     41087.14     71549.93    1.74x
BenchmarkAddVW_1e3     43266.42     73279.83    1.69x
BenchmarkAddVW_1e4     46246.74     73021.97    1.58x
BenchmarkAddVW_1e5     43433.00     71459.96    1.65x

Benchmarks run on 2.8GHz Quad-Code Intel Xeon,
4GB 800MHz DDR2 FB-DIMM ("PowerMac").

benchmark             old ns/op    new ns/op    delta
BenchmarkAddVV_1              7            7   +2.51%
BenchmarkAddVV_2              8            8   +3.70%
BenchmarkAddVV_3             10           10   +4.00%
BenchmarkAddVV_4             11            9  -19.49%
BenchmarkAddVV_5             14           11  -18.44%
BenchmarkAddVV_1e1           23           17  -27.00%
BenchmarkAddVV_1e2          234          117  -50.00%
BenchmarkAddVV_1e3         2284         1095  -52.06%
BenchmarkAddVV_1e4        22906        13149  -42.60%
BenchmarkAddVV_1e5       229860       135133  -41.21%
BenchmarkAddVW_1              6            6   +1.15%
BenchmarkAddVW_2              7            7   +1.37%
BenchmarkAddVW_3              7            8   +1.00%
BenchmarkAddVW_4              9            8   -6.93%
BenchmarkAddVW_5             10            9  -13.21%
BenchmarkAddVW_1e1           18           14  -24.32%
BenchmarkAddVW_1e2          170           97  -42.41%
BenchmarkAddVW_1e3         1619          953  -41.14%
BenchmarkAddVW_1e4        15142         9776  -35.44%
BenchmarkAddVW_1e5       160835       102396  -36.33%

benchmark              old MB/s     new MB/s  speedup
BenchmarkAddVV_1        8928.95      8702.84    0.97x
BenchmarkAddVV_2       15298.84     14739.60    0.96x
BenchmarkAddVV_3       19116.52     18375.37    0.96x
BenchmarkAddVV_4       21644.30     26935.44    1.24x
BenchmarkAddVV_5       22771.64     27754.04    1.22x
BenchmarkAddVV_1e1     27017.62     37050.89    1.37x
BenchmarkAddVV_1e2     27326.09     54289.15    1.99x
BenchmarkAddVV_1e3     28016.84     58428.83    2.09x
BenchmarkAddVV_1e4     27939.38     48670.55    1.74x
BenchmarkAddVV_1e5     27843.00     47360.54    1.70x
BenchmarkAddVW_1       10510.97     10397.27    0.99x
BenchmarkAddVW_2       17499.71     17279.03    0.99x
BenchmarkAddVW_3       24093.93     23858.39    0.99x
BenchmarkAddVW_4       27733.08     29799.42    1.07x
BenchmarkAddVW_5       30267.17     34781.83    1.15x
BenchmarkAddVW_1e1     34566.78     45629.88    1.32x
BenchmarkAddVW_1e2     37521.89     65341.93    1.74x
BenchmarkAddVW_1e3     39513.18     67153.67    1.70x
BenchmarkAddVW_1e4     42263.80     65464.60    1.55x
BenchmarkAddVW_1e5     39792.21     62501.88    1.57x

R=iant, remyoudompheng, nightlyone, minux.ma
CC=golang-dev
https://golang.org/cl/6482062

12 years agoexp/locale/collate: add code to ignore tests with (unpaired) surrogates.
Marcel van Lohuizen [Fri, 24 Aug 2012 13:56:07 +0000 (15:56 +0200)]
exp/locale/collate: add code to ignore tests with (unpaired) surrogates.
In the regtest data, surrogates are assigned primary weights based on
the surrogate code point value.  Go now converts surrogates to FFFD, however,
meaning that the primary weight is based on this code point instead.
This change drops tests with surrogates and lets the tests pass.

R=r
CC=golang-dev
https://golang.org/cl/6461100

12 years agonet/http: add parallel client/server benchmark
Dmitriy Vyukov [Fri, 24 Aug 2012 10:19:49 +0000 (14:19 +0400)]
net/http: add parallel client/server benchmark
R=bradfitz@golang.org

R=bradfitz
CC=bradfitz, dave, dsymonds, gobot, golang-dev
https://golang.org/cl/6441134

12 years agoexp/html: remove unused forTag function.
Nigel Tao [Fri, 24 Aug 2012 04:15:55 +0000 (14:15 +1000)]
exp/html: remove unused forTag function.

R=adg
CC=golang-dev
https://golang.org/cl/6480051

12 years agodatabase/sql: stop reuse of bad connections
Julien Schmidt [Fri, 24 Aug 2012 02:29:47 +0000 (19:29 -0700)]
database/sql: stop reuse of bad connections

The second parameter for sql.putConn() (err) is always nil. As a result bad
connections are reused, even if the driver returns an driver.ErrBadConn.
Unsing a pointer to err instead achievs the desired behavior.
See http://code.google.com/p/go/issues/detail?id=3777 for more details.
Fixes #3777.

R=golang-dev, dave, bradfitz, jameshuachow, BlakeSGentry
CC=golang-dev
https://golang.org/cl/6348069

12 years agoA+C: Add Julien Schmidt (Individual CLA)
Brad Fitzpatrick [Fri, 24 Aug 2012 02:29:15 +0000 (19:29 -0700)]
A+C: Add Julien Schmidt (Individual CLA)

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/6459050

12 years agoA+C: Tobias Columbus (individual CLA)
David Symonds [Fri, 24 Aug 2012 01:55:11 +0000 (11:55 +1000)]
A+C: Tobias Columbus (individual CLA)

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/6480058

12 years agogo/scanner: don't drop identifiers starting with non-ASCII letter...
Robert Griesemer [Fri, 24 Aug 2012 00:03:33 +0000 (17:03 -0700)]
go/scanner: don't drop identifiers starting with non-ASCII letter...

Bug introduced with CL 6454150.

Fixes #4000.

R=r
CC=golang-dev
https://golang.org/cl/6474061

12 years agomath/big: added benchmarks to establish baseline for core functions
Robert Griesemer [Thu, 23 Aug 2012 22:56:14 +0000 (15:56 -0700)]
math/big: added benchmarks to establish baseline for core functions

BenchmarkAddVV_1          500000000        7.24 ns/op     8844.11 MB/s
BenchmarkAddVV_2          100000000       10.4 ns/op     12290.41 MB/s
BenchmarkAddVV_3          100000000       10.7 ns/op     17966.58 MB/s
BenchmarkAddVV_4          100000000       12.3 ns/op     20848.67 MB/s
BenchmarkAddVV_5          100000000       14.5 ns/op     21993.82 MB/s
BenchmarkAddVV_1e1        100000000       24.0 ns/op     26720.65 MB/s
BenchmarkAddVV_1e2         10000000      246 ns/op       26014.58 MB/s
BenchmarkAddVV_1e3          1000000     2416 ns/op       26485.06 MB/s
BenchmarkAddVV_1e4           100000    23874 ns/op       26806.36 MB/s
BenchmarkAddVV_1e5            10000   241155 ns/op       26538.87 MB/s
BenchmarkAddVW_1          500000000        6.12 ns/op    10461.91 MB/s
BenchmarkAddVW_2          200000000       11.0 ns/op     11596.63 MB/s
BenchmarkAddVW_3          200000000        8.97 ns/op    21409.82 MB/s
BenchmarkAddVW_4          100000000       10.8 ns/op     23696.72 MB/s
BenchmarkAddVW_5          100000000       12.5 ns/op     25524.88 MB/s
BenchmarkAddVW_1e1        100000000       21.5 ns/op     29786.32 MB/s
BenchmarkAddVW_1e2         10000000      168 ns/op       37925.36 MB/s
BenchmarkAddVW_1e3          1000000     1658 ns/op       38579.15 MB/s
BenchmarkAddVW_1e4           100000    16492 ns/op       38805.85 MB/s
BenchmarkAddVW_1e5            10000   172155 ns/op       37175.69 MB/s
BenchmarkAddMulVVW_1      100000000       12.9 ns/op      4968.49 MB/s
BenchmarkAddMulVVW_2      100000000       15.5 ns/op      8279.42 MB/s
BenchmarkAddMulVVW_3      100000000       13.4 ns/op     14340.53 MB/s
BenchmarkAddMulVVW_4      100000000       15.8 ns/op     16194.94 MB/s
BenchmarkAddMulVVW_5      100000000       18.9 ns/op     16906.61 MB/s
BenchmarkAddMulVVW_1e1     50000000       32.3 ns/op     19838.35 MB/s
BenchmarkAddMulVVW_1e2     10000000      285 ns/op       22427.28 MB/s
BenchmarkAddMulVVW_1e3      1000000     2777 ns/op       23040.42 MB/s
BenchmarkAddMulVVW_1e4       100000    27901 ns/op       22938.01 MB/s
BenchmarkAddMulVVW_1e5        10000   281087 ns/op       22768.73 MB/s

R=r
CC=golang-dev
https://golang.org/cl/6478055

12 years agocrypto/tls: return better error message in the case of an SSLv2 handshake.
Adam Langley [Thu, 23 Aug 2012 20:44:44 +0000 (16:44 -0400)]
crypto/tls: return better error message in the case of an SSLv2 handshake.

Update #3930
Return a better error message in this situation.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6474055

12 years agonet: avoid nil pointer dereference when RemoteAddr.String method chain is called
Mikio Hara [Thu, 23 Aug 2012 11:54:00 +0000 (20:54 +0900)]
net: avoid nil pointer dereference when RemoteAddr.String method chain is called

Fixes #3721.

R=dave, rsc
CC=golang-dev
https://golang.org/cl/6395055

12 years agocmd/6g: fix float32/64->uint64 conversion
Shenghou Ma [Thu, 23 Aug 2012 06:35:26 +0000 (14:35 +0800)]
cmd/6g: fix float32/64->uint64 conversion
    CVTSS2SQ's rounding mode is controlled by the RC field of MXCSR;
as we specifically need truncate semantic, we should use CVTTSS2SQ.

    Fixes #3804.

R=rsc, r
CC=golang-dev
https://golang.org/cl/6352079

12 years agocmd/ld: set ELF header flags for our Linux/ARM binary
Shenghou Ma [Thu, 23 Aug 2012 06:33:41 +0000 (14:33 +0800)]
cmd/ld: set ELF header flags for our Linux/ARM binary
To make it more compliant.
This won't affect the behavior of running on OABI-only kernels.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/6475044

12 years agocmd/8g: roll back the small integer constant optimizations introduced
Nigel Tao [Thu, 23 Aug 2012 06:17:22 +0000 (16:17 +1000)]
cmd/8g: roll back the small integer constant optimizations introduced
in 13416:67c0b8c8fb29 "faster code, mainly for rotate" [1]. The codegen
can run out of registers if there are too many small-int arithmetic ops.

An alternative approach is to copy 6g's sbop/abop codegen to 8g, but
this change is less risky.

Fixes #3835.

[1] http://code.google.com/p/go/source/diff?spec=svn67c0b8c8fb29b1b7b6221977af6b89cae787b941&name=67c0b8c8fb29&r=67c0b8c8fb29b1b7b6221977af6b89cae787b941&format=side&path=/src/cmd/8g/cgen.c

R=rsc, remyoudompheng, r
CC=golang-dev
https://golang.org/cl/6450163