Commit Graph

9095 Commits

Author SHA1 Message Date
Brad Fitzpatrick
6075206904 log: more locking
This didn't actually cause a bug, but looks wrong.

There was a lock but there was more shared mutable state not
guarded by it.

R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/4760047
2011-07-17 15:46:00 -07:00
Rob Pike
c705701c69 exp/templates: variable scope persists until "end".
The previous CL doicumented and diagnosed the old situation.
This one changes it to something more traditional: any action
may declare a variable, and the block structure of scopes
applies only to control seequences.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4748047
2011-07-17 13:31:59 +10:00
Rob Pike
331840f509 exp/template: allow declaration of variables only inside control structures.
In simple pipelines the declaration has no scope.
Also document the scope.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4761044
2011-07-17 12:32:00 +10:00
Russ Cox
e07c6e6ee7 http: fixes for sniffing
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4753044
2011-07-15 12:07:37 -04:00
Lucio De Re
4c6280b0f1 6a, 6c, 6l: fix for Plan 9 build
6a/a.h:
. Dropped <u.h> and <libc.h>.
. Made definition of EOF conditional.

6a/a.y:
. Added <u.h> and <libc.h>.

6a/lex.c:
. Added <u.h> and <libc.h>.
. Dropped <ctype.h> (now in <u.h>).

6c/gc.h:
. Added varargck pragma for "lD".

6c/swt.c:
. Dropped unused "thestring" argument in Bprint() calls.

6l/Makefile:
. Dropped unneeded directory prefix.

6l/l.h:
. Dropped unneeded directory prefix.
. Added varargck pragma for "I" and "i".

6l/obj.c:
. Dropped unneeded assignment.
. Dropped unreachable goto statement.

6l/pass.c:
. Dropped assignments flagged as unused.

6l/prof.c:
. Replaced "#if 0" with "#ifdef NOTDEF".

6l/span.c:
. Dropped unused incrementation.
. Added USED() as required.
. Dropped unreachable "return" statement.

R=golang-dev
CC=golang-dev, rsc
https://golang.org/cl/4747044
2011-07-15 11:58:39 -04:00
Lucio De Re
5ea4d73b17 5a, 5c, 5l: fix for Plan 9 build
5a/a.h:
. Removed <u.h> and <lib.h>.
. Made definition of EOF conditional.

5a/a.y:
. Added <u.h> and <lib.h>.

5a/lex.c:
. Added <u.h> and <lib.h>.
. Dropped <ctype.h> (now in <u.h>).

5c/peep.c:
. Removed unnecessary "return 0" statement.

5c/reg.c:
. Added compilation condition around unused code.

5c/swt.c:
. Removed unused "thestring" argument from Bprint() calls.

5l/asm.c:
. Added USED() statements as required.
. Adjusted a few format specifications.
. Added compilation condition around unused code.

5l/l.h:
. Dropped directory prefix from <../5l/5.out.h>.
. Added varargck pragma for "I" and "i".

5l/obj.c:
. Cascaded consecutive "if" statements.
. Dropped unnecessary incrementation and assignments.

5l/pass.c:
. Dropped unnecessary assignment.

5l/prof.c:
. #if 0 converted to #ifdef NOTDEF.

5l/span.c:
. Dropped unnecessary incrementation and assignments.

R=golang-dev
CC=golang-dev, rsc
https://golang.org/cl/4752041
2011-07-15 11:58:28 -04:00
Lucio De Re
0490eb60bb 8l: nits
8l/Makefile:
. Dropped unnecessary prefix from "../8l/8.out.h"

8l/l.h:
. Dropped unnecessary prefix from "../8l/8.out.h"
. Dropped unused and inconsistent "I" vararg pragma.

R=golang-dev
CC=golang-dev, rsc
https://golang.org/cl/4754041
2011-07-15 11:51:59 -04:00
Dmitriy Vyukov
491aa1579d runtime: native xadd for 386/amd64
benchmark                          old ns/op    new ns/op    delta
BenchmarkSemaUncontended               37.40        34.10   -8.82%
BenchmarkSemaUncontended-2             18.90        17.70   -6.35%
BenchmarkSemaUncontended-4             11.90        10.90   -8.40%
BenchmarkSemaUncontended-8              6.26         5.19  -17.09%
BenchmarkSemaUncontended-16             4.39         3.91  -10.93%
BenchmarkSemaSyntNonblock              38.00        35.30   -7.11%
BenchmarkSemaSyntNonblock-2            83.00        46.70  -43.73%
BenchmarkSemaSyntNonblock-4           124.00       101.00  -18.55%
BenchmarkSemaSyntNonblock-8           124.00       116.00   -6.45%
BenchmarkSemaSyntNonblock-16          148.00       114.00  -22.97%

