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

15846 Commits

Author SHA1 Message Date
Russ Cox
0598114a90 runtime/cgo: fix arm build, re-enable test
Fixes #4961.

R=golang-dev, r, minux.ma
CC=golang-dev
https://golang.org/cl/7443048
2013-03-01 16:24:23 -05:00
Rob Pike
749082e2a4 cmd/vet: use go/printer to pretty-print expressions in printf messages
Fixes #4945.
Most examples in this issue now better, but #10 is incomplete and I'm not
certain how to reproduce it. It actually looks like a go/types problem, since
the type being reported is coming directly from that package.
Please reopen the issue if you disagree.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7448046
2013-03-01 12:30:09 -08:00
Rémy Oudompheng
80d2eac14d cmd/cgo: don't reimplement os/exec in util.go.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7450049
2013-03-01 15:04:14 -05:00
Russ Cox
e02168f659 build: skip cgo test on arm
Update #4961.

R=golang-dev
CC=golang-dev
https://golang.org/cl/7451044
2013-03-01 15:01:26 -05:00
Russ Cox
3611553c3b runtime: add atomics to fix arm
R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7429046
2013-03-01 14:57:05 -05:00
John Graham-Cumming
f42a11ec8e net: eliminate odd if statement with identical branches
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7447044
2013-03-01 11:56:33 -08:00
Alan Donovan
be6e82e30b exp/ssa/interp: disable interp_test on non-POSIX.
R=gri, rsc
CC=golang-dev
https://golang.org/cl/7422051
2013-03-01 13:17:13 -05:00
Alan Donovan
ba1d5571db exp/ssa/interp: uncomment tests now passing thanks to recent typechecker fixes.
Also: add support for pointer conversions, covered by one new test.

R=gri, bradfitz, dave
CC=golang-dev
https://golang.org/cl/7435047
2013-03-01 12:51:34 -05:00
Alan Donovan
139160eb30 exp/ssa: fix bug in bridge method
Bridge methods for embedded interfaces were
passing the interface twice: once as receiver,
once as first param.
Covered by $GOROOT/test/ddd.go.

Also:
- invent names ("arg%d") for parameters if missing.
- refactoring: move common code for bridge methods into
  createParams and emitTailCall.

R=gri
CC=golang-dev
https://golang.org/cl/7437047
2013-03-01 12:51:19 -05:00
Russ Cox
f5ceeb94a8 build: disable cgo test on openbsd
Update #4878.

R=golang-dev
CC=golang-dev
https://golang.org/cl/7450048
2013-03-01 12:13:42 -05:00
Russ Cox
83f59d0a4f net/http/cgi: disable TestCopyError to try to fix darwin/386 on builder
Update #4958.

R=golang-dev
CC=golang-dev
https://golang.org/cl/7434047
2013-03-01 12:00:24 -05:00
Russ Cox
08a1631cda runtime: fix build on openbsd, plan9
R=golang-dev
CC=golang-dev
https://golang.org/cl/7438052
2013-03-01 11:57:50 -05:00
Russ Cox
2202663a93 build: disable cgo on windows
Update #4955.

R=golang-dev
CC=golang-dev
https://golang.org/cl/7435049
2013-03-01 11:55:00 -05:00
Russ Cox
418dd410db syscall: disable TestPassFD on openbsd
Update #4956.

R=golang-dev
CC=golang-dev
https://golang.org/cl/7417048
2013-03-01 11:51:32 -05:00
Russ Cox
e6a3e22c75 runtime: start all threads with runtime.mstart
Putting the M initialization in multiple places will not scale.
Various code assumes mstart is the start already. Make it so.

R=golang-dev, devon.odell
CC=golang-dev
https://golang.org/cl/7420048
2013-03-01 11:44:43 -05:00
Russ Cox
d0d7416d3f runtime: more build fixing
Move the mstartfn into its own field.
Simpler, more likely to be correct.

R=golang-dev, devon.odell
CC=golang-dev
https://golang.org/cl/7414046
2013-03-01 09:24:17 -05:00
Russ Cox
c5f694a5c9 runtime: fix new scheduler on freebsd, windows
R=devon.odell
CC=golang-dev
https://golang.org/cl/7443046
2013-03-01 08:30:11 -05:00
Russ Cox
8d732368c2 cmd/ld: fix windows build
Fixes #4948.

R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/7445045
2013-03-01 05:03:25 -08:00
Russ Cox
776b51850b runtime/cgo: fix crosscall2 on arm
This time for sure.

R=golang-dev
CC=golang-dev
https://golang.org/cl/7449045
2013-03-01 05:02:41 -08:00
Dmitriy Vyukov
779c45a507 runtime: improved scheduler
Distribute runnable queues, memory cache
and cache of dead G's per processor.
Faster non-blocking syscall enter/exit.
More conservative worker thread blocking/unblocking.

