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

2588 Commits

Author SHA1 Message Date
Russ Cox
7ca406396f gc: disallow invalid map keys
The algtype-based test broke when algtype
got a bit more fine-grained, so replace with
an explicit check for the invalid key types.

R=ken2
CC=golang-dev
https://golang.org/cl/5071041
2011-09-19 13:11:24 -04:00
Jaroslavas Počepko
5edf5197e0 cgo: cgo to use GOARCH from the environment, not runtime.GOARCH (otherwise it results in necessity of having 8cgo and 6cgo)
R=rsc, adg
CC=golang-dev
https://golang.org/cl/4978061
2011-09-19 11:50:59 -04:00
Russ Cox
ad7dea1e96 gc: handle complex CONVNOP
Fixes #2256.

R=ken2
CC=golang-dev
https://golang.org/cl/5044047
2011-09-19 11:50:53 -04:00
Dave Cheney
f554c90cef 8l: remove left over debugging
This line was triggering a null dereference warning
        under clang-3.0. The line was added in a46819aa9150
        but compared to it's sibling in 6l it appears to be
        leftover debugging.

R=rsc
CC=golang-dev
https://golang.org/cl/5049042
2011-09-19 11:50:45 -04:00
Robert Griesemer
642d272c3c godoc: remove dependency of syscall
On app-engine, we cannot import syscall.
The respective constants are already defined
elsewhere for the same reason.

R=r, dsymonds
CC=golang-dev
https://golang.org/cl/5036042
2011-09-15 16:47:01 -07:00
Robert Griesemer
66e44000d4 godoc: use new index/suffixarray serialization code
When saving/restoring the fulltext index, the entire
respective suffixarray is now saved/restored (as opposed
to the indexed data only, and the suffixarray recreated).
This saves significant start-up time for large indexes,
at the cost of significantly larger index files.

R=r
CC=golang-dev
https://golang.org/cl/5037043
2011-09-15 16:21:42 -07:00
Russ Cox
bb0c8b3b66 godoc: use go/build to find files in a package
Fixes #1156.
Fixes #2172.

R=gri
CC=golang-dev
https://golang.org/cl/5015044
2011-09-15 16:49:06 -04:00
Russ Cox
17bebd3caa go/build: handle cgo, //build comments
R=adg
CC=golang-dev
https://golang.org/cl/5018044
2011-09-15 12:11:41 -04:00
Robert Griesemer
d76c4a52e7 godoc: support for complete index serialization
- now fulltext index information is saved/restored
- minor updates to appinit.go

R=rsc
CC=golang-dev
https://golang.org/cl/5024043
2011-09-14 20:46:03 -07:00
Russ Cox
b039883946 gofmt: add else test
R=gri
CC=golang-dev
https://golang.org/cl/4978065
2011-09-14 11:29:18 -04:00
Nigel Tao
aa75bee7a5 image: change the NewXxx functions to take a Rectangle instead of
taking (w, h int).

R=rsc, bsiegert, r
CC=golang-dev
https://golang.org/cl/4964073
2011-09-14 21:39:49 +10:00
Rob Pike
4e3b725cf0 path/filepath: new signature for Walk
This one uses a closure than an interface, and is much simpler to use.
It also enables a called function to return an error and (possibly)
halt processing.

Fixes #2237.

R=golang-dev, gri, rsc, r, cw, n13m3y3r
CC=golang-dev
https://golang.org/cl/5014043
2011-09-13 17:47:59 -07:00
Russ Cox
9fc687392c gc: clean up if grammar
Fixes #2248.

R=ken2
CC=golang-dev
https://golang.org/cl/4978064
2011-09-12 15:52:29 -04:00
Russ Cox
48e9c771a1 gofmt: accept program fragments on standard input
This makes it possible to grab a block of code
in an editor and pipe it through gofmt, instead of
having to pipe in the entire file.

