]> Cypherpunks repositories - gostls13.git/log
gostls13.git
12 years agounicode: move unicode and related packages to Unicode 6.2.0.
Marcel van Lohuizen [Wed, 31 Oct 2012 16:32:16 +0000 (17:32 +0100)]
unicode: move unicode and related packages to Unicode 6.2.0.

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

12 years agoexp/locale/collate: implementation of tailorings and table generation.
Marcel van Lohuizen [Wed, 31 Oct 2012 13:28:44 +0000 (14:28 +0100)]
exp/locale/collate: implementation of tailorings and table generation.
Tailorings are represented by removing and reinserting entries from a linked list.
After all tailorings are done, missing weights are computed and verified.
This implementation assumes that entries that are used in expansions are not
reinserted at a later point.  This considerably simplifies the implementation.

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

12 years agoexp/locale/collate: removed weights struct to allow for faster and easier
Marcel van Lohuizen [Wed, 31 Oct 2012 13:28:18 +0000 (14:28 +0100)]
exp/locale/collate: removed weights struct to allow for faster and easier
incremental comparisons. Instead, processing is now done directly on colElems.
As a result, the size of the weights array is now reduced by 75%.
Details:
- Primary value of type 1 colElem is shifted by 1 bit so that primaries
  of all types can be compared without shifting.
- Quaternary values are now stored in the colElem itself. This is possible
  as quaternary values other than 0 or maxQuaternary are only needed when other
  values are ignored.
- Simplified processWeights by removing cases that are needed for ICU but not
  for us (our CJK primary values fit in a single value).

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

12 years agoexp/locale/collate: add context to entry.
Marcel van Lohuizen [Wed, 31 Oct 2012 13:02:43 +0000 (14:02 +0100)]
exp/locale/collate: add context to entry.

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

12 years agotest: match gccgo error messages for bug358.go
Ian Lance Taylor [Wed, 31 Oct 2012 03:56:32 +0000 (20:56 -0700)]
test: match gccgo error messages for bug358.go

I fixed a bug in gccgo that was causing it to only give an
error for the first package that was imported and not used.

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

12 years agosyscall/exec_linux: enable changing controlling tty
Peter Waller [Wed, 31 Oct 2012 00:36:18 +0000 (17:36 -0700)]
syscall/exec_linux: enable changing controlling tty

As discussed in the following thread:
https://groups.google.com/forum/?fromgroups=#!topic/golang-dev/emeJffxWhVo

This is required to enable applications such as `less` to use something
other than stdin as the controlling terminal.

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

12 years agoA+C: add Peter Waller (individual CLA)
Ian Lance Taylor [Wed, 31 Oct 2012 00:24:01 +0000 (17:24 -0700)]
A+C: add Peter Waller (individual CLA)

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

12 years agonet: fix connection resets when closed on windows
Alex Brainman [Tue, 30 Oct 2012 23:24:37 +0000 (10:24 +1100)]
net: fix connection resets when closed on windows

