]> Cypherpunks repositories - gostls13.git/log
gostls13.git
11 years agoruntime: fix race condition between GC and setGCPercent
Dmitriy Vyukov [Sat, 15 Jun 2013 12:07:06 +0000 (16:07 +0400)]
runtime: fix race condition between GC and setGCPercent
If first GC runs concurrently with setGCPercent,
it can overwrite gcpercent value with default.

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

11 years agoruntime: improve scheduler fairness
Dmitriy Vyukov [Sat, 15 Jun 2013 12:06:28 +0000 (16:06 +0400)]
runtime: improve scheduler fairness
Currently global runqueue is starved if a group of goroutines
constantly respawn each other (local runqueue never becomes empty).
Fixes #5639.

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

11 years agoruntime: remove unused moreframesize_minalloc field
Dmitriy Vyukov [Sat, 15 Jun 2013 12:02:39 +0000 (16:02 +0400)]
runtime: remove unused moreframesize_minalloc field
It was used to request large stack segment for GC
when it was running not on g0.
Now GC is running on g0 with large stack,
and it is not needed anymore.

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

11 years agocmd/godoc: don't link unexported identifiers
Jonathan Rudenberg [Fri, 14 Jun 2013 19:37:23 +0000 (12:37 -0700)]
cmd/godoc: don't link unexported identifiers

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

11 years agoruntime: garbage collector runs on g0 now.
Keith Randall [Fri, 14 Jun 2013 18:42:51 +0000 (11:42 -0700)]
runtime: garbage collector runs on g0 now.
No need to change to Grunnable state.
Add some more checks for Grunning state.

R=golang-dev, rsc, khr, dvyukov
CC=golang-dev
https://golang.org/cl/10186045

11 years agoapi: update next.txt
Brad Fitzpatrick [Fri, 14 Jun 2013 17:00:07 +0000 (10:00 -0700)]
api: update next.txt

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

11 years agonet: coalesce duplicate in-flight DNS lookups
Brad Fitzpatrick [Fri, 14 Jun 2013 15:59:43 +0000 (08:59 -0700)]
net: coalesce duplicate in-flight DNS lookups

In Issue 5625, Russ says: "We should at least have a cache of
inflight lookups, so that 100 simultaneous dials of one host
name don't do the work 100x. That's easy and (assume we forget
the answer once they all get it) doesn't pose any consistency
problems. It just merges simultaneous work."

This brings in singleflight (unexported) from Google /
Camlistore, but without its tests. Maybe we should put it
somewhere in the standard library. But not now.

Update #5625

R=golang-dev, iant, cespare, rsc, dave, rogpeppe, remyoudompheng
CC=golang-dev
https://golang.org/cl/10079043

11 years agocmd/gc: instrument arrays properly in race detector.
Rémy Oudompheng [Fri, 14 Jun 2013 09:14:45 +0000 (11:14 +0200)]
cmd/gc: instrument arrays properly in race detector.

The previous implementation would only record access to
the address of the array but the memory access to the whole
memory range must be recorded instead.

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

11 years agostrconv: corrected several bad references to err.Error in doc comments.
Caleb Spare [Fri, 14 Jun 2013 00:04:47 +0000 (17:04 -0700)]
strconv: corrected several bad references to err.Error in doc comments.

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

11 years agocmd/go: change to use struct in go test -cover
Rob Pike [Thu, 13 Jun 2013 20:12:58 +0000 (13:12 -0700)]
cmd/go: change to use struct in go test -cover
Go tool half of https://golang.org/cl/10271044

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

11 years agogo/ast: add {L,R}paren token.Pos field to ast.TypeAssertExpr.
Alan Donovan [Thu, 13 Jun 2013 18:41:44 +0000 (14:41 -0400)]
go/ast: add {L,R}paren token.Pos field to ast.TypeAssertExpr.

These are required to correctly determine the End() of the node.

Also set these fields in go/parser and use them in go/printer.

This is a backward-compatible API change.

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

11 years agoruntime: fix bug introduced in cl/10256043
Dmitriy Vyukov [Thu, 13 Jun 2013 12:40:10 +0000 (16:40 +0400)]
runtime: fix bug introduced in cl/10256043

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

11 years agoruntime/race: remove now unused step parameter from range access functions
Dmitriy Vyukov [Thu, 13 Jun 2013 12:38:44 +0000 (16:38 +0400)]
runtime/race: remove now unused step parameter from range access functions

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

11 years agocmd/gc: properly race-instrument for loops
Dmitriy Vyukov [Thu, 13 Jun 2013 12:03:58 +0000 (16:03 +0400)]
cmd/gc: properly race-instrument for loops
Instrumentation of ntest expression should go to ntest->init.
Same for nincr.
Fixes #5340.

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

