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

4693 Commits

Author SHA1 Message Date
Rob Pike
7f7cb166c8 gob: several fixes.
1) Be sure to use the eval-time encoder/decoder rather than
the compile-time decoder.  In a few cases the receiver for
the compiling encoder was being pickled incorrectly into a
closure.
(This is the fix for issue 1238).

2) Get the innermost name right when given a pointer to an
unnamed type.

3) Use a count to delineate interface values, making it
possible to ignore values without having a concrete type
to encode into.  This is a protocol change but only for the
new feature, so it shouldn't affect anyone.  The old test
worked because, amazingly, it depended on bug #1.

Fixes #1238.

R=rsc, albert.strasheim
CC=golang-dev
https://golang.org/cl/2806041
2010-10-31 13:41:30 -07:00
Alex Brainman
a8c4da996e syscall: fix windows build
R=golang-dev
CC=golang-dev
https://golang.org/cl/2713043
2010-10-30 23:55:22 +11:00
Alex Brainman
7812b79627 syscall: fix Stat(path) where path is directory with trailing '/' on windows
Fixes #1220.

R=rsc, r
CC=golang-dev
https://golang.org/cl/2728043
2010-10-30 23:06:49 +11:00
Rob Pike
c490bb6f81 gob: clarify the comments about installing the debug/dumper.
R=rsc
CC=golang-dev
https://golang.org/cl/2789043
2010-10-29 15:52:25 -07:00
Rob Pike
96b9efe8a9 gob: make the debugging (dumping) code work again. Mostly rewrite it, in fact.
It's still not compiled in by default.

R=rsc, r2
CC=golang-dev
https://golang.org/cl/2754043
2010-10-29 15:07:56 -07:00
Robert Griesemer
907e998cba go/scanner: added another test case, clarified some code
R=rsc
CC=golang-dev
https://golang.org/cl/2741042
2010-10-29 15:07:04 -07:00
Robert Griesemer
7eb5c9a520 ebnf: use append
R=r, rsc
CC=golang-dev
https://golang.org/cl/2799041
2010-10-28 21:23:24 -07:00
Robert Griesemer
75855a8f5e tabwriter: use append
R=rsc
CC=golang-dev
https://golang.org/cl/2798041
2010-10-28 21:23:04 -07:00
Robert Griesemer
5762cd3755 go/doc: use append
R=rsc
CC=golang-dev
https://golang.org/cl/2792041
2010-10-28 17:26:01 -07:00
Rob Pike
4e9cc085d2 testing: eliminate testing/regexp
Rather than updating the stripped-down regexp implementation embedded
in testing, delete it by passing the one function we need from the package
main file created by gotest.

R=rsc
CC=golang-dev
https://golang.org/cl/2761043
2010-10-28 16:54:24 -07:00
Rob Pike
1f4d54ea01 regexp: eliminate vector in favor of append.
R=rsc
CC=golang-dev
https://golang.org/cl/2795041
2010-10-28 15:54:01 -07:00
Robert Griesemer
fafb116c75 go/printer: use append
R=rsc
CC=golang-dev
https://golang.org/cl/2793041
2010-10-28 15:09:47 -07:00
Robert Griesemer
098e94173a go/typechecker: use append
R=rsc
CC=golang-dev
https://golang.org/cl/2736044
2010-10-28 15:09:21 -07:00
Andrew Gerrand
6062515a93 container/list: document iteration
R=rsc
CC=golang-dev
https://golang.org/cl/2768042
2010-10-29 08:48:16 +11:00
Robert Griesemer
302b0ff942 go/parser: use append
R=rsc
CC=golang-dev
https://golang.org/cl/2720042
2010-10-28 13:36:28 -07:00
Robert Griesemer
12be168b4b godoc: bug fix (bug introduced with revision 3ee58453e961)
(thanks to Chris Dollin for identifying the cause)

Fixes #1237.

R=rsc
CC=golang-dev
https://golang.org/cl/2753043
2010-10-28 08:44:25 -07:00
Russ Cox
69c4e9380b use append
R=gri, r, r2
CC=golang-dev
https://golang.org/cl/2743042
2010-10-27 19:47:23 -07:00
Russ Cox
d8b5d039cd gc: implement append
R=ken2
CC=golang-dev
https://golang.org/cl/2757042
2010-10-27 17:56:32 -07:00
Andrew Gerrand
250ac87368 rpc: expose Server type to allow multiple RPC Server instances
R=r, rsc, msolo, sougou
CC=golang-dev
https://golang.org/cl/2696041
2010-10-28 11:05:56 +11:00
Brad Fitzpatrick
ad7d24ac4b image/png: speed up paletted encoding ~25%
Avoids a lot of redundant bounds checks.

