Rob Pike [Sun, 31 Oct 2010 20:41:30 +0000 (13:41 -0700)]
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.
Rob Pike [Thu, 28 Oct 2010 23:54:24 +0000 (16:54 -0700)]
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.
Russ Cox [Tue, 26 Oct 2010 00:55:50 +0000 (17:55 -0700)]
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.
Andrew Gerrand [Mon, 25 Oct 2010 03:37:30 +0000 (14:37 +1100)]
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.
Rob Pike [Fri, 22 Oct 2010 22:16:34 +0000 (15:16 -0700)]
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.
Rob Pike [Fri, 22 Oct 2010 18:17:40 +0000 (11:17 -0700)]
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.
Robert Griesemer [Fri, 22 Oct 2010 17:03:14 +0000 (10:03 -0700)]
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
Robert Griesemer [Fri, 22 Oct 2010 15:58:52 +0000 (08:58 -0700)]
go spec: relaxed syntax for array, slice, and map composite literals
For elements which are themselves composite literals, the type may
be omitted if it is identical to the element type of the containing
composite literal.
Russ Cox [Thu, 21 Oct 2010 15:39:47 +0000 (11:39 -0400)]
ld: abandon symbol-driven archive loading
Load the entire archive file instead.
Reduces I/O by avoiding additional passes
through libraries to resolve symbols.
Go packages always need all the files anyway
(most often, all 1 of them).
Russ Cox [Thu, 21 Oct 2010 15:25:14 +0000 (11:25 -0400)]
encoding/binary: give LittleEndian, BigEndian specific types
Giving them specific types has the benefit that
binary.BigEndian.Uint32(b) is now a direct call, not an
indirect via a mutable interface value, so it can potentially
be inlined.
Recent changes to the spec relaxed the rules for comparison,
so this code is still valid:
func isLittle(o binary.ByteOrder) { return o == binary.LittleEndian }
The change does break this potential idiom:
o := binary.BigEndian
if foo {
o = binary.LittleEndian
}
That must rewrite to give o an explicit binary.ByteOrder type.
On balance I think the benefit from the direct call and inlining
outweigh the cost of breaking that idiom.
Russ Cox [Thu, 21 Oct 2010 04:56:20 +0000 (06:56 +0200)]
arm: prop up software floating point
Just enough to make mov instructions work,
which in turn is enough to make strconv work
when it avoids any floating point calculations.
That makes a bunch of other packages pass
their tests.
Should suffice until hardware floating point
is available.
Enable package tests that now pass
(some due to earlier fixes).
Looks like there is a new integer math bug
exposed in the fmt and json tests.