1
0
mirror of https://github.com/golang/go synced 2024-09-25 05:10:12 -06:00
Commit Graph

17222 Commits

Author SHA1 Message Date
Russ Cox
413d4c6c11 net: make IP implement encoding.MarshalerText, encoding.UnmarshalerText
See golang.org/s/go12encoding for design.

R=golang-dev, bradfitz, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/12705043
2013-08-14 00:33:20 -04:00
Russ Cox
56ce83f7ba undo CL 12603044 / 2ca230b93195
fat fingers - did not intend to submit.
depends on the Unmarshaler CL anyway.

««« original CL description
encoding/xml: add, support Marshaler interface

See golang.org/s/go12xml for design.

Fixes #2771.
Fixes #4169.
Fixes #5975.
Fixes #6125.

R=golang-dev, iant, dan.kortschak
CC=golang-dev
https://golang.org/cl/12603044
»»»

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/12918043
2013-08-14 00:20:55 -04:00
Russ Cox
ce3ba126a0 encoding/gob: support new generic interfaces in package encoding
R=r
CC=golang-dev
https://golang.org/cl/12681044
2013-08-14 00:18:48 -04:00
Russ Cox
48b90bbc55 encoding: new package
See golang.org/s/go12encoding for design.

R=r
CC=golang-dev
https://golang.org/cl/12541051
2013-08-14 00:18:20 -04:00
Russ Cox
85f3acd788 encoding/xml: add, support Marshaler interface
See golang.org/s/go12xml for design.

Fixes #2771.
Fixes #4169.
Fixes #5975.
Fixes #6125.

R=golang-dev, iant, dan.kortschak
CC=golang-dev
https://golang.org/cl/12603044
2013-08-14 00:17:42 -04:00
ChaiShushan
844bc6c0ac misc/notepadplus: support Calltips
Fixes #5789.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/10601043
2013-08-14 13:41:36 +10:00
Andrew Gerrand
5dde7ccecf cmd/go: add -t flag to 'go get' to download test dependencies
Fixes #5126.

R=golang-dev, dsymonds, bradfitz, r, rsc, rogpeppe
CC=golang-dev
https://golang.org/cl/12566046
2013-08-14 11:01:17 +10:00
Russ Cox
1a09d70e23 runtime: fix build on arm
Do not use ? :
I cannot say this enough.

TBR=dvyukov
CC=golang-dev
https://golang.org/cl/12903043
2013-08-13 19:37:54 -04:00
Brad Fitzpatrick
a2599cf50e archive/zip: add File.DataOffset
Accessor to find where the bytes of a file start.

R=golang-dev, rsc, dsymonds, adg
CC=golang-dev
https://golang.org/cl/12784045
2013-08-13 16:29:51 -07:00
Mikio Hara
45cb2e1b70 net: make Dial, Listen and ListenPacket return consistent error value
Update #4856

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/12763044
2013-08-14 07:04:39 +09:00
Brad Fitzpatrick
ca3ed9f352 database/sql: add a disabled broken test
Update #6081

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/12810043
2013-08-13 14:56:40 -07:00
Brad Fitzpatrick
c7d352c941 archive/zip: remove an allocation, speed up a test
Update #6138

TestOver65kFiles spends all its time garbage collecting.
Removing the 1.4 MB of allocations per each of the 65k
files brings this from 34 seconds to 0.23 seconds.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/12894043
2013-08-13 14:48:08 -07:00
Rob Pike
c18af467fd encoding/binary: make Write work like Read
Use the fast path calculation to shorten the code.
No effect on benchmarks.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/12696046
2013-08-14 07:03:56 +10:00
Rob Pike
c32a8830bd cmd/go: nicer error diagnosis in go test
Before,
        go test -bench .
would just dump the long generic "go help" message. Confusing and
unhelpful. Now the message is short and on point and also reminds the
user about the oft-forgotten "go help testflag".

        % go test -bench
        go test: missing argument for flag bench
        run "go help test" or "go help testflag" for more information
        %

R=rsc
CC=golang-dev
https://golang.org/cl/12662046
2013-08-14 07:03:18 +10:00
Dmitriy Vyukov
992374f8fb net: fix build fix
Now builders say:
pkg/net/dnsclient_unix_test.go:10: imported and not used: "runtime"

R=golang-dev
CC=golang-dev
https://golang.org/cl/12890043
2013-08-14 00:55:18 +04:00
Dmitriy Vyukov
d90a81c39f net: fix windows build
Windows builders say:
pkg\net\dnsclient_unix_test.go:24: undefined: dnsConfig
pkg\net\dnsclient_unix_test.go:25: undefined: exchange