R=nigeltao, rsc
CC=golang-dev
https://golang.org/cl/2678041
2010-10-27 22:48:18 +11:00
Russ Cox
d86ab015f7 use copy
R=gri
CC=golang-dev
https://golang.org/cl/2763041
2010-10-26 21:52:54 -07:00
Russ Cox
e48c0fb562 5g, 6g, 8g: generate code for string index
instead of calling function.

R=ken2
CC=golang-dev
https://golang.org/cl/2762041
2010-10-26 21:11:17 -07:00
Russ Cox
705c0382e8 big: arm assembly, faster software mulWW, divWW
Reduces time spent running crypto/rsa test by 65%.

Fixes #1227.

R=gri, PeterGo
CC=golang-dev
https://golang.org/cl/2743041
2010-10-26 21:10:17 -07:00
Rob Pike
f437d4d356 gob: must register basic types to store them in interfaces.
Fixes #1230.

R=rsc
CC=golang-dev
https://golang.org/cl/2750041
2010-10-26 17:07:39 -07:00
Nigel Tao
3bb036958c gob: package doc fixes.
R=r, r2, nigeltao_gnome
CC=golang-dev
https://golang.org/cl/2748041
2010-10-27 10:46:00 +11:00
Russ Cox
82c6f5e3d1 gc, runtime: copy([]byte, string)
R=ken2
CC=golang-dev
https://golang.org/cl/2741041
2010-10-26 08:36:07 -07:00
Russ Cox
8fff9166f6 arm: enable all tests
ARM functionality is now completely working.
(Or if it's not, we'll fix it.)

R=ken2
CC=golang-dev
https://golang.org/cl/2738041
2010-10-25 21:25:13 -07:00
Russ Cox
da26e27c05 debug/gosym: do not run when cross-compiling
R=r
CC=golang-dev
https://golang.org/cl/2737041
2010-10-25 18:00:42 -07:00
Russ Cox
7c2b1597c6 arm: precise float64 software floating point
Adds softfloat64 to generic runtime
(will be discarded by linker when unused)
and adds test for it.  I used the test to check
the software code against amd64 hardware
and then check the software code against
the arm and its simulation of hardware.
The latter should have been a no-op (testing
against itself) but turned up a bug in 5c causing
the vlrt.c routines to miscompile.

These changes make the cmath, math,
and strconv tests pass without any special
accommodations for arm.

R=ken2
CC=golang-dev
https://golang.org/cl/2713042
2010-10-25 17:55:50 -07:00
Robert Griesemer
e351533aab big: delete unnecessary type decls
R=rsc, r
CC=golang-dev
https://golang.org/cl/2732041
2010-10-25 17:45:43 -07:00
Robert Griesemer
19b8fc788c tabwriter: delete unnecessary type declaration
R=rsc, r2
CC=golang-dev
https://golang.org/cl/2733041
2010-10-25 17:45:26 -07:00
Robert Griesemer
c77f090085 go/scanner: delete unnecessary type declarations
R=rsc, r2
CC=golang-dev
https://golang.org/cl/2735041
2010-10-25 17:44:54 -07:00
Rob Pike
5556f733c7 gotest: generate correct gofmt-formatted _testmain.go
Fixes #1225.

R=adg
CC=golang-dev
https://golang.org/cl/2729041
2010-10-25 17:03:25 -07:00
Andrew Gerrand
ec8f8149d2 goinstall: display helpful message when encountering a cgo package.
R=rsc
CC=golang-dev
https://golang.org/cl/2701042
2010-10-26 10:59:30 +11:00
Russ Cox
35f8a3f90e runtime: remove .c generated from .goc during make clean
R=r
CC=golang-dev
https://golang.org/cl/2704042
2010-10-25 16:54:59 -07:00
Russ Cox
079cbddbd8 arm: fix signal handler
R=ken2
CC=golang-dev
https://golang.org/cl/2670042
2010-10-26 01:32:36 +02:00
Russ Cox
b0ad7a4268 5g: complex "regalloc"
R=ken2
CC=golang-dev
https://golang.org/cl/2727041
2010-10-26 01:26:33 +02:00
Russ Cox
41b5fb4761 5c: implement uint32 -> float
There are other missing conversion cases
still but they do not show up in my tests.
This one is needed for vlrt.c's _v2d (int64, uint64 -> float).

