Specifically:
* lib/godoc:
- provide file set (FSet) argument to formatters where needed
* src/cmd:
- cgo, ebnflint, godoc, gofmt, goinstall: provide file set (fset) where needed
- godoc: remove local binary search with sort.Search (change by rsc),
extract file set for formatters
* src/pkg:
- exp/eval: remove embedded token.Position fields from nodes and replace
with named token.Pos fields; add corresponding Pos() accessor methods
- go/token: added file.Line(), changed signature of File.Position()
* test/fixedbugs/:
- bug206.go: change test to not rely on token.Pos details
* added various extra comments
* Runs all.bash
* gofmt formats all of src, misc w/o changes
* godoc runs
* performance:
- The new version of godoc consumes about the same space after indexing
has completed, but indexing is half the speed. Significant space savings
are expected from smaller ASTs, but since they are thrown away after a
file has been indexed, this is not visible anymore. The slower indexing
time is due to the much more expensive computation of line information.
However, with the new compressed position information, indexing can be
rewritten and simplified. Furthermore, computing the line info can be
done more efficiently.
New godoc, immediately after indexing completed (best of three runs):
PID COMMAND %CPU TIME #TH #PRTS #MREGS RPRVT RSHRD RSIZE VSIZE
44381 godoc 0.0% 0:38.00 4 19 149 145M 184K 148M 176M
2010/12/03 17:58:35 index updated (39.231s, 18505 unique words, 386387 spots)
2010/12/03 17:58:35 bytes=90858456 footprint=199182584
2010/12/03 17:58:36 bytes=47858568 footprint=167295224
Old godoc, immediately after indexing completed (best of three runs):
PID COMMAND %CPU TIME #TH #PRTS #MREGS RPRVT RSHRD RSIZE VSIZE
23167 godoc 0.0% 0:22.02 4 17 132 129M 184K 132M 173M
2010/12/03 14:51:32 index updated (24.892s, 18765 unique words, 393830 spots)
2010/12/03 14:51:32 bytes=66404528 footprint=163907832
2010/12/03 14:51:32 bytes=46282224 footprint=163907832
The different numbers for unique words/spots stem from the fact the the
two workspaces are not exactly identical. The new godoc maintains a large
file set data structure during indexing which (probably) is the reason
for the larger heap (90858456 vs 66404528) before garbage collection.
R=rsc, r
CC=golang-dev
https://golang.org/cl/3050041
8l was broken by commit 7ac0d2eed9, it caused .data to be page aligned in the file - which is not how Plan 9 expects things to be.
Also .rodata was layed out in a similar fashion.
Not sure when signame was introduced, but added a stub.
Removed the symo assignment in asm.c as it is not currently used.
Fix runtime breakage after commit 629c065d36 which prefixes all external symbols with runtime·.
R=rsc
CC=golang-dev
https://golang.org/cl/2674041
Note:
* Exp2 doesn't have a special case for very small arguments
* Exp2 hasn't been subject to a proper error analysis
Also:
* add tests for Exp2 with integer argument
* always test Go versions of Exp and Exp2
R=rsc
CC=Charlie Dorian, PeterGo, golang-dev
https://golang.org/cl/3481041
fmt.Printf("%U", 1) yields "U+0001"
It's essentially "U+%.4x" but lets you override the precision works in scan, too.
R=rsc
CC=golang-dev
https://golang.org/cl/3423043
Doing the tail recursion elimination explicitly
seems safer than leaving it to the compiler;
the code is still clean and easy to understand.
R=r, r2, gri
CC=golang-dev
https://golang.org/cl/3373041
Before one could say
{field}
or
{field|formatter}
Now one can also say
{field1 field2 field3}
or
{field1 field2 field3|formatter}
and the fields are passed as successive arguments to the formatter,
analogous to fmt.Print.
R=rsc, gri
CC=golang-dev
https://golang.org/cl/3385041
Make them more like Printf, with a ... final argument. This breaks
code with existing formatters but not the templates that use them.
R=rsc, gri
CC=golang-dev
https://golang.org/cl/3378041
Changed all uses of bytes.Add (aside from those testing bytes.Add) to append(a, b...).
Also ran "gofmt -s" and made use of copy([]byte, string) in the fasta benchmark.
R=golang-dev, r, r2
CC=golang-dev
https://golang.org/cl/3302042
This means that any Writer can be used safely
even when Output is called concurrently.
Fixes#1302.
R=r, nigeltao_gnome
CC=golang-dev
https://golang.org/cl/3300042
Make Split work on backslashes as well as on slashes under Windows
and support the "C:filename" special case. Also add corresponding
tests.
R=r, rsc, PeterGo, r2, brainman
CC=golang-dev
https://golang.org/cl/3008041
# test program
1 package main
2
3 type C chan int
4
5 func F(c C) {
6 c <- true
7 }
# old error
test.go:6: cannot use true (type bool) as type int in function argument
# new error
test.go:6: cannot use true (type bool) as type int in channel send
R=rsc, ejsherry
CC=golang-dev
https://golang.org/cl/3231042
This will make it easier to use Pos values
together with suffix arrays by slightly de-
coupling the mapping of Pos values to global
offsets.
R=rsc
CC=golang-dev
https://golang.org/cl/3231041
- compare against fsModified to check if index is out of date
- don't change fsModified if there are no user-mapped file systems
R=rsc, iant
CC=golang-dev
https://golang.org/cl/3213041
cipher is intended to replace crypto/block over time. This
change only adds basic parts: CBC and CTR mode and doesn't add
the package to the top-level Makefile.
R=r, rsc
CC=golang-dev
https://golang.org/cl/3069041
This makes it much easier to use a tool like Swig which needs
to run either 8c or 6c on generated code which #include's
"runtime.h".
R=ken2, rsc
CC=golang-dev
https://golang.org/cl/3205041
Backwards incompatible change, but makes
it easier to reason about non-idiomatic searches:
now f specifies what is sought.
R=gri
CC=golang-dev
https://golang.org/cl/3195042
Change comment to be more generic,
with indexed data structure search as
one common use case.
Fix typo []data.
R=gri, rog
CC=golang-dev
https://golang.org/cl/3159041
This fixes a problem with relativePath, where
a prefix was not recognized because it ended
in "//" as opposed to just "/".
Also: Minor unrelated cleanup of a declaration.
R=rsc
CC=golang-dev
https://golang.org/cl/3146041
A pos value represents a file-set specific, accurate
source position value. It is 8x smaller in size than
the corresponding Position value (4 bytes vs 32 bytes).
Using Pos values instead of Position values in AST
saves approx. 25MBytes of memory when running godoc
on the current repository.
This CL introduces the Pos, File, and FileSet data
types; it does not affect existing code. Another
(pending CL) will make the change to all dependent
source files.
Missing: tests
R=r
CC=golang-dev, rsc
https://golang.org/cl/2936041
Cleaner, but also results in a 25%+ performance improvement for Get()/SetValue() on my machine.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/3072041
The need for a LastIndexAny function has come up in the discussion
for https://golang.org/cl/3008041/. This function is
implemented analogously to lastIndexFunc, using functions from
the utf8 package.
R=r, rsc, PeterGo
CC=golang-dev
https://golang.org/cl/3057041
* Add support for certificate policy identifiers
* Fix the version number of generated certificates
* Fix the parsing of version numbers
* Fix the case of multiple name entries (it should have been a list of
tagged values, not a tagged list of values).
R=r
CC=golang-dev
https://golang.org/cl/3044041
When searching a list of directories, the files which match
the pattern are accumulated in a slice. If the glob has a
wildcard for the directory, and the wildcard matches a file
rather than a directory, then the files found so far are
discarded. E.g., path.Glob("*/x") in a directory which
contains both files and subdirectories. This patch avoids
discarding matches found so far when a file is found.
R=r
CC=bsiegert, golang-dev
https://golang.org/cl/3015042
This is in preparation for a different position representation.
It also resolves situations where a node would be printed as
it's node position simply because the embedded token.Position
has a String method.
R=r
CC=golang-dev
https://golang.org/cl/2991041
When it is known that there is already at least one element in the
list, it is awkwardly verbose to use three lines and an extra
variable declaration to remove the first or last item (a common
case), rather than use a simple expression.
a stack:
stk.PushFront(x)
x = stk.Front().Remove().(T)
vs.
stk.PushFront(x)
e := stk.Front()
e.Remove()
x = e.Value.(T)
[An alternative CL might be to add PopFront and PopBack methods].
R=gri
CC=golang-dev
https://golang.org/cl/3000041
As discussed in http://groups.google.com/group/golang-dev/browse_thread/thread/926b7d550d98ec9e,
add a simple "path expander" function, which returns all the
files matching the given pattern. This function is called Glob
after glob(3) in libc.
Also add a convenience function, hasMeta, that checks whether
a string contains one of the characters which are specially handled
by Match.
R=rsc, r, r2
CC=golang-dev
https://golang.org/cl/2476041
Previously we checked the certificate chain from the leaf
upwards and expected to jump from the last cert in the chain to
a root certificate.
Although technically correct, there are a number of sites with
problems including out-of-order certs, superfluous certs and
missing certs.
The last of these requires AIA chasing, which is a lot of
complexity. However, we can address the more common cases by
using a pool building algorithm, as browsers do.
We build a pool of root certificates and a pool from the
server's chain. We then try to build a path to a root
certificate, using either of these pools.
This differs from the behaviour of, say, Firefox in that Firefox
will accumulate intermedite certificate in a persistent pool in
the hope that it can use them to fill in gaps in future chains.
We don't do that because it leads to confusing errors which only
occur based on the order to sites visited.
This change also enabled SNI for tls.Dial so that sites will return
the correct certificate chain.
R=rsc
CC=golang-dev
https://golang.org/cl/2916041
Prefix all external symbols in runtime by runtime·,
to avoid conflicts with possible symbols of the same
name in linked-in C libraries. The obvious conflicts
are printf, malloc, and free, but hide everything to
avoid future pain.
The symbols left alone are:
** known to cgo **
_cgo_free
_cgo_malloc
libcgo_thread_start
initcgo
ncgocall
** known to linker **
_rt0_$GOARCH
_rt0_$GOARCH_$GOOS
text
etext
data
end
pclntab
epclntab
symtab
esymtab
** known to C compiler **
_divv
_modv
_div64by32
etc (arch specific)
Tested on darwin/386, darwin/amd64, linux/386, linux/amd64.
Built (but not tested) for freebsd/386, freebsd/amd64, linux/arm, windows/386.
R=r, PeterGo
CC=golang-dev
https://golang.org/cl/2899041
Previously all the functions took two arguments: src, dst. This is the
reverse of the usual Go style and worth changing sooner rather than
later.
Unfortunately, this is a change that the type system doesn't help
with. However, it's not a subtle change: any unittest worth the name
should catch this.
R=rsc, r
CC=golang-dev
https://golang.org/cl/2751042
CAST5 is the default OpenPGP cipher.
(This won't make Rob any happier about the size of crypto/, of course.)
It already has dst, src in that order but it doesn't have any users yet so I figure it's better than changing it later.
R=rsc, gri, r
CC=golang-dev
https://golang.org/cl/2762042
There's no need to hold the client mutex when calling encode, since encode itself
uses a mutex to make the writes atomic. However, we need to keep
the messages ordered, so add a mutex for that purpose alone.
Fixes#1244.
R=rsc
CC=golang-dev
https://golang.org/cl/2833041
First step towards a more light-weight implementation of token.Position:
- only use token.Position for reporting token and error position
- use offsets only for scanner control
- no interface changes yet
R=rsc
CC=golang-dev
https://golang.org/cl/2825041
Restore ability to have different file and
section alignment in generated pe file.
Stop generating .bss pe section, it is
part of .data now.
Some code refactoring.
R=rsc, vcc
CC=golang-dev
https://golang.org/cl/2731041
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