R=golang-dev
CC=golang-dev
https://golang.org/cl/12889043
2013-08-14 00:44:57 +04:00
Dmitriy Vyukov
4f2e382c9f runtime: dump scheduler state if GODEBUG=schedtrace is set
The schedtrace value sets dump period in milliseconds.
In default mode the trace looks as follows:
SCHED 0ms: gomaxprocs=4 idleprocs=0 threads=3 idlethreads=0 runqueue=0 [1 0 0 0]
SCHED 1001ms: gomaxprocs=4 idleprocs=3 threads=6 idlethreads=3 runqueue=0 [0 0 0 0]
SCHED 2008ms: gomaxprocs=4 idleprocs=1 threads=6 idlethreads=1 runqueue=0 [0 1 0 0]
If GODEBUG=scheddetail=1 is set as well, then the detailed trace is printed:
SCHED 0ms: gomaxprocs=4 idleprocs=0 threads=3 idlethreads=0 runqueue=0 singleproc=0 gcwaiting=1 mlocked=0 nmspinning=0 stopwait=0 sysmonwait=0
  P0: status=3 tick=1 m=0 runqsize=1/128 gfreecnt=0
  P1: status=3 tick=0 m=-1 runqsize=0/128 gfreecnt=0
  P2: status=3 tick=0 m=-1 runqsize=0/128 gfreecnt=0
  P3: status=3 tick=0 m=-1 runqsize=0/128 gfreecnt=0
  M2: p=-1 curg=-1 mallocing=0 throwing=0 gcing=0 locks=1 dying=0 helpgc=0 spinning=0 lockedg=-1
  M1: p=-1 curg=-1 mallocing=0 throwing=0 gcing=0 locks=1 dying=0 helpgc=0 spinning=0 lockedg=-1
  M0: p=0 curg=1 mallocing=0 throwing=0 gcing=0 locks=1 dying=0 helpgc=0 spinning=0 lockedg=1
  G1: status=2() m=0 lockedm=0
  G2: status=1() m=-1 lockedm=-1

R=golang-dev, raggi, rsc
CC=golang-dev
https://golang.org/cl/11435044
2013-08-14 00:30:55 +04:00
Russ Cox
2642c6e24d sync/atomic: update comment for ARM 64-bit atomics
They don't work on older chips, just like the x86-32 64-bit atomics.

Update #6134

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12880043
2013-08-13 16:16:05 -04:00
Keith Randall
74e78df107 undo CL 12840043 / 3b9f54db72a1
Breaks the build.  Old bucket arrays kept by iterators
still need to be scanned.

««« original CL description
runtime: tell GC not to scan internal hashmap structures.
We'll do it ourselves via hash_gciter, thanks.
Fixes bug 6119.

R=golang-dev, dvyukov, cookieo9, rsc
CC=golang-dev
https://golang.org/cl/12840043
»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/12884043
2013-08-13 12:59:39 -07:00
Keith Randall
0df438c683 runtime: tell GC not to scan internal hashmap structures.
We'll do it ourselves via hash_gciter, thanks.
Fixes bug 6119.

R=golang-dev, dvyukov, cookieo9, rsc
CC=golang-dev
https://golang.org/cl/12840043
2013-08-13 12:36:03 -07:00
Russ Cox
ba14974e07 undo CL 12787044 / ed695cdf962b
The NetBSD and OpenBSD failures are apparently real,
not due to the test bug fixed in 100b9fc0c46f.

««« original CL description
runtime/pprof: test netbsd and openbsd again

Maybe these will work now.

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

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12873043
2013-08-13 23:33:49 +04:00
Dmitriy Vyukov
4961483e7d runtime: fix LockOSThread
Fixes #6100.

R=golang-dev, dave, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/12703045
2013-08-13 22:37:04 +04:00
Dmitriy Vyukov
f9066fe1c0 runtime: more reliable preemption
Currently it's possible that a goroutine
that periodically executes non-blocking
cgo/syscalls is never preempted.
This change splits scheduler and syscall
ticks to prevent such situation.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/12658045
2013-08-13 22:14:04 +04:00
Dmitriy Vyukov
cc4e6aad8e runtime: do no lose CPU profiling signals
Currently we lose lots of profiling signals.
Most notably, GC is not accounted at all.
But stack splits, scheduler, syscalls, etc are lost as well.
This creates seriously misleading profile.
With this change all profiling signals are accounted.
Now I see these additional entries that were previously absent:
161  29.7%  29.7%      164  30.3% syscall.Syscall
 12   2.2%  50.9%       12   2.2% scanblock
 11   2.0%  55.0%       11   2.0% markonly
 10   1.8%  58.9%       10   1.8% sweepspan
  2   0.4%  85.8%        2   0.4% runtime.newstack