Thankfully, VFP has a single instruction to do this.

R=ken2
CC=golang-dev
https://golang.org/cl/2726041
2010-10-25 16:18:16 -07:00
Andrew Gerrand
6e87a0abc9 build: only print "You need to add foo to PATH" when needed
Fixes #1223.

R=bradfitz
CC=golang-dev
https://golang.org/cl/2701041
2010-10-25 16:38:48 +11:00
Andrew Gerrand
32a6613e94 container/list: elide redundant tests and fix comment typo
R=dsymonds
CC=golang-dev
https://golang.org/cl/2700041
2010-10-25 14:50:47 +11:00
Andrew Gerrand
01389b966e container/list: fix Remove bug and use pointer to self as identifier
Remove wasn't nil'ing the *Element.id. This property was exploited
by MoveToFront and MoveToBack internally, so I renamed the existing
Remove to "remove", and created an exported wrapper "Remove" that does
the right thing for the user's sake.

Also, saved an allocation by using *List as the id rather than *byte.

Fixes #1224.

R=rsc, dsymonds
CC=golang-dev
https://golang.org/cl/2685042
2010-10-25 14:37:30 +11:00
Fazlul Shahriar
ee065332dd goinstall: don't wrongly error out with "multiple package names"
Fixes #1215.

R=adg, rsc
CC=golang-dev
https://golang.org/cl/2695042
2010-10-25 13:13:00 +11:00
Luuk van Dijk
4228e62259 6l/8l: global and local variables and type info.
R=rsc
CC=golang-dev
https://golang.org/cl/2201044
2010-10-24 23:07:52 +02:00
Rob Pike
c28fa513f5 gob: error cleanup 2
Simplify error handling during the compilation phase.

R=rsc
CC=golang-dev
https://golang.org/cl/2652042
2010-10-22 16:07:26 -07:00
Rob Pike
f593b37f23 gobs: error cleanup part 1.
Remove err from the encoderState and decoderState types, so we're
not always copying to and from various copies of the error, and then
use panic/recover to eliminate lots of error checking.

another pass might take a crack at the same thing for the compilation phase.

R=rsc
CC=golang-dev
https://golang.org/cl/2660042
2010-10-22 15:16:34 -07:00
Russ Cox
1dd0319be3 runtime: print unknown types in panic
R=r
CC=golang-dev
https://golang.org/cl/2683041
2010-10-22 17:04:32 -04:00
Russ Cox
e5e9211071 5l, 6l, 8l: introduce sub-symbols
Sub-symbols are laid out inside a larger symbol
but can be addressed directly.

Use to make Mach-O pointer array not a special case.

Will use later to describe ELF sections.

Glimpses of the beginning of ELF loading.

R=ken2
CC=golang-dev
https://golang.org/cl/2623043
2010-10-22 15:27:50 -04:00
Rob Pike
5d9064697b gob: allow exchange of interface values
The implemetation describes each value as a string identifying the
concrete type of the value, followed by the usual encoding of that
value.  All types to be exchanged as contents of interface values
must be registered ahead of time with the new Register function.
Although this would not seem strictly necessary, the linker garbage
collects unused types so without some mechanism to guarantee
the type exists in the binary, there could be unpleasant surprises.
Moreover, the receiver needs a reflect.Type of the value to be
written in order to be able to save the data. A Register function
seems necessary.

The implementation may require defining types in the middle of
of sending a value.  The old code never did this. Therefore there
has been some refactoring to make the encoder and decoder
work recursively.

This change changes the internal type IDs. Existing gob archives
will break with this change.  Apologies for that. If this is a deal
breaker it should be possible to create a conversion tool.

Error handling is too complicated in this code. A subsequent
change should clean it up.

R=rsc
CC=golang-dev
https://golang.org/cl/2618042
2010-10-22 11:17:40 -07:00
Robert Griesemer
3478891d12 gofmt -s -w src misc
R=r, rsc
CC=golang-dev
https://golang.org/cl/2662041
2010-10-22 10:06:33 -07:00
Robert Griesemer
f613015e0e go ast/parser/printer: permit elision of composite literal types for composite literal elements
gofmt: added -s flag to simplify composite literal expressions through type elision where possible

R=rsc
CC=golang-dev
https://golang.org/cl/2319041
2010-10-22 10:03:14 -07:00