It is common to close network connection while another goroutine is
blocked reading on another goroutine. This sequence corresponds to
windows calls to WSARecv to start io, followed by GetQueuedCompletionStatus
that blocks until io completes, and, finally, closesocket called from
another thread. We were expecting that closesocket would unblock
GetQueuedCompletionStatus, and it does, but not always
(http://code.google.com/p/go/issues/detail?id=4170#c5). Also that sequence
results in connection is being reset.

This CL inserts CancelIo between GetQueuedCompletionStatus and closesocket,
and waits for both WSARecv and GetQueuedCompletionStatus to complete before
proceeding to closesocket.  This seems to fix both connection resets and
issue 4170. It also makes windows code behave similar to unix version.

Unfortunately, CancelIo needs to be called on the same thread as WSARecv.
So we have to employ strategy we use for connections with deadlines to
every connection now. It means, there are 2 unavoidable thread switches
for every io. Some newer versions of windows have new CancelIoEx api that
doesn't have these drawbacks, and this CL uses this capability when available.
As time goes by, we should have less of CancelIo and more of CancelIoEx
systems. Computers with CancelIoEx are also not affected by issue 4195 anymore.

Fixes #3710
Fixes #3746
Fixes #4170
Partial fix for issue 4195

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

12 years agoimage/jpeg: don't call ensureNBits unless we have to.
Nigel Tao [Tue, 30 Oct 2012 23:02:11 +0000 (10:02 +1100)]
image/jpeg: don't call ensureNBits unless we have to.

benchmark                     old ns/op    new ns/op    delta
BenchmarkDecodeBaseline         3155638      2783998  -11.78%
BenchmarkDecodeProgressive      4008088      3660310   -8.68%

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

12 years agonet: use read deadline in Accept on windows
Alexey Borzenkov [Tue, 30 Oct 2012 22:58:05 +0000 (09:58 +1100)]
net: use read deadline in Accept on windows

Fixes #4296.

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

12 years agoreflect: improve documentation for DeepEqual regarding maps
Rob Pike [Tue, 30 Oct 2012 21:42:47 +0000 (14:42 -0700)]
reflect: improve documentation for DeepEqual regarding maps
Keys use ==; values use deep equality. Also remove the word 'member'.
Fixes #4258.

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

12 years agogofmt: apply gofmt -w src misc
Robert Griesemer [Tue, 30 Oct 2012 20:38:01 +0000 (13:38 -0700)]
gofmt: apply gofmt -w src misc

Remove trailing whitespace in comments.
No other changes.

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

12 years agogo/printer, gofmt: trim trailing whitespace in comments
Robert Griesemer [Tue, 30 Oct 2012 20:09:47 +0000 (13:09 -0700)]
go/printer, gofmt: trim trailing whitespace in comments

Also: updated go fix testcases to pass tests.

Fixes #4310.

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

12 years agoarchive/zip: handle corrupt extra data records
Dave Cheney [Tue, 30 Oct 2012 16:51:59 +0000 (03:51 +1100)]
archive/zip: handle corrupt extra data records

Fixes #4302.

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

12 years agoexp/gotype: add more test packages
Robert Griesemer [Tue, 30 Oct 2012 16:42:43 +0000 (09:42 -0700)]
exp/gotype: add more test packages

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

12 years agocmd/ld: handle weak symbols
Shenghou Ma [Tue, 30 Oct 2012 15:58:43 +0000 (23:58 +0800)]
cmd/ld: handle weak symbols
compiler_rt introduces a weak and hidden symbol compilerrt_abort_impl
into our pre-linked _all.o object, we have to handle it.

Fixes #4273.

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

12 years agomisc/dashboard/builder: check http status before processing response
Dave Cheney [Tue, 30 Oct 2012 15:24:08 +0000 (02:24 +1100)]
misc/dashboard/builder: check http status before processing response

Occasionally GAE will return a 500 error response, don't treat this as a valid JSON body.

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

12 years agocmd/api: handle contexts re-converging
Brad Fitzpatrick [Tue, 30 Oct 2012 12:12:59 +0000 (13:12 +0100)]
cmd/api: handle contexts re-converging

Fixes #4303

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

12 years agocmd/api: add more tests
Brad Fitzpatrick [Tue, 30 Oct 2012 10:23:44 +0000 (11:23 +0100)]
cmd/api: add more tests

Feature extraction was tested before, but not the final diffs.

This CL breaks function main into a smaller main + testable
compareAPI.

No functional changes.

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

12 years agoio: add ByteWriter interface
Brad Fitzpatrick [Tue, 30 Oct 2012 09:51:29 +0000 (10:51 +0100)]
io: add ByteWriter interface

API change.

R=golang-dev, dsymonds, nigeltao, rsc, r
CC=golang-dev
https://golang.org/cl/6760045

12 years agoimage/jpeg: change block from [64]int to [64]int32.
Nigel Tao [Tue, 30 Oct 2012 00:10:08 +0000 (11:10 +1100)]
image/jpeg: change block from [64]int to [64]int32.

On 6g/linux:
benchmark                     old ns/op    new ns/op    delta
BenchmarkFDCT                      4606         4241   -7.92%
BenchmarkIDCT                      4187         3923   -6.31%
BenchmarkDecodeBaseline         3154864      3170224   +0.49%
BenchmarkDecodeProgressive      4072812      4017132   -1.37%
BenchmarkEncode                39406920     34596760  -12.21%

Stack requirements before (from 'go tool 6g -S'):
(scan.go:37) TEXT    (*decoder).processSOS+0(SB),$1352-32
(writer.go:448) TEXT    (*encoder).writeSOS+0(SB),$5344-24

after:
(scan.go:37) TEXT    (*decoder).processSOS+0(SB),$1064-32
(writer.go:448) TEXT    (*encoder).writeSOS+0(SB),$2520-24

Also, in encoder.writeSOS, re-use the yBlock scratch buffer for Cb and
Cr. This reduces the stack requirement slightly, but also avoids an
unlucky coincidence where a BenchmarkEncode stack split lands between
encoder.writeByte and bufio.Writer.WriteByte, which occurs very often
during Huffman encoding and is otherwise disasterous for the final
benchmark number. FWIW, the yBlock re-use *without* the s/int/int32/
change does not have a noticable effect on the benchmarks.

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

12 years agoencoding/json: tweak docs
Roger Peppe [Mon, 29 Oct 2012 19:58:24 +0000 (20:58 +0100)]
encoding/json: tweak docs

"JSON object" means something specific, which
isn't the case here.

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

12 years agosyscalls: annotate Sendfile() for race detector
Dmitriy Vyukov [Mon, 29 Oct 2012 19:15:06 +0000 (23:15 +0400)]
syscalls: annotate Sendfile() for race detector
Fixes #4306.

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

12 years agonet/http/client.go: fix cookie handling on (*Client) Do()
Pawel Szczur [Mon, 29 Oct 2012 16:56:31 +0000 (17:56 +0100)]
net/http/client.go: fix cookie handling on (*Client) Do()

Fix the problem with no cookie handling when sending
other than GET or HEAD request through
(*Client) Do(*Request) (*Resposne, error).
https://code.google.com/p/go/issues/detail?id=3985

Adds a function (*Client) send(*Request) (*Reponse, error):
- sets cookies from CookieJar to request,
- sends request
- parses a reply cookies and updates CookieJar

Fixes #3985

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

12 years agoCONTRIBUTORS: add Pawel Szczur (Google CLA)
Brad Fitzpatrick [Mon, 29 Oct 2012 16:54:22 +0000 (17:54 +0100)]
CONTRIBUTORS: add Pawel Szczur (Google CLA)

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

12 years agocrypto/x509: always write validity times in UTC.
Adam Langley [Mon, 29 Oct 2012 15:16:58 +0000 (11:16 -0400)]
crypto/x509: always write validity times in UTC.

RFC 5280 section 4.1.2.5.1 says so.

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

12 years agoencoding/asn1: don't convert UTCTime to UTC.
Adam Langley [Mon, 29 Oct 2012 15:16:05 +0000 (11:16 -0400)]
encoding/asn1: don't convert UTCTime to UTC.

Previously we converted a time to UTC *and* serialized the timezone of
the original time. With this change, we serialize a UTCTime in the
original timezone.

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

12 years agocmd/gc: inlining functions with local variables
Luuk van Dijk [Mon, 29 Oct 2012 12:55:27 +0000 (13:55 +0100)]
cmd/gc: inlining functions with local variables

- make sure dclcontext == PAUTO only in function bodies
- introduce PDISCARD to discard declarations in bodies of repeated imports
- skip printing initializing OAS'es in export mode, assuming they only occur after ODCL's
- remove ODCL and the initializing OAS from inl.c:ishairy
- fix confused use of ->typecheck in typecheckinl: it's about the ->inl, not about the fn.
- debuging aids: print ntype on ONAMEs too and -Emm instead of -Ell.

fixes #2812

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

12 years agocmd/gc: escape analysis to track flow of in to out parameters.
Luuk van Dijk [Mon, 29 Oct 2012 12:38:21 +0000 (13:38 +0100)]
cmd/gc: escape analysis to track flow of in to out parameters.

includes step 0: synthesize outparams, from 6600044
includes step 1,2: give outparams loopdepth 0 and verify unchanged results
         generate esc:$mask tags, but still tie to sink if a param has mask != 0
from 6610054

adds final steps:
- have esccall generate n->escretval, a list of nodes the function results flow to
- use these in esccall and ORETURN/OAS2FUNC/and f(g())
- only tie parameters to sink if tag is absent, otherwise according to mask, tie them to escretval

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

12 years agomisc/vim: fix reimport guard and remove K mapping.
Andrew Radev [Mon, 29 Oct 2012 11:10:59 +0000 (22:10 +1100)]
misc/vim: fix reimport guard and remove K mapping.

The "did_ftplugin" lines were ineffective and the "K" mapping was too
invasive, which is why it was removed.

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

12 years agoA+C: Andrey Radev (individual CLA).
David Symonds [Mon, 29 Oct 2012 11:10:45 +0000 (22:10 +1100)]
A+C: Andrey Radev (individual CLA).

R=golang-dev, bradfitz
CC=andrey.radev, golang-dev
https://golang.org/cl/6775067

12 years agomisc/dashboard/codereview: only accept "NOT LGTM" on the first line of a message.
David Symonds [Mon, 29 Oct 2012 11:03:58 +0000 (22:03 +1100)]
misc/dashboard/codereview: only accept "NOT LGTM" on the first line of a message.

Too many people quote entire emails and put their reply at the top ("top posting"),
so we shouldn't recognise review commands anywhere in the review text.

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

12 years agocmd/5g: introduce componentgen for better registerization.
Rémy Oudompheng [Sun, 28 Oct 2012 19:11:21 +0000 (20:11 +0100)]
cmd/5g: introduce componentgen for better registerization.

It is essentially identical to the version in 6g.

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

12 years agocontainer/list: fix typo
Taj Khattra [Sun, 28 Oct 2012 10:16:50 +0000 (21:16 +1100)]
container/list: fix typo

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

12 years agosort: Fixed a typo in the documentation for SearchStrings.
Patrick Smith [Sat, 27 Oct 2012 23:07:59 +0000 (10:07 +1100)]
sort: Fixed a typo in the documentation for SearchStrings.

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

12 years agosyscall: fix creds_test to reliably close os.File
Ian Lance Taylor [Fri, 26 Oct 2012 17:31:03 +0000 (10:31 -0700)]
syscall: fix creds_test to reliably close os.File

Before this patch the test would close the file descriptor but
not the os.File.  When the os.File was GC'ed, the finalizer
would close the file descriptor again.  That would cause
problems if the same file descriptor were returned by a later
call to open in another test.

On my system:

> GOGC=30 go test
--- FAIL: TestPassFD (0.04 seconds)
passfd_test.go:62:  FileConn: dup: bad file descriptor
FAIL

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

12 years agoencoding/binary: ReadVarint reads a signed number, not unsigned number
Shenghou Ma [Fri, 26 Oct 2012 13:14:34 +0000 (21:14 +0800)]
encoding/binary: ReadVarint reads a signed number, not unsigned number

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

12 years agonet: avoid allocation in setAddr
Dave Cheney [Fri, 26 Oct 2012 08:41:21 +0000 (19:41 +1100)]
net: avoid allocation in setAddr

setAddr was showing up in profiles due to string concatenation construction the os.File name field. netFD.sysfile's Name() is never used, except in dup() so I believe it is safe to avoid this allocation.

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

12 years agocmd/5g: peep.c: reactivate some optimisations
Dave Cheney [Fri, 26 Oct 2012 07:19:10 +0000 (18:19 +1100)]
cmd/5g: peep.c: reactivate some optimisations

Thanks to Minux and Remy for their advice.

The EOR optimisation is applied to a few places in the stdlib.

// hash/crc32/crc32.go
func update(crc uint32, tab *Table, p []byte) uint32 {
crc = ^crc
for _, v := range p {
         crc = tab[byte(crc)^v] ^ (crc >> 8)
}
return ^crc
}

before:

--- prog list "update" ---
0164 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:101) TEXT        update+0(SB),$12-24
0165 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:101) MOVW        tab+4(FP),R8
0166 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:102) MOVW        crc+0(FP),R0
0167 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:102) EOR         $-1,R0,R5
0168 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:103) MOVW        p+8(FP),R0
0169 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:103) MOVW        R0,autotmp_0019+-12(SP)

