A HMUL node appears in some constant divisions, but
to observe a false negative in race detector the divisor must be
suitably chosen to make sure the only memory access is
done for HMUL.
R=dvyukov
CC=golang-dev
https://golang.org/cl/7935045
The changes are almost completely self-contained
in the new file linkify.go. The other changes are
minimal and should not disturb the currently
working godoc, in anticipation of Go 1.1.
To disable the feature in case of problems, set
-links=false.
Fixes#2063.
R=adg, r
CC=golang-dev
https://golang.org/cl/7883044
Handle interface comparison correctly,
add a few more tests, mark more nodes as impossible.
R=dvyukov, golang-dev
CC=golang-dev
https://golang.org/cl/7942045
Fixes SWIG callbacks. Previously crosscall2 was only
cgo_export_static, despite the use of two #pragma declarations
in runtime/cgo/callbacks.c.
R=golang-dev, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/7817048
The right operand of a && and || is only executed conditionnally,
so the instrumentation must be more careful. In particular
it should not turn nodes assumed to be cheap after walk into
expensive ones.
Update #4228
R=dvyukov, golang-dev
CC=golang-dev
https://golang.org/cl/7986043
XOR key into data 128 bits at a time instead of 64 bits
and pipeline half of state loads. Rotate loop to allow
single-register indexing for state[i].
On a MacBookPro10,2 (Core i5):
benchmark old ns/op new ns/op delta
BenchmarkRC4_128 412 224 -45.63%
BenchmarkRC4_1K 3179 1613 -49.26%
BenchmarkRC4_8K 25223 12545 -50.26%
benchmark old MB/s new MB/s speedup
BenchmarkRC4_128 310.51 570.42 1.84x
BenchmarkRC4_1K 322.09 634.48 1.97x
BenchmarkRC4_8K 320.97 645.32 2.01x
For comparison, on the same machine, openssl 0.9.8r reports
its rc4 speed as somewhat under 350 MB/s for both 1K and 8K
(it is operating 64 bits at a time).
On an Intel Xeon E5520:
benchmark old ns/op new ns/op delta
BenchmarkRC4_128 418 259 -38.04%
BenchmarkRC4_1K 3200 1884 -41.12%
BenchmarkRC4_8K 25173 14529 -42.28%
benchmark old MB/s new MB/s speedup
BenchmarkRC4_128 306.04 492.48 1.61x
BenchmarkRC4_1K 319.93 543.26 1.70x
BenchmarkRC4_8K 321.61 557.20 1.73x
For comparison, on the same machine, openssl 1.0.1
reports its rc4 speed as 587 MB/s for 1K and 601 MB/s for 8K.
R=agl
CC=golang-dev
https://golang.org/cl/7865046
gcc generates only attr DW_AT_byte_size for DW_TAG_pointer_type of "void *",
but we used to also generate DW_AT_type pointing to imaginary unspecified
type "void", which confuses some gdb.
This change makes old Apple gdb 6.x (specifically, Apple version gdb-1515)
accepts our binary without issue like this:
(gdb) b 'main.main'
Die: DW_TAG_unspecified_type (abbrev = 10, offset = 47079)
has children: FALSE
attributes:
DW_AT_name (DW_FORM_string) string: "void"
Dwarf Error: Cannot find type of die [in module /Users/minux/go/go2.hg/bin/go]
Special thanks to Russ Cox for pointing out the problem in comment #6 of
CL 7891044.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7744051
CL 7504044 accidentally reverted part of CL 7891044 and 7552045, this CL
bring those part back.
R=golang-dev
TBR=rsc
CC=golang-dev
https://golang.org/cl/7950045
Add missing CLOSUREVAR in switch.
Mark MAKE, string conversion nodes as impossible.
Control statements do not need instrumentation.
Instrument COM and LROT nodes.
Instrument map length.
Update #4228
R=dvyukov, golang-dev
CC=golang-dev
https://golang.org/cl/7504047
Hashtable is arranged as an array of
8-entry buckets with chained overflow.
Each bucket has 8 extra hash bits
per key to provide quick lookup within
a bucket. Table is grown incrementally.
Update #3885
Go time drops from 0.51s to 0.34s.
R=r, rsc, m3b, dave, bradfitz, khr, ugorji, remyoudompheng
CC=golang-dev
https://golang.org/cl/7504044
Fixes#5085.
{6,8}c/swt.c allocates a third Biobuf in automatic memory which is not terminated at the end of the function. This causes the buffer to be 'in use' when the batexit handler fires, confusing valgrind.
Huge thanks to DMorsing for the diagnosis.
R=golang-dev, daniel.morsing, rsc
CC=golang-dev
https://golang.org/cl/7844044
Fixes build. One part of ../misc/cgo/test appears to be unhappy but this does not cause the build to fail.
R=rsc, r
CC=golang-dev
https://golang.org/cl/7769047
While we're here, downgrade DWARF to version 2.
We're not using any version 3 features, and OS X gdb
only supports version 2.
Fixes#3436.
R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7891044
- A note doesn't have to be in the first
comment of a comment group anymore, and
several notes may appear in the same comment
group (e.g., it is fairly common to have a
TODO(uid) note immediately following another
comment).
- Define a doc.Note type which also contains
note uid and position info.
- Better formatting in godoc output. The position
information is not yet used, but could be used to
locate the note in the source text if desired.
Fixes#4843.
R=r, cnicolaou
CC=gobot, golang-dev
https://golang.org/cl/7496048
Usually, there is no esc info when inlining, but there will be when generating inlined wrapper functions.
If we don't use this information, we get invalid addresses on the stack.
Fixes#5056.
R=golang-dev, rsc
CC=golang-dev, remyoudompheng
https://golang.org/cl/7850045
It used to not mark parameters as escaping if only one of the
fields it points to leaks out of the function. This causes
problems when importing from another package.
Fixes#4964.
R=rsc, lvd, dvyukov, daniel.morsing
CC=golang-dev
https://golang.org/cl/7648045
thread_GOOS.c becomes os_GOOS.c.
signal_GOOS_GOARCH.c becomes os_GOOS_GOARCH.c,
but with non-GOARCH-specific code moved into os_GOOS.c.
The actual arch-specific signal handler moves into signal_GOARCH.c
to avoid per-GOOS duplication.
New files signal_GOOS_GOARCH.h provide macros for
accessing fields of the very system-specific signal info structs.
Lots moving, but nothing changing.
This is a preliminarly cleanup so I can work on the signal
handling code to fix some open issues without having to
make each change 13 times.
Tested on Linux and OS X, 386 and amd64.
Will fix Plan 9, Windows, and ARM after the fact if necessary.
(Plan 9 and Windows should be fine; ARM will probably have some typos.)
Net effect: -1081 lines of code.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7565048
An earlier CL disallowed ~ anywhere in GOPATH, to avoid
problems with GOPATH='~/home' instead of GOPATH=~/home.
But ~ is only special in the shell at the beginning of each of
the paths in the list, and some paths do have ~ in the middle.
So relax the requirement slightly.
Fixes#4140.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/7799045
The new build tag "go1.1" will be satisfied by any Go 1.z release >= 1.1.
In general, the build tag "go1.x" will be satisfied by any Go 1.z release >= 1.x.
What happens when we reach Go 2 is yet to be decided.
The tags "go1" or "go1.0" are missing, because +build tags did not exist
before then, and also because the Go 1.0 releases do not recognize them.
The new -installsuffix flag gives access to the build context's InstallSuffix
(formerly named InstallTag, but not part of Go 1.0), for use in isolating
builds to custom directories. For example -race implies -installsuffix race,
and an AppEngine-specific build might use -tags appengine -installsuffix appengine.
Fixes#4116.
Fixes#4443.
R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/7794043
Eliminate false positives when you can tell even without
type information that the literal does not need field tags.
Far too noisy otherwise.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7797043
valgrind complained that under some circumstances,
*nr = *nc
was being called when nr and nc were the same *Node. The suggestion my Rémy was to introduce a tmp node to avoid the potential for aliasing in subnode.
R=remyoudompheng, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/7780044
Many thanks to Elias Naur for finding this with Valgrind on Linux.
Perhaps this is what is breaking the windows/amd64 builder.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7595044
This is what pprof expects, or else it won't use the program.
And if it doesn't use the program, it gets very bad results.
Fixes#4818.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7728043
We added -I$GOROOT/pkg/$GOOS_$GOARCH in cmd/go
(I think for use by cgo and swig, primarily) but didn't
update cmd/dist. I was testing some other code and
found that my changes built with cmd/go but failed
during the initial bootstrap. Make them match again.
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7707044
lib9: fix runcmd, removeall, and tempdir functions
cmd/dist: Include run_plan9.c and tempdir_plan9.c
from lib9 for build, and in general consider
file names containing "plan9" for building.
cmd/ld: provide function args for the new functions
from lib9.
R=rsc, rminnich, ality, bradfitz
CC=golang-dev
https://golang.org/cl/7666043
Method calls on interfaces with large stored values
will call the pointer receiver method which may be
a wrapper over a method with value receiver.
This is particularly inefficient for very small bodies.
Inlining the wrapped method body saves a potentially expensive
function call.
benchmark old ns/op new ns/op delta
BenchmarkSortString1K 802295 641387 -20.06%
BenchmarkSortInt1K 359914 238234 -33.81%
BenchmarkSortInt64K 35764226 22803078 -36.24%
Fixes#4707.
R=golang-dev, daniel.morsing, rsc
CC=golang-dev
https://golang.org/cl/7214044
"go build" and "go install" were mixing stdout and stderr
from the toolchain, then putting it all on stdout. With this
change, it stays mixed, and is sent to stderr. Because
the toolchain does not create output in a clean compile/install,
sending all output to stderr makese more sense.
Also fix test.bash because of "mktemp: too few X's
in template `testgo'" on Linux.
Fixes#4917.
R=golang-dev, rsc, adg
CC=golang-dev
https://golang.org/cl/7393073
This brings Mach-O generation more in line with ELF generation.
Having separate sections for the symtab and pclntab mean that we
can find them that way, instead of using the deprecated debug segments.
(And the host linker will keep separate sections for us, but probably
not the debug segments.)
R=ken2
CC=golang-dev
https://golang.org/cl/7688043
myrtle$ go version
go version devel +d533352b414d Sat Mar 09 05:39:15 2013 +0100 netbsd/386
myrtle$ time go test -ldflags -hostobj ../misc/cgo/test
ok _/var/project/GoLang/misc/cgo/test 10.962s
68.63s real 49.60s user 19.06s system
myrtle$ uname -a
NetBSD myrtle.plan9.local 6.0_BETA2 NetBSD 6.0_BETA2 (GENERIC) i386
R=rsc
CC=golang-dev
https://golang.org/cl/7641047
The sticking point on 386 has been the "PC relative" relocations
used to point the garbage collection metadata at the type info.
These aren't in the code segment, and I don't trust that the linker
isn't doing something special that would be okay in code but
not when interpreting the pointers as data (for example, a PLT
jump table would be terrible).
Solve the problem in two steps:
1. Handle "PC relative" relocations within a section internally,
so that the external linker never sees them.
2. Move the gcdata and gcbss tables into the rodata section,
where the type information lives, so that the relocations can
be handled internally.
(To answer the obvious question, we make the gc->type
references relative so that they need not be relocated
individually when generating a shared object file.)
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7629043
Before this CL, running
cd misc/cgo/test
go test -c
readelf --dyn-syms test.test | grep cgoexp
turned up many UNDEF symbols corresponding to symbols actually
in the binary but marked only cgo_export_static. Only symbols
marked cgo_export_dynamic should be listed in this mode.
And if the symbol is going to be listed, it should be listed with its
actual address instead of UNDEF.
The Linux dynamic linker didn't care about the seemingly missing
symbols, but the BSD one did.
This CL eliminates the symbols from the dyn-syms table.
R=golang-dev
TBR=golang-dev
CC=golang-dev
https://golang.org/cl/7624043
- Introduce MaxAlign constant and use in data layout
and ELF section header.
- Allow up to 16-byte alignment for large objects
(will help Keith's hash changes).
- Emit ELF symbol for .rathole (global /dev/null used by 8c).
- Invoke gcc with -m32/-m64 as appropriate.
- Don't invoke gcc if writing the .o file failed.
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7563045
Still to do: non-linux and non-amd64.
It may work on other ELF-based amd64 systems too, but untested.
"go test -ldflags -hostobj $GOROOT/misc/cgo/test" passes.
Much may yet change, but this seems a reasonable checkpoint.
R=iant
CC=golang-dev
https://golang.org/cl/7369057
We can enable/disable type checking with a build tag.
Should simplify cutting the go1.1 distribution free of go/types.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7482045
The only check so far is for self-assignments of the form "expr = expr",
but even that found one instance in the standard library.
R=r, adg, mtj, rsc
CC=golang-dev
https://golang.org/cl/7455048
Using -import_runtime_cgo would have worked great except
that it doesn't get passed to the second invocation of cgo,
and that's the one that writes the relevant file.
Fixes ARM build on systems with a different dynamic linker
than the one 5l assumes (like Gentoo).
R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7432048
Fixes the App Engine version of godoc. The other fix is to duplicate
this code inside appinit.go. I think initHandlers is the right place
to put the strings.Split call, as the notesToShow var is used by
docServer, which is what initHandlers sets up.
R=dsymonds
CC=golang-dev
https://golang.org/cl/7434044
1. when executing a unsupported VFP instruction, the NetBSD kernel somehow
doesn't report SIGILL, and instead just spin and spin, we add a alarm(2)
to detect this case (albeit this is a kernel bug).
2. NetBSD/ARM's VFP11 support is not complete, so temporarily disable it.
3. The default gcc shipped with NetBSD-current mis-optimizes our code
at -O2, so lower the optimization level to -O1 on NetBSD/ARM.
R=dave, rsc
CC=golang-dev
https://golang.org/cl/7286044
swig >= 2.0.9 requires the size of int values to be passed via a command line flag. Should swig complain about the -intgosize not being supported, then alert the user to their outdated version of swig.
Fixes#4756.
R=golang-dev, minux.ma, iant
CC=golang-dev
https://golang.org/cl/7331048
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