11 years agoruntime: use ROUND macro for rounding
Dmitriy Vyukov [Thu, 13 Jun 2013 12:02:50 +0000 (16:02 +0400)]
runtime: use ROUND macro for rounding

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

11 years agoruntime/race: update runtime to r183644
Dmitriy Vyukov [Thu, 13 Jun 2013 10:32:05 +0000 (14:32 +0400)]
runtime/race: update runtime to r183644
This revision properly handles memory range accesses.
Fixes #4453.
Fixes #5654.

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

11 years agomisc/vim: Adding flag-guarding for Vim commands
Josh Hoak [Thu, 13 Jun 2013 05:07:09 +0000 (15:07 +1000)]
misc/vim: Adding flag-guarding for Vim commands

Default behavior is the same as before, but now a user may selectively disable some commands.

Also: deleted the mappings for import.vim.

Tested: by trying the commands for fmt, import and godoc in succession to make sure they still work. Also, ran test.sh in ftplugin/go.

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

11 years agotag go1.1.1
Andrew Gerrand [Thu, 13 Jun 2013 02:52:02 +0000 (12:52 +1000)]
tag go1.1.1

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

11 years agodoc: add go1.1.1 to the release notes
Andrew Gerrand [Thu, 13 Jun 2013 02:43:26 +0000 (12:43 +1000)]
doc: add go1.1.1 to the release notes

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

11 years agotesting: add -outputdir flag so "go test" controls where the files are written
Rob Pike [Thu, 13 Jun 2013 01:13:34 +0000 (18:13 -0700)]
testing: add -outputdir flag so "go test" controls where the files are written
Obscure misfeature now fixed: When run from "go test", profiles were always
written in the package's source directory. This change puts them in the directory
where "go test" is run.
Also fix a couple of problems causing errors in testing.after to go unreported
unless -v was set.

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

11 years agoruntime: update runtime·gogo comment in asm files
Ian Lance Taylor [Wed, 12 Jun 2013 22:05:10 +0000 (15:05 -0700)]
runtime: update runtime·gogo comment in asm files

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

11 years agoruntime: add lr, ctxt, ret to Gobuf
Russ Cox [Wed, 12 Jun 2013 19:22:26 +0000 (15:22 -0400)]
runtime: add lr, ctxt, ret to Gobuf

Add gostartcall and gostartcallfn.
The old gogocall = gostartcall + gogo.
The old gogocallfn = gostartcallfn + gogo.

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

11 years agoruntime: more flexible heap memory mapping on 64-bits
Dmitriy Vyukov [Wed, 12 Jun 2013 14:47:16 +0000 (18:47 +0400)]
runtime: more flexible heap memory mapping on 64-bits
Fixes #5641.

R=golang-dev, dave, daniel.morsing, iant
CC=golang-dev, kcc
https://golang.org/cl/10126044

11 years agoruntime: fix scheduler race condition
Dmitriy Vyukov [Wed, 12 Jun 2013 14:46:35 +0000 (18:46 +0400)]
runtime: fix scheduler race condition
In starttheworld() we assume that P's with local work
are situated in the beginning of idle P list.
However, once we start the first M, it can execute all local G's
and steal G's from other P's.
That breaks the assumption above. Thus starttheworld() will fail
to start some P's with local work.
It seems that it can not lead to very bad things, but still
it's wrong and breaks other assumtions
(e.g. we can have a spinning M with local work).
The fix is to collect all P's with local work first,
and only then start them.

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

11 years agoruntime: fix plan9, windows builds
Russ Cox [Wed, 12 Jun 2013 13:41:29 +0000 (09:41 -0400)]
runtime: fix plan9, windows builds

TBR=dvyukov
CC=golang-dev
https://golang.org/cl/10229043

11 years agoruntime: fix build
Russ Cox [Wed, 12 Jun 2013 13:06:28 +0000 (09:06 -0400)]
runtime: fix build

TBR=dvyukov
CC=golang-dev
https://golang.org/cl/10227044

11 years agoruntime: adjust traceback / garbage collector boundary
Russ Cox [Wed, 12 Jun 2013 12:49:38 +0000 (08:49 -0400)]
runtime: adjust traceback / garbage collector boundary

The garbage collection routine addframeroots is duplicating
logic in the traceback routine that calls it, sometimes correctly,
sometimes incorrectly, sometimes incompletely.
Pass necessary information to addframeroots instead of
deriving it anew.