after:

--- prog list "update" ---
0164 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:101) TEXT        update+0(SB),$12-24
0165 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:101) MOVW        tab+4(FP),R8
0166 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:102) MOVW        crc+0(FP),R0
0167 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:102) MVN         R0,R5
0168 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:103) MOVW        p+8(FP),R0
0169 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:103) MOVW        R0,autotmp_0019+-12(SP)

After 5l has done its work,

        crc = ^crc
   3d710:       e59d0014        ldr     r0, [sp, #20]
   3d714:       e3e0b000        mvn     fp, #0
   3d718:       e020500b        eor     r5, r0, fp

becomes

        crc = ^crc
   3d710:       e59d0014        ldr     r0, [sp, #20]
   3d714:       e1e05000        mvn     r5, r0

The MOVB optimisation has a small impact on the stdlib, in strconv
and gzip.

// GZIP (RFC 1952) is little-endian, unlike ZLIB (RFC 1950).
func put2(p []byte, v uint16) {
        p[0] = uint8(v >> 0)
        p[1] = uint8(v >> 8)
}

before:

--- prog list "put2" ---
1369 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:76) TEXT       put2+0(SB),$0-16
1370 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:76) MOVHU      v+12(FP),R4
1371 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:77) MOVHU      R4,R0
1372 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:77) MOVHU      R0,R0
1373 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:77) MOVBU      R0,R1
1374 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:77) MOVBU      R1,R3
1375 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:77) MOVW       $p+0(FP),R1

