1
0
mirror of https://github.com/golang/go synced 2024-10-03 10:21:22 -06:00
Commit Graph

14570 Commits

Author SHA1 Message Date
Rémy Oudompheng
cc224c004d cmd/6c, cmd/8c: use signed char explicitly in mul.c
On ARM, char is unsigned, and the code generation for
multiplication gets totally broken.

Fixes #4354.

R=golang-dev, dave, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/6826079
2012-11-09 21:06:45 +01:00
Dmitriy Vyukov
4ef91fc854 cmd/go: fix selection of packages for testing
Currently it works incorrectly if user specifies own build tags
and with race detection (e.g. runtime/race is not selected,
because it contains only test files with +build race).

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6814107
2012-11-09 14:00:41 +04:00
Ian Lance Taylor
5e57954f8c runtime/pprof: fix typo in comment
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6810102
2012-11-08 23:48:13 -08:00
Shenghou Ma
4022fc4e21 runtime: use vDSO clock_gettime for time.now & runtime.nanotime on Linux/amd64
Performance improvement aside, time.Now() now gets real nanosecond resolution
on supported systems.

Benchmark done on Core i7-2600 @ 3.40GHz with kernel 3.5.2-gentoo.
original vDSO gettimeofday:
BenchmarkNow    100000000               27.4 ns/op
new vDSO gettimeofday fallback:
BenchmarkNow    100000000               27.6 ns/op
new vDSO clock_gettime:
BenchmarkNow    100000000               24.4 ns/op

R=golang-dev, bradfitz, iant, iant
CC=golang-dev
https://golang.org/cl/6814103
2012-11-09 14:19:07 +08:00
Mikio Hara
f668e0a5b3 net: consolidate multiple init functions
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6819117
2012-11-09 12:09:22 +09:00
Mikio Hara
e245ae7501 runtime: re-enable crash test on FreeBSD
It also passes on FreeBSD.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6812103
2012-11-09 10:05:46 +09:00
Ian Lance Taylor
3e50372f1f test: change index.go to test size of int, not GOARCH == "amd64"
Fixes the test to work correctly on other platforms with
64-bit ints, like Alpha.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6822099
2012-11-08 15:43:28 -08:00
David Symonds
86b9e3e2b4 archive/tar: accept binary format when reading numeric header fields.
Fixes #4358.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6840043
2012-11-09 08:50:10 +11:00
Russ Cox
761830f481 cmd/gc: fix export of inlined function body with type guard
When exporting a body containing
        x, ok := v.(Type)

the definition for Type was not being included, so when the body
was actually used, it would cause an "unknown type" compiler error.

Fixes #4370.

R=ken2
CC=golang-dev
https://golang.org/cl/6827064
2012-11-08 16:07:05 -05:00
Mikio Hara
5451708d5b net: fix non-unixen build
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6813101
2012-11-09 02:09:09 +09:00
Ian Lance Taylor
6694f14b67 test: run some more tests by default
R=golang-dev, remyoudompheng, iant, rsc
CC=golang-dev
https://golang.org/cl/6833043
2012-11-08 09:04:27 -08:00
Joel Sing
4e75d2c7d5 runtime: re-enable crash test on NetBSD
Re-enable the crash tests on NetBSD now that the issue has been
identified and fixed.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6813100
2012-11-09 03:41:43 +11:00
Dmitriy Vyukov
3f7f030c59 runtime: fix instrumentation of slice append for race detection
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/6819107
2012-11-08 20:37:05 +04:00
Brad Fitzpatrick
ef6806fb13 net: close fds eagerly in DialTimeout
Integrates with the pollserver now.

Uses the old implementation on windows and plan9.

Fixes #2631

R=paul, iant, adg, bendaglish, rsc
CC=golang-dev
https://golang.org/cl/6815049
2012-11-08 10:35:16 -06:00
Brad Fitzpatrick
a384b5b9c3 cmd/api: bug fix for goapi's lame type checker
This is blocking me submitting the net fd timeout
CL, since goapi chokes on my constant.

The much more extensive fix to goapi's type checker
in pending review in https://golang.org/cl/6742050

But I'd rather get this quick fix in first.

R=golang-dev, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/6818104
2012-11-08 10:34:54 -06:00
Shenghou Ma
48b739caac time: clarify why timer.Stop and ticker.Stop don't close the channel
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6818106
2012-11-08 23:25:48 +08:00
Carl Mastrangelo
148154b7e7 lib9: remove unreferenced externs and getuser()
R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/6820115
2012-11-08 09:39:24 -05:00
Anthony Martin
024a92c1da runtime: use vDSO for gettimeofday on linux/amd64
Intel Core 2 Duo (2.16 GHz) running 3.6.5-1-ARCH

benchmark       old ns/op    new ns/op    delta
BenchmarkNow         1856         1034  -44.29%