Should make addframeroots significantly more robust.
It's certainly smaller.

Also try to standardize on uintptr for saved pc, sp values.

Will make CL 10036044 trivial.

R=golang-dev, dave, dvyukov
CC=golang-dev
https://golang.org/cl/10169045

11 years agocmd/go: diagnose invalid coverage runs
Russ Cox [Wed, 12 Jun 2013 12:42:05 +0000 (08:42 -0400)]
cmd/go: diagnose invalid coverage runs

# bufio
coverage analysis cannot handle package (bufio_test imports testing imports bufio)
# bytes
coverage analysis cannot handle package (bytes_test imports encoding/base64 imports bytes)
# crypto/cipher
coverage analysis cannot handle package (cipher_test imports crypto/aes imports crypto/cipher)
# debug/dwarf
coverage analysis cannot handle package (dwarf_test imports debug/elf imports debug/dwarf)
# errors
coverage analysis cannot handle package (errors_test imports fmt imports errors)
# flag
coverage analysis cannot handle package (flag_test imports testing imports flag)
# fmt
coverage analysis cannot handle package (fmt_test imports testing imports fmt)
# go/ast
coverage analysis cannot handle package (ast_test imports go/format imports go/ast)
# image
coverage analysis cannot handle package (image_test imports image/gif imports image)
# io
coverage analysis cannot handle package (io_test imports bytes imports io)
# math
coverage analysis cannot handle package (math_test imports fmt imports math)
# net/http
coverage analysis cannot handle package (http_test imports net/http/httptest imports net/http)
# os
coverage analysis cannot handle package (os_test imports flag imports os)
# path/filepath
coverage analysis cannot handle package (filepath_test imports io/ioutil imports path/filepath)
# reflect
coverage analysis cannot handle package (reflect_test imports flag imports reflect)
# runtime
coverage analysis cannot handle package (runtime_test imports fmt imports runtime)
# runtime/pprof
coverage analysis cannot handle package (pprof_test imports testing imports runtime/pprof)
# sort
coverage analysis cannot handle package (sort_test imports testing imports sort)
# strconv
coverage analysis cannot handle package (strconv_test imports fmt imports strconv)
# strings
coverage analysis cannot handle package (strings_test imports testing imports strings)
# sync
coverage analysis cannot handle package (sync_test imports fmt imports sync)
# sync/atomic
coverage analysis cannot handle package (atomic_test imports testing imports sync/atomic)
# syscall
coverage analysis cannot handle package (syscall_test imports flag imports syscall)
# text/tabwriter
coverage analysis cannot handle package (tabwriter_test imports testing imports text/tabwriter)
# time
coverage analysis cannot handle package (time_test imports encoding/gob imports time)
# unicode
coverage analysis cannot handle package (unicode_test imports testing imports unicode)
# unicode/utf8
coverage analysis cannot handle package (utf8_test imports bytes imports unicode/utf8)

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

11 years agocmd/go: clarify test filenames in help messages
Shenghou Ma [Wed, 12 Jun 2013 11:40:58 +0000 (19:40 +0800)]
cmd/go: clarify test filenames in help messages
Fixes #5655.

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

11 years agoC: add Josh Hoak (Google CLA).
David Symonds [Wed, 12 Jun 2013 04:05:13 +0000 (14:05 +1000)]
C: add Josh Hoak (Google CLA).

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

11 years agocmd/go: use -o option of cover tool
Rob Pike [Wed, 12 Jun 2013 03:47:35 +0000 (20:47 -0700)]
cmd/go: use -o option of cover tool
Separates correct from erroneous output so errors running the tool will appear
in the log.

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

11 years agocmd/gc: save local var list before inlining
Ian Lance Taylor [Wed, 12 Jun 2013 03:23:21 +0000 (20:23 -0700)]
cmd/gc: save local var list before inlining

This avoids problems with inlining in genwrappers, which
occurs after functions have been compiled.  Compiling a
function may cause some unused local vars to be removed from
the list.  Since a local var may be unused due to
optimization, it is possible that a removed local var winds up
beingused in the inlined version, in which case hilarity
ensues.

Fixes #5515.

R=golang-dev, khr, dave
CC=golang-dev
https://golang.org/cl/10210043

11 years agocmd/gc: turn race detector off for tail-call method wrapper functions
Russ Cox [Wed, 12 Jun 2013 02:37:07 +0000 (22:37 -0400)]
cmd/gc: turn race detector off for tail-call method wrapper functions

It was off in the old implementation (because there was no high-level
description of the function at all). Maybe some day the race detector
should be fixed to handle the wrapper and then enabled for it, but there's
no reason that has to be today.

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