after:

--- prog list "put2" ---
1369 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:76) TEXT       put2+0(SB),$0-16
1370 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:76) MOVHU      v+12(FP),R4
1371 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:77) MOVHU      R4,R0
1372 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:77) MOVBU      R0,R1
1373 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:77) MOVBU      R1,R3
1374 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:77) MOVW       $p+0(FP),R1

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

12 years agoreflect: stop thinking that MaxFloat32 overflows float32.
Rémy Oudompheng [Fri, 26 Oct 2012 06:39:36 +0000 (08:39 +0200)]
reflect: stop thinking that MaxFloat32 overflows float32.

Fixes #4282.

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

12 years agoruntime: switch to 64-bit goroutine ids
Dmitriy Vyukov [Fri, 26 Oct 2012 06:13:06 +0000 (10:13 +0400)]
runtime: switch to 64-bit goroutine ids
Fixes #4275.

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

12 years agocmd/6g: fix crash in cgen_bmul.
Rémy Oudompheng [Thu, 25 Oct 2012 22:29:44 +0000 (00:29 +0200)]
cmd/6g: fix crash in cgen_bmul.

Used to print:
../test/torture.go:116: internal compiler error: bad width: 0463 (../test/torture.go:116) MOVB    ,BX (0, 8)

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

12 years agoexp/locale/collate: slightly changed collation elements:
Marcel van Lohuizen [Thu, 25 Oct 2012 11:02:31 +0000 (13:02 +0200)]
exp/locale/collate: slightly changed collation elements:
- Allow secondary values below the default value in second form. This is
  to support before tags for secondary values, as used by Chinese.
- Eliminate collation elements that are guaranteed to be immaterial
  after a weight increment.

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

12 years agosyscall: implement (*PtraceRegs).PC() and SetPC()
Shenghou Ma [Thu, 25 Oct 2012 05:41:04 +0000 (13:41 +0800)]
syscall: implement (*PtraceRegs).PC() and SetPC()

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

12 years agodoc: remove misplaced articles from references page
Andrew Gerrand [Thu, 25 Oct 2012 00:05:42 +0000 (11:05 +1100)]
doc: remove misplaced articles from references page

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