R=gri
CC=golang-dev
https://golang.org/cl/4973074
2011-09-12 15:41:49 -04:00
Robert Griesemer
7944bbf2d2 godoc, suffixarray: switch to exp/regexp
R=rsc
CC=golang-dev
https://golang.org/cl/4983058
2011-09-12 12:20:48 -07:00
Andrew Gerrand
3bc2d0f20b doc: link to notable blog posts
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4996041
2011-09-10 09:35:25 +10:00
Luuk van Dijk
ac1b9545e3 ld: grow dwarf includestack on demand.
Fixes #2241
while not breaking issue 1878 again.

R=rsc
CC=golang-dev
https://golang.org/cl/4988048
2011-09-09 15:08:57 +02:00
Robert Griesemer
041dc0a1c2 godoc: show packages matching a query at the top
Also: fix layout of textual search results and
fix a field reference in the respective template.

Fixes #1987.

R=rsc, r
CC=golang-dev
https://golang.org/cl/4962061
2011-09-08 15:35:56 -07:00
Robert Griesemer
49bcc88f79 undo CL 4964067 / 661cb84cc6f0
API change. Needs further reflection.

««« original CL description
path/filepath: Simplify Walk interface

The last argument of filepath.Walk was removed, and the Visitor
interface now contains an Error method that is called on errors.

Fixes #2237.

R=golang-dev, gri, r
CC=golang-dev
https://golang.org/cl/4964067

»»»

R=r
CC=golang-dev
https://golang.org/cl/4974065
2011-09-07 15:19:53 -07:00
Gustavo Niemeyer
e5c20dc270 path/filepath: Simplify Walk interface
The last argument of filepath.Walk was removed, and the Visitor
interface now contains an Error method that is called on errors.

Fixes #2237.

R=golang-dev, gri, r
CC=golang-dev
https://golang.org/cl/4964067
2011-09-07 14:49:48 -07:00
Russ Cox
1e480cd1ad gc: add -p flag to catch import cycles earlier
The linker would catch them if gc succeeded,
but too often the cycle manifests as making the
current package and the imported copy of itself
appear as different packages, which result in
type signature mismatches that confuse users.

As a crutch, add the -p flag to say 'if you see an
import of this package, give up early'.  Results in
messages like (during gotest in sort):

export_test.go:7: import "sort" while compiling that package (import cycle)
export_test.go:7: import "container/heap": package depends on "sort" (import cycle)

Fixes #2042.

R=ken
CC=bradfitz, dsymonds, golang-dev
https://golang.org/cl/4972057
2011-09-07 15:50:21 -04:00
Hector Chu
aed2c06dcb 5a, 5c, 6a, 6c, 8a, 8c: fix Windows file paths
Verified with objdump -W.

R=alex.brainman, rsc
CC=golang-dev
https://golang.org/cl/4974061
2011-09-07 15:49:56 -04:00
Lucio De Re
4ba677c6ea gc: silence Plan 9 warnings
R=golang-dev
CC=golang-dev, rsc
https://golang.org/cl/4975055
2011-09-07 13:55:48 -04:00
Hector Chu
7b2f214b6c gopprof: regexp fixes
Extract Windows filenames correctly.
Don't remove receivers from method names.

Fixes #2227.

R=rsc
CC=golang-dev
https://golang.org/cl/4969059
2011-09-07 13:53:29 -04:00
Luuk van Dijk
f2460a8c57 gc: treat DOTMETH like DOT in escape analysis.
Fixes #2225

R=rsc, nigeltao, dave
CC=bradfitz, golang-dev, mikioh.mikioh
https://golang.org/cl/4972056
2011-09-07 19:03:11 +02:00
Russ Cox
5ddf6255a1 gc: unify stack frame layout
allocparams + tempname + compactframe
all knew about how to place stack variables.

Now only compactframe, renamed to allocauto,
does the work.  Until the last minute, each PAUTO
variable is in its own space and has xoffset == 0.

This might break 5g.  I get failures in concurrent
code running under qemu and I can't tell whether
it's 5g's fault or qemu's.  We'll see what the real
ARM builders say.

R=ken2
CC=golang-dev
https://golang.org/cl/4973057
2011-09-06 10:24:21 -04:00
Russ Cox
919cb2ec7c gc: fix zero-length struct eval
Fixes #2232.