11 years agocmd/ld: supply -s to gcc if -s is passed.
Shenghou Ma [Tue, 11 Jun 2013 22:56:50 +0000 (06:56 +0800)]
cmd/ld: supply -s to gcc if -s is passed.
Fixes #5463.

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

11 years agoruntime: round spans_size up to page boundary
Shenghou Ma [Tue, 11 Jun 2013 21:22:49 +0000 (05:22 +0800)]
runtime: round spans_size up to page boundary
in case we have weird (not page aligned) memory limit.

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

11 years agoruntime: rename _rt0_$GOARCH to _rt0_go
Russ Cox [Tue, 11 Jun 2013 20:49:24 +0000 (16:49 -0400)]
runtime: rename _rt0_$GOARCH to _rt0_go

There's no reason to use a different name on each architecture,
and doing so makes it impossible for portable code to refer to
the original Go runtime entry point. Rename it _rt0_go everywhere.

This is a global search and replace only.

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

11 years agocmd/gc: compute initialization order for top-level blank vars too.
Rémy Oudompheng [Tue, 11 Jun 2013 20:21:51 +0000 (22:21 +0200)]
cmd/gc: compute initialization order for top-level blank vars too.

Fixes #5244.

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

11 years agocmd/gc: avoid creating circular lists when compiling with race detector.
Daniel Morsing [Tue, 11 Jun 2013 19:19:29 +0000 (21:19 +0200)]
cmd/gc: avoid creating circular lists when compiling with race detector.

Fixes #5431.

R=dvyukov, remyoudompheng, rsc
CC=gobot, golang-dev
https://golang.org/cl/9910043

11 years agocmd/go: add coverage analysis
Rob Pike [Tue, 11 Jun 2013 16:35:10 +0000 (09:35 -0700)]
cmd/go: add coverage analysis
This feature is not yet ready for real use. The CL marks a bite-sized
piece that is ready for review. TODOs that remain:
        provide control over output
        produce output without setting -v
        make work on reflect, sync and time packages
                (fail now due to link errors caused by inlining)
        better documentation
Almost all packages work now, though, if clumsily; try:
        go test -v -cover=count encoding/binary

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

11 years agocmd/cc: emit size of locals. Will be used for stack copying.
Keith Randall [Tue, 11 Jun 2013 16:01:27 +0000 (09:01 -0700)]
cmd/cc: emit size of locals.  Will be used for stack copying.

R=cshapiro, dvyukov, khr, rsc
CC=golang-dev
https://golang.org/cl/10005044

11 years agocmd/gc: move genembedtramp into portable code
Russ Cox [Tue, 11 Jun 2013 13:41:49 +0000 (09:41 -0400)]
cmd/gc: move genembedtramp into portable code

Requires adding new linker instruction
        RET f(SB)
meaning return but then immediately call f.
This is what you'd use to implement a tail call after
fiddling with the arguments, but the compiler only
uses it in genwrapper.

This CL eliminates the copy-and-paste genembedtramp
functions from 5g/8g/6g and makes the code run on ARM
for the first time. It removes a small special case for function
generation, which should help Carl a bit, but at the same time
it does not bother to implement general tail call optimization,
which we do not want anyway.

Fixes #5627.

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

11 years agoos: request appropriate access rights before calling windows TerminateProcess
Alex Brainman [Tue, 11 Jun 2013 03:06:38 +0000 (13:06 +1000)]
os: request appropriate access rights before calling windows TerminateProcess

Fixes #5615.

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

11 years agoasn1: Improved encoding/decoding for OID types
Gerasimos Dimitriadis [Mon, 10 Jun 2013 22:14:47 +0000 (18:14 -0400)]
asn1: Improved encoding/decoding for OID types

The first identifier in an Object Identifer must be between 0 and 2
inclusive. The range of values that the second one can take depends
on the value of the first one.
The two first identifiers are not necessarily encoded in a single octet,
but in a varint.

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

11 years agocmd/ld: document -s flag.
Shenghou Ma [Mon, 10 Jun 2013 20:58:02 +0000 (04:58 +0800)]
cmd/ld: document -s flag.

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

11 years agocmd/cc: fix lexbody for negative chars
Russ Cox [Mon, 10 Jun 2013 20:13:25 +0000 (16:13 -0400)]
cmd/cc: fix lexbody for negative chars

The new code matches the code in cc/lex.c and the #define GETC.
This was causing problems scanning runtime·foo if the leading
· byte was returned by the buffer fill.

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