12 years agoexp/locale/collate/build: fixed problem where blocks for first byte need
Marcel van Lohuizen [Wed, 24 Oct 2012 09:41:05 +0000 (11:41 +0200)]
exp/locale/collate/build: fixed problem where blocks for first byte need
different indexes for values and index blocks. Fixes many regressions.

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

12 years agoexp/locale/collate: clarification in comments on use of returned value.
Marcel van Lohuizen [Wed, 24 Oct 2012 09:40:32 +0000 (11:40 +0200)]
exp/locale/collate: clarification in comments on use of returned value.

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

12 years agoexp/locale/collate/tools/colcmp: add locale to output of regression failure.
Marcel van Lohuizen [Wed, 24 Oct 2012 09:28:18 +0000 (11:28 +0200)]
exp/locale/collate/tools/colcmp: add locale to output of regression failure.

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

12 years agocmd/gc, cmd/ld: use go.weak instead of weak as the weak symbol prefix
Russ Cox [Tue, 23 Oct 2012 15:16:08 +0000 (11:16 -0400)]
cmd/gc, cmd/ld: use go.weak instead of weak as the weak symbol prefix

Also defend our symbol prefixes (now just "go" and "type")
from use as import paths.

Fixes #4257.

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

12 years agoruntime, runtime/race: add missing if(raceenabled), update package docs of pkg race
Shenghou Ma [Mon, 22 Oct 2012 18:33:51 +0000 (02:33 +0800)]
runtime, runtime/race: add missing if(raceenabled), update package docs of pkg race

R=dvyukov
CC=golang-dev
https://golang.org/cl/6733058

12 years agoexp/type/staging: implemented recent spec changes
Robert Griesemer [Mon, 22 Oct 2012 18:28:21 +0000 (11:28 -0700)]
exp/type/staging: implemented recent spec changes

Also:
- type-checking receivers
- get rid of some multiple errors at the same position

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

12 years agocmd/gc: Mark use of builtin functions as calls.
Daniel Morsing [Mon, 22 Oct 2012 17:14:30 +0000 (19:14 +0200)]
cmd/gc: Mark use of builtin functions as calls.

Fixes #4097.

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

12 years agocmd/5l, cmd/6l, cmd/8l: put floating point numbers in .rodata section
Shenghou Ma [Mon, 22 Oct 2012 16:59:53 +0000 (00:59 +0800)]
cmd/5l, cmd/6l, cmd/8l: put floating point numbers in .rodata section

R=golang-dev, rsc
CC=0xe2.0x9a.0x9b, golang-dev
https://golang.org/cl/6742063

12 years agocmd/gc: escape analysis to track flow of in to out parameters.
Luuk van Dijk [Mon, 22 Oct 2012 08:18:17 +0000 (10:18 +0200)]
cmd/gc: escape analysis to track flow of in to out parameters.

includes step 0: synthesize outparams, from 6600044
step 1: give outparams loopdepth 0 and verify unchanged results
step 2: generate esc:$mask tags, but still tie to sink if a param has mask != 0
next step: use in esccall (and ORETURN with implicit OAS2FUNC) to avoid tying to sink

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

12 years agocmd/gc: track parameter flow, step 0: synthesize name nodes for anonymous PPARAMOUTs...
Luuk van Dijk [Mon, 22 Oct 2012 08:09:52 +0000 (10:09 +0200)]
cmd/gc: track parameter flow, step 0: synthesize name nodes for anonymous PPARAMOUTs without breaking anything.

further work on parameter flow tracking for escape analysis depends on this.

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

12 years agocmd/gc: fix strict tree property for AST for OAS2RECV nodes.
Luuk van Dijk [Mon, 22 Oct 2012 08:01:14 +0000 (10:01 +0200)]
cmd/gc: fix strict tree property for AST for OAS2RECV nodes.

in typecheck and walk, conversion from OAS2RECV to OAS2
and to OSELRECV2 duplicated the ->rlist->n to ->right
thereby destroying the strict tree-ness of the AST (up to
ONAMES) of course.  Several recursions in esc.c and inl.c
and probably elsewhere assume nodes of the tree aren't duplicated.
rather than defensively code around this, i'd rather assert
these cases away and fix their cause.

(this was tripped in 6741044)

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

12 years agocmd/go: add join template function.
Roger Peppe [Mon, 22 Oct 2012 07:58:27 +0000 (08:58 +0100)]
cmd/go: add join template function.

It's common to use the go list command in shell scripts, but
currently it's awkward to print a string slice from the Package
type in a way that's easily parseable by the shell.  For example:

        go list -f '{{range .Deps}}{{.}}
        {{end}}'

(and even that prints an unwanted new line at the end|).

To make this easier, this CL adds a "join" function to the
format template.

        go list -f '{{join .Deps "\n"}}'

R=rsc, dsymonds, minux.ma, remyoudompheng, r
CC=golang-dev
https://golang.org/cl/6680044

12 years agocmd/gc: fix inlining bug for composite literals in if statements.
Rémy Oudompheng [Mon, 22 Oct 2012 06:38:23 +0000 (08:38 +0200)]
cmd/gc: fix inlining bug for composite literals in if statements.