(on HP Z600 2 x Xeon E5620, 8 HT cores, 2.40GHz)

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4755041
2011-07-15 11:27:16 -04:00
Luuk van Dijk
8cf8806d31 gc: some enhancements to printing debug info.
R=rsc
CC=golang-dev
https://golang.org/cl/4710046
2011-07-15 16:00:05 +02:00
Russ Cox
e1b2e20217 http: sniffing placeholder
R=dsymonds
CC=golang-dev
https://golang.org/cl/4746041
2011-07-15 01:01:49 -04:00
Andrew Gerrand
5d929a9c92 go/build: less aggressive failure when GOROOT not found
R=golang-dev, rsc, dsymonds
CC=golang-dev
https://golang.org/cl/4743041
2011-07-15 13:45:22 +10:00
Russ Cox
29125be5c7 runtime: make TestSideEffectOrder work twice
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4714045
2011-07-14 23:43:03 -04:00
Brad Fitzpatrick
fc7b42325a cgi: make test less flaky
Previously, during the anti-zombie test, a
CGI process had to finish within ~625ms.
Now it gets ~5.6 seconds.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4741041
2011-07-14 17:00:14 -07:00
Robert Griesemer
48f598a393 go/printer: simplify internal state
No formatting changes.

R=rsc
CC=golang-dev
https://golang.org/cl/4735042
2011-07-14 16:09:15 -07:00
Robert Griesemer
38a53c7ecb go spec: (up-)date
R=rsc, bradfitz, r
CC=golang-dev
https://golang.org/cl/4738042
2011-07-14 15:58:37 -07:00
Robert Griesemer
90564a9256 go/printer: changed max. number of newlines from 3 to 2
manual changes in src/pkg/go/printer, src/cmd/gofix/signal_test.go
(cd src/cmd/gofix/testdata; gofmt -w *.in *.out)
(cd src/pkg/go/printer; gotest -update)
gofmt -w misc src

runs all tests

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4715041
2011-07-14 14:39:40 -07:00
Russ Cox
58e19aa4cb go: require { } around else block
R=gri, ken, r
CC=golang-dev
https://golang.org/cl/4721044
2011-07-14 17:15:52 -04:00
Brad Fitzpatrick
3f53475c97 json: add omitempty struct tag option
Fixes #2032

R=rsc, dsymonds, r, r
CC=golang-dev
https://golang.org/cl/4709044
2011-07-14 11:54:55 -07:00
Robert Griesemer
8d73781f8b godoc: fix build (add Makefile change)
R=bradfitz
CC=golang-dev
https://golang.org/cl/4733041
2011-07-14 11:48:23 -07:00
Robert Griesemer
df68a61c9e godoc: support for file systems stored in .zip files
Instead of serving files of the underlying OS file system,
a .zip file may be provided to godoc containing the files
to serve; for instance:

   godoc -http=:6060 -zip=go.zip

using a .zip file created from a clean tree as follows:

   zip -r go.zip $GOROOT

R=rsc
CC=golang-dev
https://golang.org/cl/4670053
2011-07-14 11:34:53 -07:00
Luuk van Dijk
e8ff9a624f gc: fix closure bug
Fixes #2056.

R=rsc
CC=golang-dev
https://golang.org/cl/4709042
2011-07-14 18:13:39 +02:00
David Symonds
cbad580e9c json: escape < and > in any JSON string.
Angle brackets can trigger some browser sniffers, causing
some forms of JSON output to be interpreted as HTML.
Escaping angle brackets closes that security hole.

R=rsc
CC=golang-dev
https://golang.org/cl/4701047
2011-07-14 13:30:08 +10:00
Rob Pike
fc1f0bd5e9 exp/template: allow range actions to declare a key and element variable.
{{range $key, $element := pipeline}}
This CL is smaller than it looks due to some rearrangement and renaming.

R=rsc, r
CC=golang-dev
https://golang.org/cl/4709047
2011-07-14 13:15:55 +10:00
Russ Cox
aec89c4c40 mime: fix build
R=bradfitz
CC=golang-dev
https://golang.org/cl/4695060
2011-07-13 20:04:12 -07:00
David Symonds
a16ad6fe0f exp/template: escape < and > in JS escaper.
Angle brackets can trigger some browser sniffers,
causing some output to be interpreted as HTML.
Escaping angle brackets closes that security hole.

R=r
CC=golang-dev
https://golang.org/cl/4714044
2011-07-14 12:02:58 +10:00
Rob Pike
dfffc7a5d5 exp/template: include function name in error returned by function or method call.
R=golang-dev, rsc, r
CC=golang-dev
https://golang.org/cl/4711049
2011-07-14 11:32:06 +10:00
Rob Pike
19e207d24d exp/template: simplify method and function calls by using the value's Method
rather than the type's, so a method's invocation works the same as a function's.

R=golang-dev, rsc, r
CC=golang-dev
https://golang.org/cl/4704049
2011-07-14 11:00:23 +10:00
Mikio Hara
689a2ec8c3 json: allow using '$' and '-' as the struct field's tag
R=adg, rsc, bradfitz, mattn.jp, gustavo
CC=golang-dev
https://golang.org/cl/4625081
2011-07-13 17:41:33 -07:00
Rob Pike
125e8277d5 reflect: trivial addition: Value.NumMethod.
Just an oversight it was missing.