11 years agocmd/5l: use BLX for BL (Rx).
Shenghou Ma [Mon, 10 Jun 2013 19:04:24 +0000 (03:04 +0800)]
cmd/5l: use BLX for BL (Rx).
Fixes #5111.
Update #4718
This CL makes BL (Rx) to use BLX Rx instead of:
MOV LR, PC
MOV PC, Rx

R=cshapiro, rsc
CC=dave, gobot, golang-dev
https://golang.org/cl/9669045

11 years agoruntime: fix one-time memory leak on linux
Dmitriy Vyukov [Mon, 10 Jun 2013 18:59:39 +0000 (22:59 +0400)]
runtime: fix one-time memory leak on linux
Update #5641.

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

11 years agoruntime: catch races between channel close and channel send in select
Dmitriy Vyukov [Mon, 10 Jun 2013 18:58:04 +0000 (22:58 +0400)]
runtime: catch races between channel close and channel send in select

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

11 years agonet: introduce netgo build tag to build a pure Go net package.
Shenghou Ma [Mon, 10 Jun 2013 18:55:16 +0000 (02:55 +0800)]
net: introduce netgo build tag to build a pure Go net package.
Fixes #4078.

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

11 years agodoc/go_spec: more examples for unspecified cases of the evaluation order
Shenghou Ma [Mon, 10 Jun 2013 18:52:07 +0000 (02:52 +0800)]
doc/go_spec: more examples for unspecified cases of the evaluation order

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

11 years agocmd/cgo: makes clang happy by not using __gcc_struct__ attribute.
Shenghou Ma [Mon, 10 Jun 2013 18:51:01 +0000 (02:51 +0800)]
cmd/cgo: makes clang happy by not using __gcc_struct__ attribute.

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

11 years agosyscall: add {Set,Get}priority for Linux, and consistency tests
Shenghou Ma [Mon, 10 Jun 2013 18:47:04 +0000 (02:47 +0800)]
syscall: add {Set,Get}priority for Linux, and consistency tests

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

11 years agoruntime/race: tell race detector what memory Read/Write syscalls touch
Dmitriy Vyukov [Mon, 10 Jun 2013 18:40:35 +0000 (22:40 +0400)]
runtime/race: tell race detector what memory Read/Write syscalls touch
Fixes #5567.

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

11 years agosync: improve race instrumentation of WaitGroup
Dmitriy Vyukov [Mon, 10 Jun 2013 18:38:58 +0000 (22:38 +0400)]
sync: improve race instrumentation of WaitGroup
Do not synchronize Add(1) with Wait().
Imitate read on first Add(1) and write on Wait(),
it allows to catch common misuses of WaitGroup:
- Add() called in the additional goroutine itself
- incorrect reuse of WaitGroup with multiple waiters

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

11 years agocmd/5l: use guaranteed undefined instruction for UNDEF to match [68]l.
Shenghou Ma [Mon, 10 Jun 2013 18:02:42 +0000 (02:02 +0800)]
cmd/5l: use guaranteed undefined instruction for UNDEF to match [68]l.

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

11 years agoos: return io.EOF from windows ReadAt as documented
Alex Brainman [Mon, 10 Jun 2013 09:14:41 +0000 (19:14 +1000)]
os: return io.EOF from windows ReadAt as documented

Fixes #5619.

R=golang-dev, r, peter.armitage, go.peter.90
CC=golang-dev
https://golang.org/cl/9952044

11 years agoruntime: use persistentalloc instead of SysAlloc in FixAlloc
Dmitriy Vyukov [Mon, 10 Jun 2013 05:20:27 +0000 (09:20 +0400)]
runtime: use persistentalloc instead of SysAlloc in FixAlloc
Also reduce FixAlloc allocation granulatiry from 128k to 16k,
small programs do not need that much memory for MCache's and MSpan's.

R=golang-dev, khr
CC=golang-dev
https://golang.org/cl/10140044

11 years agoruntime: use persistentalloc instead of mallocgc in symtab
Dmitriy Vyukov [Mon, 10 Jun 2013 05:17:46 +0000 (09:17 +0400)]
runtime: use persistentalloc instead of mallocgc in symtab
Reduces heap size.

R=golang-dev, khr
CC=golang-dev
https://golang.org/cl/10140043

11 years agoruntime: use persistentalloc instead of SysAlloc in GC
Dmitriy Vyukov [Mon, 10 Jun 2013 05:16:06 +0000 (09:16 +0400)]
runtime: use persistentalloc instead of SysAlloc in GC
Especially important for Windows because it reserves VM
only in multiple of 64k.

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