R=ken2
CC=golang-dev
https://golang.org/cl/4960054
2011-09-05 15:31:22 -04:00
Mike Rosset
8ddd66145e build: clear execute bit from Go files
R=golang-dev, rsc
CC=golang-dev, mike.rosset
https://golang.org/cl/4950062
2011-09-05 07:48:42 -04:00
Gustavo Niemeyer
c5670f1548 gofix: do not convert url in field names
There's some ambiguity in the U{url: url} case as it could be
both a map or a struct literal, but given context it's more
likely a struct, so U{url: url_} rather than U{url_: url_}.
At least that was the case for me.

R=golang-dev, rsc, adg
CC=golang-dev
https://golang.org/cl/4972052
2011-09-03 16:01:54 -03:00
Hector Chu
9b011500c0 runtime: implement exception handling on windows/amd64
Fixes #2194.

R=rsc, alex.brainman, vcc.163, jp
CC=golang-dev
https://golang.org/cl/4977044
2011-09-03 18:27:16 +10:00
Russ Cox
9854fd2a0e gc: introduce temp = nod+tempname
R=ken2
CC=golang-dev
https://golang.org/cl/4967052
2011-09-02 15:35:16 -04:00
Russ Cox
c45c0c0c1d gc: zero stack-allocated slice backing arrays
Fixes Han-Wen's termite bug.

R=lvd
CC=golang-dev
https://golang.org/cl/4977052
2011-09-02 15:11:28 -04:00
Robert Griesemer
cd6f319a76 godoc: minor tweaks for app-engine use
- read search index files in groutine to avoid
  start-up failure on app engine because reading
  the files takes too long
- permit usage of search index files and indexer
- minor cosmetic cleanups

R=dsymonds
CC=golang-dev
https://golang.org/cl/4952050
2011-09-02 10:07:29 -07:00
Andrew Gerrand
3fa7226de7 goinstall: better usage message
Fixes #2185.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4967046
2011-09-02 10:07:47 +10:00
Russ Cox
60d47101aa gc: fix label recursion bugs
Was keeping a pointer to the labeled statement in n->right,
which meant that generic traversals of the tree visited it twice.
That combined with aggressive flattening of the block
structure when possible during parsing meant that
the kinds of label: code label: code label: code sequences
generated by yacc were giving the recursion 2ⁿ paths
through the program.

Fixes #2212.

R=lvd
CC=golang-dev
https://golang.org/cl/4960050
2011-09-01 13:44:46 -04:00
Robert Griesemer
3f1269ff1e godoc: more index size reduction
- KindRuns don't need to repeat SpotKind,
  it is stored in each Spot
- removed extra indirection from FileRuns
  to KindRuns
- slight reduction of written index size
  (~500KB)

R=rsc
CC=golang-dev
https://golang.org/cl/4969052
2011-08-31 14:01:58 -07:00
Russ Cox
0c9ea63b3b cgo: explain how to free something
R=golang-dev, n13m3y3r, r
CC=golang-dev
https://golang.org/cl/4958053
2011-08-31 08:17:01 -04:00
Russ Cox
335da67e00 gc: make static initialization more static
Does as much as possible in data layout instead
of during the init function.

Handles var x = y; var y = z as a special case too,
because it is so prevalent in package unicode
(var Greek = _Greek; var _Greek = []...).

Introduces InitPlan description of initialized data
so that it can be traversed multiple times (for example,
in the copy handler).

Cuts package unicode's init function size by 8x.
All that remains there is map initialization, which
is on the chopping block too.

Fixes sinit.go test case.

Aggregate DATA instructions at end of object file.

Checkpoint.  More to come.

R=ken2
CC=golang-dev
https://golang.org/cl/4969051
2011-08-31 07:37:14 -04:00
Russ Cox
4304de6e0c runtime: make arm work on Ubuntu Natty qemu
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4963050
2011-08-31 07:02:46 -04:00
Gustavo Niemeyer
0cfa0fe242 cgo: note that CString result must be freed
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/4968054
2011-08-31 06:44:55 -03:00
Robert Griesemer
40f0a0d759 godoc index: first step towards reducing index size
- canonicalize package descriptors
- remove duplicate storage of file paths
- reduces (current) written index file by approx 3.5MB
(from 28434237B to 24686643B, or 13%)