It is still impossible to understand what causes stack splits,
but at least it's clear how many time is spent on them.
Update #2197.
Update #5659.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/12179043
2013-08-13 22:12:02 +04:00
Dmitriy Vyukov
1da1030b5d runtime: fix false deadlock crash
Fixes #6070.
Update #6055.

R=golang-dev, nightlyone, rsc
CC=golang-dev
https://golang.org/cl/12602043
2013-08-13 22:07:42 +04:00
Dmitriy Vyukov
7eb6a6f46d sync/atomic: fix ARM nomenclature in comments
R=cshapiro
CC=golang-dev
https://golang.org/cl/12877043
2013-08-13 22:07:21 +04:00
Rick Arnold
4be93851c3 io: prevent write to PipeWriter after Close
Return an ErrClosedPipe rather than allowing the write to proceed.

Fixes #5330.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/12541053
2013-08-13 11:04:09 -07:00
Dmitriy Vyukov
d3f36dbfc7 sync/atomic: add Swap to nil deref test
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12870043
2013-08-13 21:18:33 +04:00
Dmitriy Vyukov
66c58cea67 sync/atomic: trigger paging fault early on linux/arm
so that we don't need to traceback through __kuser_cmpxchg

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12869043
2013-08-13 21:15:47 +04:00
Alex A Skinner
0a3cb7ece3 net: implement DNS TCP fallback query if UDP response is truncated
Fixes #5686.

R=golang-dev, bradfitz, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/12458043
2013-08-13 09:44:12 -07:00
Alberto García Hierro
c18dc11ef2 cmd/cgo: Add support for C function pointers
* Add a new kind of Name, "fpvar" which stands for function pointer variable
* When walking the AST, find functions used as expressions and create a new Name object for them
* Track functions which are only used in expr contexts, and avoid generating bridge code for them

R=golang-dev, minux.ma, fullung, rsc, iant
CC=golang-dev
https://golang.org/cl/9835047
2013-08-13 12:42:21 -04:00
Russ Cox
469250fb77 runtime/pprof: test netbsd and openbsd again
Maybe these will work now.

R=golang-dev, dvyukov, bradfitz
CC=golang-dev
https://golang.org/cl/12787044
2013-08-13 12:35:37 -04:00
Anthony Martin
a538558003 test/run: process build tags like go/build
R=bradfitz, dave, rsc, r
CC=golang-dev
https://golang.org/cl/10001045
2013-08-13 12:25:41 -04:00
Dmitriy Vyukov
71c6da39ce runtime/pprof: fix test
R=golang-dev, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/12790043
2013-08-13 12:18:29 -04:00
Dmitriy Vyukov
aaab946943 runtime: fix handling of network deadlines
Ensure that deadlines affect already issued IO.

R=golang-dev, mikioh.mikioh, bradfitz
CC=golang-dev
https://golang.org/cl/12847043
2013-08-13 19:11:42 +04:00
Dmitriy Vyukov
d1cefd6b6d doc: update go1.2.txt
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/12851043
2013-08-13 17:21:33 +04:00
Dmitriy Vyukov
0e15b03f93 sync/atomic: add Swap functions
Fixes #5722.

R=golang-dev, khr, cshapiro, rsc, r
CC=golang-dev
https://golang.org/cl/12670045
2013-08-13 15:26:48 +04:00
Mikio Hara
39a7017c26 net: make deadline helpers join to netFD as its methods
Just for readability reasons; to prevent overlooking deadline stuff
across over platforms.

R=golang-dev, dvyukov
CC=golang-dev
https://golang.org/cl/8656044
2013-08-13 20:00:58 +09:00
Dmitriy Vyukov
5a20b4a6a9 sync: faster Cond
The new version does not require any memory allocations and is 30-50% faster.
Also detect and painc if Cond is copied after first.

benchmark            old ns/op    new ns/op    delta
BenchmarkCond1             317          195  -38.49%
BenchmarkCond1-2           875          607  -30.63%
BenchmarkCond1-4          1116          548  -50.90%
BenchmarkCond1-8          1013          613  -39.49%
BenchmarkCond1-16          983          450  -54.22%
BenchmarkCond2             559          352  -37.03%
BenchmarkCond2-2          1916         1378  -28.08%
BenchmarkCond2-4          1518         1322  -12.91%
BenchmarkCond2-8          2313         1291  -44.19%
BenchmarkCond2-16         1885         1078  -42.81%
BenchmarkCond4            1070          614  -42.62%
BenchmarkCond4-2          4899         3047  -37.80%
BenchmarkCond4-4          3813         3006  -21.16%
BenchmarkCond4-8          3605         3045  -15.53%
BenchmarkCond4-16         4148         2637  -36.43%
BenchmarkCond8            2086         1264  -39.41%
BenchmarkCond8-2          9961         6736  -32.38%
BenchmarkCond8-4          8135         7689   -5.48%
BenchmarkCond8-8          9623         7517  -21.89%
BenchmarkCond8-16        11661         8093  -30.60%