11 years agoruntime: use persistentalloc instead of mallocgc for itab
Dmitriy Vyukov [Sun, 9 Jun 2013 17:58:35 +0000 (21:58 +0400)]
runtime: use persistentalloc instead of mallocgc for itab
Reduces heap size.

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

11 years agoruntime: use persistentalloc instead of SysAlloc in netpoll
Dmitriy Vyukov [Sun, 9 Jun 2013 17:39:47 +0000 (21:39 +0400)]
runtime: use persistentalloc instead of SysAlloc in netpoll
Especially important for Windows because it reserves VM
only in multiple of 64k.

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

11 years agoruntime: use persistentalloc instead of custom malloc in memory profiler
Dmitriy Vyukov [Sun, 9 Jun 2013 17:38:37 +0000 (21:38 +0400)]
runtime: use persistentalloc instead of custom malloc in memory profiler
Removes code duplication.

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

11 years agodoc/install-source.html: recent ARM and 386 updates
Shenghou Ma [Sun, 9 Jun 2013 15:15:39 +0000 (23:15 +0800)]
doc/install-source.html: recent ARM and 386 updates

R=golang-dev, dave, adg, remyoudompheng, r
CC=golang-dev
https://golang.org/cl/6845083

11 years agocmd/cgo: use gcc_struct attribute for packed structs to work around GCC PR52991.
Shenghou Ma [Sun, 9 Jun 2013 14:06:29 +0000 (22:06 +0800)]
cmd/cgo: use gcc_struct attribute for packed structs to work around GCC PR52991.
Fixes #5603.

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

11 years agoruntime: remove unused file mkversion.c
Shenghou Ma [Sun, 9 Jun 2013 14:04:17 +0000 (22:04 +0800)]
runtime: remove unused file mkversion.c

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

11 years agomisc/pprof: fix html5 doctype declaration
Shenghou Ma [Sun, 9 Jun 2013 14:01:03 +0000 (22:01 +0800)]
misc/pprof: fix html5 doctype declaration

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

11 years agoall: fix typos
Shenghou Ma [Sun, 9 Jun 2013 13:50:24 +0000 (21:50 +0800)]
all: fix typos

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

11 years agocmd/go: update go vet documentation
Roger Peppe [Fri, 7 Jun 2013 18:01:07 +0000 (19:01 +0100)]
cmd/go: update go vet documentation

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

11 years agoruntime: remove unused mid function
Ian Lance Taylor [Fri, 7 Jun 2013 01:10:42 +0000 (18:10 -0700)]
runtime: remove unused mid function

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

11 years agogodoc: always use local jQuery script
Andrew Gerrand [Fri, 7 Jun 2013 00:46:56 +0000 (10:46 +1000)]
godoc: always use local jQuery script

Fixes #5075.

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

11 years agoruntime: remove unused field from Hchan
Dmitriy Vyukov [Thu, 6 Jun 2013 19:06:12 +0000 (23:06 +0400)]
runtime: remove unused field from Hchan
Remove alignment logic as well, it's not respected by chanbuf() anyway.

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

11 years agoruntime: speedup malloc stats collection
Dmitriy Vyukov [Thu, 6 Jun 2013 10:56:50 +0000 (14:56 +0400)]
runtime: speedup malloc stats collection
Count only number of frees, everything else is derivable
and does not need to be counted on every malloc.
benchmark                    old ns/op    new ns/op    delta
BenchmarkMalloc8                    68           66   -3.07%
BenchmarkMalloc16                   75           70   -6.48%
BenchmarkMallocTypeInfo8           102           97   -4.80%
BenchmarkMallocTypeInfo16          108          105   -2.78%

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

11 years agotime: provide timezone abbreviations on windows
Alex Brainman [Thu, 6 Jun 2013 06:30:25 +0000 (16:30 +1000)]
time: provide timezone abbreviations on windows

Use http://unicode.org/cldr/data/common/supplemental/windowsZones.xml
to generate the map.

Fixes #4838.

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

11 years agoio/ioutil: make WriteFile notice errors from Close()
Robert Obryk [Thu, 6 Jun 2013 04:16:44 +0000 (21:16 -0700)]
io/ioutil: make WriteFile notice errors from Close()

WriteFile should not successfully return if the file's
Close call failed.

Fixes #5644.

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

11 years agodoc/contribute: add "Understanding the extension" section
Patrick Higgins [Thu, 6 Jun 2013 04:09:43 +0000 (21:09 -0700)]
doc/contribute: add "Understanding the extension" section

Fixes #4996

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

11 years agocmd/6c: use full 64-bit address in block copy
Russ Cox [Wed, 5 Jun 2013 14:39:06 +0000 (10:39 -0400)]
cmd/6c: use full 64-bit address in block copy