R=rsc
CC=golang-dev
https://golang.org/cl/6826072
2012-11-07 18:29:31 -08:00
Alex Brainman
122c154c60 cmd/go: say that -race flag can be used on windows/amd64
R=golang-dev, r
CC=dvyukov, golang-dev
https://golang.org/cl/6810099
2012-11-08 13:00:54 +11:00
Ian Lance Taylor
e3977f0d3a cmd/gc: warn about slice indexes larger than int in typecheck pass
Fixes GOARCH=386 build.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6810098
2012-11-07 17:34:06 -08:00
Nigel Tao
3e2a888753 doc/effective_go: don't use ALL_CAPS for variable names.
R=r, dsymonds
CC=golang-dev
https://golang.org/cl/6826070
2012-11-08 11:55:46 +11:00
Nigel Tao
64b3e590c0 image/jpeg: handle fill bytes.
Fixes #4337.

R=r, minux.ma
CC=golang-dev
https://golang.org/cl/6814098
2012-11-08 10:36:29 +11:00
Rémy Oudompheng
c208a3a263 cmd/gc: fix internal compiler error with broken structs.
Fixes #4359.

R=golang-dev, daniel.morsing, rsc
CC=golang-dev
https://golang.org/cl/6834043
2012-11-07 23:09:01 +01:00
David Symonds
0ac317817b archive/tar: avoid writing ModTime that is out of range.
Update #4358
Still to do: support binary numeric format in Reader.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6818101
2012-11-08 08:22:40 +11:00
Rémy Oudompheng
7c0cbbfa18 cmd/6g, cmd/8g: mark used registers in indirect addressing.
Fixes #4094.
Fixes #4353.

R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/6810090
2012-11-07 21:36:15 +01:00
Rémy Oudompheng
f59a605645 runtime: use runtime·callers when racefuncenter's pc is on the heap.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6821069
2012-11-07 21:35:21 +01:00
Ian Lance Taylor
e08008e8c5 test: run index test by default
Running this test via "bash run" uncovered three different
bugs (4344, 4348, 4353).  We need to run it by default.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6832043
2012-11-07 12:33:54 -08:00
Russ Cox
ccef88c56f api: refresh next.txt
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/6811092
2012-11-07 15:26:41 -05:00
Russ Cox
71282131a1 cmd/gc: fix escape analysis bug
The code assumed that the only choices were EscNone, EscScope, and EscHeap,
so that it makes sense to set EscScope only if the current setting is EscNone.
Now that we have the many variants of EscReturn, this logic is false, and it was
causing important EscScopes to be ignored in favor of EscReturn.

Fixes #4360.

R=ken2
CC=golang-dev, lvd
https://golang.org/cl/6816103
2012-11-07 15:15:21 -05:00
Dmitriy Vyukov
1ebf2d85ba runtime/race: add Windows support
This is copy of https://golang.org/cl/6810080
but sent from another account (dvyukov@gmail.com is not in CONTRIBUTORS).

R=rsc
CC=golang-dev
https://golang.org/cl/6827060
2012-11-07 23:59:09 +04:00
Ian Lance Taylor
f8614a6645 reflect: fix test of whether structs are identical
The old code worked with gc, I assume because the linker
unified identical strings, but it failed with gccgo.

R=rsc
CC=gobot, golang-dev
https://golang.org/cl/6826063
2012-11-07 11:55:35 -08:00
Roger Peppe
768ba46cc1 crypto/x509: fix DecryptPEMBlock
The current implement can fail when the
block size is not a multiple of 8 bytes.
This CL makes it work, and also checks that the
data is in fact a multiple of the block size.

R=agl, agl
CC=golang-dev
https://golang.org/cl/6827058
2012-11-07 15:16:34 +00:00
Russ Cox
cb856adea9 cmd/gc: annotate local variables with unique ids for inlining
Avoids problems with local declarations shadowing other names.
We write a more explicit form than the incoming program, so there
may be additional type annotations. For example:

        int := "hello"
        j := 2

would normally turn into

        var int string = "hello"
        var j int = 2

but the int variable shadows the int type in the second line.

This CL marks all local variables with a per-function sequence number,
so that this would instead be:

        var int·1 string = "hello"
        var j·2 int = 2

Fixes #4326.