Fixes #4230.

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

12 years agolib9, cmd/dist, cmd/5l: embed GOARM into cmd/5l and auto detect GOARM
Shenghou Ma [Mon, 22 Oct 2012 06:26:36 +0000 (14:26 +0800)]
lib9, cmd/dist, cmd/5l: embed GOARM into cmd/5l and auto detect GOARM

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

12 years agoos: fix documentation typos: s/an array/a slice/.
Nigel Tao [Mon, 22 Oct 2012 05:26:47 +0000 (16:26 +1100)]
os: fix documentation typos: s/an array/a slice/.

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

12 years agoencoding/xml: expand allowed entity names
Patrick Smith [Mon, 22 Oct 2012 00:33:24 +0000 (20:33 -0400)]
encoding/xml: expand allowed entity names

Previously, multi-byte characters were not allowed. Also certain single-byte
characters, such as '-', were disallowed.
Fixes #3813.

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

12 years agoruntime: sizeclass in MSpan should be int32.
Jingcheng Zhang [Mon, 22 Oct 2012 00:32:43 +0000 (20:32 -0400)]
runtime: sizeclass in MSpan should be int32.

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

12 years agoA+C: Jingcheng Zhang and Patrick Smith (individual CLA x2)
Russ Cox [Mon, 22 Oct 2012 00:32:35 +0000 (20:32 -0400)]
A+C: Jingcheng Zhang and Patrick Smith (individual CLA x2)

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

12 years agogo/build: document the behavior of multiple build constraints.
Nigel Tao [Mon, 22 Oct 2012 00:15:17 +0000 (11:15 +1100)]
go/build: document the behavior of multiple build constraints.

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

12 years agoA+C: Richard Eric Gavaletz (individual CLA)
Andrew Gerrand [Sun, 21 Oct 2012 22:21:57 +0000 (09:21 +1100)]
A+C: Richard Eric Gavaletz (individual CLA)

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

12 years agoruntime: store types of allocated objects
Jan Ziak [Sun, 21 Oct 2012 21:41:32 +0000 (17:41 -0400)]
runtime: store types of allocated objects

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

12 years agonet: add test for Conn, PacketConn and Listener
Mikio Hara [Sun, 21 Oct 2012 21:17:51 +0000 (17:17 -0400)]
net: add test for Conn, PacketConn and Listener

I just realized that there is no good place for adding
exposed function or method tests because server, unicast
and multicast_test.go do test complicated multiple test
objects, platform behaviros, protocol behaviors and API,
at the same time. Perhaps splitting them into per test
object might be better, so this CL provides tests focused
on API.

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

12 years agocmd/gc: rebuild builtin.c
Russ Cox [Sun, 21 Oct 2012 21:15:56 +0000 (17:15 -0400)]
cmd/gc: rebuild builtin.c

Was not in sync with runtime.go, but the diffs
didn't really matter, so nothing broke.

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

12 years agobuild: u.h for plan9 arm
Lucio De Re [Sun, 21 Oct 2012 21:04:07 +0000 (17:04 -0400)]
build: u.h for plan9 arm

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

12 years agoreflect: make Index and Slice accept strings
Evan Shaw [Sun, 21 Oct 2012 21:02:10 +0000 (17:02 -0400)]
reflect: make Index and Slice accept strings

Fixes #3284.

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

12 years agocmd/gc: fix confusing error when using variable as type.
Daniel Morsing [Sun, 21 Oct 2012 18:50:31 +0000 (20:50 +0200)]
cmd/gc: fix confusing error when using variable as type.

Fixes #3783.

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

12 years agocmd/gc: Friendlier errors on oversized arrays.
Daniel Morsing [Sun, 21 Oct 2012 17:22:51 +0000 (19:22 +0200)]
cmd/gc: Friendlier errors on oversized arrays.

Someone new to the language may not know the connection between ints and arrays, which was the only thing that the previous error told you anything about.

Fixes #4256.

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

12 years agoruntime: update docs for MemStats.PauseNs
Shenghou Ma [Sun, 21 Oct 2012 17:08:13 +0000 (01:08 +0800)]
runtime: update docs for MemStats.PauseNs
   PauseNs is a circular buffer of recent pause times, and the
most recent one is at [((NumGC-1)+256)%256].

   Also fix comments cross-linking the Go and C definition of
various structs.

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

12 years agogophertool: fix links
Shenghou Ma [Sun, 21 Oct 2012 17:05:21 +0000 (01:05 +0800)]
gophertool: fix links

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

12 years agoA+C: add Willem van der Schyff (Individual CLA).
Adam Langley [Sun, 21 Oct 2012 03:20:17 +0000 (14:20 +1100)]
A+C: add Willem van der Schyff (Individual CLA).

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

12 years agocmd/go: make package list order predicable
Shenghou Ma [Sat, 20 Oct 2012 09:25:13 +0000 (17:25 +0800)]
cmd/go: make package list order predicable
also add a cleanup phase to cmd/go/test.bash.

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

