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.
Russ Cox [Wed, 20 Oct 2010 19:16:39 +0000 (12:16 -0700)]
6l: correct logic for morestack choice
The frame that gets allocated is for both
the args and the autos. If together they
exceed the default frame size, we need to
tell morestack about both so that it allocates
a large enough frame.
Sanity check stack pointer in morestack
to catch similar bugs.
Rob Pike [Wed, 20 Oct 2010 04:25:28 +0000 (21:25 -0700)]
reflect: add InterfaceValue.Get to enable setting of an interface
value (through unsafe means) without having a reflect.Type
of type *interface{} (pointer to interface). This is needed to make
gob able to handle interface values by a method analogous to
the way it handles maps.
Russ Cox [Tue, 19 Oct 2010 22:07:19 +0000 (18:07 -0400)]
5l, 6l, 8l: link pclntab and symtab as ordinary rodata symbols
That is, move the pc/ln table and the symbol table
into the read-only data segment. This eliminates
the need for a special load command to map the
symbol table into memory, which makes the
information available on systems that couldn't handle
the magic load to 0x99000000, like NaCl and ARM QEMU
and Linux without config_highmem=y. It also
eliminates an #ifdef and some clumsy code to
find the symbol table on Windows.
The bad news is that the binary appears to be bigger
than it used to be. This is not actually the case, though:
the same amount of data is being mapped into memory
as before, and the tables are still read-only, so they're
still shared across multiple instances of the binary as
they were before. The difference is just that the tables
aren't squirreled away in some section that "size" doesn't
know to look at.
This is a checkpoint.
It probably breaks Windows and breaks NaCl more
than it used to be broken, but those will be fixed.
The logic involving -s needs to be revisited too.