R=ken2
CC=golang-dev
https://golang.org/cl/6816100
2012-11-07 09:59:19 -05:00
Russ Cox
c6f363b22a cmd/gc: fix go:nointerface export comment
R=ken
CC=golang-dev
https://golang.org/cl/6815073
2012-11-07 09:14:21 -05:00
Mikio Hara
63f29d17d1 net: fix protocol number for IPv6 test
The protocol number of ICMP for IPv6 is 58, not 1.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6810093
2012-11-07 21:55:29 +09:00
Dmitriy Vyukov
1a19f01a68 runtime/race: lazily allocate shadow memory
Currently race detector runtime maps shadow memory eagerly at process startup.
It works poorly on Windows, because Windows requires reservation in swap file
(especially problematic if several Go program runs at the same, each consuming GBs
of memory).
With this change race detector maps shadow memory lazily, so Go runtime must notify
about all new heap memory.
It will help with Windows port, but also eliminates scary 16TB virtual mememory
consumption in top output (which sometimes confuses some monitoring scripts).

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6811085
2012-11-07 12:48:58 +04:00
Dmitriy Vyukov
a3a7244779 cmd/gc: racewalk: instrument returnsfromheap params
Fixes #4307.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6822073
2012-11-07 12:10:35 +04:00
Dmitriy Vyukov
abb313f8c8 cmd/gc: racewalk: do not double function calls
Current racewalk transformation looks like:
x := <-makeChan().c
\/\/\/\/\/\/\/\/\/
runtime.raceread(&makeChan().c)
x := <-makeChan().c
and so makeChan() is called twice.
With this CL the transformation looks like:
x := <-makeChan().c
\/\/\/\/\/\/\/\/\/
chan *tmp = &(makeChan().c)
raceread(&*tmp)
x := <-(*tmp)
Fixes #4245.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6822075
2012-11-07 12:06:27 +04:00
Dmitriy Vyukov
703043c8dc cmd/gc: refactor racewalk
It is refactoring towards generic walk
+ it handles mode nodes.
Partially fixes 4228 issue.

R=golang-dev, lvd, rsc
CC=golang-dev
https://golang.org/cl/6775098
2012-11-07 12:01:31 +04:00
Alex Brainman
eb2e6e59ee net: implement IPv6 support for windows
Thank you zhoumichaely for original CL 5175042.

Fixes #1740.
Fixes #2315.

R=golang-dev, bradfitz, mikioh.mikioh
CC=golang-dev, zhoumichaely
https://golang.org/cl/6822045
2012-11-07 16:58:20 +11:00
Carl Mastrangelo
f8892fb395 crypto/sha1: Make sha-1 do block mixup in place
Benchmarks:

benchmark              old ns/op    new ns/op    delta
BenchmarkHash8Bytes          762          674  -11.55%
BenchmarkHash1K             8791         7375  -16.11%
BenchmarkHash8K            65094        54881  -15.69%

benchmark               old MB/s     new MB/s  speedup
BenchmarkHash8Bytes        10.50        11.86    1.13x
BenchmarkHash1K           116.48       138.84    1.19x
BenchmarkHash8K           125.85       149.27    1.19x

R=dave, rsc, iant
CC=golang-dev
https://golang.org/cl/6820096
2012-11-07 13:41:02 +11:00
Ian Lance Taylor
451b91b4d1 CONTRIBUTORS: Add Carl Mastrangelo (Google CLA).
R=golang-dev, nigeltao
CC=golang-dev
https://golang.org/cl/6812095
2012-11-06 15:58:18 -08:00
Rémy Oudompheng
1e233ad075 cmd/6g: fix use of large integers as indexes or array sizes.
A check for smallintconst was missing before generating the
comparisons.

Fixes #4348.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6815088
2012-11-06 22:53:57 +01:00
Shenghou Ma
3e80f9ce7b cmd/go: invoke gcc -print-libgcc-file-name only once
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6741051
2012-11-07 05:09:54 +08:00
Shenghou Ma
882eb608b1 sort: fix comment for various Search routines
Fixes #4205 (again).

R=r, 0xjnml
CC=golang-dev
https://golang.org/cl/6819082
2012-11-07 05:07:46 +08:00
Shenghou Ma
0e3f4fdb52 net/rpc: give hint to pass a pointer to Register
Fixes #4325.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6819081
2012-11-07 05:03:16 +08:00
Péter Surányi
91651c1844 cmd/godoc: initialize filesystem and metadata for -url
Unlike when using -http, godoc -url didn't initialize the "filesystem"
and metadata that are used when generating responses. This CL adds this
initialization, so that -url provides the same results as an HTTP
request when using -http.

Fixes #4335.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/6817075
2012-11-07 04:59:21 +08:00
Daniel Morsing
d098bffd84 cmd/gc, runtime: avoid unnecessary copy on type assertion.
When the first result of a type assertion is blank, the compiler would still copy out a potentially large non-interface type.

Fixes #1021.

R=golang-dev, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/6812079
2012-11-06 20:40:40 +01:00
Ian Lance Taylor
433b2f17ee test: fix index.go to pass with recent index checks
The compiler now gives an error for out of bounds constant
indexes for arrays, and for negative constant indexes for both
arrays and slices.

With this change the index.go test passes if CLs 6815085,
6815088, and 6812089 are committed.

R=golang-dev, remyoudompheng, rsc
CC=golang-dev
https://golang.org/cl/6810085
2012-11-06 11:38:16 -08:00
Ian Lance Taylor
2355409988 cmd/gc: don't require that slice index constants be small ints
The test for this is test/index.go, which is not run by
default.

R=remyoudompheng, rsc
CC=golang-dev
https://golang.org/cl/6812089
2012-11-06 11:36:59 -08:00