Already fixed independently in Plan 9.

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

11 years agocmd/6l: accept NOP of $x+10(SP) and of X0
Russ Cox [Wed, 5 Jun 2013 14:38:52 +0000 (10:38 -0400)]
cmd/6l: accept NOP of $x+10(SP) and of X0

Needed to link code compiled with 6c -N.

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

11 years agoruntime: fix comments (g->gobuf became g->sched long ago)
Russ Cox [Wed, 5 Jun 2013 11:16:53 +0000 (07:16 -0400)]
runtime: fix comments (g->gobuf became g->sched long ago)

Should reduce size of CL 9868044.

R=golang-dev, ality
CC=golang-dev
https://golang.org/cl/10045043

11 years agocmd/cgo, cmd/go, go/build: sort flag lists
Russ Cox [Wed, 5 Jun 2013 11:14:05 +0000 (07:14 -0400)]
cmd/cgo, cmd/go, go/build: sort flag lists

CFLAGS comes before CPPFLAGS.
Also fix one typo CPPCFLAGS.

Cleanup for CL 8248043.

R=golang-dev, iant, alberto.garcia.hierro
CC=golang-dev
https://golang.org/cl/9965045

11 years agoundo CL 10017045 / 6ec8c49421a0
Brad Fitzpatrick [Wed, 5 Jun 2013 04:51:22 +0000 (21:51 -0700)]
undo CL 10017045 / 6ec8c49421a0

It was never tested and also breaks Windows.

run.go doesn't yet support the proper !windows,!plan9 syntax.

««« original CL description
test: do not run SIGCHLD test on Plan 9

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

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

11 years agomime: add support for Plan 9
Anthony Martin [Wed, 5 Jun 2013 00:30:45 +0000 (17:30 -0700)]
mime: add support for Plan 9

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

11 years agoimage/jpeg: avoid documentation argument over whether it's luma
Nigel Tao [Wed, 5 Jun 2013 00:18:06 +0000 (10:18 +1000)]
image/jpeg: avoid documentation argument over whether it's luma
subsampling or chroma subsampling.

Fixes #5569.

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

11 years agotest: do not run SIGCHLD test on Plan 9
Anthony Martin [Wed, 5 Jun 2013 00:14:53 +0000 (17:14 -0700)]
test: do not run SIGCHLD test on Plan 9

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

11 years agoruntime: fix description of SysAlloc
Anthony Martin [Wed, 5 Jun 2013 00:12:29 +0000 (17:12 -0700)]
runtime: fix description of SysAlloc

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

11 years agocrypto/tls: support TLS 1.1.
Adam Langley [Wed, 5 Jun 2013 00:02:22 +0000 (20:02 -0400)]
crypto/tls: support TLS 1.1.

The significant change between TLS 1.0 and 1.1 is the addition of an explicit IV in the case of CBC encrypted records. Support for TLS 1.1 is needed in order to support TLS 1.2.

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

11 years agoencoding/asn1: harmonise error prefixes.
Adam Langley [Tue, 4 Jun 2013 23:51:26 +0000 (19:51 -0400)]
encoding/asn1: harmonise error prefixes.

This change ensures that error messages always start with "asn1: ".

R=golang-dev, gedimitr
CC=golang-dev
https://golang.org/cl/9751043

11 years agocmd/cc: support 21-bit runes in wide string constants
Anthony Martin [Tue, 4 Jun 2013 23:30:55 +0000 (16:30 -0700)]
cmd/cc: support 21-bit runes in wide string constants

Changeset 7557a627e9b5 added a temporary stop-gap to silence
a print format warning for %S. This has been reverted.

None of this code is original. It was copied from the latest
Plan 9 compilers.

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

11 years agocmd/5g, cmd/6g, cmd/8g: remove prototypes for proglist
Carl Shapiro [Tue, 4 Jun 2013 23:22:59 +0000 (16:22 -0700)]
cmd/5g, cmd/6g, cmd/8g: remove prototypes for proglist

Each of the backends has two prototypes for this function but
no corresponding definition.

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

11 years agobuild: add intptr typedef for Plan 9
Anthony Martin [Tue, 4 Jun 2013 23:21:04 +0000 (16:21 -0700)]
build: add intptr typedef for Plan 9

Revision 01810e5c68e9 added the following to src/pkg/runtime/stack.h:

        StackPreempt = (uintptr)(intptr)0xffffade,

The typedef for intptr is defined in two places:

        1. src/pkg/runtime/runtime.h for use by the runtime

        2. include/u.h for use by the compilers and linkers