12 years agocodereview: protect against read-only upstream repository
Shenghou Ma [Sat, 20 Oct 2012 09:23:48 +0000 (17:23 +0800)]
codereview: protect against read-only upstream repository

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

12 years agoruntime: ~3.7x speed up of div/mod on ARM
Shenghou Ma [Sat, 20 Oct 2012 08:40:19 +0000 (16:40 +0800)]
runtime: ~3.7x speed up of div/mod on ARM
benchmark                      old ns/op    new ns/op    delta
BenchmarkUint32Div7                  281           75  -73.06%
BenchmarkUint32Div37                 281           75  -73.02%
BenchmarkUint32Div123                281           75  -73.02%
BenchmarkUint32Div763                280           75  -72.89%
BenchmarkUint32Div1247               280           75  -72.93%
BenchmarkUint32Div9305               281           75  -73.02%
BenchmarkUint32Div13307              281           75  -73.06%
BenchmarkUint32Div52513              281           75  -72.99%
BenchmarkUint32Div60978747           281           63  -77.33%
BenchmarkUint32Div106956295          280           63  -77.21%
BenchmarkUint32Mod7                  280           77  -72.21%
BenchmarkUint32Mod37                 280           77  -72.18%
BenchmarkUint32Mod123                280           77  -72.25%
BenchmarkUint32Mod763                280           77  -72.18%
BenchmarkUint32Mod1247               280           77  -72.21%
BenchmarkUint32Mod9305               280           77  -72.21%
BenchmarkUint32Mod13307              280           77  -72.25%
BenchmarkUint32Mod52513              280           77  -72.18%
BenchmarkUint32Mod60978747           280           63  -77.25%
BenchmarkUint32Mod106956295          280           63  -77.21%

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

12 years agobufio: remove a little unnecessary indirection in tests.
Nigel Tao [Sat, 20 Oct 2012 02:02:29 +0000 (13:02 +1100)]
bufio: remove a little unnecessary indirection in tests.

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

12 years agogo spec: constant divisors must not be zero
Robert Griesemer [Fri, 19 Oct 2012 17:12:09 +0000 (10:12 -0700)]
go spec: constant divisors must not be zero

Both gc and gccgo always checked this for constant
expressions but the spec only mentions run-time
exceptions.

This CL also requires that constant divisors
must not be zero in non-constant integer expressions:
This is consistent with the spirit of the most
recent changes and it is consistent with constant
expressions. We don't want to specify the effect for
non-integer expressions (f/0.0 where f is a float or
complex number) because there the result f/g is not
further specified if a non-constant g is 0.

R=r, rsc, iant, ken, andybalholm, iant
CC=golang-dev
https://golang.org/cl/6710045

12 years agogo spec: define make() restrictions as for index expressions
Robert Griesemer [Fri, 19 Oct 2012 17:11:06 +0000 (10:11 -0700)]
go spec: define make() restrictions as for index expressions

This is a language change: Until now, the spec required run-
time panics for some of these errors. Note that gc and gccgo
implemented this inconsistently, and that both compilers already
reported compile-time errors in some cases. This change makes
make() behave along the same vein as index expressions.

This addresses the spec aspect of issue 4085.

R=r, rsc, iant, ken
CC=golang-dev
https://golang.org/cl/6725053

12 years agounsafe: fix a typo
Oling Cat [Fri, 19 Oct 2012 05:35:15 +0000 (16:35 +1100)]
unsafe: fix a typo

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

12 years agobufio: make Writer.ReadFrom not flush prematurely. For example,
Nigel Tao [Fri, 19 Oct 2012 05:32:00 +0000 (16:32 +1100)]
bufio: make Writer.ReadFrom not flush prematurely. For example,
many small writes to a network may be less efficient that a few
large writes.

This fixes net/http's TestClientWrites, broken by 6565056 that
introduced Writer.ReadFrom. That test implicitly assumed that
calling io.Copy on a *bufio.Writer wouldn't write to the
underlying network until the buffer was full.

R=dsymonds
CC=bradfitz, golang-dev, mchaten, mikioh.mikioh
https://golang.org/cl/6743044

12 years agobufio: Implement io.ReaderFrom for (*Writer).
Michael Chaten [Fri, 19 Oct 2012 00:22:51 +0000 (11:22 +1100)]
bufio: Implement io.ReaderFrom for (*Writer).

This is part 2 of 2 for issue 4028.

benchmark                        old ns/op    new ns/op    delta
BenchmarkWriterCopyOptimal           53293        28326  -46.85%
BenchmarkWriterCopyUnoptimal         53757        30537  -43.19%
BenchmarkWriterCopyNoReadFrom        53192        36642  -31.11%

Fixes #4028.

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

12 years agoruntime: update comment for the "extern register" variables g and m.
Nigel Tao [Fri, 19 Oct 2012 00:02:32 +0000 (11:02 +1100)]
runtime: update comment for the "extern register" variables g and m.

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