- next step: untangle DAG (when serializing, using
gob, the index dag explodes into an index tree)

R=dsymonds
CC=golang-dev
https://golang.org/cl/4983042
2011-08-30 18:47:15 -07:00
Lucio De Re
4ca2172f38 gc: fix for Plan 9 build
R=golang-dev
CC=golang-dev, rsc
https://golang.org/cl/4977045
2011-08-30 09:40:46 -04:00
Russ Cox
4fb3c4f765 gc: fix div bug
R=ken2
CC=golang-dev
https://golang.org/cl/4950052
2011-08-30 08:47:28 -04:00
Lucio De Re
2d489e67dc gc: fix for Plan 9 build
R=golang-dev
CC=golang-dev, rsc
https://golang.org/cl/4975044
2011-08-30 08:00:07 -04:00
Robert Griesemer
d01ee38fb0 godoc: support for reading/writing (splitted) index files.
This CL implements a new godoc feature to save the search
index on disk. Use -write_index to create the search
index file named with -index_files. Use -index_files to
provide a glob pattern specifying index file(s) when
starting godoc; in this case the run-time indexer is not
run.

Known issues:
- saving/restoring full text index is not yet supported
- the list of flags and overall usage logic could use a
  cleanup

R=rsc, dsymonds
CC=golang-dev
https://golang.org/cl/4974045
2011-08-29 17:22:20 -07:00
Robert Griesemer
6b90262870 godoc: fix bug in zip.go
The result of sort.Search is in the interval [0,n);
specifically, if no entry is found, the result is n
and not -1.

R=dsymonds
CC=golang-dev
https://golang.org/cl/4982041
2011-08-29 16:49:31 -07:00
Andrew Gerrand
58b05e2448 goinstall: select the tag that is closest to runtime.Version
release.r50 looks for newest tag <= go.r50
weekly.2010-10-10 looks for newest tag <= go.2010-10-10

Implements behavior for hg, git, and bzr.

R=dsymonds, rsc, n13m3y3r
CC=golang-dev
https://golang.org/cl/4873057
2011-08-30 09:37:22 +10:00
Mateusz Czapliński
eae0a48cf5 libmach: support reading symbols from Windows .exe for nm
Fixes #979.

R=rsc, alex.brainman
CC=golang-dev, vcc.163
https://golang.org/cl/4894051
2011-08-29 14:25:43 -04:00
Yuval Pavel Zholkover
c20a338c2f runtime, syscall: use the vdso page on linux x86 for faster syscalls instead of int $0x80.
8l: fix handling CALL $(constant) code generated by 8a.
8a,8l: add indirect call instruction: CALL *data(SB).

R=rsc, iant
CC=golang-dev
https://golang.org/cl/4817054
2011-08-29 10:36:06 -04:00
Lucio De Re
b3cc4897be gc: fix build on Plan 9
gc/bits.c
. improved format with associated cast;
gc/closure.c
gc/dcl.c
gc/range.c
gc/reflect.c
gc/sinit.c
. dropped unnecessary assignments;
gc/gen.c
. dropped unnecessary assignment;
. added static qualifier to local function definition;
gc/go.h
. added varargck pragmas;
gc/lex.c
. used {} instead of ; in if statement to suppress warning;
. replaced exit(0) with exits(0);
. added compilation conditions for SIGBUS/SIGSEGV;
. dropped unnecessary assignment;
gc/mparith2.c
. dropped four unnecessary assignments/initialisations;
gc/obj.c
. added type cast to local pointer;
gc/pgen.c
. added cast and related print format;
gc/subr.c
. replaced exit(1) with exits("error");
. replaced unlink() with remove();
. renamed local cistrmp() as ucistrmp() to remove conflict with
  Plan 9 function by the same name;
gc/swt.c
. added braces instead of ; as empty statment;
gc/typecheck.c
. added static qualifier to local function definition;
. dropped unnecessary assignments;
gc/walk.c
. dropped unnecessary assignments;
. added static qualifier to local function definitions;

R=rsc
CC=golang-dev
https://golang.org/cl/4964046
2011-08-29 09:35:04 -04:00