R=sougou, rsc, bradfitz, r
CC=golang-dev
https://golang.org/cl/11573043
2013-08-13 14:45:36 +04:00
Dmitriy Vyukov
d1b66439f9 runtime: eliminate excessive notewakeup calls in timers
If the timer goroutine is wakeup by timeout,
other goroutines will still notewakeup because sleeping is still set.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/12763043
2013-08-13 14:14:24 +04:00
Dmitriy Vyukov
e33e476e07 syscall: disable cpu profiling around fork
Fixes #5517.
Fixes #5659.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12183044
2013-08-13 13:01:30 +04:00
Dmitriy Vyukov
9707f269c1 runtime: fix network timers related crash
Fixes #6103.

R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/12686045
2013-08-13 12:55:57 +04:00
Andrew Gerrand
1ee21701c7 tag go1.1.2
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/12836044
2013-08-13 16:33:59 +10:00
David Symonds
c272fd14a8 go/doc: permit a package synopsis to end with ":\n".
R=gri, r
CC=golang-dev
https://golang.org/cl/12822043
2013-08-13 16:20:17 +10:00
Andrew Gerrand
f7ab3917f9 doc: release notes for go1.1.2
R=golang-dev, go.peter.90, rsc, r
CC=golang-dev
https://golang.org/cl/12016043
2013-08-13 15:08:10 +10:00
Russ Cox
fa72679f07 cmd/gc: add temporary-merging optimization pass
The compilers assume they can generate temporary variables
as needed to preserve the right semantics or simplify code
generation and the back end will still generate good code.
This turns out not to be true. The back ends will only
track the first 128 variables per function and give up
on the remainder. That needs to be fixed too, in a later CL.

This CL merges temporary variables with equal types and
non-overlapping lifetimes using the greedy algorithm in
Poletto and Sarkar, "Linear Scan Register Allocation",
ACM TOPLAS 1999.

The result can be striking in the right functions.

Top 20 frame size changes in a 6g godoc binary by bytes saved:

5464 1984 (-3480, -63.7%) go/build.(*Context).Import
4456 1824 (-2632, -59.1%) go/printer.(*printer).expr1
2560   80 (-2480, -96.9%) time.nextStdChunk
3496 1608 (-1888, -54.0%) go/printer.(*printer).stmt
1896  272 (-1624, -85.7%) net/http.init
2688 1400 (-1288, -47.9%) fmt.(*pp).printReflectValue
2800 1512 (-1288, -46.0%) main.main
3296 2016 (-1280, -38.8%) crypto/tls.(*Conn).clientHandshake
1664  488 (-1176, -70.7%) time.loadZoneZip
1760  608 (-1152, -65.5%) time.parse
4104 3072 (-1032, -25.1%) runtime/pprof.writeHeap
1680  712 ( -968, -57.6%) go/ast.Walk
2488 1560 ( -928, -37.3%) crypto/x509.parseCertificate
1128  392 ( -736, -65.2%) math/big.nat.divLarge
1528  864 ( -664, -43.5%) go/printer.(*printer).fieldList
1360  712 ( -648, -47.6%) regexp/syntax.(*parser).factor
2104 1528 ( -576, -27.4%) encoding/asn1.parseField
1064  504 ( -560, -52.6%) encoding/xml.(*Decoder).text
 584   48 ( -536, -91.8%) html.init
1400  864 ( -536, -38.3%) go/doc.playExample

In the same godoc build, cuts the number of functions with
too many vars from 83 to 32.

R=ken2
CC=golang-dev
https://golang.org/cl/12829043
2013-08-13 00:09:31 -04:00
Rob Pike
306c29e963 doc/go1.2.txt: bufio.{Writer,Reader}.Reset
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12830043
2013-08-13 13:39:45 +10:00
Brad Fitzpatrick
4d2494330e cmd/api: don't fail API check if there's no network
If the hg checkout of go.tools fails, check for Internet
connectivity before failing.

R=golang-dev, shivakumar.gn
CC=golang-dev
https://golang.org/cl/12814043
2013-08-12 19:18:47 -07:00
Russ Cox
4984e6e9fd cmd/6l: fix printing of frame size in TEXT instruction
R=ken2
CC=golang-dev
https://golang.org/cl/12827043
2013-08-12 22:04:24 -04:00
Russ Cox
dbf96addfb cmd/gc: move flow graph into portable opt
Now there's only one copy of the flow graph construction
and dominator computation, and different optimizations
can attach different annotations to the instructions.

R=ken2
CC=golang-dev
https://golang.org/cl/12797045
2013-08-12 22:02:10 -04:00