12 years agoimage/draw: fast-path for 4:4:0 chroma subsampled sources.
Nigel Tao [Thu, 18 Oct 2012 23:55:41 +0000 (10:55 +1100)]
image/draw: fast-path for 4:4:0 chroma subsampled sources.

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

12 years agoencoding/xml: correctly escape newline, carriage return, and tab
Ian Lance Taylor [Thu, 18 Oct 2012 20:40:45 +0000 (13:40 -0700)]
encoding/xml: correctly escape newline, carriage return, and tab

The generated encodings are those from
http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charescaping

The change to the decoder ensures that we turn 
 in the
input into \r, not \n.

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

12 years agoimage/jpeg: make TestDCT faster.
Rémy Oudompheng [Thu, 18 Oct 2012 19:28:04 +0000 (21:28 +0200)]
image/jpeg: make TestDCT faster.

The value of cosines are cached in a global array
instead of being recomputed each time.
The test was terribly slow on arm.

R=golang-dev, dave, nigeltao
CC=golang-dev
https://golang.org/cl/6733046

12 years agonet: add LookupNS(domain string)
Stephen McQuay [Thu, 18 Oct 2012 06:39:04 +0000 (15:39 +0900)]
net: add LookupNS(domain string)
Fixes #4224.

R=golang-dev, dave, minux.ma, mikioh.mikioh, alex.brainman, rsc, herbert.fischer
CC=golang-dev
https://golang.org/cl/6675043

12 years agoA+C: Stephen McQuay (Individual CLA)
Mikio Hara [Thu, 18 Oct 2012 06:37:53 +0000 (15:37 +0900)]
A+C: Stephen McQuay (Individual CLA)

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

12 years agoexp/html: update package docs and add an example; a node's children is
Nigel Tao [Wed, 17 Oct 2012 23:25:50 +0000 (10:25 +1100)]
exp/html: update package docs and add an example; a node's children is
a linked list, not a slice.

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

12 years agodoc/codewalk/markov: fix the highlight range of the step "The NewChain constructor...
Oling Cat [Wed, 17 Oct 2012 21:12:44 +0000 (08:12 +1100)]
doc/codewalk/markov: fix the highlight range of the step "The NewChain constructor function".

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

12 years agocmd/gc: don't squash complex literals when inlining.
Rémy Oudompheng [Wed, 17 Oct 2012 18:33:44 +0000 (20:33 +0200)]
cmd/gc: don't squash complex literals when inlining.

Since this patch changes the way complex literals are written
in export data, there are a few other glitches.

Fixes #4159.

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

12 years agocrypto/cipher: panic on invalid IV length
Shane Hansen [Wed, 17 Oct 2012 18:29:00 +0000 (14:29 -0400)]
crypto/cipher: panic on invalid IV length

Give better user feedback when invalid IV is used
to construct a cipher.

Fixes #3411

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

12 years agoA+C: add Shane Hansen (Individual CLA)
Adam Langley [Wed, 17 Oct 2012 18:21:58 +0000 (14:21 -0400)]
A+C: add Shane Hansen (Individual CLA)

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

12 years agogo spec: restrictions for index and slice expressions
Robert Griesemer [Wed, 17 Oct 2012 18:08:42 +0000 (11:08 -0700)]
go spec: restrictions for index and slice expressions

At the moment, gc and gccgo report compile-
time errors for certain constant indexes that
are out of bounds. The spec however requests
a run-time panic for out-of-bounds indexes
(http://tip.golang.org/ref/spec#Indexes).

Document the status quo.

Fixes #4231.

R=r, rsc, iant, ken
CC=golang-dev
https://golang.org/cl/6699048

12 years agocmd/go: Dedup package arguments before building.
Daniel Morsing [Wed, 17 Oct 2012 15:23:47 +0000 (17:23 +0200)]
cmd/go: Dedup package arguments before building.

Fixes #4104.

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

12 years agomath/big: add 4-bit, fixed window exponentiation.
Adam Langley [Wed, 17 Oct 2012 15:19:26 +0000 (11:19 -0400)]
math/big: add 4-bit, fixed window exponentiation.

A 4-bit window is convenient because 4 divides both 32 and 64,
therefore we never have a window spanning words of the exponent.
Additionaly, the benefit of a 5-bit window is only 2.6% at 1024-bits
and 3.3% at 2048-bits.

This code is still not constant time, however.

benchmark                        old ns/op    new ns/op    delta
BenchmarkRSA2048Decrypt           17108590     11180370  -34.65%
Benchmark3PrimeRSA2048Decrypt     13003720      7680390  -40.94%

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

12 years agosync/atomic: FreeBSD/ARM support
Shenghou Ma [Wed, 17 Oct 2012 06:27:58 +0000 (14:27 +0800)]
sync/atomic: FreeBSD/ARM support
only supports ARMv6K and newer ARM cores.

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

12 years agopath/filepath: better documentation for WalkFunc
Rob Pike [Wed, 17 Oct 2012 05:00:09 +0000 (16:00 +1100)]
path/filepath: better documentation for WalkFunc
Define the properties of the arguments better. In particular,
explain that the path is (sort of) relative to the argument to
Walk.

Fixes #4119.

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