R=dave, bradfitz, remyoudompheng, rsc
CC=golang-dev
https://golang.org/cl/7314062
2013-03-01 13:49:16 +02:00
Russ Cox
d17506e52d runtime/cgo: make crosscall2 5a/6a/8a-assembled
There is a #pragma dynexport crosscall2, to help SWIG,
and 6l cannot export the symbol if it doesn't get to see it.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7448044
2013-02-28 22:14:55 -08:00
Russ Cox
83c5d07c0e runtime/cgo: fix arm build
During my global search and replace I forgot to open *.S (capital).

R=golang-dev
TBR=golang-dev
CC=golang-dev
https://golang.org/cl/7415047
2013-03-01 00:30:19 -05:00
Russ Cox
7556ccc7b1 cmd/cgo, cmd/ld: new cgo object file section
Switch to new pragma names, but leave old ones available for now.
Merge the three cgo-related sections in the .6 files into a single
cgo section.

R=golang-dev, iant, ality
CC=golang-dev
https://golang.org/cl/7424048
2013-03-01 00:27:57 -05:00
Jan Ziak
94955f9b40 runtime: check the value returned by runtime·SysAlloc
R=golang-dev, rsc
CC=golang-dev, minux.ma
https://golang.org/cl/7424047
2013-03-01 00:21:08 -05:00
Andrew Gerrand
df60c0a3b8 html/template: fix doc typo
Fixes #4950.

R=golang-dev, peter
CC=golang-dev
https://golang.org/cl/7415046
2013-03-01 14:57:59 +11:00
Alex Brainman
3889d8afe5 path/filepath: better error reporting during TestWinSplitListTestsAreValid
Fixes #4930.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7424043
2013-03-01 14:49:55 +11:00
Alex Brainman
e72d1a9575 libmach: many pe handling fixes
- implement windows pread;
- set correct Fhdr.type;
- add ImageBase to all pe "virtual" addresses;
- correct settext parameter order;
- use pclntab/epclntab to find line numbers.

Fixes #4841.
Fixes #4926.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7405050
2013-03-01 14:49:23 +11:00
Alex Brainman
211589a9ed run.bat: disable race detector test
R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/7439048
2013-03-01 14:19:56 +11:00
Alan Donovan
abbbb4283a go/types: fix regression in type checking of RangeStmt.
Now that untyped expressions are done in two phases, the
identity of operand.expr is used as a map key; when reusing
operand values we now must be careful to update the
expr field.

R=gri
CC=golang-dev
https://golang.org/cl/7444049
2013-02-28 20:37:25 -05:00
Brad Fitzpatrick
0bc38b7fe4 net/http: don't special-case multipart/byteranges responses
Fixes #4767

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/7435046
2013-02-28 16:58:26 -08:00
Brad Fitzpatrick
523cb45c9d net/http: document net/http/cookiejar on CookieJar
R=golang-dev, nigeltao, adg
CC=golang-dev
https://golang.org/cl/7444048
2013-02-28 16:58:14 -08:00
Rob Pike
6bfec725cf doc/effective_go.html: minor updates, part 1
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/7454044
2013-02-28 16:57:55 -08:00
Andrew Gerrand
17d12d6cb6 doc: fix root.html styles
R=r
CC=golang-dev
https://golang.org/cl/7442045
2013-03-01 11:22:13 +11:00
Nigel Tao
f29b0cf955 net/http/cookiejar: move cookiejar from exp/cookiejar to
net/http/cookiejar.

This is a straight rename. There are no code changes.

Fixes #1960.

R=rsc, adg
CC=dr.volker.dobler, golang-dev
https://golang.org/cl/7436043
2013-03-01 11:15:00 +11:00
Rob Pike
2145cd51e3 doc/articles/image_package.html: fix x/y mistake
Fixes #4942.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/7444047
2013-02-28 15:52:58 -08:00
Robert Griesemer
3a9fcc45f6 go/types: fix type-checking of shift expressions
Completely rethought shift expression type checking.
Instead of attempting to type-check them eagerly, now
delay the checking of untyped constant lhs in non-
constant shifts until the final expression type
becomes clear. Once it is clear, update the respective
expression tree with the final (not untyped) type and
check respective shift lhs' where necessary.

This also cleans up another conundrum: How to report
the type of untyped constants as it changes from
untyped to typed. Now, Context.Expr is only called
for an expresion x once x has received its final
(not untyped) type (for constant initializers, the
final type may still be untyped).

With this CL all remaining std lib packages that
did not typecheck due to shift errors pass now.

TODO: There's a lot of residual stuff that needs
to be cleaned up but with this CL all tests pass
now.