R=rsc, dsymonds, bradfitz, r
CC=golang-dev
https://golang.org/cl/4695059
2011-07-14 10:38:15 +10:00
Yuval Pavel Zholkover
0bf36ce8fb os: Plan 9: add Process.Signal as a way to send notes.
Move the Signal interface from exec_posix.go to exec.go.
Remove some unsused code from file_plan9.go.

R=fshahriar, rsc
CC=golang-dev
https://golang.org/cl/4683044
2011-07-13 16:29:37 -07:00
Alex Brainman
dde435587d runtime: correct FixedStack value (fixes windows build)
Fixes #2068.

R=rsc
CC=golang-dev
https://golang.org/cl/4705046
2011-07-14 09:13:39 +10:00
Lucio De Re
3f2cc8ba7e cc: fixes for Plan 9 build
<ctype.h> has been moved into <u.h>, specifically to be able to
drop it from these modules.

Will someone check platforms other than UBUNTU/386, please?

R=bsiegert, rsc
CC=golang-dev
https://golang.org/cl/4648078
2011-07-13 16:01:29 -07:00
Brad Fitzpatrick
8ba48fb5ca fix build from e904b6784768 breakage
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4696047
2011-07-13 15:48:57 -07:00
Russ Cox
aebfd63cd9 syscall: add Flock on Linux
Fixes #2069.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4703048
2011-07-13 15:34:36 -07:00
Russ Cox
a16baf0777 syscall: change missing from windows net fixes
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4701045
2011-07-13 15:34:21 -07:00
Robert Griesemer
f4acaa8ecd filepath/path: fix a comment
R=bradfitz
CC=golang-dev
https://golang.org/cl/4704047
2011-07-13 15:10:50 -07:00
Rob Pike
469e333106 exp/template: tweak behavior of booleans.
Russ suggested this technique, making the "and" and "or" functions handier.
But it's hacky, and I can be talked out of it.

R=dsymonds, rsc
CC=golang-dev
https://golang.org/cl/4698044
2011-07-14 07:59:04 +10:00
Rob Pike
c3344d61bd exp/template: allow niladic methods inside chained field references.
Also really fix the bug about dot vs. receivers.

R=rsc, r
CC=golang-dev
https://golang.org/cl/4705047
2011-07-14 07:52:07 +10:00
Yasuhiro Matsumoto
2012290c7e http: fix Content-Type of file extension.
ServeFile() pass empty string to serveFile(). serveFile() should get
file extension via joining root and filename.

R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/4654089
2011-07-13 14:39:33 -07:00
Wei Guangjing
350504559e net: windows/amd64 port
R=rsc, alex.brainman
CC=golang-dev
https://golang.org/cl/3790044
2011-07-13 12:44:21 -07:00
Matthew Horsnell
932db13e93 debug/elf: Read ELF Program headers.
NewFile has been fixed to read ELF Program headers into the structs.
Added test coverage.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4628062
2011-07-13 12:34:29 -07:00
Russ Cox
ceb4377556 A+C: Matthew Horsnell (individual CLA)
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/4700044
2011-07-13 12:33:03 -07:00
Wei Guangjing
a6e60916c1 runtime: stdcall_raw stack 16byte align for Win64
R=alex.brainman, rsc
CC=golang-dev
https://golang.org/cl/4681049
2011-07-13 11:44:44 -07:00
Dmitriy Vyukov
86a659cad0 runtime: fix data race during Itab hash update/lookup
The data race is on newly published Itab nodes, which are
both unsafely published and unsafely acquired. It can
break on IA-32/Intel64 due to compiler optimizations
(most likely not an issue as of now) and on ARM due to
hardware memory access reorderings.

R=rsc
CC=golang-dev
https://golang.org/cl/4673055
2011-07-13 11:22:41 -07:00
Brad Fitzpatrick
dcdaeebdfb docs: fix wrong it's -> its
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/4702046
2011-07-13 10:54:51 -07:00
Sam Thorogood
e3a773479d exp/regexp/syntax: add Prog.NumCap
R=rsc, r
CC=golang-dev
https://golang.org/cl/4662083
2011-07-13 10:15:00 -07:00
Robert Griesemer
4c986d86b1 exp/eval, exp/ogle: remove packages eval and ogle
An externally maintained version of exp/eval can
be found at: https://bitbucket.org/binet/go-eval/ .

R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/4695047
2011-07-13 09:40:53 -07:00
Bobby Powers
050d839df0 gob: register more slice types
Without explicitly registering slice types, gob fails to encode
map[string]interface{} instances where the value is a slice,
failing with a message such as:

  gob: type not registered for interface: []string

Fixes #2065.

R=golang-dev, gri, r
CC=golang-dev
https://golang.org/cl/4672056
2011-07-13 17:12:17 +10:00
Nigel Tao
d360e0213d html: update section references in comments to the latest HTML5 spec.
R=r
CC=golang-dev
https://golang.org/cl/4699048
2011-07-13 16:53:02 +10:00
Rob Pike
9415cd1d79 C+A: Bobby Powers <bobbypowers@gmail.com>
R=golang-dev, dsymonds
CC=bobbypowers, golang-dev
https://golang.org/cl/4695050
2011-07-13 16:10:12 +10:00