On Plan 9, we don't use include/u.h but instead augment the host's
u.h with extra typedefs. These are in include/plan9/GOARCH/u.h.

We forgot to add intptr. It didn't cause a problem until now since
that typedef was never used outside the runtime.

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

11 years agoC: add Will Norris (Google CLA)
Andrew Gerrand [Tue, 4 Jun 2013 23:11:49 +0000 (09:11 +1000)]
C: add Will Norris (Google CLA)

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

11 years agomisc/pprof: register cnew and runtime.cnewarray as malloc wrappers.
Rémy Oudompheng [Tue, 4 Jun 2013 22:40:49 +0000 (00:40 +0200)]
misc/pprof: register cnew and runtime.cnewarray as malloc wrappers.

These functions were introduced by revision 139919984600
and should not show up on profiles for consistency.

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

11 years agocmd/5c, cmd/6c, cmd/8c: isolate textflag and dataflag
Anthony Martin [Tue, 4 Jun 2013 22:18:02 +0000 (15:18 -0700)]
cmd/5c, cmd/6c, cmd/8c: isolate textflag and dataflag

Fixes #5419.

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

11 years agocodereview: don't warn about secret commits
Anthony Martin [Tue, 4 Jun 2013 22:02:28 +0000 (15:02 -0700)]
codereview: don't warn about secret commits

Normally the codereview plugin disables adding new commits
when not using the submit command. Unfortunately this makes
it impossible to use the Mercurial Queues extension at the
same time.

A feature called "Phases" was introduced in Mercurial 2.1
that allows marking commits as being secret; this means
they will never be pushed to the upstream repository.

We can take advantage of this feature to allow the use of
Mercurial Queues if the mq.secret option has been set in
hgrc(5) and a recent version of Mercurial is used.

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

11 years agocmd/ld: fix gcdata and gcbss symbols
Anthony Martin [Tue, 4 Jun 2013 14:07:22 +0000 (07:07 -0700)]
cmd/ld: fix gcdata and gcbss symbols

These two symbols don't show up in the Go symbol table
since they're defined in dodata which is called sometime
after symtab. They do, however, show up in the ELF symbol
table.

This regression was introduced in changeset 01c40d533367.

Also, remove the corresponding strings from the ELF strtab
section now that they're unused.

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

11 years agoencoding/gob: consistently use unsafe.Pointer for pointer values
Ian Lance Taylor [Tue, 4 Jun 2013 13:20:57 +0000 (06:20 -0700)]
encoding/gob: consistently use unsafe.Pointer for pointer values

Fixes #5621.

R=golang-dev, cshapiro, r, fullung
CC=golang-dev
https://golang.org/cl/9988043

11 years agocmd/6c, cmd/8c: avoid generating long multiplication when not necessary.
Rémy Oudompheng [Tue, 4 Jun 2013 06:33:00 +0000 (08:33 +0200)]
cmd/6c, cmd/8c: avoid generating long multiplication when not necessary.

On amd64
benchmark                        old ns/op    new ns/op    delta
BenchmarkHashStringSpeed                91           74  -18.49%
BenchmarkHashInt32Speed                 54           45  -17.88%
BenchmarkHashInt64Speed                 76           58  -23.53%
BenchmarkHashStringArraySpeed          231          188  -18.61%

Fixes #5367.

R=golang-dev, iant, dave, daniel.morsing, ality, rsc
CC=golang-dev
https://golang.org/cl/9040043

11 years agocmd/gc: fix missing slice/array types in export data.
Rémy Oudompheng [Tue, 4 Jun 2013 06:18:36 +0000 (08:18 +0200)]
cmd/gc: fix missing slice/array types in export data.

Fixes #5614.

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

11 years agodoc: add Game of Life to playground toys
Andrew Gerrand [Tue, 4 Jun 2013 02:59:28 +0000 (12:59 +1000)]
doc: add Game of Life to playground toys

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

11 years agoruntime: update defs_windows_*.h files
Alex Brainman [Tue, 4 Jun 2013 02:50:40 +0000 (12:50 +1000)]
runtime: update defs_windows_*.h files

New version of cmd/cgo from
https://golang.org/cl/9574043/
is used to regenerate these.

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

11 years agocmd/ld, runtime: clean up CL 9666047
Russ Cox [Mon, 3 Jun 2013 20:44:35 +0000 (16:44 -0400)]
cmd/ld, runtime: clean up CL 9666047

Remove unnecessary ( ) around == in && clause.
Add { } around multiline if body, even though it's one statement.

Add runtime: prefix to printed errors.

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