R=adonovan, axwalk
CC=golang-dev
https://golang.org/cl/7381052
2013-02-28 15:27:52 -08:00
Dmitriy Vyukov
38d4d3c66a runtime: refactor Syscall benchmark
And add a benchmark where #goroutines>GOMAXPROCS,
because it's the most interesting case.
Current results on darwin/amd64, Intel Core 2 Duo 2.13 GHz, 2 cores:
BenchmarkSyscall	100000000	        56.0 ns/op
BenchmarkSyscall-2	50000000	        57.2 ns/op
BenchmarkSyscallWork	10000000	       635 ns/op
BenchmarkSyscallWork-2	10000000	       315 ns/op
BenchmarkSyscallExcess	 1000000	      2698 ns/op
BenchmarkSyscallExcess-2	 5000000	      1192 ns/op
BenchmarkSyscallExcessWork	 1000000	      2832 ns/op
BenchmarkSyscallExcessWork-2	 2000000	      1966 ns/op

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7415044
2013-03-01 01:10:34 +02:00
Dmitriy Vyukov
72b09bd7ae runtime: add matrix multiplication benchmark
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7431047
2013-03-01 00:41:45 +02:00
Akshat Kumar
bd88990722 os: Plan 9: allocate space for a string in Rename
The Name field of the stat structure is variable length
and the marshalling code in package syscall requires
a buf long enough to contain the Name as well as the
static data. This change makes sure that the buffer in
os.Rename is allocated with the appropriate length.

R=rsc, rminnich, ality, r
CC=golang-dev
https://golang.org/cl/7453044
2013-02-28 14:20:42 -08:00
Russ Cox
5bffa3b88e runtime/cgo: move common symbol overrides into 6c-compiled code
There are some function pointers declared by 6c in
package runtime without initialization and then also
declared in package runtime/cgo with initialization,
so that if runtime/cgo is linked in, the function pointers
are non-nil, and otherwise they are nil. We depend on
this property for implementing non-essential cgo hooks
in package runtime.

The declarations in package runtime are 6c-compiled
and end up in .6 files. The declarations in package runtime/cgo
are gcc-compiled and end up in .o files. Since 6l links the .6
and .o files together, this all works.

However, when we switch to "external linking" mode,
6l will not see the .o files, and it would be up to the host linker
to resolve the two into a single initialized symbol.
Not all host linkers will do this (in particular OS X gcc will not).

To fix this, move the cgo declarations into 6c-compiled code,
so that they end up in .6 files, so that 6l gets them no matter what.

R=golang-dev
CC=golang-dev
https://golang.org/cl/7440045
2013-02-28 13:54:23 -08:00
Rob Pike
7ae41e8010 doc: correct some minor HTML errors found by tidy
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7439046
2013-02-28 13:32:36 -08:00
Russ Cox
349cc74867 encoding/gob: fix copyright
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7423046
2013-02-28 13:30:59 -08:00
Russ Cox
f8d49b509b runtime/cgo: make symbol naming consistent
The naming in this package is a disaster.
Make it all consistent.

Remove some 'static' from functions that will
be referred to from other files soon.

This CL is purely renames using global search and replace.

Submitting separately so that real changes will not
be drowned out by these renames in future CLs.

TBR=iant
CC=golang-dev
https://golang.org/cl/7416046
2013-02-28 16:24:38 -05:00
Russ Cox
40ed753ebd cmd/ld: fix symbol table sorting
runtime: double-check that symbol table is sorted

If the symbol table is unsorted, the binary search in findfunc
will not find its func, which will make stack traces stop early.
When the garbage collector starts using the stack tracer,
that would be a serious problem.

The unsorted symbol addresses came from from two things:

1. The symbols in an ELF object are not necessarily sorted,
   so sort them before adding them to the symbol list.

2. The __i686.get_pc_thunk.bx symbol is present in multiple
   object files and was having its address adjusted multiple
   times, producing an incorrect address in the symbol table.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7440044
2013-02-28 16:21:58 -05:00
Rob Pike
1bf66f081f all: fix a few more printf arg bugs found by go vet
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7413045
2013-02-28 11:33:08 -08:00
Rob Pike
3dc7f17e89 cmd/vet: %b is a valid floating-point format.
Also add a report about "invalid type" from gotype, if -v is set.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7420045
2013-02-28 11:32:53 -08:00
Robin Eklind
f82ea304f0 cgo: fix reference to puts in implementation comment.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7431046
2013-02-28 11:31:52 -08:00
Russ Cox
b89000bcab cmd/cgo: extend implementation comment
This is the plan for how to make host linking work with
the rest of the system.

There are two complications:

1. It is a goal to preserve the property that pure Go programs
(even ones importing "net") can be compiled without needing
gcc, so that a Go toolchain download works out of the box.
This forces the support for two linking modes: with and without
gcc.

2. It is a goal to allow users with old copies of SWIG to continue
to use those copies. This forces the support for "internal only"
packages. Perhaps it is reasonable to require a new SWIG.
I don't know.

R=iant
CC=golang-dev
https://golang.org/cl/7433043
2013-02-28 10:44:29 -08:00
Matt Brown
1300fb5449 strconv: use Quote to escape the input string for failed conversion errors
This reveals the presence of control and non-printable characters in the
errors returned by the Parse functions.  Also add unit tests for NumError.

R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/7393075
2013-02-28 10:08:05 -08:00
Rob Pike
ee95c95ebd C: add googler Matt Brown mdbrown@google.com
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7444045
2013-02-28 10:06:38 -08:00